[ { "name": "acc.atomic.capture", "summary": "performs an atomic capture", "description": "This operation performs an atomic capture.\n\n The region has the following allowed forms:\n\n ```\n acc.atomic.capture {\n acc.atomic.update ...\n acc.atomic.read ...\n acc.terminator\n }\n\n acc.atomic.capture {\n acc.atomic.read ...\n acc.atomic.update ...\n acc.terminator\n }\n\n acc.atomic.capture {\n acc.atomic.read ...\n acc.atomic.write ...\n acc.terminator\n }\n ```", "operands": [ { "name": "ifCond", "type": "Optional" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n )\n $region attr-dict" }, { "name": "acc.atomic.read", "summary": "performs an atomic read", "description": "This operation performs an atomic read.\n\n The operand `x` is the address from where the value is atomically read.\n The operand `v` is the address where the value is stored after reading.", "operands": [ { "name": "x", "type": "OpenACC_PointerLikeType" }, { "name": "v", "type": "OpenACC_PointerLikeType" }, { "name": "ifCond", "type": "Optional" } ], "attributes": [ { "name": "element_type", "type": "TypeAttr" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n )\n $v `=` $x\n `:` type($v) `,` type($x) `,` $element_type\n attr-dict" }, { "name": "acc.atomic.update", "summary": "performs an atomic update", "description": "This operation performs an atomic update.\n\n The operand `x` is exactly the same as the operand `x` in the OpenACC\n Standard (OpenACC 3.3, section 2.12). It is the address of the variable\n that is being updated. `x` is atomically read/written.\n\n The region describes how to update the value of `x`. It takes the value at\n `x` as an input and must yield the updated value. Only the update to `x` is\n atomic. Generally the region must have only one instruction, but can\n potentially have more than one instructions too. The update is sematically\n similar to a compare-exchange loop based atomic update.\n\n The syntax of atomic update operation is different from atomic read and\n atomic write operations. This is because only the host dialect knows how to\n appropriately update a value. For example, while generating LLVM IR, if\n there are no special `atomicrmw` instructions for the operation-type\n combination in atomic update, a compare-exchange loop is generated, where\n the core update operation is directly translated like regular operations by\n the host dialect. The front-end must handle semantic checks for allowed\n operations.", "operands": [ { "name": "x", "type": "OpenACC_PointerLikeType" }, { "name": "ifCond", "type": "Optional" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n )\n $x `:` type($x)\n $region attr-dict" }, { "name": "acc.atomic.write", "summary": "performs an atomic write", "description": "This operation performs an atomic write.\n\n The operand `x` is the address to where the `expr` is atomically\n written w.r.t. multiple threads. The evaluation of `expr` need not be\n atomic w.r.t. the write to address. In general, the type(x) must\n dereference to type(expr).", "operands": [ { "name": "x", "type": "OpenACC_PointerLikeType" }, { "name": "expr", "type": "AnyType" }, { "name": "ifCond", "type": "Optional" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n )\n $x `=` $expr\n `:` type($x) `,` type($expr)\n attr-dict" }, { "name": "acc.attach", "summary": "Represents acc attach semantics which updates a pointer in device memory with the corresponding device address of the pointee.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.bounds", "summary": "Represents normalized bounds information for acc data clause.", "description": "This operation is used to record bounds used in acc data clause in a\n normalized fashion (zero-based). This works well with the `PointerLikeType`\n requirement in data clauses - since a `lowerbound` of 0 means looking\n at data at the zero offset from pointer.\n\n The operation must have an `upperbound` or `extent` (or both are allowed -\n but not checked for consistency). When the source language's arrays are\n not zero-based, the `startIdx` must specify the zero-position index.\n\n The `stride` represents the distance between consecutive elements. For\n multi-dimensional arrays, the `stride` for each outer dimension must account\n for the complete size of all inner dimensions.\n\n The `strideInBytes` flag indicates that the `stride` is specified in bytes\n rather than the number of elements.\n\n Examples below show copying a slice of 10-element array except first element.\n Note that the examples use extent in data clause for C++ and upperbound\n for Fortran (as per 2.7.1). To simplify examples, the constants are used\n directly in the acc.bounds operands - this is not the syntax of operation.\n\n C++:\n ```\n int array[10];\n #pragma acc copy(array[1:9])\n ```\n =>\n ```mlir\n acc.bounds lb(1) ub(9) extent(9) startIdx(0) stride(1)\n ```\n\n Fortran:\n ```\n integer :: array(1:10)\n !$acc copy(array(2:10))\n ```\n =>\n ```mlir\n acc.bounds lb(1) ub(9) extent(9) startIdx(1) stride(1)\n ```", "operands": [ { "name": "lowerbound", "type": "Optional" }, { "name": "upperbound", "type": "Optional" }, { "name": "extent", "type": "Optional" }, { "name": "stride", "type": "Optional" }, { "name": "startIdx", "type": "Optional" } ], "results": [ { "name": "result", "type": "OpenACC_DataBoundsType" } ], "attributes": [ { "name": "strideInBytes", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `lowerbound` `(` $lowerbound `:` type($lowerbound) `)`\n | `upperbound` `(` $upperbound `:` type($upperbound) `)`\n | `extent` `(` $extent `:` type($extent) `)`\n | `stride` `(` $stride `:` type($stride) `)`\n | `startIdx` `(` $startIdx `:` type($startIdx) `)`\n ) attr-dict" }, { "name": "acc.cache", "summary": "Represents the cache directive that is associated with a loop.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.compute_region", "summary": "Compute region for GPU execution", "description": "The `acc.compute_region` operation wraps a region of code that will be\n compiled and executed on a GPU. It is typically produced by lowering\n OpenACC compute constructs (`acc.parallel`, `acc.kernels`, `acc.serial`)\n but can also be targeted directly by other frontends or lowered from\n other constructs that benefit from the automatic parallelization and data\n mapping facilities that the `acc` dialect provides. It serves as the\n bridge between the high-level representation and the `gpu.launch`\n operation.\n\n The operation is `IsolatedFromAbove`: all values used inside the\n region must be explicitly captured. Values are captured in two ways:\n\n - Launch arguments (`launch`): Results of `acc.par_width`\n operations that define the parallel launch configuration. These\n become `index`-typed block arguments representing the parallel\n width for each dimension.\n\n - Input arguments (`ins`): Arbitrary values captured from outside\n the region (data pointers, scalars, etc.). These become block\n arguments with their original types.\n\n The `origin` attribute records which construct produced this compute\n region (e.g., `\"acc.parallel\"`, `\"acc.kernels\"`). This is intended to\n be solely informational.\n\n Canonicalization may simplify `ins` captures: duplicate `ins` operands\n (same SSA value threaded more than once) are merged by reusing the first\n block argument, and unused `ins` operands (block arguments with no uses)\n are removed. `launch` operands are never merged or dropped.\n\n Example:\n\n ```mlir\n %w0 = acc.par_width %c128 {par_dim = #acc.par_dim}\n %w1 = acc.par_width %c8 {par_dim = #acc.par_dim}\n acc.compute_region launch(%arg0 = %w0, %arg1 = %w1)\n ins(%arg2 = %data) : (memref<1024xf32>) {\n %c0 = arith.constant 0 : index\n %c1 = arith.constant 1 : index\n %c1024 = arith.constant 1024 : index\n scf.parallel (%iv) = (%c0) to (%c1024) step (%c1) {\n %v = memref.load %arg2[%iv] : memref<1024xf32>\n scf.reduce\n } {acc.par_dims = #acc}\n acc.yield\n } {origin = \"acc.parallel\"}\n ```", "operands": [ { "name": "launchArgs", "type": "Variadic" }, { "name": "inputArgs", "type": "Variadic" }, { "name": "stream", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "origin", "type": "StrAttr" }, { "name": "kernel_func_name", "type": "OptionalAttr" }, { "name": "kernel_module_name", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" }, { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "acc.copyin", "summary": "Represents copyin semantics for acc data clauses like acc copyin and acc copy.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.copyout", "summary": "Represents acc copyout semantics - reverse of copyin.", "description": "- `varPtr`: The address of variable to copy back to.- `accVar`: The acc variable. This is the link from the data-entry\n operation used.\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, always, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data exit operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($accVar, type($accVar))\n (`bounds` `(` $bounds^ `)` )?\n (`async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)^)?\n `to` custom($var) `:` custom(type($var), $varType)\n attr-dict" }, { "name": "acc.create", "summary": "Represents create semantics for acc data clauses like acc create and acc copyout.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.data", "summary": "data construct", "description": "The \"acc.data\" operation represents a data construct. It defines vars to\n be allocated in the current device memory for the duration of the region,\n whether data should be copied from local memory to the current device\n memory upon region entry , and copied from device memory to local memory\n upon region exit.\n\n Example:\n\n ```mlir\n acc.data present(%a: memref<10x10xf32>, %b: memref<10x10xf32>,\n %c: memref<10xf32>, %d: memref<10xf32>) {\n // data region\n }\n ```\n\n `async` and `wait` operands are supported with `device_type` information.\n They should only be accessed by the extra provided getters. If modified,\n the corresponding `device_type` attributes must be modified as well.", "operands": [ { "name": "ifCond", "type": "Optional" }, { "name": "asyncOperands", "type": "Variadic" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "waitOperandsSegments", "type": "OptionalAttr" }, { "name": "waitOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "hasWaitDevnum", "type": "OptionalAttr>" }, { "name": "waitOnly", "type": "OptionalAttr>" }, { "name": "defaultAttr", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n | `wait` `` custom($waitOperands, type($waitOperands),\n $waitOperandsDeviceType, $waitOperandsSegments, $hasWaitDevnum,\n $waitOnly)\n )\n $region attr-dict-with-keyword" }, { "name": "acc.declare", "summary": "declare implicit region", "description": "The \"acc.declare\" operation represents an implicit declare region in\n function (and subroutine in Fortran).\n\n Example:\n\n ```mlir\n %pa = acc.present varPtr(%a : memref<10x10xf32>) -> memref<10x10xf32>\n acc.declare dataOperands(%pa: memref<10x10xf32>) {\n // implicit region\n }\n ```", "operands": [ { "name": "dataClauseOperands", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n $region attr-dict-with-keyword" }, { "name": "acc.declare_device_resident", "summary": "Represents acc declare device_resident semantics.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.declare_enter", "summary": "declare directive - entry to implicit data region", "description": "The \"acc.declare_enter\" operation represents the OpenACC declare directive\n and captures the entry semantics to the implicit data region.\n This operation is modeled similarly to \"acc.enter_data\".\n\n Example showing `acc declare create(a)`:\n\n ```mlir\n %0 = acc.create varPtr(%a : !llvm.ptr) -> !llvm.ptr\n acc.declare_enter dataOperands(%0 : !llvm.ptr)\n ```", "operands": [ { "name": "dataClauseOperands", "type": "Variadic" } ], "results": [ { "name": "token", "type": "OpenACC_DeclareTokenType" } ], "assemblyFormat": "oilist(\n `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n )\n attr-dict-with-keyword" }, { "name": "acc.declare_exit", "summary": "declare directive - exit from implicit data region", "description": "The \"acc.declare_exit\" operation represents the OpenACC declare directive\n and captures the exit semantics from the implicit data region.\n This operation is modeled similarly to \"acc.exit_data\".\n\n Example showing `acc declare device_resident(a)`:\n\n ```mlir\n %0 = acc.getdeviceptr varPtr(%a : !llvm.ptr) -> !llvm.ptr {dataClause = #acc}\n acc.declare_exit dataOperands(%0 : !llvm.ptr)\n acc.delete accPtr(%0 : !llvm.ptr) {dataClause = #acc}\n ```", "operands": [ { "name": "token", "type": "Optional" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `token` `(` $token `)` |\n `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n )\n attr-dict-with-keyword" }, { "name": "acc.declare_link", "summary": "Represents acc declare link semantics.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.delete", "summary": "Represents acc delete semantics - reverse of create.", "description": "- `accVar`: The acc variable. This is the link from the data-entry\n operation used.\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, always, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data exit operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($accVar, type($accVar))\n (`bounds` `(` $bounds^ `)` )?\n (`async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)^)?\n attr-dict" }, { "name": "acc.detach", "summary": "Represents acc detach semantics - reverse of attach.", "description": "- `accVar`: The acc variable. This is the link from the data-entry\n operation used.\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, always, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data exit operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($accVar, type($accVar))\n (`bounds` `(` $bounds^ `)` )?\n (`async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)^)?\n attr-dict" }, { "name": "acc.deviceptr", "summary": "Specifies that the variable pointer is a device pointer.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.enter_data", "summary": "enter data operation", "description": "The \"acc.enter_data\" operation represents the OpenACC enter data directive.\n\n Example:\n\n ```mlir\n acc.enter_data create(%d1 : memref<10xf32>) attributes {async}\n ```", "operands": [ { "name": "ifCond", "type": "Optional" }, { "name": "asyncOperand", "type": "Optional" }, { "name": "waitDevnum", "type": "Optional" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "async", "type": "UnitAttr" }, { "name": "wait", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n | `async` `` custom($asyncOperand,\n type($asyncOperand), $async)\n | `wait_devnum` `(` $waitDevnum `:` type($waitDevnum) `)`\n | `wait` `` custom($waitOperands,\n type($waitOperands), $wait)\n | `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n )\n attr-dict-with-keyword" }, { "name": "acc.exit_data", "summary": "exit data operation", "description": "The \"acc.exit_data\" operation represents the OpenACC exit data directive.\n\n Example:\n\n ```mlir\n acc.exit_data delete(%d1 : memref<10xf32>) attributes {async}\n ```", "operands": [ { "name": "ifCond", "type": "Optional" }, { "name": "asyncOperand", "type": "Optional" }, { "name": "waitDevnum", "type": "Optional" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "async", "type": "UnitAttr" }, { "name": "wait", "type": "UnitAttr" }, { "name": "finalize", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n | `async` `` custom($asyncOperand,\n type($asyncOperand), $async)\n | `wait_devnum` `(` $waitDevnum `:` type($waitDevnum) `)`\n | `wait` `` custom($waitOperands,\n type($waitOperands), $wait)\n | `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n )\n attr-dict-with-keyword" }, { "name": "acc.firstprivate", "summary": "Represents firstprivate semantic for the acc firstprivate clause.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.firstprivate_map", "summary": "Represents the mapping of the initial value for firstprivate semantics.", "description": "The `acc.firstprivate_map` operation is an intermediate representation\n used during the decomposition of `acc.firstprivate` operations. It\n represents the mapping of the initial value from the host to the device,\n which is then used to initialize per-thread private copies.\n\n This operation is distinct from `acc.copyin` because:\n - `acc.copyin` includes present counter updates, but private variables\n do not impact reference counters\n - The mapped value is used to initialize private copies rather than\n being accessed directly", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.firstprivate.recipe", "summary": "privatization recipe", "description": "Declares an OpenACC privatization recipe with copy of the initial value.\n The operation requires two mandatory regions and one optional.\n\n 1. The initializer region specifies how to allocate and initialize a new\n private value. For example in Fortran, a derived-type might have a\n default initialization. The region has an argument that contains the\n original value that needs to be privatized, followed by bounds arguments\n (if any) in order from innermost to outermost dimension. The region must\n yield the privatized copy.\n 2. The copy region specifies how to copy the initial value to the newly\n created private value. It takes the original value, the privatized\n value, followed by bounds arguments (if any) in the same order.\n 3. The destroy region specifies how to destruct the value when it reaches\n its end of life. It takes the original value, the privatized value, and\n bounds arguments (if any) in the same order. It is optional.\n\n A single privatization recipe can be used for multiple operand if they have\n the same type and do not require a specific default initialization.\n\n Example:\n\n ```mlir\n acc.firstprivate.recipe @firstprivate_memref : memref<10x20xf32> init {\n ^bb0(%original: memref<10x20xf32>):\n // init region contains a sequence of operations to create and\n // initialize the copy. It yields the privatized copy.\n %alloca = memref.alloca() : memref<10x20xf32>\n acc.yield %alloca : memref<10x20xf32>\n } copy {\n ^bb0(%original: memref<10x20xf32>, %privatized: memref<10x20xf32>):\n // copy region contains a sequence of operations to copy the initial value\n // of the firstprivate value to the newly created value.\n memref.copy %original, %privatized : memref<10x20xf32> to memref<10x20xf32>\n acc.terminator\n } destroy {\n ^bb0(%original: memref<10x20xf32>, %privatized: memref<10x20xf32>):\n // destroy region is empty since alloca is automatically cleaned up\n acc.terminator\n }\n\n // Example with bounds for array slicing:\n acc.firstprivate.recipe @firstprivate_slice : memref<10x20xf32> init {\n ^bb0(%original: memref<10x20xf32>, %bounds_inner: !acc.data_bounds_ty, %bounds_outer: !acc.data_bounds_ty):\n // Extract bounds and create appropriately sized allocation\n %extent_inner = acc.get_extent %bounds_inner : (!acc.data_bounds_ty) -> index\n %extent_outer = acc.get_extent %bounds_outer : (!acc.data_bounds_ty) -> index\n %slice_alloc = memref.alloca(%extent_outer, %extent_inner) : memref\n // ... base pointer adjustment logic ...\n acc.yield %result : memref<10x20xf32>\n } copy {\n ^bb0(%original: memref<10x20xf32>, %privatized: memref<10x20xf32>, %bounds_inner: !acc.data_bounds_ty, %bounds_outer: !acc.data_bounds_ty):\n // Copy the slice portion from original to privatized\n %lb_inner = acc.get_lowerbound %bounds_inner : (!acc.data_bounds_ty) -> index\n %lb_outer = acc.get_lowerbound %bounds_outer : (!acc.data_bounds_ty) -> index\n %extent_inner = acc.get_extent %bounds_inner : (!acc.data_bounds_ty) -> index\n %extent_outer = acc.get_extent %bounds_outer : (!acc.data_bounds_ty) -> index\n %subview = memref.subview %original[%lb_outer, %lb_inner][%extent_outer, %extent_inner][1, 1]\n : memref<10x20xf32> to memref>\n // Copy subview to privatized...\n acc.terminator\n }\n\n // The privatization symbol is then used in the corresponding operation.\n acc.parallel firstprivate(@firstprivate_memref -> %a : memref<10x20xf32>) {\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" } ], "regions": [ { "name": "initRegion", "type": "AnyRegion" }, { "name": "copyRegion", "type": "AnyRegion" }, { "name": "destroyRegion", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name `:` $type attr-dict-with-keyword `init` $initRegion\n `copy` $copyRegion\n (`destroy` $destroyRegion^)?" }, { "name": "acc.get_extent", "summary": "Extract extent from OpenACC data bounds.", "description": "This operation extracts the extent value from an `acc.bounds` value.\n If the data bounds does not have an extent specified, it is computed\n from the upperbound.\n\n Example:\n ```mlir\n %extent = acc.get_extent %bounds : (!acc.data_bounds_ty) -> index\n ```", "operands": [ { "name": "bounds", "type": "OpenACC_DataBoundsType" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$bounds attr-dict `:` `(` type($bounds) `)` `->` type($result)" }, { "name": "acc.get_lowerbound", "summary": "Extract lowerbound from OpenACC data bounds.", "description": "This operation extracts the lowerbound value from an `acc.bounds` value.\n If the data bounds does not have a lowerbound specified, it means it is zero.\n\n Example:\n ```mlir\n %lb = acc.get_lowerbound %bounds : (!acc.data_bounds_ty) -> index\n ```", "operands": [ { "name": "bounds", "type": "OpenACC_DataBoundsType" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$bounds attr-dict `:` `(` type($bounds) `)` `->` type($result)" }, { "name": "acc.get_stride", "summary": "Extract stride from OpenACC data bounds.", "description": "This operation extracts the stride value from an `acc.bounds` value.\n If the data bounds does not have a stride specified, it defaults to 1.\n\n Example:\n ```mlir\n %stride = acc.get_stride %bounds : (!acc.data_bounds_ty) -> index\n ```", "operands": [ { "name": "bounds", "type": "OpenACC_DataBoundsType" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$bounds attr-dict `:` `(` type($bounds) `)` `->` type($result)" }, { "name": "acc.get_upperbound", "summary": "Extract upperbound from OpenACC data bounds.", "description": "This operation extracts the upperbound value from an `acc.bounds` value.\n If the data bounds does not have an upperbound specified, this operation\n uses the extent to compute it.\n\n Example:\n ```mlir\n %ub = acc.get_upperbound %bounds : (!acc.data_bounds_ty) -> index\n ```", "operands": [ { "name": "bounds", "type": "OpenACC_DataBoundsType" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$bounds attr-dict `:` `(` type($bounds) `)` `->` type($result)" }, { "name": "acc.getdeviceptr", "summary": "Gets device address if variable exists on device.", "description": "This operation is used to get the `accPtr` for a variable. This is often\n used in conjunction with data exit operations when the data entry\n operation is not visible. This operation can have a `dataClause` argument\n that is any of the valid `mlir::acc::DataClause` entries.\n \\Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.global_ctor", "summary": "Used to hold construction operations associated with globals such as declare", "description": "The \"acc.global_ctor\" operation is used to capture OpenACC actions to apply\n on globals (such as `acc declare`) at the entry to the implicit data region.\n This operation is isolated and intended to be used in a module.\n\n Example showing `declare create` of global:\n\n ```mlir\n llvm.mlir.global external @globalvar() : i32 {\n %0 = llvm.mlir.constant(0 : i32) : i32\n llvm.return %0 : i32\n }\n acc.global_ctor @acc_constructor {\n %0 = llvm.mlir.addressof @globalvar : !llvm.ptr\n %1 = acc.create varPtr(%0 : !llvm.ptr) -> !llvm.ptr\n acc.declare_enter dataOperands(%1 : !llvm.ptr)\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name $region attr-dict-with-keyword" }, { "name": "acc.global_dtor", "summary": "Used to hold destruction operations associated with globals such as declare", "description": "The \"acc.global_dtor\" operation is used to capture OpenACC actions to apply\n on globals (such as `acc declare`) at the exit from the implicit data\n region. This operation is isolated and intended to be used in a module.\n\n Example showing delete associated with `declare create` of global:\n\n ```mlir\n llvm.mlir.global external @globalvar() : i32 {\n %0 = llvm.mlir.constant(0 : i32) : i32\n llvm.return %0 : i32\n }\n acc.global_dtor @acc_destructor {\n %0 = llvm.mlir.addressof @globalvar : !llvm.ptr\n %1 = acc.getdeviceptr varPtr(%0 : !llvm.ptr) -> !llvm.ptr {dataClause = #acc}\n acc.declare_exit dataOperands(%1 : !llvm.ptr)\n acc.delete accPtr(%1 : !llvm.ptr) {dataClause = #acc}\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name $region attr-dict-with-keyword" }, { "name": "acc.gpu_shared_memory", "summary": "GPU workgroup (shared) memory allocation in a compute region", "description": "Represents a GPU workgroup-memory allocation in a compute region.\n The result is a typed `memref` view into a byte slab which is later\n replaced by `memref.view` into a dynamic shared-memory blob at the\n byte offset within the workgroup allocation.\n\n Each operation occupies a distinct slot in that collective allocation.\n `static_upper_bound_bytes` is the conservative byte-size upper bound for\n the slot. `dynamic_sizes` supply values for dynamic memref result\n dimensions. The in-kernel layout of the slot is given by\n `static_upper_bound_bytes` and `dynamic_sizes`.\n\n Optional `dynamic_shared_memory_scaling_bytes` and\n `dynamic_shared_memory_fixed_bytes` parameterize\n `dynamic_shared_memory_size` when the slot footprint depends on launch\n geometry. They must be specified together. When present:\n\n dynamic_shared_memory_size =\n dynamic_shared_memory_scaling_bytes * W\n + dynamic_shared_memory_fixed_bytes\n\n where `W` is the launch width that scales the allocation.\n\n This linear model arises for `acc.cache` regions with dynamic bounds: one\n cache dimension grows with the thread-parallel launch width, while\n `dynamic_shared_memory_fixed_bytes` covers bytes that do not scale (for\n example overlap cells at cache tile boundaries so threads can read\n neighboring source elements without extra global memory traffic).\n For a 1D dynamic cache with stencil extent `E`:\n\n dynamic_shared_memory_fixed_bytes =\n (E - 1) * dynamic_shared_memory_scaling_bytes\n\n ```\n Global array: ... | a | b | c | d | e | f | ...\n [---- cached tile ----]\n Thread 0 primary: a (reads neighbor b)\n Thread 1 primary: b (reads neighbors a, c)\n ...\n Scaling portion: dynamic_shared_memory_scaling_bytes * W\n Fixed portion: dynamic_shared_memory_fixed_bytes ((E - 1) cells)\n ```\n\n The scaling attributes affect only `dynamic_shared_memory_size`, not\n the slot layout. For purely static allocations both are omitted and\n `dynamic_shared_memory_size` is the sum of aligned\n `static_upper_bound_bytes` across all slots.\n\n Example:\n\n ```mlir\n %sz = arith.constant 128 : index\n %cache = acc.gpu_shared_memory(%sz)\n {num_copies = 1 : i64,\n static_upper_bound_bytes = 1560 : i64,\n dynamic_shared_memory_scaling_bytes = 12 : i64,\n dynamic_shared_memory_fixed_bytes = 24 : i64}\n : (index) -> memref>\n ```", "operands": [ { "name": "dynamic_sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "num_copies", "type": "I64Attr" }, { "name": "static_upper_bound_bytes", "type": "I64Attr" }, { "name": "dynamic_shared_memory_scaling_bytes", "type": "OptionalAttr" }, { "name": "dynamic_shared_memory_fixed_bytes", "type": "OptionalAttr" } ], "assemblyFormat": "(`(` $dynamic_sizes^ `)`)? attr-dict `:` functional-type(operands, results)" }, { "name": "acc.host_data", "summary": "host_data construct", "description": "The \"acc.host_data\" operation represents the OpenACC host_data construct.\n\n Example:\n\n ```mlir\n %0 = acc.use_device varPtr(%a : !llvm.ptr) -> !llvm.ptr\n acc.host_data dataOperands(%0 : !llvm.ptr) {\n\n }\n ```", "operands": [ { "name": "ifCond", "type": "Optional" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "ifPresent", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n | `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n )\n $region attr-dict-with-keyword" }, { "name": "acc.init", "summary": "init operation", "description": "The \"acc.init\" operation represents the OpenACC init executable\n directive.\n\n Example:\n\n ```mlir\n acc.init\n acc.init device_num(%dev1 : i32)\n ```", "operands": [ { "name": "deviceNum", "type": "Optional" }, { "name": "ifCond", "type": "Optional" } ], "attributes": [ { "name": "device_types", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(`device_num` `(` $deviceNum `:` type($deviceNum) `)`\n | `if` `(` $ifCond `)`\n ) attr-dict-with-keyword" }, { "name": "acc.kernel_environment", "summary": "Decomposition of compute constructs to capture data mapping and asynchronous behavior information", "description": "The `acc.kernel_environment` operation represents a decomposition of\n any OpenACC compute construct (acc.kernels, acc.parallel, or\n acc.serial) that captures data mapping and asynchronous behavior:\n - data clause operands\n - async clause operands\n - wait clause operands\n\n This allows kernel execution parallelism and privatization to be\n handled separately, facilitating eventual lowering to GPU dialect where\n kernel launching and compute offloading are handled separately.", "operands": [ { "name": "dataClauseOperands", "type": "Variadic" }, { "name": "asyncOperand", "type": "Optional" }, { "name": "waitDevnum", "type": "Optional" }, { "name": "waitOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOnly", "type": "UnitAttr" }, { "name": "waitOnly", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n | `async` `` custom($asyncOperand,\n type($asyncOperand), $asyncOnly)\n | `wait_devnum` `(` $waitDevnum `:` type($waitDevnum) `)`\n | `wait` `` custom($waitOperands,\n type($waitOperands), $waitOnly)\n )\n $region attr-dict" }, { "name": "acc.kernels", "summary": "kernels construct", "description": "The \"acc.kernels\" operation represents a kernels construct block. It has\n one region to be compiled into a sequence of kernels for execution on the\n current device.\n\n Example:\n\n ```mlir\n acc.kernels num_gangs(%c10) num_workers(%c10)\n private(%c : memref<10xf32>) {\n // kernels region\n }\n ```\n\n `collapse`, `gang`, `worker`, `vector`, `seq`, `independent`, `auto` and\n `tile` operands are supported with `device_type` information. They should\n only be accessed by the extra provided getters. If modified, the\n corresponding `device_type` attributes must be modified as well.", "operands": [ { "name": "asyncOperands", "type": "Variadic" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "numGangs", "type": "Variadic" }, { "name": "numWorkers", "type": "Variadic" }, { "name": "vectorLength", "type": "Variadic" }, { "name": "ifCond", "type": "Optional" }, { "name": "selfCond", "type": "Optional" }, { "name": "reductionOperands", "type": "Variadic" }, { "name": "privateOperands", "type": "Variadic" }, { "name": "firstprivateOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "waitOperandsSegments", "type": "OptionalAttr" }, { "name": "waitOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "hasWaitDevnum", "type": "OptionalAttr>" }, { "name": "waitOnly", "type": "OptionalAttr>" }, { "name": "numGangsSegments", "type": "OptionalAttr" }, { "name": "numGangsDeviceType", "type": "OptionalAttr>" }, { "name": "numWorkersDeviceType", "type": "OptionalAttr>" }, { "name": "vectorLengthDeviceType", "type": "OptionalAttr>" }, { "name": "selfAttr", "type": "UnitAttr" }, { "name": "defaultAttr", "type": "OptionalAttr" }, { "name": "combined", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "( `combined` `(` `loop` `)` $combined^)?\n oilist(\n `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `firstprivate` `(` $firstprivateOperands `:` type($firstprivateOperands) `)`\n | `num_gangs` `(` custom($numGangs,\n type($numGangs), $numGangsDeviceType, $numGangsSegments) `)`\n | `num_workers` `(` custom($numWorkers,\n type($numWorkers), $numWorkersDeviceType) `)`\n | `private` `(` $privateOperands `:` type($privateOperands) `)`\n | `vector_length` `(` custom($vectorLength,\n type($vectorLength), $vectorLengthDeviceType) `)`\n | `wait` `` custom($waitOperands, type($waitOperands),\n $waitOperandsDeviceType, $waitOperandsSegments, $hasWaitDevnum,\n $waitOnly)\n | `self` `(` $selfCond `)`\n | `if` `(` $ifCond `)`\n | `reduction` `(` $reductionOperands `:` type($reductionOperands) `)`\n )\n $region attr-dict-with-keyword" }, { "name": "acc.loop", "summary": "loop construct", "description": "The `acc.loop` operation represents the OpenACC loop construct and when\n bounds are included, the associated source language loop iterators. The\n lower and upper bounds specify a half-open range: the range includes the\n lower bound but does not include the upper bound. If the `inclusive`\n attribute is set then the upper bound is included.\n\n In cases where the OpenACC loop directive needs to capture multiple\n source language loops, such as in the case of `collapse` or `tile`,\n the multiple induction arguments are used to capture each case. Having\n such a representation makes sure no intermediate transformation such\n as Loop Invariant Code Motion breaks the property requested by the\n clause on the loop constructs.\n\n Each `acc.loop` holds private and reduction operands which are the\n ssa values from the corresponding `acc.private` or `acc.reduction`\n operations. Additionally, firstprivate operands are supported to\n represent cases where privatization is needed with initialization\n from an original value. While the OpenACC specification does not\n explicitly support firstprivate on loop constructs, this extension\n enables representing privatization scenarios that arise from an\n optimization and codegen pipeline operating on acc dialect.\n\n The operation supports capturing information that it comes combined\n constructs (e.g., `parallel loop`, `kernels loop`, `serial loop`)\n through the `combined` attribute despite requiring the `acc.loop`\n to be decomposed from the compute operation representing compute\n construct.\n\n Example:\n\n ```mlir\n acc.loop gang() vector() (%arg3 : index, %arg4 : index, %arg5 : index) =\n (%c0, %c0, %c0 : index, index, index) to \n (%c10, %c10, %c10 : index, index, index) step \n (%c1, %c1, %c1 : index, index, index) {\n // Loop body\n acc.yield\n } attributes { collapse = [3] }\n ```\n\n `collapse`, `gang`, `worker`, `vector`, `seq`, `independent`, `auto`,\n `cache`, and `tile` operands are supported with `device_type`\n information. These clauses should only be accessed through the provided\n device-type-aware getter methods. When modifying these operands, the\n corresponding `device_type` attributes must be updated to maintain\n consistency between operands and their target device types.\n\n The `unstructured` attribute indicates that the loops inside the OpenACC\n construct contain early exits and cannot be lowered to structured MLIR\n operations. When this flag is set, the acc.loop should have no induction\n variables and the loop must be implemented via explicit control flow\n inside its body.", "operands": [ { "name": "lowerbound", "type": "Variadic" }, { "name": "upperbound", "type": "Variadic" }, { "name": "step", "type": "Variadic" }, { "name": "gangOperands", "type": "Variadic" }, { "name": "workerNumOperands", "type": "Variadic" }, { "name": "vectorOperands", "type": "Variadic" }, { "name": "tileOperands", "type": "Variadic" }, { "name": "cacheOperands", "type": "Variadic" }, { "name": "privateOperands", "type": "Variadic" }, { "name": "firstprivateOperands", "type": "Variadic" }, { "name": "reductionOperands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "inclusiveUpperbound", "type": "OptionalAttr" }, { "name": "collapse", "type": "OptionalAttr>" }, { "name": "collapseDeviceType", "type": "OptionalAttr>" }, { "name": "gangOperandsArgType", "type": "OptionalAttr>" }, { "name": "gangOperandsSegments", "type": "OptionalAttr" }, { "name": "gangOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "workerNumOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "vectorOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "seq", "type": "OptionalAttr>" }, { "name": "independent", "type": "OptionalAttr>" }, { "name": "auto_", "type": "OptionalAttr>" }, { "name": "gang", "type": "OptionalAttr>" }, { "name": "worker", "type": "OptionalAttr>" }, { "name": "vector", "type": "OptionalAttr>" }, { "name": "tileOperandsSegments", "type": "OptionalAttr" }, { "name": "tileOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "combined", "type": "OptionalAttr" }, { "name": "unstructured", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "( `combined` `(` custom($combined)^ `)` )?\n oilist(\n `gang` `` custom($gangOperands, type($gangOperands),\n $gangOperandsArgType, $gangOperandsDeviceType,\n $gangOperandsSegments, $gang)\n | `worker` `` custom(\n $workerNumOperands, type($workerNumOperands),\n $workerNumOperandsDeviceType, $worker)\n | `vector` `` custom($vectorOperands,\n type($vectorOperands), $vectorOperandsDeviceType, $vector)\n | `private` `(` $privateOperands `:` type($privateOperands) `)`\n | `firstprivate` `(` $firstprivateOperands `:` type($firstprivateOperands) `)`\n | `tile` `(` custom($tileOperands,\n type($tileOperands), $tileOperandsDeviceType, $tileOperandsSegments)\n `)`\n | `reduction` `(` $reductionOperands `:` type($reductionOperands) `)`\n | `cache` `(` $cacheOperands `:` type($cacheOperands) `)`\n )\n custom($region, $lowerbound, type($lowerbound), $upperbound,\n type($upperbound), $step, type($step))\n ( `(` type($results)^ `)` )?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "acc.nocreate", "summary": "Represents acc no_create semantics.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.on_device", "summary": "acc_on_device intrinsic operation", "description": "Represents a call to the OpenACC `acc_on_device` runtime function.\n Returns whether the current thread is executing on the given device type.\n\n Example:\n\n ```mlir\n %host = arith.constant 1 : i32\n %on_host = acc.on_device %host : i32 -> i1\n ```", "operands": [ { "name": "deviceType", "type": "IntOrIndex" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$deviceType attr-dict `:` type($deviceType) `->` type($result)" }, { "name": "acc.par_width", "summary": "Specify parallel width for a GPU dimension", "description": "The `acc.par_width` operation specifies the parallel width for a\n given GPU parallel dimension. It is used as an input to\n `acc.compute_region` to define the launch configuration.\n\n The optional `launchArg` operand provides a known width value. When\n absent, the width is unknown and must be determined later (either at\n compile time by analysis or at runtime).\n\n Examples:\n\n ```mlir\n // Known width from SSA value\n %w1 = acc.par_width %vector_len {par_dim = #acc.par_dim}\n\n // Unknown width (to be computed later)\n %w2 = acc.par_width {par_dim = #acc.par_dim}\n ```", "operands": [ { "name": "launchArg", "type": "Optional" } ], "results": [ { "name": "output", "type": "Index" } ], "attributes": [ { "name": "par_dim", "type": "OpenACC_GPUParallelDimAttr" } ], "assemblyFormat": "($launchArg^)? attr-dict" }, { "name": "acc.parallel", "summary": "parallel construct", "description": "The \"acc.parallel\" operation represents a parallel construct block. It has\n one region to be executed in parallel on the current device.\n\n Example:\n\n ```mlir\n acc.parallel num_gangs(%c10) num_workers(%c10)\n private(%c : memref<10xf32>) {\n // parallel region\n }\n ```\n\n `async`, `wait`, `num_gangs`, `num_workers` and `vector_length` operands are\n supported with `device_type` information. They should only be accessed by\n the extra provided getters. If modified, the corresponding `device_type`\n attributes must be modified as well.", "operands": [ { "name": "asyncOperands", "type": "Variadic" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "numGangs", "type": "Variadic" }, { "name": "numWorkers", "type": "Variadic" }, { "name": "vectorLength", "type": "Variadic" }, { "name": "ifCond", "type": "Optional" }, { "name": "selfCond", "type": "Optional" }, { "name": "reductionOperands", "type": "Variadic" }, { "name": "privateOperands", "type": "Variadic" }, { "name": "firstprivateOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "waitOperandsSegments", "type": "OptionalAttr" }, { "name": "waitOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "hasWaitDevnum", "type": "OptionalAttr>" }, { "name": "waitOnly", "type": "OptionalAttr>" }, { "name": "numGangsSegments", "type": "OptionalAttr" }, { "name": "numGangsDeviceType", "type": "OptionalAttr>" }, { "name": "numWorkersDeviceType", "type": "OptionalAttr>" }, { "name": "vectorLengthDeviceType", "type": "OptionalAttr>" }, { "name": "selfAttr", "type": "UnitAttr" }, { "name": "defaultAttr", "type": "OptionalAttr" }, { "name": "combined", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "( `combined` `(` `loop` `)` $combined^)?\n oilist(\n `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `firstprivate` `(` $firstprivateOperands `:` type($firstprivateOperands) `)`\n | `num_gangs` `(` custom($numGangs,\n type($numGangs), $numGangsDeviceType, $numGangsSegments) `)`\n | `num_workers` `(` custom($numWorkers,\n type($numWorkers), $numWorkersDeviceType) `)`\n | `private` `(` $privateOperands `:` type($privateOperands) `)`\n | `vector_length` `(` custom($vectorLength,\n type($vectorLength), $vectorLengthDeviceType) `)`\n | `wait` `` custom($waitOperands, type($waitOperands),\n $waitOperandsDeviceType, $waitOperandsSegments, $hasWaitDevnum,\n $waitOnly)\n | `self` `(` $selfCond `)`\n | `if` `(` $ifCond `)`\n | `reduction` `(` $reductionOperands `:` type($reductionOperands) `)`\n )\n $region attr-dict-with-keyword" }, { "name": "acc.predicate_region", "summary": "Groups operations at intermediate loop-nest points", "description": "Groups statements within an `acc.compute_region` that sit at an\n intermediate point in a loop nest (outside a partitioned loop body,\n between or around nested loops). This grouping marks code whose execution\n scope differs from that of surrounding partitioned loops, so predication\n and synchronization can be applied correctly during lowering. Corresponds\n to OpenACC single or redundant execution at nest transitions.\n\n Example:\n ```mlir\n // !$acc parallel num_gangs(NG) vector_length(VL)\n // !$acc loop gang\n // !$acc atomic update\n // !$acc loop vector\n // !$acc atomic update\n %w_gang = acc.par_width %cNG {par_dim = #acc.par_dim}\n %w_vector = acc.par_width %cVL {par_dim = #acc.par_dim}\n acc.compute_region launch(%ng = %w_gang, %vl = %w_vector)\n ins(%arg_c1 = %c1, %arg_c2 = %c2) : (memref, memref) {\n scf.parallel (%i) = (%c1) to (%cN) step (%c1) {\n acc.predicate_region {\n acc.atomic.update %arg_c1 : memref {\n ^bb0(%old: i32):\n %one = arith.constant 1 : i32\n %sum = arith.addi %old, %one : i32\n acc.yield %sum : i32\n }\n }\n scf.parallel (%j) = (%c1) to (%cN) step (%c1) {\n acc.atomic.update %arg_c2 : memref {\n ^bb0(%old: i32):\n %one = arith.constant 1 : i32\n %sum = arith.addi %old, %one : i32\n acc.yield %sum : i32\n }\n scf.reduce\n } {acc.par_dims = #acc}\n scf.reduce\n } {acc.par_dims = #acc}\n acc.yield\n } {origin = \"acc.parallel\"}\n ```", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "acc.present", "summary": "Specifies that the variable is already present on device.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.private", "summary": "Represents private semantics for acc private clause.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.private_local", "summary": "Materialize privatized storage for the current parallelism context", "description": "Given a value of type `acc.private_type`, materializes the underlying\n storage (typically a `memref`) for the current thread / iteration. Which\n slice of the privatized allocation is selected is determined by surrounding\n parallelism assigned in the context.\n\n The result type is usually `T` (often a `memref` that matches the logical\n storage type). The result may instead use a different surface type that\n still aliases the same underlying storage as `T`; in that case passes that\n consume this operation must treat the handle type and the result type as\n describing the same storage layout.", "operands": [ { "name": "privatized", "type": "OpenACC_PrivateType" } ], "results": [ { "name": "output", "type": "AnyType" } ], "assemblyFormat": "$privatized attr-dict `:` functional-type(operands, results)" }, { "name": "acc.private.recipe", "summary": "privatization recipe", "description": "Declares an OpenACC privatization recipe. The operation requires one\n mandatory and one optional region.\n\n 1. The initializer region specifies how to allocate and initialize a new\n private value. For example in Fortran, a derived-type might have a\n default initialization. The region has an argument that contains the\n original value that needs to be privatized, followed by bounds arguments\n (if any) in order from innermost to outermost dimension. The region\n must yield the privatized copy.\n 2. The destroy region specifies how to destruct the value when it reaches\n its end of life. It takes the original value, the privatized value, and\n bounds arguments (if any) in the same order as the init region.\n\n A single privatization recipe can be used for multiple operand if they have\n the same type and do not require a specific default initialization.\n\n Example:\n\n ```mlir\n acc.private.recipe @privatization_memref : memref<10x20xf32> init {\n ^bb0(%original: memref<10x20xf32>):\n // init region contains a sequence of operations to create and\n // initialize the copy. It yields the privatized copy.\n %alloca = memref.alloca() : memref<10x20xf32>\n acc.yield %alloca : memref<10x20xf32>\n } destroy {\n ^bb0(%original: memref<10x20xf32>, %privatized: memref<10x20xf32>):\n // destroy region is empty since alloca is automatically cleaned up\n acc.terminator\n }\n\n // Example with bounds for array slicing:\n acc.private.recipe @privatization_slice : memref<10x20xf32> init {\n ^bb0(%original: memref<10x20xf32>, %bounds_inner: !acc.data_bounds_ty, %bounds_outer: !acc.data_bounds_ty):\n // Extract bounds and create appropriately sized allocation\n %extent_inner = acc.get_extent %bounds_inner : (!acc.data_bounds_ty) -> index\n %extent_outer = acc.get_extent %bounds_outer : (!acc.data_bounds_ty) -> index\n %slice_alloc = memref.alloca(%extent_outer, %extent_inner) : memref\n // ... base pointer adjustment logic ...\n acc.yield %result : memref<10x20xf32>\n } destroy {\n ^bb0(%original: memref<10x20xf32>, %privatized: memref<10x20xf32>, %bounds_inner: !acc.data_bounds_ty, %bounds_outer: !acc.data_bounds_ty):\n // Cleanup is automatic for alloca-based allocations\n acc.terminator\n }\n\n // The privatization symbol is then used in the corresponding operation.\n acc.parallel private(@privatization_memref -> %a : memref<10x20xf32>) {\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" } ], "regions": [ { "name": "initRegion", "type": "AnyRegion" }, { "name": "destroyRegion", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name `:` $type attr-dict-with-keyword `init` $initRegion\n (`destroy` $destroyRegion^)?" }, { "name": "acc.privatize", "summary": "Create a handle for privatized storage along parallel dimensions", "description": "Introduces a privatization handle for storage that varies across the active\n parallel dimensions (for example OpenACC `private` / `firstprivate` after\n recipe materialization). The handle type is `acc.private_type` where\n `T` is the logical storage type (commonly a `memref`).\n\n Optional `index` operands supply dynamic sizes when the privatized shape\n depends on SSA values (for example `memref` row lengths).\n\n The optional `acc.par_dims` attribute records which GPU parallel dimensions\n participate in the privatization.", "operands": [ { "name": "dynamicSizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "OpenACC_PrivateType" } ], "attributes": [ { "name": "par_dims", "type": "OptionalAttr" } ], "assemblyFormat": "(`(` $dynamicSizes^ `)`)? (`[` qualified($par_dims)^ `]`)? attr-dict `:` functional-type(operands, results)" }, { "name": "acc.reduction", "summary": "Represents reduction semantics for acc reduction clause.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.reduction_accumulate", "summary": "Accumulate an SSA value into a reduction variable", "description": "Accumulates a scalar SSA value into a pointer-like reduction variable.\n\n Example:\n ```mlir\n %private = memref.alloca() {acc.par_dims = #acc} : memref\n memref.store %c0, %private[] : memref\n %partial = scf.parallel (%iv) = (%c0) to (%cN) step (%c1) init (%c0) -> i32 {\n %v = memref.load %data[%iv] : memref\n scf.reduce(%v : i32) {\n ^bb0(%lhs: i32, %rhs: i32):\n %sum = arith.addi %lhs, %rhs : i32\n scf.reduce.return %sum : i32\n }\n } {acc.par_dims = #acc}\n acc.reduction_accumulate %partial to %private \n : i32 -> memref {par_dims = #acc}\n acc.reduction_combine %private into %shared : memref\n {acc.par_dims = #acc}\n ```", "operands": [ { "name": "value", "type": "AnyTypeOf<[AnyInteger, AnyFloat, AnyComplex]>" }, { "name": "memref", "type": "OpenACC_PointerLikeType" } ], "attributes": [ { "name": "reductionOperator", "type": "OpenACC_ReductionOperatorAttr{none|add|mul|max|min|iand|ior|xor|eqv|neqv|land|lor|maximumf|minimumf|maxnumf|minnumf}" }, { "name": "par_dims", "type": "OpenACC_GPUParallelDimsAttr" } ], "assemblyFormat": "$value `to` $memref $reductionOperator `:` type($value) `->` type($memref) attr-dict" }, { "name": "acc.reduction_accumulate_array", "summary": "Accumulates elements of an array", "description": "Accumulates elements of an array across the specified parallel dimension \n given an acc.bounds op.", "operands": [ { "name": "memref", "type": "OpenACC_PointerLikeTypeInterface" }, { "name": "bounds", "type": "OpenACC_DataBoundsType" } ], "attributes": [ { "name": "reductionOperator", "type": "OpenACC_ReductionOperatorAttr{none|add|mul|max|min|iand|ior|xor|eqv|neqv|land|lor|maximumf|minimumf|maxnumf|minnumf}" }, { "name": "par_dims", "type": "OpenACC_GPUParallelDimsAttr" } ], "assemblyFormat": "$memref `bounds` `(` $bounds `)` $reductionOperator `:` type($memref) attr-dict" }, { "name": "acc.reduction_combine", "summary": "Combine a reduction partial sum with its original value", "description": "This operation is a composite to do a typical update of a reduction\n variable. The intention of this operator is to facilitate codegen\n decisions (such as generate an atomic update). E.g.\n\n ```\n acc.reduction_combine %src into %dest : memref\n ```\n\n Might lower to something similar to\n\n ```\n %loadSrc = memref.load %src[] : memref\n %loadDest = memref.load %dest[] : memref\n %combine = arith.addi %loadSrc, %loadDest : i32\n memref.store %combine, %dest[] : memref\n ```\n \n The $destMemref operand is a \"pointer\" to the original reduction \n variable (typically shared). The $srcMemref operand is a \"pointer\"\n to the partial sum of the reduction (typically private).\n\n The $kind is the OpenACC reduction operator that determines how to \n accumulate the two values.", "operands": [ { "name": "destMemref", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "srcMemref", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "reductionOperator", "type": "OpenACC_ReductionOperatorAttr{none|add|mul|max|min|iand|ior|xor|eqv|neqv|land|lor|maximumf|minimumf|maxnumf|minnumf}" } ], "assemblyFormat": "$srcMemref `into` $destMemref $reductionOperator `:` type($destMemref) attr-dict" }, { "name": "acc.reduction_combine_region", "summary": "Combine a reduction private value with its original (recipe)", "description": "This operation provides materialized reduction combine code from an\n OpenACC reduction recipe. The region takes the partially reduced value(s)\n from the private reduction variable and combines them with the current\n value(s) in the original/shared reduction variable. The region is\n terminated by `acc.yield` with no operands.\n\n The destVar operand is the original/shared reduction variable.\n The srcVar operand is typically the result of acc.reduction_init.", "operands": [ { "name": "destVar", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "srcVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$srcVar `into` $destVar `:` type($srcVar) $region\n attr-dict" }, { "name": "acc.reduction_init", "summary": "Allocate and initialize a reduction variable from a recipe", "description": "This operation provides materialized allocation and initialization for a\n private reduction variable from an OpenACC reduction recipe. The region\n contains the recipe's init code and must yield a single value (the private\n reduction storage) via `acc.yield`.\n\n The var operand is the original/shared reduction variable. The\n reduction_operator specifies the reduction kind (e.g. add, mul).", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" } ], "results": [ { "name": "result", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "reductionOperator", "type": "OpenACC_ReductionOperatorAttr{none|add|mul|max|min|iand|ior|xor|eqv|neqv|land|lor|maximumf|minimumf|maxnumf|minnumf}" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$var $reductionOperator `:` type($result) $region attr-dict" }, { "name": "acc.reduction.recipe", "summary": "reduction recipe", "description": "Declares an OpenACC reduction recipe. The operation requires two\n mandatory regions and one optional region.\n\n 1. The initializer region specifies how to initialize the local reduction\n value. The region has a first argument that contains the original value\n that needs to be reduced, followed by bounds arguments (if any) in order\n from innermost to outermost dimension. It is expected to `acc.yield` the\n initialized reduction value.\n 2. The combiner region contains a sequence of operations to combine two\n values of the reduction type into one. It has the first reduction value,\n the second reduction value, followed by bounds arguments (if any) in the\n same order. It is expected to `acc.yield` the combined value.\n 3. The optional destroy region specifies how to destruct the value when it\n reaches its end of life. It takes the original value, the reduction value,\n and bounds arguments (if any) in the same order.\n\n Example:\n\n ```mlir\n acc.reduction.recipe @reduction_add_memref : memref<10x20xf32> reduction_operator init {\n ^bb0(%original: memref<10x20xf32>):\n // init region contains a sequence of operations to initialize the local\n // reduction value as specified in 2.5.15\n %alloca = memref.alloca() : memref<10x20xf32>\n %cst = arith.constant 0.0 : f32\n linalg.fill ins(%cst : f32) outs(%alloca : memref<10x20xf32>)\n acc.yield %alloca : memref<10x20xf32>\n } combiner {\n ^bb0(%lhs: memref<10x20xf32>, %rhs: memref<10x20xf32>):\n // combiner region contains a sequence of operations to combine\n // two values into one.\n linalg.add ins(%lhs, %rhs : memref<10x20xf32>, memref<10x20xf32>)\n outs(%lhs : memref<10x20xf32>)\n acc.yield %lhs : memref<10x20xf32>\n } destroy {\n ^bb0(%original: memref<10x20xf32>, %reduction: memref<10x20xf32>):\n // destroy region is empty since alloca is automatically cleaned up\n acc.terminator\n }\n\n // Example with bounds for array slicing:\n acc.reduction.recipe @reduction_add_slice : memref<10x20xf32> reduction_operator init {\n ^bb0(%original: memref<10x20xf32>, %bounds_inner: !acc.data_bounds_ty, %bounds_outer: !acc.data_bounds_ty):\n // Extract bounds and create appropriately sized allocation\n %extent_inner = acc.get_extent %bounds_inner : (!acc.data_bounds_ty) -> index\n %extent_outer = acc.get_extent %bounds_outer : (!acc.data_bounds_ty) -> index\n %slice_alloc = memref.alloca(%extent_outer, %extent_inner) : memref\n %cst = arith.constant 0.0 : f32\n linalg.fill ins(%cst : f32) outs(%slice_alloc : memref)\n // ... base pointer adjustment logic ...\n acc.yield %result : memref<10x20xf32>\n } combiner {\n ^bb0(%lhs: memref<10x20xf32>, %rhs: memref<10x20xf32>, %bounds_inner: !acc.data_bounds_ty, %bounds_outer: !acc.data_bounds_ty):\n // Extract bounds to operate only on the slice portion\n %lb_inner = acc.get_lowerbound %bounds_inner : (!acc.data_bounds_ty) -> index\n %lb_outer = acc.get_lowerbound %bounds_outer : (!acc.data_bounds_ty) -> index\n %extent_inner = acc.get_extent %bounds_inner : (!acc.data_bounds_ty) -> index\n %extent_outer = acc.get_extent %bounds_outer : (!acc.data_bounds_ty) -> index\n\n // Create subviews to access only the slice portions\n %lhs_slice = memref.subview %lhs[%lb_outer, %lb_inner][%extent_outer, %extent_inner][1, 1]\n : memref<10x20xf32> to memref>\n %rhs_slice = memref.subview %rhs[%lb_outer, %lb_inner][%extent_outer, %extent_inner][1, 1]\n : memref<10x20xf32> to memref>\n\n // Combine only the slice portions\n linalg.add ins(%lhs_slice, %rhs_slice : memref>, memref>)\n outs(%lhs_slice : memref>)\n acc.yield %lhs : memref<10x20xf32>\n }\n\n // The reduction symbol is then used in the corresponding operation.\n acc.parallel reduction(@reduction_add_memref -> %a : memref<10x20xf32>) {\n }\n ```\n\n The following table lists the valid operators and the initialization values\n according to OpenACC 3.3:\n\n |------------------------------------------------|\n | C/C++ | Fortran |\n |-----------------------|------------------------|\n | operator | init value | operator | init value |\n | + | 0 | + | 0 |\n | * | 1 | * | 1 |\n | max | least | max | least |\n | min | largest | min | largest |\n | & | ~0 | iand | all bits on |\n | | | 0 | ior | 0 |\n | ^ | 0 | ieor | 0 |\n | && | 1 | .and. | .true. |\n | || | 0 | .or. | .false. |\n | | | .eqv. | .true. |\n | | | .neqv. | .false. |\n -------------------------------------------------|", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "reductionOperator", "type": "OpenACC_ReductionOperatorAttr{none|add|mul|max|min|iand|ior|xor|eqv|neqv|land|lor|maximumf|minimumf|maxnumf|minnumf}" } ], "regions": [ { "name": "initRegion", "type": "AnyRegion" }, { "name": "combinerRegion", "type": "AnyRegion" }, { "name": "destroyRegion", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name `:` $type attr-dict-with-keyword\n `reduction_operator` $reductionOperator\n `init` $initRegion `combiner` $combinerRegion\n (`destroy` $destroyRegion^)?" }, { "name": "acc.routine", "summary": "acc routine operation", "description": "The `acc.routine` operation is used to capture the clauses of acc\n routine directive, including the associated function name. The associated\n function keeps track of its corresponding routine declaration through\n the `RoutineInfoAttr`.\n\n Example:\n\n ```mlir\n func.func @acc_func(%a : i64) -> () attributes \n {acc.routine_info = #acc.routine_info<[@acc_func_rout1]>} {\n return\n }\n acc.routine @acc_func_rout1 func(@acc_func) gang\n ```\n\n `bind`, `gang`, `worker`, `vector` and `seq` operands are supported with\n `device_type` information. They should only be accessed by the extra\n provided getters. If modified, the corresponding `device_type` attributes\n must be modified as well.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "func_name", "type": "SymbolRefAttr" }, { "name": "bindIdName", "type": "OptionalAttr>" }, { "name": "bindStrName", "type": "OptionalAttr>" }, { "name": "bindIdNameDeviceType", "type": "OptionalAttr>" }, { "name": "bindStrNameDeviceType", "type": "OptionalAttr>" }, { "name": "worker", "type": "OptionalAttr>" }, { "name": "vector", "type": "OptionalAttr>" }, { "name": "seq", "type": "OptionalAttr>" }, { "name": "nohost", "type": "UnitAttr" }, { "name": "implicit", "type": "UnitAttr" }, { "name": "gang", "type": "OptionalAttr>" }, { "name": "gangDim", "type": "OptionalAttr>" }, { "name": "gangDimDeviceType", "type": "OptionalAttr>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name `func` `(` $func_name `)`\n oilist (\n `bind` `(` custom($bindIdName, $bindStrName ,$bindIdNameDeviceType, $bindStrNameDeviceType) `)`\n | `gang` `` custom($gang, $gangDim, $gangDimDeviceType)\n | `worker` custom($worker)\n | `vector` custom($vector)\n | `seq` custom($seq)\n | `nohost` $nohost\n | `implicit` $implicit\n ) attr-dict-with-keyword" }, { "name": "acc.serial", "summary": "serial construct", "description": "The \"acc.serial\" operation represents a serial construct block. It has\n one region to be executed in serial on the current device.\n\n Example:\n\n ```mlir\n acc.serial private(%c : memref<10xf32>) {\n // serial region\n }\n ```\n\n `async` and `wait` operands are supported with `device_type` information.\n They should only be accessed by the extra provided getters. If modified,\n the corresponding `device_type` attributes must be modified as well.", "operands": [ { "name": "asyncOperands", "type": "Variadic" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "ifCond", "type": "Optional" }, { "name": "selfCond", "type": "Optional" }, { "name": "reductionOperands", "type": "Variadic" }, { "name": "privateOperands", "type": "Variadic" }, { "name": "firstprivateOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "waitOperandsSegments", "type": "OptionalAttr" }, { "name": "waitOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "hasWaitDevnum", "type": "OptionalAttr>" }, { "name": "waitOnly", "type": "OptionalAttr>" }, { "name": "selfAttr", "type": "UnitAttr" }, { "name": "defaultAttr", "type": "OptionalAttr" }, { "name": "combined", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "( `combined` `(` `loop` `)` $combined^)?\n oilist(\n `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `firstprivate` `(` $firstprivateOperands `:` type($firstprivateOperands) `)`\n | `private` `(` $privateOperands `:` type($privateOperands) `)`\n | `wait` `` custom($waitOperands, type($waitOperands),\n $waitOperandsDeviceType, $waitOperandsSegments, $hasWaitDevnum,\n $waitOnly)\n | `self` `(` $selfCond `)`\n | `if` `(` $ifCond `)`\n | `reduction` `(` $reductionOperands `:` type($reductionOperands) `)`\n )\n $region attr-dict-with-keyword" }, { "name": "acc.set", "summary": "set operation", "description": "The \"acc.set\" operation represents the OpenACC set directive.\n\n Example:\n\n ```mlir\n acc.set device_num(%dev1 : i32)\n ```", "operands": [ { "name": "defaultAsync", "type": "Optional" }, { "name": "deviceNum", "type": "Optional" }, { "name": "ifCond", "type": "Optional" } ], "attributes": [ { "name": "device_type", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(`default_async` `(` $defaultAsync `:` type($defaultAsync) `)`\n | `device_num` `(` $deviceNum `:` type($deviceNum) `)`\n | `if` `(` $ifCond `)`\n ) attr-dict-with-keyword" }, { "name": "acc.shutdown", "summary": "shutdown operation", "description": "The \"acc.shutdown\" operation represents the OpenACC shutdown executable\n directive.\n\n Example:\n\n ```mlir\n acc.shutdown\n acc.shutdown device_num(%dev1 : i32)\n ```", "operands": [ { "name": "deviceNum", "type": "Optional" }, { "name": "ifCond", "type": "Optional" } ], "attributes": [ { "name": "device_types", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(`device_num` `(` $deviceNum `:` type($deviceNum) `)`\n |`if` `(` $ifCond `)`\n ) attr-dict-with-keyword" }, { "name": "acc.terminator", "summary": "Generic terminator for OpenACC regions", "description": "A terminator operation for regions that appear in the body of OpenACC\n operation. Generic OpenACC construct regions are not expected to return any\n value so the terminator takes no operands. The terminator op returns control\n to the enclosing op.", "assemblyFormat": "attr-dict" }, { "name": "acc.unwrap_private", "summary": "Unwrap acc.private_type handle to pointer-like storage", "description": "Converts a privatization handle (`acc.private_type`) to a pointer-like\n view of the underlying private storage.", "operands": [ { "name": "handle", "type": "OpenACC_PrivateType" } ], "results": [ { "name": "result", "type": "OpenACC_PointerLikeType" } ], "assemblyFormat": "$handle attr-dict `:` qualified(type($handle)) `to` type($result)" }, { "name": "acc.update", "summary": "update operation", "description": "The `acc.update` operation represents the OpenACC update executable\n directive.\n As host and self clauses are synonyms, any operands for host and self are\n add to $hostOperands.\n\n Example:\n\n ```mlir\n acc.update device(%d1 : memref<10xf32>) attributes {async}\n ```\n\n `async` and `wait` operands are supported with `device_type` information.\n They should only be accessed by the extra provided getters. If modified,\n the corresponding `device_type` attributes must be modified as well.", "operands": [ { "name": "ifCond", "type": "Optional" }, { "name": "asyncOperands", "type": "Variadic" }, { "name": "waitOperands", "type": "Variadic" }, { "name": "dataClauseOperands", "type": "Variadic" } ], "attributes": [ { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "waitOperandsSegments", "type": "OptionalAttr" }, { "name": "waitOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "hasWaitDevnum", "type": "OptionalAttr>" }, { "name": "waitOnly", "type": "OptionalAttr>" }, { "name": "ifPresent", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `if` `(` $ifCond `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `wait` `` custom($waitOperands, type($waitOperands),\n $waitOperandsDeviceType, $waitOperandsSegments, $hasWaitDevnum,\n $waitOnly)\n | `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)`\n )\n attr-dict-with-keyword" }, { "name": "acc.update_device", "summary": "Represents acc update device semantics.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.update_host", "summary": "Represents acc update host semantics.", "description": "- `varPtr`: The address of variable to copy back to.- `accVar`: The acc variable. This is the link from the data-entry\n operation used.\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, always, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data exit operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($accVar, type($accVar))\n (`bounds` `(` $bounds^ `)` )?\n (`async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)^)?\n `to` custom($var) `:` custom(type($var), $varType)\n attr-dict" }, { "name": "acc.use_device", "summary": "Represents acc use_device semantics.", "description": "Description of arguments:\n - `var`: The variable to copy. Must be either `MappableType` or\n `PointerLikeType`.\n - `varType`: The type of the variable that is being copied. When `var` is\n a `MappableType`, this matches the type of `var`. When `var` is a\n `PointerLikeType`, this type holds information about the target of the\n pointer.\n - `varPtrPtr`: Specifies the address of the address of `var` - only used\n when the variable copied is a field in a struct. This is important for\n OpenACC due to implicit attach semantics on data clauses (2.6.4).\n - `bounds`: Used when copying just slice of array or array's bounds are not\n encoded in type. They are in rank order where rank 0 is inner-most dimension.\n - `asyncOperands` and `asyncOperandsDeviceType`:\n pair-wise lists of the async clause values associated with device_type's.\n - `asyncOnly`: a list of device_type's for which async clause\n does not specify a value (default is acc_async_noval - OpenACC 3.3 2.16.1).\n - `dataClause`: Keeps track of the data clause the user used. This is because\n the acc operations are decomposed. So a 'copy' clause is decomposed to both \n `acc.copyin` and `acc.copyout` operations, but both have dataClause that\n specifies `acc_copy` in this field.\n - `structured`: Flag to note whether this is associated with structured region\n (parallel, kernels, data) or unstructured (enter data, exit data). This is\n important due to spec specifically calling out structured and dynamic reference\n counters (2.6.7).\n - `implicit`: Whether this is an implicitly generated operation, such as copies\n done to satisfy \"Variables with Implicitly Determined Data Attributes\" in 2.6.2.\n - `modifiers`: Keeps track of the data clause modifiers (eg zero, readonly, etc)\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n\n The async values attached to the data entry operation imply that the data\n action applies to all device types specified by the device_type clauses\n using the activity queues on these devices as defined by the async values.", "operands": [ { "name": "var", "type": "OpenACC_AnyPointerOrMappableType" }, { "name": "varPtrPtr", "type": "Optional" }, { "name": "bounds", "type": "Variadic" }, { "name": "asyncOperands", "type": "Variadic" } ], "results": [ { "name": "accVar", "type": "OpenACC_AnyPointerOrMappableType" } ], "attributes": [ { "name": "varType", "type": "TypeAttr" }, { "name": "asyncOperandsDeviceType", "type": "OptionalAttr>" }, { "name": "asyncOnly", "type": "OptionalAttr>" }, { "name": "dataClause", "type": "DefaultValuedAttr" }, { "name": "structured", "type": "DefaultValuedAttr" }, { "name": "implicit", "type": "DefaultValuedAttr" }, { "name": "modifiers", "type": "DefaultValuedAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "recipe", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($var) `:` custom(type($var), $varType)\n oilist(\n `varPtrPtr` `(` $varPtrPtr `:` type($varPtrPtr) `)`\n | `bounds` `(` $bounds `)`\n | `async` `` custom($asyncOperands,\n type($asyncOperands), $asyncOperandsDeviceType, $asyncOnly)\n | `recipe` `(` custom($recipe) `)`\n ) `->` type($accVar) attr-dict" }, { "name": "acc.wait", "summary": "wait operation", "description": "The \"acc.wait\" operation represents the OpenACC wait executable\n directive.\n\n Example:\n\n ```mlir\n acc.wait(%value1: index)\n acc.wait() async(%async1: i32)\n ```\n\n acc.wait does not implement MemoryEffects interface,\n so it affects all the resources. This is conservatively\n correct. More precise modelling of the memory effects\n seems to be impossible without the whole program analysis.", "operands": [ { "name": "waitOperands", "type": "Variadic" }, { "name": "asyncOperand", "type": "Optional" }, { "name": "waitDevnum", "type": "Optional" }, { "name": "ifCond", "type": "Optional" } ], "attributes": [ { "name": "async", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "( `(` $waitOperands^ `:` type($waitOperands) `)` )?\n oilist(\n `async` `` custom($asyncOperand,\n type($asyncOperand), $async)\n | `wait_devnum` `(` $waitDevnum `:` type($waitDevnum) `)`\n | `if` `(` $ifCond `)`\n ) attr-dict-with-keyword" }, { "name": "acc.yield", "summary": "Acc yield and termination operation", "description": "`acc.yield` is a special terminator operation for block inside regions in\n various acc ops (including parallel, loop, atomic.update). It returns values\n to the immediately enclosing acc op.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "affine.apply", "summary": "affine apply operation", "description": "The `affine.apply` operation applies an [affine mapping](#affine-maps)\n to a list of SSA values, yielding a single SSA value. The number of\n dimension and symbol operands to `affine.apply` must be equal to the\n respective number of dimensional and symbolic inputs to the affine mapping;\n the affine mapping has to be one-dimensional, and so the `affine.apply`\n operation always returns one value. The input operands and result must all\n have ‘index’ type.\n\n An operand that is a valid dimension as per the [rules on valid affine\n dimensions and symbols](#restrictions-on-dimensions-and-symbols)\n cannot be used as a symbolic operand.\n\n Example:\n\n ```mlir\n #map = affine_map<(d0, d1) -> (d0 floordiv 8 + d1 floordiv 128)>\n ...\n %1 = affine.apply #map (%s, %t)\n\n // Inline example.\n %2 = affine.apply affine_map<(i)[s0] -> (i + s0)> (%42)[%n]\n ```", "operands": [ { "name": "mapOperands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.delinearize_index", "summary": "delinearize an index", "description": "The `affine.delinearize_index` operation takes a single index value and\n calculates the multi-index according to the given basis.\n\n Example:\n\n ```\n %indices:3 = affine.delinearize_index %linear_index into (%c16, %c224, %c224) : index, index, index\n ```\n\n In the above example, `%indices:3` conceptually holds the following:\n\n ```\n #map0 = affine_map<()[s0] -> (s0 floordiv 50176)>\n #map1 = affine_map<()[s0] -> ((s0 mod 50176) floordiv 224)>\n #map2 = affine_map<()[s0] -> (s0 mod 224)>\n %indices_0 = affine.apply #map0()[%linear_index]\n %indices_1 = affine.apply #map1()[%linear_index]\n %indices_2 = affine.apply #map2()[%linear_index]\n ```\n\n In other words, `%0:3 = affine.delinearize_index %x into (B, C)` produces\n `%0 = {%x / (B * C), (%x mod (B * C)) / C, %x mod C}`.\n\n The basis may either contain `N` or `N-1` elements, where `N` is the number of results.\n If there are N basis elements, the first one will not be used during computations,\n but may be used during analysis and canonicalization to eliminate terms from\n the `affine.delinearize_index` or to enable conclusions about the total size of\n `%linear_index`.\n\n If the basis is fully provided, the delinearize_index operation is said to \"have\n an outer bound\". The builders assume that an `affine.delinearize_index` has\n an outer bound by default, as this is how the operation was initially defined.\n\n That is, the example above could also have been written\n ```mlir\n %0:3 = affine.delinearize_index %linear_index into (244, 244) : index, index\n ```\n\n Note that, for symmetry with `getPaddedBasis()`, if `hasOuterBound` is `true`\n when one of the `OpFoldResult` builders is called but the first element of the\n basis is `nullptr`, that first element is ignored and the builder proceeds as if\n there was no outer bound.\n\n Due to the constraints of affine maps, all the basis elements must\n be strictly positive. A dynamic basis element being 0 or negative causes\n undefined behavior.\n\n As with other affine operations, lowerings of delinearize_index may assume\n that the underlying computations do not overflow the index type in a signed sense\n - that is, the product of all basis elements is positive as an `index` as well.", "operands": [ { "name": "linear_index", "type": "Affine_IndexOrVectorOfIndex" }, { "name": "dynamic_basis", "type": "Variadic" } ], "results": [ { "name": "multi_index", "type": "Variadic" } ], "attributes": [ { "name": "static_basis", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "TypesMatchWith<'multi_index', 'linear_index', '$_self[0]'>" } ], "assemblyFormat": "$linear_index `into`\n custom($dynamic_basis, $static_basis, \"{}\", \"::mlir::AsmParser::Delimiter::Paren\")\n attr-dict `:` type($multi_index)" }, { "name": "affine.dma_start", "summary": "affine dma start operation", "description": "The `affine.dma_start` op starts a non-blocking DMA operation that\n transfers data from a source memref to a destination memref. The source and\n destination memref need not be of the same dimensionality, but need to have\n the same elemental type. The operands include the source and destination\n memref's each followed by its indices, size of the data transfer in terms of\n the number of elements (of the elemental type of the memref), a tag memref\n with its indices, and optionally at the end, a stride and a\n number_of_elements_per_stride arguments. The tag location is used by an\n `affine.dma_wait` to check for completion. The indices of the source memref,\n destination memref, and the tag memref have the same restrictions as any\n affine.load/store. In particular, index for each memref dimension must be an\n affine expression of loop induction variables and symbols.\n\n The optional stride arguments should be of 'index' type, and specify a\n stride for the slower memory space (memory space with a lower memory space\n id), transferring chunks of number_of_elements_per_stride every stride until\n %num_elements are transferred. Either both or no stride arguments should be\n specified. The value of 'num_elements' must be a multiple of\n 'number_of_elements_per_stride'. If the source and destination locations\n overlap the behavior of this operation is not defined.\n\n Example:\n\n ```mlir\n %num_elements = arith.constant 256\n %idx = arith.constant 0 : index\n %tag = memref.alloc() : memref<1xi32, 4>\n affine.dma_start %src[%i + 3, %j], %dst[%k + 7, %l], %tag[%idx],\n %num_elements :\n memref<40x128xf32, 0>, memref<2x1024xf32, 1>, memref<1xi32, 2>\n\n // If %stride and %num_elt_per_stride are specified, the DMA is expected to\n // transfer %num_elt_per_stride elements every %stride elements apart from\n // memory space 0 until %num_elements are transferred.\n affine.dma_start %src[%i, %j], %dst[%k, %l], %tag[%idx], %num_elements,\n %stride, %num_elt_per_stride : ...\n ```", "attributes": [ { "name": "src_map", "type": "AffineMapAttr" }, { "name": "dst_map", "type": "AffineMapAttr" }, { "name": "tag_map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.dma_wait", "summary": "affine dma wait operation", "description": "The `affine.dma_wait` op blocks until the completion of a DMA operation\n associated with the tag element `%tag[%index]`. `%tag` is a memref, and\n `%index` has to be an index with the same restrictions as any load/store\n index. In particular, index for each memref dimension must be an affine\n expression of loop induction variables and symbols. `%num_elements` is the\n number of elements associated with the DMA operation.\n\n Example:\n\n ```mlir\n affine.dma_start %src[%i, %j], %dst[%k, %l], %tag[%index], %num_elements :\n memref<2048xf32, 0>, memref<256xf32, 1>, memref<1xi32, 2>\n ...\n affine.dma_wait %tag[%index], %num_elements : memref<1xi32, 2>\n ```", "attributes": [ { "name": "tag_map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.for", "summary": "for operation", "description": "Syntax:\n\n ```\n operation ::= `affine.for` ssa-id `=` lower-bound `to` upper-bound\n (`step` integer-literal)? `{` op* `}`\n\n lower-bound ::= `max`? affine-map-attribute dim-and-symbol-use-list | shorthand-bound\n upper-bound ::= `min`? affine-map-attribute dim-and-symbol-use-list | shorthand-bound\n shorthand-bound ::= ssa-id | `-`? integer-literal\n ```\n\n The `affine.for` operation represents an affine loop nest. It has one region\n containing its body. This region must contain one block that terminates with\n [`affine.yield`](#affineyield-mliraffineyieldop). *Note:* when\n `affine.for` is printed in custom format, the terminator is omitted. The\n block has one argument of [`index`](Builtin.md/#indextype) type that\n represents the induction variable of the loop.\n\n The `affine.for` operation executes its body a number of times iterating\n from a lower bound to an upper bound by a stride. The stride, represented by\n `step`, is a positive constant integer which defaults to \"1\" if not present.\n The lower and upper bounds specify a half-open range: the range includes the\n lower bound but does not include the upper bound.\n\n The lower and upper bounds of a `affine.for` operation are represented as an\n application of an affine mapping to a list of SSA values passed to the map.\n The [same restrictions](#restrictions-on-dimensions-and-symbols) hold for\n these SSA values as for all bindings of SSA values to dimensions and\n symbols.\n\n The affine mappings for the bounds may return multiple results, in which\n case the `max`/`min` keywords are required (for the lower/upper bound\n respectively), and the bound is the maximum/minimum of the returned values.\n There is no semantic ambiguity, but MLIR syntax requires the use of these\n keywords to make things more obvious to human readers.\n\n Many upper and lower bounds are simple, so MLIR accepts two custom form\n syntaxes: the form that accepts a single 'ssa-id' (e.g. `%N`) is shorthand\n for applying that SSA value to a function that maps a single symbol to\n itself, e.g., `()[s]->(s)()[%N]`. The integer literal form (e.g. `-42`) is\n shorthand for a nullary mapping function that returns the constant value\n (e.g. `()->(-42)()`).\n\n Example showing reverse iteration of the inner loop:\n\n ```mlir\n #map57 = affine_map<(d0)[s0] -> (s0 - d0 - 1)>\n\n func.func @simple_example(%A: memref, %B: memref) {\n %N = dim %A, 0 : memref\n affine.for %i = 0 to %N step 1 {\n affine.for %j = 0 to %N { // implicitly steps by 1\n %0 = affine.apply #map57(%j)[%N]\n %tmp = call @F1(%A, %i, %0) : (memref, index, index)->(f32)\n call @F2(%tmp, %B, %i, %0) : (f32, memref, index, index)->()\n }\n }\n return\n }\n ```\n `affine.for` can also operate on loop-carried variables (`iter_args`) and\n return the final values after loop termination. The initial values of the\n variables are passed as additional SSA operands to the `affine.for`\n following the operands for the loop's lower and upper bounds. The\n operation's region has equivalent arguments for each variable representing\n the value of the variable at the current iteration.\n\n The region must terminate with an `affine.yield` that passes all the current\n iteration variables to the next iteration, or to the `affine.for`'s results\n if at the last iteration. For `affine.for`'s that execute zero iterations, the\n initial values of the loop-carried variables (corresponding to the SSA\n operands) will be the op's results.\n\n For example, to sum-reduce a memref:\n\n ```mlir\n func.func @reduce(%buffer: memref<1024xf32>) -> (f32) {\n // Initial sum set to 0.\n %sum_0 = arith.constant 0.0 : f32\n // iter_args binds initial values to the loop's region arguments.\n %sum = affine.for %i = 0 to 10 step 2\n iter_args(%sum_iter = %sum_0) -> (f32) {\n %t = affine.load %buffer[%i] : memref<1024xf32>\n %sum_next = arith.addf %sum_iter, %t : f32\n // Yield current iteration sum to next iteration %sum_iter or to %sum\n // if final iteration.\n affine.yield %sum_next : f32\n }\n return %sum : f32\n }\n ```\n\n ```mlir\n %res:2 = affine.for %i = 0 to 128 iter_args(%arg0 = %init0, %arg1 = %init1)\n -> (index, index) {\n %y0 = arith.addi %arg0, %c1 : index\n %y1 = arith.addi %arg1, %c2 : index\n affine.yield %y0, %y1 : index, index\n }\n ```\n If the `affine.for` defines any values, a yield terminator must be\n explicitly present. The number and types of the \"affine.for\" results must\n match the initial values in the `iter_args` binding and the yield operands.", "operands": [ { "name": "lowerBoundOperands", "type": "Variadic" }, { "name": "upperBoundOperands", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "lowerBoundMap", "type": "AffineMapAttr" }, { "name": "upperBoundMap", "type": "AffineMapAttr" }, { "name": "step", "type": "IndexAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.if", "summary": "if-then-else operation", "description": "Syntax:\n\n ```\n operation ::= `affine.if` if-op-cond `{` op* `}` (`else` `{` op* `}`)?\n if-op-cond ::= integer-set-attr dim-and-symbol-use-list\n ```\n\n The `affine.if` operation restricts execution to a subset of the loop\n iteration space defined by an integer set (a conjunction of affine\n constraints). A single `affine.if` may end with an optional `else` clause.\n\n The condition of the `affine.if` is represented by an\n [integer set](#integer-sets) (a conjunction of affine constraints),\n and the SSA values bound to the dimensions and symbols in the integer set.\n The [same restrictions](#restrictions-on-dimensions-and-symbols) hold for\n these SSA values as for all bindings of SSA values to dimensions and\n symbols.\n\n The `affine.if` operation contains two regions for the \"then\" and \"else\"\n clauses. `affine.if` may return results that are defined in its regions.\n The values defined are determined by which execution path is taken. Each\n region of the `affine.if` must contain a single block with no arguments,\n and be terminated by `affine.yield`. If `affine.if` defines no values,\n the `affine.yield` can be left out, and will be inserted implicitly.\n Otherwise, it must be explicit. If no values are defined, the else block\n may be empty (i.e. contain no blocks).\n\n Example:\n\n ```mlir\n #set = affine_set<(d0, d1)[s0]: (d0 - 10 >= 0, s0 - d0 - 9 >= 0,\n d1 - 10 >= 0, s0 - d1 - 9 >= 0)>\n func.func @reduced_domain_example(%A, %X, %N) : (memref<10xi32>, i32, i32) {\n affine.for %i = 0 to %N {\n affine.for %j = 0 to %N {\n %0 = affine.apply #map42(%j)\n %tmp = call @S1(%X, %i, %0)\n affine.if #set(%i, %j)[%N] {\n %1 = affine.apply #map43(%i, %j)\n call @S2(%tmp, %A, %i, %1)\n }\n }\n }\n return\n }\n ```\n\n Example with an explicit yield (initialization with edge padding):\n\n ```mlir\n #interior = affine_set<(i, j) : (i - 1 >= 0, j - 1 >= 0, 10 - i >= 0, 10 - j >= 0)> (%i, %j)\n func.func @pad_edges(%I : memref<10x10xf32>) -> (memref<12x12xf32) {\n %O = alloc memref<12x12xf32>\n affine.parallel (%i, %j) = (0, 0) to (12, 12) {\n %1 = affine.if #interior (%i, %j) {\n %2 = load %I[%i - 1, %j - 1] : memref<10x10xf32>\n affine.yield %2\n } else {\n %2 = arith.constant 0.0 : f32\n affine.yield %2 : f32\n }\n affine.store %1, %O[%i, %j] : memref<12x12xf32>\n }\n return %O\n }\n ```", "operands": [ { "name": "condition", "type": "IntegerSetAttr" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "thenRegion", "type": "SizedRegion<1>" }, { "name": "elseRegion", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.linearize_index", "summary": "linearize an index", "description": "The `affine.linearize_index` operation takes a sequence of index values and a\n basis of the same length and linearizes the indices using that basis.\n\n That is, for indices `%idx_0` to `%idx_{N-1}` and basis elements `b_0`\n (or `b_1`) up to `b_{N-1}` it computes\n\n ```\n sum(i = 0 to N-1) %idx_i * product(j = i + 1 to N-1) B_j\n ```\n\n In other words, `%0 = affine.linearize_index [%z, %y, %x] by (Z, Y, X)`\n gives `%0 = %x + %y * X + %z * X * Y`, or `%0 = %x + X * (%y + Y * (%z))`.\n\n The basis may either have `N` or `N-1` elements, where `N` is the number of\n inputs to linearize_index. If `N` inputs are provided, the first one is not used\n in computation, but may be used during analysis or canonicalization as a bound\n on `%idx_0`.\n\n If all `N` basis elements are provided, the linearize_index operation is said to\n \"have an outer bound\".\n\n As a convenience, and for symmetry with `getPaddedBasis()`, if the first\n element of a set of `OpFoldResult`s passed to the builders of this operation is\n `nullptr`, that element is ignored.\n\n If the `disjoint` property is present, this is an optimization hint that,\n for all `i`, `0 <= %idx_i < B_i` - that is, no index affects any other index,\n except that `%idx_0` may be negative to make the index as a whole negative.\n In addition, `disjoint` is an assertion that all bases elements are non-negative.\n\n Note that the outputs of `affine.delinearize_index` are, by definition, `disjoint`.\n\n As with other affine ops, undefined behavior occurs if the linearization\n computation overflows in the signed sense.\n\n Example:\n\n ```mlir\n %linear_index = affine.linearize_index [%index_0, %index_1, %index_2] by (2, 3, 5) : index\n // Same effect\n %linear_index = affine.linearize_index [%index_0, %index_1, %index_2] by (3, 5) : index\n ```\n\n In the above example, `%linear_index` conceptually holds the following:\n\n ```mlir\n #map = affine_map<()[s0, s1, s2] -> (s0 * 15 + s1 * 5 + s2)>\n %linear_index = affine.apply #map()[%index_0, %index_1, %index_2]\n ```", "operands": [ { "name": "multi_index", "type": "Variadic" }, { "name": "dynamic_basis", "type": "Variadic" } ], "results": [ { "name": "linear_index", "type": "Affine_IndexOrVectorOfIndex" } ], "attributes": [ { "name": "static_basis", "type": "DenseI64ArrayAttr" }, { "name": "disjoint", "type": "UnitProp" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'linear_index', 'multi_index', '$_self'>" } ], "assemblyFormat": "(`disjoint` $disjoint^)? ` `\n `[` $multi_index `]` `by`\n custom($dynamic_basis, $static_basis, \"{}\", \"::mlir::AsmParser::Delimiter::Paren\")\n attr-dict `:` type($linear_index)" }, { "name": "affine.load", "summary": "affine load operation", "description": "Syntax:\n\n ```\n operation ::= ssa-id `=` `affine.load` ssa-use `[` multi-dim-affine-map-of-ssa-ids `]` `:` memref-type\n ```\n\n The `affine.load` op reads an element from a memref, where the index\n for each memref dimension is an affine expression of loop induction\n variables and symbols. The output of `affine.load` is a new value with the\n same type as the elements of the memref. An affine expression of loop IVs\n and symbols must be specified for each dimension of the memref. The keyword\n `symbol` can be used to indicate SSA identifiers which are symbolic.\n\n Example 1:\n\n ```mlir\n %1 = affine.load %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>\n ```\n\n Example 2: Uses `symbol` keyword for symbols `%n` and `%m`.\n\n ```mlir\n %1 = affine.load %0[%i0 + symbol(%n), %i1 + symbol(%m)] : memref<100x100xf32>\n ```", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.max", "summary": "max operation", "description": "The `affine.max` operation computes the maximum value result from a multi-result\n affine map.\n\n Example:\n\n ```mlir\n %0 = affine.max (d0) -> (1000, d0 + 512) (%i0) : index\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.min", "summary": "min operation", "description": "Syntax:\n\n ```\n operation ::= ssa-id `=` `affine.min` affine-map-attribute dim-and-symbol-use-list\n ```\n\n The `affine.min` operation applies an [affine mapping](#affine-expressions)\n to a list of SSA values, and returns the minimum value of all result\n expressions. The number of dimension and symbol arguments to `affine.min`\n must be equal to the respective number of dimensional and symbolic inputs to\n the affine mapping; the `affine.min` operation always returns one value. The\n input operands and result must all have 'index' type.\n\n Example:\n\n ```mlir\n %0 = affine.min affine_map<(d0)[s0] -> (1000, d0 + 512, s0)> (%arg0)[%arg1]\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.parallel", "summary": "multi-index parallel band operation", "description": "The `affine.parallel` operation represents a hyper-rectangular affine\n parallel band, defining zero or more SSA values for its induction variables.\n It has one region capturing the parallel band body. The induction variables\n are represented as arguments of this region. These SSA values always have\n type index, which is the size of the machine word. The strides, represented\n by steps, are positive constant integers which defaults to \"1\" if not\n present. The lower and upper bounds specify a half-open range: the range\n includes the lower bound but does not include the upper bound. The body\n region must contain exactly one block that terminates with `affine.yield`.\n\n The lower and upper bounds of a parallel operation are represented as an\n application of an affine mapping to a list of SSA values passed to the map.\n The same restrictions hold for these SSA values as for all bindings of SSA\n values to dimensions and symbols. The list of expressions in each map is\n interpreted according to the respective bounds group attribute. If a single\n expression belongs to the group, then the result of this expression is taken\n as a lower(upper) bound of the corresponding loop induction variable. If\n multiple expressions belong to the group, then the lower(upper) bound is the\n max(min) of these values obtained from these expressions. The loop band has\n as many loops as elements in the group bounds attributes.\n\n Each value yielded by `affine.yield` will be accumulated/reduced via one of\n the reduction methods defined in the AtomicRMWKind enum. The order of\n reduction is unspecified, and lowering may produce any valid ordering.\n Loops with a 0 trip count will produce as a result the identity value\n associated with each reduction (i.e. 0.0 for addf, 1.0 for mulf). Assign\n reductions for loops with a trip count != 1 produces undefined results.\n\n Note: Calling `AffineParallelOp::build` will create the required region and\n block, and insert the required terminator if it is trivial (i.e. no values\n are yielded). Parsing will also create the required region, block, and\n terminator, even when they are missing from the textual representation.\n\n Example (3x3 valid convolution):\n\n ```mlir\n func.func @conv_2d(%D : memref<100x100xf32>, %K : memref<3x3xf32>) -> (memref<98x98xf32>) {\n %O = memref.alloc() : memref<98x98xf32>\n affine.parallel (%x, %y) = (0, 0) to (98, 98) {\n %0 = affine.parallel (%kx, %ky) = (0, 0) to (2, 2) reduce (\"addf\") -> f32 {\n %1 = affine.load %D[%x + %kx, %y + %ky] : memref<100x100xf32>\n %2 = affine.load %K[%kx, %ky] : memref<3x3xf32>\n %3 = arith.mulf %1, %2 : f32\n affine.yield %3 : f32\n }\n affine.store %0, %O[%x, %y] : memref<98x98xf32>\n }\n return %O : memref<98x98xf32>\n }\n ```\n\n Example (tiling by potentially imperfectly dividing sizes):\n\n ```mlir\n affine.parallel (%ii, %jj) = (0, 0) to (%N, %M) step (32, 32) {\n affine.parallel (%i, %j) = (%ii, %jj)\n to (min(%ii + 32, %N), min(%jj + 32, %M)) {\n call @f(%i, %j) : (index, index) -> ()\n }\n }\n ```", "operands": [ { "name": "mapOperands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "reductions", "type": "TypedArrayAttrBase" }, { "name": "lowerBoundsMap", "type": "AffineMapAttr" }, { "name": "lowerBoundsGroups", "type": "I32ElementsAttr" }, { "name": "upperBoundsMap", "type": "AffineMapAttr" }, { "name": "upperBoundsGroups", "type": "I32ElementsAttr" }, { "name": "steps", "type": "TypedArrayAttrBase" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.prefetch", "summary": "affine prefetch operation", "description": "The `affine.prefetch` op prefetches data from a memref location described\n with an affine subscript similar to affine.load, and has three attributes:\n a read/write specifier, a locality hint, and a cache type specifier as shown\n below:\n\n ```mlir\n affine.prefetch %0[%i, %j + 5], read, locality<3>, data : memref<400x400xi32>\n ```\n\n The read/write specifier is either 'read' or 'write', the locality hint\n specifier ranges from locality<0> (no locality) to locality<3> (extremely\n local keep in cache). The cache type specifier is either 'data' or 'instr'\n and specifies whether the prefetch is performed on data cache or on\n instruction cache.", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "isWrite", "type": "BoolAttr" }, { "name": "localityHint", "type": "ConfinedAttr, IntMaxValue<3>]>" }, { "name": "isDataCache", "type": "BoolAttr" }, { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.store", "summary": "affine store operation", "description": "Syntax:\n\n ```\n operation ::= `affine.store` ssa-use, ssa-use `[` multi-dim-affine-map-of-ssa-ids `]` `:` memref-type\n ```\n\n The `affine.store` op writes an element to a memref, where the index\n for each memref dimension is an affine expression of loop induction\n variables and symbols. The `affine.store` op stores a new value which is the\n same type as the elements of the memref. An affine expression of loop IVs\n and symbols must be specified for each dimension of the memref. The keyword\n `symbol` can be used to indicate SSA identifiers which are symbolic.\n\n Example 1:\n\n ```mlir\n affine.store %v0, %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>\n ```\n\n Example 2: Uses `symbol` keyword for symbols `%n` and `%m`.\n\n ```mlir\n affine.store %v0, %0[%i0 + symbol(%n), %i1 + symbol(%m)] : memref<100x100xf32>\n ```", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.vector_load", "summary": "affine vector load operation", "description": "The `affine.vector_load` is the vector counterpart of\n [affine.load](#affineload-mliraffineloadop). It reads a slice from a\n [MemRef](Builtin.md/#memreftype), supplied as its first operand,\n into a [vector](Builtin.md/#vectortype) of the same base elemental type.\n The index for each memref dimension is an affine expression of loop induction\n variables and symbols. These indices determine the start position of the read\n within the memref. The shape of the return vector type determines the shape of\n the slice read from the memref. This slice is contiguous along the respective\n dimensions of the shape. Strided vector loads will be supported in the future.\n An affine expression of loop IVs and symbols must be specified for each\n dimension of the memref. The keyword `symbol` can be used to indicate SSA\n identifiers which are symbolic.\n\n Example 1: 8-wide f32 vector load.\n\n ```mlir\n %1 = affine.vector_load %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>, vector<8xf32>\n ```\n\n Example 2: 4-wide f32 vector load. Uses `symbol` keyword for symbols `%n` and `%m`.\n\n ```mlir\n %1 = affine.vector_load %0[%i0 + symbol(%n), %i1 + symbol(%m)] : memref<100x100xf32>, vector<4xf32>\n ```\n\n Example 3: 2-dim f32 vector load.\n\n ```mlir\n %1 = affine.vector_load %0[%i0, %i1] : memref<100x100xf32>, vector<2x8xf32>\n ```\n\n TODOs:\n * Add support for strided vector loads.\n * Consider adding a permutation map to permute the slice that is read from memory\n (see [vector.transfer_read](../Vector/#vectortransfer_read-mlirvectortransferreadop)).", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.vector_store", "summary": "affine vector store operation", "description": "The `affine.vector_store` is the vector counterpart of\n [affine.store](#affinestore-mliraffinestoreop). It writes a\n [vector](Builtin.md/#vectortype), supplied as its first operand,\n into a slice within a [MemRef](Builtin.md/#memreftype) of the same base\n elemental type, supplied as its second operand.\n The index for each memref dimension is an affine expression of loop\n induction variables and symbols. These indices determine the start position\n of the write within the memref. The shape of the input vector determines the\n shape of the slice written to the memref. This slice is contiguous along the\n respective dimensions of the shape. Strided vector stores will be supported\n in the future.\n An affine expression of loop IVs and symbols must be specified for each\n dimension of the memref. The keyword `symbol` can be used to indicate SSA\n identifiers which are symbolic.\n\n Example 1: 8-wide f32 vector store.\n\n ```mlir\n affine.vector_store %v0, %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>, vector<8xf32>\n ```\n\n Example 2: 4-wide f32 vector store. Uses `symbol` keyword for symbols `%n` and `%m`.\n\n ```mlir\n affine.vector_store %v0, %0[%i0 + symbol(%n), %i1 + symbol(%m)] : memref<100x100xf32>, vector<4xf32>\n ```\n\n Example 3: 2-dim f32 vector store.\n\n ```mlir\n affine.vector_store %v0, %0[%i0, %i1] : memref<100x100xf32>, vector<2x8xf32>\n ```\n\n TODOs:\n * Add support for strided vector stores.\n * Consider adding a permutation map to permute the slice that is written to memory\n (see [vector.transfer_write](../Vector/#vectortransfer_write-mlirvectortransferwriteop)).", "operands": [ { "name": "value", "type": "AnyVectorOfNonZeroRank" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "affine.yield", "summary": "Yield values to parent operation", "description": "The `affine.yield` yields zero or more SSA values from an affine op region and\n terminates the region. The semantics of how the values yielded are used\n is defined by the parent operation.\n If `affine.yield` has any operands, the operands must match the parent\n operation's results.\n If the parent operation defines no values, then the `affine.yield` may be\n left out in the custom syntax and the builders will insert one implicitly.\n Otherwise, it has to be present in the syntax to indicate which values are\n yielded.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "amdg.arrive_barrier", "summary": "perform the arrive operation on an mbarrier", "description": "Performs the \"arrive\" operation on an mbarrier object in shared memory. The operation requires a `count` attribute\n of at least 1, and decreases the pending arrival count of the mbarrier by the specific count. If the pending count reaches\n zero, the phase changes (is decremented in a wraparound manner) and the pending count is reloaded with the init count value. Returns the phase\n parity (0 for even, 1 for odd) of the mbarrier object prior to the \"arrive\" operation.\n\n Example:\n\n ```mlir\n ttag.arrive_barrier %barrier, 2 : !ttg.memdesc<1xi64, #shared, #smem, mutable>\n ```", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ], "assemblyFormat": "$alloc `,` $count attr-dict `:` qualified(type($alloc)) `->` type($result)" }, { "name": "amdg.async_copy_local_to_global", "summary": "copy data from local memory to global memory asynchronously", "description": "This operation copies data from local memory to global memory asynchronously.\n This is analogue to tt.store except the data are copied from local memory pointed\n to by the memory descriptor instead of a distributed tensor.\n Contiguity is the maximum number of elements that can be stored in a single vector with\n the given layout and mask.\n This allows op to use async_copy_local_to_global even if the alignment cannot be proven based on IR.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "dst", "type": "TT_PtrTensor" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "token", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" }, { "name": "contiguity", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'dst', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$src `,` $dst (`mask` $mask^)?\n oilist(`cacheModifier` `=` $cache | `evictionPolicy` `=` $evict)\n attr-dict `:` qualified(type($src)) `->` type($dst)" }, { "name": "amdg.async_copy_mbarrier_arrive", "summary": "arrive on mbarrier once all previously issued copies are completed", "description": "Performs the \"async arrive\" operation by decrementing pending account by 1 when all previous async load to LDS (particularly, not TDM) have completed.\n The instruction itself is asynchronous; it returns immediately. Decrements the barrier pending count. The update value for decrementing is fixed at 1.\n If the pending count becomes zero, the phase changes (is decremented in a wraparound manner) and the pending count is reloaded with the init count value.", "operands": [ { "name": "barrier", "type": "TTG_MemDescType" } ], "assemblyFormat": "$barrier attr-dict `:` qualified(type($barrier))" }, { "name": "amdg.async_tdm_copy_global_to_local", "summary": "Copy data based on descriptor from global memory to local memory asynchronously", "description": "This operation copies data from global memory to local memory\n asynchronously. This is analogue to tt.load except the data are copied to\n local memory pointed by `result` instead of a distributed tensor. The data\n copied depends on the global memory pointed to by `desc`. This operation\n does not support shared memory swizzling.\n\n The descriptor must be positioned beforehand by amdg.update_tensor_descriptor\n (global offset, bounds, pred); this op applies only the per-warp distribution\n and inherits `pred` from the descriptor.\n The operation can also take an optional 64bit LDS barrier address, in which case\n it sends an \"LDS atomic arrive\" to signal its completion.\n\n `warp_used_hint` is an optional i32 bitmask performance hint for\n partial TDM copy: bit `n` (LSB = warp 0) means warp `n` issues the\n instruction; bits above `num_warps - 1` must be zero. Same data\n lands in shared memory either way -- only emission changes:\n `K = popcount(hint)` warps cover the block, the rest are pred-off.\n\n For \"all warps participate\", omit the attribute (preferred) or pass\n a full bitmask `K = num_warps`; an explicit `warp_used_hint = 0` is\n rejected by the verifier.\n\n Restriction: the hint must be *axis-aligned*. Pin some warpId bit\n positions to fixed values and leave the others free; the active\n warps are exactly those with the pinned bits set accordingly.\n K = `popcount(hint)` is therefore a power of two (= 2^(number of\n free bits)). Legal: `0x0F` (warps 0..3), `0xF0` (warps 4..7),\n `0x55` / `0xAA` / `0xCC` (stride-by-`2^j`). Rejected: non\n axis-aligned patterns like `0x69` or `0x1B`.\n\n Why this shape: power-of-two K keeps the per-warp tile recalc\n (`block / K`) integer-clean, and the bit-pinning shape lets the\n per-warp offset and active-mask predicate fall out of the same\n `getFreeVariableMasks` LL machinery the no-hint path uses.\n\n PartitionedSharedEncoding additionally requires `K = popcount(hint)`\n to be a multiple of `numLogicalPieces` (the hinted path doesn't\n support multi-instruction slicing).", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "result", "type": "TTG_MemDescType" }, { "name": "barrier", "type": "Optional" } ], "results": [ { "name": "token", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "warp_used_hint", "type": "OptionalAttr" } ], "assemblyFormat": "$desc `into` $result (`,` `barrier` `=` $barrier^)?\n attr-dict `:` qualified(type($desc)) (`,` qualified(type($barrier))^)? `->` qualified(type($result))" }, { "name": "amdg.async_tdm_copy_local_to_global", "summary": "Copy data based on descriptor from local memory to global memory asynchronously", "description": "This operation copies data from local memory to global memory\n asynchronously. This is analogue to tt.store except the data are copied from\n local memory pointed by `src` instead of a distributed tensor. The copy\n destination depends on the global memory pointed to by `desc`. This\n operation does not support shared memory padding or swizzling.\n\n The descriptor must be positioned beforehand by\n amdg.update_tensor_descriptor; this op applies only the per-warp distribution.\n The operation can also take an optional 64bit LDS barrier address, in which case\n it sends an \"LDS atomic arrive\" to signal its completion.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "src", "type": "TTG_MemDescType" }, { "name": "barrier", "type": "Optional" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$desc `from` $src (`,` `barrier` `=` $barrier^)?\n attr-dict `:` qualified(type($src)) (`,` qualified(type($barrier))^)? `->` qualified(type($desc))" }, { "name": "amdg.async_tdm_gather", "summary": "Gather data from non-contiguous global memory rows to local memory asynchronously", "description": "This operation gathers data from non-contiguous rows in global memory to local\n memory using TDM gather mode.\n Unlike the regular async_tdm_copy_global_to_local which reads from contiguous memory,\n this operation uses src_row_indices to specify which rows in global memory to read from.\n\n The descriptor must be 2D. The src_row_indices specify which rows in global memory\n to read from. The element type of src_row_indices determines the index size:\n - I16: 16-bit indices, up to 16 rows per instruction\n - I32: 32-bit indices, up to 8 rows per instruction\n If more rows are needed, multiple TDM instructions will be issued.\n\n The descriptor must be positioned beforehand by amdg.update_tensor_descriptor\n (global offset / column via add_offsets, bounds, pred); this op only supplies the\n per-instruction row slices (src_row_indices) and the LDS destination, and inherits\n `pred` from the descriptor.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "src_row_indices", "type": "TensorOf<[I16, I32]>" }, { "name": "dst", "type": "TTG_MemDescType" }, { "name": "barrier", "type": "Optional" } ], "results": [ { "name": "token", "type": "TTG_AsyncToken" } ], "assemblyFormat": "$desc `[` $src_row_indices `]` `to` $dst (`,` `barrier` `=` $barrier^)?\n attr-dict `:` qualified(type($src_row_indices)) `,` qualified(type($dst)) (`,` qualified(type($barrier))^)? `->` qualified(type($desc))" }, { "name": "amdg.async_tdm_intrinsic_wait", "summary": "Wait until there are less than or equal to the given number of outstanding TDM intrinsics", "description": "This operation waits until there are less than or equal to the given number\n of outstanding TDM intrinsics (assembly instructions). This is necessary to\n ensure that data is available in LDS (load, gather) or HBM (store, scatter)\n before it is used.\n\n Unlike AsyncTDMWait which counts IR operations, this operation counts the\n actual number of TDM assembly instructions (e.g., tensor_load_to_lds,\n tensor_store_from_lds) that are emitted. Which is required for the lowering\n to LLVM.", "operands": [ { "name": "asyncToken", "type": "Variadic" } ], "results": [ { "name": "retToken", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ], "assemblyFormat": "($asyncToken^)? attr-dict" }, { "name": "amdg.async_tdm_scatter", "summary": "Scatter data from local memory to non-contiguous global memory rows asynchronously", "description": "This operation scatters data from local memory to non-contiguous rows in global\n memory using TDM scatter mode.\n Unlike the regular async_tdm_copy_local_to_global which copies to contiguous memory,\n this operation uses dst_row_indices to specify which rows in global memory to write to.\n\n The descriptor must be 2D. The dst_row_indices specify which rows in global memory\n to write to. The element type of dst_row_indices determines the index size:\n - I16: 16-bit indices, up to 16 rows per instruction\n - I32: 32-bit indices, up to 8 rows per instruction\n If more rows are needed, multiple TDM instructions will be issued.\n\n The descriptor must be positioned beforehand by amdg.update_tensor_descriptor\n (global offset / column via add_offsets, bounds); this op only supplies the\n per-instruction row slices (dst_row_indices) and the LDS source.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "dst_row_indices", "type": "TensorOf<[I16, I32]>" }, { "name": "src", "type": "TTG_MemDescType" }, { "name": "barrier", "type": "Optional" } ], "results": [ { "name": "retToken", "type": "TTG_AsyncToken" } ], "assemblyFormat": "$desc `[` $dst_row_indices `]` `from` $src (`,` `barrier` `=` $barrier^)?\n attr-dict `:` qualified(type($dst_row_indices)) `,` qualified(type($src)) (`,` qualified(type($barrier))^)? `->` qualified(type($desc))" }, { "name": "amdg.async_tdm_wait", "summary": "Wait until there are less than or equal to the given number of outstanding TDM operations", "description": "This operation waits until there are less than or equal to the given number\n of outstanding async TDM operations.\n This is necessary to ensure that data is available in the LDS (load, gather)\n or HBM (store, scatter) before it is used.\n\n This operation counts the number of TDM IR operations (AsyncTDMCopyGlobalToLocalOp,\n AsyncTDMCopyLocalToGlobalOp, AsyncTDMScatterOp, AsyncTDMGatherOp).", "operands": [ { "name": "asyncToken", "type": "Variadic" } ], "results": [ { "name": "retToken", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "num", "type": "I32Attr" } ], "assemblyFormat": "$asyncToken attr-dict" }, { "name": "amdg.async_wait", "summary": "Wait until there are less than or equal to the given number of outstanding async intrinsics", "description": "Similar to ttg.async_wait but instead of waiting on oustanding ttg.async_commit_groups\n this op waits on the number of outstanding async instructions/intrinsics as required for the\n lowering to LLVM on the AMD backend.", "operands": [ { "name": "asyncToken", "type": "Variadic" } ], "results": [ { "name": "retToken", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "num_inst", "type": "I32Attr" } ], "assemblyFormat": "($asyncToken^)? attr-dict" }, { "name": "amdg.buffer_atomic_cas", "summary": "Atomic CAS op which does compare-exchange to a scalar base pointer and a tensor offset", "description": "AMD Buffer Atomic CAS operation. Buffer atomics are similar to normal atomics, but access global memory via a\n scalar base pointer and a tensor of offsets instead of a tensor of pointers.\n Similar to TT_AtomicCASOp: Buffer atomic CAS op loads data at $ptr, and stores $val to $ptr atomically if value at $ptr equals $cmp, with\n the specified memory semantics and scope. Atomic CAS ops return the pre-op value if used, otherwise the value is implicitly dropped.\n Stride is the distance between the beginning of contiguous memory chunks. When performing a CAS, the `stride` is\n the address difference between the first elements of each row in bytes. Compiler tries to obtain the `stride`\n when it converts to the buffer ops because it is important for optimizing the cache memory access.", "operands": [ { "name": "ptr", "type": "TT_Ptr" }, { "name": "offsets", "type": "I32Tensor" }, { "name": "cmp", "type": "TT_Tensor" }, { "name": "val", "type": "TT_Tensor" }, { "name": "stride", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'result', 'val', '$_self'>" }, { "type": "TypesMatchWith<'result', 'cmp', '$_self'>" }, { "type": "TypesMatchWith<'result', 'ptr', 'getPointerTypeToElement($_self)'>" }, { "type": "TypesMatchWith<'result', 'offsets', 'getI32SameShape($_self)'>" }, { "type": "TypesMatchWith<'val', 'offsets', 'getI32SameShape($_self)'>" }, { "type": "TypesMatchWith<'val', 'cmp', '$_self'>" } ], "assemblyFormat": "$sem `,` $scope `,` $cmp `,` $val `,` $ptr `[` $offsets `]`\n (`stride` `=` $stride^)?\n attr-dict `:` type($result)" }, { "name": "amdg.buffer_atomic_rmw", "summary": "Atomic RMW op which reads, modifies, and writes to a scalar base pointer and a tensor offset", "description": "AMD Buffer atomic RMW operation. Buffer atomics are similar to normal atomics, but access global memory via a\n scalar base pointer and a tensor of offsets instead of a tensor of pointers.\n Similar to other buffer ops, the `mask` is a boolean vector that determines if a given element should be processed with\n the atomic RMW op. Elements with `mask[i] == 0` are dropped (i.e., the atomic is not executed).\n Similar to TT_AtomicRMWOp: Buffer atomic RMW ops load data at $ptr, do $rmw_op with $val, and store result to $ptr with\n the specified memory semantics and scope. Atomic RMW ops return the pre-op value if used, otherwise the value is implicitly dropped.\n Stride is the distance between the beginning of contiguous memory chunks. When performing a RMW, the `stride` is\n the address difference between the first elements of each row in bytes. Compiler tries to obtain the `stride`\n when it converts to the buffer ops because it is important for optimizing the cache memory access.", "operands": [ { "name": "ptr", "type": "TT_Ptr" }, { "name": "offsets", "type": "I32Tensor" }, { "name": "value", "type": "TT_Tensor" }, { "name": "stride", "type": "Optional" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "atomic_rmw_op", "type": "TT_AtomicRMWAttr{and|or|xor|add|fadd|max|min|umax|umin|exch}" }, { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'result', 'value', '$_self'>" }, { "type": "TypesMatchWith<'result', 'ptr', 'getPointerTypeToElement($_self)'>" }, { "type": "TypesMatchWith<'result', 'offsets', 'getI32SameShape($_self)'>" }, { "type": "TypesMatchWith<'result', 'mask', 'getI1SameShape($_self)'>" }, { "type": "TypesMatchWith<'value', 'ptr', 'getPointerTypeToElement($_self)'>" }, { "type": "TypesMatchWith<'value', 'offsets', 'getI32SameShape($_self)'>" }, { "type": "TypesMatchWith<'value', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$atomic_rmw_op `,` $sem `,` $scope `,` $value `,` $ptr `[` $offsets `]` (`,` $mask^)?\n (`stride` `=` $stride^)?\n attr-dict `:` type($result)" }, { "name": "amdg.buffer_load", "summary": "Load from a scalar base pointer and a tensor offset", "description": "AMD Buffer load operation. Buffer store is similar to\n a normal store but it accesses global memory via a scalar base pointer\n and a tensor of offsets instead of a tensor of pointers. The other fields\n are similar to a normal load, i.e., the `mask` is a boolean vector that\n determines if a given element should be read from memory, and `other` is the\n element that should be returned on lane `i` when `mask[i] == 0`.\n Stride is the distance between the beginning of contiguous memory chunks.\n When performing a load of a block, the `stride` is the address difference between\n the first elements of each row in bytes. Compiler tries to obtain the `stride`\n when it converts to the buffer ops because it is important for optimizing\n the cache memory access.\n Contiguity is the maximum number of elements that can be loaded in a single vector\n with the given layout and mask.\n This allows to use buffer_load even if the alignment cannot be proven based on IR.", "operands": [ { "name": "ptr", "type": "TT_Ptr" }, { "name": "offsets", "type": "I32Tensor" }, { "name": "stride", "type": "Optional" }, { "name": "mask", "type": "Optional" }, { "name": "other", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "contiguity", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'result', 'ptr', 'getPointerTypeToElement($_self)'>" }, { "type": "TypesMatchWith<'result', 'offsets', 'getI32SameShape($_self)'>" }, { "type": "TypesMatchWith<'result', 'mask', 'getI1SameShape($_self)'>" }, { "type": "TypesMatchWith<'result', 'other', '$_self'>" } ], "assemblyFormat": "$ptr `[` $offsets `]` (`,` $mask^)? (`,` $other^)?\n oilist(`cacheModifier` `=` $cache)\n (`stride` `=` $stride^)?\n attr-dict `:` type($result)" }, { "name": "amdg.buffer_load_to_local", "summary": "Load from a scalar base pointer and a tensor offset to shared memory", "description": "AMD Buffer load operation. Similar to amdg.buffer_load op but directly wirtes to shared memory instead of into registers.\n Contiguity is the maximum number of elements that can be loaded in a single vector with the given layout and mask.\n This allows to use buffer_load_to_local even if the alignment cannot be proven based on IR.", "operands": [ { "name": "dest", "type": "TTG_MemDescType" }, { "name": "ptr", "type": "TT_Ptr" }, { "name": "offsets", "type": "I32Tensor" }, { "name": "mask", "type": "Optional" }, { "name": "other", "type": "Optional" }, { "name": "stride", "type": "Optional" } ], "results": [ { "name": "token", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "contiguity", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'dest', 'ptr', 'getPointerTypeToElement($_self)'>" }, { "type": "TypesMatchWith<'offsets', 'mask', 'getI1SameShape($_self)'>" }, { "type": "TypesMatchWith<'offsets', 'other', 'cast($_self).clone(getPointeeType($ptr.getType()))'>" } ], "assemblyFormat": "$ptr `[` $offsets `]` (`mask` `=` $mask^)? (`other` `=` $other^)? (`stride` `=` $stride^)?\n oilist(`cacheModifier` `=` $cache) `into` $dest\n attr-dict `:` type($ptr) `[` type($offsets) `]` type($other) `->` type($dest)" }, { "name": "amdg.buffer_store", "summary": "Store into scalar base pointer and a tensor offset", "description": "AMD Buffer store operation. Buffer store is similar to\n normal store but it accesses global memory via a scalar base pointer\n and a tensor of offsets instead of a tensor of pointers. The other fields\n are similar to a normal store , i.e., the `mask` is a boolean vector that\n determines if a given element should be written to memory, and `value` is the\n tensor of elements that should be written on lane `i` when `mask[i] == 1`.\n Stride is the distance between the beginning of contiguous memory chunks.\n When performing a block store, the `stride` is the address difference between\n the first elements of each row in bytes. Compiler tries to obtain the `stride`\n when it converts to the buffer ops because it is important for optimizing\n the cache memory access.\n Contiguity is the maximum number of elements that can be loaded in a single vector\n with the given layout and mask.\n This allows to use buffer_store even if the alignment cannot be proven based on IR.", "operands": [ { "name": "value", "type": "TT_Tensor" }, { "name": "ptr", "type": "TT_Ptr" }, { "name": "offsets", "type": "I32Tensor" }, { "name": "stride", "type": "Optional" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "contiguity", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'value', 'ptr', 'getPointerTypeToElement($_self)'>" }, { "type": "TypesMatchWith<'value', 'offsets', 'getI32SameShape($_self)'>" }, { "type": "TypesMatchWith<'value', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$value `,` $ptr `[` $offsets `]` (`,` $mask^)?\n oilist(`cacheModifier` `=` $cache)\n (`stride` `=` $stride^)?\n attr-dict `:` type($value)" }, { "name": "amdg.cluster_barrier_arrive", "summary": "Arrive at a cluster barrier", "description": "Signals that the cluster has arrived at a barrier, used to synchronizing CTAs within a cluster.\n\n See ClusterBarrierWaitOp for how to wait on the arrived cluster barrier.", "assemblyFormat": "attr-dict" }, { "name": "amdg.cluster_barrier_wait", "summary": "Wait on a cluster barrier", "description": "Waits for all CTAs of the same cluster to have arrived at a cluster barrier.\n Arrive and wait operations must come in pairs. Waiting before arriving or arriving\n more than once without a corresponding wait will result in undefined behavior.", "assemblyFormat": "attr-dict" }, { "name": "amdg.concat", "summary": "concat operation", "description": "The \"concat\" operation combines a list of source n-dimensional tensors into a single larger destination tensor.\n\n All source tensors must have the same shape, element type, and encoding.\n The concatenation dimension is inferred from the source and destination shapes provided by the user.\n For example, two tensors of shape 64x128 can produce a destination shape of 128x128,\n indicating concatenation along dimension 0; or 64x256, indicating concatenation along dimension 1.\n\n Generally, source tensors passed as op arguments can be arranged into the resulting shape in multiple ways.\n For example, given four tensors of shape 64x64:\n concat s0<64x64>, s1<64x64>, s2<64x64>, s3<64x64> -> <128x128>\n\n They can be laid out in different configurations within the result tensor:\n 1) s0 s1 2) s0 s2\n s2 s3 s1 s3\n\n From a logical tensor perspective, the source tensors are treated as elements of a tensor of tensors.\n In other words, the 1-D array of input tensors is conceptually reshaped into an n-D grid.\n The semantics of this op assume a row-major order (or its n-D generalization),\n meaning the fastest-varying dimension is filled first, and the slowest-varying dimension is filled last.\n In the example above, this corresponds to layout 1).\n\n The source and destination tensors must have identical linear layouts at the CTA tile level.\n That is, all base vectors for input dimensions must match, except for the register input dimension.\n The register basis must align on the subset that defines the logical tensor shape of a single CTA tile.\n\n This ensures that the concatenation is a no-op, meaning no data rearrangement among threads is required\n to assemble the destination tensor with the given shape and layout.\n However, the order of CTA tiles within the layout does not need to match between source and destination layouts.\n It is the responsibility of the op's lowering logic to handle this correctly.\n\n This op is designed to work on logical tensors directly, avoiding the need for complex layout reinterpretation or reshaping.\n For example, the `tt.join` operation only supports concatenation along the innermost dimension,\n and requires that the resulting innermost dimension provide 2 elements per thread, distributed across registers.\n In contrast, this `concat` op imposes no constraints on the concatenation dimension or the size of dimensions.\n\n * sources: a list of the input tensors.\n\n Example 1:\n\n ```mlir\n #blocked = #ttg.blocked<{sizePerThread = [1, 8],\n threadsPerWarp = [8, 8], warpsPerCTA = [4, 1], order = [1, 0]}>\n %0 = amdg.concat %arg0, %arg1: tensor<32x64xf32, #blocked>,tensor<32x64xf32, #blocked>,\n -> tensor<64x64xf32, #blocked>\n ```\n\n Example 2:\n ```mlir\n #src_layout = #ttg.linear<{register=[[0, 1], [0, 2], [0, 8], [0, 16], [0, 64], [64, 0]], lane=[[1, 0], [2, 0], [4, 0], [8, 0], [16, 0], [0, 4]], warp=[[0, 32], [32, 0]], block=[]}>\n #dst_layout = #ttg.linear<{register=[[0, 1], [0, 2], [0, 8], [0, 16], [0, 64], [0, 128], [64, 0], [128, 0]], lane=[[1, 0], [2, 0], [4, 0], [8, 0], [16, 0], [0, 4]], warp=[[0, 32], [32, 0]], block=[]}>\n %0 = amdg.concat %arg0, %arg1, %arg2, %arg3 : tensor<128x128xf16, #src_layout>, tensor<128x128xf16, #src_layout>, tensor<128x128xf16, #src_layout>,\n tensor<128x128xf16, #src_layout> -> tensor<256x256xf16, #dst_layout>\n ```", "operands": [ { "name": "sources", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$sources attr-dict `:` type($sources) `->` type($result)" }, { "name": "amdg.cond_barrier", "summary": "Conditionally set barriers to synchronize partial threads in a block", "description": "condBarrierOp sets barrier instruction only when the given argument is true.\n This provides a way to synchronize partial threads in a block, deliberately\n diverges the execution sequences. However, user should guarantee all threads\n converge at the end by calling condBarrierOp(true) with the remaining threads.\n Conceptually, this is similar to having an execution barrier inside an if statement.\n This op allows us to avoid blocking the whole block when suitable to help scheduling.\n NB. This doesn't set any memory fence.", "operands": [ { "name": "pred", "type": "I1" } ], "assemblyFormat": "$pred attr-dict" }, { "name": "amdg.extract_slice", "summary": "extract slice operation", "description": "The \"extract_slice\" operation enables extracting a slice of a tensor in\n registers.\n\n The \"extract_slice\" operation supports the following arguments:\n\n * source: the base tensor on which to create a view tensor\n * offsets: offsets into the base tensor at which to create the view\n\n In distributed layouts, tensors are divided into CTA tiles.\n A CTA tile represents the smallest contiguous portion of a tensor that is\n distributed across all threads and warps within a workgroup.\n The ExtractSlice operation extracts a portion of the tensor that is a\n multiple of CTA tiles.\n\n The source and destination must have matching linear layouts at the CTA\n tile level. This ensures that the extract_slice is a no-op, meaning no data\n rearrangement between threads is required to extract the destination tensor\n with the given shape and layout.\n\n +-------+-------+\n | W0 | W1 |\n | | |\n | + | + |\n | W2 | W3 | <-- Single CTA tile (distributed across warps W0-W3)\n | | |\n | + | + |\n | | |\n +-------+-------+\n | Source Tensor Extracted Slice\n | . +--------------+\n | . | W0 | W1 |\n | . | | |\n | | + | + |\n | | W2 | W3 |\n | | | |\n | | + | + |\n | | | |\n | +-------+------+\n | | W0 | W1 |\n | | | |\n | | + | + |\n | | W2 W3 |\n | | | |\n | | + | + |\n | | | |\n | +--------------+\n\n\n This op is designed to work on logical tensors directly, avoiding the need\n for complex layout reinterpretation or reshaping. For example, the tt.split\n operation only supports splitting along the innermost dimension,\n and requires that the resulting innermost dimension provide 2 elements per thread,\n distributed across registers. In contrast, extract_slice op imposes no constraints\n on the extraction dimension or the size of dimensions.\n\n Example 1:\n\n ```mlir\n #blocked = #ttg.blocked<{sizePerThread = [1, 8],\n threadsPerWarp = [4, 16], warpsPerCTA = [4, 1], order = [0, 1]}>\n #blocked1 = #ttg.blocked<{sizePerThread = [1, 8],\n threadsPerWarp = [16, 4], warpsPerCTA = [4, 1], order = [0, 1]}>\n %1 = ttg.convert_layout %0 : tensor<128x128xf16, #blocked>\n -> tensor<128x128xf16, #blocked1>\n // create a slice of base tensor %1 with static offsets\n %2 = amdg.extract_slice %0 [0, 0] :\n tensor<128x128xf16, #blocked1> to tensor<128x32xf16, #blocked1>\n ```\n\n Example 1 shows how \"extract_slice\" operation may be used. In this example a\n new slice of 128x32 is created. \"extract_slice\" works on tensors\n where the desired slice has the same layout on a CTA tile as the source tensor.\n \"%0\" cannot be sliced directly as the resulting slice does not satisfy this condition.\n Therefore it needs to be converted to a layout suitable for slicing.\n \"#blocked1\" layout is appropriate for this as it keeps the\n sizePerThread the same thus keeping coalescing properties the same.\n In order to utilize all threads in a warp, \"threadsPerWarp\" is set to\n [16,4] for this new layout. This layout conversion carried out before\n using \"extract_slice\" ensures slicing still uses all threads efficiently. The\n size of the slice is determined by the result type.", "operands": [ { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$source $static_offsets attr-dict `:` type($source) `to` type($result)" }, { "name": "amdg.in_thread_transpose", "summary": "Perform transpose of register values belonging to each threads", "description": "This operation performs a layout transpose over values in registers per thread.\n Specifically, given the input layout's blocked layout, it transposes the two last dimensions(rank-1 and rank-2)\n along the register dimension of the underlying linear layout.\n\n Conversion example:\n * input layout: blocked layout with sizePerThread=[2, 2], order=[0, 1]. It's linear layout register bases = [[1, 0], [2, 0], [0, 1], [0, 2]]\n * output layout: same thread and warp bases as in input, register bases = [[0, 1], [0, 2], [1, 0], [2, 0]]\n\n This operation enables efficient coalesced loading from HBM with following vectorized writing to shared memory\n in cases when HBM and shared memory order differ and target AMD hardware does not natively support this transposition.\n This is a specific variant of ttg.convert_layout and will be converted to ttg.convert_layout when lowering to llvm.\n We do not want this conversion to be optimized out, because we need to explicitly materialize instructions\n to transpose within each thread after loading from HBM and before writing to shared memory.", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "amdg.init_barrier", "summary": "Initialize a barrier in the given shared memory allocation.", "description": "Initializes a shared memory allocation with mbarrier information.\n `alloc` is a descriptor to the shared memory allocation. `count` is the\n number of arrives expected by the barrier.", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ], "assemblyFormat": "$alloc `,` $count attr-dict `:` qualified(type($alloc))" }, { "name": "amdg.instruction_sched_hint", "summary": "A placeholder op for instruction scheduling hints within a basic block", "description": "A placeholder op for instruction scheduling hints applied to instructions within\n a basic block where the placeholder op is located. This op is primarily intended\n to be used to adjust instruction scheduling inside the resulting main loop\n of a `tt.dot` operation. It's easier to identify dot ops at a high level and, thus,\n to mark intended scheduling regions. The hint ops are eventually lowered\n into LLVM AMDGPU instruction scheduling primitives, which are meant to control\n how different kinds of instructions (valu/mfma, global/shared memory, etc.) should\n interleave for better instruction level parallelism.", "attributes": [ { "name": "variant", "type": "TritonAMDGPU_SchedHintVariantAttr{none|attention}" } ], "assemblyFormat": "attr-dict" }, { "name": "amdg.local_load_packed_tranposed", "summary": "Load a transposed packed tensor from shared memory into a distributed tensor", "description": "Requires a M/N packed and M/N contiguous tensor in shared memory and will yield a K packed K contiguous tensor in registers.\n The packing change will change the shape of the tensor by doubling the M/N dimension and halving the K dimension.\n For example if A is 16x64 in shared memory, the result of this operation will be 32x32.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "token", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src (`token` $token^)? attr-dict `:` qualified(type($src)) `->` type($result)" }, { "name": "amdg.masked_load", "summary": "Masked load operation", "description": "Load operation with masking and multicast support. If the mask is true, loads from the given pointer. Works with LLVM types as a utility op for making LLVM conversion easier.\n On architectures supporting multicast, the `multicastMask`specifies which CTAs in the cluster request the same data. This allows the hardware to efficiently broadcast the\n data to multiple CTAs in the cluster.", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "I1" }, { "name": "falseVal", "type": "LLVM_Type" }, { "name": "multicastMask", "type": "Optional" } ], "results": [ { "name": "result", "type": "LLVM_Type" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "forceNoAlias", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$ptr `,` $mask `,` $falseVal (`,` $multicastMask^)?\n oilist(`cacheModifier` `=` $cache)\n (`forceNoAlias` $forceNoAlias^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "amdg.masked_store", "summary": "Masked Store operation", "description": "Store operation with masking support. If the mask is true, Store from the given pointer. Works with LLVM types as a utility op for making LLVM conversion easier.", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "value", "type": "LLVM_Type" }, { "name": "mask", "type": "I1" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "forceNoAlias", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$ptr `,` $value `,` $mask\n oilist(`cacheModifier` `=` $cache)\n (`forceNoAlias` $forceNoAlias^)?\n attr-dict `:` type(operands)" }, { "name": "amdg.memory_counter_wait", "summary": "Wait for specified hardware counters", "description": "Wait for the specified counters to be less-than or equal-to the provided\n values before continuing.\n\n Counters can lower to different instructions on different architectires,\n including clamping to the some HW supported max value or combining multiple\n counters into one.", "attributes": [ { "name": "load", "type": "OptionalAttr" }, { "name": "store", "type": "OptionalAttr" }, { "name": "ds", "type": "OptionalAttr" } ], "assemblyFormat": "oilist( `load` `(` $load `)` | `store` `(` $store `)` | `ds` `(` $ds `)` ) attr-dict" }, { "name": "amdg.scaled_upcast_fp4", "summary": "Upcast fp4 and then multiply scale", "description": "Upcast fp4 (e2m1) values packed as i8 values and multiply with the given\n E8M0 scale encoded as BF16. This maps to `v_cvt_scalef32_*` intrinsics\n on the AMD CDNA4 architecture.\n\n The lower 4 bits of the i8s represent the first fp4 element, and the upper\n 4 bits the second fp4 element.\n\n The `axis` attribute specifies the axis along which the fp4 elements are\n packed.", "operands": [ { "name": "input", "type": "RankedTensorOf<[I8]>" }, { "name": "scale", "type": "RankedTensorOf<[BF16, I8]>" } ], "results": [ { "name": "output", "type": "RankedTensorOf<[AnyTypeOf<[F16, BF16]>]>" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$input `scale` $scale attr-dict\n `:` type($input) `,` type($scale) `->` type($output)" }, { "name": "amdg.scaled_upcast_fp8", "summary": "Upcast Fp8 and then multiply scale", "description": "Upcast fp8 (e4m3/e5m2) values and multiply with the given E8M0 scale\n encoded as BF16. This maps to `v_cvt_scalef32_*` intrinsics\n on the AMD CDNA4 architecture.", "operands": [ { "name": "input", "type": "RankedTensorOf<[AnyTypeOf<[F8E4M3FN, F8E5M2]>]>" }, { "name": "scale", "type": "RankedTensorOf<[AnyTypeOf<[BF16, I8]>]>" } ], "results": [ { "name": "output", "type": "RankedTensorOf<[AnyTypeOf<[F16, BF16]>]>" } ], "assemblyFormat": "$input `scale` $scale attr-dict\n `:` type($input) `,` type($scale) `->` type($output)" }, { "name": "amdg.tdm_prefetch", "summary": "Prefetch data based on a TDM descriptor from global memory to L2.", "description": "This operation prefetches data from global memory to L2. It is analogous to the AsyncTDMCopyGlobalToLocalOp,\n but it does not copy the data to local memory and instead only prefetches the data into the L2 cache.\n Speculative prefetches can generate more efficient assembly because they do not require out of bounds checks.\n However, they are dropped by the hardware in case the virtual address translation is not already cached at CU level.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "indices", "type": "Variadic" }, { "name": "pred", "type": "I1" } ], "results": [ { "name": "maybeOffsets", "type": "Optional" } ], "attributes": [ { "name": "speculative", "type": "BoolAttr" }, { "name": "returnOffsets", "type": "OptionalAttr" } ], "assemblyFormat": "$desc `[` $indices `]` `,` $pred `,` `speculative` `=` $speculative\n (`returnOffsets` $returnOffsets^)?\n attr-dict `:` qualified(type($desc))\n (`->` type($maybeOffsets)^)?" }, { "name": "amdg.upcast_mxfp", "summary": "Convert an mxfp tensor to bf16/fp16", "description": "Compute the bf16 encoded in the given mxfp number as per\n https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf", "operands": [ { "name": "src", "type": "TT_Tensor" }, { "name": "scale", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "fp_type", "type": "TT_ScaleDotElemTypeAttr{e4m3|e5m2|e2m3|e3m2|e2m1|bf16|fp16}" }, { "name": "fastMath", "type": "BoolAttr" } ], "assemblyFormat": "$src `,` $scale `fp_type` `=` $fp_type attr-dict `:` type($src) `,` type($scale) `->` type($result)" }, { "name": "amdg.update_tensor_descriptor", "summary": "Update selected fields of a TDM descriptor; produce a new descriptor SSA value", "description": "Returns a new TDM descriptor with selected fields rewritten. Each\n parameter is independently optional; only the fields the caller names\n are written. Everything else is inherited from the input descriptor.\n\n | parameter | kind | effect on descriptor |\n |----------------|-------------|-----------------------------------------------------------------|\n | `add_offsets` | incremental | `global_addr += sum(add_offsets[i] * stride[i] * elem_size)` |\n | `set_bounds` | rewrite | `tensor_dim[i] = set_bounds[i]` (absolute) |\n | `pred` | rewrite | `pred = pred` |\n | `clamp_bounds` | derive | `tensor_dim[i] = max(0, tensor_dim[i] - add_offsets[i])` |\n\n The LDS destination and the TDM barrier (mbarrier) are op-level operands\n on the async_tdm_copy ops, not descriptor fields, so they are not settable\n here.\n\n `add_offsets` is incremental (deltas in element units) and does not\n touch `tensor_dim` — for OOB-correct loops, set `set_bounds` once\n outside the loop (interior tiles see a loop-invariant tensor_dim\n that hoists), or set `set_bounds` per iteration when OOB must fire.\n\n `clamp_bounds` is a unit attribute that, when present, additionally\n shrinks `tensor_dim` by `add_offsets` so the descriptor carries the\n OOB extent of the advanced tile. It requires `add_offsets` and is\n mutually exclusive with `set_bounds`. It lets a descriptor derive its\n OOB bounds from the advance without a separate `set_bounds`, and works\n for host-built descriptors whose shape is only known at runtime.\n\n Examples:\n ```\n // K-loop interior: bump tile position only\n %d1 = amdg.update_tensor_descriptor %d, add_offsets=[%c0, %BLOCK_K]\n : !tt.tensordesc<64x64xf16, #shared>\n\n // Prologue: position at first tile + set the predicate\n %d1 = amdg.update_tensor_descriptor %d,\n add_offsets=[%pid_m_off, %c0],\n pred=%p\n : !tt.tensordesc<64x64xf16, #shared>\n\n // Peel epilogue: install real OOB extent for the partial last tile\n %d1 = amdg.update_tensor_descriptor %d, set_bounds=[%m_remain, %k_remain]\n : !tt.tensordesc<64x64xf16, #shared>\n ```", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "add_offsets", "type": "Variadic" }, { "name": "set_bounds", "type": "Variadic" }, { "name": "pred", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_TensorDescType" } ], "attributes": [ { "name": "clamp_bounds", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'desc', 'result', '$_self'>" } ], "assemblyFormat": "$desc\n oilist(\n `add_offsets` `=` `[` $add_offsets `]`\n | `set_bounds` `=` `[` $set_bounds `]`\n | `pred` `=` $pred\n )\n attr-dict `:` qualified(type($desc))" }, { "name": "amdg.wait_barrier", "summary": "wait until the mbarrier phase completes.", "description": "Blocks the program progress until the mbarrier object in `alloc` completes\n its current phase.", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" }, { "name": "phase", "type": "I32" } ], "assemblyFormat": "$alloc `,` $phase attr-dict `:` qualified(type($alloc))" }, { "name": "amdgpu.dot", "summary": "MLIR wrapper for AMDGPU v_dot* intrinsics", "description": "The `amdgpu.dot` op is an MLIR wrapper over the `v_dot*` family of intrinsics,\n which compute `D = sum_i A[i] * B[i] + C`.\n\n Variants (source, dest, signedness, chipset -> intrinsic).\n\n ```text\n | A elem | B elem | destC | signedness | chipset | ROCDL op |\n |----------|----------|-------|------------|---------------------------|------------------------------|\n | f16 | f16 | f32 | n/a | gfx906+ | fdot2 |\n | f16 | f16 | f16 | n/a | gfx11+ | fdot2.f16.f16 |\n | bf16 | bf16 | f32 | n/a | gfx11+, gfx950+ | fdot2.f32.bf16 |\n | bf16 | bf16 | bf16 | n/a | gfx11+ | fdot2.bf16.bf16 |\n | i16 | i16 | i32 | s / u | gfx906+, no gfx11+/gfx12+ | sdot2 / udot2 |\n | i8 | i8 | i32 | s / u | gfx906+ | sdot4 / udot4 |\n | i8 | i8 | i32 | mixed | gfx11+ | sudot4 |\n | i4 | i4 | i32 | s / u | gfx906+ | sdot8 / udot8 |\n | i4 | i4 | i32 | mixed | gfx11+ | sudot8 |\n | fp8/bf8 | fp8/bf8 | f32 | n/a | gfx11.7, gfx12+ | dot4.f32.{fp8,bf8}.{fp8,bf8} |\n ```\n\n Example:\n ```mlir\n %r0 = amdgpu.dot %a * %b + %c : vector<4xi8>, vector<4xi8>, i32\n %r1 = amdgpu.dot %a * %b + %c {unsignedA, unsignedB, clamp}\n : vector<8xi4>, vector<8xi4>, i32\n %r2 = amdgpu.dot %a * %b + %c {unsignedB}\n : vector<4xi8>, vector<4xi8>, i32\n %r3 = amdgpu.dot %a * %b + %c : vector<2xf16>, vector<2xf16>, f32\n %r4 = amdgpu.dot %a * %b + %c : vector<2xf16>, vector<2xf16>, f16\n %r5 = amdgpu.dot %a * %b + %c\n : vector<4xf8E4M3FN>, vector<4xf8E5M2>, f32\n ```", "operands": [ { "name": "sourceA", "type": "DotInTypes" }, { "name": "sourceB", "type": "DotInTypes" }, { "name": "destC", "type": "DotOutTypes" } ], "results": [ { "name": "destD", "type": "DotOutTypes" } ], "attributes": [ { "name": "unsignedA", "type": "UnitAttr" }, { "name": "unsignedB", "type": "UnitAttr" }, { "name": "clamp", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "$sourceA `*` $sourceB `+` $destC attr-dict\n `:` type($sourceA) `,` type($sourceB) `,` type($destC)" }, { "name": "amdgpu.dpp", "summary": "AMDGPU DPP operation", "description": "The `amdgpu.dpp` op performs a Data Parallel Primitives (DPP) lane\n permutation on a source value within a wavefront. Each lane reads its\n source data from another lane according to the permutation mode specified\n by `kind`. DPP operates at dword (32-bit) granularity: sub-32-bit types\n (e.g., f16, i16) are packed into an i32 during lowering, permuted, and\n extracted back.\n\n - Lanes are organized into rows of 16.\n - A Wave64 wavefront has 4 rows of 16 lanes each: row 0 = lanes 0-15,\n row 1 = lanes 16-31, row 2 = lanes 32-47, row 3 = lanes 48-63.\n - Similarly, a Wave32 wavefront has two rows of 16 lanes each, organized\n in the same fashion.\n - Each row is divided into 4 banks of 4 consecutive lanes: bank 0 =\n lanes 0-3, bank 1 = lanes 4-7, bank 2 = lanes 8-11, bank 3 =\n lanes 12-15 (lane numbers shown for row 0; add 16/32/48 for other rows).\n\n The `kind` attribute selects the permutation. Some modes require a\n `permArgument`; others take no argument.\n\n Quad permutation:\n - `quad_perm([a, b, c, d])`: Full permute within each group of 4\n consecutive lanes (a quad). Each element is in [0, 3] and selects which\n lane within the quad to read from. Lane 4k+i reads from lane 4k+perm[i].\n For example, `quad_perm([1, 0, 3, 2])` swaps adjacent pairs within\n every quad.\n\n Row shifts and rotates (operate within each 16-lane row independently):\n - `row_shl(N)`: Shift left by N (1-15) within the row. Lane n reads from\n lane (n % 16) + N in the same row. Lanes where the source index exceeds\n 15 are out of bounds (see `bound_ctrl`).\n - `row_shr(N)`: Shift right by N (1-15) within the row. Lane n reads from\n lane (n % 16) - N in the same row. Lanes where the source index is\n negative are out of bounds.\n - `row_ror(N)`: Rotate right by N (1-15) within the row. Lane n reads from\n lane ((n % 16) - N) mod 16 in the same row. Always in bounds.\n\n Wavefront shifts and rotates (not available on RDNA):\n - `wave_shl`: Shift left by 1. Lane n reads from lane n + 1. The last lane\n in the wavefront is out of bounds.\n - `wave_shr`: Shift right by 1. Lane n reads from lane n - 1. Lane 0 is\n out of bounds.\n - `wave_rol`: Rotate left by 1. Lane n reads from lane (n + 1) mod W, where\n W is the wavefront size.\n - `wave_ror`: Rotate right by 1. Lane n reads from lane (n - 1) mod W, where\n W is the wavefront size.\n\n Row mirrors:\n - `row_mirror`: Reverse lanes within each 16-lane row. Lane n reads from\n lane 15 - (n % 16) within its row.\n - `row_half_mirror`: Reverse within each 8-lane half-row. Lane n reads\n from lane 7 - (n % 8) within its half-row.\n\n Row broadcasts (not available on RDNA):\n - `row_bcast_15`: Lane 15 of each row broadcasts to all lanes of the next\n row. Lanes in row 0 are not affected (retain `old`).\n - `row_bcast_31`: Lane 31 broadcasts to all lanes in rows 2 and 3.\n Lanes in rows 0 and 1 are not affected (retain `old`).\n\n Example:\n ```mlir\n // Swap adjacent pairs within each quad (lanes 0<->1, 2<->3, etc.)\n %0 = amdgpu.dpp %old %src quad_perm( [1, 0, 3, 2] ) : i32\n\n // Shift right by 1 lane within each 16-lane row.\n // bound_ctrl=true -> lanes that would read past the row return 0.\n // row_mask=0x5 (0b0101) -> only rows 0 and 2 apply the shift;\n // rows 1 and 3 pass through %old unchanged.\n %1 = amdgpu.dpp %old %src row_shr( 0x1 : i32 )\n { row_mask = 0x5 : i32, bound_ctrl = true } : f32\n\n // Rotate left across the full wavefront by 1 lane\n %2 = amdgpu.dpp %old %src wave_rol : i32\n ```\n\n Operands:\n * `$old`: Fallback value. Lanes that are masked off by `row_mask` /\n `bank_mask` retain `old`. For lanes with an out-of-bounds source, behavior\n depends on `bound_ctrl`.\n * `$src`: Source value to be permuted across lanes.\n * `$kind`: A `#amdgpu.dpp_perm` enum selecting the permutation mode.\n * `$permArgument`: Mode-specific argument. Required for `quad_perm`\n (array of 4 integers in [0, 3]) and `row_shl`/`row_shr`/`row_ror`\n (integer in [1, 15]). Absent for all other modes.\n * `$row_mask` (default 0xf): 4-bit mask controlling which rows write\n results. Bit i enables row i (bit 0 = lanes 0-15, bit 1 = lanes\n 16-31, etc.). Disabled lanes retain `old`.\n * `$bank_mask` (default 0xf): 4-bit mask controlling which banks write\n results. Bit i enables bank i (bit 0 = lanes 0-3, 16-19, etc. across all rows).\n Disabled lanes retain `old`.\n * `$bound_ctrl` (default false): When false, out of bounds lanes retain\n `old`. When true, out-of-bounds lanes receive zero.", "operands": [ { "name": "old", "type": "AMDGPU_IntOrFloatOr1DVectorWidthLeq64" }, { "name": "src", "type": "AMDGPU_IntOrFloatOr1DVectorWidthLeq64" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "kind", "type": "AMDGPU_DPPPermAttr{quad_perm|row_shl|row_shr|row_ror|wave_shl|wave_shr|wave_ror|wave_rol|row_mirror|row_half_mirror|row_bcast_15|row_bcast_31}" }, { "name": "permArgument", "type": "OptionalAttr>" }, { "name": "row_mask", "type": "DefaultValuedAttr" }, { "name": "bank_mask", "type": "DefaultValuedAttr" }, { "name": "bound_ctrl", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'old', 'src']>" } ], "assemblyFormat": "$old $src $kind (`(` $permArgument^ `)`)? attr-dict `:` type($result)" }, { "name": "amdgpu.ds_async_barrier_arrive", "summary": "Asynchronously arrive at an in-LDS barrier.", "description": "Add a arrival to the LDS barrier at `base[indices]` to the sequence of pending\n asynchronous memory operations.\n\n The indices must be non-negative and in-bounds for the corresponding\n dimensions of `base`.\n\n This will add an \"asynchronous memory operation\" to the in-order list of pending\n asynchronous loads from global memory to LDS. When the queue of such operations\n issued before this operation is complete, the specified barrier will be arrived at,\n decrementing the pending count by 1 **per lane that executes it** and rolling\n over the phase if applicable.\n\n This operation does not return the old barrier state.\n\n Example:\n ```mlir\n amdgpu.ds_async_barrier_arrive %barrier[] : memref>\n ```\n\n This operation is only available on gfx1250+.", "operands": [ { "name": "base", "type": "MemRefOf<[ AMDGPU_DsBarrierStateType ]>" }, { "name": "indices", "type": "Variadic" } ], "assemblyFormat": "$base `[` $indices `]` attr-dict `:` type($base)" }, { "name": "amdgpu.ds_barrier_arrive", "summary": "Arrive at an in-LDS barrier and return old state.", "description": "Atomically arrive at the LDS barrier at `base[indices]` and decrement it by `count`,\n rolling over the phase if needed and returning the old barrier state.\n\n The indices must be non-negative and in-bounds for the corresponding\n dimensions of `base`.\n\n `count` is the number of participants that should be subtracted from the barrier's\n pending count **per lane that executes the operation**.\n\n Example:\n ```mlir\n %old_state = amdgpu.ds_barrier_arrive %barrier[], %c1 : memref>, i64 -> !amdgpu.ds_barrier_state\n ```\n\n This operation is only available on gfx1250+.", "operands": [ { "name": "base", "type": "MemRefOf<[ AMDGPU_DsBarrierStateType ]>" }, { "name": "indices", "type": "Variadic" }, { "name": "count", "type": "I64" } ], "results": [ { "name": "out", "type": "AMDGPU_DsBarrierStateType" } ], "assemblyFormat": "$base `[` $indices `]` `,` $count attr-dict `:` type($base) `,` type($count) `->` type($out)" }, { "name": "amdgpu.ds_barrier_init", "summary": "Initialize an in-LDS barrier.", "description": "Given the location `!amdgpu.ds_barrier_state` in LDS (as specified by `base` and `indices`),\n initialize the barrier structure so that the pending and init counts are equal to\n `participants - 1`, which will have its high bits masked off, and its phase is equal to 0.\n\n The indices must be non-negative and in-bounds for the corresponding\n dimensions of `base`.\n\n Note that we subtract 1 from `participants` when constructing the barrier state\n to provide clearer high-level semantics.\n\n The subtraction means that, when the `participant`th arrival occurs, the phase will change.\n In practical terms, this means that you can use (for example) the number of subgroups or\n waves per workgroup as `participants`, instead of manually needing to remove one.\n\n While the write of the initial state will be performed atomically, no synchronization\n between waves will be performed by this operation.\n\n Example:\n ```mlir\n amdgpu.ds_barrier_init %barrier[], %c32 : memref>, i32\n ```\n\n This operation is only available on gfx1250+.", "operands": [ { "name": "base", "type": "MemRefOf<[ AMDGPU_DsBarrierStateType ]>" }, { "name": "indices", "type": "Variadic" }, { "name": "participants", "type": "I32" } ], "assemblyFormat": "$base `[` $indices `]` `,` $participants attr-dict `:` type($base) `,` type($participants)" }, { "name": "amdgpu.ds_barrier_poll_state", "summary": "Atomically read the state of an in-LDS barrier.", "description": "Atomically read and return the state of the barrier at `base[indices...]`.\n\n This will ultimately act like a `memref.load`, but this operation will ensure\n that appropriate atomic orderings and syncscopes are set.\n The indices must be non-negative and in-bounds for the corresponding\n dimensions of `base`.\n\n Example:\n ```mlir\n %state = amdgpu.ds_barrier_poll_state %barrier[] : memref> -> !amdgpu.ds_barrier_state\n ```\n\n This operation is only available on gfx1250+.", "operands": [ { "name": "base", "type": "MemRefOf<[ AMDGPU_DsBarrierStateType ]>" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "out", "type": "AMDGPU_DsBarrierStateType" } ], "assemblyFormat": "$base `[` $indices `]` attr-dict `:` type($base) `->` type($out)" }, { "name": "amdgpu.ds_barrier_state_init_count", "summary": "Extract the init count of a barrier state.", "description": "Extract the init count of the `!amdgpu.ds_barrier_state` `state` as a 32-bit value.\n\n Example:\n ```mlir\n %init = amdgpu.ds_barrier_state_init_count %state : !amdgpu.ds_barrier_state -> i32\n ```", "operands": [ { "name": "state", "type": "AMDGPU_DsBarrierStateType" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "$state attr-dict `:` type($state) `->` type($res)" }, { "name": "amdgpu.ds_barrier_state_pending_count", "summary": "Extract the pending count of a barrier state.", "description": "Extract the pending count of the `!amdgpu.ds_barrier_state` `state` as a 32-bit value.\n\n Example:\n ```mlir\n %pending = amdgpu.ds_barrier_state_pending_count %state : !amdgpu.ds_barrier_state -> i32\n ```", "operands": [ { "name": "state", "type": "AMDGPU_DsBarrierStateType" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "$state attr-dict `:` type($state) `->` type($res)" }, { "name": "amdgpu.ds_barrier_state_phase", "summary": "Extract the phase of a barrier state.", "description": "Extract the phase of the `!amdgpu.ds_barrier_state` `state` as a 32-bit value.\n\n Example:\n ```mlir\n %phase = amdgpu.ds_barrier_state_phase %state : !amdgpu.ds_barrier_state -> i32\n ```", "operands": [ { "name": "state", "type": "AMDGPU_DsBarrierStateType" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "$state attr-dict `:` type($state) `->` type($res)" }, { "name": "amdgpu.ds_barrier_state_phase_parity", "summary": "Extract the phase parity of a barrier state.", "description": "Return the parity of the phase of the `!amdgpu.ds_barrier_state` `state`.\n\n This is intended to simplify the case where the barrier is being used to repeatedly\n track completion of a task where the precise value of the phase won't mater, only that\n it changed since (or as a result of) the arrival.\n\n Example:\n ```mlir\n %parity = amdgpu.ds_barrier_state_phase_parity %state : !amdgpu.ds_barrier_state -> i1\n ```", "operands": [ { "name": "state", "type": "AMDGPU_DsBarrierStateType" } ], "results": [ { "name": "res", "type": "I1" } ], "assemblyFormat": "$state attr-dict `:` type($state) `->` type($res)" }, { "name": "amdgpu.ext_packed_fp8", "summary": "Extend a fp8 value to a float or a vector of packed fp8 values to two floats", "description": "Extend one or two 8-bit floats in `source[index]` to a 32-bit float or\n two floats and return them.\n\n This rather unusual signature arises from the fact that AMD GPUs cannot\n easily work with sub 32-bit quantities, so the compiler intrinsics for\n extending 8-bit floats (which are, currently, the only way to work with\n this operation) take packed vectors of 4 such floats.\n\n If the passed-in vector has fewer than four elements, or the input is scalar,\n the remaining values in the <4 x i8> will be filled with\n undefined values as needed.", "operands": [ { "name": "source", "type": "AnyTypeOf<[F8E5M2FNUZ, F8E4M3FNUZ, F8E5M2, F8E4M3FN, VectorOfLengthAndType<[1, 2, 3, 4], [F8E5M2FNUZ, F8E4M3FNUZ, F8E5M2, F8E4M3FN]>]>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[F32, FixedVectorOfLengthAndType<[2], [F32]>]>" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr]>" } ], "assemblyFormat": "attr-dict $source `[` $index `]` `:` type($source) `to` type($res)" }, { "name": "amdgpu.fat_raw_buffer_cast", "summary": "Create a raw buffer fat pointer that matches `memref`", "description": "Wraps the memory pointed to by `source` as a raw buffer fat pointer, or,\n in LLVM terms, a `ptr addrspace(7)`, returning a memref that has the same\n sizes and layout but the `#amdgpu.address_space`\n address space.\n\n This memref can be used with standard memref operations like `memref.load`,\n `memref.store`, and `memref.atomicrmw`, which will be lowered to the relevant\n buffer intrinsics. (`vector.masked_load/store` will work once there's backend\n support for lowering them, and then this document will be updated)\n\n If `validBytes` is given, it is the number of bytes that will be valid as\n an offset to `out`. If it is not provided, this will be inferred from\n the size of the memref during lowering. This size is\n max_{d = 0 upto rank(source)} (sizes[d] * strides[d]) * sizeof(element type).\n\n The flags of the buffer descriptor will be set up to enable raw usage -\n for example, stride = 0, add_tid = 0, and so on. The `boundsCheck`\n property determines if bounds checking is enabled or not (on architectures\n where this can be controlled - that is, on RDNA chips).\n\n If `cacheSwizzleStride` is provided, L1 cache swizzling will be enabled\n on architectures that support it. This swizzling, unlike the main swizzling\n mode (whose usage makes a buffer non-raw) does not affect index calculation,\n but does affect cache behavior. Mixing access between cache-swizzled raw\n buffers and other forms of memory access, like ordinary pointer loads or\n unswizzled buffer pointers can cause incorrect behavior and must be avoided.\n\n This operation preserves the sizes, strides, and offset of the input\n memref - they'll be added in by `memref.load` later. However, if\n `resetOffset` is set, that offset will be added to the base pointer.\n If the value of the memref's offset is not uniform (independent of the lane/thread ID),\n this will lead to substantially decreased performance due to the need for\n a waterfall loop on the base address of the buffer resource.", "operands": [ { "name": "source", "type": "AnyMemRef" }, { "name": "validBytes", "type": "Optional" }, { "name": "cacheSwizzleStride", "type": "Optional>" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "resetOffset", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source oilist (`validBytes` `(` $validBytes `)`\n | `cacheSwizzleStride` `(` $cacheSwizzleStride `)`\n | `boundsCheck` `(` $boundsCheck `)`\n | `resetOffset` $resetOffset )\n attr-dict `:` type($source) `to` type($result)" }, { "name": "amdgpu.gather_to_lds", "summary": "MLIR wrapper for CDNA Gather to LDS instructions", "description": "The `amdgpu.gather_to_lds` op is a wrapper around the `global_load_lds` instructions.\n\n Operands:\n * `$src`: global memory (including fat buffer) memref to read from.\n * `$srcIndices`: indices into `$src` to read from for this thread.\n These indices must be non-negative and in-bounds when `$src` is not a\n fat raw buffer. Fat raw buffer sources permit out-of-bounds indices with\n raw buffer semantics.\n * `$dst`: LDS memory memref to write to.\n * `$dstIndices`: base indices into `$dst` to write to for the subgroup of this thread.\n These indices must be non-negative and in-bounds.\n The elements gathered by the subgroup will be written contiguously in order of lane ID\n starting at `$dst[$dstIndices]`. Byte-sized (ex. i8) or short-sized (ex. i16)\n types will be zero-padded/extended to 32 bits before being written. 96-bit types\n (ex. vector<3xf32>) will be zero-padded to 128 bits before being written. Only the\n offsets held by lane 0 are used.\n * `$transferType`: type of the data to be transferred by each thread. This is used to determine\n the size of the data to be transferred and the number of threads in the subgroup.\n The transfer type must be a scalar type or a vector type with a single element type.\n * If `$async` is set, the compiler will not attempt to infer the\n memory waits needed to ensure that the DMA operation has succeeded\n before a load that might access the stored-to LDS is performed.\n Instead, the `rocdl.asyncmark` and `rocdl.wait.asyncmark N`\n operations must be used to explicitly indicate the desired completion\n behavior. This enables more precise calculation of these waits at the\n cost of requiring user management of asynchrony.\n\n The `$dst`, along with its indices, points to the memory location the subgroup of this thread\n will write to.\n\n Note: only supported on gfx9 and gfx10.", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "srcIndices", "type": "Variadic" }, { "name": "dst", "type": "AnyMemRef" }, { "name": "dstIndices", "type": "Variadic" } ], "attributes": [ { "name": "transferType", "type": "TypeAttr" }, { "name": "async", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`async` $async^)? $src `[` $srcIndices `]` `,` $dst `[` $dstIndices `]` attr-dict `:` $transferType `,` type($src) `,` type($dst)" }, { "name": "amdgpu.global_load_async_to_lds", "summary": "MLIR wrapper for async global load to lds instructions", "description": "AMDGPU wrapper for `global.load.async.to.lds` instructions, which performs\n asynchronous load of data from global memory into LDS while bypassing VGPRs.\n\n * `$src`: global memory memref to read from (global addrspace only, no fat buffer).\n * `$srcIndices`: indices into `$src` for this thread's global read location.\n These indices must be non-negative and in-bounds.\n * `$dst`: LDS memref to write to (workgroup addrspace).\n * `$dstIndices`: indices into `$dst` for this thread's LDS write location.\n These indices must be non-negative and in-bounds when `$mask` is not\n provided. When `$mask` is provided, the destination indices are not\n guaranteed to be in-bounds because masked-off lanes may carry invalid\n destination indices.\n * `$transferType`: type of data to be transferred. Must be 8, 32, 64 or 128 bit scalar\n or vector type.\n * `$mask`: optional per-thread mask. When false, the thread's LDS write\n is masked off. The global read still occurs for all threads regardless of mask.\n\n Note: only supported on gfx1250 and later.\n\n Examples:\n ```mlir\n amdgpu.global_load_async_to_lds %src[%i, %j], %dst[%k, %l]\n : f32, memref<128x64xf32, #gpu.address_space>,\n memref<64x64xf32, #gpu.address_space>\n\n amdgpu.global_load_async_to_lds %src[%i, %j], %dst[%k, %l]\n : vector<4xf32>, memref<128x64xf32, #gpu.address_space>,\n memref<64x64xf32, #gpu.address_space>\n\n amdgpu.global_load_async_to_lds %src[%i], %dst[%j]\n : i8, memref<512xi8, #gpu.address_space>,\n memref<256xi8, #gpu.address_space>\n ```", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "srcIndices", "type": "Variadic" }, { "name": "dst", "type": "AnyMemRef" }, { "name": "dstIndices", "type": "Variadic" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "transferType", "type": "TypeAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$src `[` $srcIndices `]` `,` $dst `[` $dstIndices `]` (`,` $mask^)?\n attr-dict `:` $transferType `,` type($src) `,` type($dst)" }, { "name": "amdgpu.global_prefetch", "summary": "Prefetch data to caches.", "description": "Prefetches a cache line to high-level caches using the aligned address of\n the source `memref` and an offset provided by the indices of the element\n containing the cache line. This provides temporal hints (e.g., regular\n or high-priority). Note that out-of-bounds access is allowed in\n speculative mode. The provided memref must be in the global address space\n (`#gpu.address_space` or 1).\n\n This operation was introduced in gfx1250.\n\n Example:\n ```mlir\n amdgpu.global_prefetch %src[%i, %j] RT SE speculative : memref<64x64xf16, #gpu.address_space>\n ```", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "temporalHint", "type": "AMDGPU_LoadTemporalHintAttr{RT|NT|HT|LU|NT_RT|RT_NT|NT_HT}" }, { "name": "cacheScope", "type": "AMDGPU_CacheScopeAttr{WGP|SE|DEV|SYS}" }, { "name": "speculative", "type": "UnitAttr" } ], "assemblyFormat": "$src `[` $indices `]` $temporalHint $cacheScope (`speculative` $speculative^)? attr-dict `:` qualified(type($src))" }, { "name": "amdgpu.global_transpose_load", "summary": "MLIR wrapper for global memory transpose load instructions", "description": "The `amdgpu.global_transpose_load` op is a wrapper around the\n `global_load_tr` family of instructions introduced in gfx1200.\n\n Each thread reads a column of a matrix stored in global memory and receives\n the corresponding row of the transposed matrix in its result register.\n The subgroup collectively performs a transpose of the tile.\n\n This op is a direct wrapper around the ROCDL `global.load.tr` family\n intrinsics. Refer to the ISA manual for exact semantics.\n\n Format example:\n ```mlir\n %0 = amdgpu.global_transpose_load %src[%i, %j]\n : memref<128x256xf16, #gpu.address_space> -> vector<8xf16>\n ```\n\n Operands:\n * `$src`: Global address space memref to read from.\n * `$srcIndices`: indices into `$src` for this thread. Indices must be\n non-negative and in-bounds for the corresponding dimension of `$src`,\n matching the constraints of `memref.load`.\n * `$result`: register this transpose load instruction writes to.\n\n Valid (element bits, num elements) pairs:\n * (4, 16) -> global_load_tr4_b64 (gfx1250+)\n * (6, 16) -> global_load_tr6_b96 (gfx1250+)\n * (8, 8) -> global_load_tr_b64 (gfx1200+)\n * (16, 8) -> global_load_tr_b128 (gfx1200+)\n\n Note: 8-bit and 16-bit element lowering requires gfx1200+.\n 4-bit and 6-bit element lowering requires gfx1250+.", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "srcIndices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[FixedVectorOfLengthAndType<[8], [I8, F8E5M2FNUZ, F8E4M3FNUZ, F8E5M2, F8E4M3FN, F16, BF16, I16]>, FixedVectorOfLengthAndType<[16], [I<4>, F4E2M1FN, I<6>, F6E2M3FN, F6E3M2FN]>]>" } ], "assemblyFormat": "$src `[` $srcIndices `]` attr-dict `:` type($src) `->` type($result)" }, { "name": "amdgpu.lds_barrier", "summary": "Barrier that includes a wait for LDS memory operations.", "description": "**DEPRECATION NOTICE**: Unless you need the inline-assembly-based workaround\n for gfx908/MI-100, you should represent this pattern with the equivalent\n\n ```mlir\n gpu.barrier memfence [#gpu.address_space]\n ```\n\n instead.\n\n `amdgpu.lds_barrier` is both a barrier (all workitems in a workgroup must reach\n the barrier before any of them may proceed past it) and a wait for all\n operations that affect the Local Data Store (LDS) issued from that workgroup\n to complete before the workgroup may continue. Since the LDS is per-workgroup\n memory, this barrier may be used, for example, to ensure all workitems have\n written data to LDS before any workitem attempts to read from it.\n\n Note that `lds_barrier` does **not** force reads to or from global memory\n to complete before execution continues. Therefore, it should be used when\n operations on global memory can be issued far in advance of when their results\n are used (for example, by writing them to LDS).\n\n WARNING: On architectures that do not support the BackOffBarrier feature,\n (those which will implement this barrier by emitting inline assembly),\n use of this operation will impede the usabiliity of memory watches (including\n breakpoints set on variables) when debugging.", "assemblyFormat": "attr-dict" }, { "name": "amdgpu.make_dma_base", "summary": "Pair of based addresses used when moving tiles between LDS and global memory.", "description": "This operation creates a pair of addresses that will be used by tensor_load_to_lds\n and tensor_store_from_lds.\n\n The global and LDS indices must be non-negative and in-bounds for the\n corresponding dimensions of their memrefs.\n\n This operation creates a value corresponding to the tensor descriptor (D#) group 0\n found in TensorLoadToLDSOp and TensorStoreFromLDSOp in the rocdl dialect.\n\n For example:\n\n ```mlir\n %base = amdgpu.make_dma_base %global[%idx0, %idx1], %lds[%idx2, %idx3] : memref<64x64xi32>, memref<64x64xi32, #gpu.address_space> -> !amdgpu.tdm_base\n %descriptor = amdgpu.make_dma_descriptor %base globalSize [2, 2] globalStride [2, 1] sharedSize [2, 2] : !amdgpu.tdm_base -> !amdgpu.tdm_descriptor\n amdgpu.tensor_load_to_lds %descriptor : !amdgpu.tdm_descriptor\n ```\n\n to\n\n ```mlir\n // pseudo-code\n %global_base = llvm.extractvalue %global_memref[1]\n %global_address = llvm.get_element_ptr ...\n\n %lds_base = llvm.extractvalue %lds_memref[1]\n %lds_address = llvm.get_element_ptr ...\n\n // Definition of %base\n %undef = llvm.mlir.undef : vector<4xi32>\n %v0 = llvm.insertelement %15, %undef[0] : vector<4xi32>\n %v1 = llvm.insertelement %lds_address, %v0[1] : vector<4xi32>\n %v2 = llvm.insertelement %global_address_low, %v1[2] : vector<4xi32>\n %base = llvm.insertelement %global_address_high, %v2[3] : vector<4xi32>\n\n rocdl.tensor.load.to.lds %base, %dgroup1, %dgroup2, %dgroup3 cachepolicy 0 : vector<4xi32>, vector<8xi32>\n ```\n\n These tensor DMA operations were introduced in gfx1250.", "operands": [ { "name": "global", "type": "AnyMemRef" }, { "name": "global_indices", "type": "Variadic" }, { "name": "lds", "type": "AnyMemRef" }, { "name": "lds_indices", "type": "Variadic" } ], "results": [ { "name": "base", "type": "AMDGPU_TDMBaseType" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$global `[` $global_indices `]` `,` $lds `[` $lds_indices `]` attr-dict `:` type($global) `,` type($lds) `->` type(results)" }, { "name": "amdgpu.make_dma_descriptor", "summary": "Make all descriptor groups needed by TensorLoadToLDS/TensorStoreFromLDS.", "description": "Make all descriptor groups needed by tensor memory operations.\n\n The $base operand corresponds to the base pair addresses, one must be an address in LDS\n while the other must be a global memory location.\n\n $global_{static/dynamic}_sizes determine the size of the tensor.\n $global_{static/dynamic}_strides determine the strides of the tensor.\n $shared_{static/dynamic}_sizes determines the size of the tile.\n\n $workgroup_mask broadcast load to workgroups inside of a workgroup cluster\n (0 = do not broadcast result to workgroup, 1 = broadcast result to workgroup). Ignored for stores.\n An all zeros mask is interpreted as a non-broadcasted load.\n\n $early_timeout return data to requesters as soon as cache supplies it.\n\n Padding can be applied to the LDS address when copying from memory to LDS,\n but not when copying from LDS to memory.\n The values in the padded target addresses remain the same as before the operation was applied.\n $pad_interval must be a power of two contained in [2, 256].\n $pad_amount must be a value contained in [1, 128].\n\n If an atomic barrier is provided, it will be arrived at **once** after\n each load/store using this descriptor is completed.\n Its indices must be non-negative and in-bounds for the corresponding\n dimensions of the barrier memref.\n\n 2D and 3D tensors may be iterated over by setting $global_increment, $lds_increment, and $iteration_count.\n $global_increment determines how much to increment the starting global memory address per iteration in units of the $base's element type.\n $lds_increment determines how much to increment the starting LDS address per iteration in units of the $base's element type.\n $iterate_count determines how many times to iterate, it must be a value in the inclusive interval [1, 256].\n\n ```mlir\n // Example of moving a two-dimensional tensor to LDS.\n %base = amdgpu.make_dma_base %global[0, 0], %lds[0, 0] : memref<64x64xi32>, memref<64x64xi32, #gpu.address_space> -> !amdgpu.tdm_base\n %descriptor = amdgpu.make_dma_descriptor %base globalSize [64, 64] globalStride [64, 1] sharedSize [64, 64] : !amdgpu.tdm_base -> !amdgpu.tdm_descriptor\n amdgpu.tensor_load_to_lds %descriptor : !amdgpu.tdm_descriptor\n\n // Example of moving a two dimension tensor to LDS where padding is applied after every integer.\n %base = amdgpu.make_dma_base %global[0, 0], %lds[0, 0] : memref<32x32xi32>, memref<64x64xi32, #gpu.address_space> -> !amdgpu.tdm_base\n %descriptor = amdgpu.make_dma_descriptor %base globalSize [32, 32] globalStride [32, 1] sharedSize [64, 64] padShared(%pad_amount every %pad_interval) : !amdgpu.tdm_base -> !amdgpu.tdm_descriptor\n amdgpu.tensor_load_to_lds %descriptor : !amdgpu.tdm_descriptor\n ```", "operands": [ { "name": "base", "type": "AMDGPU_TDMBaseType" }, { "name": "global_dynamic_sizes", "type": "Variadic" }, { "name": "global_dynamic_strides", "type": "Variadic" }, { "name": "shared_dynamic_sizes", "type": "Variadic" }, { "name": "workgroup_mask", "type": "Optional>" }, { "name": "early_timeout", "type": "Optional" }, { "name": "pad_amount", "type": "Optional" }, { "name": "pad_interval", "type": "Optional" }, { "name": "atomic_barrier_address", "type": "Optional>" }, { "name": "atomic_barrier_indices", "type": "Variadic" }, { "name": "global_increment", "type": "Optional" }, { "name": "lds_increment", "type": "Optional" }, { "name": "iteration_count", "type": "Optional" } ], "results": [ { "name": "desc", "type": "AMDGPU_TDMDescriptorType" } ], "attributes": [ { "name": "global_static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "global_static_strides", "type": "DenseI64ArrayAttr" }, { "name": "shared_static_sizes", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$base\n `globalSize` custom($global_dynamic_sizes, $global_static_sizes)\n `globalStride` custom($global_dynamic_strides, $global_static_strides)\n `sharedSize` custom($shared_dynamic_sizes, $shared_static_sizes)\n ( `padShared` `(` $pad_amount^ `every` $pad_interval `)` )?\n ( `workgroupMask` $workgroup_mask^ ( `earlyTimeout` $early_timeout^)?)?\n ( `atomicBarrier` `(` $atomic_barrier_address^ `[` $atomic_barrier_indices `]`\n `:` type($atomic_barrier_address) `)`)?\n ( `iterate` $global_increment^ `,` $lds_increment `,` $iteration_count )?\n attr-dict `:` qualified(type($base)) `->` type(results)" }, { "name": "amdgpu.make_gather_dma_base", "summary": "Pair of based addresses used when moving tiles between LDS and global memory.", "description": "This operation creates a pair of addresses that will be used by `tensor_load_to_lds`\n and `tensor_store_from_lds`.\n\n The global and LDS indices must be non-negative and in-bounds for the\n corresponding dimensions of their memrefs.\n\n This operation creates a value corresponding to the tensor descriptor (D#) group 0\n found in TensorLoadToLDSOp and TensorStoreFromLDSOp in the rocdl dialect.\n\n Unlike `make_dma_base`, this operation returns `!amdgpu.tdm_gather_base<$element_type, $index_type>`\n which is only compatible with `make_gather_dma_descriptor`. Using the descriptor returned\n by `make_gather_dma_descriptor` will set the `tensor_load_to_lds` and `tensor_store_from_lds` to gather mode.\n\n ```mlir\n %base = amdgpu.make_gather_dma_base %global[%idx0, %idx1], %lds[%idx2, %idx3] : memref<64x64xi32>, memref<64x64xi32, #gpu.address_space> -> !amdgpu.tdm_gather_base\n // %indices : i16\n %descriptor = amdgpu.make_gather_dma_descriptor %base[%indices] globalSize [2, 2] globalStride [2, 1] sharedSize [2, 2] : !amdgpu.tdm_gather_base, i16 -> !amdgpu.tdm_descriptor\n amdgpu.tensor_load_to_lds %descriptor : !amdgpu.tdm_descriptor\n ```", "operands": [ { "name": "global", "type": "AnyMemRef" }, { "name": "global_indices", "type": "Variadic" }, { "name": "lds", "type": "AnyMemRef" }, { "name": "lds_indices", "type": "Variadic" } ], "results": [ { "name": "base", "type": "AMDGPU_TDMGatherBaseType" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$global `[` $global_indices `]` `,` $lds `[` $lds_indices `]` attr-dict `:` type($global) `,` type($lds) `->` type(results)" }, { "name": "amdgpu.make_gather_dma_descriptor", "summary": "Make all descriptor groups needed by TensorLoadToLDS/TensorStoreFromLDS.", "description": "Make all descriptor groups needed by tensor memory operations in gather\n mode.\n\n If an atomic barrier is provided, its indices must be non-negative and\n in-bounds for the corresponding dimensions of the barrier memref.", "operands": [ { "name": "base", "type": "AMDGPU_TDMGatherBaseType" }, { "name": "indices", "type": "AnyTypeOf<[VectorOfMinMaxLengthAndType<1, 8, [I32]>, VectorOfMinMaxLengthAndType<1, 16, [I16]>]>" }, { "name": "global_dynamic_sizes", "type": "Variadic" }, { "name": "global_dynamic_strides", "type": "Variadic" }, { "name": "shared_dynamic_sizes", "type": "Variadic" }, { "name": "workgroup_mask", "type": "Optional>" }, { "name": "early_timeout", "type": "Optional" }, { "name": "pad_amount", "type": "Optional" }, { "name": "pad_interval", "type": "Optional" }, { "name": "atomic_barrier_address", "type": "Optional>" }, { "name": "atomic_barrier_indices", "type": "Variadic" }, { "name": "global_increment", "type": "Optional" }, { "name": "lds_increment", "type": "Optional" }, { "name": "iteration_count", "type": "Optional" } ], "results": [ { "name": "desc", "type": "AMDGPU_TDMDescriptorType" } ], "attributes": [ { "name": "global_static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "global_static_strides", "type": "DenseI64ArrayAttr" }, { "name": "shared_static_sizes", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$base `[` $indices `]`\n `globalSize` custom($global_dynamic_sizes, $global_static_sizes)\n `globalStride` custom($global_dynamic_strides, $global_static_strides)\n `sharedSize` custom($shared_dynamic_sizes, $shared_static_sizes)\n ( `padShared` `(` $pad_amount^ `every` $pad_interval `)` )?\n ( `workgroupMask` $workgroup_mask^ ( `earlyTimeout` $early_timeout^)?)?\n ( `atomicBarrier` `(` $atomic_barrier_address^ `[` $atomic_barrier_indices `]`\n `:` type($atomic_barrier_address) `)`)?\n ( `iterate` $global_increment^ `,` $lds_increment `,` $iteration_count )?\n attr-dict `:` qualified(type($base)) `,` type($indices) `->` type(results)" }, { "name": "amdgpu.memory_counter_wait", "summary": "Wait for specified hardware counters", "description": "Wait for the specified counters to be less-than or equal-to the provided\n values before continuing.\n\n Counters can lower to different instructions on different architectires,\n including clamping to the some HW supported max value or combining multiple\n counters into one.", "attributes": [ { "name": "load", "type": "OptionalAttr" }, { "name": "store", "type": "OptionalAttr" }, { "name": "ds", "type": "OptionalAttr" }, { "name": "exp", "type": "OptionalAttr" }, { "name": "tensor", "type": "OptionalAttr" } ], "assemblyFormat": "oilist( `load` `(` $load `)` | `store` `(` $store `)` | `ds` `(` $ds `)` | `exp` `(` $exp `)` | `tensor` `(` $tensor `)` ) attr-dict" }, { "name": "amdgpu.mfma", "summary": "MLIR wrapper for CDNA mfma instructions", "description": "The `amdgpu.mfma` op is an MLIR wrapper around intrinsics\n for various `mfma` instructions in the CDNA architecture, which perform\n multiple outer products in order to allow fast matrix multiplication.\n\n The wrapper will select an appropriate `mfma` instruction, if one is available,\n based on the provided `m`, `k`, `n`, and `nBlks` attributes, along with the\n types of the source and destination arguments.\n\n For information on the layouts of the input and output matrices (which are stored\n in `sourceA`, `sourceB`, `destC`, and `destD`), see the CDNA ISA documentation.\n\n The `cbsz`, `abid`, and `blgp` parameters control how the lanes of the wave\n are permuted when matrix data is being loaded: `blgp` can be any number of\n fixed permutations, `cbsz` specifies the log_2 of the number of chunks the lanes\n holding sourceA are split into, and `abid` selects one of those chunks.\n\n Note, this wrapper allows specifying `vector<4Kxi8>` arguments to MFMA\n intrinsics that take an integer type of width `4K`. For example,\n one can provide a vector<4xi8> as an argument to an MFMA instruction that\n logically takes 4 i8s but whose intrinsics are specified to take an i32.\n In these cases, the bytes in the vector will be concatenated in little-endian\n order (that is, v[0] will go to arg[7:0], v[1] to arg[15:8] and so on).\n\n The negateA, negateB, and negateC flags are only supported for double-precision\n operations on gfx94x.\n\n Example:\n ```mlir\n %0 = amdgpu.mfma 16x16x16 %matA * %matB + %matC\n : vector<4xf16>, vector<4xf16>, vector<4xf32>\n\n %1 = amdgpu.mfma 32x32x1 %matD * %matE + %matF\n { abid = 1 : i32, cbsz = 1 : i32, blocks = 2 : i32 }\n blgp = bcast_second_32 : f32, f32, vector<32xf32>\n ```", "operands": [ { "name": "sourceA", "type": "MFMAInTypes" }, { "name": "sourceB", "type": "MFMAInTypes" }, { "name": "destC", "type": "MFMAOutTypes" } ], "results": [ { "name": "destD", "type": "MFMAOutTypes" } ], "attributes": [ { "name": "m", "type": "ConfinedAttr]>" }, { "name": "n", "type": "ConfinedAttr]>" }, { "name": "k", "type": "ConfinedAttr]>" }, { "name": "blocks", "type": "DefaultValuedAttr ]>, 1>" }, { "name": "cbsz", "type": "DefaultValuedAttr" }, { "name": "abid", "type": "DefaultValuedAttr" }, { "name": "blgp", "type": "DefaultValuedAttr" }, { "name": "reducePrecision", "type": "UnitAttr" }, { "name": "negateA", "type": "UnitAttr" }, { "name": "negateB", "type": "UnitAttr" }, { "name": "negateC", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "custom($m, $n, $k) $sourceA `*` $sourceB `+` $destC\n attr-dict\n `blgp` `=` $blgp\n `:` type($sourceA) `,` type($sourceB) `,` type($destC)" }, { "name": "amdgpu.packed_scaled_trunc", "summary": "Round two floats into a packed vector of floats", "description": "Scale and round the inputs `source` (which is undefined if not\n specified) into the low or high word (bottom two or top two) elements\n of the returned vector, keeping the other two elements of `existing`\n unchanged if present (or undefined if it was not passed in).\n\n The reason for this odd signature is that AMD GPUs cannot easily work with\n sub-registers, and so the conversion intrinsics take 32-bit wide\n packed vectors of float values.", "operands": [ { "name": "source", "type": "VectorOfLengthAndType<[1, 2], [F32, F16, BF16]>" }, { "name": "scale", "type": "F32" }, { "name": "existing", "type": "Optional, FixedVectorOfLengthAndType < [ 8 ] , [ F4E2M1FN ] > ]>>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[FixedVectorOfLengthAndType<[4], [F8E5M2, F8E4M3FN]>, FixedVectorOfLengthAndType<[8], [F4E2M1FN]>]>" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr]>" } ], "assemblyFormat": "attr-dict $source `into` ($existing^):(`undef`)? `[` $index `]`\n `,` $scale\n `:` type($source) `to` type($res) (`into` type($existing)^)?" }, { "name": "amdgpu.packed_stoch_round_fp8", "summary": "Round float stochiastically into a packed vector of 8-bit floats", "description": "Round the input `source`, adding in `stochiasticParam`, and place it into\n the `storeIndex`th element of `res`.\n\n If `existing` is passed in, elements of `res` other than the one at `storeIndex`\n are copied from `existing`.\n\n The reason for this odd signature is that AMD GPUs cannot easily work with\n sub-registers, and so the conversion intrinsics (which are currently the\n only way to work with 8-bit float types) take packed vectors of 4 8-bit\n values.", "operands": [ { "name": "source", "type": "F32" }, { "name": "stochiasticParam", "type": "I32" }, { "name": "existing", "type": "Optional>" } ], "results": [ { "name": "res", "type": "FixedVectorOfLengthAndType<[4], [F8E4M3FNUZ, F8E5M2FNUZ, F8E4M3FN, F8E5M2]>" } ], "attributes": [ { "name": "storeIndex", "type": "ConfinedAttr]>" } ], "assemblyFormat": "attr-dict $source `+` $stochiasticParam\n `into` ($existing^):(`undef`)? `[` $storeIndex `]`\n `:` type($source) `to` type($res) (`into` type($existing)^)?" }, { "name": "amdgpu.packed_trunc_2xfp8", "summary": "Round two floats into a packed vector of 8-bit floats", "description": "Round the inputs `sourceA` and `sourceB` (which is undefined if not\n specified) into the low or high word (bottom two or top two) elements\n of the returned vector, keeping the other two elements of `existing`\n unchanged if present (or undefined if it was not passed in).\n\n The reason for this odd signature is that AMD GPUs cannot easily work with\n sub-registers, and so the conversion intrinsics (which are currently the\n only way to work with 8-bit float types) take packed vectors of 4 8-bit\n values.", "operands": [ { "name": "sourceA", "type": "F32" }, { "name": "sourceB", "type": "Optional" }, { "name": "existing", "type": "Optional>" } ], "results": [ { "name": "res", "type": "FixedVectorOfLengthAndType<[4], [F8E4M3FNUZ, F8E5M2FNUZ, F8E4M3FN, F8E5M2]>" } ], "attributes": [ { "name": "wordIndex", "type": "ConfinedAttr]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $sourceA `,` ($sourceB^):(`undef`)?\n `into` ($existing^):(`undef`)? `[` `word` $wordIndex `]`\n `:` type($sourceA) `to` type($res) (`into` type($existing)^)?" }, { "name": "amdgpu.permlane_swap", "summary": "AMDGPU permlane swap op", "description": "High-level wrapper on `rocdl.permlane{16,32}.swap` variants for permutations\n on rows of lanes in a subgroup.\n\n Supports arbitrary int/float/vector types, which will be repacked to i32 and\n one or more `rocdl.permlane_swap` ops during lowering.\n Supported lane permutations:\n - Swap the data between odd and even rows of 16 lanes\n - Swap the data between the first 32 lanes and the last 32 lanes\n\n Example:\n ```mlir\n %0 = amdgpu.permlane_swap %src 16 : f16\n %1 = amdgpu.permlane_swap %src 32 { fetch_inactive = true, bound_ctrl = true } : f16\n ```\n\n Operands:\n * `$src`: Vector register to permute across lanes of the subgroup.\n * `$row_length`: The length of a row to permute in number of lanes (valid values are 16 and 32).\n * `$fetch_inactive`: Optional. Used to dertermine behavior of a fetch from a disabled lane.\n `fetch_inactive = false`: If the source lane is disabled, use `bound_ctrl` to determine the source value.\n `fetch_inactive = true`: If the source lane is disabled, fetch the source value anyway (ignoring `bound_ctrl`).\n * `$bound_ctrl`: Optional. Used to determine what a thread should do if its source operand is from\n a disabled lane: use the value zero, or disable the write.\n `bound_ctrl = false`: Do not write when source is from a disabled lane\n `bound_ctrl = true`: Use zero as input if source is from a disabled lane\n\n Note: Lowering is only supported on gfx950 and up.", "operands": [ { "name": "src", "type": "AnyIntegerOrFloatOr1DVector" } ], "results": [ { "name": "result", "type": "AnyIntegerOrFloatOr1DVector" } ], "attributes": [ { "name": "row_length", "type": "I32Attr" }, { "name": "fetch_inactive", "type": "DefaultValuedAttr" }, { "name": "bound_ctrl", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'src']>" } ], "assemblyFormat": "$src $row_length attr-dict `:` type($result)" }, { "name": "amdgpu.permlane_var", "summary": "AMDGPU variable-selector permlane op (GFX12+)", "description": "High-level wrapper on `rocdl.permlane16.var` and `rocdl.permlanex16.var`\n for per-lane variable-selector permutations within a wave32 subgroup.\n\n Supports arbitrary int/float/vector types, which will be repacked to i32\n and one or more ROCDL intrinsic calls during lowering.\n\n - `cross = false`: intra-row permutation (each lane in a 16-lane row reads\n from a lane in the same row, selected by `$selector`). Maps to\n `rocdl.permlane16.var`.\n - `cross = true`: cross-row permutation (each lane reads from the opposite\n 16-lane row, selected by `$selector`). Maps to `rocdl.permlanex16.var`.\n\n `$selector` is an i32 VGPR providing the per-lane source-lane index.\n\n Example:\n ```mlir\n %0 = amdgpu.permlane_var %src, %sel { cross = false } : f16\n %1 = amdgpu.permlane_var %src, %sel { cross = true } : f32\n ```\n\n Note: Lowering is only supported on GFX12+.", "operands": [ { "name": "src", "type": "AnyIntegerOrFloatOr1DVector" }, { "name": "selector", "type": "I32" } ], "results": [ { "name": "result", "type": "AnyIntegerOrFloatOr1DVector" } ], "attributes": [ { "name": "cross", "type": "DefaultValuedAttr" }, { "name": "fetch_inactive", "type": "DefaultValuedAttr" }, { "name": "bound_ctrl", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'src']>" } ], "assemblyFormat": "$src `,` $selector attr-dict `:` type($result)" }, { "name": "amdgpu.raw_buffer_atomic_cmpswap", "summary": "Raw Buffer Atomic compare-and-swap", "description": "The `amdgpu.raw_buffer_atomic_cmpswap` op is a wrapper around the\n buffer-based atomic compare-and-swap min available on AMD GPUs.\n\n The index into the buffer is computed as for `memref.store` with the addition\n of `indexOffset` (which is used to aid in emitting vectorized code) and,\n if present `sgprOffset` (which is added after bounds checks and includes\n any non-zero offset on the memref type).\n\n All indexing components are given in terms of the memref's element size, not\n the byte lengths required by the intrinsic.\n\n Out of bounds atomic operations are ignored in hardware.\n\n See `amdgpu.raw_buffer_load` for a description of how the underlying\n instruction is constructed.", "operands": [ { "name": "src", "type": "AnyType" }, { "name": "cmp", "type": "AnyType" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "results": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['src', 'cmp', 'value']>" } ], "assemblyFormat": "attr-dict $src `,` $cmp `->` $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($value) `->` type($memref) `,` type($indices)" }, { "name": "amdgpu.raw_buffer_atomic_fadd", "summary": "Raw Buffer Floating-point Atomic Add (MI-* only)", "description": "The `amdgpu.raw_buffer_atomic_fadd` op is a wrapper around the\n buffer-based atomic floating point addition available on the MI-* series\n of AMD GPUs.\n\n The index into the buffer is computed as for `memref.store` with the addition\n of `indexOffset` (which is used to aid in emitting vectorized code) and,\n if present `sgprOffset` (which is added after bounds checks and includes\n any non-zero offset on the memref type).\n\n All indexing components are given in terms of the memref's element size, not\n the byte lengths required by the intrinsic.\n\n The op returns the value observed before the atomic update.\n\n See `amdgpu.raw_buffer_load` for a description of how the underlying\n instruction is constructed.", "operands": [ { "name": "value", "type": "AnyTypeOf<[F32, VectorOfLengthAndType<[2], [F16, BF16]>]>" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "results": [ { "name": "oldValue", "type": "AnyTypeOf<[F32, VectorOfLengthAndType<[2], [F16, BF16]>]>" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['oldValue', 'value']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $value `->` $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($value) `->` type($memref) `,` type($indices)" }, { "name": "amdgpu.raw_buffer_atomic_fmax", "summary": "Raw Buffer Floating-point Atomic Max (non-GFX9)", "description": "The `amdgpu.raw_buffer_atomic_fmax` op is a wrapper around the\n buffer-based atomic floating point max available on AMD GPUs (except GFX9).\n\n The index into the buffer is computed as for `memref.store` with the addition\n of `indexOffset` (which is used to aid in emitting vectorized code) and,\n if present `sgprOffset` (which is added after bounds checks and includes\n any non-zero offset on the memref type).\n\n All indexing components are given in terms of the memref's element size, not\n the byte lengths required by the intrinsic.\n\n The op returns the value observed before the atomic update. Out of bounds\n atomic operations are ignored in hardware.\n\n See `amdgpu.raw_buffer_load` for a description of how the underlying\n instruction is constructed.", "operands": [ { "name": "value", "type": "AnyTypeOf<[F32, F64]>" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "results": [ { "name": "oldValue", "type": "AnyTypeOf<[F32, F64]>" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['oldValue', 'value']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $value `->` $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($value) `->` type($memref) `,` type($indices)" }, { "name": "amdgpu.raw_buffer_atomic_smax", "summary": "Raw Buffer Signed Integer Atomic Max", "description": "The `amdgpu.raw_buffer_atomic_smax` op is a wrapper around the\n buffer-based atomic signed integer max available on AMD GPUs.\n\n The index into the buffer is computed as for `memref.store` with the addition\n of `indexOffset` (which is used to aid in emitting vectorized code) and,\n if present `sgprOffset` (which is added after bounds checks and includes\n any non-zero offset on the memref type).\n\n All indexing components are given in terms of the memref's element size, not\n the byte lengths required by the intrinsic.\n\n The op returns the value observed before the atomic update. Out of bounds\n atomic operations are ignored in hardware.\n\n See `amdgpu.raw_buffer_load` for a description of how the underlying\n instruction is constructed.", "operands": [ { "name": "value", "type": "I32" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "results": [ { "name": "oldValue", "type": "I32" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['oldValue', 'value']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $value `->` $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($value) `->` type($memref) `,` type($indices)" }, { "name": "amdgpu.raw_buffer_atomic_umin", "summary": "Raw Buffer Unsigned Integer Atomic Min", "description": "The `amdgpu.raw_buffer_atomic_umin` op is a wrapper around the\n buffer-based atomic signed integer min available on AMD GPUs.\n\n The index into the buffer is computed as for `memref.store` with the addition\n of `indexOffset` (which is used to aid in emitting vectorized code) and,\n if present `sgprOffset` (which is added after bounds checks and includes\n any non-zero offset on the memref type).\n\n All indexing components are given in terms of the memref's element size, not\n the byte lengths required by the intrinsic.\n\n The op returns the value observed before the atomic update. Out of bounds\n atomic operations are ignored in hardware.\n\n See `amdgpu.raw_buffer_load` for a description of how the underlying\n instruction is constructed.", "operands": [ { "name": "value", "type": "I32" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "results": [ { "name": "oldValue", "type": "I32" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['oldValue', 'value']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $value `->` $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($value) `->` type($memref) `,` type($indices)" }, { "name": "amdgpu.raw_buffer_load", "summary": "Raw Buffer load, exposing GCN features", "description": "The `amdgpu.raw_buffer_load` op is a wrapper around the buffer load intrinsics\n available on AMD GPUs, including extensions in newer GPUs.\n\n The index into the buffer is computed as for `memref.load` with the additon\n of `indexOffset` and `sgprOffset` (which **may or may not** be considered\n in bounds checks and includes any offset present on the memref type if it's\n non-zero).\n\n All indices and offsets are in units of the memref's data type and are\n converted to bytes during lowering.\n\n When a load is out of bounds, the instruction returns zero.\n Partially-out of bounds have chipset-dependent behavior: whether reading\n 2 elements starting at index 7 of a `memref<8xf32>` returns the last element\n in the first vector component depends on the architecture.\n\n The memref struct is converted into a buffer resource (a V#) and the arguments\n are translated to intrinsic arguments as follows:\n - The base address of the buffer is the base address of the memref\n - The stride is 0 to enable raw mode\n - The number of records is the size of the memref, in bytes\n In the case of dynamically-shaped memrefs, this is computed at runtime\n as max_d (size(d) * stride(d)) * sizeof(elementType(memref))\n - The offset enable bit is 1, the index enable bit is 0.\n - The thread ID addition bit is off\n - If `boundsCheck` is false and the target chipset is RDNA, OOB_SELECT is set\n to 2 to disable bounds checks, otherwise it is 3\n - The cache coherency bits are off", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "results": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($memref) (`,` type($indices)^)? `->` type($value)" }, { "name": "amdgpu.raw_buffer_store", "summary": "Raw Buffer Store, exposing GCN features", "description": "The `amdgpu.raw_buffer_store` op is a wrapper around the buffer store\n intrinsics available on AMD GPUs, including extensions in newer GPUs.\n\n The store index is computed as in `memref.store` with the addition of\n `indexOffset` (which is included for uniformity with atomics and may be useful\n when writing vectorized code) and `sgprOffset` (which is added after bounds\n checks and implicitly includes the offset of the memref type if non-zero).\n All index components are in terms of the elements of the memref, not bytes,\n and are scaled up appropriately.\n\n Out of bounds stores are ignored in hardware.\n Wthether a vector write that includes some in-bounds and soeme out-of-bounds\n components is partically completed is chipset-dependent.\n\n See `amdgpu.raw_buffer_load` for a description of how the underlying\n instruction is constructed.", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "sgprOffset", "type": "Optional" } ], "attributes": [ { "name": "boundsCheck", "type": "DefaultValuedAttr" }, { "name": "indexOffset", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $value `->` $memref `[` $indices `]`\n (`sgprOffset` $sgprOffset^)? `:`\n type($value) `->` type($memref) (`,` type($indices)^)?" }, { "name": "amdgpu.scaled_ext_packed", "summary": "Extend a vector of packed floating point values", "description": "Extend and scale two packed floats in `source[index]` to two floats and\n return them.\n\n This rather unusual signature arises from the fact that AMD GPUs cannot\n easily work with sub 32-bit quantities, so the compiler intrinsics for\n extending 8-bit floats (which are, currently, the only way to work with\n this operation) take packed vectors of 2 such floats.\n\n If the passed-in vector has fewer than two elements, or the input is scalar,\n the remaining values in the <2 x i8> will be filled with\n undefined values as needed.", "operands": [ { "name": "source", "type": "AnyTypeOf<[VectorOfLengthAndType<[1, 2, 3, 4], [F8E5M2, F8E4M3FN]>, VectorOfLengthAndType<[1, 2, 3, 4, 5, 6, 7, 8], [F4E2M1FN]>]>" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[FixedVectorOfLengthAndType<[2], [F32]>, FixedVectorOfLengthAndType<[2], [F16]>, FixedVectorOfLengthAndType<[2], [BF16]>]>" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr]>" } ], "assemblyFormat": "attr-dict $source `[` $index `]` `,` $scale `:` type($source) `to` type($res)" }, { "name": "amdgpu.scaled_ext_packed_matrix", "summary": "Extend a wave-wide matrix of packed floating point values", "description": "Extend matrix of microfloats (8 or 16 elements per lane) using a set of scales\n that may be stored on other lanes.\n\n The scales applied to the input microfloats are stored in bytes which\n come from the `scales` input provided in a *half* of the wave identified\n by `firstScaleLane`. The bytes used is selected by `firstScaleByte` and depends\n on the type of `source`. The 16 vectors in consecutive lanes starting from\n `firstScaleLane` (which we'll call the scale vectors) will be used by both\n halves of the wave (with lane L reading from L % 16'th scale vector).\n\n When `source` is either F4E2M1FN, F6E2M3FN, or F6E3M2FN each half of the\n wave will use a different byte. The first one being `firstScaleByte` and\n the second one being `firstScaleByte` + 1. When the block size is 32,\n `firstScaleByte` can be either 0 or 2, selecting halves of the scale vectors.\n Lanes 0-15 will read from `firstScaleByte` and lanes 16-31 will read\n from `firstScaleByte` + 1.\n\n\n For example:\n ```mlir\n // Input: 8-element vector of F8E4M3FN, converting to F32\n // Lanes 0-15 read from byte 0, lanes 16-31 read from byte 1\n %result = amdgpu.scaled_ext_packed_matrix %source scale(%scales)\n blockSize(32) firstScaleLane(0) firstScaleByte(0)\n : vector<8xf8E4M3FN>, vector<4xf8E8M0FNU> -> vector<8xf32>\n\n // Input: 16-element vector of F6E2M3FN, converting to F16\n // Lanes 0-15 read from byte 2, lanes 16-31 read from byte 3\n %result = amdgpu.scaled_ext_packed_matrix %source scale(%scales)\n blockSize(32) firstScaleLane(16) firstScaleByte(2)\n : vector<16xf6E2M3FN>, vector<4xf8E8M0FNU> -> vector<16xf16>\n ```\n\n When `source` is either F4E2M1FN, F6E2M3FN, or F6E3M2FN and\n the block size is 16, `firstScaleByte` can be 0 or 1.\n Lanes 0-15 read from the `firstScaleByte`th element of the scale vectors,\n while lanes 16-31 read from `firstScaleByte` + 2.\n For example:\n ```mlir\n // Input: 8-element vector of F8E5M2, converting to BF16\n // Lanes 0-15 read from byte 0, lanes 16-31 read from byte 2 (0+2)\n %result = amdgpu.scaled_ext_packed_matrix %source scale(%scales)\n blockSize(16) firstScaleLane(0) firstScaleByte(0)\n : vector<8xf8E5M2>, vector<4xf8E8M0FNU> -> vector<8xbf16>\n\n // Input: 16-element vector of F6E3M2FN, converting to F32\n // Lanes 0-15 read from byte 1, lanes 16-31 read from byte 3 (1+2)\n %result = amdgpu.scaled_ext_packed_matrix %source scale(%scales)\n blockSize(16) firstScaleLane(16) firstScaleByte(1)\n : vector<16xf6E3M2FN>, vector<4xf8E8M0FNU> -> vector<16xf32>\n ```\n\n Note: the layout for the scales generally mirrors how the WMMA\n instructions use for matrix scales. These selection operands allows\n one to choose portions of the matrix to convert.\n\n When `source` is either F8E4M3FN or F8E5M2 and `blockSize` is 32,\n then the same byte will be used by both halves of the wave.\n In this case, `firstScaleByte` can be any value from 0 to 3.\n\n When `source` is either F8E4M3FN or F8E5M2 and `blockSize` is 16,\n following combinations are allowed:\n * `firstScaleLane(0), firstScaleByte(0)`\n * `firstScaleLane(16), firstScaleByte(2)`\n all other combinations are reserved.\n\n Available on gfx1250+.", "operands": [ { "name": "source", "type": "AnyTypeOf<[FixedVectorOfShapeAndType<[8], F4E2M1FN>, FixedVectorOfShapeAndType<[8], F8E4M3FN>, FixedVectorOfShapeAndType<[8], F8E5M2>, FixedVectorOfShapeAndType<[16], F6E2M3FN>, FixedVectorOfShapeAndType<[16], F6E3M2FN>]>" }, { "name": "scale", "type": "FixedVectorOfShapeAndType<[4], F8E8M0FNU>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[FixedVectorOfShapeAndType<[8], F32>, FixedVectorOfShapeAndType<[8], F16>, FixedVectorOfShapeAndType<[8], BF16>, FixedVectorOfShapeAndType<[16], F32>, FixedVectorOfShapeAndType<[16], F16>, FixedVectorOfShapeAndType<[16], BF16>]>" } ], "attributes": [ { "name": "blockSize", "type": "ConfinedAttr]>" }, { "name": "firstScaleLane", "type": "ConfinedAttr]>" }, { "name": "firstScaleByte", "type": "ConfinedAttr, IntMaxValue<3>]>" } ], "assemblyFormat": "attr-dict $source\n `scale` `(` $scale `)`\n `blockSize` `(` $blockSize `)`\n `firstScaleLane` `(` $firstScaleLane`)`\n `firstScaleByte` `(` $firstScaleByte `)`\n `:` type($source) `,` type($scale) `->` type($res)" }, { "name": "amdgpu.scaled_ext_packed816", "summary": "Extend a vector of packed floating point values", "description": "The scales applied to the input microfloats are stored in bytes which\n come from the `scales` input provided in a *half* of the wave identified\n by `firstScaleLane`. The bytes used is selected by `firstScaleByte` and depends\n on the type of `source`. The 16 vectors in consecutive lanes starting from\n `firstScaleLane` (which we'll call the scale vectors) will be used by both\n halves of the wave (with lane L reading from L % 16'th scale vector).\n\n When `source` is either F4E2M1FN, F6E2M3FN, or F6E3M2FN each half of the\n wave will use a different byte. The first one being `firstScaleByte` and\n the second one being `firstScaleByte` + 1. When the block size is 32,\n `firstScaleByte` can be either 0 or 2, selecting halves of the scale vectors.\n Lanes 0-15 will read from `firstScaleByte` and lanes 16-31 will read\n from `firstScaleByte` + 1.\n\n\n For example:\n ```mlir\n // Input: 8-element vector of F8E4M3FN, converting to F32\n // Lanes 0-15 read from byte 0, lanes 16-31 read from byte 1\n %result = amdgpu.scaled_ext_packed816 %source scale(%scales)\n blockSize(32) firstScaleLane(0) firstScaleByte(0)\n : vector<8xf8E4M3FN>, vector<4xf8E8M0FNU> -> vector<8xf32>\n\n // Input: 16-element vector of F6E2M3FN, converting to F16\n // Lanes 0-15 read from byte 2, lanes 16-31 read from byte 3\n %result = amdgpu.scaled_ext_packed816 %source scale(%scales)\n blockSize(32) firstScaleLane(1) firstScaleByte(2)\n : vector<16xf6E2M3FN>, vector<4xf8E8M0FNU> -> vector<16xf16>\n ```\n\n When `source` is either F4E2M1FN, F6E2M3FN, or F6E3M2FN and\n the block size is 16, `firstScaleByte` can be 0 or 1.\n Lanes 0-15 read from the `firstScaleByte`th element of the scale vectors,\n while lanes 16-31 read from `firstScaleByte` + 2.\n For example:\n ```mlir\n // Input: 8-element vector of F8E5M2, converting to BF16\n // Lanes 0-15 read from byte 0, lanes 16-31 read from byte 2 (0+2)\n %result = amdgpu.scaled_ext_packed816 %source scale(%scales)\n blockSize(16) firstScaleLane(0) firstScaleByte(0)\n : vector<8xf8E5M2>, vector<4xf8E8M0FNU> -> vector<8xbf16>\n\n // Input: 16-element vector of F6E3M2FN, converting to F32\n // Lanes 0-15 read from byte 1, lanes 16-31 read from byte 3 (1+2)\n %result = amdgpu.scaled_ext_packed816 %source scale(%scales)\n blockSize(16) firstScaleLane(1) firstScaleByte(1)\n : vector<16xf6E3M2FN>, vector<4xf8E8M0FNU> -> vector<16xf32>\n ```\n\n Note: the layout for the scales generally mirrors how the WMMA\n instructions use for matix scales. These selection operands allows\n one to choose portions of the matrix to convert.\n\n When `source` is either F8E4M3FN or F8E5M2 and `blockSize` is 32,\n then the same byte will be used by both halves of the wave.\n In this case, `firstScaleByte` can be any value from 0 to 3.\n\n When `source` is either F8E4M3FN or F8E5M2 and `blockSize` is 16,\n following combinations are allowed:\n * `firstScaleLane(0), firstScaleByte(0)`\n * `firstScaleLane(1), firstScaleByte(2)`\n all other combinations are reserved.\n\n Available on gfx1250+.", "operands": [ { "name": "source", "type": "AnyTypeOf<[FixedVectorOfShapeAndType<[8], F4E2M1FN>, FixedVectorOfShapeAndType<[8], F8E4M3FN>, FixedVectorOfShapeAndType<[8], F8E5M2>, FixedVectorOfShapeAndType<[16], F6E2M3FN>, FixedVectorOfShapeAndType<[16], F6E3M2FN>]>" }, { "name": "scale", "type": "FixedVectorOfShapeAndType<[4], F8E8M0FNU>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[FixedVectorOfShapeAndType<[8], F32>, FixedVectorOfShapeAndType<[8], F16>, FixedVectorOfShapeAndType<[8], BF16>, FixedVectorOfShapeAndType<[16], F32>, FixedVectorOfShapeAndType<[16], F16>, FixedVectorOfShapeAndType<[16], BF16>]>" } ], "attributes": [ { "name": "blockSize", "type": "ConfinedAttr" }, { "name": "firstScaleLane", "type": "ConfinedAttr, IntMaxValue<1>]>" }, { "name": "firstScaleByte", "type": "ConfinedAttr, IntMaxValue<3>]>" } ], "assemblyFormat": "attr-dict $source\n `scale` `(` $scale `)`\n `blockSize` `(` $blockSize `)`\n `firstScaleLane` `(` $firstScaleLane`)`\n `firstScaleByte` `(` $firstScaleByte `)`\n `:` type($source) `,` type($scale) `->` type($res)" }, { "name": "amdgpu.scaled_mfma", "summary": "MLIR wrapper for CDNA scaled mfma instructions", "description": "The `amdgpu.scaled_mfma` op is an MLIR wrapper around intrinsics\n for various scaled versions of `mfma` instructions in the CDNA architecture, which\n perform multiple outer products in order to allow fast matrix multiplication.\n\n The wrapper will select an appropriate `mfma` instruction, if one is available,\n based on the provided `m`, `k`, `n`, and `nBlks` attributes, along with the\n types of the source and destination arguments.\n\n Note, this wrapper allows specifying `vector<4Kxi8>` arguments to MFMA\n intrinsics that take an integer type of width `4K`. For example,\n one can provide a `vector<4xi8>` as an argument to an MFMA instruction that\n logically takes 4 i8s but whose intrinsics are specified to take an i32.\n In these cases, the bytes in the vector will be concatenated in little-endian\n order (that is, v[0] will go to arg[7:0], v[1] to arg[15:8] and so on).\n\n This wrapper takes inspiration from `amdgpu.mfma`, but has some key differences:\n - `amdgpu.scaled_mfma` operates on fp4 (f4E2M1FN), fp6 (f6E2M3FN and f6E3M2FN) and\n fp8 (f8E4M3FN and f8E5M2) types using either M=N=16, K=128 or M=N=32, K=64 as\n their tile size.\n - `amdgpu.scaled_mfma` does not support broadcasting. So, `cbsz`, `abid`, and `blgp`\n are omitted from this wrapper.\n - The `negateA`, `negateB`, and `negateC` flags in `amdgpu.mfma` are only supported\n for double-precision operations on gfx94x and so are not included here.\n\n Example:\n ```mlir\n %0 = amdgpu.scaled_mfma 32x32x64 (%arg0[0] * %arg1) * (%arg0[1] * %arg1) + %arg2\n : vector<4xf8E8M0FNU>, vector<32xf6E2M3FN>, f8E8M0FNU, vector<32xf6E2M3FN>, vector<16xf32>\n ```", "operands": [ { "name": "sourceA", "type": "ScaledMFMAInTypes" }, { "name": "sourceB", "type": "ScaledMFMAInTypes" }, { "name": "destC", "type": "ScaledMFMAOutTypes" }, { "name": "scalesA", "type": "AnyTypeOf<[F8E8M0FNU, FixedVectorOfLengthAndType<[4], [F8E8M0FNU]>]>" }, { "name": "scalesB", "type": "AnyTypeOf<[F8E8M0FNU, FixedVectorOfLengthAndType<[4], [F8E8M0FNU]>]>" } ], "results": [ { "name": "destD", "type": "ScaledMFMAOutTypes" } ], "attributes": [ { "name": "m", "type": "ConfinedAttr]>" }, { "name": "n", "type": "ConfinedAttr]>" }, { "name": "k", "type": "ConfinedAttr]>" }, { "name": "scalesIdxA", "type": "ConfinedAttr]>" }, { "name": "scalesIdxB", "type": "ConfinedAttr]>" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "custom($m, $n, $k) ` `\n `(` $scalesA `[` $scalesIdxA `]` `*` $sourceA `)` `*`\n `(` $scalesB `[` $scalesIdxB `]` `*` $sourceB `)` `+` $destC\n attr-dict\n `:` type($scalesA) `,` type($sourceA) `,` type($scalesB) `,` type($sourceB) `,` type($destC)" }, { "name": "amdgpu.scaled_wmma", "summary": "MLIR wrapper for scaled wmma instructions", "description": "The `amdgpu.scaled_wmma` op is an MLIR wrapper around intrinsics for scaled\n `wmma` instructions. These instructions perform matrix multiplication with\n per-block scaling of inputs, supporting fp4, fp6, and fp8 data formats.\n\n The scale instructions support a block size of 16 or 32 and two tile sizes:\n - 16x16x128 with mixed f8/f6/f4 formats (output: vector<8xf32>)\n - 32x16x128 with f4 format only (output: vector<16xf32>)\n\n Scale parameters (`scaleA`, `scaleB`) are small vectors of f8 scale values\n (either f8E8M0FNU, or f8E4M3FN) that are packed into i32/i64 values during\n lowering. Each lane can operate on 4 bytes (4 scale values), and the\n number of scales required for each matrix is determined by:\n num_scales_A = (M × K) / block_size\n num_scales_B = (N × K) / block_size\n\n The index attributes (`a_first_scale_lane`, `b_first_scale_lane`) select\n which lane to start reading scale values from (0 or 16):\n - For block size 32, 32 lanes across a single wave are used for the scale\n values. If the number of scales (num_scales_A or num_scales_B) can fit\n into half of the available lanes\n (i.e., num_scales / scales_per_lane == 16 (num_lanes)),\n then then first_scale_lane can be either 0 or 16. If all lanes are required\n for storing the scale values (num_scales / scales_per_lane == 32 (num_lanes)),\n then the first_scale_lane must be 0.\n - For block size 16, the same rules apply as above except that there are 64\n lanes across two waves that are used for the scale values. When\n num_scales / scales_per_lane == 32 (num lanes), then 16 lanes from each wave are used.\n first_scale_lane of 0 or 16 will decide which lanes are used for this. When\n num_scales / scales_per_lane == 64 (num_lanes), then first_scale_lane must\n be set to 0.\n\n Example:\n ```mlir\n // 16x16x128: fp8 inputs\n %0 = amdgpu.scaled_wmma 16x16x128 (%scaleVecA * %matA) * (%scaleVecB * %matB) + %matC\n {a_first_scale_lane = 0 : i32, b_first_scale_lane = 0 : i32}\n : vector<4xf8E8M0FNU>, vector<64xf8E4M3FN>,\n vector<4xf8E8M0FNU>, vector<64xf8E4M3FN>, vector<8xf32>\n\n // 32x16x128: fp4 inputs with different scale lanes\n %1 = amdgpu.scaled_wmma 32x16x128 (%scaleVecD * %matD) * (%scaleVecE * %matE) + %matF\n {a_first_scale_lane = 0 : i32, b_first_scale_lane = 16 : i32}\n : vector<8xf8E4M3FN>, vector<128xf4E2M1FN>,\n vector<8xf8E4M3FN>, vector<64xf4E2M1FN>, vector<16xf32>\n ```", "operands": [ { "name": "sourceA", "type": "ScaledWMMAInTypes" }, { "name": "sourceB", "type": "ScaledWMMAInTypes" }, { "name": "destC", "type": "ScaledWMMAOutTypes" }, { "name": "scaleA", "type": "VectorOfLengthAndType<[4, 8], [F8E8M0FNU, F8E4M3FN]>" }, { "name": "scaleB", "type": "VectorOfLengthAndType<[4, 8], [F8E8M0FNU, F8E4M3FN]>" } ], "results": [ { "name": "destD", "type": "ScaledWMMAOutTypes" } ], "attributes": [ { "name": "m", "type": "ConfinedAttr]>" }, { "name": "n", "type": "ConfinedAttr]>" }, { "name": "k", "type": "ConfinedAttr]>" }, { "name": "a_first_scale_lane", "type": "ConfinedAttr]>" }, { "name": "b_first_scale_lane", "type": "ConfinedAttr]>" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "custom($m, $n, $k) ` `\n `(` $scaleA `*` $sourceA `)` `*`\n `(` $scaleB `*` $sourceB `)` `+` $destC\n attr-dict\n `:` type($scaleA) `,` type($sourceA) `,` type($scaleB) `,` type($sourceB) `,` type($destC)" }, { "name": "amdgpu.sched_barrier", "summary": "Barrier that limits the backend scheduler of instruction movement", "description": "`amdgpu.sched_barrier` serves as a barrier that could be\n configured to restrict movements of instructions through it as\n defined by the ROCDL scheduling group mask enum.", "attributes": [ { "name": "opts", "type": "ROCDL_SchedGroupMaskAttr{none|non_mem_non_sideeffect|valu|salu|mfma_wmma|all_vmem|vmem_read|vmem_write|all_ds|ds_read|ds_write|transcendental|ldsdma|all}" } ], "assemblyFormat": "`allow` `=` $opts attr-dict" }, { "name": "amdgpu.sparse_mfma", "summary": "MLIR wrapper for CDNA sparse mfma (smfmac) instructions", "description": "The `amdgpu.sparse_mfma` op is an MLIR wrapper around intrinsics for various\n `smfmac` instructions in the AMDGPU architecture, which perform matrix\n multiply-accumulate operations using 2:4 structured sparsity on matrix A\n with dense matrices B, C, and D.\n\n On gfx942, smfmac intrinsics support:\n - M=N=16, K=32 and M=N=32, K=16 for f16 and bf16 sources\n - M=N=16, K=64 and M=N=32, K=32 for i8 and fp8 sources\n\n On gfx950, smfmac intrinsics additionally support:\n - M=N=16, K=64 and M=N=32, K=32 for f16 and bf16 sources\n - M=N=16, K=128 and M=N=32, K=64 for i8 and fp8 sources\n\n The `sparseIdx` parameter contains packed 2-bit indices identifying which\n of every 4 dense-K positions are non-zero in the 2:4 sparse matrix A.\n The required `sparseIdx` type depends on the variant:\n - gfx942 16-bit (`(m,k)` in `{(16,32), (32,16)}`): 8 bits per lane,\n carried as `vector<4xi8>` (one 8-bit set per i8 element).\n - gfx942 8-bit (`(m,k)` in `{(16,64), (32,32)}`) and gfx950 16-bit\n (`(m,k)` in `{(16,64), (32,32)}`): 16 bits per lane, carried as\n `vector<2xi16>` (one 16-bit set per i16 element).\n - gfx950 8-bit (`(m,k)` in `{(16,128), (32,64)}`): 32 bits per lane (a\n full VGPR with no internal set structure), carried as `i32`.\n\n The `cbsz` and `abid` parameters select which index set within the VGPR is\n used:\n - gfx942 16-bit: `cbsz == 0` selects one of four 8-bit sets via\n `abid[1:0]` (range `[0, 3]`); `cbsz != 0` selects the first set.\n - gfx942 8-bit and gfx950 16-bit: `cbsz == 0` selects one of two 16-bit\n sets via `abid[0]` (range `[0, 1]`); `cbsz != 0` selects the first set.\n - gfx950 8-bit: hardware ignores both `cbsz` and `abid`; both must be 0.\n\n Example:\n ```mlir\n %0 = amdgpu.sparse_mfma 16x16x32 %matA * %matB + %matC sparse(%idx : vector<4xi8>)\n : vector<4xf16>, vector<8xf16>, vector<4xf32>\n\n %1 = amdgpu.sparse_mfma 16x16x64 %matA * %matB + %matC sparse(%idx : vector<2xi16>)\n : vector<8xi8>, vector<16xi8>, vector<4xi32>\n\n %2 = amdgpu.sparse_mfma 16x16x64 %matA * %matB + %matC sparse(%idx : vector<2xi16>)\n { cbsz = 0 : i32, abid = 1 : i32 }\n : vector<8xf8E4M3FNUZ>, vector<16xf8E4M3FNUZ>, vector<4xf32>\n\n %3 = amdgpu.sparse_mfma 16x16x128 %matA * %matB + %matC sparse(%idx : i32)\n : vector<16xf8E4M3FN>, vector<32xf8E4M3FN>, vector<4xf32>\n ```", "operands": [ { "name": "sourceA", "type": "SMFMACSparseInTypes" }, { "name": "sourceB", "type": "SMFMACDenseInTypes" }, { "name": "destC", "type": "SMFMACOutTypes" }, { "name": "sparseIdx", "type": "SMFMACIdxTypes" } ], "results": [ { "name": "destD", "type": "SMFMACOutTypes" } ], "attributes": [ { "name": "m", "type": "ConfinedAttr]>" }, { "name": "n", "type": "ConfinedAttr]>" }, { "name": "k", "type": "ConfinedAttr]>" }, { "name": "cbsz", "type": "DefaultValuedAttr" }, { "name": "abid", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "custom($m, $n, $k) $sourceA `*` $sourceB `+` $destC\n `sparse` `(` $sparseIdx `:` type($sparseIdx) `)`\n attr-dict\n `:` type($sourceA) `,` type($sourceB) `,` type($destC)" }, { "name": "amdgpu.sparse_wmma", "summary": "MLIR wrapper for gfx12+ sparse wmma instructions", "description": "The `amdgpu.sparse_wmma` op is an MLIR wrapper around intrinsics for various\n `swmmac` instructions in the AMDGPU architecture, which perform matrix\n multiply-accumulate operations using 2:4 structured sparsity on matrix A\n with dense matrices B, C, and D.\n\n On gfx12, swmmac intrinsics support:\n - M=N=16, K=32 and M=N=32, K=16 for f16, bf16, i8 and i4 sources\n - M=N=16, K=64 for i4 sources\n\n On gfx1250, swmmac intrinsics additionally support:\n - M=N=16, K=64 for f16 and bf16 sources\n - M=N=16, K=128 for f16, bf16 and i8 sources\n\n The `sparseIdx` parameter contains packed indices identifying the positions\n of non-zero elements in the 2:4 sparse matrix A. For 16-bit source data,\n use `vector<4xi8>` (four 8-bit indices). For 8-bit source data, use\n `vector<2xi16>` (two 16-bit indices).\n\n `unsignedA` and `unsignedB` flag that the `int8` LLVM inputs are unsigned.\n\n The `clamp` flag is used to saturate the output of type T to `numeric_limits::max()`\n in case of overflow.\n\n Example:\n ```mlir\n %0 = amdgpu.sparse_wmma 16x16x32 %matA * %matB + %matC sparse(%idx : vector<4xi8>)\n : vector<4xf16>, vector<8xf16>, vector<4xf32>\n\n %1 = amdgpu.sparse_wmma 16x16x64 %matA * %matB + %matC sparse(%idx : vector<2xi16>)\n : vector<8xi8>, vector<16xi8>, vector<4xi32>\n\n %2 = amdgpu.sparse_wmma 16x16x64 %matA * %matB + %matC sparse(%idx : vector<2xi16>)\n { unsignedA = 0 : i1, unsignedB = 1 : i1, clamp = 0 : i1 }\n : vector<8xf8E4M3FNUZ>, vector<16xf8E4M3FNUZ>, vector<4xf32>\n ```", "operands": [ { "name": "sourceA", "type": "SWMMACSparseInTypes" }, { "name": "sourceB", "type": "SWMMACDenseInTypes" }, { "name": "destC", "type": "SWMMACOutTypes" }, { "name": "sparseIdx", "type": "SWMMACIdxTypes" } ], "results": [ { "name": "destD", "type": "SWMMACOutTypes" } ], "attributes": [ { "name": "m", "type": "ConfinedAttr]>" }, { "name": "n", "type": "ConfinedAttr]>" }, { "name": "k", "type": "ConfinedAttr]>" }, { "name": "unsignedA", "type": "UnitAttr" }, { "name": "unsignedB", "type": "UnitAttr" }, { "name": "reuseA", "type": "UnitAttr" }, { "name": "reuseB", "type": "UnitAttr" }, { "name": "clamp", "type": "UnitAttr" }, { "name": "wave64", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "custom($m, $n, $k) $sourceA `*` $sourceB `+` $destC\n `sparse` `(` $sparseIdx `:` type($sparseIdx) `)`\n attr-dict\n `:` type($sourceA) `,` type($sourceB) `,` type($destC)" }, { "name": "amdgpu.swizzle_bitmode", "summary": "AMDGPU ds_swizzle op, bitmode variant", "description": "High-level wrapper on bitmode `rocdl.ds_swizzle` op, masks are represented\n as separate fields so user won't need to do manual bitpacking.\n\n Supports arbitrary int/float/vector types, which will be repacked to i32 and\n one or more `rocdl.ds_swizzle` ops during lowering.", "operands": [ { "name": "src", "type": "AnyIntegerOrFloatOr1DVector" } ], "results": [ { "name": "result", "type": "AnyIntegerOrFloatOr1DVector" } ], "attributes": [ { "name": "and_mask", "type": "I32Attr" }, { "name": "or_mask", "type": "I32Attr" }, { "name": "xor_mask", "type": "I32Attr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'src']>" } ], "assemblyFormat": "$src $and_mask $or_mask $xor_mask attr-dict `:` type($result)" }, { "name": "amdgpu.tensor_load_to_lds", "summary": "Load tensors from global memory to LDS.", "description": "Load tensors of up to five dimensions from global memory to LDS.\n\n This operation was introduced in gfx1250.", "operands": [ { "name": "desc", "type": "AMDGPU_TDMDescriptorType" } ], "assemblyFormat": "$desc attr-dict `:` qualified(type($desc))" }, { "name": "amdgpu.tensor_store_from_lds", "summary": "Store tensors from LDS to global memory.", "description": "Store tensors of up to five dimensions from LDS to global memory.\n\n This operation was introduced in gfx1250.", "operands": [ { "name": "desc", "type": "AMDGPU_TDMDescriptorType" } ], "assemblyFormat": "$desc attr-dict `:` qualified(type($desc))" }, { "name": "amdgpu.transpose_load", "summary": "MLIR wrapper for CDNA transpose Load instructions", "description": "The `amdgpu.transpose_load` op is a wrapper around the `ds_read_tr` instructions\n on gfx9 and the `ds_load_tr` family of instructions on gfx1250.\n\n The transpose load op represents a subgroup load from LDS memory,\n where the subgroup of threads collectively reads a matrix from the source\n memref, with each thread reading a vector of the matrix, and gets a transposed matrix\n in as the result. That is, each thread reads a vector of the col-major matrix at different\n indices, and the thread's read result is a vector of the corresponding row of the transposed\n matrix.\n\n This op is a direct wrapper around the ROCDL `ds_read_tr` family intrinsics on\n gfx950 and the `ds_load_tr` family of instructions on gfx1250. Please refer\n to the respective ISA documentation for more details about its exact semantics.\n\n Format example:\n ```\n %0 = amdgpu.transpose_load %src[%srcIndices] : memref<128x256xf16> -> vector<4xf16>\n ```\n Operands:\n * `$src`: LDS memref to read from.\n * `$srcIndices`: indices into `$src` to read from for this thread. Indices\n must be non-negative and in-bounds for the corresponding dimension of\n `$src`, matching the constraints of `memref.load`.\n * `$result`: target register this transpose load instruction will write to.\n\n Note: Lowering is only supported on gfx950 and gfx1250, with different\n permitted load types.", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "srcIndices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyVectorOfNonZeroRank]>" } ], "assemblyFormat": "$src `[` $srcIndices `]` attr-dict `:` type($src) `->` type($result)" }, { "name": "amdgpu.wmma", "summary": "MLIR wrapper for wmma instructions", "description": "The `amdgpu.wmma` op is an MLIR wrapper around intrinsics for various `wmma`\n instructions in the AMDGPU architecture, which perform matrix multiplication.\n\n On gfx11/RDNA3, wmma intrinsics have M=N=K=16 dimensions.\n\n On gfx12/RDNA4, wmma intrinsics have M=N=16 dimensions and support K=16 for\n all element types, and K=32 for i4 sources.\n\n On gfx1250, wmma intrinsics have M=N=16 and K dimensions of 4, 32, 64, or 128,\n depending on the element types.\n\n On gfx11/RDNA3, emitting f16->f16 (or bf16->bf16) wmma the output is a 16xf16\n (or 16xbf16) vector containing only 8 valid values:\n - If `subwordOffset` is 0, then the output is stored at indices 0, 2, 4, ..., 14.\n - If `subwordOffset` is 1, then the output is stored at indices 1, 3, 5, ..., 15.\n On gfx12/RDNA4 and gfx1250, the result is instead returned as vector where all\n the values are valid and the `subwordOffset` must be `0`, as it cannot be used.\n\n `unsignedA` and `unsignedB` flag that the `int8` LLVM inputs are unsigned.\n\n The `clamp` flag is used to saturate the output of type T to `numeric_limits::max()`\n in case of overflow.\n\n The `wave64`attribute indicates whether an op is designed for 64 threads wavefont.\n\n Example:\n ```mlir\n %0 = amdgpu.wmma 16x16x16 %matA * %matB + %matC : vector<8xf16>, vector<8xf16>, vector<8xf16>\n\n %1 = amdgpu.wmma 16x16x64 %matD * %matE + %matF : vector<32xi8>, vector<8xf32>, vector<8xf32>\n\n %2 = amdgpu.wmma 16x16x128 %matG * %matH + %matI : vector<64xf4E2M1FN>, vector<64xf4E2M1FN>, vector<8xf32>\n\n %3 = amdgpu.wmma 16x16x4 %matJ * %matK + %matL : vector<2xf32>, vector<2xf32>, vector<8xf32>\n ```", "operands": [ { "name": "sourceA", "type": "WMMAInTypes" }, { "name": "sourceB", "type": "WMMAInTypes" }, { "name": "destC", "type": "WMMAOutTypes" } ], "results": [ { "name": "destD", "type": "WMMAOutTypes" } ], "attributes": [ { "name": "m", "type": "ConfinedAttr]>" }, { "name": "n", "type": "ConfinedAttr]>" }, { "name": "k", "type": "ConfinedAttr]>" }, { "name": "subwordOffset", "type": "DefaultValuedAttr ]>, 0>" }, { "name": "unsignedA", "type": "UnitAttr" }, { "name": "unsignedB", "type": "UnitAttr" }, { "name": "clamp", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['destC', 'destD']>" } ], "assemblyFormat": "custom($m, $n, $k) $sourceA `*` $sourceB `+` $destC\n attr-dict\n `:` type($sourceA) `,` type($sourceB) `,` type($destC)" }, { "name": "amx.tile_load", "summary": "tile load operation", "description": "Loads a tile from memory defined by a `base` and `indices`, with the\n shape defined by the 2-dim vector type of the result.\n The tile's rows are populated by reading contiguous elements starting\n at the `base`. For each tile row, the `base` is incremented by `stride`\n number of elements.\n\n The tile is loaded using the following indexing scheme:\n\n ```\n for row in enumerate(tile_rows):\n mem_row = base[i0, i1, ..., iN + row * stride]\n for col in enumerate(tile_cols):\n tile[row, col] = mem_row[col]\n ```\n\n If the `stride` is not provided, then the `base` buffer must be at least\n 2-dimensional, and the `stride` is automatically inferred and corresponds\n to the stride of the buffer's second innermost dimension.\n\n The operation is eventually lowered into the \"tileloadd\" instruction\n with the corresponding tile configuration.\n\n With the write memory effect, each `amx.tile_load` operation serves as\n a compilation hint to use a separate tile register.\n\n Example:\n\n ```mlir\n // Tile load from a 2-D memref with implicit stride.\n %0 = amx.tile_load %arg0[%c0, %c0] : memref into !amx.tile<16x64xi8>\n\n // Tile load from a 1-D memref with explicit stride.\n %0 = amx.tile_load %arg0[%c0], %stride : memref into !amx.tile<16x64xi8>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "stride", "type": "Optional" } ], "results": [ { "name": "res", "type": "AnyAMXTile" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$base `[` $indices `]` (`,` $stride^ )? attr-dict`:` type($base) `into` qualified(type($res))" }, { "name": "amx.tile_mulf", "summary": "tile multiplication operation (floating-point)", "description": "Multiplies a \"m x k\" tile with a \"k x n\" tile and accumulates the results\n into a \"m x n\" destination tile. Supports \"f32 <- bf16 x bf16\" (with\n pairs of \"bf16\").\n \n The operation is eventually lowered into the \"tdpbf16ps\" instruction with\n the corresponding tile configuration.\n\n Example:\n\n ```mlir\n %0 = amx.tile_mulf %a, %b, %c\n : !amx.tile<16x32xbf16>, !amx.tile<16x32xbf16>, !amx.tile<16x16xf32>\n ```", "operands": [ { "name": "lhs", "type": "AMXTileF16OrBF16" }, { "name": "rhs", "type": "AMXTileF16OrBF16" }, { "name": "acc", "type": "AMXTileF32" } ], "results": [ { "name": "res", "type": "AMXTileF32" } ], "traits": [ { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$lhs `,` $rhs `,` $acc attr-dict `:` qualified(type($lhs)) `,` qualified(type($rhs)) `,` qualified(type($acc))" }, { "name": "amx.tile_muli", "summary": "tile multiplication operation (integer)", "description": "Multiplies a \"m x k\" tile with a \"k x n\" tile and accumulates the results\n into a \"m x n\" destination tile. Supports all \"si32 <- s/ui8 x s/ui8\"\n combinations (4 bytes packed into dwords in the columns of both the\n source operand tiles; the zero or sign extension is specified with\n the attributes and default to sign extended).\n \n The operation is eventually lowered into one of the \"tdpbssd\",\n \"tdpbsud\", \"tdpbusd\", or \"tdpbuud\" instructions with the corresponding\n tile configuration.\n\n Example:\n\n ```mlir\n %0 = amx.tile_muli %a zext, %b zext, %c\n : !amx.tile<16x64xi8>, !amx.tile<16x64xi8>, !amx.tile<16x16xi32>\n ```", "operands": [ { "name": "lhs", "type": "AMXTileI8" }, { "name": "rhs", "type": "AMXTileI8" }, { "name": "acc", "type": "AMXTileI32" } ], "results": [ { "name": "res", "type": "AMXTileI32" } ], "attributes": [ { "name": "isZextLhs", "type": "UnitAttr" }, { "name": "isZextRhs", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$lhs (`zext` $isZextLhs^)? `,` $rhs (`zext` $isZextRhs^)? `,` $acc attr-dict `:` qualified(type($lhs)) `,` qualified(type($rhs)) `,` qualified(type($acc))" }, { "name": "amx.tile_store", "summary": "tile store operation", "description": "Stores a tile to memory defined by a `base` and `indices`, with the\n shape defined by the 2-dim vector type of the value.\n The tile's rows are written contiguously to the buffer starting at\n the `base`. For each tile row, the `base` is incremented by `stride`\n number of elements.\n\n The tile is stored using the following indexing scheme:\n\n ```\n for row in enumerate(tile_rows):\n mem_row = base[i0, i1, ..., iN + row * stride]\n for col in enumerate(tile_cols):\n mem_row[col] = tile[row, col]\n ```\n\n If the `stride` is not provided, then the `base` buffer must be at least\n 2-dimensional, and the `stride` is automatically inferred and corresponds\n to the stride of the buffer's second innermost dimension.\n\n The operation is eventually lowered into the \"tilestored\" instruction\n with the corresponding tile configuration.\n\n Example:\n\n ```mlir\n // Tile store to a 2-D memref with implicit stride.\n amx.tile_store %arg1[%c0, %c0], %0 : memref, !amx.tile<16x64xi8>\n\n // Tile store to a 1-D memref with explicit stride.\n amx.tile_store %arg1[%c0], %0, %stride : memref, !amx.tile<16x64xi8>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "val", "type": "AnyAMXTile" }, { "name": "stride", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$base `[` $indices `]` `,` $val (`,` $stride^ )?attr-dict `:` type($base) `,` qualified(type($val))" }, { "name": "amx.tile_zero", "summary": "tile zero operation", "description": "Zeroes the destination tile, with the shape defined by the 2-dim\n vector type of the result.\n \n The operation is eventually lowered into the \"tilezero\" instruction\n with the corresponding tile configuration.\n \n With the write memory effect, each `amx.tile_zero` operation serves as\n a compilation hint to use a separate tile register.\n\n Example:\n\n ```mlir\n %0 = amx.tile_zero : !amx.tile<16x16xbf16>\n ```", "results": [ { "name": "res", "type": "AnyAMXTile" } ], "assemblyFormat": "attr-dict `:` qualified(type($res))" }, { "name": "arith.addf", "summary": "floating point addition operation", "description": "The `addf` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be a floating point\n scalar type, a vector whose element type is a floating point type, or a\n floating point tensor.\n\n Example:\n\n ```mlir\n // Scalar addition.\n %a = arith.addf %b, %c : f64\n\n // SIMD vector addition, e.g. for Intel SSE.\n %f = arith.addf %g, %h : vector<4xf32>\n\n // Tensor addition.\n %x = arith.addf %y, %z : tensor<4x?xbf16>\n\n // Scalar addition with rounding mode.\n %a = arith.addf %b, %c to_nearest_even : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" }, { "name": "roundingmode", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.addi", "summary": "integer addition operation", "description": "Performs N-bit addition on the operands. The operands are interpreted as\n unsigned bitvectors. The result is represented by a bitvector containing the\n mathematical value of the addition modulo 2^n, where `n` is the bitwidth.\n Because `arith` integers use a two's complement representation, this operation\n is applicable on both signed and unsigned integer operands.\n\n The `addi` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be an integer scalar type,\n a vector whose element type is integer, or a tensor of integers.\n\n This op supports `nuw`/`nsw` overflow flags which stands for\n \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the `nuw` and/or\n `nsw` flags are present, and an unsigned/signed overflow occurs\n (respectively), the result is poison.\n\n Example:\n\n ```mlir\n // Scalar addition.\n %a = arith.addi %b, %c : i64\n\n // Scalar addition with overflow flags.\n %a = arith.addi %b, %c overflow : i64\n\n // SIMD vector element-wise addition.\n %f = arith.addi %g, %h : vector<4xi32>\n\n // Tensor element-wise addition.\n %x = arith.addi %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "overflowFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`overflow` `` $overflowFlags^)?\n attr-dict `:` type($result)" }, { "name": "arith.addui_extended", "summary": "extended unsigned integer addition operation returning sum and overflow bit", "description": "Performs (N+1)-bit addition on zero-extended operands. Returns two results:\n the N-bit sum (same type as both operands), and the overflow bit\n (boolean-like), where `1` indicates unsigned addition overflow, while `0`\n indicates no overflow.\n\n Example:\n\n ```mlir\n // Scalar addition.\n %sum, %overflow = arith.addui_extended %b, %c : i64, i1\n\n // Vector element-wise addition.\n %d:2 = arith.addui_extended %e, %f : vector<4xi32>, vector<4xi1>\n\n // Tensor element-wise addition.\n %x:2 = arith.addui_extended %y, %z : tensor<4x?xi8>, tensor<4x?xi1>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "sum", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "overflow", "type": "BoolLike" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'sum']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($sum) `,` type($overflow)" }, { "name": "arith.andi", "summary": "integer binary and", "description": "The `andi` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be an integer scalar\n type, a vector whose element type is integer, or a tensor of integers. It\n has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar integer bitwise and.\n %a = arith.andi %b, %c : i64\n\n // SIMD vector element-wise bitwise integer and.\n %f = arith.andi %g, %h : vector<4xi32>\n\n // Tensor element-wise bitwise integer and.\n %x = arith.andi %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.bitcast", "summary": "bitcast between values of equal bit width", "description": "Bitcast an integer or floating point value to an integer or floating point\n value of equal bit width. When operating on vectors, casts elementwise.\n\n Note that this implements a logical bitcast independent of target\n endianness. This allows constant folding without target information and is\n consitent with the bitcast constant folders in LLVM (see\n https://github.com/llvm/llvm-project/blob/18c19414eb/llvm/lib/IR/ConstantFold.cpp#L168)\n For targets where the source and target type have the same endianness (which\n is the standard), this cast will also change no bits at runtime, but it may\n still require an operation, for example if the machine has different\n floating point and integer register files. For targets that have a different\n endianness for the source and target types (e.g. float is big-endian and\n integer is little-endian) a proper lowering would add operations to swap the\n order of words in addition to the bitcast.", "operands": [ { "name": "in", "type": "BitcastTypeConstraint" } ], "results": [ { "name": "out", "type": "BitcastTypeConstraint" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.ceildivsi", "summary": "signed ceil integer division operation", "description": "Signed integer division. Rounds towards positive infinity, i.e. `7 / -2 = -3`.\n\n Divison by zero, or signed division overflow (minimum value divided by -1)\n is undefined behavior. When applied to `vector` and `tensor` values, the\n behavior is undefined if _any_ of its elements are divided by zero or has a\n signed division overflow.\n\n Example:\n\n ```mlir\n // Scalar signed integer division.\n %a = arith.ceildivsi %b, %c : i64\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.ceildivui", "summary": "unsigned ceil integer division operation", "description": "Unsigned integer division. Rounds towards positive infinity. Treats the\n leading bit as the most significant, i.e. for `i16` given two's complement\n representation, `6 / -2 = 6 / (2^16 - 2) = 1`.\n\n Division by zero is undefined behavior. When applied to `vector` and\n `tensor` values, the behavior is undefined if _any_ elements are divided by\n zero.\n\n Example:\n\n ```mlir\n // Scalar unsigned integer division.\n %a = arith.ceildivui %b, %c : i64\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.cmpf", "summary": "floating-point comparison operation", "description": "The `cmpf` operation compares its two operands according to the float\n comparison rules and the predicate specified by the respective attribute.\n The predicate defines the type of comparison: (un)orderedness, (in)equality\n and signed less/greater than (or equal to) as well as predicates that are\n always true or false. The operands must have the same type, and this type\n must be a float type, or a vector or tensor thereof. The result is an i1,\n or a vector/tensor thereof having the same shape as the inputs. Unlike cmpi,\n the operands are always treated as signed. The u prefix indicates\n *unordered* comparison, not unsigned comparison, so \"une\" means unordered or\n not equal. For the sake of readability by humans, custom assembly form for\n the operation uses a string-typed attribute for the predicate. The value of\n this attribute corresponds to lower-cased name of the predicate constant,\n e.g., \"one\" means \"ordered not equal\". The string representation of the\n attribute is merely a syntactic sugar and is converted to an integer\n attribute by the parser.\n\n Example:\n\n ```mlir\n %r1 = arith.cmpf oeq, %0, %1 : f32\n %r2 = arith.cmpf ult, %0, %1 : tensor<42x42xf64>\n %r3 = \"arith.cmpf\"(%0, %1) {predicate: 0} : (f8, f8) -> i1\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "attributes": [ { "name": "predicate", "type": "Arith_CmpFPredicateAttr{false|oeq|ogt|oge|olt|ole|one|ord|ueq|ugt|uge|ult|ule|une|uno|true}" }, { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'lhs', 'result', '::getI1SameShape($_self)'>" } ], "assemblyFormat": "$predicate `,` $lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($lhs)" }, { "name": "arith.cmpi", "summary": "integer comparison operation", "description": "The `cmpi` operation is a generic comparison for integer-like types. Its two\n arguments can be integers, vectors or tensors thereof as long as their types\n match. The operation produces an i1 for the former case, a vector or a\n tensor of i1 with the same shape as inputs in the other cases.\n\n Its first argument is an attribute that defines which type of comparison is\n performed. The following comparisons are supported:\n\n - equal (mnemonic: `\"eq\"`; integer value: `0`)\n - not equal (mnemonic: `\"ne\"`; integer value: `1`)\n - signed less than (mnemonic: `\"slt\"`; integer value: `2`)\n - signed less than or equal (mnemonic: `\"sle\"`; integer value: `3`)\n - signed greater than (mnemonic: `\"sgt\"`; integer value: `4`)\n - signed greater than or equal (mnemonic: `\"sge\"`; integer value: `5`)\n - unsigned less than (mnemonic: `\"ult\"`; integer value: `6`)\n - unsigned less than or equal (mnemonic: `\"ule\"`; integer value: `7`)\n - unsigned greater than (mnemonic: `\"ugt\"`; integer value: `8`)\n - unsigned greater than or equal (mnemonic: `\"uge\"`; integer value: `9`)\n\n The result is `1` if the comparison is true and `0` otherwise. For vector or\n tensor operands, the comparison is performed elementwise and the element of\n the result indicates whether the comparison is true for the operand elements\n with the same indices as those of the result.\n\n Note: while the custom assembly form uses strings, the actual underlying\n attribute has integer type (or rather enum class in C++ code) as seen from\n the generic assembly form. String literals are used to improve readability\n of the IR by humans.\n\n This operation only applies to integer-like operands, but not floats. The\n main reason being that comparison operations have diverging sets of\n attributes: integers require sign specification while floats require various\n floating point-related particularities, e.g., `-ffast-math` behavior,\n IEEE754 compliance, etc\n ([rationale](../Rationale/Rationale.md#splitting-floating-point-vs-integer-operations)).\n The type of comparison is specified as attribute to avoid introducing ten\n similar operations, taking into account that they are often implemented\n using the same operation downstream\n ([rationale](../Rationale/Rationale.md#specifying-comparison-kind-as-attribute)). The\n separation between signed and unsigned order comparisons is necessary\n because of integers being signless. The comparison operation must know how\n to interpret values with the foremost bit being set: negatives in two's\n complement or large positives\n ([rationale](../Rationale/Rationale.md#specifying-sign-in-integer-comparison-operations)).\n\n Example:\n\n ```mlir\n // Custom form of scalar \"signed less than\" comparison.\n %x = arith.cmpi slt, %lhs, %rhs : i32\n\n // Generic form of the same operation.\n %x = \"arith.cmpi\"(%lhs, %rhs) {predicate = 2 : i64} : (i32, i32) -> i1\n\n // Custom form of vector equality comparison.\n %x = arith.cmpi eq, %lhs, %rhs : vector<4xi64>\n\n // Generic form of the same operation.\n %x = \"arith.cmpi\"(%lhs, %rhs) {predicate = 0 : i64}\n : (vector<4xi64>, vector<4xi64>) -> vector<4xi1>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "attributes": [ { "name": "predicate", "type": "Arith_CmpIPredicateAttr{eq|ne|slt|sle|sgt|sge|ult|ule|ugt|uge}" } ], "traits": [ { "type": "TypesMatchWith<'lhs', 'result', '::getI1SameShape($_self)'>" } ], "assemblyFormat": "$predicate `,` $lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "arith.constant", "summary": "integer or floating point constant", "description": "The `constant` operation produces an SSA value equal to some integer or\n floating-point constant specified by an attribute. This is the way MLIR\n forms simple integer and floating point constants.\n\n Example:\n\n ```\n // Integer constant\n %1 = arith.constant 42 : i32\n\n // Equivalent generic form\n %1 = \"arith.constant\"() {value = 42 : i32} : () -> i32\n ```", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "attr-dict $value" }, { "name": "arith.convertf", "summary": "cast between floating-point types of the same bitwidth", "description": "Cast a floating-point value to a different floating-point type of the same\n bitwidth. This operation handles conversions between types that have the\n same bitwidth but different semantics (e.g., f16 to bf16), which cannot\n be represented by `arith.extf` or `arith.truncf`.\n\n The source and destination element types must be different and must have\n the same bitwidth. When operating on vectors, casts elementwise.", "operands": [ { "name": "in", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "attributes": [ { "name": "roundingmode", "type": "OptionalAttr" }, { "name": "fastmath", "type": "OptionalAttr" } ], "assemblyFormat": "$in ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.divf", "summary": "floating point division operation", "description": "The `divf` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be a floating point\n scalar type, a vector whose element type is a floating point type, or a\n floating point tensor.\n\n Example:\n\n ```mlir\n // Scalar division.\n %a = arith.divf %b, %c : f64\n\n // Scalar division with rounding mode.\n %a = arith.divf %b, %c toward_zero : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" }, { "name": "roundingmode", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.divsi", "summary": "signed integer division operation", "description": "Signed integer division. Rounds towards zero. Treats the leading bit as\n sign, i.e. `6 / -2 = -3`.\n\n Divison by zero, or signed division overflow (minimum value divided by -1)\n is undefined behavior. When applied to `vector` and `tensor` values, the\n behavior is undefined if _any_ of its elements are divided by zero or has a\n signed division overflow.\n\n If the `exact` attribute is present, the result value is poison if `lhs` is\n not a multiple of `rhs`.\n\n Example:\n\n ```mlir\n // Scalar signed integer division.\n %a = arith.divsi %b, %c : i64\n\n // Scalar signed integer division where %b is known to be a multiple of %c.\n %a = arith.divsi %b, %c exact : i64\n\n // SIMD vector element-wise division.\n %f = arith.divsi %g, %h : vector<4xi32>\n\n // Tensor element-wise integer division.\n %x = arith.divsi %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`exact` $isExact^)?\n attr-dict `:` type($result)" }, { "name": "arith.divui", "summary": "unsigned integer division operation", "description": "Unsigned integer division. Rounds towards zero. Treats the leading bit as\n the most significant, i.e. for `i16` given two's complement representation,\n `6 / -2 = 6 / (2^16 - 2) = 0`.\n\n Division by zero is undefined behavior. When applied to `vector` and\n `tensor` values, the behavior is undefined if _any_ elements are divided by\n zero.\n\n If the `exact` attribute is present, the result value is poison if `lhs` is\n not a multiple of `rhs`.\n\n Example:\n\n ```mlir\n // Scalar unsigned integer division.\n %a = arith.divui %b, %c : i64\n\n // Scalar unsigned integer division where %b is known to be a multiple of %c.\n %a = arith.divui %b, %c exact : i64\n\n // SIMD vector element-wise division.\n %f = arith.divui %g, %h : vector<4xi32>\n\n // Tensor element-wise integer division.\n %x = arith.divui %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`exact` $isExact^)?\n attr-dict `:` type($result)" }, { "name": "arith.extf", "summary": "cast from floating-point to wider floating-point", "description": "Cast a floating-point value to a larger floating-point-typed value.\n The destination type must to be strictly wider than the source type.\n When operating on vectors, casts elementwise.", "operands": [ { "name": "in", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "OptionalAttr" } ], "assemblyFormat": "$in (`fastmath` `` $fastmath^)?\n attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.extsi", "summary": "integer sign extension operation", "description": "The integer sign extension operation takes an integer input of\n width M and an integer destination type of width N. The destination\n bit-width must be larger than the input bit-width (N > M).\n The top-most (N - M) bits of the output are filled with copies\n of the most-significant bit of the input.\n\n Example:\n\n ```mlir\n %1 = arith.constant 5 : i3 // %1 is 0b101\n %2 = arith.extsi %1 : i3 to i6 // %2 is 0b111101\n %3 = arith.constant 2 : i3 // %3 is 0b010\n %4 = arith.extsi %3 : i3 to i6 // %4 is 0b000010\n\n %5 = arith.extsi %0 : vector<2 x i32> to vector<2 x i64>\n ```", "operands": [ { "name": "in", "type": "SignlessFixedWidthIntegerLike" } ], "results": [ { "name": "out", "type": "SignlessFixedWidthIntegerLike" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.extui", "summary": "integer zero extension operation", "description": "The integer zero extension operation takes an integer input of\n width M and an integer destination type of width N. The destination\n bit-width must be larger than the input bit-width (N > M).\n The top-most (N - M) bits of the output are filled with zeros.\n\n When the `nneg` flag is present, the operand is assumed to have\n the most significant bit set to 0. In this case, zero extension is\n equivalent to sign extension. When this assumption is violated, the\n result is poison.\n\n Example:\n\n ```mlir\n %1 = arith.constant 5 : i3 // %1 is 0b101\n %2 = arith.extui %1 : i3 to i6 // %2 is 0b000101\n %3 = arith.constant 2 : i3 // %3 is 0b010\n %4 = arith.extui %3 : i3 to i6 // %4 is 0b000010\n\n %5 = arith.extui %0 : vector<2 x i32> to vector<2 x i64>\n\n // Zero extension with nneg flag.\n %6 = arith.extui %3 nneg : i3 to i6\n ```", "operands": [ { "name": "in", "type": "SignlessFixedWidthIntegerLike" } ], "results": [ { "name": "out", "type": "SignlessFixedWidthIntegerLike" } ], "attributes": [ { "name": "nonNeg", "type": "UnitAttr" } ], "assemblyFormat": "$in (`nneg` $nonNeg^)? attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.floordivsi", "summary": "signed floor integer division operation", "description": "Signed integer division. Rounds towards negative infinity, i.e. `5 / -2 = -3`.\n\n Divison by zero, or signed division overflow (minimum value divided by -1)\n is undefined behavior. When applied to `vector` and `tensor` values, the\n behavior is undefined if _any_ of its elements are divided by zero or has a\n signed division overflow.\n\n Example:\n\n ```mlir\n // Scalar signed integer division.\n %a = arith.floordivsi %b, %c : i64\n\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.flush_denormals", "summary": "flush denormal floating-point values to zero", "description": "The `flush_denormals` operation takes a floating-point value and returns\n the input value if it is a normal (or zero, infinity, or NaN) value, or\n a zero of the same type if the input is a denormal (subnormal) value.\n The sign of zero is preserved when flushing a denormal: negative\n denormals flush to `-0.0`, positive denormals flush to `+0.0`.\n\n A denormal number (\"subnormal number\" in IEEE-754) is a non-zero floating\n point number that is smaller (closer to zero) than the smallest normal\n number. Denormals fill the underflow gap around zero in floating-point\n arithmetics, but may come at a runtime cost on some architectures.\n\n The input and result are required to be the same type. This type may be\n a floating-point scalar type, a vector whose element type is a\n floating-point type, or a tensor of floats. When operating on vectors\n or tensors, the operation is applied elementwise.\n\n Example:\n\n ```mlir\n // Scalar denormal flushing.\n %a = arith.flush_denormals %b : f32\n\n // SIMD vector element-wise denormal flushing.\n %f = arith.flush_denormals %g : vector<4xf32>\n\n // Tensor element-wise denormal flushing.\n %x = arith.flush_denormals %y : tensor<4x?xbf16>\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.fptosi", "summary": "cast from floating-point type to integer type", "description": "Cast from a value interpreted as floating-point to the nearest (rounding\n towards zero) signed integer value. When operating on vectors, casts\n elementwise.", "operands": [ { "name": "in", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "SignlessFixedWidthIntegerLike" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.fptoui", "summary": "cast from floating-point type to integer type", "description": "Cast from a value interpreted as floating-point to the nearest (rounding\n towards zero) unsigned integer value. When operating on vectors, casts\n elementwise.", "operands": [ { "name": "in", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "SignlessFixedWidthIntegerLike" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.index_cast", "summary": "cast between index and integer types", "description": "Casts between scalar or vector integers and corresponding 'index' scalar or\n vectors. Index is an integer of platform-specific bit width. If casting to\n a wider integer, the value is sign-extended. If casting to a narrower\n integer, the value is truncated.", "operands": [ { "name": "in", "type": "IndexCastTypeConstraint" } ], "results": [ { "name": "out", "type": "IndexCastTypeConstraint" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.index_castui", "summary": "unsigned cast between index and integer types", "description": "Casts between scalar or vector integers and corresponding 'index' scalar or\n vectors. Index is an integer of platform-specific bit width. If casting to\n a wider integer, the value is zero-extended. If casting to a narrower\n integer, the value is truncated.\n\n When the `nneg` flag is present, the operand is assumed to have\n the most significant bit set to 0. In this case, zero extension\n is equivalent to sign extension. When this assumption is violated,\n the result is poison.\n\n Example:\n\n ```mlir\n %0 = arith.index_castui %a : i32 to index\n %1 = arith.index_castui %a nneg : i32 to index\n %2 = arith.index_castui %b nneg : index to i64\n ```", "operands": [ { "name": "in", "type": "IndexCastTypeConstraint" } ], "results": [ { "name": "out", "type": "IndexCastTypeConstraint" } ], "attributes": [ { "name": "nonNeg", "type": "UnitAttr" } ], "assemblyFormat": "$in (`nneg` $nonNeg^)? attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.maximumf", "summary": "floating-point maximum operation", "description": "Returns the maximum of the two arguments, treating -0.0 as less than +0.0.\n If one of the arguments is NaN, then the result is also NaN.\n\n Example:\n\n ```mlir\n // Scalar floating-point maximum.\n %a = arith.maximumf %b, %c : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.maxnumf", "summary": "floating-point maximum operation", "description": "Returns the maximum of the two arguments.\n If the arguments are -0.0 and +0.0, then the result is either of them.\n If one of the arguments is NaN, then the result is the other argument.\n\n Example:\n\n ```mlir\n // Scalar floating-point maximum.\n %a = arith.maxnumf %b, %c : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.maxsi", "summary": "signed integer maximum operation", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.maxui", "summary": "unsigned integer maximum operation", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.minimumf", "summary": "floating-point minimum operation", "description": "Returns the minimum of the two arguments, treating -0.0 as less than +0.0.\n If one of the arguments is NaN, then the result is also NaN.\n\n Example:\n\n ```mlir\n // Scalar floating-point minimum.\n %a = arith.minimumf %b, %c : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.minnumf", "summary": "floating-point minimum operation", "description": "Returns the minimum of the two arguments.\n If the arguments are -0.0 and +0.0, then the result is either of them.\n If one of the arguments is NaN, then the result is the other argument.\n\n Example:\n\n ```mlir\n // Scalar floating-point minimum.\n %a = arith.minnumf %b, %c : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.minsi", "summary": "signed integer minimum operation", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.minui", "summary": "unsigned integer minimum operation", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.mulf", "summary": "floating point multiplication operation", "description": "The `mulf` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be a floating point\n scalar type, a vector whose element type is a floating point type, or a\n floating point tensor.\n\n Example:\n\n ```mlir\n // Scalar multiplication.\n %a = arith.mulf %b, %c : f64\n\n // SIMD pointwise vector multiplication, e.g. for Intel SSE.\n %f = arith.mulf %g, %h : vector<4xf32>\n\n // Tensor pointwise multiplication.\n %x = arith.mulf %y, %z : tensor<4x?xbf16>\n\n // Scalar multiplication with rounding mode.\n %a = arith.mulf %b, %c upward : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" }, { "name": "roundingmode", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.muli", "summary": "Integer multiplication operation.", "description": "Performs N-bit multiplication on the operands. The operands are interpreted as\n unsigned bitvectors. The result is represented by a bitvector containing the\n mathematical value of the multiplication modulo 2^n, where `n` is the bitwidth.\n Because `arith` integers use a two's complement representation, this operation is\n applicable on both signed and unsigned integer operands.\n\n The `muli` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be an integer scalar type,\n a vector whose element type is integer, or a tensor of integers.\n\n This op supports `nuw`/`nsw` overflow flags which stands for\n \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the `nuw` and/or\n `nsw` flags are present, and an unsigned/signed overflow occurs\n (respectively), the result is poison.\n\n Example:\n\n ```mlir\n // Scalar multiplication.\n %a = arith.muli %b, %c : i64\n\n // Scalar multiplication with overflow flags.\n %a = arith.muli %b, %c overflow : i64\n\n // SIMD vector element-wise multiplication.\n %f = arith.muli %g, %h : vector<4xi32>\n\n // Tensor element-wise multiplication.\n %x = arith.muli %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "overflowFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`overflow` `` $overflowFlags^)?\n attr-dict `:` type($result)" }, { "name": "arith.mulsi_extended", "summary": "extended signed integer multiplication operation", "description": "Performs (2*N)-bit multiplication on sign-extended operands. Returns two\n N-bit results: the low and the high halves of the product. The low half has\n the same value as the result of regular multiplication `arith.muli` with\n the same operands.\n\n Example:\n\n ```mlir\n // Scalar multiplication.\n %low, %high = arith.mulsi_extended %a, %b : i32\n\n // Vector element-wise multiplication.\n %c:2 = arith.mulsi_extended %d, %e : vector<4xi32>\n\n // Tensor element-wise multiplication.\n %x:2 = arith.mulsi_extended %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "low", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "high", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'low', 'high']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "arith.mului_extended", "summary": "extended unsigned integer multiplication operation", "description": "Performs (2*N)-bit multiplication on zero-extended operands. Returns two\n N-bit results: the low and the high halves of the product. The low half has\n the same value as the result of regular multiplication `arith.muli` with\n the same operands.\n\n Example:\n\n ```mlir\n // Scalar multiplication.\n %low, %high = arith.mului_extended %a, %b : i32\n\n // Vector element-wise multiplication.\n %c:2 = arith.mului_extended %d, %e : vector<4xi32>\n\n // Tensor element-wise multiplication.\n %x:2 = arith.mului_extended %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "low", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "high", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'low', 'high']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "arith.negf", "summary": "floating point negation", "description": "The `negf` operation computes the negation of a given value. It takes one\n operand and returns one result of the same type. This type may be a float\n scalar type, a vector whose element type is float, or a tensor of floats.\n It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar negation value.\n %a = arith.negf %b : f64\n\n // SIMD vector element-wise negation value.\n %f = arith.negf %g : vector<4xf32>\n\n // Tensor element-wise negation value.\n %x = arith.negf %y : tensor<4x?xf8>\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.ori", "summary": "integer binary or", "description": "The `ori` operation takes two operands and returns one result, each of these\n is required to be the same type. This type may be an integer scalar type, a\n vector whose element type is integer, or a tensor of integers. It has no\n standard attributes.\n\n Example:\n\n ```mlir\n // Scalar integer bitwise or.\n %a = arith.ori %b, %c : i64\n\n // SIMD vector element-wise bitwise integer or.\n %f = arith.ori %g, %h : vector<4xi32>\n\n // Tensor element-wise bitwise integer or.\n %x = arith.ori %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.remf", "summary": "floating point division remainder operation", "description": "Returns the floating point division remainder.\n The remainder has the same sign as the dividend (lhs operand).\n\n TODO: Add support for rounding modes.", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.remsi", "summary": "signed integer division remainder operation", "description": "Signed integer division remainder. Treats the leading bit as sign, i.e. `6 %\n -2 = 0`.\n\n Division by zero is undefined behavior. When applied to `vector` and\n `tensor` values, the behavior is undefined if _any_ elements are divided by\n zero.\n\n Example:\n\n ```mlir\n // Scalar signed integer division remainder.\n %a = arith.remsi %b, %c : i64\n\n // SIMD vector element-wise division remainder.\n %f = arith.remsi %g, %h : vector<4xi32>\n\n // Tensor element-wise integer division remainder.\n %x = arith.remsi %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.remui", "summary": "unsigned integer division remainder operation", "description": "Unsigned integer division remainder. Treats the leading bit as the most\n significant, i.e. for `i16`, `6 % -2 = 6 % (2^16 - 2) = 6`.\n\n Division by zero is undefined behavior. When applied to `vector` and\n `tensor` values, the behavior is undefined if _any_ elements are divided by\n zero.\n\n Example:\n\n ```mlir\n // Scalar unsigned integer division remainder.\n %a = arith.remui %b, %c : i64\n\n // SIMD vector element-wise division remainder.\n %f = arith.remui %g, %h : vector<4xi32>\n\n // Tensor element-wise integer division remainder.\n %x = arith.remui %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arith.scaling_extf", "summary": "Upcasts input floats using provided scales values following OCP MXFP Spec", "description": "This operation upcasts input floating-point values using provided scale\n values. It expects both scales and the input operand to be of the same shape,\n making the operation elementwise. Scales are usually calculated per block\n following the OCP MXFP spec as described in https://arxiv.org/abs/2310.10537.\n\n If scales are calculated per block where blockSize != 1, then scales may\n require broadcasting to make this operation elementwise. For example, let's\n say the input is of shape ``. Given blockSize != 1 and\n assuming quantization happens on the last axis, the input can be reshaped to\n ``. Scales will be calculated\n per block on the last axis. Therefore, scales will be of shape\n ``. Scales could also be of some other\n shape as long as it is broadcast compatible with the input, e.g.,\n `<1 x 1 x ... (dimN/blockSize) x 1>`.\n\n In this example, before calling into `arith.scaling_extf`, scales must be\n broadcasted to ``. Note\n that there could be multiple quantization axes. Internally,\n `arith.scaling_extf` would perform the following:\n\n ```mlir\n // Cast scale to result type.\n %0 = arith.truncf %1 : f32 to f8E8M0FNU\n %1 = arith.extf %0 : f8E8M0FNU to f16\n\n // Cast input to result type.\n %2 = arith.extf %3 : f4E2M1FN to f16\n\n // Perform scaling\n %3 = arith.mulf %2, %1 : f16\n ```\n It propagates NaN values. Therefore, if either scale or the input element\n contains NaN, then the output element value will also be a NaN.\n\n Example:\n\n ```mlir\n // Upcast from f4E2M1FN to f32.\n %a = arith.scaling_extf %b, %c : f4E2M1FN, f8E8M0FNU to f32\n\n // Element-wise upcast with broadcast (blockSize = 32).\n %f = vector.broadcast %g : vector<1xf8E8M0FNU> to vector<32xf8E8M0FNU>\n %h = arith.scaling_extf %i, %f : vector<32xf4E2M1FN>, vector<32xf8E8M0FNU> to vector<32xbf16>\n ```", "operands": [ { "name": "in", "type": "FloatLike" }, { "name": "scale", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "OptionalAttr" } ], "assemblyFormat": "$in `,` $scale (`fastmath` `` $fastmath^)? attr-dict `:`\n type($in) `,` type($scale) `to` type($out)" }, { "name": "arith.scaling_truncf", "summary": "Downcasts input floating point values using provided scales values following OCP MXFP Spec", "description": "This operation downcasts input using the provided scale values. It expects\n both scales and the input operand to be of the same shape and, therefore,\n makes the operation elementwise. Scales are usually calculated per block\n following the OCP MXFP spec as described in https://arxiv.org/abs/2310.10537.\n Users are required to normalize and clamp the scales as necessary before calling\n passing them to this operation. OCP MXFP spec also does the flushing of denorms\n on the input operand, which should be handled during lowering by passing appropriate\n fastMath flag to this operation.\n\n If scales are calculated per block where blockSize != 1, scales may require\n broadcasting to make this operation elementwise. For example, let's say the\n input is of shape ``. Given blockSize != 1 and\n assuming quantization happens on the last axis, the input can be reshaped to\n ``. Scales will be calculated\n per block on the last axis. Therefore, scales will be of shape\n ``. Scales could also be of some other\n shape as long as it is broadcast compatible with the input, e.g.,\n `<1 x 1 x ... (dimN/blockSize) x 1>`.\n\n In this example, before calling into `arith.scaling_truncf`, scales must be\n broadcasted to ``. Note\n that there could be multiple quantization axes. Internally,\n `arith.scaling_truncf` would perform the following:\n\n ```mlir\n // Cast scale to input type.\n %0 = arith.truncf %1 : f32 to f8E8M0FNU\n %1 = arith.extf %0 : f8E8M0FNU to f16\n\n // Perform scaling.\n %3 = arith.divf %2, %1 : f16\n\n // Cast to result type.\n %4 = arith.truncf %3 : f16 to f4E2M1FN\n ```\n\n Example:\n\n ```mlir\n // Downcast from f32 to f4E2M1FN.\n %a = arith.scaling_truncf %b, %c : f32, f8E8M0FNU to f4E2M1FN\n\n // Element-wise downcast with broadcast (blockSize = 32).\n %f = vector.broadcast %g : vector<1xf8E8M0FNU> to vector<32xf8E8M0FNU>\n %h = arith.scaling_truncf %i, %f : vector<32xbf16>, vector<32xf8E8M0FNU> to vector<32xf4E2M1FN>\n ```", "operands": [ { "name": "in", "type": "FloatLike" }, { "name": "scale", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "attributes": [ { "name": "roundingmode", "type": "OptionalAttr" }, { "name": "fastmath", "type": "OptionalAttr" } ], "assemblyFormat": "$in `,` $scale ($roundingmode^)? (`fastmath` `` $fastmath^)? attr-dict `:`\n type($in) `,` type($scale) `to` type($out)" }, { "name": "arith.select", "summary": "select operation", "description": "The `arith.select` operation chooses one value based on a binary condition\n supplied as its first operand.\n\n If the value of the first operand (the condition) is `1`, then the second\n operand is returned, and the third operand is ignored, even if it was poison.\n\n If the value of the first operand (the condition) is `0`, then the third\n operand is returned, and the second operand is ignored, even if it was poison.\n\n If the value of the first operand (the condition) is poison, then the\n operation returns poison.\n\n The operation applies to vectors and tensors elementwise given the _shape_\n of all operands is identical. The choice is made for each element\n individually based on the value at the same position as the element in the\n condition operand. If an i1 is provided as the condition, the entire vector\n or tensor is chosen.\n\n Example:\n\n ```mlir\n // Custom form of scalar selection.\n %x = arith.select %cond, %true, %false : i32\n\n // Generic form of the same operation.\n %x = \"arith.select\"(%cond, %true, %false) : (i1, i32, i32) -> i32\n\n // Element-wise vector selection.\n %vx = arith.select %vcond, %vtrue, %vfalse : vector<42xi1>, vector<42xf32>\n\n // Full vector selection.\n %vx = arith.select %cond, %vtrue, %vfalse : vector<42xf32>\n ```", "operands": [ { "name": "condition", "type": "BoolLike" }, { "name": "true_value", "type": "AnyType" }, { "name": "false_value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "hasCustomAssemblyFormat": true }, { "name": "arith.shli", "summary": "integer left-shift", "description": "The `shli` operation shifts the integer value of the first operand to the left\n by the integer value of the second operand. The second operand is interpreted as\n unsigned. The low order bits are filled with zeros. If the value of the second\n operand is greater or equal than the bitwidth of the first operand, then the\n operation returns poison.\n\n This op supports `nuw`/`nsw` overflow flags which stands for\n \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the `nuw` and/or\n `nsw` flags are present, and an unsigned/signed overflow occurs\n (respectively), the result is poison.\n\n Example:\n\n ```mlir\n %1 = arith.constant 5 : i8 // %1 is 0b00000101\n %2 = arith.constant 3 : i8\n %3 = arith.shli %1, %2 : i8 // %3 is 0b00101000\n %4 = arith.shli %1, %2 overflow : i8\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "overflowFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`overflow` `` $overflowFlags^)?\n attr-dict `:` type($result)" }, { "name": "arith.shrsi", "summary": "signed integer right-shift", "description": "The `shrsi` operation shifts an integer value of the first operand to the right\n by the value of the second operand. The first operand is interpreted as signed,\n and the second operand is interpreter as unsigned. The high order bits in the\n output are filled with copies of the most-significant bit of the shifted value\n (which means that the sign of the value is preserved). If the value of the second\n operand is greater or equal than bitwidth of the first operand, then the operation\n returns poison.\n\n If the `exact` attribute is present, the result value of shrsi is a poison\n value if any of the bits shifted out are non-zero.\n\n Example:\n\n ```mlir\n %1 = arith.constant 160 : i8 // %1 is 0b10100000\n %2 = arith.constant 3 : i8\n %3 = arith.shrsi %1, %2 exact : i8 // %3 is 0b11110100\n %4 = arith.constant 98 : i8 // %4 is 0b01100010\n %5 = arith.shrsi %4, %2 : i8 // %5 is 0b00001100\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`exact` $isExact^)?\n attr-dict `:` type($result)" }, { "name": "arith.shrui", "summary": "unsigned integer right-shift", "description": "The `shrui` operation shifts an integer value of the first operand to the right\n by the value of the second operand. The first operand is interpreted as unsigned,\n and the second operand is interpreted as unsigned. The high order bits are always\n filled with zeros. If the value of the second operand is greater or equal than the\n bitwidth of the first operand, then the operation returns poison.\n\n If the `exact` attribute is present, the result value of shrui is a poison\n value if any of the bits shifted out are non-zero.\n\n Example:\n\n ```mlir\n %1 = arith.constant 160 : i8 // %1 is 0b10100000\n %2 = arith.constant 3 : i8\n %3 = arith.constant 6 : i8\n %4 = arith.shrui %1, %2 exact : i8 // %4 is 0b00010100\n %5 = arith.shrui %1, %3 : i8 // %3 is 0b00000010\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`exact` $isExact^)?\n attr-dict `:` type($result)" }, { "name": "arith.sitofp", "summary": "cast from integer type to floating-point", "description": "Cast from a value interpreted as a signed integer to the corresponding\n floating-point value. When operating on vectors, casts elementwise.", "operands": [ { "name": "in", "type": "SignlessFixedWidthIntegerLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.subf", "summary": "floating point subtraction operation", "description": "The `subf` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be a floating point\n scalar type, a vector whose element type is a floating point type, or a\n floating point tensor.\n\n Example:\n\n ```mlir\n // Scalar subtraction.\n %a = arith.subf %b, %c : f64\n\n // SIMD vector subtraction, e.g. for Intel SSE.\n %f = arith.subf %g, %h : vector<4xf32>\n\n // Tensor subtraction.\n %x = arith.subf %y, %z : tensor<4x?xbf16>\n\n // Scalar subtraction with rounding mode.\n %a = arith.subf %b, %c downward : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" }, { "name": "roundingmode", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "arith.subi", "summary": "Integer subtraction operation.", "description": "Performs N-bit subtraction on the operands. The operands are interpreted as unsigned\n bitvectors. The result is represented by a bitvector containing the mathematical\n value of the subtraction modulo 2^n, where `n` is the bitwidth. Because `arith`\n integers use a two's complement representation, this operation is applicable on\n both signed and unsigned integer operands.\n\n The `subi` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be an integer scalar type,\n a vector whose element type is integer, or a tensor of integers.\n\n This op supports `nuw`/`nsw` overflow flags which stands for\n \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the `nuw` and/or\n `nsw` flags are present, and an unsigned/signed overflow occurs\n (respectively), the result is poison.\n\n Example:\n\n ```mlir\n // Scalar subtraction.\n %a = arith.subi %b, %c : i64\n\n // Scalar subtraction with overflow flags.\n %a = arith.subi %b, %c overflow : i64\n\n // SIMD vector element-wise subtraction.\n %f = arith.subi %g, %h : vector<4xi32>\n\n // Tensor element-wise subtraction.\n %x = arith.subi %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "attributes": [ { "name": "overflowFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`overflow` `` $overflowFlags^)?\n attr-dict `:` type($result)" }, { "name": "arith.subui_extended", "summary": "extended unsigned integer subtraction operation returning difference and\n borrow bit", "description": "Performs (N+1)-bit subtraction on zero-extended operands. Returns two\n results: the N-bit difference (same type as both operands), and the borrow\n bit (boolean-like), where `1` indicates unsigned subtraction underflow\n (i.e. `lhs < rhs` when interpreted as unsigned), while `0` indicates no\n underflow.\n\n Example:\n\n ```mlir\n // Scalar subtraction.\n %diff, %borrow = arith.subui_extended %b, %c : i64, i1\n\n // Vector element-wise subtraction.\n %d:2 = arith.subui_extended %e, %f : vector<4xi32>, vector<4xi1>\n\n // Tensor element-wise subtraction.\n %x:2 = arith.subui_extended %y, %z : tensor<4x?xi8>, tensor<4x?xi1>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "diff", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "borrow", "type": "BoolLike" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'diff']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($diff) `,` type($borrow)" }, { "name": "arith.truncf", "summary": "cast from floating-point to narrower floating-point", "description": "Truncate a floating-point value to a smaller floating-point-typed value.\n The destination type must be strictly narrower than the source type.\n When operating on vectors, casts elementwise.", "operands": [ { "name": "in", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "attributes": [ { "name": "roundingmode", "type": "OptionalAttr" }, { "name": "fastmath", "type": "OptionalAttr" } ], "assemblyFormat": "$in ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.trunci", "summary": "integer truncation operation", "description": "The integer truncation operation takes an integer input of\n width M and an integer destination type of width N. The destination\n bit-width must be smaller than the input bit-width (N < M).\n The top-most (N - M) bits of the input are discarded.\n\n This op supports `nuw`/`nsw` overflow flags which stands for \"No Unsigned\n Wrap\" and \"No Signed Wrap\", respectively. If the nuw keyword is present,\n and any of the truncated bits are non-zero, the result is a poison value.\n If the nsw keyword is present, and any of the truncated bits are not the\n same as the top bit of the truncation result, the result is a poison value.\n\n Example:\n\n ```mlir\n // Scalar truncation.\n %1 = arith.constant 21 : i5 // %1 is 0b10101\n %2 = arith.trunci %1 : i5 to i4 // %2 is 0b0101\n %3 = arith.trunci %1 : i5 to i3 // %3 is 0b101\n\n // Vector truncation.\n %4 = arith.trunci %0 : vector<2 x i32> to vector<2 x i16>\n\n // Scalar truncation with overflow flags.\n %5 = arith.trunci %a overflow : i32 to i16\n ```", "operands": [ { "name": "in", "type": "SignlessFixedWidthIntegerLike" } ], "results": [ { "name": "out", "type": "SignlessFixedWidthIntegerLike" } ], "attributes": [ { "name": "overflowFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$in (`overflow` `` $overflowFlags^)? attr-dict\n `:` type($in) `to` type($out)" }, { "name": "arith.uitofp", "summary": "cast from unsigned integer type to floating-point", "description": "Cast from a value interpreted as unsigned integer to the corresponding\n floating-point value. When operating on vectors, casts elementwise.\n\n When the `nneg` flag is present, the operand is assumed to have\n the most significant bit set to 0. In this case, zero extension is\n equivalent to sign extension. When this assumption is violated, the\n result is poison.\n\n Example:\n\n ```mlir\n // Without nneg flag.\n %0 = arith.uitofp %a : i32 to f64\n\n // With nneg flag.\n %1 = arith.uitofp %a nneg : i32 to f64\n ```", "operands": [ { "name": "in", "type": "SignlessFixedWidthIntegerLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ], "attributes": [ { "name": "nonNeg", "type": "UnitAttr" } ], "assemblyFormat": "$in (`nneg` $nonNeg^)? attr-dict `:` type($in) `to` type($out)" }, { "name": "arith.xori", "summary": "integer binary xor", "description": "The `xori` operation takes two operands and returns one result, each of\n these is required to be the same type. This type may be an integer scalar\n type, a vector whose element type is integer, or a tensor of integers. It\n has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar integer bitwise xor.\n %a = arith.xori %b, %c : i64\n\n // SIMD vector element-wise bitwise integer xor.\n %f = arith.xori %g, %h : vector<4xi32>\n\n // Tensor element-wise bitwise integer xor.\n %x = arith.xori %y, %z : tensor<4x?xi8>\n ```", "operands": [ { "name": "lhs", "type": "Arith_SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "Arith_SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "Arith_SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "arm_neon.2d.sdot", "summary": "sdot op", "description": "The two input vectors `b` and `c` have a 2D shape, consisting of either 2\n or 4 rows, each row having length 4. This operation computes the pair-wise\n dot-products of the rows of `b` and `c` and accumulates them with the\n corresponding entry of `a`:\n\n ```\n res[i] := a[i] + dot_product(b[i, ...], c[i, ...])\n ```", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[4, 2], [I32]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 8], [I8]>" }, { "name": "c", "type": "VectorOfLengthAndType<[16, 8], [I8]>" } ], "results": [ { "name": "res", "type": "VectorOfLengthAndType<[4, 2], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['b', 'c']>" }, { "type": "AllTypesMatch<['a', 'res']>" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` type($b) `,` type($c) `to` type($res)" }, { "name": "arm_neon.intr.bfmmla", "summary": "BFloat16 matrix multiply-accumulate to single-precision", "description": "BFMMLA: BFloat16 matrix multiply-accumulate to single-precision.\n\n The operation multiplies the 2x4 BFloat16 matrix in the first source vector\n with the 4x2 BFloat16 matrix in the second source vector, then accumulates\n this intermediate result with the 2x2 Float32 matrix in the accumulator\n vector, yielding the final 2x2 Float32 result.\n\n Source:\n https://developer.arm.com/architectures/instruction-sets/intrinsics/vbfmmlaq_f32", "operands": [ { "name": "acc", "type": "NeonVectorOfLength<4, F32>" }, { "name": "src1", "type": "NeonVectorOfLength<8, BF16>" }, { "name": "src2", "type": "NeonVectorOfLength<8, BF16>" } ], "results": [ { "name": "res", "type": "NeonVectorOfLength<4, F32>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($res)" }, { "name": "arm_neon.intr.sdot", "summary": "sdot op", "description": "Signed integer addition of dot product (vector). This instruction performs\n the following operation on signed integer vectors: res = dot(b, c) + a,\n where vector operands are partitioned into groups of four elements.\n\n Source:\n https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[4, 2], [I32]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 8], [I8]>" }, { "name": "c", "type": "VectorOfLengthAndType<[16, 8], [I8]>" } ], "results": [ { "name": "res", "type": "VectorOfLengthAndType<[4, 2], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['b', 'c']>" }, { "type": "AllTypesMatch<['a', 'res']>" }, { "type": "TypesMatchWith<'b', 'res', '[object Object],[object Object]'>" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` type($b) `,` type($c) `to` type($res)" }, { "name": "arm_neon.intr.smmla", "summary": "Matrix-matrix multiply and accumulate op", "description": "SMMLA: Signed integer matrix multiply-accumulate.\n\n Signed 8-bit integer matrix multiply-accumulate. This instruction multiplies\n the 2x8 matrix of signed 8-bit integer values in the first source vector by\n the 8x2 matrix of signed 8-bit integer values in the second source vector.\n The resulting 2x2 32-bit integer matrix product is destructively added to\n the 32-bit integer matrix accumulator in the destination vector. This is\n equivalent to performing an 8-way dot product per destination element.\n\n Source:\n https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]&q=smmla", "operands": [ { "name": "acc", "type": "NeonVectorOfLength<4, I32>" }, { "name": "src1", "type": "NeonVectorOfLength<16, I8>" }, { "name": "src2", "type": "NeonVectorOfLength<16, I8>" } ], "results": [ { "name": "res", "type": "NeonVectorOfLength<4, I32>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($res)" }, { "name": "arm_neon.intr.smull", "summary": "smull roundscale op", "description": "Signed Multiply Long (vector). This instruction multiplies corresponding\n signed integer values in the lower or upper half of the vectors of the two\n source SIMD&FP registers, places the results in a vector, and writes the\n vector to the destination SIMD&FP register.\n\n Source:\n https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8, 4, 2], [I8, I16, I32]>" }, { "name": "b", "type": "VectorOfLengthAndType<[8, 4, 2], [I8, I16, I32]>" } ], "results": [ { "name": "res", "type": "VectorOfLengthAndType<[8, 4, 2], [I16, I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "TypesMatchWith<'a', 'res', '::llvm::cast($_self).scaleElementBitwidth(2)'>" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($a) `to` type($res)" }, { "name": "arm_neon.intr.ummla", "summary": "Unsinged matrix-matrix multiply and accumulate op", "description": "UMMLA: Signed integer matrix multiply-accumulate.\n\n Unsigned 8-bit integer matrix multiply-accumulate. This instruction\n multiplies the 2x8 matrix of unsigned 8-bit integer values in the first\n source vector by the 8x2 matrix of unsigned 8-bit integer values in the\n second source vector. The resulting 2x2 32-bit integer matrix product is\n destructively added to the 32-bit integer matrix accumulator in the\n destination vector. This is equivalent to performing an 8-way dot product\n per destination element.\n\n Source:\n https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]&q=ummla", "operands": [ { "name": "acc", "type": "NeonVectorOfLength<4, I32>" }, { "name": "src1", "type": "NeonVectorOfLength<16, I8>" }, { "name": "src2", "type": "NeonVectorOfLength<16, I8>" } ], "results": [ { "name": "res", "type": "NeonVectorOfLength<4, I32>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($res)" }, { "name": "arm_neon.intr.usmmla", "summary": "Unsignged and signed matrix-matrix multiply and accumulate op", "description": "USMMLA: Signed integer matrix multiply-accumulate.\n\n Unsigned and signed 8-bit integer matrix multiply-accumulate. This\n instruction multiplies the 2x8 matrix of unsigned 8-bit integer values in\n the first source vector by the 8x2 matrix of signed 8-bit integer values in\n the second source vector. The resulting 2x2 32-bit integer matrix product is\n destructively added to the 32-bit integer matrix accumulator in the\n destination vector. This is equivalent to performing an 8-way dot product\n per destination element.\n\n\n Source:\n https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]&q=usmmla", "operands": [ { "name": "acc", "type": "NeonVectorOfLength<4, I32>" }, { "name": "src1", "type": "NeonVectorOfLength<16, I8>" }, { "name": "src2", "type": "NeonVectorOfLength<16, I8>" } ], "results": [ { "name": "res", "type": "NeonVectorOfLength<4, I32>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($res)" }, { "name": "arm_sme.copy_tile", "summary": "Copies an SME tile value", "description": "Copies an SME \"virtual tile\" value to a new SSA value. This operation is\n primarily intended to be used to normalize the IR prior to tile allocation.\n\n Example:\n\n ```mlir\n %copy = arm_sme.copy_tile %tile : vector<[4]x[4]xf32>\n ```", "operands": [ { "name": "tile", "type": "SMETile" } ], "results": [ { "name": "result", "type": "SMETile" } ], "traits": [ { "type": "AllTypesMatch<['tile', 'result']>" } ], "assemblyFormat": "$tile attr-dict `:` type($result)" }, { "name": "arm_sme.extract_tile_slice", "summary": "Extract 1-D scalable vector from slice of 2-D tile", "description": "Extracts a 1-D scalable slice from a 2-D scalable tile at the given index.\n A tile slice is a 1-D vector of horizontally or vertically contiguous\n elements within a ZA tile.\n\n An optional tile slice layout attribute specifies whether the tile slice is\n horizontal (default) or vertical.\n\n Example 1: Extract `vector<[16]xi8>` from tile horizontally at the given index.\n ```mlir\n %slice = arm_sme.extract_tile_slice %tile[%tile_slice_index] : vector<[16]xi8> from vector<[16]x[16]xi8>\n ```\n\n Example 2: Extract `vector<[2]xf64>` from tile vertically at the given index.\n ```mlir\n %slice = arm_sme.extract_tile_slice %tile[%tile_slice_index] layout : vector<[2]xf64> from vector<[2]x[2]xf64>\n ```", "operands": [ { "name": "tile", "type": "SMETile" }, { "name": "tile_slice_index", "type": "Index" } ], "results": [ { "name": "result", "type": "SVEVector" } ], "attributes": [ { "name": "layout", "type": "ArmSME_TileSliceLayoutAttr{horizontal|vertical}" } ], "traits": [ { "type": "TypesMatchWith<'tile', 'result', 'VectorType(VectorType::Builder(::llvm::cast($_self)).dropDim(0))'>" } ], "assemblyFormat": "$tile `[` $tile_slice_index `]` (`layout` `` $layout^)? attr-dict\n `:` type($result) `from` type($tile)" }, { "name": "arm_sme.fmopa_2way", "summary": "Floating-point sum of 2 outer products and accumulate", "description": "This operation represents a sum of 2 widened outer products. It takes 2 1-D\n scalable vectors as input and a 2-D scalable vector (ZA tile) as output.\n\n For example (fp16 to fp32):\n\n ```mlir\n %result = arm_sme.fmopa_2way %lhs, %rhs :\n vector<[8]xf16>, vector<[8]xf16> into vector<[4]x[4]xf32>\n ```\n\n The `lhs` encodes a matrix of shape SVLSx2 and the `rhs` a matrix of\n 2xSVLS, where SVLS (spec [1], section B2.1) is the number of 32-bit\n elements in a vector of SVL bits. To illustrate, below is a breakdown of\n this operation for fp16 to fp32, SVL=128 (i.e., vscale=1):\n\n ```\n LHS RHS\n [A0 A1 A2 A3 A4 A5 A6 A7] [B0 B1 B2 B3 B4 B5 B6 B7]\n\n ----------------------------------------------------------------------------\n\n implicit layout\n\n [A0 A1] |\n [A2 A3] | [B0 B2 B4 B6]\n [A4 A5] | [B1 B3 B5 B7]\n [A6 A7] |\n\n ----------------------------------------------------------------------------\n\n 2 outer products\n\n Acol0 ⊗ Brow0 | Acol1 ⊗ Brow1\n ------------- | -------------\n |\n [B0 B2 B4 B6] | [B1 B3 B5 B7]\n |\n [A0 [A0B0 A0B2 A0B4 A0B6] | [A1 [A1B1 A1B3 A1B5 A1B7]\n A2 [A2B0 A2B2 A2B4 A2B6] | A3 [A3B1 A3B3 A3B5 A3B7]\n A4 [A4B0 A4B2 A4B4 A4B6] | A5 [A5B1 A5B3 A5B5 A5B7]\n A6] [A6B0 A6B2 A6B4 A6B6] | A7] [A7B1 A7B3 A7B5 A7B7]\n |\n\n ----------------------------------------------------------------------------\n\n sum of 2 outer products\n\n Acol0 ⊗ Brow0 + Acol1 ⊗ Brow1\n\n [A0B0 + A1B1 A0B2 + A1B3 A0B4 + A1B5 A0B6 + A1B7]\n [A2B0 + A3B1 A2B2 + A3B3 A2B4 + A3B5 A2B6 + A3B7]\n [A4B0 + A5B1 A4B2 + A5B3 A4B4 + A5B5 A4B6 + A5B7]\n [A6B0 + A7B1 A6B2 + A7B3 A6B4 + A7B5 A6B6 + A7B7]\n\n ----------------------------------------------------------------------------\n ```\n\n This operation enables the folding of 2 outer products chained via the\n accumulator into a single outer product.\n\n For example:\n\n ```mlir\n %a0_ext = arith.extf %a0 : vector<[4]xf16> to vector<[4]xf32>\n %b0_ext = arith.extf %b0 : vector<[4]xf16> to vector<[4]xf32>\n %a1_ext = arith.extf %a1 : vector<[4]xf16> to vector<[4]xf32>\n %b1_ext = arith.extf %b1 : vector<[4]xf16> to vector<[4]xf32>\n\n %0 = arm_sme.outerproduct %a0_ext, %b0_ext : vector<[4]xf32>, vector<[4]xf32>\n %1 = arm_sme.outerproduct %a1_ext, %b1_ext acc(%0) : vector<[4]xf32>, vector<[4]xf32>\n ```\n\n The 2 outer products in the example above can be fused into a single outer\n product as follows:\n\n ```mlir\n %a_packed = vector.interleave %a0, %a1 : vector<[4]xf16> -> vector<[8]xf16>\n %b_packed = vector.interleave %b0, %b1 : vector<[4]xf16> -> vector<[8]xf16>\n %0 = arm_sme.fmopa_2way %a_packed, %b_packed : vector<[8]xf16>, vector<[8]xf16> into vector<[4]x[4]xf32>\n ```\n\n This is implemented in the `-arm-sme-outer-product-fusion` pass.\n\n Example: FP16 to FP32\n ```mlir\n %result = arm_sme.fmopa_2way $lhs, $rhs : vector<[8]xf16>, vector<[8]xf16> into vector<[4]x[4]xf32>\n ```\n\n Example: BF16 to FP32\n ```mlir\n %result = arm_sme.fmopa_2way $lhs, $rhs : vector<[8]xbf16>, vector<[8]xbf16> into vector<[4]x[4]xf32>\n ```\n\n | Spec | Features |\n | ---- | -------- |\n | [FMOPA (widening, 2-way, FP16 to FP32)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/FMOPA--widening--2-way--FP16-to-FP32---Half-precision-floating-point-sum-of-outer-products-and-accumulate-) | +sme |\n | [BFMOPA (widening, 2-way, BF16 to FP32)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/BFMOPA--widening---BFloat16-sum-of-outer-products-and-accumulate-) | +sme |\n\n [1] https://developer.arm.com/documentation/ddi0616", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [8], [F16, BF16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4f32]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.fmops_2way", "summary": "Floating-point sum of 2 outer products and subtract", "description": "Equivalent to `fmopa_2way` but outer products are subtracted from\n destination `result`.\n\n Example: FP16 to FP32\n ```mlir\n %result = arm_sme.fmops_2way $lhs, $rhs : vector<[8]xf16>, vector<[8]xf16> into vector<[4]x[4]xf32>\n ```\n\n Example: BF16 to FP32\n ```mlir\n %result = arm_sme.fmops_2way $lhs, $rhs : vector<[8]xbf16>, vector<[8]xbf16> into vector<[4]x[4]xf32>\n ```\n\n Refer to\n [fmopa_2way](#arm_smefmopa_2way-arm_smefmopa2wayop) for a detailed\n description of 2-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [FMOPS (widening, 2-way, FP16 to FP32)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/FMOPS--widening---Half-precision-floating-point-sum-of-outer-products-and-subtract-) | +sme |\n | [BFMOPS (widening, 2-way, BF16 to FP32)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/BMOPS--Bitwise-exclusive-NOR-population-count-outer-product-and-subtract-) | +sme |", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [8], [F16, BF16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4f32]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.get_tile", "summary": "Creates an undefined value of SME virtual tile type", "description": "Creates a new SME \"virtual tile\" value within a function. The contents of\n the tile returned from this operation are undefined.\n\n Example 1:\n\n ```mlir\n // Create an 8-bit element \"virtual tile\" value:\n %za0_b = arm_sme.get_tile: vector<[16]x[16]xi8>\n ```\n\n Example 2:\n\n ```mlir\n // Create two 16-bit element \"virtual tiles\" values:\n %za0_h = arm_sme.get_tile : vector<[8]x[8]xi16>\n %za1_h = arm_sme.get_tile : vector<[8]x[8]xi16>\n ```\n\n Example 3:\n ```mlir\n // Create an 128-bit element \"virtual tile\" value:\n %za0_q = arm_sme.get_tile : vector<[1]x[1]xi128>\n ```", "results": [ { "name": "tile", "type": "SMETile" } ], "assemblyFormat": "attr-dict `:` type($tile)" }, { "name": "arm_sme.insert_tile_slice", "summary": "Insert 1-D scalable vector into slice of 2-D tile", "description": "Inserts a 1-D scalable vector into a slice of a 2-D scalable vector tile at\n the given index. The type of the 1-D scalable vector to be inserted must\n match the type of the tile slice. A tile slice is a 1-D vector of\n horizontally or vertically contiguous elements within a ZA tile. The updated\n tile is returned as the result.\n\n An optional tile slice layout attribute specifies whether the tile slice is\n horizontal (default) or vertical.\n\n Example 1: Insert `vector<[16]xi8>` into tile horizontally at the given index.\n ```mlir\n %tile_update = arm_sme.insert_tile_slice %vector, %tile[%tile_slice_index] : vector<[16]xi8> into vector<[16]x[16]xi8>\n ```\n\n Example 2: Insert `vector<[2]xf64>` into tile vertically at the given index.\n ```mlir\n %tile_update = arm_sme.insert_tile_slice %vector, %tile[%tile_slice_index] layout : vector<[2]xf64> into vector<[2]x[2]xf64>\n ```", "operands": [ { "name": "vector", "type": "SVEVector" }, { "name": "tile", "type": "SMETile" }, { "name": "tile_slice_index", "type": "Index" } ], "results": [ { "name": "result", "type": "SMETile" } ], "attributes": [ { "name": "layout", "type": "ArmSME_TileSliceLayoutAttr{horizontal|vertical}" } ], "traits": [ { "type": "AllTypesMatch<['tile', 'result']>" }, { "type": "TypesMatchWith<'tile', 'vector', '[object Object],[object Object],[object Object],[object Object]'>" } ], "assemblyFormat": "$vector `,` $tile `[` $tile_slice_index `]` (`layout` `` $layout^)?\n attr-dict `:` type($vector) `into` type($result)" }, { "name": "arm_sme.load_tile_slice", "summary": "Tile slice load and update operation", "description": "Loads a 1D tile slice from memory into a 2D SME \"virtual tile\". The tile\n slice is defined by the dimension of the 2D scalable vector type pointed by\n the index. A tile slice index describes where in the input tile the tile\n slice is loaded to. An optional tile slice layout attribute specifies\n whether the tile slice being loaded at the given index is horizontal\n (default) or vertical. The updated tile is returned as the result.\n\n The slice of memory read is defined by a base and indices and must be\n contiguous. The memref must be either rank 1 or rank 2, have dynamic\n dimensions since the operation is scalable, and the element type must be a\n scalar that matches the element type of the result.\n\n The provided `mask` is used to specify which elements of the tile slice\n will be loaded.\n\n Example 1: Load a vector<[16]xi8> tile slice from memory into tile horizontally (default) at given index.\n ```mlir\n %tile_update = arm_sme.load_tile_slice %base[%c0], %mask, %tile, %tile_slice_index : memref, vector<[16]xi1>, vector<[16]x[16]xi8>\n ```\n\n Example 2: Load a vector<[4]xf32> tile slice from memory into tile vertically at given index.\n ```mlir\n %tile_update = arm_sme.load_tile_slice %base[%c0], %mask, %tile, %tile_slice_index layout : memref, vector<[4]xi1>, vector<[4]x[4]xf32>\n ```\n\n Example 3: Load a vector<[1]xi128> tile slice from memory into tile vertically at given index.\n ```mlir\n %tile_update = arm_sme.load_tile_slice %base[%c0], %mask, %tile, %tile_slice_index layout : memref, vector<[1]xi1>, vector<[1]x[1]xi128>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "mask", "type": "SVEPredicate" }, { "name": "tile", "type": "SMETile" }, { "name": "indices", "type": "Variadic" }, { "name": "tile_slice_index", "type": "Index" } ], "results": [ { "name": "result", "type": "SMETile" } ], "attributes": [ { "name": "layout", "type": "ArmSME_TileSliceLayoutAttr{horizontal|vertical}" } ], "traits": [ { "type": "AllTypesMatch<['tile', 'result']>" } ], "assemblyFormat": "$base `[` $indices `]` `,` $mask `,` $tile `,` $tile_slice_index\n (`layout` `` $layout^)? attr-dict `:` type($base) `,` type($mask) `,`\n type($result)" }, { "name": "arm_sme.outerproduct", "summary": "Outer product with optional fused add/sub", "description": "This operation represents an outer product that fits within an SME tile.\n All operands must be SVE vectors and the result a SME tile. Unlike\n `vector.outerproduct` masking is on the operands (rather than the result),\n which mirrors the SME instructions.\n\n Example 1: Unmasked outerproduct (without accumulator)\n ```mlir\n // Not specifying an accumulator implicitly zeros the destination tile.\n %result = arm_sme.outerproduct $lhs, $rhs : vector<[4]xf32>, vector<[4]xf32>\n ```\n\n Example 2: Unmasked outerproduct (with accumulator)\n ```mlir\n %result = arm_sme.outerproduct $lhs, $rhs acc($accumulator)\n : vector<[4]xf32>, vector<[4]xf32>\n ```\n\n Example 3: Masked outerproduct\n ```mlir\n %result = arm_sme.outerproduct $lhs, $rhs masks($lhsMask, $rhsMask)\n : vector<[4]xf32>, vector<[4]xf32>\n ```\n\n Example 4: Masked outerproduct (with accumulator)\n ```mlir\n %result = arm_sme.outerproduct $lhs, $rhs acc($accumulator) masks($lhsMask, $rhsMask)\n : vector<[4]xf32>, vector<[4]xf32>\n ```", "operands": [ { "name": "lhs", "type": "SVEVector" }, { "name": "rhs", "type": "SVEVector" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "SMETile" } ], "attributes": [ { "name": "kind", "type": "ArmSME_CombiningKindAttr{add|sub}" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `kind` `` $kind\n | `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs)" }, { "name": "arm_sme.smopa_2way", "summary": "Signed integer sum of 2 outer products and accumulate", "description": "Example:\n ```mlir\n %result = arm_sme.smopa_2way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[4]x[4]xi32>\n ```\n\n Refer to\n [fmopa_2way](#arm_smefmopa_2way-arm_smefmopa2wayop) for a detailed\n description of 2-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [SMOPA (2-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/SMOPA--2-way---Signed-integer-sum-of-outer-products-and-accumulate-) | +sme2 |", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.smopa_4way", "summary": "Signed integer sum of 4 outer products and accumulate", "description": "This operation represents a sum of 4 widened outer products. It takes 2 1-D\n scalable vectors as input and a 2-D scalable vector (ZA tile) as output.\n\n For example (i8 to i32):\n\n ```mlir\n %result = arm_sme.smopa_4way $lhs, $rhs :\n vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n The `lhs` encodes a matrix of shape SVLSx4 and the `rhs` a matrix of\n 4xSVLS, where SVLS (spec [1], section B2.1) is the number of 32-bit\n elements in a vector of SVL bits. To illustrate, below is a breakdown of\n this operation for i8 to i32, SVL=128 (i.e., vscale=1):\n\n ```\n LHS\n [A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A15 A14 A15]\n\n RHS\n [B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15]\n\n ----------------------------------------------------------------------------\n\n implicit layout\n\n [A0 A1 A2 A3] | [B0 B4 B8 B12]\n [A4 A5 A6 A7] | [B1 B5 B9 B13]\n [A8 A9 A10 A11] | [B2 B6 B10 B14]\n [A12 A13 A14 A15] | [B3 B7 B11 B15]\n\n ----------------------------------------------------------------------------\n\n 4 outer products\n\n Acol0 ⊗ Brow0 | Acol1 ⊗ Brow1\n ------------- | -------------\n |\n [B0 B4 B8 B12] | [B1 B5 B9 B13]\n |\n [A0 [ A0B0 A0B4 A0B8 A0B12] | [A1 [ A1B1 A1B5 A1B9 A1B13]\n A4 [ A4B0 A4B4 A4B8 A4B12] | A5 [ A5B1 A5B5 A5B9 A5B13]\n A8 [ A8B0 A8B4 A8B8 A8B12] | A9 [ A9B1 A9B5 A9B9 A9B13]\n A12] [A12B0 A12B4 A12B8 A12B12] | A13] [A13B1 A13B5 A13B9 A13B13]\n |\n Acol2 ⊗ Brow2 | Acol3 ⊗ Brow3\n ------------- | -------------\n |\n [B2, B6, B10, B14] | [B3 B7 B11 B15]\n |\n [A2 [ A2B2 A2B6 A2B10 A2B14] | [A3 [ A3B3 A3B7 A3B11 A3B15]\n A6 [ A6B2 A6B6 A6B10 A6B14] | A7 [ A7B3 A7B7 A7B11 A7B15]\n A10 [A10B2 A10B6 A10B10 A10B14] | A11 [A11B3 A11B7 A11B11 A11B15]\n A14] [A14B2 A14B6 A14B10 A14B14] | A15] [A15B3 A15B7 A15B11 A15B15]\n |\n\n ----------------------------------------------------------------------------\n\n sum of 4 outer products\n\n Acol0 ⊗ Brow0 + Acol1 ⊗ Brow1 + Acol2 ⊗ Brow2 + Acol3 ⊗ Brow3\n\n [ A0B0 + A1B1 + A2B2 + A3B3 ... ... A0B12 + A1B13 + A2B14 + A3B15]\n [ A4B0 + A5B1 + A6B2 + A7B3 ... ... A4B12 + A5B13 + A6B14 + A7B15]\n [ A8B0 + A9B1 + A10B2 + A11B3 ... ... A8B12 + A9B13 + A10B14 + A11B15]\n [A12B0 + A13B1 + A14B2 + A15B3 ... ... A12B12 + A13B13 + A14B14 + A15B15]\n\n ----------------------------------------------------------------------------\n ```\n\n This operation enables the folding of 4 outer products chained via the\n accumulator into a single outer product.\n\n For example:\n\n ```mlir\n %a0_ext = arith.extsi %a0 : vector<[4]xi8> to vector<[4]xi32>\n %b0_ext = arith.extsi %b0 : vector<[4]xi8> to vector<[4]xi32>\n\n %a1_ext = arith.extsi %a1 : vector<[4]xi8> to vector<[4]xi32>\n %b1_ext = arith.extsi %b1 : vector<[4]xi8> to vector<[4]xi32>\n\n %a2_ext = arith.extsi %a2 : vector<[4]xi8> to vector<[4]xi32>\n %b2_ext = arith.extsi %b2 : vector<[4]xi8> to vector<[4]xi32>\n\n %a3_ext = arith.extsi %a3 : vector<[4]xi8> to vector<[4]xi32>\n %b3_ext = arith.extsi %b3 : vector<[4]xi8> to vector<[4]xi32>\n\n %0 = arm_sme.outerproduct %a0_ext, %b0_ext : vector<[4]xi32>, vector<[4]xi32>\n %1 = arm_sme.outerproduct %a1_ext, %b1_ext acc(%0) : vector<[4]xi32>, vector<[4]xi32>\n %2 = arm_sme.outerproduct %a2_ext, %b2_ext acc(%1) : vector<[4]xi32>, vector<[4]xi32>\n %3 = arm_sme.outerproduct %a3_ext, %b3_ext acc(%2) : vector<[4]xi32>, vector<[4]xi32>\n ```\n\n The 4 outer products in the example above can be fused into a single outer\n product as follows:\n\n ```mlir\n %lhs0 = vector.interleave %a0, %a2 : vector<[4]xi8> -> vector<[8]xi8>\n %lhs1 = vector.interleave %a1, %a3 : vector<[4]xi8> -> vector<[8]xi8>\n %lhs = vector.interleave %lhs0, %lhs1 : vector<[8]xi8> -> vector<[16]xi8>\n\n %rhs0 = vector.interleave %b0, %b2 : vector<[4]xi8> -> vector<[8]xi8>\n %rhs1 = vector.interleave %b1, %b3 : vector<[4]xi8> -> vector<[8]xi8>\n %rhs = vector.interleave %rhs0, %rhs1 : vector<[8]xi8> -> vector<[16]xi8>\n\n %0 = arm_sme.smopa_4way %lhs, %rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n This is implemented in the `-arm-sme-outer-product-fusion` pass.\n\n Example: I8 to I32\n ```mlir\n %result = arm_sme.smopa_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.smopa_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n | Spec | Features |\n | ---- | -------- |\n | [SMOPA (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/SMOPA--4-way---Signed-integer-sum-of-outer-products-and-accumulate-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.smops_2way", "summary": "Signed integer sum of 2 outer products and subtract", "description": "Example:\n ```mlir\n %result = arm_sme.smops_2way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[4]x[4]xi32>\n ```\n\n Refer to\n [fmopa_2way](#arm_smefmopa_2way-arm_smefmopa2wayop) for a detailed\n description of 2-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [SMOPS (2-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/SMOPS--2-way---Signed-integer-sum-of-outer-products-and-subtract-) | +sme2 |", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.smops_4way", "summary": "Signed integer sum of 4 outer products and subtract", "description": "Equivalent to `smopa_4way` but outer products are subtracted from\n destination `result`.\n\n Example: I8 to I32\n ```mlir\n %result = arm_sme.smops_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.smops_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [SMOPS (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/SMOPS--4-way---Signed-integer-sum-of-outer-products-and-subtract-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.store_tile_slice", "summary": "Tile slice store operation", "description": "Stores a 1D tile slice from a 2D SME \"virtual tile\" into memory. The tile\n slice is defined by the dimension of the 2D scalable vector type pointed by\n the index. A tile slice index describes where in the input tile the tile\n slice is stored from. An optional tile slice layout attribute specifies\n whether the tile slice being stored from the given index is horizontal\n (default) or vertical.\n\n The slice of memory written is defined by a base and indices and must be\n contiguous. The memref must be either rank 1 or rank 2, have dynamic\n dimensions since the operation is scalable, and the element type must be a\n scalar that matches the element type of the input tile.\n\n The provided `mask` is used to specify which elements of the tile slice\n will be stored.\n\n Example 1: Store vector<[16]xi8> horizontal (default) tile slice from tile at given index to memory.\n ```mlir\n arm_sme.store_tile_slice %tile, %tile_slice_index, %mask, %base[%c0] : vector<[16]x[16]xi8>, vector<[16]xi1>, memref\n ```\n\n Example 2: Store vector<[4]xf32> vertical tile slice from tile at given index to memory.\n ```mlir\n arm_sme.store_tile_slice %tile, %tile_slice_index, %mask, %base[%c0] layout : vector<[4]x[4]xf32>, vector<[4]xi1>, memref\n ```\n\n Example 3: Store a vector<[1]xi128> vertical tile slice from tile at given index to memory.\n ```mlir\n arm_sme.store_tile_slice %tile, %tile_slice_index, %mask, %base[%c0] layout : vector<[1]x[1]xi128>, vector<[1]xi1>, memref\n ```", "operands": [ { "name": "tile", "type": "SMETile" }, { "name": "tile_slice_index", "type": "Index" }, { "name": "mask", "type": "SVEPredicate" }, { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "layout", "type": "ArmSME_TileSliceLayoutAttr{horizontal|vertical}" } ], "assemblyFormat": "$tile `,` $tile_slice_index `,` $mask `,` $base `[` $indices `]` (`layout` `` $layout^)?\n attr-dict `:` type($base) `,` type($mask) `,` type($tile)" }, { "name": "arm_sme.streaming_vl", "summary": "Query the streaming vector length", "description": "This operation returns the streaming vector length (SVL) for a given type\n size. Unlike `vector.vscale` the value returned is invariant to the\n streaming mode.\n\n Example:\n ```mlir\n // Streaming vector length in:\n // - bytes (8-bit, SVL.B)\n %svl_b = arm_sme.streaming_vl \n // - half words (16-bit, SVL.H)\n %svl_h = arm_sme.streaming_vl \n // - words (32-bit, SVL.W)\n %svl_w = arm_sme.streaming_vl \n // - double words (64-bit, SVL.D)\n %svl_d = arm_sme.streaming_vl \n ```", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "type_size", "type": "ArmSME_TypeSizeAttr{byte|half|word|double}" } ], "assemblyFormat": "$type_size attr-dict" }, { "name": "arm_sme.sumopa_4way", "summary": "Signed by unsigned integer sum of 4 outer products and accumulate", "description": "Example: I8 to I32\n ```mlir\n %result = arm_sme.sumopa_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.sumopa_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [SUMOPA (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/SUMOPA--Signed-by-unsigned-integer-sum-of-outer-products-and-accumulate-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.sumops_4way", "summary": "Signed by unsigned integer sum of 4 outer products and subtract", "description": "Example: I8 to I32\n ```mlir\n %result = arm_sme.sumops_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.sumops_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [SUMOPS (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/SUMOPS--Signed-by-unsigned-integer-sum-of-outer-products-and-subtract-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.tile_load", "summary": "Tile load operation", "description": "Loads a 2D SME \"virtual tile\" from memory defined by a base and indices,\n with the shape defined by the 2D scalable vector type of the result tile.\n An optional tile slice layout attribute specifies whether the slices of the\n tile being loaded are horizontal (default) or vertical. The slice of memory\n must be contiguous. The memref must be either rank 1 or rank 2 with dynamic\n dimensions, since the operation is scalable, and the element type must be a\n scalar that matches the element type of the result.\n\n An optional SSA value `padding` of the same elemental type as the MemRef is\n provided to specify a fallback value in the case of masking.\n\n An optional SSA value `mask` may be specified to mask out elements read\n from the MemRef. The `mask` type is an `i1` vector with a shape that\n matches how elements are read from the MemRef. Elements whose corresponding\n mask element is `0` are masked out and replaced with `padding`.\n\n If either `padding` or `mask` are specified, both must be specified.\n\n Example 1: Load an 8-bit element ZA tile with horizontal layout (default) from memory (ZA0.B).\n ```mlir\n %tile = arm_sme.tile_load %base[%c0, %c0] : memref, vector<[16]x[16]xi8>\n ```\n\n Example 2: Load a FP 32-bit element ZA tile with vertical layout from memory.\n ```mlir\n %tile = arm_sme.tile_load %base[%c0, %c0] layout : memref, vector<[4]x[4]xf32>\n ```\n\n Example 3: Load a 128-bit element ZA tile with horizontal layout (default) from memory.\n ```mlir\n %tile = arm_sme.tile_load %base[%c0, %c0] layout : memref, vector<[1]x[1]xi128>\n ```\n\n Example 4: Masked load of int 32-bit element ZA tile with horizontal layout (default) from memory.\n ```mlir\n %tile = arm_sme.tile_load %base[%c0, %c0], %pad, %mask : memref, vector<[4]x[4]xf32>\n ```", "operands": [ { "name": "base", "type": "MemRefRankOf<[ AnyType ], [ 2 ]>" }, { "name": "indices", "type": "Variadic" }, { "name": "padding", "type": "Optional" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "SMETile" } ], "attributes": [ { "name": "layout", "type": "ArmSME_TileSliceLayoutAttr{horizontal|vertical}" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'result', 'padding', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$base `[` $indices `]` (`,` $padding `,` $mask^)? (`layout` `` $layout^)?attr-dict `:` type($base) `,` type($result)" }, { "name": "arm_sme.tile_store", "summary": "Tile store operation", "description": "Stores a 2D SME \"virtual tile\" to memory defined by a base and indices,\n with the shape defined by the 2D scalable vector type of the tile being\n stored. An optional tile slice layout attribute specifies whether the\n slices of the tile being stored are horizontal (default) or vertical. The\n slice of memory must be contiguous. The memref must be either rank 1 or\n rank 2 with dynamic dimensions, since the operation is scalable, and the\n element type must be a scalar that matches the element type of the result.\n\n An optional `mask` may be provided, the shape of which corresponds to the\n `tile`, and selects which elements of the tile will be stored.\n\n Example 1: Store an 8-bit element ZA tile with horizontal (default) layout to memory (ZA0.B).\n ```mlir\n arm_sme.tile_store %tile, %base[%c0, %c0] : vector<[16]x[16]xi8>, memref\n ```\n\n Example 2: Store a FP 32-bit element ZA tile with vertical layout to memory.\n ```mlir\n arm_sme.tile_store %tile, %base[%c0, %c0] layout : vector<[4]x[4]xf32>, memref\n ```\n\n Example 3: Store a 128-bit element ZA tile with horizontal (default) layout to memory.\n ```mlir\n arm_sme.tile_store %tile, %base[%c0, %c0] layout : vector<[1]x[1]xi128>, memref\n ```\n\n Example 4: Masked store a int 32-bit element ZA tile with vertical layout to memory.\n ```mlir\n arm_sme.tile_store %tile, %base[%c0, %c0], %mask layout : vector<[4]x[4]xf32>, memref\n ```", "operands": [ { "name": "valueToStore", "type": "SMETile" }, { "name": "base", "type": "MemRefRankOf<[ AnyType ], [ 2 ]>" }, { "name": "indices", "type": "Variadic" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "layout", "type": "ArmSME_TileSliceLayoutAttr{horizontal|vertical}" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$valueToStore `,` $base `[` $indices `]` (`,` $mask^)? (`layout` `` $layout^)?attr-dict `:` type($base) `,` type($valueToStore)" }, { "name": "arm_sme.umopa_2way", "summary": "Unsiged integer sum of 2 outer products and accumulate", "description": "Example:\n ```mlir\n %result = arm_sme.umopa_2way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[4]x[4]xi32>\n ```\n\n Refer to\n [fmopa_2way](#arm_smefmopa_2way-arm_smefmopa2wayop) for a detailed\n description of 2-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [UMOPA (2-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/UMOPA--2-way---Unsigned-integer-sum-of-outer-products-and-accumulate-) | +sme2 |", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.umopa_4way", "summary": "Unsigned integer sum of 4 outer products and accumulate", "description": "Example: I8 to I32\n ```mlir\n %result = arm_sme.umopa_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.umopa_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [UMOPA (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/UMOPA--4-way---Unsigned-integer-sum-of-outer-products-and-accumulate-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.umops_2way", "summary": "Unsiged integer sum of 2 outer products and subtract", "description": "Example:\n ```mlir\n %result = arm_sme.umops_2way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[4]x[4]xi32>\n ```\n\n Refer to\n [fmopa_2way](#arm_smefmopa_2way-arm_smefmopa2wayop) for a detailed\n description of 2-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [UMOPS (2-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/UMOPS--2-way---Unsigned-integer-sum-of-outer-products-and-subtract-) | +sme2 |", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.umops_4way", "summary": "Unsigned integer sum of 4 outer products and subtract", "description": "Example: I8 to I32\n ```mlir\n %result = arm_sme.umops_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.umops_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [UMOPS (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/UMOPS--4-way---Unsigned-integer-sum-of-outer-products-and-subtract-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.usmopa_4way", "summary": "Unsigned by signed integer sum of 4 outer products and accumulate", "description": "Example: I8 to I32\n ```mlir\n %result = arm_sme.usmopa_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.usmopa_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [USMOPA (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/USMOPA--Unsigned-by-signed-integer-sum-of-outer-products-and-accumulate-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.usmops_4way", "summary": "Unsigned by signed integer sum of 4 outer products and subtract", "description": "Example: I8 to I32\n ```mlir\n %result = arm_sme.usmops_4way $lhs, $rhs : vector<[16]xi8>, vector<[16]xi8> into vector<[4]x[4]xi32>\n ```\n\n Example: I16 to I64\n ```mlir\n %result = arm_sme.usmops_4way $lhs, $rhs : vector<[8]xi16>, vector<[8]xi16> into vector<[2]x[2]xi64>\n ```\n\n Refer to [smopa_4way](#arm_smesmopa_4way-arm_smesmopa4wayop) for a\n detailed description of 4-way outer products.\n\n | Spec | Features |\n | ---- | -------- |\n | [USMOPS (4-way)](https://developer.arm.com/documentation/ddi0602/2023-09/SME-Instructions/USMOPS--Unsigned-by-signed-integer-sum-of-outer-products-and-subtract-) | +sme (32-bit), +sme-i16i64 (64-bit)|", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[ScalableVectorOfRankAndLengthAndType<[1], [16], [I8]>, ScalableVectorOfRankAndLengthAndType<[1], [8], [I16]>]>" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRank" }, { "name": "lhsMask", "type": "Optional" }, { "name": "rhsMask", "type": "Optional" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[nxnxv4i32, nxnxv2i64]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['lhs', 'rhs']>" }, { "type": "TypesMatchWith<'result', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$lhs `,` $rhs\n oilist(\n `acc` `` `(` $acc `)`\n | `masks` `` `(` $lhsMask `,` $rhsMask `)`\n ) attr-dict `:` type($lhs) `,` type($rhs) `into` type($result)" }, { "name": "arm_sme.zero", "summary": "Creates a zero-initialized value of SME virtual tile type", "description": "Creates a new SME \"virtual tile\" value within a function. The contents of\n the tile returned from this operation are zero-initialized.\n\n Example 1: Zero an 8-bit element ZA tile.\n\n ```mlir\n %0 = arm_sme.zero : vector<[16]x[16]xi8>\n ```\n\n Example 2: Zero a 64-bit element ZA tile.\n\n ```mlir\n %0 = arm_sme.zero : vector<[2]x[2]xi64>\n ```", "results": [ { "name": "res", "type": "SMETile" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "arm_sve.convert_from_svbool", "summary": "Convert a svbool type to a SVE predicate type", "description": "Converts svbool types (`vector<[16]xi1>` or vectors of that type, e.g.\n `vector<2x3x[16]xi1>`) to SVE predicate types. Note: Only the trailing\n dimension can be scalable.\n\n Example 1: Convert a 1-D svbool mask to a SVE predicate.\n ```mlir\n %source = vector.load %memref[%c0] : memref, vector<[16]xi1>\n %result = arm_sve.convert_from_svbool %source : vector<[4]xi1>\n ```\n\n Example 2: Convert a 2-D svbool mask to a mask of SVE predicates.\n ```mlir\n %source = vector.load %memref[%c0, %c0] : memref<2x?xi1>, vector<2x[16]xi1>\n %result = arm_sve.convert_from_svbool %source : vector<2x[8]xi1>\n ```\n\n ---\n\n A `svbool` is the smallest SVE predicate type that has a in-memory\n representation (and maps to a full predicate register). In MLIR `svbool` is\n represented as `vector<[16]xi1>`. Smaller SVE predicate types\n (`vector<[1|2|4|8]xi1>`) must be stored as a `svbool` then converted back to\n the original predicate type after loading.", "operands": [ { "name": "source", "type": "SVBoolMask" } ], "results": [ { "name": "result", "type": "SVEPredicateMask" } ], "traits": [ { "type": "TypesMatchWith<'result', 'source', 'VectorType(VectorType::Builder(::llvm::cast($_self)).setDim(::llvm::cast($_self).getRank() - 1, 16))'>" } ], "assemblyFormat": "$source attr-dict `:` type($result)" }, { "name": "arm_sve.convert_to_svbool", "summary": "Convert a SVE predicate type to a svbool type", "description": "Converts SVE predicate types (or vectors of predicate types, e.g.\n `vector<4x[4]xi1>`) to svbool types. Note: Only the trailing dimension can\n be scalable.\n\n Example 1: Convert a 1-D SVE predicate to a svbool mask.\n ```mlir\n %source = vector.create_mask %dim_size : vector<[4]xi1>\n %result = arm_sve.convert_to_svbool %source : vector<[4]xi1>\n // => Results in vector<[16]xi1>\n ```\n\n Example 2: Convert a 2-D mask of SVE predicates to a svbool mask.\n ```mlir\n %source = vector.create_mask %c2, %dim_size : vector<2x[2]xi1>\n %result = arm_sve.convert_to_svbool %source : vector<2x[2]xi1>\n // => Results in vector<2x[16]xi1>\n ```\n\n ---\n\n A `svbool` is the smallest SVE predicate type that has a in-memory\n representation (and maps to a full predicate register). In MLIR `svbool` is\n represented as `vector<[16]xi1>`. Smaller SVE predicate types\n (`vector<[1|2|4|8]xi1>`) must be converted to a `svbool` before they can be\n stored.", "operands": [ { "name": "source", "type": "SVEPredicateMask" } ], "results": [ { "name": "result", "type": "SVBoolMask" } ], "traits": [ { "type": "TypesMatchWith<'source', 'result', 'VectorType(VectorType::Builder(::llvm::cast($_self)).setDim(::llvm::cast($_self).getRank() - 1, 16))'>" } ], "assemblyFormat": "$source attr-dict `:` type($source)" }, { "name": "arm_sve.dupq_lane", "summary": "Broadcast indexed 128-bit segment to vector", "description": "This operation fills each 128-bit segment of a vector with the elements\n from the indexed 128-bit segment of the source vector. If the VL is\n 128 bits the operation is a NOP. If the index exceeds the number of\n 128-bit segments in a vector the result is an all-zeroes vector.\n\n Example:\n ```mlir\n // VL == 256\n // %X = [A B C D x x x x]\n %Y = arm_sve.dupq_lane %X[0] : vector<[4]xi32>\n // Y = [A B C D A B C D]\n\n // %U = [x x x x x x x x A B C D E F G H]\n %V = arm_sve.dupq_lane %U[1] : vector<[8]xf16>\n // %V = [A B C D E F H A B C D E F H]\n ```\n\n Note: The semantics of the operation match those of the `svdupq_lane` intrinsics.\n [Source](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svdupq_lane)", "operands": [ { "name": "src", "type": "SVEVector" } ], "results": [ { "name": "dst", "type": "SVEVector" } ], "attributes": [ { "name": "lane", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['src', 'dst']>" } ], "assemblyFormat": "$src `[` $lane `]` attr-dict `:` type($dst)" }, { "name": "arm_sve.intr.add", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.bfmmla", "summary": "BFloat16 matrix multiply-accumulate", "description": "BFMMLA: BFloat16 matrix multiply-accumulate into 2×2 matrices\";\n\n This operation multiplies the 2x4 BFloat16 matrix held in each 128-bit\n segment of the first source vector by the 4x2 BFloat16 matrix in the\n corresponding segment of the second source vector, then accumulates\n this intermediate result with the 2x2 Float32 matrix in the corresponding\n segment of the accumulator vector, yielding the final 2x2 Float32\n segment of the result.\n\n Source:\n https://developer.arm.com/documentation/100987/0000", "operands": [ { "name": "acc", "type": "ScalableVectorOfLengthAndType<[4], [F32]>" }, { "name": "src1", "type": "ScalableVectorOfLengthAndType<[8], [BF16]>" }, { "name": "src2", "type": "ScalableVectorOfLengthAndType<[8], [BF16]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfLengthAndType<[4], [F32]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($res)" }, { "name": "arm_sve.intr.convert.from.svbool", "operands": [ { "name": "svbool", "type": "SVBool" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.convert.to.svbool", "operands": [ { "name": "mask", "type": "SVEPredicate" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.dupq_lane", "operands": [ { "name": "v", "type": "ScalableVectorOfRank<[ 1 ]>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "lane", "type": "I64Attr" } ] }, { "name": "arm_sve.intr.fadd", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.fdiv", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.fmul", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.fsub", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.mul", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.psel", "operands": [ { "name": "p1", "type": "SVBool" }, { "name": "p2", "type": "SVEPredicate" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.sdiv", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.sdot", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.smmla", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.sub", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.udiv", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.udot", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.ummla", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.usmmla", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.whilelt", "operands": [ { "name": "base", "type": "I64" }, { "name": "n", "type": "I64" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.zip.x2", "operands": [ { "name": "v1", "type": "AnyScalableVectorOfAnyRank" }, { "name": "v2", "type": "AnyScalableVectorOfAnyRank" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.intr.zip.x4", "operands": [ { "name": "v1", "type": "AnyScalableVectorOfAnyRank" }, { "name": "v2", "type": "AnyScalableVectorOfAnyRank" }, { "name": "v3", "type": "AnyScalableVectorOfAnyRank" }, { "name": "v4", "type": "AnyScalableVectorOfAnyRank" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "arm_sve.masked.addf", "summary": "masked addition for scalable vectors of floats", "description": "The `arm_sve.masked.addf` operation takes one scalable vector mask\n and two scalable vector operands, and perform floating pointadditionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.addi", "summary": "masked addition for scalable vectors of integers", "description": "The `arm_sve.masked.addi` operation takes one scalable vector mask\n and two scalable vector operands, and perform integeradditionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.divf", "summary": "masked division for scalable vectors of floats", "description": "The `arm_sve.masked.divf` operation takes one scalable vector mask\n and two scalable vector operands, and perform floating pointdivisionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.divi_signed", "summary": "masked signed division for scalable vectors of integers", "description": "The `arm_sve.masked.divi_signed` operation takes one scalable vector mask\n and two scalable vector operands, and perform integersigned divisionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.divi_unsigned", "summary": "masked unsigned division for scalable vectors of integers", "description": "The `arm_sve.masked.divi_unsigned` operation takes one scalable vector mask\n and two scalable vector operands, and perform integerunsigned divisionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.mulf", "summary": "masked multiplication for scalable vectors of floats", "description": "The `arm_sve.masked.mulf` operation takes one scalable vector mask\n and two scalable vector operands, and perform floating pointmultiplicationon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.muli", "summary": "masked multiplication for scalable vectors of integers", "description": "The `arm_sve.masked.muli` operation takes one scalable vector mask\n and two scalable vector operands, and perform integermultiplicationon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.subf", "summary": "masked subtraction for scalable vectors of floats", "description": "The `arm_sve.masked.subf` operation takes one scalable vector mask\n and two scalable vector operands, and perform floating pointsubtractionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[AnyFloat]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.masked.subi", "summary": "masked subtraction for scalable vectors of integers", "description": "The `arm_sve.masked.subi` operation takes one scalable vector mask\n and two scalable vector operands, and perform integersubtractionon active lanes. Inactive lanes will keep the value of\n the first operand.", "operands": [ { "name": "mask", "type": "ScalableVectorOfAnyRank<[I1]>" }, { "name": "src1", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" }, { "name": "src2", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "results": [ { "name": "res", "type": "ScalableVectorOfAnyRank<[I8, I16, I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2', 'res']>" }, { "type": "TypesMatchWith<'src1', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$mask `,` $src1 `,` $src2 attr-dict `:` type($mask) `,` type($res)" }, { "name": "arm_sve.psel", "summary": "Predicate select", "description": "This operation returns the input predicate `p1` or an all-false predicate\n based on the bit at `p2[index]`. Informally, the semantics are:\n ```\n if p2[index % num_elements(p2)] == 1:\n return p1 : type(p1)\n return all-false : type(p1)\n ```\n\n Example:\n ```mlir\n // Note: p1 and p2 can have different sizes.\n %pd = arm_sve.psel %p1, %p2[%index] : vector<[4]xi1>, vector<[8]xi1>\n ```\n\n Note: This requires SME or SVE2.1 (`+sme` or `+sve2p1` in LLVM target features).", "operands": [ { "name": "p1", "type": "SVEPredicate" }, { "name": "p2", "type": "SVEPredicate" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "SVEPredicate" } ], "traits": [ { "type": "AllTypesMatch<['p1', 'result']>" } ], "assemblyFormat": "$p1 `,` $p2 `[` $index `]` attr-dict `:` type($p1) `,` type($p2)" }, { "name": "arm_sve.sdot", "summary": "Vector-vector dot product and accumulate op", "description": "SDOT: Signed integer addition of dot product.\n\n This function maps to the SDOT instruction, and it takes signless integer\n operands that the operation interprets as signed. It partitions the second\n and third vector inputs into groups of four elements. They calculate the dot\n product of each group (without loss of precision) and then add each result\n to the overlapping element of the first vector input.\n\n Source:\n https://developer.arm.com/documentation/100987/0000", "operands": [ { "name": "acc", "type": "ScalableVectorOfLengthAndType<[4, 2], [I32, I64]>" }, { "name": "src1", "type": "ScalableVectorOfLengthAndType<[16, 8], [I8, I16]>" }, { "name": "src2", "type": "ScalableVectorOfLengthAndType<[16, 8], [I8, I16]>" } ], "results": [ { "name": "dst", "type": "ScalableVectorOfLengthAndType<[4, 2], [I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'dst']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($dst)" }, { "name": "arm_sve.smmla", "summary": "Matrix-matrix multiply and accumulate op", "description": "SMMLA: Signed integer matrix multiply-accumulate.\n\n This function maps to the SMMLA instruction, and it takes signless integer\n operands that the operation interprets as signed. It partitions the inputs\n into 128-bit quadwords, with the first input containing a row-by-row 2×2\n matrix of 32-bit integers, the second input containing a row-by-row 2×8\n matrix of 8-bit integers, and the third input containing a column-by-column\n 8×2 matrix of 8-bit integers. For each quadword, they multiply the second\n input matrix by the third input matrix using natural arithmetic and then add\n the result to the first input using modular arithmetic.\n\n Source:\n https://developer.arm.com/documentation/100987/0000", "operands": [ { "name": "acc", "type": "ScalableVectorOfLengthAndType<[4], [I32]>" }, { "name": "src1", "type": "ScalableVectorOfLengthAndType<[16], [I8]>" }, { "name": "src2", "type": "ScalableVectorOfLengthAndType<[16], [I8]>" } ], "results": [ { "name": "dst", "type": "ScalableVectorOfLengthAndType<[4], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'dst']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($dst)" }, { "name": "arm_sve.udot", "summary": "Vector-vector dot product and accumulate op", "description": "UDOT: Unsigned integer addition of dot product.\n\n This function maps to the UDOT instruction, and it takes signless integer\n operands that the operation interprets as unsigned. It partitions the second\n and third vector inputs into groups of four elements. They calculate the dot\n product of each group (without loss of precision) and then add each result\n to the overlapping element of the first vector input.\n\n Source:\n https://developer.arm.com/documentation/100987/0000", "operands": [ { "name": "acc", "type": "ScalableVectorOfLengthAndType<[4, 2], [I32, I64]>" }, { "name": "src1", "type": "ScalableVectorOfLengthAndType<[16, 8], [I8, I16]>" }, { "name": "src2", "type": "ScalableVectorOfLengthAndType<[16, 8], [I8, I16]>" } ], "results": [ { "name": "dst", "type": "ScalableVectorOfLengthAndType<[4, 2], [I32, I64]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'dst']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($dst)" }, { "name": "arm_sve.ummla", "summary": "Matrix-matrix multiply and accumulate op", "description": "UMMLA: Unsigned integer matrix multiply-accumulate.\n\n This function maps to the UMMLA instruction, and it takes signless integer\n operands that the operation interprets as unsigned. It partitions the inputs\n into 128-bit quadwords, with the first input containing a row-by-row 2×2\n matrix of 32-bit integers, the second input containing a row-by-row 2×8\n matrix of 8-bit integers, and the third input containing a column-by-column\n 8×2 matrix of 8-bit integers. For each quadword, they multiply the second\n input matrix by the third input matrix using natural arithmetic and then add\n the result to the first input using modular arithmetic.\n\n Source:\n https://developer.arm.com/documentation/100987/0000", "operands": [ { "name": "acc", "type": "ScalableVectorOfLengthAndType<[4], [I32]>" }, { "name": "src1", "type": "ScalableVectorOfLengthAndType<[16], [I8]>" }, { "name": "src2", "type": "ScalableVectorOfLengthAndType<[16], [I8]>" } ], "results": [ { "name": "dst", "type": "ScalableVectorOfLengthAndType<[4], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'dst']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($dst)" }, { "name": "arm_sve.usmmla", "summary": "Matrix-matrix multiply and accumulate op", "description": "USMMLA: Unsigned by signed integer matrix multiply-accumulate.\n\n The unsigned by signed integer matrix multiply-accumulate operation\n multiplies the 2×8 matrix of unsigned 8-bit integer values held\n the first source vector by the 8×2 matrix of signed 8-bit integer\n values in the second source vector. The resulting 2×2 widened 32-bit\n integer matrix product is then added to the 32-bit integer matrix\n accumulator.\n\n Source:\n https://developer.arm.com/documentation/100987/0000", "operands": [ { "name": "acc", "type": "ScalableVectorOfLengthAndType<[4], [I32]>" }, { "name": "src1", "type": "ScalableVectorOfLengthAndType<[16], [I8]>" }, { "name": "src2", "type": "ScalableVectorOfLengthAndType<[16], [I8]>" } ], "results": [ { "name": "dst", "type": "ScalableVectorOfLengthAndType<[4], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['src1', 'src2']>" }, { "type": "AllTypesMatch<['acc', 'dst']>" } ], "assemblyFormat": "$acc `,` $src1 `,` $src2 attr-dict `:` type($src1) `to` type($dst)" }, { "name": "arm_sve.zip.x2", "summary": "Multi-vector two-way zip op", "description": "This operation interleaves elements from two input SVE vectors, returning\n two new SVE vectors (`resultV1` and `resultV2`), which contain the low and\n high halves of the result respectively.\n\n Example:\n ```mlir\n // sourceV1 = [ A1, A2, A3, ... An ]\n // sourceV2 = [ B1, B2, B3, ... Bn ]\n // (resultV1, resultV2) = [ A1, B1, A2, B2, A3, B3, ... An, Bn ]\n %resultV1, %resultV2 = arm_sve.zip.x2 %sourceV1, %sourceV2 : vector<[16]xi8>\n ```\n\n Note: This requires SME 2 (`+sme2` in LLVM target features)\n\n [Source](https://developer.arm.com/documentation/ddi0602/2023-12/SME-Instructions/ZIP--two-registers---Interleave-elements-from-two-vectors-?lang=en)", "operands": [ { "name": "sourceV1", "type": "ZipInputVectorType" }, { "name": "sourceV2", "type": "ZipInputVectorType" } ], "results": [ { "name": "resultV1", "type": "ZipInputVectorType" }, { "name": "resultV2", "type": "ZipInputVectorType" } ], "traits": [ { "type": "AllTypesMatch<['sourceV1', 'sourceV2', 'resultV1', 'resultV2']>" } ], "assemblyFormat": "$sourceV1 `,` $sourceV2 attr-dict `:` type($sourceV1)" }, { "name": "arm_sve.zip.x4", "summary": "Multi-vector four-way zip op", "description": "This operation interleaves elements from four input SVE vectors, returning\n four new SVE vectors, each of which contain a quarter of the result. The\n first quarter will be in `resultV1`, second in `resultV2`, third in\n `resultV3`, and fourth in `resultV4`.\n\n ```mlir\n // sourceV1 = [ A1, A2, ... An ]\n // sourceV2 = [ B1, B2, ... Bn ]\n // sourceV3 = [ C1, C2, ... Cn ]\n // sourceV4 = [ D1, D2, ... Dn ]\n // (resultV1, resultV2, resultV3, resultV4)\n // = [ A1, B1, C1, D1, A2, B2, C2, D2, ... An, Bn, Cn, Dn ]\n %resultV1, %resultV2, %resultV3, %resultV4 = arm_sve.zip.x4\n %sourceV1, %sourceV2, %sourceV3, %sourceV4 : vector<[16]xi8>\n ```\n\n **Warning:** The result of this op is undefined for 64-bit elements on\n hardware with less than 256-bit vectors!\n\n Note: This requires SME 2 (`+sme2` in LLVM target features)\n\n [Source](https://developer.arm.com/documentation/ddi0602/2023-12/SME-Instructions/ZIP--four-registers---Interleave-elements-from-four-vectors-?lang=en)", "operands": [ { "name": "sourceV1", "type": "ZipInputVectorType" }, { "name": "sourceV2", "type": "ZipInputVectorType" }, { "name": "sourceV3", "type": "ZipInputVectorType" }, { "name": "sourceV4", "type": "ZipInputVectorType" } ], "results": [ { "name": "resultV1", "type": "ZipInputVectorType" }, { "name": "resultV2", "type": "ZipInputVectorType" }, { "name": "resultV3", "type": "ZipInputVectorType" }, { "name": "resultV4", "type": "ZipInputVectorType" } ], "traits": [ { "type": "AllTypesMatch<['sourceV1', 'sourceV2', 'sourceV3', 'sourceV4', 'resultV1', 'resultV2', 'resultV3', 'resultV4']>" } ], "assemblyFormat": "$sourceV1 `,` $sourceV2 `,` $sourceV3 `,` $sourceV4 attr-dict\n `:` type($sourceV1)" }, { "name": "asuka.abs", "summary": "abs", "description": "abs", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.add", "summary": "add", "description": "add", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.avg_pool", "summary": "asuka avgpool", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "kernel_size", "type": "DenseI64ArrayAttr" }, { "name": "stride", "type": "DenseI64ArrayAttr" }, { "name": "padding", "type": "DenseI64ArrayAttr" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "count_include_pad", "type": "BoolAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$operand `,` `kernel_size` `=` $kernel_size `,` `stride` `=` $stride `,` `padding` `=` $padding `,` `ceil_mode` `=` $ceil_mode `,` `count_include_pad` `=` $count_include_pad attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.block_for", "summary": "block for", "operands": [ { "name": "block_args", "type": "Variadic" }, { "name": "init_args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "lower_bound", "type": "IndexAttr" }, { "name": "upper_bound", "type": "IndexAttr" }, { "name": "step", "type": "IndexAttr" }, { "name": "block_dims", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`lb` `=` $lower_bound `,` `ub` `=` $upper_bound `,` `step` `=` $step `,` `args` `=` `[` $block_args `]` `,` `dims` `=` $block_dims `,` `init` `=` `[` $init_args `]` $region attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.block_yield", "summary": "block yield in block for op", "operands": [ { "name": "block_outs", "type": "Variadic" }, { "name": "iter_outs", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`block_outs` `=` `[` $block_outs `]` `,` `iter_outs` `=` `[` $iter_outs `]` attr-dict `:` type(operands)" }, { "name": "asuka.call", "summary": "call", "description": "call", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "asuka.cmp", "summary": "cmp", "description": "cmp", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_BoolTensor" } ], "attributes": [ { "name": "cmp_type", "type": "Asuka_CmpTypeAttr{GT|GE}" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$cmp_type $lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.convert", "summary": "convert", "operands": [ { "name": "operand", "type": "AS_TypedTensor" } ], "results": [ { "name": "result", "type": "AS_TypedTensor" } ], "attributes": [ { "name": "dst_type", "type": "TypeAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$operand `,` `type` `=` $dst_type attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.div", "summary": "div", "description": "div", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.dot", "summary": "asuka dot", "description": "dot op\n for lhs: [x.., m, k]\n for rhs: [y.., k, n]\n k is reduce dim, x.. and y.. are batch dim", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.dynamic_block_for", "summary": "block for", "operands": [ { "name": "lower_bound", "type": "Index" }, { "name": "upper_bound", "type": "Index" }, { "name": "block_args", "type": "Variadic" }, { "name": "init_args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "step", "type": "IndexAttr" }, { "name": "block_dims", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`lb` `=` $lower_bound `,` `ub` `=` $upper_bound `,` `step` `=` $step `,` `args` `=` `[` $block_args `]` `,` `dims` `=` $block_dims `,` `init` `=` `[` $init_args `]` $region attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.erase_type", "summary": "erase type", "description": "erase type", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$inputs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.exp", "summary": "exp", "description": "exp", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.exp2", "summary": "exp2", "description": "exp2", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.kernel", "summary": "asuka kernel", "description": "kernel", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "asuka.log", "summary": "log", "description": "log", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.log2", "summary": "log2", "description": "log2", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.mask", "operands": [ { "name": "starts", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "sizes", "type": "DenseI64ArrayAttr" }, { "name": "element_type", "type": "TypeAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`starts` `=` `[` $starts `]` `,` `sizes` `=` $sizes `,` `type` `=` $element_type $region attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.mask_yield", "operands": [ { "name": "srcs", "type": "Variadic" } ], "assemblyFormat": "attr-dict $srcs `:` type($srcs)" }, { "name": "asuka.mul", "summary": "mul", "description": "mul", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.neg", "summary": "neg", "description": "neg", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.normalize", "summary": "asuka normalize", "description": "normalize", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "reduce_dimension", "type": "I64Attr" }, { "name": "lp", "type": "I64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `,` `dim` `=` $reduce_dimension `,` `Lp` `=` $lp attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.parallel_for", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$inputs $region attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.parallel_yield", "operands": [ { "name": "srcs", "type": "Variadic" } ], "assemblyFormat": "attr-dict $srcs `:` type($srcs)" }, { "name": "asuka.permute", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "dims", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$operand `,` `dims` `=` $dims attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.pow", "summary": "pow", "description": "pow", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.precise_dot_op", "summary": "Dot operation with output precision at least as high as input precision", "description": "This operation performs a dot product on two input tensors with the same element type,\n and ensures the output tensor has a precision (element type) that is at least as high as the inputs.", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "acc_type", "type": "TypeAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$lhs `,` $rhs `,` `acc` `=` $acc_type attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.reduce", "summary": "asuka reduce", "description": "reduce", "operands": [ { "name": "operand", "type": "AS_AnyTensor" }, { "name": "init", "type": "Optional" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "reduce_dimension", "type": "I64Attr" }, { "name": "reduce_type", "type": "Asuka_ReduceTypeAttr{ADD|MUL|ANY}" }, { "name": "keep_dim", "type": "BoolAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`(` $operand ( `,` `init` `=` $init^ )? `)` `,` `dim` `=` $reduce_dimension `,` `op` `=` $reduce_type attr-dict `,` `keep_dim` `=` $keep_dim `:` functional-type(operands, results)" }, { "name": "asuka.reshape", "category": "Shape", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.return", "summary": "return", "description": "return", "operands": [ { "name": "srcs", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($srcs^ `:` type($srcs))?" }, { "name": "asuka.rng", "summary": "rng", "description": "rng", "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "rng_distribution", "type": "Asuka_RngDistributionAttr{UNIT_UNIFORM|UNIT_GUMBEL}" } ], "assemblyFormat": "`distribution` `=` $rng_distribution attr-dict `:` type($result)" }, { "name": "asuka.softmax", "category": "Activation", "summary": "asuka softmax", "description": "softmax", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "reduce_dimension", "type": "I64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `,` `dim` `=` $reduce_dimension attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.specify_type", "summary": "specify type", "description": "specify type", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "element_types", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$inputs `with` `type` `=` $element_types attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.split", "category": "Tensor", "summary": "rng", "description": "split", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "split_dimension", "type": "I64Attr" } ], "assemblyFormat": "$operand `,` `dim` `=` $split_dimension attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.sub", "summary": "sub", "description": "sub", "operands": [ { "name": "lhs", "type": "AS_AnyTensor" }, { "name": "rhs", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.tanh", "category": "Activation", "summary": "tanh", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.transpose", "category": "Transform", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "dims", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$operand `,` `dims` `=` $dims attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.trilu", "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "diagonal", "type": "I64Attr" }, { "name": "is_upper", "type": "BoolAttr" }, { "name": "shape", "type": "DenseI64ArrayAttr" }, { "name": "val", "type": "TypedAttrInterface" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`diagonal` `=` $diagonal `,` `is_upper` `=` $is_upper `,` `shape` `=` $shape `,` `val` `=` $val attr-dict" }, { "name": "asuka.unsqueeze", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$operand `,` `dim` `=` $dim attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.view", "operands": [ { "name": "operand", "type": "AS_AnyTensor" } ], "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "asuka.zero", "results": [ { "name": "result", "type": "AS_AnyTensor" } ], "attributes": [ { "name": "shape", "type": "DenseI64ArrayAttr" }, { "name": "element_type", "type": "TypeAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`shape` `=` $shape `,` `type` `=` $element_type attr-dict `:` functional-type(operands, results)" }, { "name": "async.add_to_group", "summary": "adds an async token or value to the group", "description": "The `async.add_to_group` adds an async token or value to the async group.\n Returns the rank of the added element in the group. This rank is fixed\n for the group lifetime.\n\n Example:\n\n ```mlir\n %0 = async.create_group %size : !async.group\n %1 = ... : !async.token\n %2 = async.add_to_group %1, %0 : !async.token\n ```", "operands": [ { "name": "operand", "type": "Async_AnyValueOrTokenType" }, { "name": "group", "type": "Async_GroupType" } ], "results": [ { "name": "rank", "type": "Index" } ], "assemblyFormat": "$operand `,` $group `:` type($operand) attr-dict" }, { "name": "async.await", "summary": "waits for the argument to become ready", "description": "The `async.await` operation waits until the argument becomes ready, and for\n the `async.value` arguments it unwraps the underlying value\n\n Example:\n\n ```mlir\n %0 = ... : !async.token\n async.await %0 : !async.token\n\n %1 = ... : !async.value\n %2 = async.await %1 : !async.value\n ```", "operands": [ { "name": "operand", "type": "Async_AnyValueOrTokenType" } ], "results": [ { "name": "result", "type": "Optional" } ], "assemblyFormat": "$operand `:` custom(\n type($operand), type($result)\n ) attr-dict" }, { "name": "async.await_all", "summary": "waits for the all async tokens or values in the group to become ready", "description": "The `async.await_all` operation waits until all the tokens or values in the\n group become ready.\n\n Example:\n\n ```mlir\n %0 = async.create_group %size : !async.group\n\n %1 = ... : !async.token\n %2 = async.add_to_group %1, %0 : !async.token\n\n %3 = ... : !async.token\n %4 = async.add_to_group %2, %0 : !async.token\n\n async.await_all %0\n ```", "operands": [ { "name": "operand", "type": "Async_GroupType" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "async.call", "summary": "async call operation", "description": "The `async.call` operation represents a direct call to an async function\n that is within the same symbol scope as the call. The operands and result\n types of the call must match the specified async function type. The callee\n is encoded as a symbol reference attribute named \"callee\".\n\n Example:\n\n ```mlir\n %2 = async.call @my_add(%0, %1) : (f32, f32) -> !async.value\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "async.coro.begin", "summary": "returns a handle to the coroutine", "description": "The `async.coro.begin` allocates a coroutine frame and returns a handle to\n the coroutine.", "operands": [ { "name": "id", "type": "Async_CoroIdType" } ], "results": [ { "name": "handle", "type": "Async_CoroHandleType" } ], "assemblyFormat": "$id attr-dict" }, { "name": "async.coro.end", "summary": "marks the end of the coroutine in the suspend block", "description": "The `async.coro.end` marks the point where a coroutine needs to return\n control back to the caller if it is not an initial invocation of the\n coroutine. In the start part of the coroutine it is no-op.", "operands": [ { "name": "handle", "type": "Async_CoroHandleType" } ], "assemblyFormat": "$handle attr-dict" }, { "name": "async.coro.free", "summary": "deallocates the coroutine frame", "description": "The `async.coro.free` deallocates the coroutine frame created by the\n async.coro.begin operation.", "operands": [ { "name": "id", "type": "Async_CoroIdType" }, { "name": "handle", "type": "Async_CoroHandleType" } ], "assemblyFormat": "$id `,` $handle attr-dict" }, { "name": "async.coro.id", "summary": "returns a switched-resume coroutine identifier", "description": "The `async.coro.id` returns a switched-resume coroutine identifier.", "results": [ { "name": "id", "type": "Async_CoroIdType" } ], "assemblyFormat": "attr-dict" }, { "name": "async.coro.save", "summary": "saves the coroutine state", "description": "The `async.coro.saves` saves the coroutine state.", "operands": [ { "name": "handle", "type": "Async_CoroHandleType" } ], "results": [ { "name": "state", "type": "Async_CoroStateType" } ], "assemblyFormat": "$handle attr-dict" }, { "name": "async.coro.suspend", "summary": "suspends the coroutine", "description": "The `async.coro.suspend` suspends the coroutine and transfers control to the\n `suspend` successor. If suspended coroutine later resumed it will transfer\n control to the `resume` successor. If it is destroyed it will transfer\n control to the the `cleanup` successor.\n\n In switched-resume lowering coroutine can be already in resumed state when\n suspend operation is called, in this case control will be transferred to the\n `resume` successor skipping the `suspend` successor.", "operands": [ { "name": "state", "type": "Async_CoroStateType" } ], "successors": [ { "name": "suspendDest", "type": "AnySuccessor" }, { "name": "resumeDest", "type": "AnySuccessor" }, { "name": "cleanupDest", "type": "AnySuccessor" } ], "assemblyFormat": "$state `,` $suspendDest `,` $resumeDest `,` $cleanupDest attr-dict" }, { "name": "async.create_group", "summary": "creates an empty async group", "description": "The `async.create_group` allocates an empty async group. Async tokens or\n values can be added to this group later. The size of the group must be\n specified at construction time, and `await_all` operation will first\n wait until the number of added tokens or values reaches the group size.\n\n Example:\n\n ```mlir\n %size = ... : index\n %group = async.create_group %size : !async.group\n ...\n async.await_all %group\n ```", "operands": [ { "name": "size", "type": "Index" } ], "results": [ { "name": "result", "type": "Async_GroupType" } ], "assemblyFormat": "$size `:` type($result) attr-dict" }, { "name": "async.execute", "summary": "Asynchronous execute operation", "description": "The `body` region attached to the `async.execute` operation semantically\n can be executed concurrently with the successor operation. In the followup\n example \"compute0\" can be executed concurrently with \"compute1\".\n\n The actual concurrency semantics depends on the dialect lowering to the\n executable format. Fully sequential execution (\"compute0\" completes before\n \"compute1\" starts) is a completely legal execution.\n\n Because concurrent execution is not guaranteed, it is illegal to create an\n implicit dependency from \"compute1\" to \"compute0\" (e.g. via shared global\n state). All dependencies must be made explicit with async execute arguments\n (`async.token` or `async.value`).\n\n `async.execute` operation takes `async.token` dependencies and `async.value`\n operands separately, and starts execution of the attached body region only\n when all tokens and values become ready.\n\n Example:\n\n ```mlir\n %dependency = ... : !async.token\n %value = ... : !async.value\n\n %token, %results =\n async.execute [%dependency](%value as %unwrapped: !async.value)\n -> !async.value\n {\n %0 = \"compute0\"(%unwrapped): (f32) -> !some.type\n async.yield %0 : !some.type\n }\n\n %1 = \"compute1\"(...) : !some.type\n ```\n\n In the example above asynchronous execution starts only after dependency\n token and value argument become ready. Unwrapped value passed to the\n attached body region as an %unwrapped value of f32 type.", "operands": [ { "name": "dependencies", "type": "Variadic" }, { "name": "bodyOperands", "type": "Variadic" } ], "results": [ { "name": "token", "type": "Async_TokenType" }, { "name": "bodyResults", "type": "Variadic" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "async.func", "summary": "async function operation", "description": "An async function is like a normal function, but supports non-blocking\n await. Internally, async function is lowered to the LLVM coroutinue with\n async runtime intrinsic. It can return an async token and/or async values.\n The token represents the execution state of async function and can be used\n when users want to express dependencies on some side effects, e.g.,\n the token becomes available once every thing in the func body is executed.\n\n Example:\n\n ```mlir\n // Async function can't return void, it always must be some async thing.\n async.func @async.0() -> !async.token {\n return\n }\n\n // Function returns only async value.\n async.func @async.1() -> !async.value {\n %0 = arith.constant 42 : i32\n return %0 : i32\n }\n\n // Implicit token can be added to return types.\n async.func @async.2() -> !async.token, !async.value {\n %0 = arith.constant 42 : i32\n return %0 : i32\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "async", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "async.return", "summary": "Async function return operation", "description": "The `async.return` is a special terminator operation for Async function.\n\n Example:\n\n ```mlir\n async.func @foo() : !async.token {\n return\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "async.runtime.add_ref", "summary": "adds a reference to async value", "description": "The `async.runtime.add_ref` operation adds a reference(s) to async value\n (token, value or group).", "operands": [ { "name": "operand", "type": "Async_AnyAsyncType" } ], "attributes": [ { "name": "count", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "async.runtime.add_to_group", "summary": "adds an async token or value to the group", "description": "The `async.runtime.add_to_group` adds an async token or value to the async\n group. Returns the rank of the added element in the group.", "operands": [ { "name": "operand", "type": "Async_AnyValueOrTokenType" }, { "name": "group", "type": "Async_GroupType" } ], "results": [ { "name": "rank", "type": "Index" } ], "assemblyFormat": "$operand `,` $group attr-dict `:` type($operand)" }, { "name": "async.runtime.await", "summary": "blocks the caller thread until the operand becomes available", "description": "The `async.runtime.await` operation blocks the caller thread until the\n operand becomes available or error.", "operands": [ { "name": "operand", "type": "Async_AnyAsyncType" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "async.runtime.await_and_resume", "summary": "awaits the async operand and resumes the coroutine", "description": "The `async.runtime.await_and_resume` operation awaits for the operand to\n become available or error and resumes the coroutine on a thread managed by\n the runtime.", "operands": [ { "name": "operand", "type": "Async_AnyAsyncType" }, { "name": "handle", "type": "Async_CoroHandleType" } ], "assemblyFormat": "$operand `,` $handle attr-dict `:` type($operand)" }, { "name": "async.runtime.create", "summary": "creates an async runtime token or value", "description": "The `async.runtime.create` operation creates an async dialect token or\n value. Tokens and values are created in the non-ready state.", "results": [ { "name": "result", "type": "Async_AnyValueOrTokenType" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "async.runtime.create_group", "summary": "creates an async runtime group", "description": "The `async.runtime.create_group` operation creates an async dialect group\n of the given size. Group created in the empty state.", "operands": [ { "name": "size", "type": "Index" } ], "results": [ { "name": "result", "type": "Async_GroupType" } ], "assemblyFormat": "$size `:` type($result) attr-dict" }, { "name": "async.runtime.drop_ref", "summary": "drops a reference to async value", "description": "The `async.runtime.drop_ref` operation drops a reference(s) to async value\n (token, value or group).", "operands": [ { "name": "operand", "type": "Async_AnyAsyncType" } ], "attributes": [ { "name": "count", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "async.runtime.is_error", "summary": "returns true if token, value or group is in error state", "description": "The `async.runtime.is_error` operation returns true if the token, value or\n group (any of the async runtime values) is in the error state. It is the\n caller responsibility to check error state after the call to `await` or\n resuming after `await_and_resume`.", "operands": [ { "name": "operand", "type": "Async_AnyAsyncType" } ], "results": [ { "name": "is_error", "type": "I1" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "async.runtime.load", "summary": "loads the value from the runtime async.value", "description": "The `async.runtime.load` operation loads the value from the runtime\n async.value storage.", "operands": [ { "name": "storage", "type": "Async_ValueType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'storage', 'result', '::llvm::cast($_self).getValueType()'>" } ], "assemblyFormat": "$storage attr-dict `:` type($storage)" }, { "name": "async.runtime.num_worker_threads", "summary": "gets the number of threads in the threadpool from the runtime", "description": "The `async.runtime.num_worker_threads` operation gets the number of threads\n in the threadpool from the runtime.", "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "async.runtime.resume", "summary": "resumes the coroutine on a thread managed by the runtime", "description": "The `async.runtime.resume` operation resumes the coroutine on a thread\n managed by the runtime.", "operands": [ { "name": "handle", "type": "Async_CoroHandleType" } ], "assemblyFormat": "$handle attr-dict" }, { "name": "async.runtime.set_available", "summary": "switches token or value to available state", "description": "The `async.runtime.set_available` operation switches async token or value\n state to available.", "operands": [ { "name": "operand", "type": "Async_AnyValueOrTokenType" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "async.runtime.set_error", "summary": "switches token or value to error state", "description": "The `async.runtime.set_error` operation switches async token or value\n state to error.", "operands": [ { "name": "operand", "type": "Async_AnyValueOrTokenType" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "async.runtime.store", "summary": "stores the value into the runtime async.value", "description": "The `async.runtime.store` operation stores the value into the runtime\n async.value storage.", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "storage", "type": "Async_ValueType" } ], "traits": [ { "type": "TypesMatchWith<'storage', 'value', '::llvm::cast($_self).getValueType()'>" } ], "assemblyFormat": "$value `,` $storage attr-dict `:` type($storage)" }, { "name": "async.yield", "summary": "terminator for Async execute operation", "description": "The `async.yield` is a special terminator operation for the block inside\n `async.execute` operation.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "($operands^ `:` type($operands))? attr-dict" }, { "name": "bufferization.alloc_tensor", "summary": "allocate buffer for a tensor", "description": "`bufferization.alloc_tensor` materializes an uninitialized tensor with a\n given shape (dynamic or static). It always bufferizes to a new buffer\n allocation of the given shape. The optional `copy` operand specifies the\n contents of the tensors. If no `copy` operand is specified, reading from the\n result of an `alloc_tensor` op yields an undefined value.\n\n If `copy` is specified, no dynamic sizes should be passed, since they are\n the same as the dynamic sizes of the `copy` operand.\n\n `alloc_tensor` is a helper op for bufferization. The operation is provided\n as an anchor that marks the beginning of a new tensor SSA use-def chain. It\n can be used to control in-place bufferization decisions during One-Shot\n Bufferize: The bufferized result of a `bufferization.alloc_tensor` does not\n alias with any other buffer, so it can be used to resolve read-after-write\n conflicts that would have been introduced by the in-place bufferization of\n another op.\n\n The optional `memory_space` attribute specifies the memory space when\n bufferizing this op. The memory space is inferred from `copy` if specified.\n If neither `copy` nor `memory_space` is specified, the default memory space\n is used during bufferization.\n\n The optional `size_hint` operand specifies the number of non-zero elements\n for sparse tensors. The value of `size_hint` should be not less than 1 and\n not larger than the linear size of the corresponding dense tensor type. If\n this requirement is not met, the behavior of the operator is undefined.\n\n Both dense and sparse tensor types are supported. The result of a\n `bufferization.alloc_tensor` is a tensor value that can be used like any\n other tensor value. In practice, it is often used as the \"out\" operand of\n another op. Sparse tensor allocations should always be used in a local\n construction operation and never escape the function boundary directly.\n\n Example:\n\n ```mlir\n %c = bufferization.alloc_tensor(%d1, %d2) : tensor\n %0 = linalg.matmul\n ins(%a, %b: tensor, tensor)\n outs(%c: tensor) -> tensor\n return %0 : tensor\n ```\n\n ```mlir\n %c = bufferization.alloc_tensor(%d1, %d2) size_hint = %noe\n : tensor\n ```\n\n Note: An `alloc_tensor` with a `copy` should also be expressed as an\n `alloc_tensor` without `copy`, followed by a `copy_tensor`.", "operands": [ { "name": "dynamic_sizes", "type": "Variadic" }, { "name": "copy", "type": "Optional" }, { "name": "size_hint", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "memory_space", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "bufferization.clone", "summary": "clone a memref", "description": "Clones the data in the input view into an implicitly defined output view.\n\n Usage:\n\n ```mlir\n %arg1 = bufferization.clone %arg0 : memref to memref\n ```\n\n Valid implementations of this operation may alias the input and output\n views or create an actual copy. Mutating the source or result\n of the clone operation after the clone operation thus leads to undefined\n behavior.", "operands": [ { "name": "input", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "output", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($output)" }, { "name": "bufferization.dealloc", "summary": "deallocates the given memrefs if no alias is retained", "description": "This operation deallocates each of the given memrefs if there is no alias\n to that memref in the list of retained memrefs and the corresponding\n condition value is set. This condition can be used to indicate and pass on\n ownership of memref values (or in other words, the responsibility of\n deallocating that memref). If two memrefs alias each other, only one will be\n deallocated to avoid double free situations.\n\n The number of variadic `memref` operands (the memrefs to be deallocated)\n must equal the number of variadic `condition` operands and correspond to\n each other element-wise.\n\n The `memref` operands must be the originally allocated memrefs, however, the\n `retained` memref operands may be arbitrary memrefs.\n\n This operation returns a variadic number of `updatedConditions` operands,\n one updated condition per retained memref. An updated condition indicates\n the ownership of the respective retained memref. It is computed as the\n disjunction of all `conditions` operands where the corresponding to\n `memrefs` operand aliases with the retained memref. If the retained memref\n has no aliases among `memrefs`, the resulting updated condition is 'false'.\n This is because all memrefs that need to be deallocated within one basic\n block should be added to the same `bufferization.dealloc` operation at the\n end of the block; if no aliasing memref is present, then it does not have to\n be deallocated and thus we don't need to claim ownership. If the memrefs to\n be deallocated are split over multiple dealloc operations (e.g., to avoid\n aliasing checks at runtime between the `memref` operands), then the results\n have to be manually combined using an `arith.ori` operation and all of them\n still require the same list of `retained` memref operands unless the\n (potentially empty) set of aliasing memrefs can be determined statically. In\n that case, the `updatedCondition` operand can be replaced accordingly (e.g.,\n by a canonicalizer).\n\n Example:\n ```mlir\n %0:3 = bufferization.dealloc (%a0, %a1 : memref<2xf32>, memref<4xi32>)\n if (%cond0, %cond1) retain (%r0, %r1, %r2 : memref, memref,\n memref<2xi32>)\n ```\n Deallocation will be called on `%a0` if `%cond0` is 'true' and neither\n `%r0`, `%r1`, or `%r2` are aliases of `%a0`. `%a1` will be deallocated when\n `%cond1` is set to 'true' and none of `%r0`, `%r1`, `%r2`, and `%a0` are\n aliases.\n\n Note that this can be an expensive operation if there are many operands that\n cannot be optimized away. The runtime cost of this operation (assuming that\n nothing is optimized away) is `O(|memrefs|^2+|memrefs|*|retained|)`. The\n cost in terms of memory space is `O(|memrefs|+|retained|)`. As a result, it\n is recommended to place it carefully in the IR such that most operands can\n be optimized away by running the `buffer-deallocation-simplification` pass.", "operands": [ { "name": "memrefs", "type": "Variadic" }, { "name": "conditions", "type": "Variadic" }, { "name": "retained", "type": "Variadic" } ], "results": [ { "name": "updatedConditions", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(` ``(` $memrefs^ `:` type($memrefs) `)` `if` ` ` `(` $conditions `)` )?\n (`retain` ` ` `(` $retained^ `:` type($retained) `)` )? attr-dict" }, { "name": "bufferization.dealloc_tensor", "summary": "release underlying storage format of given tensor", "description": "`bufferization.dealloc_tensor` is a buffer deallocation in tensor land. This\n op can be used for manual buffer deallocation. Some bufferizations (such as\n One-Shot Bufferize) take care of buffer deallocation, in which case this op\n is usually not needed. Details can be found in the documentation of the\n respective bufferization passes.\n\n In case of a dense tensor, this op lowers to a `memref.dealloc` op during\n bufferization.\n\n In case of a sparse tensor, this op releases the underlying sparse storage\n format for a tensor that materialized earlier through a `new` operation, a\n `convert` operation with annotated destination tensor type (unless the\n convert is folded away), or a `bufferization.alloc_tensor` operation. The\n release operation should only be called once for any materialized tensor.\n After this operation, any subsequent `memref` querying operation on the\n tensor returns undefined results.\n\n Example:\n\n ```mlir\n bufferization.dealloc_tensor %tensor : tensor<1024x1024xf64, #CSR>\n ```", "operands": [ { "name": "tensor", "type": "AnyTensor" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor)" }, { "name": "bufferization.materialize_in_destination", "summary": "copy a tensor", "description": "This op indicates that the data of the `source` tensor is guaranteed to\n materialize in `dest`, which can be a tensor or a memref. In case of a\n tensor, `source` materializes in the future buffer of `dest` and a the\n updated destination tensor is returned. If this is not possible, e.g.,\n because the destination tensor is read-only or because its original\n contents are still read later, the input IR fails to bufferize. In case of a\n memref, `source` materializes in `dest`, which is already a buffer. The op\n has no results in that case.\n\n `source`, `dest` and `result` (if present) must have the same runtime shape\n and element type. If the op has a result, the types of `result` and `dest`\n must match exactly (e.g., including any tensor encodings).\n\n By default, this op bufferizes to a memcpy from the future buffer of the\n `source` tensor to the future buffer of the `dest` tensor or to the `dest`\n buffer. However, transformations such as \"empty tensor elimination\" may\n rewrite IR such that a computation is performed directly in `dest` and no\n memcpy is needed.\n\n If `dest` is a buffer, the `writable` attribute must be specified and the\n `restrict` keyword can be specified. These attributes have the same meaning\n as the respective attributes of `bufferization.to_tensor`.\n\n `writable` indicates that the `dest` buffer is considered writable. It does\n not make sense to materialize a computation in a read-only buffer, so\n `writable` is required.\n\n `restrict` indicates that there is no `bufferization.to_tensor` op and no\n other `bufferization.materialize_in_destination` op with `dest` (or an alias\n thereof) and \"restrict\". Only ops with this attribute are considered for\n \"empty tensor elimination\". As part of empty tensor elimination, a new\n `to_tensor` op with `dest` may be inserted and the `restrict` attribute is\n transferred from this op to the new `to_tensor` op. Having \"restrict\" on\n this op guarantees that performing empty tensor elimination would not create\n invalid IR (i.e., having multiple `to_tensor restrict` with aliasing\n buffers).\n\n Note: `writable` could be removed from this op because it must always be set\n for memref destinations. This op has that attribute to make clear the\n requirements on the `dest` operand in the op assembly format.\n\n Note: If `dest` is a tensor, `tensor.insert_slice` could be used for the\n same purpose, but since tensor dialect ops only indicate *what* should be\n computed but not *where*, it could fold away, causing the computation to\n materialize in a different buffer.", "operands": [ { "name": "source", "type": "AnyTensor" }, { "name": "dest", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "restrict", "type": "UnitAttr" }, { "name": "writable", "type": "UnitAttr" } ], "assemblyFormat": "$source `in` (`restrict` $restrict^)? (`writable` $writable^)? $dest\n attr-dict `:` functional-type(operands, results)" }, { "name": "bufferization.to_buffer", "summary": "cast a tensor-like type to buffer-like type", "description": "An operation that returns the future buffer of a `tensor`.\n\n ```mlir\n // Result type is memref<4x?xf32, #layout, 0>\n %m = bufferization.to_buffer %t : tensor<4x?xf32> to memref<4x?xf32, #layout, 0>\n ```\n\n This operation is a specialized variant of the built-in\n `unrealized_conversion_cast` and is used to make sure that the IR stays\n valid at any point during the bufferization.\n\n The `read_only` attribute can optionally be set, indicating to the\n bufferization that the buffer returned by this op (or an alias created from\n the returned buffer) will not be written to.", "operands": [ { "name": "tensor", "type": "Bufferization_TensorLikeTypeInterface" } ], "results": [ { "name": "buffer", "type": "Bufferization_BufferLikeTypeInterface" } ], "attributes": [ { "name": "read_only", "type": "UnitAttr" } ], "assemblyFormat": "$tensor (`read_only` $read_only^)? attr-dict `:` type($tensor) `to` type($buffer)" }, { "name": "bufferization.to_memref" }, { "name": "bufferization.to_tensor", "summary": "create a tensor-like type from a buffer-like type", "description": "An operation that creates a tensor from a buffer. The result value is a\n tensor-like type that must match the corresponding buffer-like operand as\n per TensorLikeType::verifyCompatibleBufferType(). For builtins (TensorType\n and BaseMemRefType), this means that shapes and element types match between\n the tensor and the buffer.\n\n The opposite of this op is `to_buffer`. Together, these two ops are\n useful for source/target materializations when doing type conversions\n involving tensors and buffers.\n\n Example:\n\n ```mlir\n // Produces a value of tensor<4x?xf32> type.\n %t = bufferization.to_tensor %m : memref<4x?xf32, #layout, 0> to tensor<4x?xf32>\n ```\n\n If the `writable` unit attribute is set, the produced tensor is considered\n \"writable\" during bufferization. Otherwise, every OpOperand that bufferizes\n to a write to the future buffer of the resulting tensor (or an alias\n thereof) will bufferize out-of-place to prevent emitting any writes to\n `memref` during bufferization.\n\n The `restrict` unit attribute (similar to the C `restrict` keyword)\n indicates that the produced tensor result is the only way for the tensor\n IR to gain access to the `memref` operand (or an alias thereof). E.g.,\n there must be no other `to_tensor` op with the same or with an aliasing\n `memref` operand.\n\n Note: Only `to_tensor` ops with the `restrict` unit attribute are supported\n by One-Shot Bufferize. Other IR is rejected. (To support `to_tensor`\n without `restrict`, One-Shot Bufferize would have to analyze memref IR.)\n Ops that have incorrect usage of `restrict` may bufferize incorrectly.\n\n Example:\n\n ```\n %t = bufferization.to_tensor %m restrict writable : memref<4xf32> to tensor<4xf32>\n\n // %t is writable, so the tensor.insert may bufferize in-place in the\n // absence of other conflicts.\n %r = tensor.insert %f into %t[%idx] : tensor<4xf32>\n ```\n\n `to_tensor` ops are not bufferized. They are expected to fold away after\n bufferization. If there are non-bufferizable ops in the IR and\n `allowUnknownOps` is set, they may be part of the resulting IR and not fold\n away. However, such IR is no longer bufferizable with One-Shot Bufferize.", "operands": [ { "name": "buffer", "type": "Bufferization_BufferLikeTypeInterface" } ], "results": [ { "name": "result", "type": "Bufferization_TensorLikeTypeInterface" } ], "attributes": [ { "name": "restrict", "type": "UnitAttr" }, { "name": "writable", "type": "UnitAttr" } ], "assemblyFormat": "$buffer (`restrict` $restrict^)? (`writable` $writable^)? attr-dict\n `:` type($buffer) `to` type($result)" }, { "name": "builtin.module", "summary": "A top level container operation", "description": "A `module` represents a top-level container operation. It contains a single\n [graph region](../LangRef.md#control-flow-and-ssacfg-regions) containing a single block\n which can contain any operations and does not have a terminator. Operations\n within this region cannot implicitly capture values defined outside the module,\n i.e. Modules are [IsolatedFromAbove](../Traits#isolatedfromabove). Modules have\n an optional [symbol name](../SymbolsAndSymbolTables.md) which can be used to refer\n to them in operations.\n\n Example:\n\n ```mlir\n module {\n func.func @foo()\n }\n ```", "attributes": [ { "name": "sym_name", "type": "OptionalAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "defaultDialect": "builtin", "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "($sym_name^)? attr-dict-with-keyword $bodyRegion" }, { "name": "builtin.unrealized_conversion_cast", "summary": "An unrealized conversion from one set of types to another", "description": "An `unrealized_conversion_cast` operation represents an unrealized\n conversion from one set of types to another, that is used to enable the\n inter-mixing of different type systems. This operation should not be\n attributed any special representational or execution semantics, and is\n generally only intended to be used to satisfy the temporary intermixing of\n type systems during the conversion of one type system to another.\n\n This operation may produce results of arity 1-N, and accept as input\n operands of arity 0-N.\n\n Example:\n\n ```mlir\n // An unrealized 0-1 conversion. These types of conversions are useful in\n // cases where a type is removed from the type system, but not all uses have\n // been converted. For example, imagine we have a tuple type that is\n // expanded to its element types. If only some uses of an empty tuple type\n // instance are converted we still need an instance of the tuple type, but\n // have no inputs to the unrealized conversion.\n %result = unrealized_conversion_cast to !bar.tuple_type<>\n\n // An unrealized 1-1 conversion.\n %result1 = unrealized_conversion_cast %operand : !foo.type to !bar.lowered_type\n\n // An unrealized 1-N conversion.\n %results2:2 = unrealized_conversion_cast %tuple_operand : !foo.tuple_type to !foo.type, !foo.type\n\n // An unrealized N-1 conversion.\n %result3 = unrealized_conversion_cast %operand, %operand : !foo.type, !foo.type to !bar.tuple_type\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "assemblyFormat": "($inputs^ `:` type($inputs))? `to` type($outputs) attr-dict" }, { "name": "cf.assert", "summary": "Assert operation with message attribute", "description": "Assert operation at runtime with single boolean operand and an error\n message attribute.\n If the argument is `true` this operation has no effect. Otherwise, the\n program execution will abort. The provided error message may be used by a\n runtime to propagate the error to the user.\n\n Example:\n\n ```mlir\n cf.assert %b, \"Expected ... to be true\"\n ```", "operands": [ { "name": "arg", "type": "I1" } ], "attributes": [ { "name": "msg", "type": "StrAttr" } ], "assemblyFormat": "$arg `,` $msg attr-dict" }, { "name": "cf.br", "summary": "Branch operation", "description": "The `cf.br` operation represents a direct branch operation to a given\n block. The operands of this operation are forwarded to the successor block,\n and the number and type of the operands must match the arguments of the\n target block.\n\n Example:\n\n ```mlir\n ^bb2:\n %2 = call @someFn()\n cf.br ^bb3(%2 : tensor<*xf32>)\n ^bb3(%3: tensor<*xf32>):\n ```", "operands": [ { "name": "destOperands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict" }, { "name": "cf.cond_br", "summary": "Conditional branch operation", "description": "The `cf.cond_br` terminator operation represents a conditional branch on a\n boolean (1-bit integer) value. If the bit is set, then the first destination\n is jumped to; if it is false, the second destination is chosen. The count\n and types of operands must align with the arguments in the corresponding\n target blocks.\n\n The MLIR conditional branch operation is not allowed to target the entry\n block for a region. The two destinations of the conditional branch operation\n are allowed to be the same.\n\n The following example illustrates a function with a conditional branch\n operation that targets the same block.\n\n Example:\n\n ```mlir\n func.func @select(%a: i32, %b: i32, %flag: i1) -> i32 {\n // Both targets are the same, operands differ\n cf.cond_br %flag, ^bb1(%a : i32), ^bb1(%b : i32)\n\n ^bb1(%x : i32) :\n return %x : i32\n }\n ```", "operands": [ { "name": "condition", "type": "I1" }, { "name": "trueDestOperands", "type": "Variadic" }, { "name": "falseDestOperands", "type": "Variadic" } ], "attributes": [ { "name": "branch_weights", "type": "OptionalAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$condition (`weights` `(` $branch_weights^ `)` )? `,`\n $trueDest (`(` $trueDestOperands^ `:` type($trueDestOperands) `)`)? `,`\n $falseDest (`(` $falseDestOperands^ `:` type($falseDestOperands) `)`)?\n attr-dict" }, { "name": "cf.switch", "summary": "Switch operation", "description": "The `cf.switch` terminator operation represents a switch on a signless integer\n value. If the flag matches one of the specified cases, then the\n corresponding destination is jumped to. If the flag does not match any of\n the cases, the default destination is jumped to. The count and types of\n operands must align with the arguments in the corresponding target blocks.\n\n Example:\n\n ```mlir\n cf.switch %flag : i32, [\n default: ^bb1(%a : i32),\n 42: ^bb1(%b : i32),\n 43: ^bb3(%c : i32)\n ]\n ```", "operands": [ { "name": "flag", "type": "AnyInteger" }, { "name": "defaultOperands", "type": "Variadic" }, { "name": "caseOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "case_values", "type": "OptionalAttr" }, { "name": "case_operand_segments", "type": "DenseI32ArrayAttr" } ], "successors": [ { "name": "defaultDestination", "type": "AnySuccessor" }, { "name": "caseDestinations", "type": "VariadicSuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$flag `:` type($flag) `,` `[` `\\n`\n custom(ref(type($flag)),$defaultDestination,\n $defaultOperands,\n type($defaultOperands),\n $case_values,\n $caseDestinations,\n $caseOperands,\n type($caseOperands))\n `]`\n attr-dict" }, { "name": "check..expect_all_true", "summary": "Checks that the operand contains only values that are true.", "description": "Verifies that the operand contains true values, which are represented by any\n non-zero integer.\n\n Issues a non-fatal failure if the verification fails.\n\n ```mlir\n check.expect_all_true<%device>(%arg0) : !hal.buffer_view\n check.expect_all_true(%arg1) : tensor<2x2xi32>\n ```", "operands": [ { "name": "device", "type": "Optional" }, { "name": "operand", "type": "AnyTypeOf<[HAL_BufferView, TensorOf<[AnySignlessInteger]>]>" } ], "assemblyFormat": "(`` `<` $device^ `>`)?\n `` `(` $operand `)` attr-dict `:` type($operand)" }, { "name": "check..expect_almost_eq", "summary": "Checks that the operands are almost equal.", "description": "Verifies that the buffer view or tensor operands with float elements satisfy\n the Numpy-style fuzzy-comparison condition with parameters `atol`,\n `rtol`, defined exactly as in NumPy isclose():\n https://github.com/numpy/numpy/blob/7297f3117d84745bfade1e2f9aec3531e5917500/numpy/_core/numeric.py#L2447-L2449\n\n The condition being verified on each lhs and rhs value is:\n lhs == rhs || (isfinite(rhs) && abs(lhs - rhs) <= atol + rtol * abs(rhs)).\n Note that the `lhs == rhs` part is needed for the case (lhs=+inf, rhs+inf)\n to return true. Indeed, in that case, lhs-rhs is NaN.\n\n Issues a non-fatal failure if the verification fails.\n\n The `atol`, `rtol` parameters may be omitted, in which case some default\n value is used. The default `atol` is nonzero, while the default `rtol` is\n zero, which makes these comparison behave closer to exact comparisons as\n the values being compared get large.\n\n This default behavior is supported for legacy compatibility and to support\n some use cases that legitimately don't care, but the majority of use cases\n should care and so should provide explicit `atol`, `rtol` values.\n\n ```mlir\n check.expect_almost_eq(%arg0, %arg1, atol 1.0e-2, rtol 1.0e-3) : tensor<5xf32>\n ```", "operands": [ { "name": "device", "type": "Optional" }, { "name": "lhs", "type": "AnyTypeOf<[HAL_BufferView, TensorOf<[AnyFloat]>]>" }, { "name": "rhs", "type": "AnyTypeOf<[HAL_BufferView, TensorOf<[AnyFloat]>]>" } ], "attributes": [ { "name": "atol", "type": "DefaultValuedAttr" }, { "name": "rtol", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "(`` `<` $device^ `>`)?\n `` `(` $lhs `,` $rhs (`` `,` `atol` $atol^)? (`` `,` `rtol` $rtol^)? `)`\n attr-dict `:` type($lhs)" }, { "name": "check..expect_almost_eq_const", "summary": "Checks that the tensor operand is almost equal to some constant.", "description": "This op is just a convenience wrapper around the expect_almost_eq op.\n\n Verifies that the buffer view or tensor operands with float elements satisfy\n the Numpy-style fuzzy-comparison condition with pararameters `atol`,\n `rtol`. More details in the description of `expect_almost_eq`.\n\n Issues a non-fatal failure if the verification fails.\n\n ```mlir\n check.expect_almost_eq_const(%const0, dense<[0.999999, 2.0]> : tensor<5xf32>, atol 1.0e-2, rtol 1.0e-3) : tensor<5xf32>\n ```", "operands": [ { "name": "device", "type": "Optional" }, { "name": "lhs", "type": "TensorOf<[AnyFloat]>" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" }, { "name": "atol", "type": "DefaultValuedAttr" }, { "name": "rtol", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'value']>" } ], "assemblyFormat": "(`` `<` $device^ `>`)?\n `` `(` $lhs `,` $value (`` `,` `atol` $atol^)? (`` `,` `rtol` $rtol^)? `)`\n attr-dict `:` type($lhs)" }, { "name": "check..expect_eq", "summary": "Checks that the tensor or buffer view operands are equal.", "description": "Verifies that the operands are exactly equal.\n\n Issues a non-fatal failure if the verification fails.\n\n ```mlir\n check.expect_eq(%arg0, %arg1) : tensor<5xi32>\n ```", "operands": [ { "name": "device", "type": "Optional" }, { "name": "lhs", "type": "AnyTypeOf<[HAL_BufferView, AnyTensor]>" }, { "name": "rhs", "type": "AnyTypeOf<[HAL_BufferView, AnyTensor]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "(`` `<` $device^ `>`)?\n `` `(` $lhs `,` $rhs `)` attr-dict `:` type($lhs)" }, { "name": "check..expect_eq_const", "summary": "Checks that the tensor operand is equal to some constant.", "description": "Verifies that the tensor operand is exactly equal to a constant attribute.\n\n Issues a non-fatal failure if the verification fails.\n\n This op is just a convenience wrapper around the expect_eq op.\n\n ```mlir\n check.expect_eq_const(%arg0, dense<[1, 2]> : tensor<2xi32>) : tensor<2xi32>\n ```", "operands": [ { "name": "device", "type": "Optional" }, { "name": "lhs", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'value']>" } ], "assemblyFormat": "(`` `<` $device^ `>`)?\n `` `(` $lhs `,` $value `)` attr-dict `:` type($lhs)" }, { "name": "check..expect_false", "summary": "Checks that the operand is false.", "description": "Verifies that the operand contains a false value, which is represented by\n zero.\n\n Issues a non-fatal failure if the verification fails.\n\n ```mlir\n check.expect_false(%arg0) : i32\n ```", "operands": [ { "name": "operand", "type": "AnySignlessInteger" } ], "assemblyFormat": "`(` $operand `)` attr-dict `:` type($operand)" }, { "name": "check..expect_true", "summary": "Checks that the operand is true.", "description": "Verifies that the operand contains a true value, which is represented by\n any non-zero integer.\n\n Issues a non-fatal failure if the verification fails.\n\n ```mlir\n check.expect_true(%arg0) : i32\n ```", "operands": [ { "name": "operand", "type": "AnySignlessInteger" } ], "assemblyFormat": "`(` $operand `)` attr-dict `:` type($operand)" }, { "name": "check..expect_almost_eq", "summary": "Checks that the tensor operands are almost equal", "description": "Verifies that the tensor operands with floating-point or complex element\n types are almost equal within an implementation-defined tolerance.\n\n ```mlir\n check.expect_almost_eq %arg0, %arg1, tolerance = 0.001 : f64 : tensor<2xf32>\n ```", "operands": [ { "name": "lhs", "type": "TensorOf<[AnyFloat, AnyComplex]>" }, { "name": "rhs", "type": "TensorOf<[AnyFloat, AnyComplex]>" } ], "attributes": [ { "name": "tolerance", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs (`,` `tolerance` `=` $tolerance^)? attr-dict `:` type($lhs)" }, { "name": "check..expect_almost_eq_const", "summary": "Checks the tensor operand is almost equal to some constant", "description": "Verifies that the tensor operand with floating-point or complex element\n type is almost equal to the constant attribute within an\n implementation-defined tolerance.\n\n ```mlir\n check.expect_almost_eq_const %arg0, dense<[0.999999, 2.0]> : tensor<2xf32>, tolerance = 0.0001\n ```", "operands": [ { "name": "lhs", "type": "TensorOf<[AnyFloat, AnyComplex]>" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" }, { "name": "tolerance", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'value']>" } ], "assemblyFormat": "$lhs `,` $value (`,` `tolerance` `=` $tolerance^)? attr-dict" }, { "name": "check..expect_close", "summary": "Checks that the tensor operand ULP-distance to expected tensor operand is within specified limits", "description": "Verifies that the floating-point tensor operands, actual and\n expected, are close within user-defined limits:\n\n min_ulp_difference <= ulp_difference(actual, reference) <= max_ulp_difference\n\n where ulp_difference returns the number of all possible floating\n point values that are greater than or equal to min(actual,\n expected) and smaller than max(actual, expected) provided that\n both operands are finite.\n\n When either of operands is non-finite, expect_close returns true\n when actual and expected are bitwise equal, or when both values\n are NaNs, otherwise false. Note that quiet NaN and signaling NaN\n values with different payloads are all considered equivalent.\n\n ```mlir\n check.expect_close %arg0, %arg1, max_ulp_difference = 3, min_ulp_difference = 0 : tensor<2xf32>, tensor<2xf32>\n ```", "operands": [ { "name": "actual", "type": "TensorOf<[AnyFloat, AnyComplex]>" }, { "name": "expected", "type": "TensorOf<[AnyFloat, AnyComplex]>" } ], "attributes": [ { "name": "max_ulp_difference", "type": "DefaultValuedAttr" }, { "name": "min_ulp_difference", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['actual', 'expected']>" } ], "assemblyFormat": "$actual `,` $expected\n `,` `max_ulp_difference` `=` $max_ulp_difference\n (`,` `min_ulp_difference` `=` $min_ulp_difference^)?\n `:` attr-dict type($actual) `,` type($expected)" }, { "name": "check..expect_eq", "summary": "Checks that the tensor operands are equal", "description": "Verifies that the operands are exactly equal.\n\n ```mlir\n check.expect_eq %arg0, %arg1 : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "check..expect_eq_const", "summary": "Checks the tensor operand is equal to some constant", "description": "Verifies that the tensor operand is exactly equal to a constant attribute.\n\n ```mlir\n check.expect_eq_const %arg0, dense<[1, 2]> : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'value']>" } ], "assemblyFormat": "$lhs `,` $value attr-dict" }, { "name": "check..expect_serialized_eq", "summary": "Checks value of serialized tensor value.", "description": "Verifies that the value and type of the serialized tensor `probe_id` match\n the optionally specified input tensor at iteration `iteration`, using\n previously serialized filepaths in `index.csv`.\n\n ```mlir\n check.expect_serialized_eq %arg0,\n probe_id = \"probe0\",\n iter = 0 : tensor<2xi32>\n ```", "operands": [ { "name": "expected", "type": "HLO_Tensor" } ], "attributes": [ { "name": "probe_id", "type": "StrAttr" }, { "name": "iteration", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$expected `,` `probe_id` `=` $probe_id (`,` `iter` `=` $iteration^)?\n attr-dict `:` type($expected)" }, { "name": "chlo._asin_acos_kernel", "summary": "AsinAcosKernel operator", "description": "Returns `AsinAcosKernel(operand)` element-wise.\n\n ```\n If\n w = _asin_acos_kernel(z)\n w' = _asin_acos_kernel(I * z)\n Then\n asin(z) = complex(atan2(z.real, w.real), sign(z.imag) * w.imag)\n acos(z) = complex(atan2(w.real, z.real), -sign(z.imag) * w.imag)\n asinh(z) = complex(sign(z.real) * w'.imag, atan2(z.imag, w'.real))\n acosh(z) = complex(w.imag, sign(z.imag) * atan2(w.real, z.real))\n ```\n\n This op is used as an intermediate value in decompositions and\n should never be constructed directly by frameworks or consumed by\n backends.", "operands": [ { "name": "operand", "type": "HLO_AnyComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.acos", "summary": "Acos operator", "description": "Returns `Acos(operand)` element-wise.\n\n $$\n \\acos(x) = 2 * \\atan(\\sqrt(1 - x^2) / (1 + x)) if x != -1\n = pi if x == -1\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.acosh", "summary": "Acosh operation", "description": "Returns `Acosh(operand)` element-wise.\n\n $$\n \\acosh(x) = log(x + sqrt(x^2 - 1)) if x >= -1\n \\acosh(x) = nan if x < -1\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.asin", "summary": "Asin operator", "description": "Returns `Asin(operand)` element-wise.\n\n $$\n \\asin(x) = 2 * atan(x / (1 + sqrt(1 - x^2)))\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.asinh", "summary": "Asinh operation", "description": "Returns `Asinh(operand)` element-wise.\n\n $$\n \\asinh(x) = log(x + sqrt(x^2 + 1))\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.atan", "summary": "Atan operator", "description": "Returns `Atan(operand)` element-wise.\n\n $$\n \\atan(x) = \\atan2(x, 1)\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.atanh", "summary": "Atanh operator", "description": "Returns `Atanh(operand)` element-wise.\n\n $$\n \\atanh(x) = 0.5 * log((1 + x) / (1 - x)) if abs(x) <= 1\n = nan otherwise\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.bessel_i1e", "summary": "Bessel function of order 1", "description": "Returns `bessel_i1e(operand)` element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.broadcast_add", "summary": "Addition operator (with optional broadcasting)", "description": "Returns `lhs + rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_and", "summary": "Logical and operator (with optional broadcasting)", "description": "Returns `logical_and(lhs, rhs)` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyPredOrIntTensor" }, { "name": "rhs", "type": "HLO_AnyPredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_atan2", "summary": "Atan2 operator (with optional broadcasting)", "description": "Returns `atan2(lhs/rhs)` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_compare", "summary": "Compare operator (with optional broadcasting)", "description": "Compares `lhs` and `rhs` elementwise according to `comparison_direction`\n and `compare_type`. If unspecified, `compare_type` is FLOAT for float element\n types, SIGNED for signed element types and UNSIGNED for unsigned element\n types.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_comparison_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyPredTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" }, { "name": "comparison_direction", "type": "CHLO_ComparisonDirectionAttr{EQ|NE|GE|GT|LE|LT}" }, { "name": "compare_type", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_complex", "summary": "Complex operator (with optional broadcasting)", "description": "Performs element-wise conversion of a pair of real and imaginary values to\n a complex value.", "operands": [ { "name": "lhs", "type": "HLO_AnyFpTensor" }, { "name": "rhs", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyComplexTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_divide", "summary": "Division operator (with optional broadcasting)", "description": "Returns `lhs / rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_maximum", "summary": "Maximum operator (with optional broadcasting)", "description": "Returns `max(lhs, rhs)` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_minimum", "summary": "Minimum operator (with optional broadcasting)", "description": "Returns `min(lhs, rhs)` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_multiply", "summary": "Multiplication operator (with optional broadcasting)", "description": "Returns `lhs * rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_next_after", "summary": "std::nextafter operator (with optional broadcasting)", "description": "Returns the next representable value of `lhs` in the direction of `rhs`,\n element-wise. It can also return a subnormal number.\n\n Equivalent to the C++ std::nextafter function.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_or", "summary": "Logical or operator (with optional broadcasting)", "description": "Returns `logical_or(lhs, rhs)` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyPredOrIntTensor" }, { "name": "rhs", "type": "HLO_AnyPredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_polygamma", "summary": "Polygamma function (with optional broadcasting)", "description": "Returns `Polygamma(operand, operand)` element-wise.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_power", "summary": "Power operator (with optional broadcasting)", "description": "Returns `lhs ^ rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_remainder", "summary": "Remainder operator (with optional broadcasting)", "description": "Returns `lhs % rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_select", "summary": "Select operator (with optional numpy-style broadcasting)", "description": "Constructs an output array from elements of two input arrays, based on the\n values of a predicate array.\n\n See https://www.tensorflow.org/xla/operation_semantics#select", "operands": [ { "name": "pred", "type": "HLO_PredTensor" }, { "name": "on_true", "type": "HLO_AnyTensor" }, { "name": "on_false", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "assemblyFormat": "$pred `,` $on_true `,` $on_false attr-dict `:`\n `(` type($pred) `,` type($on_true) `,` type($on_false) `)` `->` type(results)" }, { "name": "chlo.broadcast_shift_left", "summary": "Shift left operator (with optional broadcasting)", "description": "Returns `lhs << rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_shift_right_arithmetic", "summary": "Shift right arithmetic operator (with optional broadcasting)", "description": "Returns `lhs >> rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_shift_right_logical", "summary": "Shift right logical operator (with optional broadcasting)", "description": "Returns `lhs >> rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_subtract", "summary": "Subtraction operator (with optional broadcasting)", "description": "Returns `lhs - rhs` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_xor", "summary": "Logical xor operator (with optional broadcasting)", "description": "Returns `logical_xor(lhs, rhs)` element-wise.\n\n See\n https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.", "operands": [ { "name": "lhs", "type": "HLO_AnyPredOrIntTensor" }, { "name": "rhs", "type": "HLO_AnyPredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.broadcast_zeta", "summary": "Hurwitz zeta function", "description": "Returns `Zeta(operand, operand)` element-wise.\n\n $$\n \\(\\zeta(x, q) = \\sum_{n=0}^{\\infty} (q + n)^{-x}\\)\n $$", "operands": [ { "name": "lhs", "type": "HLO_AnyFpTensor" }, { "name": "rhs", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:`\n `(` type($lhs) `,` type($rhs) `)` `->` type(results)" }, { "name": "chlo.conj", "summary": "Conj operator", "description": "Returns `Conj(operand)` element-wise.\n\n $$\n \\conj(x) = (\\real(x), \\neg(\\imag(x)))\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.constant", "summary": "Constant operator", "description": "Represents a constant value.", "results": [ { "name": "output", "type": "HLO_StaticShapeTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "assemblyFormat": "attr-dict $value" }, { "name": "chlo.constant_like", "summary": "Constant like operator", "description": "Returns a splat constant of the same shape as the operand.", "operands": [ { "name": "operand", "type": "HLO_AnyTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ] }, { "name": "chlo.cosh", "summary": "Cosh operator", "description": "Returns `Cosh(operand)` element-wise.\n\n $$\n \\cosh(x) = (e^x + e^-x) / 2\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.digamma", "summary": "Digamma function", "description": "Returns `Digamma(operand)` element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.erf", "summary": "Erfc operator", "description": "Computes the Gauss error function of `x` element-wise.\n\n erf(x) = erf_impl(x) if |x| < 1\n = 1 - erfc_impl(x) otherwise", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.erf_inv", "summary": "Inverse Erf", "description": "Returns `ErfInv(operand)` element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.erfc", "summary": "Erfc operator", "description": "Computes an approximation of the error function complement (1 - erf(x)).\n\n erfc(x) = erfc_impl(x) if |x| > 1\n = 1 - erf_impl(x) otherwise", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.is_inf", "summary": "IsInf predicate", "description": "Returns if a value is +/-inf element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyPredTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.is_neg_inf", "summary": "IsNegInf predicate", "description": "Returns if a value is -inf element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyPredTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.is_pos_inf", "summary": "IsPosInf predicate", "description": "Returns if a value is +inf element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyPredTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.lgamma", "summary": "Lgamma function", "description": "Returns `Lgamma(operand)` element-wise.", "operands": [ { "name": "operand", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.mulhi", "summary": "Mulhi operation", "description": "Performs element-wise multiplication of two N-bit integer tensors\n `lhs` and `rhs`, returning a N-bit integer `result` tensor containing\n the most significant N bits of the upcasted (N+N-bit) product.\n\n $$\n \\text{mulhi}(x, y) = \\text{downcast}((\\text{upcast}(x) * \\text{upcast}(y)) >> N)\n $$", "operands": [ { "name": "lhs", "type": "HLO_IntTensor" }, { "name": "rhs", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "chlo.next_after", "summary": "std::nextafter operator", "description": "Returns the next representable value of `x` in the direction of `y`,\n element-wise. It can also return a subnormal number.\n\n Equivalent to the C++ std::nextafter function.", "operands": [ { "name": "x", "type": "HLO_AnyFpTensor" }, { "name": "y", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$x `,` $y attr-dict `:` type($x) `,` type($y) `->` type(results)" }, { "name": "chlo.polygamma", "summary": "Polygamma function", "description": "Returns `Polygamma(operand, operand)` element-wise.", "operands": [ { "name": "n", "type": "HLO_AnyFpTensor" }, { "name": "x", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$n `,` $x attr-dict `:` type($n) `,` type($x) `->` type(results)" }, { "name": "chlo.ragged_dot", "summary": "Computes a matmul over a single ragged dimension", "description": "This operation takes three tensor args---lhs, rhs, and group_sizes---and\n a \"ragged_dot_dimension_numbers\" attribute. Like dot_general, the lhs and\n rhs are allowed arbitrary batch and contracting dimensions. Additionally,\n the lhs is required to have one ragged dimension, and the rhs may have at\n most one group dimension. The op has three modes, depending on the kind of\n the lhs ragged dimension.\n\n In mode 1, the shape-signature is `[b,m,k], [g,b,k,n], [b,g] -> [b,m,n]`.\n Here the ragged dimension is an lhs non-contracting dimension (`m`). The\n dimensions `b` and `k` represent batch and contracting dimensions\n respectively. The rhs is required to have a group dimension (`g`).\n\n In mode 2, the shape-signature is `[b,m,k], [b,k,n], [b,g] -> [g,b,m,n]`.\n Here the ragged dimension is an lhs/rhs contracting dimension (`k`).\n\n In mode 3, the shape-signature is `[b,m,k], [b,k,n], [g] -> [b,m,n]`. Here\n the ragged dimension is an lhs/rhs batch dimension (`b`).", "operands": [ { "name": "lhs", "type": "HLO_AnyTensor" }, { "name": "rhs", "type": "HLO_AnyTensor" }, { "name": "group_sizes", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "ragged_dot_dimension_numbers", "type": "CHLO_RaggedDotDimensionNumbers" }, { "name": "precision_config", "type": "OptionalAttr>" } ] }, { "name": "chlo.scan", "summary": "Scan operation", "description": "Applies a reduction function `body` to `inputs` and `inits` along the\n `dimension` and produces `results` (comprising `outputs` and `carries`).\n\n If `is_reverse` is true, the scan is performed in reverse order.\n `is_associative` indicates whether the reduction function is associative.\n\n See: https://www.tensorflow.org/xla/operation_semantics#scan\n\n ScanOp currently does not have a decomposition to StableHLO.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "carries", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" }, { "name": "scan_dim_size", "type": "OptionalAttr>" }, { "name": "is_reverse", "type": "DefaultValuedOptionalAttr" }, { "name": "is_associative", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "chlo.sinh", "summary": "Sinh operation", "description": "Returns `Sinh(operand)` element-wise.\n\n $$\n \\sinh(x) = (e^x - e^-x) / 2 if |x| < 1\n = e^(x + log(1/2)) - e^(-x + log(1/2)) otherwise.\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.square", "summary": "Square operation", "description": "Returns `Square(operand)` element-wise.\n\n $$\n \\square(x) = complex((x.real - x.imag) * (x.real + x.imag), x.real * x.imag * 2) if x is a complex number\n = x * x otherwise\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.tan", "summary": "Tan operation", "description": "Returns `Tan(operand)` element-wise.\n\n $$\n \\tan(x) = \\sin(x) / \\cos(x)\n $$", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)" }, { "name": "chlo.top_k", "summary": "Finds values and indices of the `k` largest elements for the last dimension", "description": "If the input is a vector (rank-1), finds the `k` largest entries in the\n vector and outputs their values and indices as vectors. Thus `values[j]` is\n the `j`-th largest entry in `input`, and its index is `indices[j]`.\n\n For matrices (resp. higher rank input), computes the top `k` entries in each\n row (resp. vector along the last dimension). Thus,\n\n ```\n values.shape = indices.shape = input.shape[:-1] + [k]\n ```\n\n If two elements are equal, the lower-index element appears first.", "operands": [ { "name": "operand", "type": "HLO_AnyTensor" } ], "results": [ { "name": "values", "type": "HLO_AnyTensor" }, { "name": "indices", "type": "HLO_AnyTensor" } ], "attributes": [ { "name": "k", "type": "I64Attr" } ], "assemblyFormat": "`(`$operand `,` `k` `=` $k`)` attr-dict `:`\n type($operand) `->` `(`type($values)`,` type($indices)`)`" }, { "name": "chlo.zeta", "summary": "Hurwitz zeta function", "description": "Returns `Zeta(operand, operand)` element-wise.\n\n $$\n \\(\\zeta(x, q) = \\sum_{n=0}^{\\infty} (q + n)^{-x}\\)\n $$", "operands": [ { "name": "x", "type": "HLO_AnyFpTensor" }, { "name": "q", "type": "HLO_AnyFpTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpTensor" } ], "assemblyFormat": "$x `,` $q attr-dict `:` type($x) `,` type($q) `->` type(results)" }, { "name": "cir.abs", "summary": "libc builtin equivalent abs, labs, llabs\n\n The `poison` argument indicate whether the result value\n is a poison value if the first argument is statically or\n dynamically an INT_MIN value.\n\n Example:\n\n ```mlir\n %0 = cir.const #cir.int<-42> : s32i\n %1 = cir.abs %0 poison : s32i\n %2 = cir.abs %3 : !cir.vector\n ```", "operands": [ { "name": "src", "type": "CIR_AnySIntOrVecOfSIntType" } ], "results": [ { "name": "result", "type": "CIR_AnySIntOrVecOfSIntType" } ], "attributes": [ { "name": "poison", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src ( `poison` $poison^ )? `:` type($src) attr-dict" }, { "name": "cir.acos", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.alloc.exception", "summary": "Allocates an exception according to Itanium ABI", "description": "Implements a slightly higher level __cxa_allocate_exception:\n\n `void *__cxa_allocate_exception(size_t thrown_size);`\n\n If operation fails, program terminates, not throw.\n\n Example:\n\n ```mlir\n // if (b == 0) {\n // ...\n // throw \"...\";\n cir.if %10 {\n %11 = cir.alloc_exception 8 -> !cir.ptr\n ... // store exception content into %11\n cir.throw %11 : !cir.ptr>, ...\n ```", "results": [ { "name": "addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "size", "type": "I64Attr" } ], "assemblyFormat": "$size `->` qualified(type($addr)) attr-dict" }, { "name": "cir.alloca", "summary": "Defines a scope-local variable", "description": "The `cir.alloca` operation defines a scope-local variable.\n\n The presence `init` attribute indicates that the local variable represented\n by this alloca was originally initialized in C/C++ source code. In such\n cases, the first use contains the initialization (a cir.store, a cir.call\n to a ctor, etc).\n\n The presence of the `const` attribute indicates that the local variable is\n declared with C/C++ `const` keyword.\n\n The `dynAllocSize` specifies the size to dynamically allocate on the stack\n and ignores the allocation size based on the original type. This is useful\n when handling VLAs and is omitted when declaring regular local variables.\n\n The result type is a pointer to the input's type.\n\n Example:\n\n ```mlir\n // int count = 3;\n %0 = cir.alloca i32, !cir.ptr, [\"count\", init] {alignment = 4 : i64}\n\n // int *ptr;\n %1 = cir.alloca !cir.ptr, !cir.ptr>, [\"ptr\"] {alignment = 8 : i64}\n ...\n ```", "operands": [ { "name": "dynAllocSize", "type": "Optional" } ], "results": [ { "name": "addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "allocaType", "type": "TypeAttr" }, { "name": "name", "type": "StrAttr" }, { "name": "init", "type": "UnitAttr" }, { "name": "constant", "type": "UnitAttr" }, { "name": "alignment", "type": "ConfinedAttr, [IntMinValue<0>]>" }, { "name": "annotations", "type": "OptionalAttr" }, { "name": "ast", "type": "OptionalAttr" } ], "assemblyFormat": "$allocaType `,` qualified(type($addr)) `,`\n ($dynAllocSize^ `:` type($dynAllocSize) `,`)?\n `[` $name\n (`,` `init` $init^)?\n (`,` `const` $constant^)?\n `]`\n ($annotations^)?\n (`ast` $ast^)? attr-dict" }, { "name": "cir.array.ctor", "summary": "Initialize array elements with C++ constructors", "description": "Initialize each array element using the same C++ constructor. This\n operation has one region, with one single block. The block has an\n incoming argument for the current array index to initialize.", "operands": [ { "name": "addr", "type": "CIR_PtrToArray" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`(` $addr `:` qualified(type($addr)) `)` $body attr-dict" }, { "name": "cir.array.dtor", "summary": "Destroy array elements with C++ dtors", "description": "Destroy each array element using the same C++ destructor. This\n operation has one region, with one single block. The block has an\n incoming argument for the current array index to initialize.", "operands": [ { "name": "addr", "type": "CIR_PtrToArray" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`(` $addr `:` qualified(type($addr)) `)` $body attr-dict" }, { "name": "cir.asin", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.asm", "description": "The `cir.asm` operation represents C/C++ asm inline.\n\n CIR constraints strings follow barelly the same rules that are established\n for the C level assembler constraints with several differences caused by\n clang::AsmStmt processing.\n\n Thus, numbers that appears in the constraint string may also refer to:\n - the output variable index referenced by the input operands.\n - the index of early-clobber operand\n\n Operand attributes is a storage, where each element corresponds to the operand with\n the same index. The first index relates to the operation result (if any).\n Note, the operands themselves are stored as VariadicOfVariadic in the next order:\n output, input and then in/out operands.\n\n Note, when several output operands are present, the result type may be represented as\n an anon record type.\n\n Example:\n ```C++\n __asm__(\"foo\" : : : );\n __asm__(\"bar $42 %[val]\" : [val] \"=r\" (x), \"+&r\"(x));\n __asm__(\"baz $42 %[val]\" : [val] \"=r\" (x), \"+&r\"(x) : \"[val]\"(y));\n ```\n\n ```mlir\n !rec_22anon2E022 = !cir.record, !cir.int}>\n !rec_22anon2E122 = !cir.record, !cir.int}>\n ...\n %0 = cir.alloca !s32i, !cir.ptr, [\"x\", init]\n %1 = cir.alloca !s32i, !cir.ptr, [\"y\", init]\n ...\n %2 = cir.load %0 : !cir.ptr, !s32i\n %3 = cir.load %1 : !cir.ptr, !s32i\n\n cir.asm(x86_att,\n out = [],\n in = [],\n in_out = [],\n {\"foo\" \"~{dirflag},~{fpsr},~{flags}\"}) side_effects\n\n cir.asm(x86_att,\n out = [],\n in = [],\n in_out = [%2 : !s32i],\n {\"bar $$42 $0\" \"=r,=&r,1,~{dirflag},~{fpsr},~{flags}\"}) -> !rec_22anon2E022\n\n cir.asm(x86_att,\n out = [],\n in = [%3 : !s32i],\n in_out = [%2 : !s32i],\n {\"baz $$42 $0\" \"=r,=&r,0,1,~{dirflag},~{fpsr},~{flags}\"}) -> !rec_22anon2E122\n ```", "operands": [ { "name": "asm_operands", "type": "VariadicOfVariadic" } ], "results": [ { "name": "res", "type": "Optional" } ], "attributes": [ { "name": "asm_string", "type": "StrAttr" }, { "name": "constraints", "type": "StrAttr" }, { "name": "side_effects", "type": "UnitAttr" }, { "name": "asm_flavor", "type": "CIR_AsmFlavor{x86_att|x86_intel}" }, { "name": "operand_attrs", "type": "ArrayAttr" }, { "name": "operands_segments", "type": "DenseI32ArrayAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "cir.assume", "summary": "Tell the optimizer that a boolean value is true", "description": "The `cir.assume` operation takes a single boolean prediate as its only\n argument and does not have any results. The operation tells the optimizer\n that the predicate's value is true.\n\n This operation corresponds to the `__assume` and the `__builtin_assume`\n builtin function.", "operands": [ { "name": "predicate", "type": "CIR_BoolType" } ], "assemblyFormat": "$predicate `:` type($predicate) attr-dict" }, { "name": "cir.assume.aligned", "summary": "Tell the optimizer that a pointer is aligned", "description": "The `cir.assume.aligned` operation takes two or three arguments.\n\n When the 3rd argument `offset` is absent, this operation tells the optimizer\n that the pointer given by the `pointer` argument is aligned to the alignment\n given by the `align` argument.\n\n When the `offset` argument is given, it represents an offset from the\n alignment. This operation then tells the optimizer that the pointer given by\n the `pointer` argument is always misaligned by the alignment given by the\n `align` argument by `offset` bytes, a.k.a. the pointer yielded by\n `(char *)pointer - offset` is aligned to the specified alignment.\n\n The `align` argument is a constant integer represented as an integer\n attribute instead of an SSA value. It must be a positive integer.\n\n The result of this operation has the same value as the `pointer` argument,\n but the optimizer has additional knowledge about its alignment.\n\n This operation corresponds to the `__builtin_assume_aligned` builtin\n function.", "operands": [ { "name": "pointer", "type": "CIR_PointerType" }, { "name": "offset", "type": "Optional" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "attributes": [ { "name": "alignment", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['pointer', 'result']>" } ], "assemblyFormat": "$pointer `:` qualified(type($pointer))\n `[` `alignment` $alignment (`,` `offset` $offset^ `:` type($offset))? `]`\n attr-dict" }, { "name": "cir.assume.separate_storage", "summary": "Tell the optimizer that two pointers point to different allocations", "description": "The `cir.assume.separate_storage` operation takes two pointers as arguments,\n and the operation tells the optimizer that these two pointers point to\n different allocations.\n\n This operation corresponds to the `__builtin_assume_separate_storage`\n builtin function.", "operands": [ { "name": "ptr1", "type": "CIR_VoidPtrType" }, { "name": "ptr2", "type": "CIR_VoidPtrType" } ], "assemblyFormat": "$ptr1 `,` $ptr2 `:` qualified(type($ptr1)) attr-dict" }, { "name": "cir.atan", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.atan2", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.atomic.clear", "summary": "Atomic clear", "description": "C/C++ atomic clear operation. Implements the builtin function\n `__atomic_clear`.\n\n The operation takes as its only operand a pointer to an 8-bit signed\n integer. The operation atomically sets the integer to zero.\n\n Example:\n ```mlir\n cir.atomic.clear seq_cst %ptr : !cir.ptr\n ```", "operands": [ { "name": "ptr", "type": "CIR_PtrToType" } ], "attributes": [ { "name": "mem_order", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "sync_scope", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "is_volatile", "type": "UnitAttr" } ], "assemblyFormat": "$mem_order $ptr\n (`volatile` $is_volatile^)?\n `:` qualified(type($ptr)) attr-dict" }, { "name": "cir.atomic.cmp_xchg", "summary": "Atomic compare exchange", "description": "C/C++ Atomic compare and exchange operation. Implements builtins like\n `__atomic_compare_exchange_n` and `__atomic_compare_exchange`.\n\n Example:\n %old, %cmp = cir.atomic.cmp_xchg(%ptr : !cir.ptr,\n %expected : !u64i,\n %desired : !u64i,\n success = seq_cst,\n failure = seq_cst) weak\n : (!u64i, !cir.bool)", "operands": [ { "name": "ptr", "type": "CIR_PointerType" }, { "name": "expected", "type": "CIR_AnyType" }, { "name": "desired", "type": "CIR_AnyType" } ], "results": [ { "name": "old", "type": "CIR_AnyType" }, { "name": "cmp", "type": "CIR_BoolType" } ], "attributes": [ { "name": "succ_order", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "fail_order", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "sync_scope", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "weak", "type": "UnitAttr" }, { "name": "is_volatile", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['old', 'expected', 'desired']>" } ], "assemblyFormat": "`(`\n $ptr `:` qualified(type($ptr)) `,`\n $expected `:` type($expected) `,`\n $desired `:` type($desired) `,`\n `success` `=` $succ_order `,`\n `failure` `=` $fail_order\n `)`\n (`syncscope` `(` $sync_scope^ `)`)?\n (`align` `(` $alignment^ `)`)?\n (`weak` $weak^)?\n (`volatile` $is_volatile^)?\n `:` `(` type($old) `,` type($cmp) `)` attr-dict" }, { "name": "cir.atomic.fence", "summary": "Atomic thread fence", "description": "C/C++ Atomic thread fence synchronization primitive. Implements the builtin\n `__atomic_thread_fence` which enforces memory ordering constraints across\n threads within the specified synchronization scope.\n\n This handles all variations including:\n - `__atomic_thread_fence`\n - `__atomic_signal_fence`\n - `__c11_atomic_thread_fence`\n - `__c11_atomic_signal_fence`\n\n Example:\n ```mlir\n cir.atomic.fence syncscope(system) seq_cst\n cir.atomic.fence syncscope(single_thread) seq_cst\n ```", "attributes": [ { "name": "ordering", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "sync_scope", "type": "OptionalAttr" } ], "assemblyFormat": "(`syncscope` `(` $sync_scope^ `)`)? $ordering attr-dict" }, { "name": "cir.atomic.fetch", "summary": "Atomic fetch with unary and binary operations", "description": "Represents `__atomic__fetch` and `__atomic_fetch_` builtins,\n where `binop` is on of the binary opcodes : `add`, `sub`, `and`, `xor`,\n `or`, `nand`, `max` and `min`.\n\n `ptr` is an integer or fp pointer, followed by `val`, which must be\n an integer or fp (only supported for `add` and `sub`). The operation\n can also be marked `volatile`.\n\n If `fetch_first` is present, the operation works like\n `__atomic_fetch_binop` and returns the value that had\n previously been in *ptr, otherwise it returns the final result\n of the computation (`__atomic_binop_fetch`).\n\n Example:\n %res = cir.atomic.fetch(add, %ptr : !cir.ptr,\n %val : !s32i, seq_cst) : !s32i", "operands": [ { "name": "ptr", "type": "CIR_PtrToIntOrFloatType" }, { "name": "val", "type": "CIR_AnyIntOrFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyIntOrFloatType" } ], "attributes": [ { "name": "binop", "type": "CIR_AtomicFetchKind{add|sub|and|xor|or|nand|max|min|xchg}" }, { "name": "mem_order", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "is_volatile", "type": "UnitAttr" }, { "name": "fetch_first", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'val']>" } ], "assemblyFormat": "`(`$binop `,`\n $ptr `:` qualified(type($ptr)) `,`\n $val `:` type($val) `,`\n $mem_order `)`\n (`volatile` $is_volatile^)?\n (`fetch_first` $fetch_first^)?\n `:` type($result) attr-dict" }, { "name": "cir.atomic.test_and_set", "summary": "Atomic test and set", "description": "C/C++ atomic test and set operation. Implements the builtin function\n `__atomic_test_and_set`.\n\n The operation takes as its only operand a pointer to an 8-bit signed\n integer. The operation atomically set the integer to an implementation-\n defined non-zero \"set\" value. The result of the operation is a boolean value\n indicating whether the previous value of the integer was the \"set\" value.\n\n Example:\n ```mlir\n %res = cir.atomic.test_and_set seq_cst %ptr : !cir.ptr -> !cir.bool\n ```", "operands": [ { "name": "ptr", "type": "CIR_PtrToType" } ], "results": [ { "name": "result", "type": "CIR_BoolType" } ], "attributes": [ { "name": "mem_order", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "sync_scope", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "is_volatile", "type": "UnitAttr" } ], "assemblyFormat": "$mem_order $ptr\n (`volatile` $is_volatile^)?\n `:` qualified(type($ptr)) `->` qualified(type($result)) attr-dict" }, { "name": "cir.atomic.xchg", "summary": "Atomic exchange", "description": "Atomic exchange operations. Implements C/C++ builtins such as\n `__atomic_exchange`and `__atomic_exchange_n`.\n\n Example:\n %res = cir.atomic.xchg(%ptr : !cir.ptr,\n %val : !u64i, seq_cst) : !u64i", "operands": [ { "name": "ptr", "type": "CIR_PointerType" }, { "name": "val", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "mem_order", "type": "CIR_MemOrder{relaxed|consume|acquire|release|acq_rel|seq_cst}" }, { "name": "is_volatile", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'val']>" } ], "assemblyFormat": "`(`\n $ptr `:` qualified(type($ptr)) `,`\n $val `:` type($val) `,`\n $mem_order `)`\n (`volatile` $is_volatile^)?\n `:` type($result) attr-dict" }, { "name": "cir.await", "summary": "Wraps C++ co_await implicit logic", "description": "The under the hood effect of using C++ `co_await expr` roughly\n translates to:\n\n ```c++\n // co_await expr;\n\n auto &&x = CommonExpr();\n if (!x.await_ready()) {\n ...\n x.await_suspend(...);\n ...\n }\n x.await_resume();\n ```\n\n `cir.await` represents this logic by using 3 regions:\n - ready: covers veto power from x.await_ready()\n - suspend: wraps actual x.await_suspend() logic\n - resume: handles x.await_resume()\n\n Breaking this up in regions allow individual scrutiny of conditions\n which might lead to folding some of them out. Lowerings coming out\n of CIR, e.g. LLVM, should use the `suspend` region to track more\n lower level codegen (e.g. intrinsic emission for coro.save/coro.suspend).\n\n There are also 4 flavors of `cir.await` available:\n - `init`: compiler generated initial suspend via implicit `co_await`.\n - `user`: also known as normal, representing user written co_await's.\n - `yield`: user written `co_yield` expressions.\n - `final`: compiler generated final suspend via implicit `co_await`.\n\n From the C++ snippet we get:\n\n ```mlir\n cir.scope {\n ... // auto &&x = CommonExpr();\n cir.await(user, ready : {\n ... // x.await_ready()\n }, suspend : {\n ... // x.await_suspend()\n }, resume : {\n ... // x.await_resume()\n })\n }\n ```\n\n Note that resulution of the common expression is assumed to happen\n as part of the enclosing await scope.", "attributes": [ { "name": "kind", "type": "CIR_AwaitKind{init|user|yield|final}" } ], "regions": [ { "name": "ready", "type": "SizedRegion<1>" }, { "name": "suspend", "type": "SizedRegion<1>" }, { "name": "resume", "type": "SizedRegion<1>" } ], "assemblyFormat": "`(` $kind `,`\n `ready` `:` $ready `,`\n `suspend` `:` $suspend `,`\n `resume` `:` $resume `,`\n `)`\n attr-dict" }, { "name": "cir.base_class_addr", "summary": "Get the base class address for a class/struct", "description": "The `cir.base_class_addr` operaration gets the address of a particular\n non-virtual base class given a derived class pointer. The offset in bytes\n of the base class must be passed in, since it is easier for the front end\n to calculate that than the MLIR passes. The operation contains a flag for\n whether or not the operand may be nullptr. That depends on the context and\n cannot be known by the operation, and that information affects how the\n operation is lowered.\n\n Example:\n ```c++\n struct Base { };\n struct Derived : Base { };\n Derived d;\n Base& b = d;\n ```\n will generate\n ```mlir\n %3 = cir.base_class_addr %1 : !cir.ptr nonnull [0] -> !cir.ptr\n ```", "operands": [ { "name": "derived_addr", "type": "CIR_PointerType" } ], "results": [ { "name": "base_addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "offset", "type": "IndexAttr" }, { "name": "assume_not_null", "type": "UnitAttr" } ], "assemblyFormat": "$derived_addr `:` qualified(type($derived_addr))\n (`nonnull` $assume_not_null^)?\n ` ` `[` $offset `]` `->` qualified(type($base_addr)) attr-dict" }, { "name": "cir.base_data_member", "summary": "Cast a derived class data member pointer to a base class data member pointer", "description": "The `cir.base_data_member` operation casts a data member pointer of type\n `T Derived::*` to a data member pointer of type `T Base::*`, where `Base`\n is an accessible non-ambiguous non-virtual base class of `Derived`.\n\n The `offset` parameter gives the offset in bytes of the `Base` base class\n subobject within a `Derived` object.", "operands": [ { "name": "src", "type": "CIR_DataMemberType" } ], "results": [ { "name": "result", "type": "CIR_DataMemberType" } ], "attributes": [ { "name": "offset", "type": "IndexAttr" } ], "assemblyFormat": "$src `:` qualified(type($src))\n ` ` `[` $offset `]` `->` qualified(type($result)) attr-dict" }, { "name": "cir.base_method", "summary": "Cast a derived class pointer-to-member-function to a base class\n pointer-to-member-function", "description": "The `cir.base_method` operation casts a pointer-to-member-function of type\n `Ret (Derived::*)(Args)` to a pointer-to-member-function of type\n `Ret (Base::*)(Args)`, where `Base` is a non-virtual base class of\n `Derived`.\n\n The `offset` parameter gives the offset in bytes of the `Base` base class\n subobject within a `Derived` object.\n\n Example:\n\n ```mlir\n %1 = cir.base_method %0 : !cir.method in !rec_Derived> [16] -> !cir.method in !rec_Base>\n ```", "operands": [ { "name": "src", "type": "CIR_MethodType" } ], "results": [ { "name": "result", "type": "CIR_MethodType" } ], "attributes": [ { "name": "offset", "type": "IndexAttr" } ], "assemblyFormat": "$src `:` qualified(type($src))\n ` ` `[` $offset `]` `->` qualified(type($result)) attr-dict" }, { "name": "cir.binop", "summary": "Binary operations (arith and logic)", "description": "cir.binop performs the binary operation according to\n the specified opcode kind: [mul, div, rem, add, sub,\n and, xor, or].\n\n It requires two input operands and has one result, all types\n should be the same.\n\n ```mlir\n %7 = cir.binop(add, %1, %2) : !s32i\n %7 = cir.binop(mul, %1, %2) : !u8i\n ```", "operands": [ { "name": "lhs", "type": "CIR_AnyType" }, { "name": "rhs", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "kind", "type": "CIR_BinOpKind{mul|div|rem|add|sub|and|xor|or|max}" }, { "name": "no_unsigned_wrap", "type": "UnitAttr" }, { "name": "no_signed_wrap", "type": "UnitAttr" }, { "name": "saturated", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` $kind `,` $lhs `,` $rhs `)`\n (`nsw` $no_signed_wrap^)?\n (`nuw` $no_unsigned_wrap^)?\n (`sat` $saturated^)?\n `:` type($lhs) attr-dict" }, { "name": "cir.binop.overflow", "summary": "Perform binary integral arithmetic with overflow checking", "description": "`cir.binop.overflow` performs binary arithmetic operations with overflow\n checking on integral operands.\n\n The `kind` argument specifies the kind of arithmetic operation to perform.\n It can be either `add`, `sub`, or `mul`. The `lhs` and `rhs` arguments\n specify the input operands of the arithmetic operation. The types of `lhs`\n and `rhs` must be the same.\n\n `cir.binop.overflow` produces two SSA values. `result` is the result of the\n arithmetic operation truncated to its specified type. `overflow` is a\n boolean value indicating whether overflow happens during the operation.\n\n The exact semantic of this operation is as follows:\n\n - `lhs` and `rhs` are promoted to an imaginary integral type that has\n infinite precision.\n - The arithmetic operation is performed on the promoted operands.\n - The infinite-precision result is truncated to the type of `result`. The\n truncated result is assigned to `result`.\n - If the truncated result is equal to the un-truncated result, `overflow`\n is assigned to false. Otherwise, `overflow` is assigned to true.", "operands": [ { "name": "lhs", "type": "CIR_IntType" }, { "name": "rhs", "type": "CIR_IntType" } ], "results": [ { "name": "result", "type": "CIR_IntType" }, { "name": "overflow", "type": "CIR_BoolType" } ], "attributes": [ { "name": "kind", "type": "CIR_BinOpOverflowKind{add|sub|mul}" } ], "assemblyFormat": "`(` $kind `,` $lhs `,` $rhs `)` `:` type($lhs) `,`\n `(` type($result) `,` type($overflow) `)`\n attr-dict" }, { "name": "cir.bit_reverse", "summary": "Reverse the bit pattern of the operand integer", "description": "The `cir.bit_reverse` operation reverses the bit pattern of the operand\n integer. Its only argument must be of unsigned integer types of width 8, 16,\n 32, or 64.\n\n This operation covers the C/C++ builtin function `__builtin_bitreverse`.\n\n Example:\n\n ```mlir\n %1 = cir.bit_reverse %0 : !u32i\n ```", "operands": [ { "name": "src", "type": "CIR_UIntOfWidths<[8, 16, 32, 64]>" } ], "results": [ { "name": "result", "type": "CIR_UIntOfWidths<[8, 16, 32, 64]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($result) attr-dict" }, { "name": "cir.blockaddress", "summary": "Get the address of a cir.label within a function", "description": "The `cir.blockaddress` operation takes a function name and a label and\n produces a pointer value that represents the address of that cir.label within\n the specified function.\n\n This operation models GCC's \"labels as values\" extension (`&&label`), which\n allows taking the address of a local label and using it as a computed\n jump target (e.g., with `goto *addr;`).\n\n Example:\n ```mlir\n %1 = cir.alloca !cir.ptr, !cir.ptr>, [\"ptr\", init] {alignment = 8 : i64}\n %addr = cir.blockaddress(\"foo\", \"label\") -> !cir.ptr\n cir.store align(8) %addr, %1 : !cir.ptr, !cir.ptr>\n cir.br ^bb1\n ^bb1:\n cir.label \"label\"\n ```", "results": [ { "name": "addr", "type": "CIR_VoidPtrType" } ], "attributes": [ { "name": "blockAddrInfo", "type": "CIR_BlockAddrInfoAttr" } ], "assemblyFormat": "$blockAddrInfo `->` qualified(type($addr)) attr-dict" }, { "name": "cir.br", "summary": "Unconditional branch", "description": "The `cir.br` branches unconditionally to a block. Used to represent C/C++\n goto's and general block branching.\n\n Note that for source level `goto`'s crossing scope boundaries, those are\n usually represented with the \"symbolic\" `cir.goto` operation.\n\n Example:\n\n ```mlir\n ...\n cir.br ^bb3\n ^bb3:\n cir.return\n ```", "operands": [ { "name": "destOperands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict" }, { "name": "cir.brcond", "summary": "Conditional branch", "description": "The `cir.brcond %cond, ^bb0, ^bb1` branches to 'bb0' block in case\n %cond (which must be a !cir.bool type) evaluates to true, otherwise\n it branches to 'bb1'.\n\n Example:\n\n ```mlir\n ...\n cir.brcond %a, ^bb3, ^bb4\n ^bb3:\n cir.return\n ^bb4:\n cir.yield\n ```", "operands": [ { "name": "cond", "type": "CIR_BoolType" }, { "name": "destOperandsTrue", "type": "Variadic" }, { "name": "destOperandsFalse", "type": "Variadic" } ], "successors": [ { "name": "destTrue", "type": "AnySuccessor" }, { "name": "destFalse", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$cond\n $destTrue (`(` $destOperandsTrue^ `:` type($destOperandsTrue) `)`)?\n `,`\n $destFalse (`(` $destOperandsFalse^ `:` type($destOperandsFalse) `)`)?\n attr-dict" }, { "name": "cir.break", "summary": "C/C++ `break` statement equivalent", "description": "The `cir.break` operation is used to cease the control flow to the parent\n operation, exiting its region's control flow. It is only allowed if it is\n within a breakable operation (loops and `switch`).", "assemblyFormat": "attr-dict" }, { "name": "cir.byte_swap", "summary": "Reverse the bytes that constitute the operand integer", "description": "The `cir.byte_swap` operation takes an integer as operand, and returns it\n with the order of bytes that constitute the operand reversed.\n\n The operand integer must be an unsigned integer. Its widths must be either\n 16, 32, or 64.\n\n Example:\n\n ```mlir\n !u32i = !cir.int\n\n // %0 = 0x12345678\n %0 = cir.const #cir.int<305419896> : !u32i\n\n // %1 should be 0x78563412\n %1 = cir.byte_swap(%0 : !u32i) : !u32i\n ```", "operands": [ { "name": "input", "type": "CIR_UIntOfWidths<[16, 32, 64]>" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input `:` type($result) attr-dict" }, { "name": "cir.call", "summary": "call operation", "description": "Direct and indirect calls.\n\n For direct calls, the `call` operation represents a direct call to a\n function that is within the same symbol scope as the call. The operands\n and result types of the call must match the specified function type.\n The callee is encoded as a aymbol reference attribute named \"callee\".\n\n For indirect calls, the first `mlir::Operation` operand is the call target.\n\n Given the way indirect calls are encoded, avoid using `mlir::Operation`\n methods to walk the operands for this operation, instead use the methods\n provided by `CIRCallOpInterface`.\n\n If the `cir.call` has the `exception` keyword, the call can throw. In this\n case, cleanups can be added in the `cleanup` region.\n\n Example:\n\n ```mlir\n // Direct call\n %2 = cir.call @my_add(%0, %1) : (f32, f32) -> f32\n ...\n // Indirect call\n %20 = cir.call %18(%17)\n ...\n // Call that might throw\n cir.call exception @my_div() -> () cleanup {\n // call dtor...\n }\n ```", "operands": [ { "name": "arg_ops", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "exception", "type": "UnitAttr" }, { "name": "callee", "type": "OptionalAttr" }, { "name": "calling_conv", "type": "DefaultValuedAttr" }, { "name": "side_effect", "type": "DefaultValuedAttr" }, { "name": "extra_attrs", "type": "CIR_ExtraFuncAttr" }, { "name": "ast", "type": "OptionalAttr" } ], "regions": [ { "name": "cleanup", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "cir.case", "summary": "Case operation", "description": "The `cir.case` operation represents a case within a C/C++ switch.\n The `cir.case` operation must be in a `cir.switch` operation directly or indirectly.\n\n The `cir.case` have 4 kinds:\n - `equal, `: equality of the second case operand against the\n condition.\n - `anyof, [constant-list]`: equals to any of the values in a subsequent\n following list.\n - `range, [lower-bound, upper-bound]`: the condition is within the closed interval.\n - `default`: any other value.\n\n Each case region must be explicitly terminated.", "attributes": [ { "name": "value", "type": "ArrayAttr" }, { "name": "kind", "type": "CIR_CaseOpKind{default|equal|anyof|range}" } ], "regions": [ { "name": "caseRegion", "type": "AnyRegion" } ], "assemblyFormat": "`(` $kind `,` $value `)` $caseRegion attr-dict" }, { "name": "cir.cast", "summary": "Conversion between values of different types", "description": "Apply the usual C/C++ conversion rules between values. This operation models\n a subset of conversions as defined in Clang's `OperationKinds.def`\n (`llvm-project/clang/include/clang/AST/OperationKinds.def`).\n\n Note: not all conversions are implemented using `cir.cast`. For instance,\n lvalue-to-rvalue conversion is modeled as a `cir.load` instead. Currently\n supported kinds:\n\n - `bitcast`\n - `array_to_ptrdecay`\n - `member_ptr_to_bool\n - `int_to_ptr`\n - `ptr_to_int`\n - `ptr_to_bool`\n - `integral`\n - `int_to_bool`\n - `int_to_float`\n - `float_to_int`\n - `float_to_bool`\n - `bool_to_int`\n - `floating`\n - `float_to_complex`\n - `float_complex_to_real`\n - `float_complex_to_bool`\n - `float_complex`\n - `float_complex_to_int_complex`\n - `int_to_complex`\n - `int_complex_to_real`\n - `int_complex_to_bool`\n - `int_complex`\n - `int_complex_to_float_complex`\n - `address_space`\n\n CIR also supports some additional conversions that are not part of the classic\n Clang codegen:\n\n - `bool_to_float`\n\n Example:\n\n ```mlir\n %4 = cir.cast int_to_bool %3 : i32 -> !cir.bool\n ...\n %x = cir.cast array_to_ptrdecay %0 : !cir.ptr> -> !cir.ptr\n ```", "operands": [ { "name": "src", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "kind", "type": "CIR_CastKind{bitcast|array_to_ptrdecay|member_ptr_to_bool|int_to_ptr|ptr_to_int|ptr_to_bool|integral|int_to_bool|int_to_float|float_to_int|float_to_bool|bool_to_int|floating|float_to_complex|float_complex_to_real|float_complex_to_bool|float_complex|float_complex_to_int_complex|int_to_complex|int_complex_to_real|int_complex_to_bool|int_complex|int_complex_to_float_complex|address_space|bool_to_float}" } ], "assemblyFormat": "$kind $src `:` type($src) `->` type($result) attr-dict" }, { "name": "cir.catch_param", "summary": "Represents catch clause formal parameter", "description": "The `cir.catch_param` can operate in two modes: within catch regions of\n `cir.try` or anywhere else with the `begin` or `end` markers. The `begin`\n version requires an exception pointer of `cir.ptr`.\n\n Example:\n ```mlir\n // TBD\n ```", "operands": [ { "name": "exception_ptr", "type": "Optional" } ], "results": [ { "name": "param", "type": "Optional" } ], "attributes": [ { "name": "kind", "type": "OptionalAttr" } ], "assemblyFormat": "($kind^)?\n ($exception_ptr^)?\n (`->` qualified(type($param))^)?\n attr-dict" }, { "name": "cir.ceil", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.clear_cache", "summary": "clear cache operation", "description": "CIR representation for `__builtin___clear_cache`.", "operands": [ { "name": "begin", "type": "CIR_VoidPtrType" }, { "name": "end", "type": "CIR_VoidPtrType" } ], "traits": [ { "type": "AllTypesMatch<['begin', 'end']>" } ], "assemblyFormat": "$begin `:` qualified(type($begin)) `,`\n $end `,`\n attr-dict" }, { "name": "cir.clrsb", "summary": "Get the number of leading redundant sign bits in the input", "description": "Compute the number of leading redundant sign bits in the input integer.\n\n The input integer must be a signed integer. The most significant bit of the\n input integer is the sign bit. The `cir.clrsb` operation returns the number\n of redundant sign bits in the input, that is, the number of bits following\n the most significant bit that are identical to it.\n\n The bit width of the input integer must be either 32 or 64.\n\n Examples:\n\n ```mlir\n !s32i = !cir.int\n\n // %0 = 0xDEADBEEF, 0b1101_1110_1010_1101_1011_1110_1110_1111\n %0 = cir.const #cir.int<3735928559> : !s32i\n // %1 will be 1 because there is 1 bit following the most significant bit\n // that is identical to it.\n %1 = cir.clrsb(%0 : !s32i) : !s32i\n\n // %2 = 1, 0b0000_0000_0000_0000_0000_0000_0000_0001\n %2 = cir.const #cir.int<1> : !s32i\n // %3 will be 30\n %3 = cir.clrsb(%2 : !s32i) : !s32i\n ```", "operands": [ { "name": "input", "type": "CIR_SIntOfWidths<[ 32, 64 ]>" } ], "results": [ { "name": "result", "type": "CIR_SIntOfWidths<[ 32, 64 ]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input `:` type($result) attr-dict" }, { "name": "cir.clz", "summary": "Get the number of leading 0-bits in the input", "description": "Compute the number of leading 0-bits in the input.\n\n The input integer must be an unsigned integer. The `cir.clz` operation\n returns the number of consecutive 0-bits at the most significant bit\n position in the input.\n\n Zero_poison attribute means this operation invokes undefined behavior if the\n input value is 0.\n\n Example:\n\n ```mlir\n !u32i = !cir.int\n\n // %0 = 0b0000_0000_0000_0000_0000_0000_0000_1000\n %0 = cir.const #cir.int<8> : !u32i\n // %1 will be 28\n %1 = cir.clz(%0 : !u32i) zero_poison : !u32i\n ```", "operands": [ { "name": "input", "type": "CIR_UIntOfWidths<[ 16, 32, 64 ]>" } ], "results": [ { "name": "result", "type": "CIR_UIntOfWidths<[ 16, 32, 64 ]>" } ], "attributes": [ { "name": "is_zero_poison", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input (`zero_poison` $is_zero_poison^)?\n `:` type($result) attr-dict" }, { "name": "cir.cmp", "summary": "Compare values two values and produce a boolean result", "description": "`cir.cmp` compares two input operands of the same type and produces a\n `cir.bool` result. The kinds of comparison available are:\n [lt,le,gt,ge,eq,ne] for all types, and [fone,funo] for floating-point only.\n\n ```mlir\n %7 = cir.cmp(gt, %1, %2) : i32, !cir.bool\n ```", "operands": [ { "name": "lhs", "type": "CIR_AnyType" }, { "name": "rhs", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_BoolType" } ], "attributes": [ { "name": "kind", "type": "CIR_CmpOpKind{lt|le|gt|ge|eq|ne|fone|funo}" } ], "assemblyFormat": "`(` $kind `,` $lhs `,` $rhs `)` `:` type($lhs) `,` type($result) attr-dict" }, { "name": "cir.cmp3way", "summary": "Compare two values with C++ three-way comparison semantics", "description": "The `cir.cmp3way` operation models the `<=>` operator in C++20. It takes two\n operands with the same type and produces a result indicating the ordering\n between the two input operands.\n\n The result of the operation is a signed integer that indicates the ordering\n between the two input operands.\n\n There are two kinds of ordering: strong ordering and partial ordering.\n Comparing different types of values yields different kinds of orderings.\n The `info` parameter gives the ordering kind and other necessary information\n about the comparison.\n\n Example:\n\n ```mlir\n !s32i = !cir.int\n\n #cmp3way_strong = #cmp3way_info\n #cmp3way_partial = #cmp3way_info\n\n %0 = cir.const #cir.int<0> : !s32i\n %1 = cir.const #cir.int<1> : !s32i\n %2 = cir.cmp3way(%0 : !s32i, %1, #cmp3way_strong) : !s8i\n\n %3 = cir.const #cir.fp<0.0> : !cir.float\n %4 = cir.const #cir.fp<1.0> : !cir.float\n %5 = cir.cmp3way(%3 : !cir.float, %4, #cmp3way_partial) : !s8i\n ```", "operands": [ { "name": "lhs", "type": "CIR_AnyType" }, { "name": "rhs", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnySIntType" } ], "attributes": [ { "name": "info", "type": "CIR_CmpThreeWayInfoAttr" } ], "assemblyFormat": "`(` $lhs `:` type($lhs) `,` $rhs `,` qualified($info) `)`\n `:` type($result) attr-dict" }, { "name": "cir.complex.binop", "summary": "Binary operations on operands of complex type", "description": "The `cir.complex.binop` operation represents a binary operation on operands\n of C complex type (e.g. `float _Complex`). The operation can only represent\n binary multiplication or division on complex numbers; other binary\n operations, such as addition and subtraction, are represented by the\n `cir.binop` operation.\n\n The operation requires two input operands and has one result. The types of\n all the operands and the result should be of the same `!cir.complex` type.\n\n The operation also takes a `range` attribute that specifies the complex\n range of the binary operation.\n\n Examples:\n\n ```mlir\n %2 = cir.complex.binop add %0, %1 : !cir.complex\n %2 = cir.complex.binop mul %0, %1 : !cir.complex\n ```", "operands": [ { "name": "lhs", "type": "CIR_ComplexType" }, { "name": "rhs", "type": "CIR_ComplexType" } ], "results": [ { "name": "result", "type": "CIR_ComplexType" } ], "attributes": [ { "name": "kind", "type": "CIR_ComplexBinOpKind{mul|div}" }, { "name": "range", "type": "CIR_ComplexRangeKind{full|improved|promoted|basic}" }, { "name": "promoted", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$kind $lhs `,` $rhs `range` `(` $range `)` (`promoted` $promoted^)?\n `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.complex.create", "summary": "Create a complex value from its real and imaginary parts", "description": "`cir.complex.create` operation takes two operands that represent the real\n and imaginary part of a complex number, and yields the complex number.\n\n Example:\n\n ```mlir\n %0 = cir.const #cir.fp<1.000000e+00> : !cir.double\n %1 = cir.const #cir.fp<2.000000e+00> : !cir.double\n %2 = cir.complex.create %0, %1 : !cir.complex\n ```", "operands": [ { "name": "real", "type": "CIR_AnyIntOrFloatType" }, { "name": "imag", "type": "CIR_AnyIntOrFloatType" } ], "results": [ { "name": "result", "type": "CIR_ComplexType" } ], "assemblyFormat": "$real `,` $imag\n `:` qualified(type($real)) `->` qualified(type($result)) attr-dict" }, { "name": "cir.complex.imag", "summary": "Extract the imaginary part of a complex value", "description": "`cir.complex.imag` operation takes an operand of `!cir.complex`, `!cir.int`\n `!cir.bool` or `!cir.float`. If the operand is `!cir.complex`, the imag \n part of it will be returned, otherwise a zero value will be returned. \n\n Example:\n\n ```mlir\n %imag = cir.complex.imag %complex : !cir.complex -> !cir.float\n %imag = cir.complex.imag %scalar : !cir.float -> !cir.float\n ```", "operands": [ { "name": "operand", "type": "CIR_AnyComplexOrIntOrBoolOrFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyIntOrBoolOrFloatType" } ], "assemblyFormat": "$operand `:` qualified(type($operand)) `->` qualified(type($result))\n attr-dict" }, { "name": "cir.complex.imag_ptr", "summary": "Derive a pointer to the imaginary part of a complex value", "description": "`cir.complex.imag_ptr` operation takes a pointer operand that points to a\n complex value of type `!cir.complex` and yields a pointer to the imaginary\n part of the operand.\n\n Example:\n\n ```mlir\n %1 = cir.complex.imag_ptr %0 : !cir.ptr> -> !cir.ptr\n ```", "operands": [ { "name": "operand", "type": "CIR_PtrToComplexType" } ], "results": [ { "name": "result", "type": "CIR_PtrToIntOrFloatType" } ], "assemblyFormat": "$operand `:`\n qualified(type($operand)) `->` qualified(type($result)) attr-dict" }, { "name": "cir.complex.real", "summary": "Extract the real part of a complex value", "description": "`cir.complex.real` operation takes an operand of `!cir.complex`, `cir.int`, \n `!cir.bool` or `!cir.float`. If the operand is `!cir.complex`, the real \n part of it will be returned, otherwise the value returned unmodified. \n\n Example:\n\n ```mlir\n %real = cir.complex.real %complex : !cir.complex -> !cir.float\n %real = cir.complex.real %scalar : !cir.float -> !cir.float\n ```", "operands": [ { "name": "operand", "type": "CIR_AnyComplexOrIntOrBoolOrFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyIntOrBoolOrFloatType" } ], "assemblyFormat": "$operand `:` qualified(type($operand)) `->` qualified(type($result))\n attr-dict" }, { "name": "cir.complex.real_ptr", "summary": "Derive a pointer to the real part of a complex value", "description": "`cir.complex.real_ptr` operation takes a pointer operand that points to a\n complex value of type `!cir.complex` and yields a pointer to the real part\n of the operand.\n\n Example:\n\n ```mlir\n %1 = cir.complex.real_ptr %0 : !cir.ptr> -> !cir.ptr\n ```", "operands": [ { "name": "operand", "type": "CIR_PtrToComplexType" } ], "results": [ { "name": "result", "type": "CIR_PtrToIntOrFloatType" } ], "assemblyFormat": "$operand `:`\n qualified(type($operand)) `->` qualified(type($result)) attr-dict" }, { "name": "cir.condition", "summary": "Loop continuation condition.", "description": "The `cir.condition` terminates conditional regions. It takes a single\n `cir.bool` operand and, depending on its value, may branch to different\n regions:\n\n - When in the `cond` region of a `cir.loop`, it continues the loop\n if true, or exits it if false.\n - When in the `ready` region of a `cir.await`, it branches to the `resume`\n region when true, and to the `suspend` region when false.\n\n Example:\n\n ```mlir\n cir.loop for(cond : {\n cir.condition(%arg0) // Branches to `step` region or exits.\n }, step : {\n [...]\n }) {\n [...]\n }\n\n cir.await(user, ready : {\n cir.condition(%arg0) // Branches to `resume` or `suspend` region.\n }, suspend : {\n [...]\n }, resume : {\n [...]\n },)\n ```", "operands": [ { "name": "condition", "type": "CIR_BoolType" } ], "assemblyFormat": "`(` $condition `)` attr-dict" }, { "name": "cir.const", "summary": "Create a CIR constant from a literal attribute", "description": "The `cir.const` operation turns a literal into an SSA value. The data is\n attached to the operation as an attribute.\n\n ```mlir\n %0 = cir.const #cir.int<4> : !u32i\n %1 = cir.const #cir.fp<1.500000e+00> : !cir.float\n %2 = cir.const #cir.ptr : !cir.ptr\n ```", "results": [ { "name": "res", "type": "CIR_AnyType" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value', 'res']>" } ], "assemblyFormat": "$value attr-dict" }, { "name": "cir.continue", "summary": "C/C++ `continue` statement equivalent", "description": "The `cir.continue` operation is used to continue execution to the next\n iteration of a loop. It is only allowed within `cir.loop` regions.", "assemblyFormat": "attr-dict" }, { "name": "cir.copy", "summary": "Copies contents from a CIR pointer to another", "description": "Given two CIR pointers, `src` and `dst`, `cir.copy` will copy the memory\n pointed by `src` to the memory pointed by `dst`.\n\n The amount of bytes copied is inferred from the pointee type. Naturally,\n the pointee type of both `src` and `dst` must match and must implement\n the `DataLayoutTypeInterface`.\n\n Examples:\n\n ```mlir\n // Copying contents from one record to another:\n cir.copy %0 to %1 : !cir.ptr\n ```", "operands": [ { "name": "dst", "type": "CIR_PointerType" }, { "name": "src", "type": "CIR_PointerType" } ], "attributes": [ { "name": "is_volatile", "type": "UnitAttr" }, { "name": "tbaa", "type": "OptionalAttr" } ], "assemblyFormat": "$src `to` $dst (`volatile` $is_volatile^)?\n attr-dict `:` qualified(type($dst))\n (`tbaa` `(` $tbaa^ `)`)?" }, { "name": "cir.copysign", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.cos", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.ctz", "summary": "Get the number of trailing 0-bits in the input", "description": "Compute the number of trailing 0-bits in the input.\n\n The input integer must be an unsigned integer. The `cir.ctz` operation\n returns the number of consecutive 0-bits at the least significant bit\n position in the input.\n\n Zero_poison attribute means this operation invokes undefined behavior if the\n input value is 0.\n\n Example:\n\n ```mlir\n !s32i = !cir.int\n !u32i = !cir.int\n\n // %0 = 0b1000\n %0 = cir.const #cir.int<8> : !u32i\n // %1 will be 3\n %1 = cir.ctz(%0 : !u32i) : !u32i\n ```", "operands": [ { "name": "input", "type": "CIR_UIntOfWidths<[ 16, 32, 64 ]>" } ], "results": [ { "name": "result", "type": "CIR_UIntOfWidths<[ 16, 32, 64 ]>" } ], "attributes": [ { "name": "is_zero_poison", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input (`zero_poison` $is_zero_poison^)?\n `:` type($result) attr-dict" }, { "name": "cir.delete.array", "summary": "Delete address representing an array", "description": "`cir.delete.array` operation deletes an array. For example, `delete[] ptr;`\n will be translated to `cir.delete.array %ptr`.", "operands": [ { "name": "address", "type": "CIR_PointerType" } ], "assemblyFormat": "$address `:` type($address) attr-dict" }, { "name": "cir.derived_class_addr", "summary": "Get the derived class address for a class/struct", "description": "The `cir.derived_class_addr` operaration gets the address of a particular\n derived class given a non-virtual base class pointer. The offset in bytes\n of the base class must be passed in, similar to `cir.base_class_addr`, but\n going into the other direction (In the itanium ABI this means lowering to\n a negative offset).\n\n The operation contains a flag for whether or not the operand may be nullptr.\n That depends on the context and cannot be known by the operation, and that\n information affects how the operation is lowered.\n\n Example:\n ```c++\n class A { int a; };\n class B { int b;\n public:\n A *getAsA();\n };\n class X : public A, public B { int x; };\n\n A *B::getAsA() {\n return static_cast(this);\n ```\n\n leads to\n ```mlir\n %2 = cir.load %0 : !cir.ptr>, !cir.ptr\n %3 = cir.derived_class_addr %2 : !cir.ptr nonnull [4] -> !cir.ptr\n %4 = cir.base_class_addr %3 : !cir.ptr [0] -> !cir.ptr\n cir.return %4\n ```", "operands": [ { "name": "base_addr", "type": "CIR_PointerType" } ], "results": [ { "name": "derived_addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "offset", "type": "IndexAttr" }, { "name": "assume_not_null", "type": "UnitAttr" } ], "assemblyFormat": "$base_addr `:` qualified(type($base_addr))\n (`nonnull` $assume_not_null^)?\n ` ` `[` $offset `]` `->` qualified(type($derived_addr)) attr-dict" }, { "name": "cir.derived_data_member", "summary": "Cast a base class data member pointer to a derived class data member pointer", "description": "The `cir.derived_data_member` operation casts a data member pointer of type\n `T Base::*` to a data member pointer of type `T Derived::*`, where `Base`\n is an accessible non-ambiguous non-virtual base class of `Derived`.\n\n The `offset` parameter gives the offset in bytes of the `Base` base class\n subobject within a `Derived` object.", "operands": [ { "name": "src", "type": "CIR_DataMemberType" } ], "results": [ { "name": "result", "type": "CIR_DataMemberType" } ], "attributes": [ { "name": "offset", "type": "IndexAttr" } ], "assemblyFormat": "$src `:` qualified(type($src))\n ` ` `[` $offset `]` `->` qualified(type($result)) attr-dict" }, { "name": "cir.derived_method", "summary": "Cast a base class pointer-to-member-function to a derived class\n pointer-to-member-function", "description": "The `cir.derived_method` operation casts a pointer-to-member-function of\n type `Ret (Base::*)(Args)` to a pointer-to-member-function of type\n `Ret (Derived::*)(Args)`, where `Base` is a non-virtual base class of\n `Derived`.\n\n The `offset` parameter gives the offset in bytes of the `Base` base class\n subobject within a `Derived` object.\n\n Example:\n\n ```mlir\n %1 = cir.derived_method %0 : !cir.method in !rec_Base> [16] -> !cir.method in !rec_Derived>\n ```", "operands": [ { "name": "src", "type": "CIR_MethodType" } ], "results": [ { "name": "result", "type": "CIR_MethodType" } ], "attributes": [ { "name": "offset", "type": "IndexAttr" } ], "assemblyFormat": "$src `:` qualified(type($src))\n ` ` `[` $offset `]` `->` qualified(type($result)) attr-dict" }, { "name": "cir.do", "summary": "C/C++ do-while loop", "description": "Represents a C/C++ do-while loop. Identical to `cir.while` but the\n condition is evaluated after the body.\n\n Example:\n\n ```mlir\n cir.do {\n cir.break\n ^bb2:\n cir.yield\n } while {\n cir.condition %cond : cir.bool\n }\n ```", "regions": [ { "name": "body", "type": "MinSizedRegion<1>" }, { "name": "cond", "type": "SizedRegion<1>" } ], "assemblyFormat": "$body `while` $cond attr-dict" }, { "name": "cir.dyn_cast", "summary": "Perform dynamic cast on record pointers", "description": "The `cir.dyn_cast` operation models part of the semantics of the\n `dynamic_cast` operator in C++. It can be used to perform 3 kinds of casts\n on record pointers:\n\n - Down-cast, which casts a base class pointer to a derived class pointer;\n - Side-cast, which casts a class pointer to a sibling class pointer;\n - Cast-to-complete, which casts a class pointer to a void pointer.\n\n The input of the operation must be a record pointer. The result of the\n operation is either a record pointer or a void pointer.\n\n The parameter `kind` specifies the semantics of this operation. If its value\n is `ptr`, then the operation models dynamic casts on pointers. Otherwise, if\n its value is `ref`, the operation models dynamic casts on references.\n Specifically:\n\n - When the input pointer is a null pointer value:\n - If `kind` is `ref`, the operation will invoke undefined behavior. A\n sanitizer check will be emitted if sanitizer is on.\n - Otherwise, the operation will return a null pointer value as its result.\n - When the runtime type check fails:\n - If `kind` is `ref`, the operation will throw a `bad_cast` exception.\n - Otherwise, the operation will return a null pointer value as its result.\n\n The `info` argument gives detailed information about the requested dynamic\n cast operation. It is an optional `#cir.dyn_cast_info` attribute that is\n only present when the operation models a down-cast or a side-cast.\n\n The `relative_layout` argument specifies whether the Itanium C++ ABI vtable\n uses relative layout. It is only meaningful when the operation models a\n cast-to-complete operation.\n\n Example:\n\n ```mlir\n %res = cir.dyn_cast ptr %ptr: !cir.ptr -> !cir.ptr\n %res = cir.dyn_cast ptr relative_layout %ptr: !cir.ptr -> !cir.ptr\n ```", "operands": [ { "name": "src", "type": "CIR_PtrToRecordType" } ], "results": [ { "name": "result", "type": "CIR_PtrToAnyOf<[CIR_VoidType, CIR_RecordType]>" } ], "attributes": [ { "name": "kind", "type": "CIR_DynamicCastKind{ptr|ref}" }, { "name": "info", "type": "OptionalAttr" }, { "name": "relative_layout", "type": "UnitAttr" } ], "assemblyFormat": "$kind (`relative_layout` $relative_layout^)? $src \n `:` qualified(type($src)) `->` qualified(type($result)) \n (qualified($info)^)? attr-dict" }, { "name": "cir.eh.inflight_exception", "summary": "Materialize the catch clause formal parameter", "description": "`cir.eh.inflight_exception` returns two values:\n - `exception_ptr`: The exception pointer for the inflight exception\n - `type_id`: pointer to the exception object\n This operation is expected to be the first one basic blocks on the\n exception path out of `cir.try_call` operations.\n\n The `cleanup` attribute indicates that clean up code might run before the\n values produced by this operation are used to gather exception information.\n This helps CIR to pass down more accurate information for LLVM lowering\n to landingpads.", "results": [ { "name": "exception_ptr", "type": "CIR_VoidPtrType" }, { "name": "type_id", "type": "CIR_UInt32" } ], "attributes": [ { "name": "cleanup", "type": "UnitAttr" }, { "name": "sym_type_list", "type": "OptionalAttr>" } ], "assemblyFormat": "(`cleanup` $cleanup^)?\n ($sym_type_list^)?\n attr-dict" }, { "name": "cir.eh.longjmp", "summary": "CIR longjmp operation", "description": "Restore the environment (e.g., stack pointer, instruction pointer,\n signal mask, and other registers) at the time of setjmp() call, by using\n the information saved in `env` by setjmp().\n\n Examples:\n ```mlir\n cir.eh.longjmp %arg0 : !cir.ptr\n ```", "operands": [ { "name": "env", "type": "CIR_PointerType" } ], "assemblyFormat": "$env `:` qualified(type($env)) attr-dict" }, { "name": "cir.eh.setjmp", "summary": "CIR setjmp operation", "description": "Saves call-site information (e.g., stack pointer, instruction\n pointer, signal mask, and other registers) in memory at `env` for use by longjmp(). In this case,\n setjmp() returns 0. Following a successful longjmp(), execution proceeds\n from cir.eh.setjmp with the operation yielding a non-zero value.\n\n The presence of the `builtin` attribute refers to the setjmp() function; the lack of the attribute refers\n to the _setjmp() function.\n\n Examples:\n ```mlir\n // Specify setjmp is builtin.\n %0 = cir.eh.setjmp builtin %arg0 : (!cir.ptr) -> !s32i\n\n // Specify setjmp is not builtin.\n %0 = cir.eh.setjmp %arg0 : (!cir.ptr) -> !s32i\n ```", "operands": [ { "name": "env", "type": "CIR_PointerType" } ], "results": [ { "name": "res", "type": "CIR_SInt32" } ], "attributes": [ { "name": "is_builtin", "type": "UnitAttr" } ], "assemblyFormat": "(`builtin` $is_builtin^)?\n $env `:` functional-type($env, results) attr-dict" }, { "name": "cir.eh.typeid", "summary": "Compute exception type id from it's global type symbol", "description": "Returns the exception type id for a given global symbol representing\n a type.", "results": [ { "name": "type_id", "type": "CIR_UInt32" } ], "attributes": [ { "name": "type_sym", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$type_sym attr-dict" }, { "name": "cir.exp", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.exp2", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.expect", "summary": "Compute whether expression is likely to evaluate to a specified value", "description": "Provides __builtin_expect functionality in Clang IR.\n\n If $prob is not specified, then behaviour is same as __builtin_expect.\n If specified, then behaviour is same as __builtin_expect_with_probability,\n where probability = $prob.", "operands": [ { "name": "val", "type": "CIR_AnyFundamentalIntType" }, { "name": "expected", "type": "CIR_AnyFundamentalIntType" } ], "results": [ { "name": "result", "type": "CIR_AnyFundamentalIntType" } ], "attributes": [ { "name": "prob", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'val', 'expected']>" } ], "assemblyFormat": "`(` $val`,` $expected (`,` $prob^)? `)` `:` type($val) attr-dict" }, { "name": "cir.extract_member", "summary": "Extract the value of a member of a record value", "description": "The `cir.extract_member` operation extracts the value of a particular member\n from the input record. Unlike `cir.get_member` which derives pointers, this\n operation operates on values. It takes a value of record type, and extract\n the value of the specified record member from the input record value.\n\n Currently `cir.extract_member` does not work on unions.\n\n Example:\n\n ```mlir\n // Suppose we have a record with multiple members.\n !s32i = !cir.int\n !s8i = !cir.int\n !record_ty = !cir.record<\"struct.Bar\" {!s32i, !s8i}>\n\n // And suppose we have a value of the record type.\n %0 = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s8i}> : !record_ty\n\n // Extract the value of the second member of the record.\n %1 = cir.extract_member %0[1] : !record_ty -> !s8i\n ```", "operands": [ { "name": "record", "type": "CIRRecordType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "assemblyFormat": "$record `[` $index `]` attr-dict\n `:` qualified(type($record)) `->` qualified(type($result))" }, { "name": "cir.fabs", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.ffs", "summary": "Get the position of the least significant 1-bit of input", "description": "Compute the position of the least significant 1-bit of the input.\n\n The input integer must be a signed integer. The `cir.ffs` operation returns\n one plus the index of the least significant 1-bit of the input signed\n integer. As a special case, if the input integer is 0, `cir.ffs` returns 0.\n\n Example:\n\n ```mlir\n !s32i = !cir.int\n\n // %0 = 0x0010_1000\n %0 = cir.const #cir.int<40> : !s32i\n // #1 will be 4 since the 4th least significant bit is 1.\n %1 = cir.ffs(%0 : !s32i) : !s32i\n ```", "operands": [ { "name": "input", "type": "CIR_SIntOfWidths<[ 32, 64 ]>" } ], "results": [ { "name": "result", "type": "CIR_SIntOfWidths<[ 32, 64 ]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input `:` type($result) attr-dict" }, { "name": "cir.floor", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.fmaximum", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.fmaxnum", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.fminimum", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.fminnum", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.fmod", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.for", "summary": "C/C++ for loop counterpart", "description": "Represents a C/C++ for loop. It consists of three regions:\n\n - `cond`: single block region with the loop's condition. Should be\n terminated with a `cir.condition` operation.\n - `body`: contains the loop body and an arbitrary number of blocks.\n - `step`: single block region with the loop's step.\n\n Example:\n\n ```mlir\n cir.for cond {\n cir.condition(%val)\n } body {\n cir.break\n ^bb2:\n cir.yield\n } step {\n cir.yield\n }\n ```", "regions": [ { "name": "cond", "type": "SizedRegion<1>" }, { "name": "body", "type": "MinSizedRegion<1>" }, { "name": "step", "type": "SizedRegion<1>" } ], "assemblyFormat": "`:` `cond` $cond\n `body` $body\n `step` $step\n attr-dict" }, { "name": "cir.frame_address", "summary": "The frame address of the current function, or of one of its callers", "description": "Represents call to builtin function ` __builtin_frame_address` in CIR.\n This builtin function returns the frame address of the current function,\n or of one of its callers. The frame is the area on the stack that holds\n local variables and saved registers. The frame address is normally the\n address of the first word pushed on to the stack by the function.\n However, the exact definition depends upon the processor and the calling\n convention. If the processor has a dedicated frame pointer register, and\n the function has a frame, then __builtin_frame_address returns the value of\n the frame pointer register.\n\n The `level` argument is number of frames to scan up the call stack.\n For instance, value of 0 yields the frame address of the current function,\n value of 1 yields the frame address of the caller of the current function,\n and so forth.\n\n Examples:\n\n ```mlir\n %p = frame_address(%level) -> !cir.ptr\n ```", "operands": [ { "name": "level", "type": "CIR_UInt32" } ], "results": [ { "name": "result", "type": "CIR_VoidPtrType" } ], "assemblyFormat": "`(` $level `)` attr-dict" }, { "name": "cir.free.exception", "summary": "Frees an exception according to Itanium ABI", "description": "Implements a slightly higher level version of:\n `void __cxa_free_exception(void *thrown_exception);`\n\n Example:\n\n ```mlir\n %0 = cir.alloc.exception 16 -> !cir.ptr\n %1 = cir.get_global @d2 : !cir.ptr\n cir.try synthetic cleanup {\n cir.call exception @_ZN7test2_DC1ERKS_(%0, %1) : (!cir.ptr, !cir.ptr) -> () cleanup {\n %2 = cir.cast bitcast %0 : !cir.ptr -> !cir.ptr\n cir.free.exception %2\n cir.yield\n }\n ...\n }\n ```", "operands": [ { "name": "ptr", "type": "CIR_VoidPtrType" } ], "assemblyFormat": "$ptr attr-dict" }, { "name": "cir.func", "summary": "Declare or define a function", "description": "Similar to `mlir::FuncOp` built-in:\n > Operations within the function cannot implicitly capture values defined\n > outside of the function, i.e. Functions are `IsolatedFromAbove`. All\n > external references must use function arguments or attributes that establish\n > a symbolic connection (e.g. symbols referenced by name via a string\n > attribute like SymbolRefAttr). An external function declaration (used when\n > referring to a function declared in some other module) has no body. While\n > the MLIR textual form provides a nice inline syntax for function arguments,\n > they are internally represented as “block arguments” to the first block in\n > the region.\n >\n > Only dialect attribute names may be specified in the attribute dictionaries\n > for function arguments, results, or the function itself.\n\n The function linkage information is specified by `linkage`, as defined by\n `GlobalLinkageKind` attribute.\n\n The `calling_conv` attribute specifies the calling convention of the function.\n The default calling convention is `CallingConv::C`.\n\n A compiler builtin function must be marked as `builtin` for further\n processing when lowering from CIR.\n\n The `coroutine` keyword is used to mark coroutine function, which requires\n at least one `cir.await` instruction to be used in its body.\n\n The `lambda` translates to a C++ `operator()` that implements a lambda, this\n allow callsites to make certain assumptions about the real function nature\n when writing analysis. The verifier should, but do act on this keyword yet.\n\n The `no_proto` keyword is used to identify functions that were declared\n without a prototype and, consequently, may contain calls with invalid\n arguments and undefined behavior.\n\n The `extra_attrs`, which is an aggregate of function-specific attributes is\n required and mandatory to describle additional attributes that are not listed\n above. Though mandatory, the prining of the attribute can be omitted if it is\n empty.\n\n The `global_ctor` indicates whether a function should execute before `main()`\n function, as specified by `__attribute__((constructor))`. A execution priority\n can also be specified `global_ctor()`. Similarly, for global destructors\n both `global_dtor` and `global_dtor()` are available.\n\n Example:\n\n ```mlir\n // External function definitions.\n cir.func @abort()\n\n // A function with internal linkage.\n cir.func internal @count(%x: i64) -> (i64)\n return %x : i64\n }\n\n // Linkage information\n cir.func linkonce_odr @some_method(...)\n\n // Calling convention information\n cir.func @another_func(...) cc(spir_kernel) extra(#fn_attr)\n\n // Builtin function\n cir.func builtin @__builtin_coro_end(!cir.ptr, !cir.bool) -> !cir.bool\n\n // Coroutine\n cir.func coroutine @_Z10silly_taskv() -> !CoroTask {\n ...\n cir.await(...)\n ...\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "global_visibility", "type": "CIR_VisibilityAttr{default|hidden|protected}" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "builtin", "type": "UnitAttr" }, { "name": "coroutine", "type": "UnitAttr" }, { "name": "inline_kind", "type": "OptionalAttr" }, { "name": "lambda", "type": "UnitAttr" }, { "name": "no_proto", "type": "UnitAttr" }, { "name": "opt_none", "type": "UnitAttr" }, { "name": "cold", "type": "UnitAttr" }, { "name": "dso_local", "type": "UnitAttr" }, { "name": "linkage", "type": "DefaultValuedAttr" }, { "name": "calling_conv", "type": "DefaultValuedAttr" }, { "name": "extra_attrs", "type": "CIR_ExtraFuncAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "comdat", "type": "UnitAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "aliasee", "type": "OptionalAttr" }, { "name": "global_ctor_priority", "type": "CIR_OptionalPriorityAttr" }, { "name": "global_dtor_priority", "type": "CIR_OptionalPriorityAttr" }, { "name": "annotations", "type": "OptionalAttr" }, { "name": "cxx_special_member", "type": "OptionalAttr" }, { "name": "ast", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "cir.get_bitfield", "summary": "Get a bitfield", "description": "The `cir.get_bitfield` operation provides a load-like access to\n a bit field of a record.\n\n It expects a name if a bit field, a pointer to a storage in the\n base record, a type of the storage, a name of the bitfield,\n a size the bit field, an offset of the bit field and a sign.\n\n A unit attribute `volatile` can be used to indicate a volatile load of the\n bitfield.\n\n Example:\n Suppose we have a struct with multiple bitfields stored in\n different storages. The `cir.get_bitfield` operation gets the value\n of the bitfield\n ```C++\n typedef struct {\n int a : 4;\n int b : 27;\n int c : 17;\n int d : 2;\n int e : 15;\n } S;\n\n int load_bitfield(S& s) {\n return s.d;\n }\n ```\n\n ```mlir\n // 'd' is in the storage with the index 1\n !record_type = !cir.record, !cir.int, !cir.int} #cir.record.decl.ast>\n #bfi_d = #cir.bitfield_info\n\n %2 = cir.load %0 : !cir.ptr>, !cir.ptr\n %3 = cir.get_member %2[1] {name = \"d\"} : !cir.ptr -> !cir.ptr\n %4 = cir.get_bitfield align(4) (#bfi_d, %3 : !cir.ptr) -> !s32i\n ```", "operands": [ { "name": "addr", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "attributes": [ { "name": "bitfield_info", "type": "CIR_BitfieldInfoAttr" }, { "name": "alignment", "type": "DefaultValuedOptionalAttr" }, { "name": "is_volatile", "type": "UnitAttr" } ], "assemblyFormat": "(`align` `(` $alignment^ `)`)?\n `(`$bitfield_info `,` $addr attr-dict `:`\n qualified(type($addr)) `)` `->` type($result)" }, { "name": "cir.get_element", "summary": "Get the address of an array element", "description": "The `cir.get_element` operation gets the address of a particular element\n from the `base` array.\n\n It expects a pointer to the `base` array and the `index` of the element.\n\n Example:\n ```mlir\n // Suppose we have a array.\n !s32i = !cir.int\n !arr_ty = !cir.array\n\n // Get the address of the element at index 1.\n %elem_1 = cir.get_element %0[1] : (!cir.ptr, !s32i) -> !cir.ptr\n\n // Get the address of the element at index %i.\n %i = ...\n %elem_i = cir.get_element %0[%i] : (!cir.ptr, !s32i) -> !cir.ptr\n ```", "operands": [ { "name": "base", "type": "CIR_PtrToArray" }, { "name": "index", "type": "CIR_AnyFundamentalIntType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "assemblyFormat": "$base `[` $index `]` `:` `(` qualified(type($base)) `,` qualified(type($index)) `)`\n `->` qualified(type($result)) attr-dict" }, { "name": "cir.get_global", "summary": "Get the address of a global variable", "description": "The `cir.get_global` operation retrieves the address pointing to a\n named global variable. If the global variable is marked constant, writing\n to the resulting address (such as through a `cir.store` operation) is\n undefined. Resulting type must always be a `!cir.ptr<...>` type with the\n same address space as the global variable.\n\n Addresses of thread local globals can only be retrieved if this operation\n is marked `thread_local`, which indicates the address isn't constant.\n\n Example:\n ```mlir\n %x = cir.get_global @foo : !cir.ptr\n ...\n %y = cir.get_global thread_local @batata : !cir.ptr\n ...\n cir.global external addrspace(offload_global) @gv = #cir.int<0> : !s32i\n %z = cir.get_global @gv : !cir.ptr\n ```", "results": [ { "name": "addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" }, { "name": "tls", "type": "UnitAttr" } ], "assemblyFormat": "(`thread_local` $tls^)?\n $name `:` qualified(type($addr)) attr-dict" }, { "name": "cir.get_member", "summary": "Get the address of a member of a record", "description": "The `cir.get_member` operation gets the address of a particular named\n member from the input record.\n\n It expects a pointer to the base record as well as the name of the member\n and its field index.\n\n Example:\n ```mlir\n // Suppose we have a record with multiple members.\n !s32i = !cir.int\n !s8i = !cir.int\n !record_ty = !cir.record<\"struct.Bar\" {!s32i, !s8i}>\n\n // Get the address of the member at index 1.\n %1 = cir.get_member %0[1] {name = \"i\"} : (!cir.ptr) -> !cir.ptr\n ```", "operands": [ { "name": "addr", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "index", "type": "I64Attr" } ], "assemblyFormat": "$addr `[` $index `]` attr-dict\n `:` qualified(type($addr)) `->` qualified(type($result))" }, { "name": "cir.get_method", "summary": "Resolve a method to a function pointer as callee", "description": "The `cir.get_method` operation takes a method and an object as input, and\n yields a function pointer that points to the actual function corresponding\n to the input method. The operation also applies any necessary adjustments to\n the input object pointer for calling the method and yields the adjusted\n pointer.\n\n This operation is generated when calling a method through a pointer-to-\n member-function in C++:\n\n ```cpp\n // Foo *object;\n // int arg;\n // void (Foo::*method)(int);\n\n (object->*method)(arg);\n ```\n\n The code above will generate CIR similar as:\n\n ```mlir\n // %object = ...\n // %arg = ...\n // %method = ...\n %callee, %this = cir.get_method %method, %object\n cir.call %callee(%this, %arg)\n ```\n\n The method type must match the callee type. That is:\n - The return type of the method must match the return type of the callee.\n - The first parameter of the callee must have type `!cir.ptr`.\n - Types of other parameters of the callee must match the parameters of the\n method.", "operands": [ { "name": "method", "type": "CIR_MethodType" }, { "name": "object", "type": "CIR_PtrToRecordType" } ], "results": [ { "name": "callee", "type": "CIR_PtrToFunc" }, { "name": "adjusted_this", "type": "CIR_VoidPtrType" } ], "assemblyFormat": "$method `,` $object\n `:` `(` qualified(type($method)) `,` qualified(type($object)) `)`\n `->` `(` qualified(type($callee)) `,` qualified(type($adjusted_this)) `)`\n attr-dict" }, { "name": "cir.get_runtime_member", "summary": "Get the address of a member of a record", "description": "The `cir.get_runtime_member` operation gets the address of a member from\n the input record. The target member is given by a value of type\n `!cir.data_member` (i.e. a pointer-to-data-member value).\n\n This operation differs from `cir.get_member` in when the target member can\n be determined. For the `cir.get_member` operation, the target member is\n specified as a constant index so the member it returns access to is known\n when the operation is constructed. For the `cir.get_runtime_member`\n operation, the target member is given through a pointer-to-data-member\n value which is unknown until the program being compiled is executed. In\n other words, `cir.get_member` represents a normal member access through the\n `.` operator in C/C++:\n\n ```cpp\n struct Foo { int x; };\n Foo f;\n (void)f.x; // cir.get_member\n ```\n\n And `cir.get_runtime_member` represents a member access through the `.*` or\n the `->*` operator in C++:\n\n ```cpp\n struct Foo { int x; }\n Foo f;\n Foo *p;\n int Foo::*member;\n\n (void)f.*member; // cir.get_runtime_member\n (void)f->*member; // cir.get_runtime_member\n ```\n\n This operation expects a pointer to the base record as well as the pointer\n to the target member.", "operands": [ { "name": "addr", "type": "CIR_PtrToRecordType" }, { "name": "member", "type": "CIR_DataMemberType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "assemblyFormat": "$addr `[` $member `:` qualified(type($member)) `]` attr-dict\n `:` qualified(type($addr)) `->` qualified(type($result))" }, { "name": "cir.global", "summary": "Declares or defines a global variable", "description": "The `cir.global` operation declares or defines a named global variable.\n\n The backing memory for the variable is allocated statically and is\n described by the type of the variable.\n\n The operation is a declaration if no `inital_value` is\n specified, else it is a definition.\n\n The global variable can also be marked constant using the\n `constant` unit attribute. Writing to such constant global variables is\n undefined.\n\n The `linkage` tracks C/C++ linkage types, currently very similar to LLVM's.\n Symbol visibility in `sym_visibility` is defined in terms of MLIR's visibility\n and verified to be in accordance to `linkage`.\n\n `visibility_attr` is defined in terms of CIR's visibility.\n\n Example:\n\n ```mlir\n // Public and constant variable with initial value.\n cir.global public constant @c : i32 = 4;\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "global_visibility", "type": "DefaultValuedAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_type", "type": "TypeAttr" }, { "name": "linkage", "type": "CIR_GlobalLinkageKind{external|available_externally|linkonce|linkonce_odr|weak|weak_odr|appending|internal|cir_private|extern_weak|common}" }, { "name": "addr_space", "type": "OptionalAttr" }, { "name": "tls_model", "type": "OptionalAttr" }, { "name": "initial_value", "type": "OptionalAttr" }, { "name": "comdat", "type": "UnitAttr" }, { "name": "constant", "type": "UnitAttr" }, { "name": "dso_local", "type": "UnitAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "ast", "type": "OptionalAttr" }, { "name": "section", "type": "OptionalAttr" }, { "name": "annotations", "type": "OptionalAttr" } ], "regions": [ { "name": "ctorRegion", "type": "AnyRegion" }, { "name": "dtorRegion", "type": "AnyRegion" } ], "assemblyFormat": "($sym_visibility^)?\n (`` $global_visibility^)?\n (`constant` $constant^)?\n $linkage\n (`comdat` $comdat^)?\n ($tls_model^)?\n (`dso_local` $dso_local^)?\n (` ` custom($addr_space)^ )?\n $sym_name\n custom($sym_type, $initial_value, $ctorRegion, $dtorRegion)\n ($annotations^)?\n attr-dict" }, { "name": "cir.goto", "description": "Transfers control to the specified `label`. This requires a corresponding\n `cir.label` to exist and is used by to represent source level `goto`s\n that jump across region boundaries. Alternatively, `cir.br` is used to\n construct goto's that don't violate such boundaries.\n\n `cir.goto` is completely symbolic (i.e. it \"jumps\" on a label that isn't\n yet materialized) and should be taken into account by passes and analysis\n when deciding if it's safe to make some assumptions about a given region\n or basic block.\n\n Example:\n ```C++\n int test(int x) {\n if (x)\n goto label;\n {\n x = 10;\n label:\n return x;\n }\n }\n ```\n\n ```mlir\n cir.scope { // REGION #1\n %2 = cir.load %0 : !cir.ptr, !s32i\n %3 = cir.cast int_to_bool %2 : !s32i -> !cir.bool\n cir.if %3 {\n cir.goto \"label\"\n }\n }\n cir.scope { // REGION #2\n %2 = cir.const #cir.int<10> : !s32i\n cir.store %2, %0 : !s32i, !cir.ptr\n cir.br ^bb1\n ^bb1: // pred: ^bb0\n cir.label \"label\"\n %3 = cir.load %0 : !cir.ptr, !s32i\n cir.store %3, %1 : !s32i, !cir.ptr\n %4 = cir.load %1 : !cir.ptr, !s32i\n cir.return %4 : !s32i\n }\n cir.unreachable\n ```", "attributes": [ { "name": "label", "type": "StrAttr" } ], "assemblyFormat": "$label attr-dict" }, { "name": "cir.if", "summary": "The if-then-else operation", "description": "The `cir.if` operation represents an if-then-else construct for\n conditionally executing two regions of code. The operand is a `cir.bool`\n type.\n\n Examples:\n\n ```mlir\n cir.if %b {\n ...\n } else {\n ...\n }\n\n cir.if %c {\n ...\n }\n\n cir.if %c {\n ...\n cir.br ^a\n ^a:\n cir.yield\n }\n ```\n\n `cir.if` defines no values and the 'else' can be omitted. The if/else\n regions must be terminated. If the region has only one block, the terminator\n can be left out, and `cir.yield` terminator will be inserted implictly.\n Otherwise, the region must be explicitly terminated.", "operands": [ { "name": "condition", "type": "CIR_BoolType" } ], "regions": [ { "name": "thenRegion", "type": "AnyRegion" }, { "name": "elseRegion", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "cir.indirectbr", "summary": "Indirect branch", "description": "The `cir.indirectbr` operation represents an indirect branch to one of\n several possible successor blocks. The target block is computed from\n the value of the given address operand.\n\n This operation is typically generated when handling constructs like\n the GCC extension `&&label` combined with an indirect `goto *ptr;`.\n\n The `poison` attribute is used to mark an `indirectbr` that was created\n but is known to be invalid — for instance, when a label address was\n taken but no indirect branch was ever emitted.\n\n Example:\n\n ```mlir\n %0 = cir.alloca !cir.ptr, !cir.ptr>, [\"ptr\", init]\n %1 = cir.blockaddress <@A, \"A\"> -> !cir.ptr\n cir.store align(8) %1, %0 : !cir.ptr, !cir.ptr>\n %2 = cir.load align(8) %0 : !cir.ptr>, !cir.ptr\n cir.br ^bb1(%2 : !cir.ptr)\n ^bb1(%3: !cir.ptr):\n cir.indirectbr %3 : , [\n ^bb2\n ]\n ```\n or with a poison:\n\n ```mlir\n cir.indirectbr %0 poison : , [\n ^bb3,\n ^bb2\n ]\n ```", "operands": [ { "name": "addr", "type": "CIR_VoidPtrType" }, { "name": "succOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "poison", "type": "UnitAttr" }, { "name": "indbr_operand_segments", "type": "DenseI32ArrayAttr" } ], "successors": [ { "name": "successors", "type": "VariadicSuccessor" } ], "assemblyFormat": "$addr ( `poison` $poison^ )? `:` type($addr) `,`\n custom(ref(type($addr)),\n $successors,\n $succOperands,\n type($succOperands))\n attr-dict" }, { "name": "cir.insert_member", "summary": "Overwrite the value of a member of a record value", "description": "The `cir.insert_member` operation overwrites the value of a particular\n member in the input record value, and returns the modified record value. The\n result of this operation is equal to the input record value, except for the\n member specified by `index_attr` whose value is equal to the given value.\n\n This operation is named after the LLVM instruction `insertvalue`.\n\n Currently `cir.insert_member` does not work on unions.\n\n Example:\n\n ```mlir\n // Suppose we have a record with multiple members.\n !s32i = !cir.int\n !s8i = !cir.int\n !record_ty = !cir.record<\"struct.Bar\" {!s32i, !s8i}>\n\n // And suppose we have a value of the record type.\n %0 = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s8i}> : !record_ty\n // %0 is {1, 2}\n\n // Overwrite the second member of the record value.\n %1 = cir.const #cir.int<3> : !s8i\n %2 = cir.insert_member %0[1], %1 : !record_ty, !s8i\n // %2 is {1, 3}\n ```", "operands": [ { "name": "record", "type": "CIRRecordType" }, { "name": "value", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIRRecordType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['record', 'result']>" } ], "assemblyFormat": "$record `[` $index `]` `,` $value attr-dict\n `:` qualified(type($record)) `,` qualified(type($value))" }, { "name": "cir.invariant_group", "summary": "Start an invariant group", "description": "The `cir.invariant_group` operation takes a single pointer value as argument\n and returns the same pointer value with fresh [invariant group] information.\n All loads and stores that access the returned pointer value are presumed by\n the optimizer to load or store the same value.\n\n [invariant group]: https://llvm.org/docs/LangRef.html#invariant-group-metadata\n\n This operation is not emitted during CIRGen. Instead, it is created when\n hoisting constant alloca operations to the entry block of a function. This\n operation effectively marks the syntactic scope of the constant local\n variable represented by the hosited alloca operation, and it allows for\n better LLVMIR generation with potentially more optimizations.\n\n For example, if we have the following CIR before alloca hoisting:\n\n ```mlir\n cir.func @foo() {\n cir.scope {\n %0 = cir.alloca !s32i : !cir.ptr\n use(%0)\n }\n }\n ```\n\n After alloca hoisting:\n\n ```mlir\n cir.func @foo() {\n %0 = cir.alloca !s32i : !cir.ptr\n cir.scope {\n %1 = cir.invariant_group %0 : !cir.ptr\n use(%1)\n }\n }\n ```\n\n During LLVMIR lowering, load and store operations whose pointer operand\n comes from `cir.invariant_group` are lowered to corresponding LLVM\n instructions with invariant group metadata attached.", "operands": [ { "name": "ptr", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$ptr `:` type($result) attr-dict" }, { "name": "cir.is_constant", "description": "Returns `true` if the argument is known to be a compile-time constant\n otherwise returns 'false'.", "operands": [ { "name": "val", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_BoolType" } ], "assemblyFormat": "`(` $val `:` type($val) `)` `:` type($result) attr-dict" }, { "name": "cir.is_fp_class", "summary": "Corresponding to the `__builtin_fpclassify` builtin function in clang", "description": "The `cir.is_fp_class` operation takes a floating-point value as its first\n argument and a bitfield of flags as its second argument. The operation\n returns a boolean value indicating whether the floating-point value\n satisfies the given flags.\n\n The flags must be a compile time constant and the values are:\n\n | Bit # | floating-point class |\n | -------- | ------- |\n | 0 | Signaling NaN |\n | 1 | Quiet NaN |\n | 2 | Negative infinity |\n | 3 | Negative normal |\n | 4 | Negative subnormal |\n | 5 | Negative zero |\n | 6 | Positive zero |\n | 7 | Positive subnormal |\n | 8 | Positive normal |\n | 9 | Positive infinity |", "operands": [ { "name": "src", "type": "CIR_AnyFloatType" } ], "results": [ { "name": "result", "type": "CIR_BoolType" } ], "attributes": [ { "name": "flags", "type": "I32Attr" } ], "assemblyFormat": "$src `,` $flags `:` functional-type($src, $result) attr-dict" }, { "name": "cir.label", "description": "An identifier which may be referred by cir.goto operation", "attributes": [ { "name": "label", "type": "StrAttr" } ], "assemblyFormat": "$label attr-dict" }, { "name": "cir.libc.memchr", "summary": "libc's `memchr`", "description": "Search for `pattern` in data range from `src` to `src` + `len`.\n provides a bound to the search in `src`. `result` is a pointer to found\n `pattern` or a null pointer.\n\n Examples:\n\n ```mlir\n %p = cir.libc.memchr(%src, %pattern, %len) -> !cir.ptr\n ```", "operands": [ { "name": "src", "type": "CIR_VoidPtrType" }, { "name": "pattern", "type": "CIR_SInt32" }, { "name": "len", "type": "CIR_UInt64" } ], "results": [ { "name": "result", "type": "CIR_VoidPtrType" } ], "assemblyFormat": "`(`\n $src `,` $pattern `,` $len `)` attr-dict" }, { "name": "cir.libc.memcpy", "summary": "Equivalent to libc's `memcpy`", "description": "Given two CIR pointers, `src` and `dst`, `cir.libc.memcpy` will copy `len`\n bytes from the memory pointed by `src` to the memory pointed by `dst`.\n\n While `cir.copy` is meant to be used for implicit copies in the code where\n the length of the copy is known, `cir.memcpy` copies only from and to void\n pointers, requiring the copy length to be passed as an argument.\n\n Examples:\n\n ```mlir\n // Copying 2 bytes from one array to a record:\n %2 = cir.const #cir.int<2> : !u32i\n cir.libc.memcpy %2 bytes from %arr to %record : !cir.ptr -> !cir.ptr\n ```", "operands": [ { "name": "dst", "type": "CIR_VoidPtrType" }, { "name": "src", "type": "CIR_VoidPtrType" }, { "name": "len", "type": "CIR_AnyFundamentalUIntType" } ], "traits": [ { "type": "AllTypesMatch<['dst', 'src']>" } ], "assemblyFormat": "$len `bytes` `from` $src `to` $dst attr-dict\n `:` type($len) `` `,` qualified(type($src)) `->` qualified(type($dst))" }, { "name": "cir.libc.memmove", "summary": "Equivalent to libc's `memmove`", "description": "Given two CIR pointers, `src` and `dst`, `cir.libc.memmove` will copy `len`\n bytes from the memory pointed by `src` to the memory pointed by `dst`.\n\n similiar to `cir.libc.memcpy` but accounts for overlapping memory.\n\n Examples:\n\n ```mlir\n // Copying 2 bytes from one array to a record:\n %2 = cir.const #cir.int<2> : !u32i\n cir.libc.memmove %2 bytes from %arr to %record : !cir.ptr, !u64i\n ```", "operands": [ { "name": "dst", "type": "CIR_VoidPtrType" }, { "name": "src", "type": "CIR_VoidPtrType" }, { "name": "len", "type": "CIR_AnyFundamentalUIntType" } ], "traits": [ { "type": "AllTypesMatch<['dst', 'src']>" } ], "assemblyFormat": "$len `bytes` `from` $src `to` $dst attr-dict\n `:` qualified(type($dst)) `,` type($len)" }, { "name": "cir.libc.memset", "summary": "Equivalent to libc's `memset`", "description": "Given the CIR pointer, `dst`, `cir.libc.memset` will set the first `len`\n bytes of the memory pointed by `dst` to the specified `val`.\n\n Examples:\n\n ```mlir\n // Set 2 bytes from a record to 0:\n %2 = cir.const #cir.int<2> : !u32i\n %3 = cir.const #cir.int<0> : !u32i\n %zero = cir.cast integral %3 : !s32i -> !u8i\n cir.libc.memset %2 bytes from %record set to %zero : !cir.ptr, !s32i, !u64i\n ```", "operands": [ { "name": "dst", "type": "CIR_VoidPtrType" }, { "name": "val", "type": "CIR_SInt32" }, { "name": "len", "type": "CIR_AnyFundamentalUIntType" } ], "assemblyFormat": "$len `bytes` `from` $dst `set` `to` $val attr-dict\n `:` qualified(type($dst)) `,` type($val) `,` type($len)" }, { "name": "cir.linker_options", "summary": "Options to pass to the linker when the object file is linked", "description": "Pass the given options to the linker when the resulting object file\n is linked.\n This is used extensively on Windows to determine the C runtime that the\n object files should link against.\n\n Examples:\n ```mlir\n // Link against the MSVC static threaded CRT.\n cir.linker_options [\"/DEFAULTLIB:\", \"libcmt\"]\n\n // Link against aarch64 compiler-rt builtins\n cir.linker_options [\"-l\", \"clang_rt.builtins-aarch64\"]\n ```", "attributes": [ { "name": "options", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$options attr-dict" }, { "name": "cir.llrint", "summary": "Builtin function that takes a floating-point value as input and produces an\n integral value as output.", "operands": [ { "name": "src", "type": "CIR_AnyFloatType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "assemblyFormat": "$src `:` type($src) `->` type($result) attr-dict" }, { "name": "cir.llround", "summary": "Builtin function that takes a floating-point value as input and produces an\n integral value as output.", "operands": [ { "name": "src", "type": "CIR_AnyFloatType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "assemblyFormat": "$src `:` type($src) `->` type($result) attr-dict" }, { "name": "cir.llvm.intrinsic", "summary": "Call to llvm intrinsic functions that is not defined in CIR", "description": "`cir.llvm.intrinsic` operation represents a call-like expression which has\n return type and arguments that maps directly to a llvm intrinsic.\n It only records intrinsic `intrinsic_name`.", "operands": [ { "name": "arg_ops", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "intrinsic_name", "type": "StrAttr" } ], "assemblyFormat": "$intrinsic_name $arg_ops `:` functional-type($arg_ops, $result) attr-dict" }, { "name": "cir.load", "summary": "Load value from memory adddress", "description": "`cir.load` reads a value (lvalue to rvalue conversion) given an address\n backed up by a `cir.ptr` type. A unit attribute `deref` can be used to\n mark the resulting value as used by another operation to dereference\n a pointer. A unit attribute `volatile` can be used to indicate a volatile\n loading. Load can be marked atomic by using `atomic()`.\n\n `align` can be used to specify an alignment that's different from the\n default, which is computed from `result`'s type ABI data layout.\n\n Example:\n\n ```mlir\n\n // Read from local variable, address in %0.\n %1 = cir.load %0 : !cir.ptr, i32\n\n // Load address from memory at address %0. %3 is used by at least one\n // operation that dereferences a pointer.\n %3 = cir.load deref %0 : !cir.ptr>\n\n // Perform a volatile load from address in %0.\n %4 = cir.load volatile %0 : !cir.ptr, i32\n\n // Others\n %x = cir.load align(16) syncscope(single_thread) atomic(seq_cst)\n %0 : !cir.ptr, i32\n ```", "operands": [ { "name": "addr", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "isDeref", "type": "UnitAttr" }, { "name": "is_volatile", "type": "UnitAttr" }, { "name": "is_nontemporal", "type": "UnitAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "sync_scope", "type": "OptionalAttr" }, { "name": "mem_order", "type": "OptionalAttr" }, { "name": "tbaa", "type": "OptionalAttr" } ], "traits": [ { "type": "TypesMatchWith<'addr', 'result', 'mlir::cast($_self).getPointee()'>" } ], "assemblyFormat": "(`deref` $isDeref^)?\n (`volatile` $is_volatile^)?\n (`nontemporal` $is_nontemporal^)?\n (`align` `(` $alignment^ `)`)?\n (`syncscope` `(` $sync_scope^ `)`)?\n (`atomic` `(` $mem_order^ `)`)?\n $addr `:` qualified(type($addr)) `,` type($result) attr-dict\n (`tbaa` `(` $tbaa^ `)`)?" }, { "name": "cir.log", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.log10", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.log2", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.lrint", "summary": "Builtin function that takes a floating-point value as input and produces an\n integral value as output.", "operands": [ { "name": "src", "type": "CIR_AnyFloatType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "assemblyFormat": "$src `:` type($src) `->` type($result) attr-dict" }, { "name": "cir.lround", "summary": "Builtin function that takes a floating-point value as input and produces an\n integral value as output.", "operands": [ { "name": "src", "type": "CIR_AnyFloatType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "assemblyFormat": "$src `:` type($src) `->` type($result) attr-dict" }, { "name": "cir.memcpy_inline", "summary": "Memory copy with constant length without callingany external function", "description": "Given two CIR pointers, `src` and `dst`, `memcpy_inline` will copy `len`\n bytes from the memory pointed by `src` to the memory pointed by `dst`.\n\n Unlike `cir.libc.memcpy`, this Op guarantees that no external functions\n are called, and length of copied bytes is a constant.\n\n Examples:\n\n ```mlir\n // Copying 2 bytes from one array to a record:\n cir.memcpy_inline 2 bytes from %arr to %record : !cir.ptr -> !cir.ptr\n ```", "operands": [ { "name": "dst", "type": "CIR_VoidPtrType" }, { "name": "src", "type": "CIR_VoidPtrType" } ], "attributes": [ { "name": "len", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['dst', 'src']>" } ], "assemblyFormat": "$len `bytes` `from` $src `to` $dst attr-dict\n `:` qualified(type($src)) `->` qualified(type($dst))" }, { "name": "cir.memset_inline", "summary": "Fill a block of memory with constant length without callingany external function", "description": "Given the CIR pointer, `dst`, `cir.memset_inline` will set the first `len`\n bytes of the memory pointed by `dst` to the specified `val`.\n\n The `len` argument must be a constant integer argument specifying the number\n of bytes to fill.\n\n Examples:\n\n ```mlir\n // Set 2 bytes from a record to 0\n cir.memset_inline 2 bytes from %record set to %zero : !cir.ptr, !s32i\n ```", "operands": [ { "name": "dst", "type": "CIR_VoidPtrType" }, { "name": "val", "type": "CIR_SInt32" } ], "attributes": [ { "name": "len", "type": "I64Attr" } ], "assemblyFormat": "$len `bytes` `from` $dst `set` `to` $val attr-dict\n `:` qualified(type($dst)) `,` type($val)" }, { "name": "cir.nearbyint", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.objsize", "summary": "Implements llvm.objsize builtin.", "description": "The `cir.objsize` operation models the behavior of the `llvm.objectsize`\n builtins in Clang. It returns the number of accessible bytes past ptr.\n\n The `kind` argument determines whether `cir.objsize` returns 0 (if\n true) or -1 (if false) when the object size is unknown. Corresponds to \n `llvm.objectsize`'s `min` argument.\n \n The `dynamic` attribute determines if the value should be evaluated at\n runtime. Corresponds to `llvm.objectsize`'s `dynamic` argument.\n\n Example:\n\n ```mlir\n %size = cir.objsize min %ptr : !cir.ptr -> i64\n %dsize = cir.objsize max dynamic %ptr : !cir.ptr -> i64\n ```", "operands": [ { "name": "ptr", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_AnyFundamentalIntType" } ], "attributes": [ { "name": "min", "type": "UnitAttr" }, { "name": "dynamic", "type": "UnitAttr" } ], "assemblyFormat": "(`min` $min^) : (`max`)?\n (`dynamic` $dynamic^)?\n $ptr `:` qualified(type($ptr)) `->` qualified(type($result)) attr-dict" }, { "name": "cir.parity", "summary": "Get the parity of input", "description": "Compute the parity of the input. The parity of an integer is the number of\n 1-bits in it modulo 2.\n\n The input must be an unsigned integer.\n\n Example:\n\n ```mlir\n !s32i = !cir.int\n !u32i = !cir.int\n\n // %0 = 0x0110_1000\n %0 = cir.const #cir.int<104> : !u32i\n // %1 will be 1 since there are 3 1-bits in %0\n %1 = cir.parity(%0 : !u32i) : !u32i\n ```", "operands": [ { "name": "input", "type": "CIR_UIntOfWidths<[ 32, 64 ]>" } ], "results": [ { "name": "result", "type": "CIR_UIntOfWidths<[ 32, 64 ]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input `:` type($result) attr-dict" }, { "name": "cir.popcount", "summary": "Get the number of 1-bits in input", "description": "Compute the number of 1-bits in the input.\n\n The input must be an unsigned integer.\n\n Example:\n\n ```mlir\n !u32i = !cir.int\n\n // %0 = 0x0110_1000\n %0 = cir.const #cir.int<104> : !u32i\n // %1 will be 3 since there are 3 1-bits in %0\n %1 = cir.popcount(%0 : !u32i) : !u32i\n ```", "operands": [ { "name": "input", "type": "CIR_UIntOfWidths<[ 16, 32, 64 ]>" } ], "results": [ { "name": "result", "type": "CIR_UIntOfWidths<[ 16, 32, 64 ]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input `:` type($result) attr-dict" }, { "name": "cir.pow", "summary": "libc builtin equivalent ignoring floating-point exceptions and errno.", "operands": [ { "name": "lhs", "type": "CIR_AnyFloatOrVecOfFloatType" }, { "name": "rhs", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) attr-dict" }, { "name": "cir.prefetch", "summary": "prefetch operation", "description": "The `cir.prefetch` op prefetches data from the memmory address.\n\n ```mlir\n cir.prefetch(%0 : !cir.ptr) locality(1) write\n ```\n\n This opcode has the three attributes:\n 1. The $locality is a temporal locality specifier\n ranging from (0) - no locality, to (3) - extremely local keep in cache.\n 2. The $isWrite is the specifier determining if the prefetch is prepaired\n for a 'read' or 'write'.\n If $isWrite doesn't specified it means that prefetch is prepared for 'read'.", "operands": [ { "name": "addr", "type": "CIR_VoidPtrType" } ], "attributes": [ { "name": "locality", "type": "ConfinedAttr, IntMaxValue<3>]>" }, { "name": "isWrite", "type": "UnitAttr" } ], "assemblyFormat": "`(` $addr `:` qualified(type($addr)) `)`\n `locality``(` $locality `)`\n (`write` $isWrite^) : (`read`)?\n attr-dict" }, { "name": "cir.ptr_diff", "summary": "Pointer subtraction arithmetic", "description": "The cir.ptr_diff operation computes the difference between two pointers that\n have the same element type\n\n The result reflects the ABI-defined size of the pointed-to type. For example,\n subtracting two !cir.ptr values may yield 1, representing an 8-byte\n difference. In contrast, for pointers to void or function types, a result of\n 8 corresponds to an 8-byte difference.\n\n Example:\n\n ```mlir\n %7 = cir.ptr_diff %0, %1 : !cir.ptr -> !u64i\n ```", "operands": [ { "name": "lhs", "type": "CIR_PointerType" }, { "name": "rhs", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_AnyFundamentalIntType" } ], "assemblyFormat": "$lhs `,` $rhs `:` qualified(type($lhs)) `->` qualified(type($result)) \n attr-dict" }, { "name": "cir.ptr_mask", "summary": "Masks out bits of the pointer according to a mask", "description": "The `cir.ptr_mask` operation takes a pointer and an interger `mask` as its\n argument and return the masked pointer type according to the `mask`.", "operands": [ { "name": "ptr", "type": "CIR_PointerType" }, { "name": "mask", "type": "CIR_IntType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "traits": [ { "type": "AllTypesMatch<['ptr', 'result']>" } ], "assemblyFormat": "`(` $ptr `,` $mask `:` type($mask) `)` `:` qualified(type($result)) attr-dict" }, { "name": "cir.ptr_stride", "summary": "Pointer access with stride", "description": "The `cir.ptr_stride` operation computes a new pointer from a base pointer\n and an integer stride, similar to a single-index `getelementptr` in LLVM IR.\n It moves the pointer by `stride * sizeof(element_type)` bytes.\n\n Optional no-wrap flags refine pointer arithmetic semantics, that mirror\n LLVM's GEP no-wrap semantics.\n\n Example:\n\n ```mlir\n %3 = cir.ptr_stride %1, %2 : (!cir.ptr, i32) ->!cir.ptr\n %4 = cir.ptr_stride inbounds %1, %2 : (!cir.ptr, i32) -> !cir.ptr\n %5 = cir.ptr_stride inbounds|nuw %1, %2 : (!cir.ptr, i32) -> !cir.ptr\n ```", "operands": [ { "name": "base", "type": "CIR_PointerType" }, { "name": "stride", "type": "CIR_AnyFundamentalIntType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "attributes": [ { "name": "noWrapFlags", "type": "CIR_GEPNoWrapFlagsProp{none|inbounds_flag|nusw|nuw|inbounds}" } ], "traits": [ { "type": "AllTypesMatch<['base', 'result']>" } ], "assemblyFormat": "($noWrapFlags^)? $base`,` $stride `:` functional-type(operands, results) \n attr-dict" }, { "name": "cir.resume", "summary": "Resumes execution after not catching exceptions", "description": "The `cir.resume` operation handles an uncaught exception scenario and\n behaves in two different modes:\n\n - As the terminator of a `CatchUnwind` region of `cir.try`, where it\n does not receive any arguments (implied from the `cir.try` scope), or\n - The terminator of a regular basic block without an enclosing `cir.try`\n operation, where it requires an `exception_ptr` and a `type_id`.\n\n The `rethrow` attribute is used to denote rethrowing behavior for the\n resume operation (versus default terminaton).\n ```", "operands": [ { "name": "exception_ptr", "type": "Optional" }, { "name": "type_id", "type": "Optional" } ], "attributes": [ { "name": "rethrow", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`rethrow` $rethrow^)?\n ($exception_ptr^ (`,` $type_id^)?)?\n attr-dict" }, { "name": "cir.resume.flat", "summary": "A flattened version of `cir.resume`", "description": "The `cir.resume.flat` operation is a region-less and simplified\n version of the `cir.resume`.\n\n Its representation is closer to LLVM IR dialect\n than the C/C++ language feature.\n\n This operation is used only after the CFG flatterning pass.\n\n Examples:\n ```mlir\n cir.resume.flat %exception_ptr, %type_id\n ```", "operands": [ { "name": "exception_ptr", "type": "CIR_VoidPtrType" }, { "name": "type_id", "type": "CIR_UInt32" } ], "assemblyFormat": "$exception_ptr `,` $type_id\n attr-dict" }, { "name": "cir.return", "summary": "Return from function", "description": "The \"return\" operation represents a return operation within a function.\n The operation takes an optional operand and produces no results.\n The operand type must match the signature of the function that contains\n the operation.\n\n ```mlir\n func @foo() -> i32 {\n ...\n cir.return %0 : i32\n }\n ```", "operands": [ { "name": "input", "type": "Variadic" } ], "assemblyFormat": "($input^ `:` type($input))? attr-dict" }, { "name": "cir.return_address", "summary": "The return address of the current function, or of one of its callers", "description": "Represents call to builtin function ` __builtin_return_address` in CIR.\n This builtin function returns the return address of the current function,\n or of one of its callers.\n The `level` argument is number of frames to scan up the call stack.\n For instance, value of 0 yields the return address of the current function,\n value of 1 yields the return address of the caller of the current function,\n and so forth.\n\n Examples:\n\n ```mlir\n %p = return_address(%level) -> !cir.ptr\n ```", "operands": [ { "name": "level", "type": "CIR_UInt32" } ], "results": [ { "name": "result", "type": "CIR_VoidPtrType" } ], "assemblyFormat": "`(` $level `)` attr-dict" }, { "name": "cir.rint", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.rotate", "summary": "Reverse the bytes that constitute the operand integer", "description": "The `cir.rotate` rotates operand in `src` by the given bit amount `amt`.\n Its widths must be either 8, 16, 32, or 64 and both `src`, `amt` and\n `result` be of the same type. The rotate direction is specified by a\n `left`/`right` keyword.\n\n This operation covers different C/C++\n builtins, some examples: `__builtin_rotateleft8`, `__builtin_rotateleft16`,\n `__builtin_rotateleft32`, `__builtin_rotateleft64`, `_rotl8`, `_rotl16`,\n `_rotl`, `_lrotl`, `_rotl64`, etc and their \"right\" variants.\n\n Example:\n\n ```mlir\n %r = cir.rotate left %0, %1 -> !u32i\n ```", "operands": [ { "name": "src", "type": "CIR_IntType" }, { "name": "amt", "type": "CIR_IntType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "attributes": [ { "name": "left", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`left` $left^) : (`right`)?\n $src `,` $amt `->` type($result) attr-dict" }, { "name": "cir.round", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.roundeven", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.scope", "summary": "Represents a C/C++ scope", "description": "`cir.scope` contains one region and defines a strict \"scope\" for all new\n values produced within its blocks.\n\n The region can contain an arbitrary number of blocks but usually defaults\n to one and can optionally return a value (useful for representing values\n coming out of C++ full-expressions) via `cir.yield`:\n\n\n ```mlir\n %rvalue = cir.scope {\n ...\n cir.yield %value\n }\n ```\n\n The blocks can be terminated by `cir.yield`, `cir.return` or `cir.throw`.\n If `cir.scope` yields no value, the `cir.yield` can be left out, and\n will be inserted implicitly.\n\n The scope might also have an associated `cleanup` region, providing code\n that run destruction of automatic variables. Note that in order to lower the\n cleanup region while keeping C++ semantics, all immediate control-flow\n breaking operations not under a children scope should jump to this cleanup\n code.", "results": [ { "name": "results", "type": "Optional" } ], "regions": [ { "name": "scopeRegion", "type": "AnyRegion" }, { "name": "cleanupRegion", "type": "AnyRegion" } ], "assemblyFormat": "custom($scopeRegion, $cleanupRegion) (`:` type($results)^)? attr-dict" }, { "name": "cir.select", "summary": "Yield one of two values based on a boolean value", "description": "The `cir.select` operation takes three operands. The first operand\n `condition` is a boolean value of type `!cir.bool`. The second and the third\n operand can be of any CIR types, but their types must be the same. If the\n first operand is `true`, the operation yields its second operand. Otherwise,\n the operation yields its third operand.\n\n Example:\n\n ```mlir\n %0 = cir.const #cir.bool : !cir.bool\n %1 = cir.const #cir.int<42> : !s32i\n %2 = cir.const #cir.int<72> : !s32i\n %3 = cir.select if %0 then %1 else %2 : (!cir.bool, !s32i, !s32i) -> !s32i\n ```", "operands": [ { "name": "condition", "type": "CIR_BoolType" }, { "name": "true_value", "type": "CIR_AnyType" }, { "name": "false_value", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "`if` $condition `then` $true_value `else` $false_value\n `:` `(`\n qualified(type($condition)) `,`\n qualified(type($true_value)) `,`\n qualified(type($false_value))\n `)` `->` qualified(type($result)) attr-dict" }, { "name": "cir.set_bitfield", "summary": "Set a bitfield", "description": "The `cir.set_bitfield` operation provides a store-like access to\n a bit field of a record.\n\n It expects an address of a storage where to store, a type of the storage,\n a value being stored, a name of a bit field, a pointer to the storage in the\n base record, a size of the storage, a size the bit field, an offset\n of the bit field and a sign. Returns a value being stored.\n\n A unit attribute `volatile` can be used to indicate a volatile load of the\n bitfield.\n\n Example.\n Suppose we have a struct with multiple bitfields stored in\n different storages. The `cir.set_bitfield` operation sets the value\n of the bitfield.\n ```C++\n typedef struct {\n int a : 4;\n int b : 27;\n int c : 17;\n int d : 2;\n int e : 15;\n } S;\n\n void store_bitfield(S& s) {\n s.d = 3;\n }\n ```\n\n ```mlir\n // 'd' is in the storage with the index 1\n !record_type = !cir.record, !cir.int, !cir.int} #cir.record.decl.ast>\n #bfi_d = #cir.bitfield_info\n\n %1 = cir.const #cir.int<3> : !s32i\n %2 = cir.load %0 : !cir.ptr>, !cir.ptr\n %3 = cir.get_member %2[1] {name = \"d\"} : !cir.ptr -> !cir.ptr\n %4 = cir.set_bitfield align(4) (#bfi_d, %3 : !cir.ptr, %1 : !s32i) -> !s32i\n ```", "operands": [ { "name": "addr", "type": "CIR_PointerType" }, { "name": "src", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_IntType" } ], "attributes": [ { "name": "bitfield_info", "type": "CIR_BitfieldInfoAttr" }, { "name": "alignment", "type": "DefaultValuedOptionalAttr" }, { "name": "is_volatile", "type": "UnitAttr" } ], "assemblyFormat": "(`align` `(` $alignment^ `)`)?\n `(`$bitfield_info`,` $addr`:`qualified(type($addr))`,`\n $src`:`type($src) `)` attr-dict `->` type($result)" }, { "name": "cir.shift", "summary": "Shift", "description": "Shift `left` or `right`, according to the first operand. Second operand is\n the shift target and the third the amount. Second and the thrid operand can\n be either integer type or vector of integer type. However, they must be\n either all vector of integer type, or all integer type. If they are vectors,\n each vector element of the shift target is shifted by the corresponding\n shift amount in the shift amount vector.\n\n ```mlir\n %7 = cir.shift(left, %1 : !u64i, %4 : !s32i) -> !u64i\n %8 = cir.shift(left, %2 : !cir.vector, %3 : !cir.vector) -> !cir.vector\n ```", "operands": [ { "name": "value", "type": "CIR_AnyIntOrVecOfIntType" }, { "name": "amount", "type": "CIR_AnyIntOrVecOfIntType" } ], "results": [ { "name": "result", "type": "CIR_AnyIntOrVecOfIntType" } ], "attributes": [ { "name": "isShiftleft", "type": "UnitAttr" } ], "assemblyFormat": "`(`\n (`left` $isShiftleft^) : (```right`)?\n `,` $value `:` type($value)\n `,` $amount `:` type($amount)\n `)` `->` type($result) attr-dict" }, { "name": "cir.signbit", "summary": "Checks the sign of a floating-point number", "description": "It returns whether the sign bit (i.e. the highest bit) of the input operand\n is set.", "operands": [ { "name": "input", "type": "CIR_AnyFloatType" } ], "results": [ { "name": "res", "type": "CIR_BoolType" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` qualified(type($res))" }, { "name": "cir.sin", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.sqrt", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.stack_restore", "summary": "restores the state of the function stack", "description": "Restore the state of the function stack to the state it was\n in when the corresponding cir.stack_save executed.\n Useful for implementing language features like variable length arrays.\n\n ```mlir\n %0 = cir.alloca !cir.ptr, !cir.ptr>, [\"saved_stack\"] {alignment = 8 : i64}\n %1 = cir.stack_save : \n cir.store %1, %0 : !cir.ptr, !cir.ptr>\n %2 = cir.load %0 : !cir.ptr>, !cir.ptr\n cir.stack_restore %2 : !cir.ptr\n ```", "operands": [ { "name": "ptr", "type": "CIR_PointerType" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "cir.stack_save", "summary": "remembers the current state of the function stack", "description": "Remembers the current state of the function stack. Returns a pointer\n that later can be passed into cir.stack_restore.\n Useful for implementing language features like variable length arrays.\n\n ```mlir\n %0 = cir.stack_save : \n ```", "results": [ { "name": "result", "type": "CIR_PointerType" } ], "assemblyFormat": "attr-dict `:` qualified(type($result))" }, { "name": "cir.std.begin", "summary": "std::begin()", "operands": [ { "name": "container", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "original_fn", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`(` `,` $original_fn `)` `->` type($) attr-dict" }, { "name": "cir.std.end", "summary": "std::end()", "operands": [ { "name": "container", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "original_fn", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`(` `,` $original_fn `)` `->` type($) attr-dict" }, { "name": "cir.std.find", "summary": "std::find()", "operands": [ { "name": "first", "type": "CIR_AnyType" }, { "name": "last", "type": "CIR_AnyType" }, { "name": "pattern", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "original_fn", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "AllTypesMatch<['first', 'last', 'result']>" } ], "assemblyFormat": "`(` `,` $original_fn `)` `->` type($) attr-dict" }, { "name": "cir.std.strlen", "summary": "std::strlen()", "operands": [ { "name": "string", "type": "CIR_StringType" } ], "results": [ { "name": "result", "type": "CIR_AnyFundamentalIntType" } ], "attributes": [ { "name": "original_fn", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`(` `,` $original_fn `)` `->` type($) attr-dict" }, { "name": "cir.store", "summary": "Store value to memory address", "description": "`cir.store` stores a value (first operand) to the memory address specified\n in the second operand. A unit attribute `volatile` can be used to indicate\n a volatile store. Store's can be marked atomic by using\n `atomic()`.\n\n `align` can be used to specify an alignment that's different from the\n default, which is computed from `result`'s type ABI data layout.\n\n Example:\n\n ```mlir\n // Store a function argument to local storage, address in %0.\n cir.store %arg0, %0 : i32, !cir.ptr\n\n // Perform a volatile store into memory location at the address in %0.\n cir.store volatile %arg0, %0 : i32, !cir.ptr\n\n // Others\n cir.store align(16) atomic(seq_cst) %x, %addr : i32, !cir.ptr\n ```", "operands": [ { "name": "value", "type": "CIR_AnyType" }, { "name": "addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "is_volatile", "type": "UnitAttr" }, { "name": "is_nontemporal", "type": "UnitAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "mem_order", "type": "OptionalAttr" }, { "name": "tbaa", "type": "OptionalAttr" } ], "traits": [ { "type": "TypesMatchWith<'addr', 'value', 'mlir::cast($_self).getPointee()'>" } ], "assemblyFormat": "(`volatile` $is_volatile^)?\n (`nontemporal` $is_nontemporal^)?\n (`align` `(` $alignment^ `)`)?\n (`atomic` `(` $mem_order^ `)`)?\n $value `,` $addr attr-dict `:` type($value) `,` qualified(type($addr))\n (`tbaa` `(` $tbaa^ `)`)?" }, { "name": "cir.switch", "summary": "Switch operation", "description": "The `cir.switch` operation represents C/C++ switch functionality for\n conditionally executing multiple regions of code. The operand to an switch\n is an integral condition value.\n\n The set of `cir.case` operations and their enclosing `cir.switch`\n represents the semantics of a C/C++ switch statement. Users can use\n `collectCases(llvm::SmallVector &cases)` to collect the `cir.case`\n operation in the `cir.switch` operation easily.\n\n The `cir.case` operations doesn't have to be in the region of `cir.switch`\n directly. However, when all the `cir.case` operations lives in the region\n of `cir.switch` directly and there is no other operations except the ending\n `cir.yield` operation in the region of `cir.switch` directly, we call the\n `cir.switch` operation is in a simple form. Users can use\n `bool isSimpleForm(llvm::SmallVector &cases)` member function to\n detect if the `cir.switch` operation is in a simple form. The simple form\n makes analysis easier to handle the `cir.switch` operation\n and makes the boundary to give up pretty clear.\n\n To make the simple form as common as possible, CIR code generation attaches\n operations corresponding to the statements that lives between top level\n cases into the closest `cir.case` operation.\n\n For example,\n\n ```\n switch(int cond) {\n case 4:\n a++;\n\n b++;\n case 5;\n c++;\n\n ...\n }\n ```\n\n The statement `b++` is not a sub-statement of the case statement `case 4`.\n But to make the generated `cir.switch` a simple form, we will attach the\n statement `b++` into the closest `cir.case` operation. So that the generated\n code will be like:\n\n ```\n cir.switch(int cond) {\n cir.case(equal, 4) {\n a++;\n b++;\n cir.yield\n }\n cir.case(equal, 5) {\n c++;\n cir.yield\n }\n ...\n }\n ```\n\n For the same reason, we will hoist the case statement as the substatement\n of another case statement so that they will be in the same level. For\n example,\n\n ```\n switch(int cond) {\n case 4:\n default;\n case 5;\n a++;\n ...\n }\n ```\n\n will be generated as\n\n ```\n cir.switch(int cond) {\n cir.case(equal, 4) {\n cir.yield\n }\n cir.case(default) {\n cir.yield\n }\n cir.case(equal, 5) {\n a++;\n cir.yield\n }\n ...\n }\n ```\n\n The cir.switch might not be considered \"simple\" if any of the following is\n true:\n - There are case statements of the switch statement lives in other scopes\n other than the top level compound statement scope. Note that a case\n statement itself doesn't form a scope.\n - The sub-statement of the switch statement is not a compound statement.\n - There are codes before the first case statement. For example,\n\n ```\n switch(int cond) {\n l:\n b++;\n\n case 4:\n a++;\n break;\n\n case 5:\n goto l;\n ...\n }\n ```\n\n the generated CIR for this non-simple switch would be:\n\n ```\n cir.switch(int cond) {\n cir.label \"l\"\n b++;\n cir.case(4) {\n a++;\n cir.break\n }\n cir.case(5) {\n goto \"l\"\n }\n cir.yield\n }\n ```", "operands": [ { "name": "condition", "type": "CIR_IntType" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "custom(\n $body, $condition, type($condition)\n )\n attr-dict" }, { "name": "cir.switch.flat", "summary": "A flattened version of cir.switch", "description": "The `cir.switch.flat` operation is a region-less and simplified version of the `cir.switch`.\n It's representation is closer to LLVM IR dialect than the C/C++ language feature.", "operands": [ { "name": "condition", "type": "CIR_IntType" }, { "name": "defaultOperands", "type": "Variadic" }, { "name": "caseOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "case_values", "type": "ArrayAttr" }, { "name": "case_operand_segments", "type": "DenseI32ArrayAttr" } ], "successors": [ { "name": "defaultDestination", "type": "AnySuccessor" }, { "name": "caseDestinations", "type": "VariadicSuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$condition `:` type($condition) `,`\n $defaultDestination (`(` $defaultOperands^ `:` type($defaultOperands) `)`)?\n custom(ref(type($condition)), $case_values, $caseDestinations,\n $caseOperands, type($caseOperands))\n attr-dict" }, { "name": "cir.tan", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.ternary", "summary": "The `cond ? a : b` C/C++ ternary operation", "description": "The `cir.ternary` operation represents C/C++ ternary, much like a `select`\n operation. First argument is a `cir.bool` condition to evaluate, followed\n by two regions to execute (true or false). This is different from `cir.if`\n since each region is one block sized and the `cir.yield` closing the block\n scope should have one argument.\n\n Example:\n\n ```mlir\n // x = cond ? a : b;\n\n %x = cir.ternary (%cond, true_region {\n ...\n cir.yield %a : i32\n }, false_region {\n ...\n cir.yield %b : i32\n }) -> i32\n ```", "operands": [ { "name": "cond", "type": "CIR_BoolType" } ], "results": [ { "name": "result", "type": "Optional" } ], "regions": [ { "name": "trueRegion", "type": "AnyRegion" }, { "name": "falseRegion", "type": "AnyRegion" } ], "assemblyFormat": "`(` $cond `,`\n `true` $trueRegion `,`\n `false` $falseRegion\n `)` `:` functional-type(operands, results) attr-dict" }, { "name": "cir.throw", "summary": "(Re)Throws an exception", "description": "Very similar to __cxa_throw:\n\n ```\n void __cxa_throw(void *thrown_exception, std::type_info *tinfo,\n void (*dest) (void *));\n ```\n\n The absense of arguments for `cir.throw` means it rethrows.\n\n For the no-rethrow version, it must have at least two operands, the RTTI\n information, a pointer to the exception object (likely allocated via\n `cir.cxa.allocate_exception`) and finally an optional dtor, which might\n run as part of this operation.\n\n ```mlir\n // if (b == 0)\n // throw \"Division by zero condition!\";\n cir.if %10 {\n %11 = cir.alloc_exception 8 -> !cir.ptr\n ...\n cir.store %13, %11 : // Store string addr for \"Division by zero condition!\"\n cir.throw %11 : !cir.ptr>, @\"typeinfo for char const*\"\n ```", "operands": [ { "name": "exception_ptr", "type": "Optional" } ], "attributes": [ { "name": "type_info", "type": "OptionalAttr" }, { "name": "dtor", "type": "OptionalAttr" } ], "assemblyFormat": "($exception_ptr^ `:` type($exception_ptr))?\n (`,` $type_info^)?\n (`,` $dtor^)?\n attr-dict" }, { "name": "cir.trap", "summary": "Exit the program abnormally", "description": "The cir.trap operation causes the program to exit abnormally. The\n implementations may implement this operation with different mechanisms. For\n example, an implementation may implement this operation by calling abort,\n while another implementation may implement this operation by executing an\n illegal instruction.", "assemblyFormat": "attr-dict" }, { "name": "cir.trunc", "summary": "libc builtin equivalent ignoring floating point exceptions and errno", "operands": [ { "name": "src", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "results": [ { "name": "result", "type": "CIR_AnyFloatOrVecOfFloatType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src `:` type($src) attr-dict" }, { "name": "cir.try", "summary": "C++ try block", "description": "```mlir\n\n Holds the lexical scope of `try {}`. Note that resources used on catch\n clauses are usually allocated in the same parent as `cir.try`.\n\n `synthetic`: use `cir.try` to represent try/catches not originally\n present in the source code (e.g. `g = new Class` under `-fexceptions`).\n\n `cleanup`: signal to targets (LLVM for now) that this try/catch, needs\n to specially tag their landing pads as needing \"cleanup\".\n\n Example: TBD\n ```", "attributes": [ { "name": "synthetic", "type": "UnitAttr" }, { "name": "cleanup", "type": "UnitAttr" }, { "name": "catch_types", "type": "OptionalAttr" } ], "regions": [ { "name": "try_region", "type": "AnyRegion" }, { "name": "catch_regions", "type": "VariadicRegion" } ], "assemblyFormat": "(`synthetic` $synthetic^)?\n (`cleanup` $cleanup^)?\n $try_region\n custom($catch_regions, $catch_types)\n attr-dict" }, { "name": "cir.try_call", "summary": "try_call operation", "description": "Mostly similar to cir.call but requires two destination\n branches, one for handling exceptions in case its thrown and\n the other one to follow on regular control-flow.\n\n Example:\n\n ```mlir\n // Direct call\n %2 = cir.try_call @my_add(%0, %1) ^continue, ^landing_pad : (f32, f32) -> f32\n ```", "operands": [ { "name": "contOperands", "type": "Variadic" }, { "name": "landingPadOperands", "type": "Variadic" }, { "name": "arg_ops", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "callee", "type": "OptionalAttr" }, { "name": "calling_conv", "type": "DefaultValuedAttr" }, { "name": "side_effect", "type": "DefaultValuedAttr" }, { "name": "extra_attrs", "type": "CIR_ExtraFuncAttr" }, { "name": "ast", "type": "OptionalAttr" } ], "successors": [ { "name": "cont", "type": "AnySuccessor" }, { "name": "landing_pad", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "cir.unary", "summary": "Unary operations", "description": "`cir.unary` performs the unary operation according to\n the specified opcode kind: [inc, dec, plus, minus, not].\n\n It requires one input operand and has one result, both types\n should be the same.\n\n ```mlir\n %7 = cir.unary(inc, %1) : i32 -> i32\n %8 = cir.unary(dec, %2) : i32 -> i32\n ```", "operands": [ { "name": "input", "type": "CIR_AnyType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "attributes": [ { "name": "kind", "type": "CIR_UnaryOpKind{inc|dec|plus|minus|not}" }, { "name": "no_signed_wrap", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` $kind `,` $input `)`\n (`nsw` $no_signed_wrap^)?\n `:` type($input) `,` type($result) attr-dict" }, { "name": "cir.unreachable", "summary": "invoke immediate undefined behavior", "description": "If the program control flow reaches a `cir.unreachable` operation, the\n program exhibits undefined behavior immediately. This operation is useful\n in cases where the unreachability of a program point needs to be explicitly\n marked.", "assemblyFormat": "attr-dict" }, { "name": "cir.va.arg", "summary": "Fetches next variadic element as a given type", "operands": [ { "name": "arg_list", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_AnyType" } ], "assemblyFormat": "$arg_list attr-dict `:` functional-type(operands, $result)" }, { "name": "cir.va.copy", "summary": "Copies a variable argument list", "operands": [ { "name": "dst_list", "type": "CIR_PointerType" }, { "name": "src_list", "type": "CIR_PointerType" } ], "assemblyFormat": "$src_list `to` $dst_list attr-dict `:` type(operands)" }, { "name": "cir.va.end", "summary": "Ends a variable argument list", "operands": [ { "name": "arg_list", "type": "CIR_PointerType" } ], "assemblyFormat": "$arg_list attr-dict `:` type(operands)" }, { "name": "cir.va.start", "summary": "Starts a variable argument list", "operands": [ { "name": "arg_list", "type": "CIR_PointerType" } ], "assemblyFormat": "$arg_list attr-dict `:` type(operands)" }, { "name": "cir.vec.cmp", "summary": "Compare two vectors", "description": "The `cir.vec.cmp` operation does an element-wise comparison of two vectors\n of the same type. The result is a vector of the same size as the operands\n whose element type is the signed integral type that is the same size as the\n element type of the operands. The values in the result are 0 or -1.", "operands": [ { "name": "lhs", "type": "CIR_VectorType" }, { "name": "rhs", "type": "CIR_VectorType" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "attributes": [ { "name": "kind", "type": "CIR_CmpOpKind{lt|le|gt|ge|eq|ne|fone|funo}" } ], "assemblyFormat": "`(` $kind `,` $lhs `,` $rhs `)` `:` qualified(type($lhs)) `,`\n qualified(type($result)) attr-dict" }, { "name": "cir.vec.create", "summary": "Create a vector value", "description": "The `cir.vec.create` operation creates a vector value with the given element\n values. The number of element arguments must match the number of elements\n in the vector type.", "operands": [ { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "assemblyFormat": "`(` ($elements^ `:` type($elements))? `)` `:` qualified(type($result))\n attr-dict" }, { "name": "cir.vec.extract", "summary": "Extract one element from a vector object", "description": "The `cir.vec.extract` operation extracts the element at the given index\n from a vector object.", "operands": [ { "name": "vec", "type": "CIR_VectorType" }, { "name": "index", "type": "CIR_AnyFundamentalIntType" } ], "results": [ { "name": "result", "type": "CIR_VectorElementType" } ], "traits": [ { "type": "TypesMatchWith<'vec', 'result', 'mlir::cast($_self).getElementType()'>" } ], "assemblyFormat": "$vec `[` $index `:` type($index) `]` attr-dict `:` qualified(type($vec))" }, { "name": "cir.vec.insert", "summary": "Insert one element into a vector object", "description": "The `cir.vec.insert` operation replaces the element of the given vector at\n the given index with the given value. The new vector with the inserted\n element is returned.", "operands": [ { "name": "vec", "type": "CIR_VectorType" }, { "name": "value", "type": "CIR_VectorElementType" }, { "name": "index", "type": "CIR_AnyFundamentalIntType" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "traits": [ { "type": "TypesMatchWith<'vec', 'value', 'mlir::cast($_self).getElementType()'>" }, { "type": "AllTypesMatch<['result', 'vec']>" } ], "assemblyFormat": "$value `,` $vec `[` $index `:` type($index) `]` attr-dict `:`\n qualified(type($vec))" }, { "name": "cir.vec.shuffle", "summary": "Combine two vectors using indices passed as constant integers", "description": "The `cir.vec.shuffle` operation implements the documented form of Clang's\n __builtin_shufflevector, where the indices of the shuffled result are\n integer constants.\n\n The two input vectors, which must have the same type, are concatenated.\n Each of the integer constant arguments is interpreted as an index into that\n concatenated vector, with a value of -1 meaning that the result value\n doesn't matter. The result vector, which must have the same element type as\n the input vectors and the same number of elements as the list of integer\n constant indices, is constructed by taking the elements at the given\n indices from the concatenated vector. The size of the result vector does\n not have to match the size of the individual input vectors or of the\n concatenated vector.", "operands": [ { "name": "vec1", "type": "CIR_VectorType" }, { "name": "vec2", "type": "CIR_VectorType" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "attributes": [ { "name": "indices", "type": "ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['vec1', 'vec2']>" } ], "assemblyFormat": "`(` $vec1 `,` $vec2 `:` qualified(type($vec1)) `)` $indices `:`\n qualified(type($result)) attr-dict" }, { "name": "cir.vec.shuffle.dynamic", "summary": "Shuffle a vector using indices in another vector", "description": "The `cir.vec.shuffle.dynamic` operation implements the undocumented form of\n Clang's __builtin_shufflevector, where the indices of the shuffled result\n can be runtime values.\n\n There are two input vectors, which must have the same number of elements.\n The second input vector must have an integral element type. The elements of\n the second vector are interpreted as indices into the first vector. The\n result vector is constructed by taking the elements from the first input\n vector from the indices indicated by the elements of the second vector.", "operands": [ { "name": "vec", "type": "CIR_VectorType" }, { "name": "indices", "type": "CIR_VectorOfIntType" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "traits": [ { "type": "AllTypesMatch<['vec', 'result']>" } ], "assemblyFormat": "$vec `:` qualified(type($vec)) `,` $indices `:` qualified(type($indices))\n attr-dict" }, { "name": "cir.vec.splat", "summary": "Convert a scalar into a vector", "description": "The `cir.vec.splat` operation creates a vector value from a scalar value.\n All elements of the vector have the same value, that of the given scalar.", "operands": [ { "name": "value", "type": "CIR_VectorElementType" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "traits": [ { "type": "TypesMatchWith<'result', 'value', 'mlir::cast($_self).getElementType()'>" } ], "assemblyFormat": "$value `:` type($value) `,` qualified(type($result)) attr-dict" }, { "name": "cir.vec.ternary", "summary": "The `cond ? a : b` ternary operator for vector types", "description": "The `cir.vec.ternary` operation represents the C/C++ ternary operator,\n `?:`, for vector types, which does a `select` on individual elements of the\n vectors. Unlike a regular `?:` operator, there is no short circuiting. All\n three arguments are always evaluated. Because there is no short\n circuiting, there are no regions in this operation, unlike cir.ternary.\n\n The first argument is a vector of integral type. The second and third\n arguments are vectors of the same type and have the same number of elements\n as the first argument.\n\n The result is a vector of the same type as the second and third arguments.\n Each element of the result is `(bool)a[n] ? b[n] : c[n]`.", "operands": [ { "name": "cond", "type": "CIR_VectorOfIntType" }, { "name": "lhs", "type": "CIR_VectorType" }, { "name": "rhs", "type": "CIR_VectorType" } ], "results": [ { "name": "result", "type": "CIR_VectorType" } ], "traits": [ { "type": "AllTypesMatch<['result', 'lhs', 'rhs']>" } ], "assemblyFormat": "`(` $cond `,` $lhs `,` $rhs `)` `:` qualified(type($cond)) `,`\n qualified(type($lhs)) attr-dict" }, { "name": "cir.vtable.address_point", "summary": "Get the vtable (global variable) address point", "description": "The `vtable.address_point` operation retrieves the \"effective\" address\n (address point) of a C++ virtual table. An object internal `__vptr`\n gets initializated on top of the value returned by this operation.\n\n `address_point.index` (vtable index) provides the appropriate vtable within\n the vtable group (as specified by Itanium ABI), and `address_point.offset`\n (address point index) the actual address point within that vtable.\n\n The `name` argument to this operation must be the name of a C++ vtable\n object. The return value is the address of the virtual function pointer\n array within the vtable (the vptr). This value will be written to the\n vptr member of a dynamic class by the constructor of the class. Derived\n classes have their own vtable, which is used to obtain the vptr stored\n in instances of the derived class.\n\n The return type is always `!cir.vptr`.\n\n Examples:\n\n ```C++\n struct Base {\n Base();\n virtual void f();\n };\n struct Derived : public Base {\n Derived();\n };\n ```\n\n ```mlir\n !rec_Base = !cir.record) : !cir.vptr\n %3 = cir.vtable.get_vptr %1 : !cir.ptr -> !cir.ptr\n cir.store align(8) %2, %3 : !cir.vptr, !cir.ptr\n ...\n // VTable for Derived\n cir.global linkonce_odr @_ZTV7Derived = ...\n ...\n // Constructor for Derived\n cir.func dso_local @_ZN7DerivedC2Ev ...\n // Get the address of Base within this Derived instance\n %2 = cir.base_class_addr %1 : !cir.ptr nonnull [0]\n cir.call @_ZN4BaseC2Ev(%2)\n %3 = cir.vtable.address_point(@_ZTV7Derived,\n address_point = ) : !cir.vptr\n // The vptr is still at the start of the object in this case\n %4 = cir.vtable.get_vptr %1 : !cir.ptr -> !cir.ptr\n // This overwrites the vptr that was stored in the Base constructor call\n cir.store align(8) %3, %4 : !cir.vptr, !cir.ptr\n ```", "results": [ { "name": "addr", "type": "CIR_VPtrType" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" }, { "name": "address_point", "type": "CIR_AddressPointAttr" } ], "assemblyFormat": "`(`\n $name `,` `address_point` `=` $address_point\n `)`\n `:` qualified(type($addr)) attr-dict" }, { "name": "cir.vtable.get_virtual_fn_addr", "summary": "Get a the address of a virtual function pointer", "description": "The `vtable.get_virtual_fn_addr` operation retrieves the address of a\n virtual function pointer from an object's vtable (__vptr).\n This is an abstraction to perform the basic pointer arithmetic to get\n the address of the virtual function pointer, which can then be loaded and\n called.\n\n The `vptr` operand must be a `!cir.ptr` value, which would\n have been returned by a previous call to `cir.vatble.get_vptr`. The\n `index` operand is an index of the virtual function in the vtable.\n\n The return type is a pointer-to-pointer to the function type.\n\n Example 1:\n Suppose we have two classes, Base and Derived, where Derived overrides\n virtual functions that were defined in Base. When a pointer to a Base\n object is used to call one of these function, we may not know at compile\n time whether it points to an instance of Base or an instance of Derived.\n The compiler does not need to know. It will load the vptr from the object\n and use that to get the address of the correct function to call. The\n vptr will have been initialized in the object's constructor to point to\n the correct vtable for the object being instantiated.\n ```C++\n // In this example, when f3 is called, we don't know at compile-time\n // whether\n struct Base {\n virtual void f1();\n virtual void f2();\n };\n struct Derived : public Base {\n void f1() override;\n void f2() override;\n };\n void f3(Base *b) {\n b->f2();\n }\n ```\n\n ```mlir\n // VTable for Base\n cir.global external @_ZTV4Base = #cir.vtable<{\n #cir.const_array<[\n #cir.ptr : !cir.ptr,\n #cir.global_view<@_ZTI4Base> : !cir.ptr,\n #cir.global_view<@_ZN4Base2f1Ev> : !cir.ptr,\n #cir.global_view<@_ZN4Base2f2Ev> : !cir.ptr\n ]> : !cir.array x 4>}> ...\n // VTable for Derived\n cir.global external @_ZTV7Derived = #cir.vtable<{\n #cir.const_array<[\n #cir.ptr : !cir.ptr,\n #cir.global_view<@_ZTI7Derived> : !cir.ptr,\n #cir.global_view<@_ZN7Derived2f1Ev> : !cir.ptr,\n #cir.global_view<@_ZN7Derived2f2Ev> : !cir.ptr\n ]> : !cir.array x 4>}> ...\n // f3()\n cir.func dso_local @_Z2f3P4Base(%b: !cir.ptr)\n // Get the vptr\n %1 = cir.vtable.get_vptr %b : !cir.ptr -> !cir.ptr\n %2 = cir.load align(8) %1 : !cir.ptr, !cir.vptr\n // Get the address of b->f2() -- may be Base::f2() or Derived::f2()\n %3 = cir.vtable.get_virtual_fn_addr %2[1] : !cir.vptr\n -> !cir.ptr)>>>\n %4 = cir.load align(8) %3\n : !cir.ptr)>>>,\n !cir.ptr)>>\n cir.call %4(%b)\n ```\n\n Example 2:\n Consider the case of multiple inheritance, where Base1 and Base2 both\n provide virtual functions and a third class, Derived, inherits from both\n bases. When a pointer to a Derived is used to call a virtual function in\n Base2, we must retrieve a pointer to the Base2 portion of the Derived object\n and use that pointer to get the vptr for Base2 as a base class.\n ```C++\n struct Base1 {\n virtual void f1();\n };\n struct Base2 {\n virtual void f2();\n };\n struct Derived : public Base1, Base2 { };\n void f3(Derived *d) {\n d->f2();\n }\n ```\n\n ```mlir\n !rec_Base1 = !cir.record)\n %2 = cir.base_class_addr %d : !cir.ptr nonnull [8]\n -> !cir.ptr\n %3 = cir.vtable.get_vptr %2 : !cir.ptr -> !cir.ptr\n %4 = cir.load align(8) %3 : !cir.ptr, !cir.vptr\n %5 = cir.vtable.get_virtual_fn_addr %4[0] : !cir.vptr\n -> !cir.ptr)>>>\n %6 = cir.load align(8) %5\n : !cir.ptr)>>>,\n !cir.ptr)>>\n cir.call %6(%2) : (!cir.ptr)>>,\n !cir.ptr) -> ()\n ```", "operands": [ { "name": "vptr", "type": "CIR_VPtrType" } ], "results": [ { "name": "result", "type": "CIR_PointerType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "assemblyFormat": "$vptr `[` $index `]` attr-dict\n `:` qualified(type($vptr)) `->` qualified(type($result))" }, { "name": "cir.vtable.get_vptr", "summary": "Get a the address of the vtable pointer for an object", "description": "The `vtable.get_vptr` operation retrieves the address of the vptr for a\n C++ object. This operation requires that the object pointer points to\n the start of a complete object. (TODO: Describe how we get that).\n The vptr will always be at offset zero in the object, but this operation\n is more explicit about what is being retrieved than a direct bitcast.\n\n The return type is always `!cir.ptr`.\n\n Example:\n ```C++\n struct S {\n virtual void f1();\n virtual void f2();\n };\n void f3(S *s) {\n s->f2();\n }\n ```\n\n ```mlir\n // VTable for S\n cir.global external @_ZTV1S = #cir.vtable<{\n #cir.const_array<[\n // Offset to the base object\n #cir.ptr : !cir.ptr,\n // Type info for S\n #cir.global_view<@_ZTI1S> : !cir.ptr,\n // Pointer to S::f1\n #cir.global_view<@_ZN1S2f1Ev> : !cir.ptr,\n // Pointer to S::f2\n #cir.global_view<@_ZN1S2f2Ev> : !cir.ptr\n ]> : !cir.array x 4>}> ...\n // f3()\n cir.func dso_local @_Z2f3P1S(%s: !cir.ptr) {\n // Get the vptr -- This points to offset 2 in the vtable.\n %1 = cir.vtable.get_vptr %s : !cir.ptr -> !cir.ptr\n %2 = cir.load align(8) %1 : !cir.ptr, !cir.vptr\n // Get the address of b->f2() -- may be Base::f2() or Derived::f2()\n %3 = cir.vtable.get_virtual_fn_addr %2[1] : !cir.vptr\n -> !cir.ptr)>>>\n %4 = cir.load align(8) %3\n : !cir.ptr)>>>,\n !cir.ptr)>>\n cir.call %4(%b)\n ```", "operands": [ { "name": "src", "type": "CIR_PointerType" } ], "results": [ { "name": "result", "type": "CIR_PtrToVPtr" } ], "assemblyFormat": "$src `:` qualified(type($src)) `->` qualified(type($result)) attr-dict" }, { "name": "cir.vtt.address_point", "summary": "Get the VTT address point", "description": "The `vtt.address_point` operation retrieves an element from the VTT,\n which is the address point of a C++ vtable. In virtual inheritance,\n A set of internal `__vptr` for an object are initialized by this operation,\n which assigns an element from the VTT. The initialization order is as follows:\n\n The complete object constructors and destructors find the VTT,\n via the mangled name of VTT global variable. They pass the address of\n the subobject's sub-VTT entry in the VTT as a second parameter\n when calling the base object constructors and destructors.\n The base object constructors and destructors use the addresses passed to\n initialize the primary virtual pointer and virtual pointers that point to\n the classes which either have virtual bases or override virtual functions\n with a virtual step.\n\n The first parameter is either the mangled name of VTT global variable\n or the address of the subobject's sub-VTT entry in the VTT.\n The second parameter `offset` provides a virtual step to adjust to\n the actual address point of the vtable.\n\n The return type is always a `!cir.ptr>`.\n\n Example:\n ```mlir\n cir.global linkonce_odr @_ZTV1B = ...\n ...\n %3 = cir.base_class_addr(%1 : !cir.ptr nonnull) [0] -> !cir.ptr\n %4 = cir.vtt.address_point @_ZTT1D, offset = 1 -> !cir.ptr>\n cir.call @_ZN1BC2Ev(%3, %4)\n ```\n Or:\n ```mlir\n %7 = cir.vtt.address_point %3 : !cir.ptr>, offset = 1 -> !cir.ptr>\n ```", "operands": [ { "name": "sym_addr", "type": "Optional" } ], "results": [ { "name": "addr", "type": "CIR_PointerType" } ], "attributes": [ { "name": "name", "type": "OptionalAttr" }, { "name": "offset", "type": "I32Attr" } ], "assemblyFormat": "($name^)?\n ($sym_addr^ `:` type($sym_addr))?\n `,`\n `offset` `=` $offset\n `->` qualified(type($addr)) attr-dict" }, { "name": "cir.while", "summary": "C/C++ while loop", "description": "Represents a C/C++ while loop. It consists of two regions:\n\n - `cond`: single block region with the loop's condition. Should be\n terminated with a `cir.condition` operation.\n - `body`: contains the loop body and an arbitrary number of blocks.\n\n Example:\n\n ```mlir\n cir.while {\n cir.break\n ^bb2:\n cir.yield\n } do {\n cir.condition %cond : cir.bool\n }\n ```", "regions": [ { "name": "cond", "type": "SizedRegion<1>" }, { "name": "body", "type": "MinSizedRegion<1>" } ], "assemblyFormat": "$cond `do` $body attr-dict" }, { "name": "cir.yield", "summary": "Represents the default branching behaviour of a region", "description": "The `cir.yield` operation terminates regions on different CIR operations,\n and it is used to represent the default branching behaviour of a region.\n Said branching behaviour is determinted by the parent operation. For\n example, a yield in a `switch-case` region implies a fallthrough, while\n a yield in a `cir.if` region implies a branch to the exit block, and so\n on.\n\n In some cases, it might yield an SSA value and the semantics of how the\n values are yielded is defined by the parent operation. For example, a\n `cir.ternary` operation yields a value from one of its regions.\n\n As a general rule, `cir.yield` must be explicitly used whenever a region has\n more than one block and no terminator, or within `cir.switch` regions not\n `cir.return` terminated.\n\n Examples:\n ```mlir\n cir.if %4 {\n ...\n cir.yield\n }\n\n cir.switch (%5) [\n case (equal, 3) {\n ...\n cir.yield\n }, ...\n ]\n\n cir.scope {\n ...\n cir.yield\n }\n\n %x = cir.scope {\n ...\n cir.yield %val\n }\n\n %y = cir.ternary {\n ...\n cir.yield %val : i32\n } : i32\n ```", "operands": [ { "name": "args", "type": "Variadic" } ], "assemblyFormat": "($args^ `:` type($args))? attr-dict" }, { "name": "complex.abs", "summary": "computes absolute value of a complex number", "description": "The `abs` op takes a single complex number and computes its absolute value.\n\n Example:\n\n ```mlir\n %a = complex.abs %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "AnyFloat" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'complex', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.add", "summary": "complex addition", "description": "The `add` operation takes two complex numbers and returns their sum.\n\n Example:\n\n ```mlir\n %a = complex.add %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)" }, { "name": "complex.angle", "summary": "computes argument value of a complex number", "description": "The `angle` op takes a single complex number and computes its argument value with a branch cut along the negative real axis.\n\n Example:\n\n ```mlir\n %a = complex.angle %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "AnyFloat" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'complex', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.atan2", "summary": "complex 2-argument arctangent", "description": "For complex numbers it is expressed using complex logarithm\n atan2(y, x) = -i * log((x + i * y) / sqrt(x**2 + y**2))\n\n Example:\n\n ```mlir\n %a = complex.atan2 %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)" }, { "name": "complex.bitcast", "summary": "computes bitcast between complex and equal arith types", "description": "Example:\n\n ```mlir\n %a = complex.bitcast %b : complex -> i64\n ```", "operands": [ { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "complex.conj", "summary": "Calculate the complex conjugate", "description": "The `conj` op takes a single complex number and computes the\n complex conjugate.\n\n Example:\n\n ```mlir\n %a = complex.conj %b: complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.constant", "summary": "complex number constant operation", "description": "The `complex.constant` operation creates a constant complex number from an\n attribute containing the real and imaginary parts.\n\n Example:\n\n ```mlir\n %a = complex.constant [0.1, -1.0] : complex\n ```", "results": [ { "name": "complex", "type": "AnyComplex" } ], "attributes": [ { "name": "value", "type": "ArrayAttr" } ], "assemblyFormat": "$value attr-dict `:` type($complex)" }, { "name": "complex.cos", "summary": "computes cosine of a complex number", "description": "The `cos` op takes a single complex number and computes the cosine of\n it, i.e. `cos(x)`, where `x` is the input value.\n\n Example:\n\n ```mlir\n %a = complex.cos %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.create", "summary": "complex number creation operation", "description": "The `complex.create` operation creates a complex number from two\n floating-point operands, the real and the imaginary part.\n\n Example:\n\n ```mlir\n %a = complex.create %b, %c : complex\n ```", "operands": [ { "name": "real", "type": "AnyFloat" }, { "name": "imaginary", "type": "AnyFloat" } ], "results": [ { "name": "complex", "type": "Complex" } ], "traits": [ { "type": "AllTypesMatch<['real', 'imaginary']>" }, { "type": "TypesMatchWith<'complex', 'real', '::llvm::cast($_self).getElementType()'>" }, { "type": "TypesMatchWith<'complex', 'imaginary', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$real `,` $imaginary attr-dict `:` type($complex)" }, { "name": "complex.div", "summary": "complex division", "description": "The `div` operation takes two complex numbers and returns result of their\n division:\n\n ```mlir\n %a = complex.div %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)" }, { "name": "complex.eq", "summary": "computes whether two complex values are equal", "description": "The `eq` op takes two complex numbers and returns whether they are equal.\n\n Example:\n\n ```mlir\n %a = complex.eq %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "complex.exp", "summary": "computes exponential of a complex number", "description": "The `exp` op takes a single complex number and computes the exponential of\n it, i.e. `exp(x)` or `e^(x)`, where `x` is the input value.\n `e` denotes Euler's number and is approximately equal to 2.718281.\n\n Example:\n\n ```mlir\n %a = complex.exp %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.expm1", "summary": "computes exponential of a complex number minus 1", "description": "complex.expm1(x) := complex.exp(x) - 1\n\n Example:\n\n ```mlir\n %a = complex.expm1 %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.im", "summary": "extracts the imaginary part of a complex number", "description": "The `im` op takes a single complex number and extracts the imaginary part.\n\n Example:\n\n ```mlir\n %a = complex.im %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "imaginary", "type": "AnyFloat" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'complex', 'imaginary', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.log", "summary": "computes natural logarithm of a complex number", "description": "The `log` op takes a single complex number and computes the natural\n logarithm of it, i.e. `log(x)` or `log_e(x)`, where `x` is the input value.\n `e` denotes Euler's number and is approximately equal to 2.718281.\n\n Example:\n\n ```mlir\n %a = complex.log %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.log1p", "summary": "computes natural logarithm of a complex number", "description": "The `log` op takes a single complex number and computes the natural\n logarithm of one plus the given value, i.e. `log(1 + x)` or `log_e(1 + x)`,\n where `x` is the input value. `e` denotes Euler's number and is\n approximately equal to 2.718281.\n\n Example:\n\n ```mlir\n %a = complex.log1p %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.mul", "summary": "complex multiplication", "description": "The `mul` operation takes two complex numbers and returns their product:\n\n ```mlir\n %a = complex.mul %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)" }, { "name": "complex.neg", "summary": "Negation operator", "description": "The `neg` op takes a single complex number `complex` and returns `-complex`.\n\n Example:\n\n ```mlir\n %a = complex.neg %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.neq", "summary": "computes whether two complex values are not equal", "description": "The `neq` op takes two complex numbers and returns whether they are not\n equal.\n\n Example:\n\n ```mlir\n %a = complex.neq %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "complex.pow", "summary": "complex power function", "description": "The `pow` operation takes a complex number raises it to the given complex\n exponent.\n\n Example:\n\n ```mlir\n %a = complex.pow %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)" }, { "name": "complex.powi", "summary": "complex number raised to signed integer power", "description": "The `powi` operation takes a `base` operand of complex type and a `power`\n operand of signed integer type and returns one result of the same type\n as `base`. The result is `base` raised to the power of `power`.\n\n Example:\n\n ```mlir\n %a = complex.powi %b, %c : complex, i32\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "AnySignlessInteger" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'result']>" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) `,` type($rhs)" }, { "name": "complex.re", "summary": "extracts the real part of a complex number", "description": "The `re` op takes a single complex number and extracts the real part.\n\n Example:\n\n ```mlir\n %a = complex.re %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "real", "type": "AnyFloat" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'complex', 'real', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.rsqrt", "summary": "complex reciprocal of square root", "description": "The `rsqrt` operation computes reciprocal of square root.\n\n Example:\n\n ```mlir\n %a = complex.rsqrt %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.sign", "summary": "computes sign of a complex number", "description": "The `sign` op takes a single complex number and computes the sign of\n it, i.e. `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.\n\n Example:\n\n ```mlir\n %a = complex.sign %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.sin", "summary": "computes sine of a complex number", "description": "The `sin` op takes a single complex number and computes the sine of\n it, i.e. `sin(x)`, where `x` is the input value.\n\n Example:\n\n ```mlir\n %a = complex.sin %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.sqrt", "summary": "complex square root", "description": "The `sqrt` operation takes a complex number and returns its square root.\n\n Example:\n\n ```mlir\n %a = complex.sqrt %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.sub", "summary": "complex subtraction", "description": "The `sub` operation takes two complex numbers and returns their difference.\n\n Example:\n\n ```mlir\n %a = complex.sub %b, %c : complex\n ```", "operands": [ { "name": "lhs", "type": "Complex" }, { "name": "rhs", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)" }, { "name": "complex.tan", "summary": "computes tangent of a complex number", "description": "The `tan` op takes a single complex number and computes the tangent of\n it, i.e. `tan(x)`, where `x` is the input value.\n\n Example:\n\n ```mlir\n %a = complex.tan %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "complex.tanh", "summary": "complex hyperbolic tangent", "description": "The `tanh` operation takes a complex number and returns its hyperbolic\n tangent.\n\n Example:\n\n ```mlir\n %a = complex.tanh %b : complex\n ```", "operands": [ { "name": "complex", "type": "Complex" } ], "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)" }, { "name": "coo.convert_coo_to_dht.f32.0", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.f32.1", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.f32.2", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.f32.3", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.i32.0", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.i32.1", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.i32.2", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_coo_to_dht.i32.3", "summary": "coo.convert_coo_to_dht operation", "description": "Convert a sparse tensor to a dense host tensor.\n It takes a sparse tensor and chain as input and outputs dht tensor and\n chain.\n\n Example:\n %4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0\n %5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.f32.0", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.f32.1", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.f32.2", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.f32.3", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.i32.0", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.i32.1", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.i32.2", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.convert_dht_to_coo.i32.3", "summary": "coo.convert_dht_to_coo operation", "description": "Convert a dense host tensor into a coo sparse host tensor.\n It takes a dht tensor and chain as input and outputs a coo tensor and chain.\n\n Example:\n %4, %3 = coo.convert_dht_to_coo.i32.0 %1, %0\n %5, %6 = coo.convert_dht_to_coo.i32.2 %2, %0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.print_tensor", "summary": "coo.print_tensor operation", "description": "An operation that prints a tensor.\n It takes a tensor and chain as input and outputs a chain.\n\n Example:\n %3 = coo.print_tensor %1, %2", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.f32.0", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.f32.1", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.f32.2", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.f32.3", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.i32.0", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.i32.1", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.i32.2", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "coo.tensor_equal.i32.3", "summary": "coo.tensor_equal operation", "description": "An operation that checks if two input tensors are equal.\n It takes two input tensors and a chain as inputs and outputs an i1 result\n and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = \"coo.tensor_equal.i32.2 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "corert_sync.const_dense_tensor", "summary": "Create a constant host tensor.", "description": "ConstDenseTensorOp creates a constant dense host tensor.\n\n Example:\n %tensor_handle = corert_sync.const_dense_tensor dense<[0, 1, 2]>: tensor<3xi32>", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.bf16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.complex128", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.complex64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.f16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.f32", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.f64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.i1", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.i16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.i32", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.i64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.i8", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.ui16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.ui32", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.ui64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.create_dense_tensor.ui8", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert_sync.executeop", "summary": "The CoreRuntime ExecuteOp", "description": "The ExecuteOp executes an operation on the specified device.\n\n Example:\n %res = corert_sync.executeop(%op_handler) \"some.op\"(%arg) : 1\n\n Note that the trailing number indicates the number of results.", "operands": [ { "name": "op_handler", "type": "CoreRT_OpHandlerType" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "corert_sync.get_op_handler", "summary": "return the registered op handler", "description": "GetOpHandler returns a registered op handler, which can be used by ExecuteOp.\n\n Example:\n %cpu = corert_sync.get_op_handler \"cpu\"", "results": [ { "name": "op_handler", "type": "CoreRT_OpHandlerType" } ], "attributes": [ { "name": "device_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$device_name attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.cond", "summary": "conditional operation", "description": "The \"corert.cond\" operation takes a tensorhandle as predicate, a 'true'\n function and a 'false' function. If the condition is true, the 'true'\n function is called and the \"hex.cond\" operation returns the results of that\n function, otherwise the \"false\" function is called and its values are\n returned.\n\n The 'true' and 'false' functions must have the same signature, but they may\n take an arbitrary number of arguments and return values with the same types\n as the op return types. Both functions are encoded as function attribute,\n named true_fn and false_fn. The a_ and b_ prefix prevent reordering by BEF\n since BEF orders attribute by name alphabetically.\n\n This operation is safe to use as a 'nonstrict' op, which dispatches its body\n whenever the condition and any dependent arguments are resolved.\n\n Example:\n\n %chain, %z = corert.cond %cond, @true_fn, @false_fn (%chain, %x, %y) : (i32)", "operands": [ { "name": "cond", "type": "CoreRT_TensorHandleType" }, { "name": "in_op_chain", "type": "TFRT_ChainType" }, { "name": "fn_operands", "type": "Variadic" } ], "results": [ { "name": "out_op_chain", "type": "TFRT_ChainType" }, { "name": "fn_outputs", "type": "Variadic" } ], "attributes": [ { "name": "a_true_fn", "type": "FlatSymbolRefAttr" }, { "name": "b_false_fn", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$cond $a_true_fn $b_false_fn `(` $in_op_chain (`,` $fn_operands^)? `)` attr-dict `:` `(` type($fn_operands) `)` `->` `(` type($fn_outputs) `)`", "hasCustomAssemblyFormat": true }, { "name": "corert.const_dense_tensor", "summary": "Create a constant dense host tensor.", "description": "ConstDenseTensorOp creates a constant dense host tensor.\n\n Example:\n %tensor_handle = corert.const_dense_tensor dense<[0, 1, 2]>: tensor<3xi32>", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.const_string_tensor", "summary": "Create a constant string host tensor.", "description": "ConstStringTensorOp creates a constant string host tensor.\n\n Example:\n %tensor_handle = corert.const_string_tensor {shape = [1, 2], value = [\"const\", \"string\"]}\n\n Note: if the entries in `value` are all the same, we can just keep one copy.\n In other words, the following two lines are effectively the same.\n %tensor_handle = corert.const_string_tensor {shape = [1, 2], value = [\"string\", \"string\"]}\n %tensor_handle = corert.const_string_tensor {shape = [1, 2], value = [\"string\"]}", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.bf16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.complex128", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.complex64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.f16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.f32", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.f64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.i1", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.i16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.i32", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.i64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.i8", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.ui16", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.ui32", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.ui64", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.create_dense_tensor.ui8", "summary": "Create a constant dense host tensor with explicit dtype and rank.", "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.executeop", "summary": "The CoreRuntime ExecuteOp", "description": "The ExecuteOp executes an operation on the specified op handler.\n\n Example:\n %res = corert.executeop(%op_handler) \"some.op\"(%arg) : 1\n\n Note that the trailing number indicates the number of results.\n\n\n The func attrs and op attrs are placed in two separate regions.\n\n Example:\n %res = corert.executeop(%op_handler) \"some.op\"(%arg)\n {attr1 = value, attr2 = value2} {f_attr1 = \"fn1\", f_attr2 = \"fn2\"} : 1\n\n Note that in this case, the first braket contains op attributes other than\n function attributes, and the second braket contains function attributes,\n which represent function names.", "operands": [ { "name": "op_handler", "type": "CoreRT_OpHandlerType" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "corert.executeop.seq", "summary": "The sequenced version of CoreRuntime ExecuteOp", "description": "The ExecuteOpSeq executes an operation on the specified op handler, similar to\n ExecuteOp. In addition, it takes an in_op_chain and produces an out_op_chain\n that can be used to sequence op executions. ExecuteOpSeq is nonstrict on\n in_op_chain.\n\n Example:\n %op_ch_out, %res = corert.executeop.seq(%op_handler, %op_ch_in) \"some.op\"(%arg) : 1\n\n Note that the trailing number indicates the number of results.\n\n The func attrs and op attrs are placed in two separate regions.\n\n Example:\n %op_ch_out, %res = corert.executeop.seq(%op_ch_in) \"some.op\"(%arg)\n {fn = function_1} {attr1 = value, attr2 = value2} : 1\n\n Note that in this case, the first braket contains op attributes other than\n function attributes, and the second braket contains function attributes,\n which represent function names.", "operands": [ { "name": "op_handler", "type": "CoreRT_OpHandlerType" }, { "name": "in_op_chain", "type": "TFRT_ChainType" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "out_op_chain", "type": "TFRT_ChainType" }, { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "corert.get_dst_tensor_type", "summary": "Get the type of the tensor to be used on the dst_device", "description": "Get the type of the tensor to be used on the dst_device.\n\n Example:\n %result = corert.get_dst_tensor_type %src_tensor_handle, %dst_device", "operands": [ { "name": "src_tensor_handle", "type": "CoreRT_TensorHandleType" }, { "name": "dst_device", "type": "TFRT_DeviceType" } ], "results": [ { "name": "result", "type": "TFRT_TensorTypeType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.get_op_handler", "summary": "return the registered op handler", "description": "GetOpHandler returns a registered op handler, which can be used by ExecuteOp.\n\n Example:\n %ch0 = tfrt.new.chain\n %cpu = corert.get_op_handler %ch0 \"cpu\"", "operands": [ { "name": "in_op_chain", "type": "TFRT_ChainType" } ], "results": [ { "name": "op_handler", "type": "CoreRT_OpHandlerType" } ], "attributes": [ { "name": "op_handler_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$in_op_chain $op_handler_name attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.register_op_handler", "summary": "Register a name for an OpHandler.", "description": "Register a name for the given OpHandler and make it accessible through\n corert.get_op_handler.\n\n Example:\n %chain = corert.register_op_handler %op_handler, \"my_op_handler0\"", "operands": [ { "name": "op_handler", "type": "CoreRT_OpHandlerType" } ], "results": [ { "name": "out_op_chain", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "op_handler_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$op_handler $op_handler_name attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.tensorhandle_to_int32", "summary": "Cast a TensorHandle to int32.", "description": "Cast a TensorHandle to int32.\n\n Example:\n %one = corert.tensorhandle_to_int32 %src_th", "operands": [ { "name": "src", "type": "CoreRT_TensorHandleType" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.transfer", "summary": "Transfer a TensorHandle to the specified device", "description": "Transfer a TensorHandle to the specified device.\n\n Example:\n %dst_th = corert.transfer %src_th {device=\"CPU:0\", dst_tensor_type_name=\"DenseHost\"}", "operands": [ { "name": "src", "type": "CoreRT_TensorHandleType" }, { "name": "device", "type": "TFRT_DeviceType" }, { "name": "dst_tensor_type", "type": "TFRT_TensorTypeType" } ], "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.transfer_inferred_tensortype", "summary": "Transfer a TensorHandle to the specified device", "description": "Transfer a TensorHandle to the specified device. Destination tensor type\n is inferred.\n\n Example:\n %dst_th = corert.transfer_inferred_type %src_th {device=\"CPU:0\"}", "operands": [ { "name": "src", "type": "CoreRT_TensorHandleType" }, { "name": "device", "type": "TFRT_DeviceType" } ], "results": [ { "name": "result", "type": "CoreRT_TensorHandleType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "corert.while", "summary": "while loop operation", "description": "The \"corert.while\" operation takes a 'Cond' function and a 'Body' function\n and performs the following action:\n fn_output = fn_operands; while(cond_fn(fn_output)) { fn_output = body_fn(fn_output) }\n\n The 'Cond' and 'Body' functions must have the same input signature, but they\n may take an arbitrary number of arguments. The 'Body' function must return\n values with the same types as the op return types. Both functions are\n encoded as function attribute, named cond_fn and body_fn. The a_ and b_\n prefix prevent reordering by BEF since BEF orders attribute by name\n alphabetically.\n\n This operation is safe to use as a 'nonstrict' op, which dispatches its body\n whenever the condition and any dependent arguments are resolved.\n\n Example:\n\n %chain, %z = corert.while @cond_fn, @body_fn (%chain, %x, %y) : (i32)", "operands": [ { "name": "in_op_chain", "type": "TFRT_ChainType" }, { "name": "fn_operands", "type": "Variadic" } ], "results": [ { "name": "out_op_chain", "type": "TFRT_ChainType" }, { "name": "fn_outputs", "type": "Variadic" } ], "attributes": [ { "name": "a_cond_fn", "type": "FlatSymbolRefAttr" }, { "name": "b_body_fn", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$a_cond_fn $b_body_fn `(` $in_op_chain (`,` $fn_operands^)? `)` attr-dict `:` `(` type($fn_operands) `)` `->` `(` type($fn_outputs) `)`", "hasCustomAssemblyFormat": true }, { "name": "cuda.alloc", "description": "`cuda.memory.alloc` performs an asynchronous memory allocation on the\n provided `stream`. The memory is associated with the device that is\n associated with the stream.\n\n The `dynamic_sizes` must be provided for each dynamic dimension of the\n result type.\n\n An optional alignment may be specified.", "operands": [ { "name": "stream", "type": "Optional" }, { "name": "dynamic_sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` ($dynamic_sizes^ `)`) : (`)`)?\n (`stream` `(` $stream^ `)`)?\n (`align` $alignment^)?\n attr-dict `:` type($result)" }, { "name": "cuda.blas.algo_select", "summary": "Retrieve possible GEMM algorithm, given the problem size", "description": "`cuda.blas.algo_select` tries to find the best possible cuBLAS GEMM algorithm\n for the given problem size using cuBLAS `cublasLtMatmulAlgoGetHeuristic` API. If\n no algorithm is found, it returns an error at the runtime.\n\n Problem size is defined with the following attributes,\n - `data_type`: Data type for input. For now, the input data type and cuBLAS\n matmul algorithm data type is same.\n - `size_a`: Size of input matrix A.\n\n NOTE: Unit of both the size and the stride is the number of elements of type\n `data_type`.\n\n - `stride_a`: Stride of input matrix A.\n\n NOTE: Even though the default cuBLAS format is `column-major`, default format\n used here and implemented at runtime is `row-major`.\n\n - `transpose_a`: If this unit attribute is set, matrix A is transposed before\n GEMM computation.\n - `size_b`: Size of input matrix B.\n - `stride_b`: Stride of input matrix B.\n - `transpose_b`: If this unit attribute is set, matrix B is transposed before\n GEMM computation.\n - `size_c`: Size of input matrix C.\n - `stride_c`: Stride of input matrix C.\n - `tile_sizes`: Desired CTA tile sizes for the M/N dimensions for the\n selected algorithm. 2 elements are expected in tile sizes. If any element\n is 0, then this argument will be considered as invalid.\n\n NOTE: All dimensions should be static.\n\n Example,\n ```mlir\n %r = cuda.blas.algo_select {\n data_type = f32,\n size_a = array,\n stride_a = array,\n size_b = array,\n stride_b = array,\n size_c = array,\n stride_c = array,\n tile_sizes = array\n } %h : !cuda.blas.gemm_algorithm\n ```\n If matrix A and C needs to be transposed,\n\n ```mlir\n %r = cuda.blas.algo_select {\n data_type = f32,\n size_a = array,\n stride_a = array,\n transpose_a,\n size_b = array,\n stride_b = array,\n size_c = array,\n stride_c = array,\n tile_sizes = array\n } %h : !cuda.blas.gemm_algorithm\n ```", "operands": [ { "name": "handle", "type": "CUDA_BlasHandle" } ], "results": [ { "name": "result", "type": "CUDA_BlasGemmAlgorithm" } ], "attributes": [ { "name": "data_type", "type": "TypeAttr" }, { "name": "size_a", "type": "DenseI64ArrayAttr" }, { "name": "stride_a", "type": "DenseI64ArrayAttr" }, { "name": "transpose_a", "type": "UnitAttr" }, { "name": "size_b", "type": "DenseI64ArrayAttr" }, { "name": "stride_b", "type": "DenseI64ArrayAttr" }, { "name": "transpose_b", "type": "UnitAttr" }, { "name": "size_c", "type": "DenseI64ArrayAttr" }, { "name": "stride_c", "type": "DenseI64ArrayAttr" }, { "name": "tile_sizes", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "attr-dict $handle `:` type($result)" }, { "name": "cuda.blas.handle.create", "summary": "Creates cuBLAS handle", "description": "Creates a cuBLAS handle that manages cuBLAS library context.\n\n Example,\n ```mlir\n %0 = cuda.blas.handle.create : !cuda.blas.handle\n ```", "results": [ { "name": "result", "type": "CUDA_BlasHandle" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "cuda.blas.handle.destroy", "summary": "Destroys cuBLAS handle", "description": "Destroys cuBLAS handle.\n Example,\n ```mlir\n %0 = cuda.blas.handle.create : !cuda.blas.handle\n cuda.blas.handle.destroy %0 : !cuda.blas.handle\n ```", "operands": [ { "name": "handle", "type": "CUDA_BlasHandle" } ], "assemblyFormat": "attr-dict $handle `:` type($handle)" }, { "name": "cuda.blas.run_gemm", "summary": "Runs cuBLAS gemm algorithm", "description": "`cuda.blas.run_gemm` runs GEMM or MatMul (Multiply-Accumulate) operation, based\n on input operands.\n GEMM is implemented as,\n `C = alpha*(A@B) + beta*C` (i.e. in-place GEMM).\n MatMul is implemented as,\n `C += A@B` (If `C` is non-zero, result of matmul `(A@B)` is accumulated into `C`.)\n\n NOTE: `@` represents matrix multiplication and `*` represents elementwise\n multiplication.\n\n - `handle`: cuBLAS Handle\n - `stream`: CUDA\n - `algo`: A gemm algorithm selected heuristically by `cuda.blas.algo_select` op\n for the given problem size.\n\n If the input has a `tensor` type, then `algo` should not be specified. The IR\n required to create `algo` is automatically added during bufferization.\n\n #### Implementing MatMul (C += A @ B)\n 1. If input has `tensor` type, only operand `mat_a`, `mat_b` and `mat_c` are\n compulsory.\n Example,\n ```mlir\n %a = arith.constant dense<2.0> : tensor<2x2xf32>\n %b = arith.constant dense<2.0> : tensor<2x2xf32>\n %c = arith.constant dense<0.0> : tensor<2x2xf32>\n %h = cuda.blas.handle.create : !cuda.blas.handle\n %s = cuda.stream.create : !cuda.stream\n\n %r = cuda.blas.run_gemm %h stream (%s) inputs(%a, %b) out (%c) : !cuda.blas.handle,\n !cuda.stream, tensor<2x2xf32>, tensor<2x2xf32>, tensor<2x2xf32>\n ```\n 2. If input has `memref` form, all operands are compulsory. Runtime sets both\n `alpha` and `beta` to 1.\n Example,\n ```mlir\n %a = memref.alloc() {alignment = 64 : i64} : memref<2x2xf32,\n #executor.memory_type>\n %b = memref.alloc() {alignment = 64 : i64} : memref<2x2xf32,\n #executor.memory_type>\n %c = memref.alloc() {alignment = 64 : i64} : memref<2x2xf32,\n #executor.memory_type>\n\n cuda.blas.run_gemm %h stream (%s) algo (%r) inputs(%a, %b) out (%c) :\n !cuda.blas.handle, !cuda.stream, !cuda.blas.gemm_algorithm,\n memref<2x2xf32, #executor.memory_type>, memref<2x2xf32, #executor.memory_type>, memref<2x2xf32, #executor.memory_type>\n ```\n\n #### Implementing GEMM (C = alpha*(A@B) + beta*C)\n 1. If input has `tensor` form, all operands except `algo` are compulsory.\n Example,\n ```\n %a = arith.constant dense<2.0> : tensor<2x2xf32>\n %b = arith.constant dense<2.0> : tensor<2x2xf32>\n %c = arith.constant dense<2.0> : tensor<2x2xf32>\n\n // set alpha and beta to 1.\n %alpha = arith.constant dense<1.0> : tensor<1xf32>\n %beta = arith.constant dense<1.0> : tensor<1xf32>\n %h = cuda.blas.handle.create : !cuda.blas.handle\n %s = cuda.stream.create : !cuda.stream\n\n %r = cuda.blas.run_gemm %h stream (%s) inputs(alpha %alpha, %a, %b, beta %beta)\n out (%c) : !cuda.blas.handle, !cuda.stream, tensor<1xf32>, tensor<2x2xf32>,\n tensor<2x2xf32>, tensor<1xf32>, tensor<2x2xf32>\n ```\n 2. If input has `memref` form, all operands are compulsory.\n Example,\n ```\n %a = memref.alloc() {alignment = 64 : i64} : memref<2x2xf32,\n #executor.memory_type>\n %b = memref.alloc() {alignment = 64 : i64} : memref<2x2xf32,\n #executor.memory_type>\n %c = memref.alloc() {alignment = 64 : i64} : memref<2x2xf32,\n #executor.memory_type>\n\n // set to intended values\n %alpha = memref.alloc() {alignment = 64 : i64} : memref<1xf32, #executor.memory_type>\n %beta = memref.alloc() {alignment = 64 : i64} : memref<1xf32, #executor.memory_type>\n\n cuda.blas.run_gemm %h stream (%s) algo (%r) inputs(alpha %alpha, %a, %b, beta %beta) out (%c) :\n !cuda.blas.handle, !cuda.stream, !cuda.blas.gemm_algorithm, memref<1xf32, #executor.memory_type>,\n memref<2x2xf32, #executor.memory_type>, memref<2x2xf32, #executor.memory_type>,\n memref<1xf32, #executor.memory_type>, memref<2x2xf32, #executor.memory_type>\n ```\n\n NOTE: If input is `memref`, memory space is on device.\n NOTE: `transpose_` attribute should be provided wherever necessary.", "operands": [ { "name": "handle", "type": "CUDA_BlasHandle" }, { "name": "stream", "type": "CUDA_Stream" }, { "name": "algo", "type": "Optional" }, { "name": "alpha", "type": "Optional" }, { "name": "mat_a", "type": "AnyShaped" }, { "name": "mat_b", "type": "AnyShaped" }, { "name": "beta", "type": "Optional" }, { "name": "mat_c", "type": "AnyShaped" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "transpose_a", "type": "UnitAttr" }, { "name": "transpose_b", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$handle `stream` `(` $stream `)` (`algo` `(` $algo^ `)`)?\n `inputs` `(`(`alpha` $alpha^ `,`)? $mat_a `,` $mat_b (`,` `beta` $beta^)?`)`\n `out` `(` $mat_c `)` attr-dict `:` type(operands)" }, { "name": "cuda.compiled_module", "summary": "represents a compiled CUDA binary", "description": "The `cuda.compiled_module` is a global operation that represents\n a compiled CUDA kernel module.\n\n The module contents can be provided in one of two ways:\n\n - `value`: an in-IR byte buffer (1D i8 ElementsAttr) containing the module\n data (e.g. PTX).\n - `file`: a path to a file containing the module data (e.g. a `.ptx` file).\n\n Exactly one of `value` or `file` must be specified.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "value", "type": "OptionalAttr" }, { "name": "file", "type": "OptionalAttr" }, { "name": "kind", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$sym_name ($value^)? (`file` $file^)? attr-dict" }, { "name": "cuda.copy_d2d", "description": "`cuda.memcpy_d2d` copies `num_bytes` from device buffer `source` to\n device buffer `target` at the specified offsets.", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "source", "type": "AnyMemRef" }, { "name": "target", "type": "AnyMemRef" } ], "assemblyFormat": "attr-dict `stream` `(` $stream`)` $source `,` $target `:` type($source) `to` type($target)" }, { "name": "cuda.copy_d2h", "description": "`cuda.memcpy_d2h` copies `num_bytes` from device buffer `source` to\n host buffer `target` at the specified offsets.", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "source", "type": "AnyMemRef" }, { "name": "target", "type": "AnyMemRef" } ], "assemblyFormat": "attr-dict `stream` `(` $stream`)` $source `,` $target `:` type($source) `to` type($target)" }, { "name": "cuda.copy_h2d", "description": "`cuda.memcpy_h2d` copies `num_bytes` from host buffer `source` to\n device buffer `target` at the specified offsets.", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "source", "type": "AnyMemRef" }, { "name": "target", "type": "AnyMemRef" } ], "assemblyFormat": "attr-dict `stream` `(` $stream`)` $source `,` $target `:` type($source) `to` type($target)" }, { "name": "cuda.dealloc", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "memref", "type": "AnyMemRef" } ], "assemblyFormat": "attr-dict `stream` `(` $stream `)` $memref `:` type($memref)" }, { "name": "cuda.event.create", "summary": "Creates a CUDA event", "description": "Creates a CUDA event object. This allocates a CUDA event resource.\n This is equivalent to `cudaEventCreate`.\n\n The `device` argument specifies which CUDA device the event should be\n associated with.", "operands": [ { "name": "device", "type": "I32" } ], "results": [ { "name": "result", "type": "CUDA_Event" } ], "assemblyFormat": "attr-dict `device` `(` $device `)`" }, { "name": "cuda.event.create_on_stream", "summary": "Creates and records a CUDA event on a stream", "description": "Creates a CUDA event associated with the same device as the given\n `stream`, then records the event on the stream. This is equivalent\n to `cuda.event.create` followed by `cuda.stream.record_event`.", "operands": [ { "name": "stream", "type": "CUDA_Stream" } ], "results": [ { "name": "result", "type": "CUDA_Event" } ], "assemblyFormat": "attr-dict $stream `:` type($stream)" }, { "name": "cuda.event.elapsed", "summary": "Computes time elapsed between two CUDA events", "description": "Computes the elapsed time in milliseconds between two CUDA events.\n This is equivalent to `cudaEventElapsedTime`.\n\n Both events must have been recorded (via `cuda.stream.record_event`)\n before calling this operation.", "operands": [ { "name": "start", "type": "CUDA_Event" }, { "name": "end", "type": "CUDA_Event" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "attr-dict $start `,` $end `:` qualified(type($result))" }, { "name": "cuda.event.release", "summary": "Releases a CUDA event", "description": "Releases the given CUDA event, freeing its associated resources.\n This is equivalent to `cudaEventDestroy`.\n\n After release, the event should not be used again.", "operands": [ { "name": "event", "type": "CUDA_Event" } ], "assemblyFormat": "attr-dict $event `:` qualified(type($event))" }, { "name": "cuda.event.sync", "summary": "Wait for a CUDA event to complete (host-side synchronization)", "description": "Blocks the host thread until the given event has completed. This is\n equivalent to `cudaEventSynchronize`.\n\n This op is preferred over synchronizing an entire stream when only a\n specific dependency needs to be enforced on the host.", "operands": [ { "name": "event", "type": "CUDA_Event" } ], "assemblyFormat": "attr-dict $event `:` qualified(type($event))" }, { "name": "cuda.get_active_device", "summary": "returns the ID of the device associated with the active CUDA context", "description": "Returns the ID of the CUDA device that is active for the current\n thread. This is equivalent to the device associated with the currently\n active CUDA driver context (CUcontext).\n\n In our runtime model, a program is usually associated with a\n single-threaded execution context, and the CUDA runtime associates an\n \"active context\" with each thread. If no operation is invoked that can\n change the active context associatd with the thread within each\n function, then we we are free to deduplicate or hoist instances\n of this operation.\n\n Programs that use multiple devices must perform additional analysis\n to determine whether de-duplication or reordering of this operation\n is safe.\n\n This operation is marked as having a read side-effect on an\n unknown resource in order to prevent speculation. However, it can\n be safely dropped if there are no users.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict" }, { "name": "cuda.get_device", "summary": "returns the identifier of a particular device", "description": "Returns the identifier for a particular CUDA device. Note that\n currently this is just the identity function since the CUDA runtime\n identifies devices by their ordinal.\n\n Note that this operation is marked as being speculatable and\n side-effect free. We assume that the number of devices cannot\n change during the execution of the program and that the\n IDs associated with devices cannot change.", "operands": [ { "name": "deviceNumber", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict $deviceNumber `:` type($result)" }, { "name": "cuda.get_function", "summary": "retrieves a CUDA function handle from a compiled module", "description": "The `cuda.get_function` operation references a `cuda.compiled_module`\n and returns an opaque `cuda.function` (representing a `CUfunction`\n from the CUDA driver API). The specific kernel entrypoint retrieved\n is given by the `kernel_name`.", "results": [ { "name": "result", "type": "CUDA_Function" } ], "attributes": [ { "name": "module", "type": "FlatSymbolRefAttr" }, { "name": "kernel_name", "type": "StrAttr" } ], "assemblyFormat": "attr-dict $kernel_name `from` $module" }, { "name": "cuda.get_global_stream", "summary": "gets handle to the runtime's CUDA stream associated with the specified device", "description": "The `cuda.stream.get_global_stream` operation returns a handle to the\n runtime's CUDA stream associated with the specified device.\n\n Each device has a pool of global streams addressable by `index`.", "operands": [ { "name": "device", "type": "I32" } ], "results": [ { "name": "result", "type": "CUDA_Stream" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "assemblyFormat": "attr-dict `device` `(` $device `)` `[` $index `]`" }, { "name": "cuda.get_program_device", "summary": "returns the CUDA device ordinal associated with a program logical device", "description": "Returns the CUDA device ordinal for the given program \"logical device\"\n identifier.\n\n This operation is intended to support compilation modes where device\n selection is modeled explicitly and provided by the runtime when the\n program is loaded (e.g. via a constant mapping table). As a result, this\n operation is marked as being speculatable and side-effect free.", "operands": [ { "name": "logicalDevice", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict $logicalDevice `:` type($result)" }, { "name": "cuda.launch", "operands": [ { "name": "func", "type": "CUDA_Function" }, { "name": "grid_x", "type": "I32" }, { "name": "grid_y", "type": "I32" }, { "name": "grid_z", "type": "I32" }, { "name": "block_x", "type": "I32" }, { "name": "block_y", "type": "I32" }, { "name": "block_z", "type": "I32" }, { "name": "dynamic_shared_mem", "type": "I32" }, { "name": "stream", "type": "CUDA_Stream" }, { "name": "args", "type": "Variadic>" } ], "assemblyFormat": "attr-dict\n $func `(` ($args^ `:` type($args))? `)` `with` `\\n`\n ` ` `grid` `(` $grid_x `,` $grid_y `,` $grid_z `)` `\\n`\n ` ` `block` `(` $block_x `,` $block_y `,` $block_z `)` `\\n`\n ` ` `smem` `(` $dynamic_shared_mem `)` `stream` `(` $stream `)`" }, { "name": "cuda.memset", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "fill_value", "type": "AnyTypeOf<[I32, F32, I16, F16, BF16, I8, F8E4M3FN]>" } ], "assemblyFormat": "attr-dict `stream` `(` $stream `)` $memref `with` $fill_value\n `:` type($memref) `,` type($fill_value)" }, { "name": "cuda.num_devices", "summary": "returns the number of CUDA devices on the host", "description": "Returns the number of CUDA devices (e.g. GPUs) on the host. This is\n equivalent to the `cudaDeviceCount` CUDA runtime API call.\n\n Note that this operation is marked as being speculatable and\n side-effect free. We assume that the number of devices cannot\n change during the execution of the program.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "cuda.set_active_device", "summary": "sets the active CUDA device context", "description": "Sets the active CUDA device context for the current thread.\n\n This operation is marked as having a write side-effect on an\n unknown resource in order to prevent speculation. Since this\n change the active device, it cannot be safely reordered or\n dropped without careful analysis.\n\n This operation is rarely used outside of testing since\n currently our Executor runtime assumes that there is a\n single device per execution context and that multi-device\n programs are executed in SPMD fashion by utilizing one execution\n session per device and one thread per execution context.\n\n In the future, we may support multiple devices for a\n single program and/or multiple threads per program. In such\n cases, this operation can be utilized to change the device.", "operands": [ { "name": "device", "type": "I32" } ], "assemblyFormat": "attr-dict $device" }, { "name": "cuda.stream.create", "summary": "Creates an asynchronous CUDA stream", "description": "Creates a CUDA stream associated with the given device.\n This is equivalent to `cudaStreamCreate`.", "operands": [ { "name": "device", "type": "I32" } ], "results": [ { "name": "result", "type": "CUDA_Stream" } ], "assemblyFormat": "attr-dict `device` `(` $device `)`" }, { "name": "cuda.stream.destroy", "summary": "Destroy CUDA stream", "operands": [ { "name": "stream", "type": "CUDA_Stream" } ], "assemblyFormat": "attr-dict $stream `:` type($stream)" }, { "name": "cuda.stream.record_event", "summary": "Records an event in the given stream", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "event", "type": "CUDA_Event" } ], "assemblyFormat": "attr-dict $stream `,` $event" }, { "name": "cuda.stream.sync", "summary": "Wait for stream tasks to complete", "operands": [ { "name": "stream", "type": "CUDA_Stream" } ], "assemblyFormat": "attr-dict $stream `:` type($stream)" }, { "name": "cuda.stream.wait_event", "summary": "Makes stream wait on a CUDA event", "operands": [ { "name": "stream", "type": "CUDA_Stream" }, { "name": "event", "type": "CUDA_Event" } ], "assemblyFormat": "attr-dict $stream `,` $event" }, { "name": "emitc.add", "summary": "Addition operation", "description": "With the `emitc.add` operation the arithmetic operator + (addition) can\n be applied.\n\n Example:\n\n ```mlir\n // Custom form of the addition operation.\n %0 = emitc.add %arg0, %arg1 : (i32, i32) -> i32\n %1 = emitc.add %arg2, %arg3 : (!emitc.ptr, i32) -> !emitc.ptr\n ```\n ```c++\n // Code emitted for the operations above.\n int32_t v5 = v1 + v2;\n float* v6 = v3 + v4;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.address_of", "summary": "Address operation", "description": "This operation models the C & (address of) operator for a single operand,\n which must be an emitc.lvalue, and returns an emitc pointer to its location.\n\n Example:\n\n ```mlir\n // Custom form of applying the & operator.\n %0 = emitc.address_of %arg0 : (!emitc.lvalue) -> !emitc.ptr\n ```", "operands": [ { "name": "reference", "type": "EmitC_LValueType" } ], "results": [ { "name": "result", "type": "EmitC_PointerType" } ], "traits": [ { "type": "TypesMatchWith<'reference', 'result', 'emitc::PointerType::get(::llvm::cast($_self).getValueType())'>" } ], "assemblyFormat": "$reference `:` qualified(type($reference)) attr-dict" }, { "name": "emitc.apply", "summary": "Deprecated (use address_of/dereference)", "description": "With the `emitc.apply` operation the operators & (address of) and * (contents of)\n can be applied to a single operand.\n\n Example:\n\n ```mlir\n // Custom form of applying the & operator.\n %0 = emitc.apply \"&\"(%arg0) : (!emitc.lvalue) -> !emitc.ptr\n\n // Generic form of the same operation.\n %0 = \"emitc.apply\"(%arg0) {applicableOperator = \"&\"}\n : (!emitc.lvalue) -> !emitc.ptr\n\n ```", "operands": [ { "name": "operand", "type": "AnyTypeOf<[EmitCType, EmitC_LValueType]>" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "attributes": [ { "name": "applicableOperator", "type": "StrAttr" } ], "assemblyFormat": "$applicableOperator `(` $operand `)` attr-dict `:` functional-type($operand, results)" }, { "name": "emitc.assign", "summary": "Assign operation", "description": "The `emitc.assign` operation stores an SSA value to the location designated by an\n EmitC variable. This operation doesn't return any value. The assigned value\n must be of the same type as the variable being assigned. The operation is\n emitted as a C/C++ '=' operator.\n\n Example:\n\n ```mlir\n // Integer variable\n %0 = \"emitc.variable\"(){value = 42 : i32} : () -> !emitc.lvalue\n %1 = emitc.call_opaque \"foo\"() : () -> (i32)\n\n // Assign emitted as `... = ...;`\n \"emitc.assign\"(%0, %1) : (!emitc.lvalue, i32) -> ()\n ```", "operands": [ { "name": "var", "type": "EmitC_LValueType" }, { "name": "value", "type": "EmitCType" } ], "assemblyFormat": "$value `:` type($value) `to` $var `:` type($var) attr-dict" }, { "name": "emitc.bitwise_and", "summary": "Bitwise and operation", "description": "With the `emitc.bitwise_and` operation the bitwise operator & (and) can\n be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.bitwise_and %arg0, %arg1 : (i32, i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v3 = v1 & v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.bitwise_left_shift", "summary": "Bitwise left shift operation", "description": "With the `emitc.bitwise_left_shift` operation the bitwise operator <<\n (left shift) can be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.bitwise_left_shift %arg0, %arg1 : (i32, i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v3 = v1 << v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.bitwise_not", "summary": "Bitwise not operation", "description": "With the `emitc.bitwise_not` operation the bitwise operator ~ (not) can\n be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.bitwise_not %arg0 : (i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v2 = ~v1;\n ```", "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.bitwise_or", "summary": "Bitwise or operation", "description": "With the `emitc.bitwise_or` operation the bitwise operator | (or)\n can be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.bitwise_or %arg0, %arg1 : (i32, i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v3 = v1 | v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.bitwise_right_shift", "summary": "Bitwise right shift operation", "description": "With the `emitc.bitwise_right_shift` operation the bitwise operator >>\n (right shift) can be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.bitwise_right_shift %arg0, %arg1 : (i32, i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v3 = v1 >> v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.bitwise_xor", "summary": "Bitwise xor operation", "description": "With the `emitc.bitwise_xor` operation the bitwise operator ^ (xor)\n can be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.bitwise_xor %arg0, %arg1 : (i32, i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v3 = v1 ^ v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.call", "summary": "Call operation", "description": "The `emitc.call` operation represents a direct call to an `emitc.func`\n that is within the same symbol scope as the call. The operands and result type\n of the call must match the specified function type. The callee is encoded as a\n symbol reference attribute named \"callee\".\n\n Example:\n\n ```mlir\n %2 = emitc.call @my_add(%0, %1) : (f32, f32) -> f32\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "emitc.call_opaque", "summary": "Opaque call operation", "description": "The `emitc.call_opaque` operation represents a C++ function call. The callee\n can be an arbitrary non-empty string. The call allows specifying order\n of operands and attributes in the call as follows:\n\n - integer value of index type refers to an operand;\n - attribute which will get lowered to constant value in call;\n\n Example:\n\n ```mlir\n // Custom form defining a call to `foo()`.\n %0 = emitc.call_opaque \"foo\" () : () -> i32\n\n // Generic form of the same operation.\n %0 = \"emitc.call_opaque\"() {callee = \"foo\"} : () -> i32\n ```", "operands": [ { "name": "arg_operands", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "StrAttr" }, { "name": "args", "type": "OptionalAttr" }, { "name": "template_args", "type": "OptionalAttr" } ], "assemblyFormat": "$callee `(` $arg_operands `)` prop-dict attr-dict `:` functional-type($arg_operands, results)" }, { "name": "emitc.cast", "summary": "Cast operation", "description": "The `emitc.cast` operation performs an explicit type conversion and is emitted\n as a C-style cast expression. It can be applied to integer, float, index\n and EmitC types.\n\n Example:\n\n ```mlir\n // Cast from `int32_t` to `float`\n %0 = emitc.cast %arg0: i32 to f32\n\n // Cast from `void` to `int32_t` pointer\n %1 = emitc.cast %arg1 :\n !emitc.ptr> to !emitc.ptr\n ```\n\n In general, C++ cast expressions cannot always be assumed to be pure:\n they may invoke user-defined conversions or be affected by floating-point\n environment settings. However, in many practical cases, such as integer\n casts without operator overloading, the cast is pure and can be treated as\n speculatable and side-effect-free. For such cases, the `pure` attribute\n may be used.\n\n When `pure` attribute is set, `getSpeculatability()` returns `Speculatable`\n and `getEffects()` reports no effects. It is UB if the `pure` attribute is\n set and the actual conversion is not pure, e.g. when the user-defined\n conversion has memory effects.", "operands": [ { "name": "source", "type": "EmitCType" } ], "results": [ { "name": "dest", "type": "EmitCType" } ], "attributes": [ { "name": "pure", "type": "UnitAttr" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "emitc.class", "summary": "Represents a C++ class definition, encapsulating fields and methods.", "description": "The `emitc.class` operation defines a C++ class, acting as a container\n for its data fields (`emitc.field`) and methods (`emitc.func`).\n It creates a distinct scope, isolating its contents from the surrounding\n MLIR region, similar to how C++ classes encapsulate their internals.\n\n Example:\n\n ```mlir\n emitc.class @modelClass {\n emitc.field @fieldName0 : !emitc.array<1xf32> = {emitc.opaque = \"input_tensor\"}\n emitc.func @execute() {\n %0 = \"emitc.constant\"() <{value = 0 : index}> : () -> !emitc.size_t\n %1 = get_field @fieldName0 : !emitc.array<1xf32>\n %2 = subscript %1[%0] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue\n return\n }\n }\n // Class with a final specifer\n emitc.class final @modelClass {\n emitc.field @fieldName0 : !emitc.array<1xf32> = {emitc.opaque = \"input_tensor\"}\n emitc.func @execute() {\n %0 = \"emitc.constant\"() <{value = 0 : index}> : () -> !emitc.size_t\n %1 = get_field @fieldName0 : !emitc.array<1xf32>\n %2 = subscript %1[%0] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue\n return\n }\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "final_specifier", "type": "UnitAttr" }, { "name": "class_type", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "($class_type^)? (`final` $final_specifier^)? $sym_name attr-dict-with-keyword $body" }, { "name": "emitc.cmp", "summary": "Comparison operation", "description": "With the `emitc.cmp` operation the comparison operators ==, !=, <, <=, >, >=, <=>\n can be applied.\n\n Its first argument is an attribute that defines the comparison operator:\n\n - equal to (mnemonic: `\"eq\"`; integer value: `0`)\n - not equal to (mnemonic: `\"ne\"`; integer value: `1`)\n - less than (mnemonic: `\"lt\"`; integer value: `2`)\n - less than or equal to (mnemonic: `\"le\"`; integer value: `3`)\n - greater than (mnemonic: `\"gt\"`; integer value: `4`)\n - greater than or equal to (mnemonic: `\"ge\"`; integer value: `5`)\n - three-way-comparison (mnemonic: `\"three_way\"`; integer value: `6`)\n\n Example:\n ```mlir\n // Custom form of the cmp operation.\n %0 = emitc.cmp eq, %arg0, %arg1 : (i32, i32) -> i1\n %1 = emitc.cmp lt, %arg2, %arg3 :\n (\n !emitc.opaque<\"std::valarray\">,\n !emitc.opaque<\"std::valarray\">\n ) -> !emitc.opaque<\"std::valarray\">\n ```\n ```c++\n // Code emitted for the operations above.\n bool v5 = v1 == v2;\n std::valarray v6 = v3 < v4;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "attributes": [ { "name": "predicate", "type": "EmitC_CmpPredicateAttr{eq|ne|lt|le|gt|ge|three_way}" } ], "assemblyFormat": "$predicate `,` operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.conditional", "summary": "Conditional (ternary) operation", "description": "With the `emitc.conditional` operation the ternary conditional operator can\n be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.cmp gt, %arg0, %arg1 : (i32, i32) -> i1\n\n %c0 = \"emitc.constant\"() {value = 10 : i32} : () -> i32\n %c1 = \"emitc.constant\"() {value = 11 : i32} : () -> i32\n\n %1 = emitc.conditional %0, %c0, %c1 : i32\n ```\n ```c++\n // Code emitted for the operations above.\n bool v3 = v1 > v2;\n int32_t v4 = 10;\n int32_t v5 = 11;\n int32_t v6 = v3 ? v4 : v5;\n ```", "operands": [ { "name": "condition", "type": "I1" }, { "name": "true_value", "type": "EmitCType" }, { "name": "false_value", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)" }, { "name": "emitc.constant", "summary": "Constant operation", "description": "The `emitc.constant` operation produces an SSA value equal to some constant\n specified by an attribute. This can be used to form simple integer and\n floating point constants, as well as more exotic things like tensor\n constants. The `emitc.constant` operation also supports the EmitC opaque\n attribute and the EmitC opaque type. Since folding is supported,\n it should not be used with pointers.\n\n Example:\n\n ```mlir\n // Integer constant\n %0 = \"emitc.constant\"(){value = 42 : i32} : () -> i32\n\n // Constant emitted as `char = CHAR_MIN;`\n %1 = \"emitc.constant\"() {value = #emitc.opaque<\"CHAR_MIN\">}\n : () -> !emitc.opaque<\"char\">\n ```", "results": [ { "name": "result", "type": "EmitCType" } ], "attributes": [ { "name": "value", "type": "EmitC_OpaqueOrTypedAttr" } ] }, { "name": "emitc.declare_func", "summary": "An operation to declare a function", "description": "The `emitc.declare_func` operation allows to insert a function declaration for an\n `emitc.func` at a specific position. The operation only requires the \"callee\"\n of the `emitc.func` to be specified as an attribute.\n\n Example:\n\n ```mlir\n emitc.declare_func @bar\n emitc.func @foo(%arg0: i32) -> i32 {\n %0 = emitc.call @bar(%arg0) : (i32) -> (i32)\n emitc.return %0 : i32\n }\n\n emitc.func @bar(%arg0: i32) -> i32 {\n emitc.return %arg0 : i32\n }\n ```\n\n ```c++\n // Code emitted for the operations above.\n int32_t bar(int32_t v1);\n int32_t foo(int32_t v1) {\n int32_t v2 = bar(v1);\n return v2;\n }\n\n int32_t bar(int32_t v1) {\n return v1;\n }\n ```", "attributes": [ { "name": "sym_name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$sym_name attr-dict" }, { "name": "emitc.dereference", "summary": "Dereference operation", "description": "This operation models the C * (dereference) operator, which must be of\n !emitc.ptr<> type, returning an !emitc.lvalue<> the value pointed to by the\n pointer.\n\n Example:\n\n ```mlir\n // Custom form of the dereference operator.\n %0 = emitc.dereference %arg0 : (!emitc.ptr) -> !emitc.lvalue\n ```", "operands": [ { "name": "pointer", "type": "EmitC_PointerType" } ], "results": [ { "name": "result", "type": "EmitC_LValueType" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'emitc::LValueType::get(::llvm::cast($_self).getPointee())'>" } ], "assemblyFormat": "$pointer `:` qualified(type($pointer)) attr-dict" }, { "name": "emitc.div", "summary": "Division operation", "description": "With the `emitc.div` operation the arithmetic operator / (division) can\n be applied.\n\n Example:\n\n ```mlir\n // Custom form of the division operation.\n %0 = emitc.div %arg0, %arg1 : (i32, i32) -> i32\n %1 = emitc.div %arg2, %arg3 : (f32, f32) -> f32\n ```\n ```c++\n // Code emitted for the operations above.\n int32_t v5 = v1 / v2;\n float v6 = v3 / v4;\n ```", "results": [ { "name": "result", "type": "FloatIntegerIndexOrOpaqueType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.do", "summary": "Do-while operation", "description": "The `emitc.do` operation represents a C/C++ do-while loop construct that\n repeatedly executes a body region as long as a condition region evaluates to\n true. The operation has two regions:\n\n 1. A body region that contains the loop body\n 2. A condition region that must yield a boolean value (i1)\n\n The condition is evaluated before each iteration as follows:\n - The condition region must contain exactly one block with:\n 1. An `emitc.expression` operation producing an i1 value\n 2. An `emitc.yield` passing through the expression result\n - The expression's body contains the actual condition logic\n\n The body region is executed before the first evaluation of the\n condition. Thus, there is a guarantee that the loop will be executed\n at least once. The loop terminates when the condition yields false.\n\n The canonical structure of `emitc.do` is:\n\n ```mlir\n emitc.do {\n // Body region (no terminator required).\n // Loop body operations...\n } while {\n // Condition region (must yield i1)\n %condition = emitc.expression : () -> i1 {\n // Condition computation...\n %result = ... : i1 // Last operation must produce i1\n emitc.yield %result : i1\n }\n // Forward expression result\n emitc.yield %condition : i1\n }\n ```\n\n Example:\n\n ```mlir\n emitc.func @do_example() {\n %counter = \"emitc.variable\"() <{value = 0 : i32}> : () -> !emitc.lvalue\n %end = emitc.literal \"10\" : i32\n %step = emitc.literal \"1\" : i32\n\n emitc.do {\n // Print current value\n %val = emitc.load %counter : !emitc.lvalue\n emitc.verbatim \"printf(\\\"%d\\\\n\\\", {});\" args %val : i32\n\n // Increment counter\n %new_val = emitc.add %val, %step : (i32, i32) -> i32\n \"emitc.assign\"(%counter, %new_val) : (!emitc.lvalue, i32) -> ()\n } while {\n %condition = emitc.expression %counter, %end : (!emitc.lvalue, i32) -> i1 {\n %current = emitc.load %counter : !emitc.lvalue\n %cmp_res = emitc.cmp lt, %current, %end : (i32, i32) -> i1\n emitc.yield %cmp_res : i1\n }\n emitc.yield %condition : i1\n }\n return\n }\n ```\n ```c++\n // Code emitted for the operation above.\n void do_example() {\n int32_t v1 = 0;\n do {\n int32_t v2 = v1;\n printf(\"%d\\n\", v2);\n int32_t v3 = v2 + 1;\n v1 = v3;\n } while (v1 < 10);\n return;\n }\n ```", "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" }, { "name": "conditionRegion", "type": "SizedRegion<1>" } ], "defaultDialect": "emitc", "hasCustomAssemblyFormat": true }, { "name": "emitc.expression", "summary": "Expression operation", "description": "The `emitc.expression` operation returns a single SSA value which is yielded by\n its single-basic-block region. The operation takes zero or more input operands\n that are passed as block arguments to the region.\n\n As the operation is to be emitted as a C expression, the operations within\n its body must form a single Def-Use tree, or a DAG trivially expandable to\n one, i.e. a DAG where each operation with side effects is only reachable\n once from the expression root.\n\n Input operands can be of both value types (`EmitCType`) and lvalue types\n (`EmitC_LValueType`).\n\n Example:\n ```mlir\n %r = emitc.expression %a, %b, %c : (i32, i32, i32) -> i32 {\n %0 = emitc.call_opaque \"foo\"(%a) : (i32) -> i32\n %1 = emitc.add %b, %c : (i32, i32) -> i32\n %2 = emitc.mul %0, %1 : (i32, i32) -> i32\n emitc.yield %2 : i32\n }\n ```\n\n May be emitted as:\n ```c++\n int32_t v4 = foo(v1) * (v2 + v3);\n ```\n\n When specified, the optional `noinline` indicates that the expression is\n to be emitted as seen above, i.e. as the rhs of an EmitC SSA value\n definition. Otherwise, the expression may be emitted inline, i.e. directly\n at its use.", "operands": [ { "name": "defs", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[EmitCType, EmitC_LValueType]>" } ], "attributes": [ { "name": "do_not_inline", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "defaultDialect": "emitc", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "emitc.field", "summary": "A field within a class", "description": "The `emitc.field` operation declares a named field within an `emitc.class`\n operation. The field's type must be an EmitC type.\n\n Example:\n\n ```mlir\n // Example with an attribute:\n emitc.field @fieldName0 : !emitc.array<1xf32> {emitc.opaque = \"another_feature\"}\n // Example with no attribute:\n emitc.field @fieldName0 : !emitc.array<1xf32>\n // Example with an initial value:\n emitc.field @fieldName0 : !emitc.array<1xf32> = dense<0.0>\n // Example with an initial value and attributes:\n emitc.field @fieldName0 : !emitc.array<1xf32> = dense<0.0> {\n emitc.opaque = \"input_tensor\"}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "initial_value", "type": "OptionalAttr" } ], "assemblyFormat": "$sym_name\n `:` custom($type, $initial_value)\n attr-dict" }, { "name": "emitc.file", "summary": "A file container operation", "description": "A `file` represents a single C/C++ file.\n\n `mlir-translate` ignores the body of all `emitc.file` ops\n unless the `-file-id=id` flag is used. With that flag, all `emitc.file` ops\n with matching id are emitted.\n\n Example:\n\n ```mlir\n emitc.file \"main\" {\n emitc.func @func_one() {\n emitc.return\n }\n }\n ```", "attributes": [ { "name": "id", "type": "Builtin_StringAttr" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "defaultDialect": "emitc", "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$id attr-dict-with-keyword $bodyRegion" }, { "name": "emitc.for", "summary": "For operation", "description": "The `emitc.for` operation represents a C loop of the following form:\n\n ```c++\n for (T i = lb; i < ub; i += step) { /* ... */ } // where T is typeof(lb)\n ```\n\n The operation takes 3 SSA values as operands that represent the lower bound,\n upper bound and step respectively, and defines an SSA value for its\n induction variable. It has one region capturing the loop body. The induction\n variable is represented as an argument of this region. This SSA value is a\n signless integer, or an index. The step is a value of same type.\n\n This operation has no result. The body region must contain exactly one block\n that terminates with `emitc.yield`. Calling ForOp::build will create such a\n region and insert the terminator implicitly if none is defined, so will the\n parsing even in cases when it is absent from the custom format. For example:\n\n ```mlir\n // Index case.\n emitc.for %iv = %lb to %ub step %step {\n ... // body\n }\n ...\n // Integer case.\n emitc.for %iv_32 = %lb_32 to %ub_32 step %step_32 : i32 {\n ... // body\n }\n ```", "operands": [ { "name": "lowerBound", "type": "IntegerIndexOrOpaqueType" }, { "name": "upperBound", "type": "IntegerIndexOrOpaqueType" }, { "name": "step", "type": "IntegerIndexOrOpaqueType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "defaultDialect": "emitc", "traits": [ { "type": "AllTypesMatch<['lowerBound', 'upperBound', 'step']>" } ], "hasCustomAssemblyFormat": true }, { "name": "emitc.func", "summary": "An operation with a name containing a single `SSACFG` region", "description": "Operations within the function cannot implicitly capture values defined\n outside of the function, i.e. Functions are `IsolatedFromAbove`. All\n external references must use function arguments or attributes that establish\n a symbolic connection (e.g. symbols referenced by name via a string\n attribute like SymbolRefAttr). While the MLIR textual form provides a nice\n inline syntax for function arguments, they are internally represented as\n “block arguments” to the first block in the region.\n\n Only dialect attribute names may be specified in the attribute dictionaries\n for function arguments, results, or the function itself.\n\n Example:\n\n ```mlir\n // A function with no results:\n emitc.func @foo(%arg0 : i32) {\n emitc.call_opaque \"bar\" (%arg0) : (i32) -> ()\n emitc.return\n }\n\n // A function with its argument as single result:\n emitc.func @foo(%arg0 : i32) -> i32 {\n emitc.return %arg0 : i32\n }\n\n // A function with specifiers attribute:\n emitc.func @example_specifiers_fn_attr() -> i32\n attributes {specifiers = [\"static\",\"inline\"]} {\n %0 = emitc.call_opaque \"foo\" (): () -> i32\n emitc.return %0 : i32\n }\n\n // An external function definition:\n emitc.func private @extern_func(i32)\n attributes {specifiers = [\"extern\"]}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "specifiers", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "emitc", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "emitc.get_field", "summary": "Obtain access to a field within a class instance", "description": "The `emitc.get_field` operation retrieves the lvalue of a\n named field from a given class instance.\n\n Example:\n\n ```mlir\n %0 = get_field @fieldName0 : !emitc.array<1xf32>\n ```", "results": [ { "name": "result", "type": "EmitCType" } ], "attributes": [ { "name": "field_name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$field_name `:` type($result) attr-dict" }, { "name": "emitc.get_global", "summary": "Obtain access to a global variable", "description": "The `emitc.get_global` operation retrieves the lvalue of a\n named global variable. If the global variable is marked constant, assigning\n to that lvalue is undefined.\n\n Example:\n\n ```mlir\n %x = emitc.get_global @foo : !emitc.array<2xf32>\n %y = emitc.get_global @bar : !emitc.lvalue\n ```", "results": [ { "name": "result", "type": "AnyTypeOf<[EmitC_ArrayType, EmitC_LValueType]>" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$name `:` type($result) attr-dict" }, { "name": "emitc.global", "summary": "A global variable", "description": "The `emitc.global` operation declares or defines a named global variable.\n The backing memory for the variable is allocated statically and described by\n the variable's type, which must be an EmitC type.\n Optionally, an `initial_value` can be provided.\n Internal linkage can be specified using the `static_specifier` unit attribute\n and external linkage can be specified using the `extern_specifier` unit attribute.\n Note that the default linkage without those two keywords depends on whether\n the target is C or C++ and whether the global variable is `const`.\n The global variable can also be marked constant using the `const_specifier`\n unit attribute. Writing to such constant global variables is\n undefined.\n\n The global variable can be accessed by using the `emitc.get_global` to\n retrieve the value for the global variable.\n\n Example:\n\n ```mlir\n // Global variable with an initial value.\n emitc.global @x : !emitc.array<2xf32> = dense<0.0>\n // Global variable with an initial values.\n emitc.global @x : !emitc.array<3xi32> = dense<[0, 1, 2]>\n // Global variable with an opaque initial value.\n emitc.global @x : !emitc.opaque<\"char\"> = #emitc.opaque<\"CHAR_MIN\">\n // External global variable\n emitc.global extern @x : !emitc.array<2xf32>\n // Constant global variable with internal linkage\n emitc.global static const @x : i32 = 0\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "initial_value", "type": "OptionalAttr" }, { "name": "extern_specifier", "type": "UnitAttr" }, { "name": "static_specifier", "type": "UnitAttr" }, { "name": "const_specifier", "type": "UnitAttr" } ], "assemblyFormat": "(`extern` $extern_specifier^)?\n (`static` $static_specifier^)?\n (`const` $const_specifier^)?\n $sym_name\n `:` custom($type, $initial_value)\n attr-dict" }, { "name": "emitc.if", "summary": "If-then-else operation", "description": "The `emitc.if` operation represents an if-then-else construct for\n conditionally executing two regions of code. The operand to an if operation\n is a boolean value. For example:\n\n ```mlir\n emitc.if %b {\n ...\n } else {\n ...\n }\n ```\n\n The \"then\" region has exactly 1 block. The \"else\" region may have 0 or 1\n blocks. The blocks are always terminated with `emitc.yield`, which can be\n left out to be inserted implicitly. This operation doesn't produce any\n results.", "operands": [ { "name": "condition", "type": "I1" } ], "regions": [ { "name": "thenRegion", "type": "SizedRegion<1>" }, { "name": "elseRegion", "type": "MaxSizedRegion<1>" } ], "defaultDialect": "emitc", "hasCustomAssemblyFormat": true }, { "name": "emitc.include", "summary": "Include operation", "description": "The `emitc.include` operation allows to define a source file inclusion via the\n `#include` directive.\n\n Example:\n\n ```mlir\n // Custom form defining the inclusion of ``.\n emitc.include <\"myheader.h\">\n\n // Generic form of the same operation.\n \"emitc.include\" (){include = \"myheader.h\", is_standard_include} : () -> ()\n\n // Custom form defining the inclusion of `\"myheader\"`.\n emitc.include \"myheader.h\"\n\n // Generic form of the same operation.\n \"emitc.include\" (){include = \"myheader.h\"} : () -> ()\n ```", "attributes": [ { "name": "include", "type": "StrAttr" }, { "name": "is_standard_include", "type": "UnitAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "emitc.literal", "summary": "Literal operation", "description": "The `emitc.literal` operation produces an SSA value equal to some constant\n specified by an attribute.\n\n Example:\n\n ```mlir\n %p0 = emitc.literal \"M_PI\" : f32\n %1 = \"emitc.add\" (%arg0, %p0) : (f32, f32) -> f32\n ```\n ```c++\n // Code emitted for the operation above.\n float v2 = v1 + M_PI;\n ```", "results": [ { "name": "result", "type": "EmitCType" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "$value attr-dict `:` type($result)" }, { "name": "emitc.load", "summary": "Load an lvalue into an SSA value.", "description": "This operation loads the content of a modifiable lvalue into an SSA value.\n Modifications of the lvalue executed after the load are not observable on\n the produced value.\n\n Example:\n\n ```mlir\n %1 = emitc.load %0 : !emitc.lvalue\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v2 = v1;\n ```", "operands": [ { "name": "operand", "type": "EmitC_LValueType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', '::llvm::cast($_self).getValueType()'>" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "emitc.logical_and", "summary": "Logical and operation", "description": "With the `emitc.logical_and` operation the logical operator && (and) can\n be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.logical_and %arg0, %arg1 : i32, i32\n ```\n ```c++\n // Code emitted for the operation above.\n bool v3 = v1 && v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "operands attr-dict `:` type(operands)" }, { "name": "emitc.logical_not", "summary": "Logical not operation", "description": "With the `emitc.logical_not` operation the logical operator ! (negation) can\n be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.logical_not %arg0 : i32\n ```\n ```c++\n // Code emitted for the operation above.\n bool v2 = !v1;\n ```", "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "operands attr-dict `:` type(operands)" }, { "name": "emitc.logical_or", "summary": "Logical or operation", "description": "With the `emitc.logical_or` operation the logical operator || (inclusive or)\n can be applied.\n\n Example:\n\n ```mlir\n %0 = emitc.logical_or %arg0, %arg1 : i32, i32\n ```\n ```c++\n // Code emitted for the operation above.\n bool v3 = v1 || v2;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "operands attr-dict `:` type(operands)" }, { "name": "emitc.member", "summary": "Member operation", "description": "With the `emitc.member` operation the member access operator `.` can be\n applied.\n\n Example:\n\n ```mlir\n %0 = \"emitc.member\" (%arg0) {member = \"a\"}\n : (!emitc.opaque<\"mystruct\">) -> i32\n %0 = \"emitc.member\" (%arg0) {member = \"a\"}\n : (!emitc.lvalue>) -> !emitc.lvalue\n %1 = \"emitc.member\" (%arg0) {member = \"b\"}\n : (!emitc.lvalue>) -> !emitc.array<2xi32>\n ```", "operands": [ { "name": "operand", "type": "AnyTypeOf<[EmitC_OpaqueType, EmitC_LValueOf<[EmitC_OpaqueType]>]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[EmitCType, EmitC_LValueType]>" } ], "attributes": [ { "name": "member", "type": "StrAttr" } ] }, { "name": "emitc.member_call_opaque", "summary": "Opaque member call operation", "description": "The `emitc.member_call_opaque` operation represents a C++ member function\n call. It takes a receiver operand, a callee string attribute (the method\n name), and variadic operands for arguments.\n\n The call allows specifying order of operands and attributes in the call as\n follows:\n - integer value of index type refers to an argument operand;\n - attribute which will get lowered to constant value in call;\n\n Example:\n\n ```mlir\n %0 = emitc.member_call_opaque %receiver \"method\" (%arg0, %arg1) : !emitc.opaque<\"MyClass\">, (i32, i32) -> i32\n ```", "operands": [ { "name": "receiver", "type": "EmitCType" }, { "name": "arg_operands", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "StrAttr" }, { "name": "args", "type": "OptionalAttr" }, { "name": "template_args", "type": "OptionalAttr" } ], "assemblyFormat": "$receiver $callee `(` $arg_operands `)` prop-dict attr-dict `:` type($receiver) `,` functional-type($arg_operands, results)" }, { "name": "emitc.member_of_ptr", "summary": "Member of pointer operation", "description": "With the `emitc.member_of_ptr` operation the member access operator `->`\n can be applied.\n\n Example:\n\n ```mlir\n %0 = \"emitc.member_of_ptr\" (%arg0) {member = \"a\"}\n : (!emitc.lvalue>>)\n -> !emitc.lvalue\n %1 = \"emitc.member_of_ptr\" (%arg0) {member = \"b\"}\n : (!emitc.lvalue>>)\n -> !emitc.array<2xi32>\n ```", "operands": [ { "name": "operand", "type": "EmitC_LValueOf<[EmitC_OpaqueType, EmitC_PointerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[EmitC_ArrayType, EmitC_LValueType]>" } ], "attributes": [ { "name": "member", "type": "StrAttr" } ] }, { "name": "emitc.mul", "summary": "Multiplication operation", "description": "With the `emitc.mul` operation the arithmetic operator * (multiplication) can\n be applied.\n\n Example:\n\n ```mlir\n // Custom form of the multiplication operation.\n %0 = emitc.mul %arg0, %arg1 : (i32, i32) -> i32\n %1 = emitc.mul %arg2, %arg3 : (f32, f32) -> f32\n ```\n ```c++\n // Code emitted for the operations above.\n int32_t v5 = v1 * v2;\n float v6 = v3 * v4;\n ```", "results": [ { "name": "result", "type": "FloatIntegerIndexOrOpaqueType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.rem", "summary": "Remainder operation", "description": "With the `emitc.rem` operation the arithmetic operator % (remainder) can\n be applied.\n\n Example:\n\n ```mlir\n // Custom form of the remainder operation.\n %0 = emitc.rem %arg0, %arg1 : (i32, i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v5 = v1 % v2;\n ```", "results": [ { "name": "result", "type": "IntegerIndexOrOpaqueType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.return", "summary": "Function return operation", "description": "The `emitc.return` operation represents a return operation within a function.\n The operation takes zero or exactly one operand and produces no results.\n The operand number and type must match the signature of the function\n that contains the operation.\n\n Example:\n\n ```mlir\n emitc.func @foo() -> (i32) {\n ...\n emitc.return %0 : i32\n }\n ```", "operands": [ { "name": "operand", "type": "Optional" } ], "assemblyFormat": "attr-dict ($operand^ `:` type($operand))?" }, { "name": "emitc.sub", "summary": "Subtraction operation", "description": "With the `emitc.sub` operation the arithmetic operator - (subtraction) can\n be applied.\n\n Example:\n\n ```mlir\n // Custom form of the substraction operation.\n %0 = emitc.sub %arg0, %arg1 : (i32, i32) -> i32\n %1 = emitc.sub %arg2, %arg3 : (!emitc.ptr, i32) -> !emitc.ptr\n %2 = emitc.sub %arg4, %arg5 : (!emitc.ptr, !emitc.ptr)\n -> !emitc.ptrdiff_t\n ```\n ```c++\n // Code emitted for the operations above.\n int32_t v7 = v1 - v2;\n float* v8 = v3 - v4;\n ptrdiff_t v9 = v5 - v6;\n ```", "operands": [ { "name": "lhs", "type": "EmitCType" }, { "name": "rhs", "type": "EmitCType" } ], "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.subscript", "summary": "Subscript operation", "description": "With the `emitc.subscript` operation the subscript operator `[]` can be applied\n to variables or arguments of array, pointer and opaque type.\n\n Example:\n\n ```mlir\n %i = index.constant 1\n %j = index.constant 7\n %0 = emitc.subscript %arg0[%i, %j] : (!emitc.array<4x8xf32>, index, index)\n -> !emitc.lvalue\n %1 = emitc.subscript %arg1[%i] : (!emitc.ptr, index)\n -> !emitc.lvalue\n ```", "operands": [ { "name": "value", "type": "AnyTypeOf<[ EmitC_ArrayType, EmitC_OpaqueType, EmitC_PointerType ]>" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "EmitC_LValueType" } ], "assemblyFormat": "$value `[` $indices `]` attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.switch", "summary": "Switch operation", "description": "The `emitc.switch` is a control-flow operation that branches to one of\n the given regions based on the values of the argument and the cases.\n The operand to a switch operation is a opaque, integral or pointer\n wide types.\n\n The operation always has a \"default\" region and any number of case regions\n denoted by integer constants. Control-flow transfers to the case region\n whose constant value equals the value of the argument. If the argument does\n not equal any of the case values, control-flow transfer to the \"default\"\n region.\n\n The operation does not return any value. Moreover, case regions must be\n explicitly terminated using the `emitc.yield` operation. Default region is\n yielded implicitly.\n\n Example:\n\n ```mlir\n // Example:\n emitc.switch %0 : i32\n case 2 {\n %1 = emitc.call_opaque \"func_b\" () : () -> i32\n emitc.yield\n }\n case 5 {\n %2 = emitc.call_opaque \"func_a\" () : () -> i32\n emitc.yield\n }\n default {\n %3 = \"emitc.constant\"(){value = 42.0 : f32} : () -> f32\n emitc.call_opaque \"func2\" (%3) : (f32) -> ()\n }\n ```\n ```c++\n // Code emitted for the operations above.\n switch (v1) {\n case 2: {\n int32_t v2 = func_b();\n break;\n }\n case 5: {\n int32_t v3 = func_a();\n break;\n }\n default: {\n float v4 = 4.200000000e+01f;\n func2(v4);\n break;\n }\n }\n ```", "operands": [ { "name": "arg", "type": "IntegerIndexOrOpaqueType" } ], "attributes": [ { "name": "cases", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "defaultRegion", "type": "SizedRegion<1>" }, { "name": "caseRegions", "type": "VariadicRegion>" } ], "defaultDialect": "emitc", "assemblyFormat": "$arg `:` type($arg) attr-dict custom($cases, $caseRegions) `\\n`\n `` `default` $defaultRegion" }, { "name": "emitc.unary_minus", "summary": "Unary minus operation", "description": "With the `emitc.unary_minus` operation the unary operator - (minus) can be\n applied.\n\n Example:\n\n ```mlir\n %0 = emitc.unary_minus %arg0 : (i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v2 = -v1;\n ```", "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.unary_plus", "summary": "Unary plus operation", "description": "With the `emitc.unary_plus` operation the unary operator + (plus) can be\n applied.\n\n Example:\n\n ```mlir\n %0 = emitc.unary_plus %arg0 : (i32) -> i32\n ```\n ```c++\n // Code emitted for the operation above.\n int32_t v2 = +v1;\n ```", "results": [ { "name": "result", "type": "EmitCType" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "emitc.variable", "summary": "Variable operation", "description": "The `emitc.variable` operation produces an SSA value equal to some value\n specified by an attribute. This can be used to form simple integer and\n floating point variables, as well as more exotic things like tensor\n variables. The `emitc.variable` operation also supports the EmitC opaque\n attribute and the EmitC opaque type. If further supports the EmitC\n pointer type, whereas folding is not supported.\n The `emitc.variable` is emitted as a C/C++ local variable.\n\n Example:\n\n ```mlir\n // Integer variable\n %0 = \"emitc.variable\"(){value = 42 : i32} : () -> !emitc.lvalue\n\n // Variable emitted as `int32_t* = NULL;`\n %1 = \"emitc.variable\"() {value = #emitc.opaque<\"NULL\">}\n : () -> !emitc.lvalue>>\n ```\n\n Since folding is not supported, it can be used with pointers.\n As an example, it is valid to create pointers to `variable` operations\n by using `address_of` operations and pass these to a `call` operation.\n ```mlir\n %0 = \"emitc.variable\"() {value = 0 : i32} : () -> !emitc.lvalue\n %1 = \"emitc.variable\"() {value = 0 : i32} : () -> !emitc.lvalue\n %2 = emitc.address_of %0 : !emitc.lvalue\n %3 = emitc.address_of %1 : !emitc.lvalue\n emitc.call_opaque \"write\"(%2, %3)\n : (!emitc.ptr, !emitc.ptr) -> ()\n ```", "results": [ { "name": "result", "type": "AnyTypeOf<[ EmitC_ArrayType, EmitC_LValueType ]>" } ], "attributes": [ { "name": "value", "type": "EmitC_OpaqueOrTypedAttr" } ] }, { "name": "emitc.verbatim", "summary": "Verbatim operation", "description": "The `emitc.verbatim` operation produces no results and the value is emitted as is\n followed by a line break ('\\n' character) during translation.\n\n Note: Use with caution. This operation can have arbitrary effects on the\n semantics of the emitted code. Use semantically more meaningful operations\n whenever possible. Additionally this op is *NOT* intended to be used to\n inject large snippets of code.\n\n This operation can be used in situations where a more suitable operation is\n not yet implemented in the dialect or where preprocessor directives\n interfere with the structure of the code. One example of this is to declare\n the linkage of external symbols to make the generated code usable in both C\n and C++ contexts:\n\n ```c++\n #ifdef __cplusplus\n extern \"C\" {\n #endif\n\n ...\n\n #ifdef __cplusplus\n }\n #endif\n ```\n\n If the `emitc.verbatim` op has operands, then the `value` is interpreted as\n format string, where `{}` is a placeholder for an operand in their order.\n For example, `emitc.verbatim \"#pragma my src={} dst={}\" %src, %dest : i32, i32`\n would be emitted as `#pragma my src=a dst=b` if `%src` became `a` and\n `%dest` became `b` in the C code.\n `{{` in the format string is interpreted as a single `{` and doesn't introduce\n a placeholder.\n\n Example:\n\n ```mlir\n emitc.verbatim \"typedef float f32;\"\n emitc.verbatim \"#pragma my var={} property\" args %arg : f32\n ```\n ```c++\n // Code emitted for the operation above.\n typedef float f32;\n #pragma my var=v1 property\n ```", "operands": [ { "name": "fmtArgs", "type": "Variadic>" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "$value (`args` $fmtArgs^ `:` type($fmtArgs))? attr-dict" }, { "name": "emitc.yield", "summary": "Block termination operation", "description": "The `emitc.yield` terminates its parent EmitC op's region, optionally yielding\n an SSA value. The semantics of how the values are yielded is defined by the\n parent operation.\n If `emitc.yield` has an operand, the operand must match the parent operation's\n result. If the parent operation defines no values, then the `emitc.yield`\n may be left out in the custom syntax and the builders will insert one\n implicitly. Otherwise, it has to be present in the syntax to indicate which\n value is yielded.", "operands": [ { "name": "result", "type": "Optional>" } ], "assemblyFormat": "attr-dict ($result^ `:` type($result))?" }, { "name": "ensemble.alloc_cbits", "summary": "Allocate a tensor of classical bits for a given circuit size.", "results": [ { "name": "output", "type": "TensorOf<[Cbit]>" } ], "attributes": [ { "name": "circuit_size", "type": "I32Attr" } ], "assemblyFormat": "$circuit_size attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.apply", "summary": "Apply a deterministic gate to any number of qubits.", "operands": [ { "name": "gate", "type": "Gate" }, { "name": "input", "type": "Variadic" } ], "assemblyFormat": "$gate attr-dict $input `:` functional-type(operands, results)" }, { "name": "ensemble.apply_distribution", "summary": "Gate distribution on a variable number of qubits and gates", "operands": [ { "name": "gates", "type": "GateDistribution" }, { "name": "index", "type": "AnyIndexType" }, { "name": "inputs", "type": "Variadic" } ], "assemblyFormat": "$gates `[` $index `]` attr-dict $inputs `:` functional-type(operands, results)" }, { "name": "ensemble.cbit_distribution_1c", "summary": "Cbit distribution sampled from by an integer", "operands": [ { "name": "input", "type": "Variadic" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "output", "type": "Cbit" } ], "assemblyFormat": "$input `[` $index `]` attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.cnot_pair_distribution", "summary": "Distribution of non-overlapping CNOT pairs sampled from a connectivity graph.", "description": "This operation generates random non-overlapping CNOT pairs sampled from a connectivity graph.\n The operation produces a tensor of the given shape, where each element is a pair of qubits.", "operands": [ { "name": "connectivity", "type": "ConnectivityGraph" }, { "name": "num_samples", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TensorOf<[AnyQubit]>" } ], "assemblyFormat": "$connectivity `,` `[` $num_samples `]` attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.device_connectivity", "summary": "Create a connectivity graph for a device.", "description": "This operation creates a connectivity graph for a device from a tensor of qubits and a dense array \n of indices specifying the connectivity between qubits.", "operands": [ { "name": "qubits", "type": "TensorOf<[AnyQubit]>" } ], "results": [ { "name": "connectivity", "type": "ConnectivityGraph" } ], "attributes": [ { "name": "indices", "type": "I32ElementsAttr" } ], "assemblyFormat": "$qubits `,` `{` $indices `}` attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.float_uniform", "summary": "Uniform float distribution over low (inclusive) to high (exclusive).", "description": "This operation generates random floats uniformly distributed between\n two bounds (`low` and `high`). The operation produces a tensor of the \n given shape.", "operands": [ { "name": "low", "type": "AnyFloat" }, { "name": "high", "type": "AnyFloat" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TensorOf<[AnyFloat]>" } ], "assemblyFormat": "$low `,` $high `,` `[` $shape `]` attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.gate", "summary": "Gate constructor. Takes in a name, optional inverse annotation, and variadic floating point parameters.", "operands": [ { "name": "parameters", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Gate" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "inverse", "type": "OptionalAttr" }, { "name": "num_operands", "type": "I32Attr" } ], "assemblyFormat": "$name ($inverse^)? $num_operands (`(` $parameters^ `)`)? attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.gate_distribution", "summary": "Gate distribution constructor that accepts a variable number of gates", "operands": [ { "name": "gates", "type": "Variadic" } ], "results": [ { "name": "output", "type": "GateDistribution" } ], "assemblyFormat": "$gates attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.int_categorical", "summary": "Categorical integer distribution over low (inclusive) to low + len(probs) (exclusive).", "description": "This operation generates random integers non-uniformly distributed between\n two bounds (`low` and `low + len(probs)`)., with each integer being produced with probability\n equal to the magnitude of the corresponding probability argument. The operation produces a tensor of the \n given shape.", "operands": [ { "name": "low", "type": "AnyInteger" }, { "name": "probs", "type": "TensorOf<[AnyFloat]>" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TensorOf<[AnyInteger]>" } ], "assemblyFormat": "$low `,` $probs `,` `[` $shape `]` attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.int_uniform", "summary": "Uniform integer distribution over low (inclusive) to high (exclusive).", "description": "This operation generates random integers uniformly distributed between\n two bounds (`low` and `high`). The operation produces a tensor of the \n given shape if provided, otherwise a single integer.", "operands": [ { "name": "low", "type": "AnyInteger" }, { "name": "high", "type": "AnyInteger" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TensorOf<[AnyInteger]>" } ], "assemblyFormat": "$low `,` $high ( `,` `[` $shape^ `]`)? attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.measure", "summary": "Single qubit measurement to classical bit.", "operands": [ { "name": "input0", "type": "AnyQubit" }, { "name": "input1", "type": "Cbit" } ], "assemblyFormat": "$input0 `,` $input1 attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.permutation", "summary": "Generates a random permutation of numbers from 0 to N-1.", "description": "This operation generates a random permutation of numbers from 0 to N-1.\n The operation produces a tensor of the given shape.", "operands": [ { "name": "N", "type": "AnyInteger" } ], "results": [ { "name": "result", "type": "TensorOf<[AnyInteger]>" } ], "assemblyFormat": "$N attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.program_alloc", "summary": "Allocate a tensor of qubits for a given circuit size.", "results": [ { "name": "output", "type": "TensorOf<[PhysicalQubit]>" } ], "attributes": [ { "name": "circuit_size", "type": "I32Attr" } ], "assemblyFormat": "$circuit_size attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.quantum_program_iteration", "summary": "An operation that wraps multiple operations and contains all of the code for one iteration of a quantum program.", "description": "This operation wraps a single region. The region can have multiple blocks, and\n the operation itself persists across transformations unless explicitly targeted.", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$body attr-dict" }, { "name": "ensemble.qubit_distribution_1q", "summary": "Qubit distribution sampled from by an integer", "operands": [ { "name": "input", "type": "Variadic" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "output", "type": "AnyQubit" } ], "assemblyFormat": "$input `[` $index `]` attr-dict `:` functional-type(operands, results)" }, { "name": "ensemble.reset", "summary": "variadic qubit reset.", "operands": [ { "name": "input", "type": "Variadic" } ], "assemblyFormat": "attr-dict $input `:` functional-type(operands, results)" }, { "name": "ensemble.reset_tensor", "summary": "Reset a tensor of qubits.", "description": "This operation resets all qubits in a given tensor to their ground state.\n It takes a tensor of qubits as input and returns a tensor of reset qubits of the same shape.", "operands": [ { "name": "input", "type": "TensorOf<[AnyQubit]>" } ], "assemblyFormat": "attr-dict $input `:` functional-type(operands, results)" }, { "name": "ensemble.transmit_results", "summary": "Transmit results from a quantum program iteration.", "description": "This operation transmits results from a quantum program iteration.", "operands": [ { "name": "results", "type": "TensorOf<[Cbit]>" } ], "assemblyFormat": "$results attr-dict `:` functional-type(operands, results)" }, { "name": "executor.abi.recv", "summary": "receive an argument from the caller", "description": "The `executor.abi.recv` operation represents loading an argument value\n indirectly from a function input argument which has host pointer type.\n\n The argument must be annotated with an `#executor.arg` argument\n ABI. Currently, only non-scalar value types are supported for passing\n inputs via pointer arguments.\n\n The result type of the operation must match the type of the argument's\n `#executor.arg` value type.", "operands": [ { "name": "ptr", "type": "Executor_HostPtr" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "memory_space", "type": "OptionalAttr" } ], "assemblyFormat": "$ptr attr-dict `:` type($result)" }, { "name": "executor.abi.send", "summary": "send an argument to the caller", "description": "The `executor.abi.send` operation \"stores\" value to a function output argument\n which has host poitner type and is annotated with `#executor.arg`\n argument ABI.\n\n The value type of the argument's `#executor.arg` must match the type\n of `value`.", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "ptr", "type": "Executor_HostPtr" }, { "name": "ownership", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$value `to` $ptr ( `ownership` `(` $ownership^ `)`)? attr-dict `:` type($value)" }, { "name": "executor.absf", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.absi", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.addf", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.addi", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.alignto", "summary": "rounds up integer operand to nearest multiple of power-of-two alignment", "description": "`executor.alignto` returns an integer formed from taking `arg` and\n rounding it up to the nearest multiple of `alignment`, which must be a power\n of two.\n\n One possible implementation of this is:\n\n ```\n bumped = arg + alignment -1\n result = bumped - urem(bumped, alignment)\n ```", "operands": [ { "name": "arg", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_Index" } ], "attributes": [ { "name": "alignment", "type": "UI32Attr" } ], "traits": [ { "type": "AllTypesMatch<['arg', 'result']>" } ], "assemblyFormat": "attr-dict $arg `,` $alignment `:` type($arg)" }, { "name": "executor.alloc", "description": "`executor.alloc` performs an allocation of `num_bytes` using the given\n allocation. It returns an opaque pointer representing the allocation.\n The caller must also specify `alignment`.\n\n Backends/runtimes impleemnting this operation may automatically round up\n `num_bytes` to the next multiple of the `alignment`. `num_bytes` should\n be a power of two.", "operands": [ { "name": "num_bytes", "type": "Executor_Index" }, { "name": "alignment", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_HostPtr" } ], "assemblyFormat": "attr-dict $num_bytes `bytes` `align` `(` $alignment `)` `:` functional-type(operands, results)" }, { "name": "executor.alloc_host_pinned", "description": "The `executor.alloc_host_pinned` op performs a synchronous allocation of\n `num_bytes` of host-pinned memory. The actual allocation size may be larger;\n this is decided by the underlying runtime allocator object.", "operands": [ { "name": "num_bytes", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_HostPinnedPtr" } ], "assemblyFormat": "attr-dict $num_bytes `bytes` `:` functional-type(operands, results)" }, { "name": "executor.alloca", "summary": "block-scoped temporary allocation", "description": "The `executor.alloca` operation allocates temporary memory to be\n automatically released when control transfers back from the region of its\n closest surrounding operation with an\n [`AutomaticAllocationScope`](../Traits.md/#automaticallocationscope) trait.\n\n The size of the allocation is specified by giving the element type and\n number of elements of an array which it must be large enough to hold.\n Once allocated, the size of the allocation cannot change.\n\n An optional alignment can be specified, the alignment is implicitly\n interpreted as the DataLayout-specified ABI alignment for the\n `element_type`.", "operands": [ { "name": "num_elements", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_HostPtr" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" }, { "name": "element_type", "type": "TypeAttr" } ], "assemblyFormat": "$num_elements `x` $element_type (`align` `(` $alignment^ `)`)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "executor.assert", "summary": "Assert operation with message attribute", "description": "The `executor.assert` operation represents a runtime assertion with a single\n boolean operand and an error message attribute.\n\n If the argument is `true` this operation has no effect. Otherwise, the\n program execution will abort. The provided error message may be used by a\n runtime to propagate the error to the user.\n\n Example:\n\n ```mlir\n executor.assert %b, \"Expected some condition to be true\"\n ```", "operands": [ { "name": "arg", "type": "I1" } ], "attributes": [ { "name": "msg", "type": "StrAttr" } ], "assemblyFormat": "$arg `,` $msg attr-dict" }, { "name": "executor.atan2", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.bitcast", "description": "`executor.bitcast` op performs a bitcast between values of equal bit width.", "operands": [ { "name": "input", "type": "AnyTypeOf<[F4E2M1FN, F8E4M3FN, F64, F32, F16, I64, I32, I16, I8, I4]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[F4E2M1FN, F8E4M3FN, F64, F32, F16, I64, I32, I16, I8, I4]>" } ], "assemblyFormat": "attr-dict $input `:` type($input) `to` type($result)" }, { "name": "executor.bitwise_andi", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "res", "type": "Executor_Integer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.bitwise_ori", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "res", "type": "Executor_Integer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.bitwise_xori", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "res", "type": "Executor_Integer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.buffer_bitcast", "description": "`executor.buffer_bitcast` op performs a bitcast from one tensor or\n memref type to another tensor or memref type.\n\n The result element type must have the same bit width as the source\n element type.", "operands": [ { "name": "source", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "assemblyFormat": "attr-dict $source `:` type($source) `to` type($result)" }, { "name": "executor.call", "summary": "call to an Executor IR function", "description": "The `executor.call` operation represents a procedure call to an externally\n defined function given by the `callee` symbol name. The procedure is invoked\n by passing `args`.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $args `)` attr-dict\n `:` functional-type($args, $results)" }, { "name": "executor.call_plugin", "summary": "call a plugin callable", "description": "The `executor.call_plugin` operation calls an instance of a plugin\n callable.\n\n For TVM FFI backend (`ffi_backend = #executor.ffi_backend`):\n This operation invokes a TVM FFI function following the TVM FFI ABI calling\n convention. All arguments and outputs are converted to `TVMFFIAny` structures\n and arranged according to the `arg_spec` attribute.\n\n Argument Specification (`arg_spec`):\n The `arg_spec` is a list of strings that encodes how to arrange arguments\n for the TVM FFI call. Each string can be:\n - `\"args.N\"`: Use the N-th input argument from `args`\n - `\"rets.N\"`: Use the N-th output argument from `outputs`\n - `\"attrs.name\"`: Use the attribute named `name` from `immediate_args`\n - `\"none\"`: Insert an optional None value\n\n Argument Conversion:\n - POD values (integers, floats): Stored directly in the 16-byte `TVMFFIAny`\n union structure without heap allocation\n - Tensor values: Converted to DLPack-compatible `DLTensor` structures and\n stored as pointers (`kTVMFFIDLTensorPtr`). The DLTensor contains:\n - Data pointer and device information (CUDA, CPU, etc.)\n - Rank, shape, and strides arrays (promoted to host memory)\n - Data type information (DLDataType)\n - Byte offset for non-contiguous views\n - Attributes: Converted to appropriate `TVMFFIAny` values (POD or string literals)\n\n Output Handling:\n TVM FFI functions do not return values through a result parameter. All\n outputs must be provided as input arguments with I/O aliasing specified\n via the `io_aliasing` attribute. This attribute maps each input index to\n an output index (-1 if not aliased), allowing in-place operations.\n\n Stream Handling:\n The optional `stream` operand specifies a CUDA stream for async operations.\n If not provided, NULL will be passed as the stream argument to the\n TVM FFI call.\n\n Memory Management:\n - DLTensor structures are allocated on the stack (via alloca) and contain\n pointers to the actual tensor data\n - Shape and strides arrays are promoted to host-allocated memory for runtime\n access\n - The `TVMFFIAny` argument array is allocated on the host stack for passing\n to the FFI runtime\n\n During lowering, this operation is converted to a call to the runtime\n function `_call_plugin_tvm_ffi`, which:\n 1. Sets CUDA streams for DLTensor arguments (if applicable)\n 2. Invokes the TVM FFI function using the `TVMFFISafeCallType` signature:\n `int (*TVMFFISafeCallType)(void* handle, const TVMFFIAny* args,\n int32_t num_args, TVMFFIAny* result)`\n 3. Handles errors and propagates them appropriately\n\n Example:\n\n ```mlir\n %result = executor.call_plugin @my_plugin\n ins(%arg0 : tensor<*xf32>, %arg1 : tensor<*xf32>)\n outs(%output : tensor<*xf32>)\n {\n arg_spec = [\"args.0\", \"args.1\", \"rets.0\", \"attrs.backend\"],\n io_aliasing = [-1, -1, 0],\n immediate_args = {backend = \"paged\"}\n } : (tensor<*xf32>, tensor<*xf32>, tensor<*xf32>) -> ()\n ```\n\n In this example:\n - `args.0` and `args.1` are the input tensors\n - `rets.0` is the output tensor (aliased with input 0 via `io_aliasing`)\n - `attrs.backend` is an immediate string attribute", "operands": [ { "name": "stream", "type": "Optional" }, { "name": "args", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "immediate_args", "type": "OptionalAttr" }, { "name": "arg_spec", "type": "TypedArrayAttrBase" }, { "name": "io_aliasing", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee\n (`stream` `(` $stream^ `:` type($stream) `)`)?\n `ins` `(` $args `:` type($args) `)`\n `outs` `(` $outputs `:` type($outputs) `)`\n attr-dict (`:` type($results)^)?" }, { "name": "executor.cbrt", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.ceil", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.constant", "summary": "integer or floating point constant", "description": "The `executor.constant` operation produces an SSA value equal to some\n integer or floating-point constant specified by an attribute.\n\n This is basically the same as `arith.constant`, but we are more limited\n in terms of allowed types based on the target VM.\n\n For example, if Lua is the target VM, then depending on Lua's build\n config, integers are either signed 32 bit or signed 64 bit.\n\n Example:\n\n ```\n // Integer constant\n %1 = executor.constant 42 : i32\n\n // Equivalent generic form\n %1 = \"executor.constant\"() {value = 42 : i32} : () -> i32\n ```", "results": [ { "name": "result", "type": "AnyTypeOf<[Executor_Integer, Executor_Float]>" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "attr-dict $value" }, { "name": "executor.copysign", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.coro_await", "summary": "resume coroutine", "description": "`executor.coro_await` resumes a coroutine. The 'callee_operands' must either be\n empty or they must match the operands of the coroutine (for the initial\n resume). The results yielded from the coroutine should always match\n the function signature results, so the result types of `executor.coro_await`\n must match the callee function result types.\n\n The results of `executor.coro_await` are a flag indicating whether or not\n the coroutine was resumed (false indicates the coroutine is terminated and cannot\n be resumed) followed by the list of values yielded from the coroutine.\n If the 'status' flag is false, then the 'results' values contain undefined\n contents.", "operands": [ { "name": "callee", "type": "FunctionType" }, { "name": "callee_operands", "type": "Variadic" } ], "results": [ { "name": "status", "type": "I1" }, { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "TypesMatchWith<'callee', 'results', '::llvm::cast($_self).getResults()'>" } ], "assemblyFormat": "$callee `(` $callee_operands (`:` type($callee_operands)^)? `)` attr-dict `:` type($callee)" }, { "name": "executor.coro_create", "description": "Constructs a coroutine handle from a function or coroutine function.\n Functions may or may not use 'executor.coro_yield' in their bodies\n (abcense of 'coro_yield' does not prevent a 'func.func' from being\n used as a coroutine, although the in that case 'coro_await' is\n identical to just using 'func.call').", "results": [ { "name": "result", "type": "FunctionType" } ], "attributes": [ { "name": "func", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "attr-dict $func `:` type($result)" }, { "name": "executor.coro_yield", "summary": "suspends a coroutine", "description": "The 'executor.coro_yield' operation suspends the current coroutine and\n transfers control back to the program point immediately after the\n point where the coroutine was resumed.\n\n The control flow returns to the the 'coro_yield' point when the coroutine\n is resumed. Note that 'coro_yield' is not a \"terminator\", but invoking the\n coro suspension has \"return-like\" semantics with respect to 'executor.coro_resume`.\n\n Therefore, the types passed to the continuation must match the result\n types of the containing function.\n\n Any function containing a 'coro_yield' is a coroutine function, and while\n the compiler might not object until runtime when invoking\n it directly with 'func.call', this is invalid and will result in undefined\n behavior. A coroutine function can only be invoked through the sequence of\n 'executor.coro_create' and then one or more 'executor.coro_await' calls.", "operands": [ { "name": "yielded", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($yielded^ `:` type($yielded))?" }, { "name": "executor.cos", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.ctpop", "summary": "count the number of set bits in an integer", "description": "Returns the number of bits set to 1 in the input integer.\n Only i32 and i64 types are supported. For smaller bit types,\n user `executor.zext` to extend the width to 32 or 64.", "operands": [ { "name": "operand", "type": "AnyTypeOf<[I32, I64]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, I64]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.data_segment", "summary": "declares a read-only constant resource", "description": "The `executor.data_segment` operation represents a declaration of a region\n of memory.\n\n The region of memory must have an initial `value` attached. If the\n `uninitialized` attribute is set, then the `value` is used just to indicate\n the size of the zero-initialized data, and `value` should be a dense splat\n elements attribute. Only the size is encoded in the compiled artifact (no\n actual data is encoded). This lets us create a mechanism for indicating that\n globals should be initialized with a new zero-filled allocation, similar to\n the BSS section in an ELF.\n\n If `constant` is specified, then the memory is read-only, and this is\n exclusive to `uninitialized`.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "value", "type": "AnyAttrOf<[ElementsAttr, StrAttr]>" }, { "name": "constant", "type": "UnitAttr" }, { "name": "uninitialized", "type": "UnitAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "address_space", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$sym_name attr-dict\n ( `constant` $constant^ )?\n (`uninitialized` $uninitialized^ )?\n (`align` $alignment^)?\n (`address_space` $address_space^)?\n $value" }, { "name": "executor.dealloc", "operands": [ { "name": "ptr", "type": "Executor_HostPtr" } ], "assemblyFormat": "attr-dict $ptr `:` type($ptr)" }, { "name": "executor.divf", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.erf", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.exp", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.exp2", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.expm1", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.extf", "description": "Cast a floating point type to another floating point type of a wider\n bitwidth. The numeric values should be equivalent.", "operands": [ { "name": "operand", "type": "Executor_Float" } ], "results": [ { "name": "result", "type": "Executor_Float" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.fcmp", "description": "`executor.fcmp` performs a comparison between `lhs` and `rhs` floats.\n The comparison type is given by the `predicate` attribute.", "operands": [ { "name": "lhs", "type": "Executor_Float" }, { "name": "rhs", "type": "Executor_Float" } ], "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "predicate", "type": "Executor_FCmpTypeAttr{_false|oeq|ogt|oge|olt|ole|one|ord|ueq|ugt|uge|ult|ule|une|uno|_true}" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$predicate $lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "executor.file_artifact", "description": "`executor.file_artifact` op declares a file artifact that will be\n emitted to the artifacts directory.", "attributes": [ { "name": "path", "type": "StrAttr" }, { "name": "data", "type": "ElementsAttr" } ], "assemblyFormat": "$path `data` `(` $data `)` attr-dict" }, { "name": "executor.floor", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.fmax", "operands": [ { "name": "lhs", "type": "Executor_Float" }, { "name": "rhs", "type": "Executor_Float" } ], "results": [ { "name": "result", "type": "Executor_Float" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)" }, { "name": "executor.fmin", "operands": [ { "name": "lhs", "type": "Executor_Float" }, { "name": "rhs", "type": "Executor_Float" } ], "results": [ { "name": "result", "type": "Executor_Float" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)" }, { "name": "executor.fptosi", "description": "`executor.fptosi` casts floating point value to the nearest signed integer\n value. This is similar to `static_cast` in C++.", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.func", "summary": "an executor function", "description": "The `executor.func` operation defines either a function along\n with its definition or a function declaration that is defined\n externally by runtime bindings.\n\n Example:\n\n ```mlir\n executor.func @enqueue_kernel(%arg0: i32, ...)\n ```", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "executor.get_global", "description": "The `executor.get_global` operation returns an SSA value representing the\n global stored at the given symbol name.", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$name attr-dict `:` type($result)" }, { "name": "executor.getoffset", "summary": "calculates byte offsets to positions within aggregate types", "description": "The `executor.getoffset` operation is used to calculate byte offsets within\n an aggregate type (e.g. array or table/struct). It is semantically equivalent\n to the [LLVM GetElementPtr (GEP) operation](https://llvm.org/docs/GetElementPtr.html),\n except that the `executor.getoffset` operation does not perform pointer arithmetic,\n it only calculates offsets. While the LLVM GEP op takes a pointer operand to\n which the calculated offset is added, this operation does not take a pointer\n operand and simply returns the offset which should be added to a base pointer\n assuming the base pointer points to data of `elem_type`.\n\n Since `executor` load/store operations take byte offsets as arguments,\n we omitted the pointer modification, especially since doing so would\n require materialization of excess `inttoptr|ptrtoint` ops.\n\n This operation may be further lowered when targeting interpreters; in\n such cases the `executor-expand-ops` pass can be invoked with\n `lower-getoffset=true` to lower `executor.getoffset` to more primitive\n ops.\n\n Note that internal storage of `staticIndices` uses I64, but if the\n DataModel specifies that the pointer or index type width is 32, then\n static indices should be convertible to i32 losslessly.", "operands": [ { "name": "dynamicIndices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Executor_Index" } ], "attributes": [ { "name": "staticIndices", "type": "DenseI64ArrayAttr" }, { "name": "elem_type", "type": "TypeAttr" } ], "assemblyFormat": "`[` custom($dynamicIndices, $staticIndices) `]` attr-dict\n `:` functional-type(operands, results) `,` $elem_type" }, { "name": "executor.global", "summary": "defines a global variable", "description": "The `executor.global` operation describes a global variable declaration and,\n optionally, the IR that initializes the global when the program is loaded.\n\n Providing an initialization region is optional. Besides initialization\n regions, a global with a numeric constant value can also utilize the\n `initial_value` attribute. Only one of `initial_value` and an initialization\n region can be used. If the program does not provide an initialization region\n or an initial_value, then its state is considered undefined.\n\n If an initialization region is provided, then it should be terminated with\n an `executor.return` statement that returns the SSA value which should be\n stored into the region. The type of this value must match the `type`\n attribute.\n\n The operation can optionally specify that the global is a constant. In this\n case, a `executor.set_global` referencing this global is illegal, the global\n can only be set by its initialization region.\n\n Please note that ordering of `executor.global` operations matter: Since any\n number of `executor.global` variables can be declared, the final backend\n should execute the initialization of global variables one after another in\n the order that they are listed in the IR. Therefore, certain globals can\n depend on the initialization of other globals as long as the global being\n used in the initialization region was initialized earlier in the program\n declaration.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "initial_value", "type": "OptionalAttr" }, { "name": "constant", "type": "UnitAttr" } ], "regions": [ { "name": "body_region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name (`constant` $constant^)? `:` $type attr-dict-with-keyword\n ($body_region^)?" }, { "name": "executor.icmp", "description": "`executor.icmp` performs a comparison between `lhs` and `rhs` integers.\n The comparison type is given by the `predicate` attribute.", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "predicate", "type": "Executor_ICmpTypeAttr{eq|ne|slt|sgt|sle|sge|ult|ugt}" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$predicate $lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "executor.inttoptr", "operands": [ { "name": "arg", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_Ptr" } ], "assemblyFormat": "attr-dict $arg `:` functional-type(operands, results)" }, { "name": "executor.load", "description": "`executor.load` loads `result` from the memory location given by `ptr +\n offset`. The offset is in terms of bytes.", "operands": [ { "name": "ptr", "type": "Executor_Ptr" }, { "name": "offset", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Executor_Integer, Executor_Float, Executor_Table, Executor_Ptr]>" } ], "assemblyFormat": "attr-dict $ptr `+` $offset `:` functional-type(operands, results)" }, { "name": "executor.load_data_segment", "summary": "loads a constant resource into a new host buffer", "description": "The `executor.load_data_segment` operation allocates a new host buffer\n and loads the specified resource into the buffer.", "results": [ { "name": "result", "type": "Executor_Ptr" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "attr-dict $name `:` qualified(type($result))" }, { "name": "executor.log", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.log10", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.log1p", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.log2", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.memcpy", "description": "`executor.memcpy` copies `num_bytes` bytes from `source` to `dest`. Both\n buffers must be host memory buffers.", "operands": [ { "name": "src", "type": "Executor_HostVisiblePtr" }, { "name": "src_offset", "type": "Executor_Index" }, { "name": "dest", "type": "Executor_HostVisiblePtr" }, { "name": "dest_offset", "type": "Executor_Index" }, { "name": "num_bytes", "type": "Executor_Index" } ], "traits": [ { "type": "AllTypesMatch<['src_offset', 'dest_offset', 'num_bytes']>" } ], "assemblyFormat": "attr-dict $src `+` $src_offset `to` $dest `+` $dest_offset `size` $num_bytes\n `:` type(operands)" }, { "name": "executor.mulf", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.muli", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.negf", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.plugin", "summary": "declare a plugin handle", "description": "The `executor.plugin` operation defines a new global symbol representing\n a handle to a plugin instance that can be invoked with\n `executor.call_plugin`.\n\n For TVM FFI backend (`ffi_backend = #executor.ffi_backend`):\n This operation declares a callable handle to a TVM FFI function. The\n `plugin_name` identifies the TVM FFI library (e.g., a shared library path),\n and `function_name` identifies the function symbol within that library.\n\n During lowering, this operation is converted to a global variable that\n holds an opaque callable handle. The handle is initialized at module load\n time by calling the runtime function `_create_plugin_callable_tvm_ffi`,\n which:\n - Loads the TVM FFI library from `plugin_name` (caching loaded libraries)\n - Resolves the function symbol `function_name` from the library\n - Returns an opaque handle wrapping the `tvm::ffi::Function` object\n\n The `function_type` attribute specifies the MLIR function signature\n (arguments and results), which is used to validate `executor.call_plugin`\n calls. The `config` dictionary may contain additional backend-specific\n configuration attributes, but for the TVM FFI backend, it is currently\n unused.\n\n Example:\n\n ```mlir\n executor.plugin @my_plugin {\n plugin_name = \"libflashinfer.so\",\n function_name = \"single_prefill_with_kv_cache\",\n ffi_backend = #executor.ffi_backend,\n function_type = (tensor<*xf32>, tensor<*xf32>) -> (),\n config = {}\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "plugin_name", "type": "StrAttr" }, { "name": "function_name", "type": "StrAttr" }, { "name": "ffi_backend", "type": "Executor_FFIBackendAttr{tvm_ffi}" }, { "name": "function_type", "type": "OptionalAttr>" }, { "name": "config", "type": "OptionalAttr" } ], "assemblyFormat": "$sym_name attr-dict `:` $function_type" }, { "name": "executor.print", "description": "The `executor.print` op prints a formatted string to \"the output stream\",\n the specifics of which depend on the runtime implementation.\n\n The operation takes an optional format string, which follows the C\n `sprintf`-style string formatting rules.", "operands": [ { "name": "arguments", "type": "Variadic" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict ($format^)? `(` ($arguments^ `:` type($arguments))? `)`" }, { "name": "executor.ptrtoint", "operands": [ { "name": "arg", "type": "Executor_Ptr" } ], "results": [ { "name": "result", "type": "Executor_Index" } ], "assemblyFormat": "attr-dict $arg `:` functional-type(operands, results)" }, { "name": "executor.remf", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.return", "summary": "global initialization or function return operation", "description": "The `executor.return` op represents a return within a region that yields\n some results, such as a global initialization region.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "executor.round", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.sdivi", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.select", "description": "`executor.select`op chooses one of the `true_value` or `false_value` based on\n value of the predicate. If the value of predicate is 1, `true_value` is chosen\n otherwise `false_value` is chosen.", "operands": [ { "name": "predicate", "type": "I1" }, { "name": "true_value", "type": "Executor_AnyType" }, { "name": "false_value", "type": "Executor_AnyType" } ], "results": [ { "name": "result", "type": "Executor_AnyType" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "attr-dict $predicate `,` $true_value `,` $false_value `:` type($true_value)" }, { "name": "executor.set_global", "description": "The `executor.set_global` operation sets the value of the global\n with the given symbol name to the given `value`.", "operands": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$value `,` $name attr-dict `:` type($value)" }, { "name": "executor.sfloor_divi", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.shift_lefti", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.shift_right_arithmetici", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.shift_right_logicali", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.siext", "description": "`executor.siext` extends the bitwidth of an integer, by appending bits to\n the most significant side of the nubmer such that the positive/negative\n sign of the number is preserved. The positive/negative sign of the number\n is determined by interpreting the `operand` as an integer in two's complement\n format.", "operands": [ { "name": "operand", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.sin", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.sitofp", "description": "`executor.sitofp` casts signed integer to the corresponding floating point\n value. This is similar to `static_cast` in C++. If value can't be exactly\n represented, it is rounded (implementation-defined).", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.smax", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)" }, { "name": "executor.smin", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)" }, { "name": "executor.sqrt", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.sremi", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.store", "description": "`executor.store` stores `value` to the memory location given by `ptr +\n offset`. The offset is in terms of bytes.", "operands": [ { "name": "ptr", "type": "Executor_Ptr" }, { "name": "offset", "type": "Executor_Index" }, { "name": "value", "type": "AnyTypeOf<[Executor_Ptr, Executor_Integer, Executor_Float, Executor_Table]>" } ], "assemblyFormat": "attr-dict $value `to` $ptr `+` $offset\n `:` type($value) `,` qualified(type($ptr)) `,` type($offset)" }, { "name": "executor.str_literal", "summary": "declares a constant string literal", "description": "The `executor.str_literal` operation declares an SSA value\n that holds a single string literal.", "results": [ { "name": "result", "type": "Executor_StrLiteral" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "attr-dict $value" }, { "name": "executor.strided_memref_copy", "description": "Executes a copy from a source buffer to a destination buffer where the\n source and destination may be strided memrefs (with potentially different strides,\n but of the same shape).\n\n The `source_aligned_ptr` and `destination_aligned_ptr` are pointers to the aligned data\n of the source and destination memrefs, respectively while `src_descriptor` and `dest_descriptor`\n are pointers to the caller-allocated MLIR C-ABI compatible ranked memref\n descriptors provided for callee use.\n\n When this operation is lowered to the target, only the descriptor is passed. The\n data pointers are present here in order to capture the full memory effects of the\n operation.", "operands": [ { "name": "rank", "type": "I32" }, { "name": "elem_size", "type": "Executor_Index" }, { "name": "shape", "type": "Executor_HostPtr" }, { "name": "src_aligned_ptr", "type": "Executor_HostVisiblePtr" }, { "name": "src_offset", "type": "Executor_Index" }, { "name": "src_strides", "type": "Executor_HostPtr" }, { "name": "dest_aligned_ptr", "type": "Executor_HostVisiblePtr" }, { "name": "dest_offset", "type": "Executor_Index" }, { "name": "dest_strides", "type": "Executor_HostPtr" } ], "assemblyFormat": "attr-dict `(` operands `)`\n `:` type(operands)" }, { "name": "executor.subf", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.subi", "operands": [ { "name": "lhs", "type": "AnyTypeOf" }, { "name": "rhs", "type": "AnyTypeOf" } ], "results": [ { "name": "res", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "executor.table.create", "operands": [ { "name": "init", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Executor_Table" } ], "assemblyFormat": "attr-dict (`(` $init^ `:` type($init) `)`)? `:` type($result)" }, { "name": "executor.table.dynamic_get", "description": "The `executor.table.dynamic_get` operation returns the element at the\n `index-th` position in the given table. `index` is a variable.", "operands": [ { "name": "table", "type": "Executor_Table" }, { "name": "index", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_AnyType" } ], "assemblyFormat": "attr-dict $table `[` $index `]` `:` functional-type(operands, results)" }, { "name": "executor.table.get", "description": "The `executor.table.extract` operation returns the element at the `index-th`\n position in the given table.", "operands": [ { "name": "table", "type": "Executor_Table" } ], "results": [ { "name": "result", "type": "Executor_AnyType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "assemblyFormat": "attr-dict $table `[` $index `]` `:` type($table)" }, { "name": "executor.table.set", "description": "The `executor.table.insert` operation insert `value` into the `index`-th\n position in the table, returning a new (updated) copy of the table.", "operands": [ { "name": "table", "type": "Executor_Table" }, { "name": "value", "type": "Executor_AnyType" } ], "results": [ { "name": "result", "type": "Executor_AnyType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['table', 'result']>" } ], "assemblyFormat": "attr-dict $value `into` $table `[` $index `]` `:` type($value) `,` type($table)" }, { "name": "executor.tan", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.tanh", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "executor.trunc", "description": "The `executor.trunc` op truncates an integer to a smaller bitwidth.", "operands": [ { "name": "operand", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.truncf", "description": "Truncates a floating point type from one bitwidth to a floating point\n type of a narrower bitwidth. When an exact conversion is not possible,\n rounding occurs using the default rounding mode.", "operands": [ { "name": "operand", "type": "Executor_Float" } ], "results": [ { "name": "result", "type": "Executor_Float" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.uitofp", "description": "`executor.uitofp` casts unsigned integer to the corresponding floating point\n value. If value can't be exactly represented, it is rounded\n (implementation-defined). Out-of-range casts (truncations) result in mapping\n to +/-inf or max/min value depending on whether the target floating point\n type has a representation for infinities.", "operands": [ { "name": "operand", "type": "AnyTypeOf" } ], "results": [ { "name": "result", "type": "AnyTypeOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "executor.umax", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)" }, { "name": "executor.umin", "operands": [ { "name": "lhs", "type": "Executor_Integer" }, { "name": "rhs", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)" }, { "name": "executor.undef", "summary": "produces an undefined value", "description": "The `executor.undefined` operation produces a value whose binary\n storage representation (of the correct size for the scalar or fixed size\n aggregate) contains undefined data, and therefore may contain any possible\n bit pattern\n\n Current support for lowering `executor.undefined` is very limited. It\n is only created at intermediate stages (e.g. to support mem2reg transform,\n and translation to certain targets like the Lua interpreter will yield\n an error if the IR contains lingering `undef` values).\n\n See also [discussion on LLVM's undef](https://llvm.org/docs/LangRef.html#undefined-values)\n values for background on why this op exists and ideas for what we can\n do with it in the future.", "results": [ { "name": "result", "type": "AnyTypeOf<[Executor_Integer, Executor_Float, Executor_Table, Executor_Ptr]>" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "executor.uremi", "description": "`executor.uremi` performs an unsigned integer remainder operation.", "operands": [ { "name": "lhs", "type": "Executor_Index" }, { "name": "rhs", "type": "Executor_Index" } ], "results": [ { "name": "result", "type": "Executor_Index" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs)" }, { "name": "executor.zext", "description": "`executor.zext` extends the bitwidth of an integer, filling in the\n new bits with zeros.", "operands": [ { "name": "operand", "type": "Executor_Integer" } ], "results": [ { "name": "result", "type": "Executor_Integer" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "flow.call", "summary": "Calls a streamable external host function.", "description": "Calls a function taking/returning tensor values with stream semantics.\n Tensors have their shapes captured and may be tied to denote in-place\n operations. Asynchronous calls must have no side-effects.\n\n Note that returned tensors must have their shapes declared prior to the call\n as this is what allows the call to be made on the stream. If external host\n logic is required to compute the shape (avoid at all costs!) a separate\n func.call can be used outside of the stream to do so. If shapes are\n unknowable until the operation is performed it should be made as a normal\n asynchronous host call with 'coarse-fences' instead.", "operands": [ { "name": "arguments", "type": "Variadic" }, { "name": "argument_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee\n `(` $arguments `)` attr-dict `:`\n custom(ref($arguments),\n type($arguments), $argument_dims,\n type($results), $result_dims,\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "flow.channel.count", "summary": "Returns the total number of participants in the group.", "description": "Returns the total participant count in the collective communicator group.", "operands": [ { "name": "channel", "type": "FLOW_Channel" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$channel `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.channel.default", "summary": "Returns a default collective communication channel.", "description": "Returns a channel initialized using the runtime environment.", "results": [ { "name": "result", "type": "FLOW_Channel" } ], "attributes": [ { "name": "group", "type": "OptionalAttr" } ], "assemblyFormat": "($group^)?\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.channel.rank", "summary": "Returns the rank of the local participant in the group.", "description": "Returns the rank the channel represents as a participant in a collective\n group in `[0, count)`.", "operands": [ { "name": "channel", "type": "FLOW_Channel" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$channel `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.channel.split", "summary": "Splits a collective communication channel.", "description": "Partitions the group associated with the given channel into disjoint\n subgroups for each unique value of color. Each new subgroup contains all\n participants of the same color and within each subgroup the key argument\n is used to define the rank order. When multiple participants in a group\n use the same key the tie will be broken using their rank in the parent\n group.", "operands": [ { "name": "channel", "type": "FLOW_Channel" }, { "name": "color", "type": "Index" }, { "name": "key", "type": "Index" } ], "results": [ { "name": "result", "type": "FLOW_Channel" } ], "assemblyFormat": "$channel `,` $color `,` $key\n `:` type($channel) `->` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.collective.all_gather", "summary": "Performs all-gather operation.", "description": "Gathers data from all ranks and concatenates them on the 0-th dimension.", "operands": [ { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "source", "type": "FLOW_Tensor" }, { "name": "channel", "type": "FLOW_Channel" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "element_type", "type": "FLOW_CollectiveElementTypeAttr{si8|ui8|si16|ui16|si32|ui32|si64|ui64|f16|f32|f64|bf16}" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "$element_type `,` $target `,` $source `,` $channel `:`\n `(` type($target) `,` type($source) `,` type($channel) `)` `->`\n custom(type($result), $target_dims, $tied_operands)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.collective.all_reduce", "summary": "Performs all-reduce operation.", "description": "Reduces data across all the ranks in the channel.", "operands": [ { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "source", "type": "FLOW_Tensor" }, { "name": "channel", "type": "FLOW_Channel" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "reduction_op", "type": "FLOW_CollectiveReductionOpAttr{none|sum|product|minimum|maximum|average}" }, { "name": "element_type", "type": "FLOW_CollectiveElementTypeAttr{si8|ui8|si16|ui16|si32|ui32|si64|ui64|f16|f32|f64|bf16}" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['source', 'target', 'result']>" } ], "assemblyFormat": "$reduction_op `,` $element_type `,` $target `,` $source `,` $channel `:`\n `(` type($target) `,` type($source) `,` type($channel) `)` `->`\n custom(type($result), $target_dims, $tied_operands)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.collective.all_to_all", "summary": "Performs all-to-all operation.", "description": "This operation mutually exchanges data across all of the ranks in the channel.", "operands": [ { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "source", "type": "FLOW_Tensor" }, { "name": "channel", "type": "FLOW_Channel" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "element_type", "type": "FLOW_CollectiveElementTypeAttr{si8|ui8|si16|ui16|si32|ui32|si64|ui64|f16|f32|f64|bf16}" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "$element_type `,` $target `,` $source `,` $channel `:`\n `(` type($target) `,` type($source) `,` type($channel) `)` `->`\n custom(type($result), $target_dims, $tied_operands)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.collective.reduce_scatter", "summary": "Performs reduce and scatter operations.", "description": "The operation reduces data across all the ranks in the channel and\n scatters the result to each rank.", "operands": [ { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "source", "type": "FLOW_Tensor" }, { "name": "channel", "type": "FLOW_Channel" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "reduction_op", "type": "FLOW_CollectiveReductionOpAttr{none|sum|product|minimum|maximum|average}" }, { "name": "element_type", "type": "FLOW_CollectiveElementTypeAttr{si8|ui8|si16|ui16|si32|ui32|si64|ui64|f16|f32|f64|bf16}" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "$reduction_op `,` $element_type `,` $target `,` $source `,` $channel `:`\n `(` type($target) `,` type($source) `,` type($channel) `)` `->`\n custom(type($result), $target_dims, $tied_operands)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.collective.send_recv", "summary": "Performs a grouped send and receive operation.", "description": "The operation sends data to the rank specified by send\n and receives data from the rank specified by recv. If send is -1, this rank\n will not send any data. If recv is -1, this rank will not receive any data\n and the output will be all zeros.", "operands": [ { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "source", "type": "FLOW_Tensor" }, { "name": "channel", "type": "FLOW_Channel" }, { "name": "send", "type": "Index" }, { "name": "recv", "type": "Index" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "element_type", "type": "FLOW_CollectiveElementTypeAttr{si8|ui8|si16|ui16|si32|ui32|si64|ui64|f16|f32|f64|bf16}" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['source', 'target', 'result']>" } ], "assemblyFormat": "$element_type `,` $target `,` $source `,` $channel `,` $send `,` $recv `:`\n `(` type($target) `,` type($source) `,` type($channel) `,` type($send) `,` type($recv) `)` `->`\n custom(type($result), $target_dims, $tied_operands)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch", "summary": "A dispatch of workgroups across a grid.", "description": "Dispatches workgroups across an grid defined by the captured workload\n parameters carrying the information required to compute the workgroup count\n at runtime. The function for converting the workload into a 3D workgroup\n count is attached to the dispatch entry point and may contain\n arbitrary host logic.", "operands": [ { "name": "workload", "type": "Variadic" }, { "name": "arguments", "type": "Variadic" }, { "name": "argument_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "entry_points", "type": "TypedArrayAttrBase" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($entry_points)\n (`[` $workload^ `]`)? ``\n `(` $arguments `)` attr-dict `:`\n custom(ref($arguments),\n type($arguments), $argument_dims,\n type($results), $result_dims,\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch.entry", "hasCustomAssemblyFormat": 1 }, { "name": "flow.dispatch.region", "summary": "A grouping of ops with implicit capture.", "description": "This op is a container/grouping of ops. It represents a fusion group before\n being lowered to a dispatch region. Ops are collected inside of the region\n body of the op. Values from parent regions can be captured. Results are\n yielded with a `return` terminator and returned from this op.\n\n `dispatch.region` ops are lowered to `dispatch.workgroups` ops. Workgroups\n isolated from above. `dispatch.region` ops are a more lightweight\n abstraction for implementing fusion heuristics, i.e., the process of\n deciding which ops should form a dispatch region.\n\n This op also has a second region: `workload_count`. The arguments to the\n region represent the workload for the dispatch, and returns the number of\n workgroups for the dispatch. The region is lowered directly to\n `workload_count` region of `dispatch.workgroups`.", "operands": [ { "name": "result_dims", "type": "Variadic" }, { "name": "workload", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "AnyRegion" }, { "name": "workgroup_count", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch.tensor.load", "hasCustomAssemblyFormat": 1 }, { "name": "flow.dispatch.tensor.store", "hasCustomAssemblyFormat": 1 }, { "name": "flow.dispatch.tie_shape", "summary": "Ties a runtime shape to a dispatch I/O argument.", "description": "Metadata op used to tie a runtime-computed shape with dynamic dimensions to\n a dispatch input/output argument. All uses of the argument should use the\n pass-through result of this op to allow for SSA-based shape resolution.", "operands": [ { "name": "operand", "type": "IREETensorExt_DispatchTensor" }, { "name": "dynamic_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "IREETensorExt_DispatchTensor" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict\n `:` type($result) (`{` $dynamic_dims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch.workgroup.count", "summary": "Returns the total workgroup count of the grid.", "description": "The total number of workgroups along each dimension in the dispatch grid.\n\n Represented as a 3D grid classically written as XYZ.\n Corresponds to the `NumWorkgroups` SPIR-V built-in and the `gridDim` CUDA\n built-in variable.\n\n ```mlir\n %x = flow.dispatch.workgroup.count[0] : index\n %y = flow.dispatch.workgroup.count[1] : index\n %z = flow.dispatch.workgroup.count[2] : index\n ```", "results": [ { "name": "result", "type": "FLOW_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "assemblyFormat": "`[` $dimension `]` attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch.workgroup.id", "summary": "Returns the index of the current workgroup in the grid.", "description": "The global workgroup ID of the current workgroup in the range of\n `[0, flow.dispatch.workgroup.count)` along each dimension.\n\n Represented as a 3D grid classically written as XYZ.\n Corresponds to the `WorkgroupId` SPIR-V built-in and the `blockIdx` CUDA\n built-in variable.\n\n ```mlir\n %x = flow.dispatch.workgroup.id[0] : index\n %y = flow.dispatch.workgroup.id[1] : index\n %z = flow.dispatch.workgroup.id[2] : index\n ```", "results": [ { "name": "result", "type": "FLOW_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "assemblyFormat": "`[` $dimension `]` attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch.workgroup.size", "summary": "Returns the size of each workgroup in invocations.", "description": "The number of local invocations within the current workgroup along each\n dimension. Depending on backend this may map to the SIMT thread count or\n inner loop nest parameters.\n\n Workgroup sizes are not determined at the flow dialect level as they are\n dependent on the target backend determined when lowering into the HAL. It's\n still possible to use the symbolic workgroup size inside of dispatch\n executables as a placeholder for the resolved value once in the HAL.\n\n Represented as a 3D grid classically written as XYZ.\n Corresponds to the `WorkgroupSize` SPIR-V built-in and the `blockDim` CUDA\n built-in variable.\n\n ```mlir\n %x = flow.dispatch.workgroup.size[0] : index\n %y = flow.dispatch.workgroup.size[1] : index\n %z = flow.dispatch.workgroup.size[2] : index\n ```", "results": [ { "name": "result", "type": "FLOW_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "assemblyFormat": "`[` $dimension `]` attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "flow.dispatch.workgroups", "summary": "A dispatch of workgroups across a 3-dimensional grid.", "description": "Dispatches some number of workgroups across a 3-dimensional grid. The\n body region will be invoked for each workgroup with a unique\n `flow.dispatch.workgroup.id` in the range of\n `[0, flow.dispatch.workgroup.count)` (along each dimension XYZ).\n\n From the outside the dispatch operation has value semantics: some tensors\n (and optionally other primitive types) are consumed and one or more new\n result tensors are produced. Inside each workgroup, however, the input and\n output tensors are available for arbitrary loads and stores. In many cases\n each workgroup will load some particular tile(s) from the input tensors and\n store some particular tile(s) to the output tensors unique to that\n workgroup. Though it's possible for multiple workgroups to load the same\n regions of the input tensors behavior is undefined if multiple workgroups\n store to the same regions of the output tensors.\n\n Though the representation is similar to the GPU-style grid dispatch model\n here we still have not yet allocated buffers, determined the target device\n for execution, or even completed fully resolving shapes/types/etc. Because\n of this it's important that the workgroup body use the\n `flow.dispatch.workgroup.*` ops to query the workgroup ID/count/size instead\n of hardcoding them to a particular set of values. Assume that any workgroup\n dispatch may end up being specialized for several different target devices\n and even several different variants for a particular target device\n (differing workgroup sizes, etc).\n\n Because at this point in the layering devices have not yet been selected the\n workgroup count cannot be fully evaluated. Instead workload parameters are\n captured that are then passed to a function that when later evaluated\n computes the actual workgroup count based on target information. The\n workload is not limited to the 3D XYZ grid dispatch of the workgroup count\n and can contain any number of parameters used to compute it.\n\n ```mlir\n %r = flow.dispatch.workgroups[%c5, %c5](%0, %1)\n : (tensor<5x5xf32>, tensor<5xf32>) -> tensor<5x5xf32> =\n (%arg0: !iree_tensor_ext.dispatch.tensor>,\n %arg1: !iree_tensor_ext.dispatch.tensor>,\n %arg2: !iree_tensor_ext.dispatch.tensor>) {\n ...\n }\n ```\n\n The number of results of the operation is equal to the number of results\n in the type signature (`(tensor<5x5xf32>, tensor<5xf32>) -> tensor<5x5xf32>`).\n Each tensor argument and result in the type signature has a corresponding\n block argument of type `!iree_tensor_ext.dispatch.tensor`. Furthermore, each argument\n has a corresponding `arguments` operand.\n\n There are no `arguments` operands for results, but a result can be tied an\n argument by writing the argument operand's SSA value instead of its type:\n E.g., in the above example, `-> %0` would tie the first argument to the\n result. In that case, there would be no separate block argument for the\n result.", "operands": [ { "name": "workload", "type": "Variadic" }, { "name": "arguments", "type": "Variadic" }, { "name": "argument_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "tied_operands", "type": "OptionalAttr>" } ], "regions": [ { "name": "workgroup_body", "type": "AnyRegion" }, { "name": "workgroup_count", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`[` $workload^ `]`)? ``\n `(` $arguments `)` `:`\n custom(ref($arguments),\n type($arguments), $argument_dims,\n type($results), $result_dims,\n $tied_operands)\n attr-dict-with-keyword\n `=` `\\n` ` ` ` ` ` `\n custom(ref(type($arguments)),\n ref(type($results)),\n $workgroup_body)\n `` custom($workgroup_count)", "hasCustomAssemblyFormat": true }, { "name": "flow.ex.stream.fragment", "hasCustomAssemblyFormat": 1 }, { "name": "flow.executable", "summary": "Generic executable module.", "description": "An executable module containing one or more public functions. The contents\n of the functions are safe to dispatch and can be lowered further to\n target-specific backend IR representations.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n attr-dict-with-keyword\n regions", "hasCustomAssemblyFormat": true }, { "name": "flow.executable_end", "summary": "Terminator pseudo-op for the executable op.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "flow.executable.export", "summary": "Defines an executable entry point for dispatch operations.", "description": "Specifies an exported function with an externally-visible alias. Multiple\n exports can reference the same internal function.\n\n Each entry point can have a unique workgroup count calculation region.\n This region takes the workload parameters passed to each flow.dispatch and\n produces an XYZ workgroup count for the 3D grid dispatch.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_ref", "type": "FlatSymbolRefAttr" } ], "regions": [ { "name": "workgroup_count", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n custom($sym_name, $function_ref)\n custom($workgroup_count)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.func", "summary": "Streamable function declaration.", "description": "Declares a function that can be called as an asynchronous streaming\n operation via `flow.call`. Today only external functions are allowed.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n ``\n custom($function_type,\n $tied_operands,\n $arg_attrs,\n $res_attrs)\n attr-dict-with-keyword\n ($body^)?", "hasCustomAssemblyFormat": true }, { "name": "flow.parameter.load", "summary": "Loads a tensor from a parameter archive.", "description": "Allocates a new tensor and populates it with data from a parameter archive\n file (or in-memory buffer) at the specified byte offset. The scope is an\n optional namespace for the parameter key.\n\n Example:\n ```mlir\n %result = flow.parameter.load %key[%offset] : tensor<4x8xf32>\n %result = flow.parameter.load %scope::%key[%offset] : tensor{%dim0}\n ```", "operands": [ { "name": "source_scope", "type": "Optional" }, { "name": "source_key", "type": "Util_BufferType" }, { "name": "source_offset", "type": "I64" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($source_scope, $source_key)\n `` `[` $source_offset `]`\n `:` type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.parameter.write", "summary": "Writes a tensor to a parameter archive.", "description": "Writes data from a source tensor to a parameter archive file (or in-memory\n buffer) at the specified byte offset. The source tensor is returned\n unchanged to establish proper data flow dependencies. The scope is an\n optional namespace for the parameter key.\n\n Example:\n ```mlir\n %written = flow.parameter.write %source -> %key[%offset] : tensor<4x8xf32>\n %written = flow.parameter.write %source -> %scope::%key[%offset] : tensor{%dim0}\n ```", "operands": [ { "name": "source", "type": "FLOW_Tensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_key", "type": "Util_BufferType" }, { "name": "target_offset", "type": "I64" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `->` custom($target_scope, $target_key)\n `` `[` $target_offset `]`\n `:` type($source) (`{` $source_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.return", "summary": "Return from a flow.dispatch_region.", "description": "Returns the given values from the region and back to the host code.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.alloca", "summary": "An empty tensor allocation with undefined contents.", "description": "Returns a new transient tensor allocation with undefined contents.\n Subsequent writes must populate any ranges of the tensor that are later\n read. The resulting tensor may be long-lived and allocated as part of a\n dedicated allocation. Prefer using `flow.tensor.empty` whenever possible as\n this op disables nearly all allocation-related optimizations performed by\n the compiler. The presence of this op is often an indication of an improper\n lowering.", "operands": [ { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "assemblyFormat": "`:` type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.barrier", "summary": "Indicates a value that must have a specific affinity.", "description": "Prevents fusion and scheduling of a value across an affinity boundary.\n May introduce copy-on-write behavior if the operand value is used as well as\n the result and users should try to keep the operand to a single use by this\n op.", "operands": [ { "name": "operand", "type": "FLOW_Tensor" }, { "name": "operand_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "target", "type": "AnyAttr" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `:` type($result) (`{` $operand_dims^ `}`)?\n `on` $target\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.bitcast", "summary": "Bitcasts a tensor without modifying the contents.", "description": "Bitcasts a tensor |source| to the shape implied by this operations result\n type interleaved with |result_dims|, potentially with a different element\n type. For example,\n\n ```\n result_dims = {%0, %1}\n result_type = tensor<1x?x2x?x3 x!eltype>\n ```\n\n produces a tensor of shape [1, %0, 2, %1, 3] and element type `!eltype`.\n Note that the source and result tensors must serialized to the same size.", "operands": [ { "name": "source", "type": "FLOW_Tensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `:`\n type($source) (`{` $source_dims^ `}`)? `->`\n type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.clone", "summary": "Performs a full tensor clone operation.", "description": "Clones the input tensor into an identical output tensor.", "operands": [ { "name": "operand", "type": "FLOW_Tensor" }, { "name": "operand_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `:` type($result) (`{` $operand_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.constant", "summary": "Tensor constant that can have dynamic dimensions.", "description": "Allows specifying a tensor constant of IREE-specific types/attributes.\n\n ```mlir\n %cst = flow.tensor.constant #something_tensor_like : tensor<2x2xf32>\n %res = math.absf %cst : tensor<2x2xf32>\n ```", "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "attr-dict $value", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.dynamic_constant", "summary": "Tensor constant that can have dynamic dimensions.", "description": "Allows specifying a tensor constant of IREE-specific types/attributes with\n a dynamic shape that approximates a value as passed from the user. This\n disables many optimizations and should only be used when testing or\n benchmarking and wanting to ensure that dynamic dimension behavior is\n preserved.\n\n ```mlir\n %cst = flow.tensor.dynamic_constant #something_tensor_like : tensor<2x2xf32> -> tensor\n %res = math.absf %cst : tensor\n ```", "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "assemblyFormat": "attr-dict $value `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.empty", "summary": "An empty tensor carrying metadata but no contents.", "description": "Returns a tensor with undefined contents. Subsequent writes must populate\n any ranges of the tensor that are later read.", "operands": [ { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "assemblyFormat": "`:` type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.encode", "summary": "Performs a full tensor encode operation.", "description": "Encode the input tensor into an encoded output tensor.", "operands": [ { "name": "operand", "type": "FLOW_Tensor" }, { "name": "operand_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$operand `:`\n type($operand) (`{` $operand_dims^ `}`)? `->`\n type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.load", "summary": "Loads a value from a tensor element.", "description": "Returns the element at the given location from within the tensor.", "operands": [ { "name": "source", "type": "FLOW_Tensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[FLOW_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "traits": [ { "type": "TypesMatchWith<'source', 'result', 'cast($_self).getElementType()'>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source (`[` $indices^ `]`)? `:`\n type($source) (`{` $source_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.reshape", "summary": "Reshapes a tensor without modifying the contents.", "description": "Reshapes a tensor |source| to the shape implied by this operations result\n type interleaved with |result_dims|. For example,\n\n ```\n result_dims = {%0, %1}\n result_type = tensor<1x?x2x?x3>\n ```\n\n produces a tensor of shape [1, %0, 2, %1, 3] and the same element type.", "operands": [ { "name": "source", "type": "FLOW_Tensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `:`\n type($source) (`{` $source_dims^ `}`)? `->`\n type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.slice", "summary": "Clones a subregion of a tensor.", "operands": [ { "name": "source", "type": "FLOW_Tensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "start_indices", "type": "Variadic" }, { "name": "lengths", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `[` $start_indices `for` $lengths `]` `:`\n type($source) (`{` $source_dims^ `}`)? `->`\n type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.splat", "summary": "Splats a value into a shaped tensor.", "description": "Returns a tensor initialized to the given primitive value.", "operands": [ { "name": "value", "type": "FLOW_PrimitiveType" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "TypesMatchWith<'result', 'value', 'cast($_self).getElementType()'>" } ], "assemblyFormat": "$value `:` type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.store", "summary": "Stores a value into a tensor element.", "description": "Returns a tensor with the element at the given index set to the given value.", "operands": [ { "name": "value", "type": "AnyTypeOf<[FLOW_PrimitiveType, AnyVectorOfNonZeroRank]>" }, { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" }, { "type": "TypesMatchWith<'target', 'value', 'cast($_self).getElementType()'>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$value `,` $target (`[` $indices^ `]`)? `:`\n type($target) (`{` $target_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.tie_shape", "summary": "Ties a runtime shape to a tensor value.", "description": "Metadata op used to tie tensors with their runtime-computed dynamic\n dimensions. This only exists transiently in the IR as a witness to shape\n calculations and is removed during lowering.", "operands": [ { "name": "operand", "type": "FLOW_Tensor" }, { "name": "dynamic_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict\n `:` type($result) (`{` $dynamic_dims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.trace", "summary": "Traces one or more tensor values at runtime.", "description": "Traces out to a runtime trace sink (console, log file, etc) the given\n tensors. The key is arbitrary and can be used for identifying the set of\n values being traced.", "operands": [ { "name": "values", "type": "Variadic" }, { "name": "value_dims", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$key `=` `[`\n custom($values, type($values), $value_dims)\n `]` attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.transfer", "summary": "Transfers a tensor to a target by copying if needed.", "description": "Transfers the tensor from whichever context it may be in to the specified\n target context. If the contexts are compatible and can access each others\n memory the operation may be elided and otherwise will become one or more\n copies to transfer the tensor in cases where staging through an intermediate\n context is required.", "operands": [ { "name": "operand", "type": "FLOW_Tensor" }, { "name": "operand_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "attributes": [ { "name": "target", "type": "AnyAttr" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `:` type($result) (`{` $operand_dims^ `}`)?\n `to` $target\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "flow.tensor.update", "summary": "Updates a tensor with the contents of another tensor.", "description": "Updates the target tensor with the contents of the update tensor at the\n given offset indices.", "operands": [ { "name": "target", "type": "FLOW_Tensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "start_indices", "type": "Variadic" }, { "name": "update", "type": "FLOW_Tensor" }, { "name": "update_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "FLOW_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$update `,` $target `[` $start_indices `]` `:`\n type($update) (`{` $update_dims^ `}`)? `->`\n custom(type($result), $target_dims)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "func.call", "summary": "call operation", "description": "The `func.call` operation represents a direct call to a function that is\n within the same symbol scope as the call. The operands and result types of\n the call must match the specified function type. The callee is encoded as a\n symbol reference attribute named \"callee\".\n\n Example:\n\n ```mlir\n %2 = func.call @my_add(%0, %1) : (f32, f32) -> f32\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "no_inline", "type": "UnitAttr" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "func.call_indirect", "summary": "indirect call operation", "description": "The `func.call_indirect` operation represents an indirect call to a value\n of function type. The operands and result types of the call must match the\n specified function type.\n\n Function values can be created with the\n [`func.constant` operation](#funcconstant-constantop).\n\n Example:\n\n ```mlir\n %func = func.constant @my_func : (tensor<16xf32>, tensor<16xf32>) -> tensor<16xf32>\n %result = func.call_indirect %func(%0, %1) : (tensor<16xf32>, tensor<16xf32>) -> tensor<16xf32>\n ```", "operands": [ { "name": "callee", "type": "FunctionType" }, { "name": "callee_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "TypesMatchWith<'callee', 'callee_operands', '::llvm::cast($_self).getInputs()'>" }, { "type": "TypesMatchWith<'callee', 'results', '::llvm::cast($_self).getResults()'>" } ], "assemblyFormat": "$callee `(` $callee_operands `)` attr-dict `:` type($callee)" }, { "name": "func.constant", "summary": "constant", "description": "The `func.constant` operation produces an SSA value from a symbol reference\n to a `func.func` operation\n\n Example:\n\n ```mlir\n // Reference to function @myfn.\n %2 = func.constant @myfn : (tensor<16xf32>, f32) -> tensor<16xf32>\n\n // Equivalent generic forms\n %2 = \"func.constant\"() { value = @myfn } : () -> ((tensor<16xf32>, f32) -> tensor<16xf32>)\n ```\n\n MLIR does not allow direct references to functions in SSA operands because\n the compiler is multithreaded, and disallowing SSA values to directly\n reference a function simplifies this\n ([rationale](../Rationale/Rationale.md#multithreading-the-compiler)).", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "attr-dict $value `:` type(results)" }, { "name": "func.func", "summary": "An operation with a name containing a single `SSACFG` region", "description": "Operations within the function cannot implicitly capture values defined\n outside of the function, i.e. Functions are `IsolatedFromAbove`. All\n external references must use function arguments or attributes that establish\n a symbolic connection (e.g. symbols referenced by name via a string\n attribute like SymbolRefAttr). An external function declaration (used when\n referring to a function declared in some other module) has no body. While\n the MLIR textual form provides a nice inline syntax for function arguments,\n they are internally represented as “block arguments” to the first block in\n the region.\n\n Only dialect attribute names may be specified in the attribute dictionaries\n for function arguments, results, or the function itself.\n\n Example:\n\n ```mlir\n // External function definitions.\n func.func private @abort()\n func.func private @scribble(i32, i64, memref) -> f64\n\n // A function that returns its argument twice:\n func.func @count(%x: i64) -> (i64, i64)\n attributes {fruit = \"banana\"} {\n return %x, %x: i64, i64\n }\n\n // A function with an argument attribute\n func.func private @example_fn_arg(%x: i32 {swift.self = unit})\n\n // A function with a result attribute\n func.func private @example_fn_result() -> (f64 {dialectName.attrName = 0 : i64})\n\n // A function with an attribute\n func.func private @example_fn_attr() attributes {dialectName.attrName = false}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "no_inline", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "func", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "func.return", "summary": "Function return operation", "description": "The `func.return` operation represents a return operation within a function.\n The operation takes variable number of operands and produces no results.\n The operand number and types must match the signature of the function\n that contains the operation.\n\n Example:\n\n ```mlir\n func.func @foo() -> (i32, f8) {\n ...\n return %0, %1 : i32, f8\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "gluon.set_auto_layout", "summary": "set auto encoding to a concrete encoding type", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "gpu.all_reduce", "summary": "Reduce values among workgroup.", "description": "The `all_reduce` op reduces the value of every work item across a local\n workgroup. The result is equal for all work items of a workgroup.\n\n For example, both\n\n ```mlir\n %1 = gpu.all_reduce add %0 {} : (f32) -> (f32)\n %2 = gpu.all_reduce %0 {\n ^bb(%lhs : f32, %rhs : f32):\n %sum = arith.addf %lhs, %rhs : f32\n \"gpu.yield\"(%sum) : (f32) -> ()\n } : (f32) -> (f32)\n ```\n\n compute the sum of each work item's %0 value. The first version specifies\n the accumulation as operation, whereas the second version specifies the\n accumulation as code region. The reduction operation must be one of:\n * Integer types: `add`, `mul`, `minui`, `minsi`, `maxui`, `maxsi`, `and`,\n `or`, `xor`\n * Floating point types: `add`, `mul`, `minnumf`, `maxnumf`, `minimumf`,\n `maximumf`\n\n If `uniform` flag is set either none or all work items of a workgroup\n need to execute this op in convergence.", "operands": [ { "name": "value", "type": "AnyIntegerOrFloat" } ], "results": [ { "name": "result", "type": "AnyIntegerOrFloat" } ], "attributes": [ { "name": "op", "type": "OptionalAttr" }, { "name": "uniform", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($op) $value\n (`uniform` $uniform^)? $body attr-dict\n `:` functional-type(operands, results)" }, { "name": "gpu.alloc", "summary": "GPU memory allocation operation.", "description": "The `gpu.alloc` operation allocates a region of memory on the GPU. It is\n similar to the `memref.alloc` op, but supports asynchronous GPU execution.\n\n The op does not execute before all async dependencies have finished\n executing.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it also returns a !gpu.async.token.\n\n If the `host_shared` keyword is present, the memory will be allocated in a\n memory accessible both on host and on device.\n\n Example:\n\n ```mlir\n %memref, %token = gpu.alloc async [%dep] host_shared (%width) : memref<64x?xf32, 1>\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "dynamicSizes", "type": "Variadic" }, { "name": "symbolOperands", "type": "Variadic" } ], "results": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "hostShared", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies) (` ` `host_shared` $hostShared^)? ` `\n `(` $dynamicSizes `)` (`` `[` $symbolOperands^ `]`)? attr-dict `:` type($memref)" }, { "name": "gpu.ballot", "summary": "Collects predicate values from all threads in a subgroup.", "description": "The `ballot` op performs a ballot operation across all threads in a subgroup.\n Each thread contributes its predicate value as a single bit. The result is an\n integer where the Nth bit is set iff the Nth thread's predicate is true.\n\n The result type must be a signless integer type. The exact supported widths\n are target-dependent. Common GPU targets support i32 and i64.\n\n Example:\n ```mlir\n %0 = gpu.ballot %pred : i32\n %1 = gpu.ballot %pred : i64\n ```", "operands": [ { "name": "predicate", "type": "I1" } ], "results": [ { "name": "result", "type": "AnySignlessInteger" } ], "assemblyFormat": "$predicate attr-dict `:` type($result)" }, { "name": "gpu.barrier", "summary": "Synchronizes work items within an execution scope.", "description": "The `barrier` op synchronizes work items within the specified execution\n scope. By default, the scope is `workgroup`, synchronizing all work items\n in a workgroup.\n\n ```mlir\n // Synchronize all work items in the workgroup, making all prior\n // memory accesses visible.\n gpu.barrier\n ```\n\n waits until all work items in the workgroup have reached the operation\n and all memory accesses made by these work items prior to the op are\n visible to all work items in the workgroup. Data hazards between work items\n accessing the same memory can be avoided by synchronizing work items\n in-between these accesses.\n\n The `scope` attribute controls the execution scope of the barrier:\n\n ```mlir\n // Synchronize within a subgroup (warp/wavefront).\n gpu.barrier scope \n // Synchronize within a cluster.\n gpu.barrier scope \n ```\n\n A `named` barrier allows synchronizing a specific subset of subgroups\n that have been associated with a named barrier handle. Named barriers\n require workgroup scope.\n\n ```mlir\n // Initialize a named barrier for 4 participating members.\n %nb = gpu.initialize_named_barrier %c4 : i32 -> !gpu.named_barrier\n // Wait on the named barrier.\n gpu.barrier named(%nb : !gpu.named_barrier)\n ```\n\n If the `memfence` attribute is specified, the set of memory accesses that\n must be completed after the barrier resolves is limited to only those\n accesses that read from or write to the specified address spaces. In\n particular, specifying `memfence []` creates a barrier that is not required\n to affect the visibility of any memory operations and is purely used for\n synchronizing work items.\n\n ```mlir\n // Only workgroup address space accesses required to be visible.\n gpu.barrier memfence [#gpu.address_space]\n // No memory accesses required to be visible.\n gpu.barrier memfence []\n // All memory accesses required to be visible.\n gpu.barrier\n ```\n\n The three clauses can be combined in any order, but not all combinations may\n be supported on a given target:\n\n ```mlir\n // Named barrier with a workgroup-only memory fence.\n gpu.barrier named(%nb : !gpu.named_barrier) memfence [#gpu.address_space]\n // Subgroup barrier with a global fence.\n gpu.barrier memfence [#gpu.address_space] scope \n ```\n\n Once one thread of execution in a given scope (say, thread in a workgroup)\n has executed a particular dynamic instance of `gpu.barrier`, all other threads\n in that scope are required to execute the same dynamic instance of `gpu.barrier`\n before any thread executes any other instance of it. That is, you cannot, for\n example, have the two subgroups of a workgroup arrive at `gpu.barrier` ops in\n different branches of an if statement and have this work.", "operands": [ { "name": "named_barrier", "type": "Optional" } ], "attributes": [ { "name": "address_spaces", "type": "OptionalAttr>" }, { "name": "scope", "type": "DefaultValuedAttr" } ], "assemblyFormat": "oilist(\n `named` `(` $named_barrier `:` type($named_barrier) `)`\n | `memfence` $address_spaces\n | `scope` $scope\n ) attr-dict" }, { "name": "gpu.binary", "summary": "An Op for storing serialized GPU binary objects.", "description": "GPU binaries provide a semantic mechanism for storing GPU objects,\n e.g. the result of compiling a GPU module to an object file.\n\n This operation has 3 arguments:\n - The name of the binary.\n - An optional attribute implementing the offloading LLVM translation interface.\n - An array of GPU object attributes.\n\n During translation, the offloading attribute will be called for translating\n GPU `binary` and `launch_func` operations. The default offloading handler is:\n `#gpu.select_object`, this handler selects the first object from the array\n and embeds it as a string.\n\n Examples:\n ```\n // Selects the first object.\n gpu.binary @myobject [#gpu.object<...>, #gpu.object<...>]\n // Uses the `#foo.my_handler` for handling the binary during translation.\n gpu.binary @myobject <#foo.my_handler> [#gpu.object<...>, #gpu.object<...>]\n // Selects the object with the `#rocdl.target` target attribute.\n gpu.binary @myobject <#gpu.select_object<#rocdl.target>> [#gpu.object<...>, #gpu.object<#rocdl.target, ...>]\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "offloadingHandler", "type": "OptionalAttr>" }, { "name": "objects", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ], "assemblyFormat": "$sym_name custom($offloadingHandler) attr-dict $objects" }, { "name": "gpu.block_dim", "description": "Returns the number of threads in the thread block (aka the block size) along\n the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %bDimX = gpu.block_dim x\n ```\n\n If `known_block_size` is set on an this operation's enclosing `gpu.func`,\n or `gpu.known_block_size` is set on an enclosing `FunctionOpInterface`\n implementor, or if the enclosing `gpu.launch` specifies a constant size for\n `dimension`'s blocks, these contextual facts may be used to infer that this\n operation has a constant value, though such a transformation will not be\n performed by canonicalization or the default constant folder. Executions which\n cause that constant-value assumption to be false incur undefined behavior.\n\n If `upper_bound` is set, executions where the bblock size along `dimension`\n exceeds `upper_bound` cause undefined behavior.\n\n There is an implicit upper bound of `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.block_id", "description": "Returns the block id, i.e. the index of the current block within the grid\n along the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %bIdY = gpu.block_id y\n ```\n\n If `upper_bound` is set, or if one can be inferred from `known_grid_size`-type\n annotations in context, executions where the block index in `dimension` would\n be greater than or equal to that bound cause undefined behavior. `upper_bound`\n takes priority over bounds inferrable from context.\n\n There is an implicit upper bound of `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.cluster_block_id", "description": "Returns the block id within the cluster along the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %cBlockIdY = gpu.cluster_block_id y\n ```\n\n If `upper_bound` is set, then executing (a lowering of) this operation in an\n environment where the number of thread blocks per cluster along `dimension`\n is greater than `upper_bound` causes undefined behavior.\n\n There is an implicit upper bound of `kMaxClusterDim` (currently 8).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.cluster_dim", "description": "Returns the number of cluster identifiers per grid along\n the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %cDimX = gpu.cluster_dim x\n ```\n\n If `upper_bound` is set, then executing (a lowering of) this operation in an\n environment where the clusters per grid is greater than `upper_bound` causes\n undefined behavior.\n\n There is an implicit upper bound of `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.cluster_dim_blocks", "description": "Returns the number of thread blocks in the cluster along\n the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %cDimBlocksX = gpu.cluster_dim_blocks x\n ```\n\n If `upper_bound` is set, then executing (a lowering of) this operation in an\n environment where the thread blocks per cluster is greater than `upper_bound`\n causes undefined behavior.\n\n There is an implicit upper bound of `kMaxClusterDim` (currently 8).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.cluster_id", "description": "Returns the cluster id, i.e. the index of the current cluster within the\n grid along the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %cIdY = gpu.cluster_id y\n ```\n\n If `upper_bound` is set, then executing (a lowering of) this operation in an\n environment where the number of clusters in the grid along `dimension` is\n greater than `upper_bound` causes undefined behavior.\n\n There is an implicit upper bound of `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.create_2to4_spmat", "summary": "Create sparse matrix with 2:4 sparsity operation", "description": "The `gpu.create_2to4_spmat` operation initializes a sparse matrix in dense\n format with 2:4 sparsity.\n The buffers must already be copied from the host to the device prior to\n using this operation. The operation returns a handle to the sparse\n matrix descriptor.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %spmat, %token = gpu.create_2to4_spmat async [%dep] {PRUNE_AND_CHECK} %rows, %cols, %mem: memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "rows", "type": "Index" }, { "name": "cols", "type": "Index" }, { "name": "memref", "type": "AnyMemRef" } ], "results": [ { "name": "spMat", "type": "GPU_SparseSpMatHandle" }, { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "pruneFlag", "type": "GPU_Prune2To4SpMatFlagAttr{NONE|PRUNE_ONLY|PRUNE_AND_CHECK}" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n `{` $pruneFlag `}` $rows `,` $cols `,` $memref attr-dict `:` type($memref)" }, { "name": "gpu.create_bsr", "summary": "Create sparse matrix in BSR format operation", "description": "The `gpu.create_bsr` operation initializes a sparse matrix in BSR format\n with the given sizes for the matrix and blocks from the given position,\n index, and values buffers. The buffers must already be copied from the\n host to the device prior to using this operation. The operation returns\n a handle to the sparse matrix descriptor.\n\n The BSR format is similar to CSR, where the column indices represent\n two-dimensional blocks instead of a single matrix entry. Note that this\n operation (currently) only supports storage with **square** blocks,\n i.e., `rBlockSize == cBlockSize`.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %spmat, %token = gpu.create_bsr async [%dep]\n %brows, %bcols, %bnnz, %rBlockSize, %cBlockSize,\n %bRowPos, %bColIdxs, %values : memref, memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "brows", "type": "Index" }, { "name": "bcols", "type": "Index" }, { "name": "bnnz", "type": "Index" }, { "name": "rBlockSize", "type": "Index" }, { "name": "cBlockSize", "type": "Index" }, { "name": "bRowPos", "type": "AnyMemRef" }, { "name": "bColIdxs", "type": "AnyMemRef" }, { "name": "values", "type": "AnyMemRef" } ], "results": [ { "name": "spmat", "type": "GPU_SparseSpMatHandle" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $brows `,` $bcols `,` $bnnz `,` $rBlockSize `,` $cBlockSize `,`\n $bRowPos `,` $bColIdxs `,` $values attr-dict\n `:` type($bRowPos) `,` type($bColIdxs) `,` type($values)" }, { "name": "gpu.create_coo", "summary": "Create sparse matrix in COO format operation", "description": "The `gpu.create_coo` operation initializes a sparse matrix in COO format\n with the given sizes from the given index and values buffers. The buffers\n must already be copied from the host to the device prior to using this\n operation. The operation returns a handle to the sparse matrix descriptor.\n Note that this operation builds the COO in SoA format.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %spmat, %token = gpu.create_coo async [%dep] %rows, %cols, %nnz, %rowIdx,\n %colIdx, %values : memref, memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "rows", "type": "Index" }, { "name": "cols", "type": "Index" }, { "name": "nnz", "type": "Index" }, { "name": "rowIdxs", "type": "AnyMemRef" }, { "name": "colIdxs", "type": "AnyMemRef" }, { "name": "values", "type": "AnyMemRef" } ], "results": [ { "name": "spmat", "type": "GPU_SparseSpMatHandle" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $rows `,` $cols `,` $nnz `,` $rowIdxs `,` $colIdxs `,` $values attr-dict\n `:` type($rowIdxs) `,` type($colIdxs) `,` type($values)" }, { "name": "gpu.create_coo_aos", "summary": "Create sparse matrix in COO format operation (AoS)", "description": "The `gpu.create_coo_aos` operation initializes a sparse matrix in COO format\n with the given sizes from the given index and values buffers. The buffers\n must already be copied from the host to the device prior to using this\n operation. The operation returns a handle to the sparse matrix descriptor.\n Unlike the default `gpu.create_coo` operation, this operation builds the\n COO format from a single index buffer in AoS format (note that this\n feature has been deprecated in cuSparse 11.2).\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %spmat, %token = gpu.create_coo_aos async [%dep] %rows, %cols, %nnz, %idxs,\n %values : memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "rows", "type": "Index" }, { "name": "cols", "type": "Index" }, { "name": "nnz", "type": "Index" }, { "name": "idxs", "type": "AnyMemRef" }, { "name": "values", "type": "AnyMemRef" } ], "results": [ { "name": "spmat", "type": "GPU_SparseSpMatHandle" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $rows `,` $cols `,` $nnz `,` $idxs `,` $values attr-dict\n `:` type($idxs) `,` type($values)" }, { "name": "gpu.create_csc", "summary": "Create sparse matrix in CSC format operation", "description": "The `gpu.create_csc` operation initializes a sparse matrix in CSC format\n with the given sizes from the given position, index, and values buffers.\n The buffers must already be copied from the host to the device prior to\n using this operation. The operation returns a handle to the sparse\n matrix descriptor.\n\n The CSC format has exactly the same memory layout as its transpose\n in CSR format (and vice versa).\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %spmat, %token = gpu.create_csc async [%dep] %rows, %cols, %nnz, %colPos,\n %rowIdx, %values : memref, memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "rows", "type": "Index" }, { "name": "cols", "type": "Index" }, { "name": "nnz", "type": "Index" }, { "name": "colPos", "type": "AnyMemRef" }, { "name": "rowIdxs", "type": "AnyMemRef" }, { "name": "values", "type": "AnyMemRef" } ], "results": [ { "name": "spmat", "type": "GPU_SparseSpMatHandle" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $rows `,` $cols `,` $nnz `,` $colPos `,` $rowIdxs `,` $values attr-dict\n `:` type($colPos) `,` type($rowIdxs) `,` type($values)" }, { "name": "gpu.create_csr", "summary": "Create sparse matrix in CSR format operation", "description": "The `gpu.create_csr` operation initializes a sparse matrix in CSR format\n with the given sizes from the given position, index, and values buffers.\n The buffers must already be copied from the host to the device prior to\n using this operation. The operation returns a handle to the sparse\n matrix descriptor.\n\n The CSR format has exactly the same memory layout as its transpose\n in CSC format (and vice versa).\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %spmat, %token = gpu.create_csr async [%dep] %rows, %cols, %nnz, %rowPos,\n %colIdx, %values : memref, memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "rows", "type": "Index" }, { "name": "cols", "type": "Index" }, { "name": "nnz", "type": "Index" }, { "name": "rowPos", "type": "AnyMemRef" }, { "name": "colIdxs", "type": "AnyMemRef" }, { "name": "values", "type": "AnyMemRef" } ], "results": [ { "name": "spmat", "type": "GPU_SparseSpMatHandle" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $rows `,` $cols `,` $nnz `,` $rowPos `,` $colIdxs `,` $values attr-dict\n `:` type($rowPos) `,` type($colIdxs) `,` type($values)" }, { "name": "gpu.create_dn_tensor", "summary": "Create dense tensor operation", "description": "The `gpu.create_dn_tensor` operation initializes a dense tensor from\n the given values buffer and sizes. The buffer must already be copied\n from the host to the device prior to using this operation. The\n operation returns a handle to the dense tensor descriptor.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %dmat, %token = gpu.create_dn_tensor async [%dep] %mem, %dims : index, index into memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "dims", "type": "Variadic" } ], "results": [ { "name": "dnTensor", "type": "GPU_SparseDnTensorHandle" }, { "name": "asyncToken", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $memref `,` $dims attr-dict `:` type($dims) `into` type($memref)" }, { "name": "gpu.dealloc", "summary": "GPU memory deallocation operation", "description": "The `gpu.dealloc` operation frees the region of memory referenced by a\n memref which was originally created by the `gpu.alloc` operation. It is\n similar to the `memref.dealloc` op, but supports asynchronous GPU execution.\n\n The op does not execute before all async dependencies have finished\n executing.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token.\n\n Example:\n\n ```mlir\n %token = gpu.dealloc async [%dep] %memref : memref<8x64xf32, 1>\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "memref", "type": "AnyMemRef" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $memref attr-dict `:` type($memref)" }, { "name": "gpu.destroy_dn_tensor", "summary": "Destroy dense tensor operation", "description": "The `gpu.destroy_dn_tensor` operation releases all resources of a dense\n tensor represented by a handle that was previously created by a\n `gpu.create_dn_tensor` operation.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %token = gpu.destroy_dn_tensor async [%dep] %dnTensor\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "dnTensor", "type": "GPU_SparseDnTensorHandle" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $dnTensor attr-dict" }, { "name": "gpu.destroy_sp_mat", "summary": "Destroy sparse matrix operation", "description": "The `gpu.destroy_sp_mat` operation releases all resources of a sparse\n matrix represented by a handle that was previously created by a\n one of the sparse matrix creation operations.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %token = gpu.destroy_sp_mat async [%dep] %spmat\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmat", "type": "GPU_SparseSpMatHandle" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies) $spmat attr-dict" }, { "name": "gpu.dynamic_shared_memory", "summary": "Get the memref for dynamic shared memory", "description": "This operation provides a memref pointer to the start of dynamic shared\n memory, often referred to as workgroup memory. It's important to note that\n this dynamic shared memory needs to be allocated at kernel launch. One can\n conveniently utilize the `dynamic_shared_memory_size` parameter of\n `gpu.launch` for this purpose.\n\n Examples:\n ```mlir\n %0 = gpu.dynamic.shared.memory : memref>\n %1 = memref.view %0[%c8192][] : memref>\n to memref<32x64xf32, #gpu.address_space>\n %2 = memref.view %0[%c16384][] : memref>\n to memref<32x64xf32, #gpu.address_space>\n ```", "results": [ { "name": "resultMemref", "type": "MemRefRankOf<[ I8 ], [ 1 ]>" } ], "assemblyFormat": "attr-dict `:` type($resultMemref)" }, { "name": "gpu.func", "summary": "Function executable on a GPU", "description": "Defines a function that can be executed on a GPU. This supports memory\n attribution and its body has a particular execution model.\n\n GPU functions are either kernels (as indicated by the `kernel` attribute) or\n regular functions. The former can be launched from the host side, while the\n latter are device side only.\n\n The memory attribution defines SSA values that correspond to memory buffers\n allocated in the memory hierarchy of the GPU (see below).\n\n The operation has one attached region that corresponds to the body of the\n function. The region arguments consist of the function arguments without\n modification, followed by buffers defined in memory annotations. The body of\n a GPU function, when launched, is executed by multiple work items. There are\n no guarantees on the order in which work items execute, or on the connection\n between them. In particular, work items are not necessarily executed in\n lock-step. Synchronization ops such as \"gpu.barrier\" should be used to\n coordinate work items. Declarations of GPU functions, i.e. not having the\n body region, are not supported.\n\n A function may optionally be annotated with the block and/or grid sizes\n that will be used when it is launched using the `known_block_size` and\n `known_grid_size` attributes, respectively. If set, these attributes must\n be arrays of three 32-bit integers giving the x, y, and z launch dimensions.\n Launching a kernel that has these annotations, or that calls a function with\n these annotations, using a block size or grid size other than what is specified\n is undefined behavior. These attributes may be set on non-`gpu.func` functions\n by using `gpu.known_block_size` or `gpu.known_grid_size`, but this carries\n the risk that they will de discarded.\n\n Syntax:\n\n ```\n op ::= `gpu.func` symbol-ref-id `(` argument-list `)` (`->`\n function-result-list)?\n memory-attribution `kernel`? function-attributes? region\n\n memory-attribution ::= (`workgroup` `(` ssa-id-and-type-list `)`)?\n (`private` `(` ssa-id-and-type-list `)`)?\n ```\n\n Example:\n\n ```mlir\n gpu.func @foo(%arg0: index)\n workgroup(%workgroup: memref<32xf32, 3>)\n private(%private: memref<1xf32, 5>)\n kernel\n attributes {qux: \"quux\"} {\n gpu.return\n }\n ```\n\n The generic form illustrates the concept\n\n ```mlir\n \"gpu.func\"(%arg: index) {sym_name: \"foo\", kernel, qux: \"quux\"} ({\n ^bb0(%arg0: index, %workgroup: memref<32xf32, 3>,\n %private: memref<1xf32, 5>):\n \"gpu.return\"() : () -> ()\n }) : (index) -> ()\n ```\n\n Note the non-default memory spaces used in memref types in memory\n attribution.", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "workgroup_attrib_attrs", "type": "OptionalAttr>" }, { "name": "private_attrib_attrs", "type": "OptionalAttr>" }, { "name": "known_block_size", "type": "ConfinedAttr, [AttrConstraint . predicate , CPred < ([](mlir::Attribute a) { auto arr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(a).asArrayRef(); return ::llvm::all_of(arr, [](int32_t v) { return v >= 1; }); })($_self) > ] > ]>, with 3 elements (if present) and all elements >= 1>]>" }, { "name": "known_grid_size", "type": "ConfinedAttr, [AttrConstraint . predicate , CPred < ([](mlir::Attribute a) { auto arr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(a).asArrayRef(); return ::llvm::all_of(arr, [](int32_t v) { return v >= 1; }); })($_self) > ] > ]>, with 3 elements (if present) and all elements >= 1>]>" }, { "name": "known_cluster_size", "type": "ConfinedAttr, [AttrConstraint . predicate , CPred < ([](mlir::Attribute a) { auto arr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(a).asArrayRef(); return ::llvm::all_of(arr, [](int32_t v) { return v >= 1; }); })($_self) > ] > ]>, with 3 elements (if present) and all elements >= 1>]>" }, { "name": "workgroup_attributions", "type": "OptionalAttr>" }, { "name": "kernel", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "gpu.global_id", "description": "Returns the unique global workitem/thread id, i.e., the unique index of the\n current workitem/thread within all workgroups / grid along the x, y, or z\n `dimension`.\n\n Example:\n\n ```mlir\n %gidX = gpu.global_id x\n %gidX = gpu.global_id x upper_bound 65536\n ```\n\n The `upper_bound` attribute defines an upper bound analogously to the ones on\n `thread_id` and `block_id`. If one is not set, the bound may be inferred from\n a combination of `known_block_size` and `known_grid_size`-type annotations.", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.grid_dim", "description": "Returns the number of thread blocks in the grid along the x, y, or z\n `dimension`.\n\n Example:\n\n ```mlir\n %gDimZ = gpu.grid_dim z\n ```\n\n\n If `known_grid_size` is set on an this operation's enclosing `gpu.func`,\n or `gpu.known_grid_size` is set on an enclosing `FunctionOpInterface`\n implementor, or if the enclosing `gpu.launch` specifies a constant size for\n `dimension`'s grid length, these contextual facts may be used to infer that this\n operation has a constant value, though such a transformation will not be\n performed by canonicalization or the default constant folder. Executions which\n cause that constant-value assumption to be false incur undefined behavior.\n\n If `upper_bound` is set, executions where the grid size in `dimension` would\n exceed `upper_bound` cause undefined behavior.\n\n There is an implicit upper bound of `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.host_register", "summary": "Registers a memref for access from device.", "description": "This op maps the provided host buffer into the device address space.\n\n This operation may not be supported in every environment, there is not yet a\n way to check at runtime whether this feature is supported.\n\n Writes from the host are guaranteed to be visible to device kernels that are\n launched afterwards. Writes from the device are guaranteed to be visible on\n the host after synchronizing with the device kernel completion.", "operands": [ { "name": "value", "type": "AnyUnrankedMemRef" } ], "assemblyFormat": "$value attr-dict `:` type($value)" }, { "name": "gpu.host_unregister", "summary": "Unregisters a memref for access from device.", "description": "This op unmaps the provided host buffer from the device address space.\n\n This operation may not be supported in every environment, there is not yet a\n way to check at runtime whether this feature is supported.", "operands": [ { "name": "value", "type": "AnyUnrankedMemRef" } ], "assemblyFormat": "$value attr-dict `:` type($value)" }, { "name": "gpu.initialize_named_barrier", "summary": "Initialize a named barrier with a member count.", "description": "Initializes a named barrier object with the given number of participating\n members (subgroups) and returns a handle to it. All members that will\n synchronize on this barrier must be accounted for in the count.\n\n ```mlir\n %nb = gpu.initialize_named_barrier %num_members : i32 -> !gpu.named_barrier\n ```", "operands": [ { "name": "member_count", "type": "I32" } ], "results": [ { "name": "result", "type": "GPU_NamedBarrier" } ], "assemblyFormat": "$member_count attr-dict `:` type($member_count) `->` type($result)" }, { "name": "gpu.lane_id", "description": "Returns the lane id within the subgroup (warp/wave).\n\n Example:\n ```mlir\n %laneId = gpu.lane_id\n ```\n\n If `upper_bound` is set, executions with more than `upper_bound` lanes per\n subgroup cause undefined behavior. In the abscence of `upper_bound`,\n the lane id is still assumed to be non-negative and less than the\n target-independent `kMaxSubgroupSize` (currently 128).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "(`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.launch", "summary": "GPU kernel launch operation", "description": "Launch a kernel on the specified grid of thread blocks. The body of the\n kernel is defined by the single region that this operation contains. The\n operation takes an optional list of async dependencies followed by six\n operands and an optional operand.\n\n The `async` keyword indicates the kernel should be launched asynchronously;\n the operation returns a new !gpu.async.token when the keyword is specified.\n The kernel launched does not start executing until the ops producing its\n async dependencies (optional operands) have completed.\n\n The first three operands (following any async dependencies) are grid sizes\n along the x,y,z dimensions and the following three are block sizes along the\n x,y,z dimensions. When a lower-dimensional kernel is required, unused sizes\n must be explicitly set to `1`. The last operand is optional and corresponds\n to the amount of dynamic shared memory a kernel's workgroup should be\n allocated; when this operand is not present, a zero size is assumed.\n\n The body region has at least _twelve_ arguments, or _eighteen_ if cluster\n dimensions are present, grouped as follows:\n\n - three optional arguments that contain cluster identifiers along x,y,z\n dimensions;\n - three arguments that contain block identifiers along x,y,z dimensions;\n - three arguments that contain thread identifiers along x,y,z dimensions;\n - operands of the `gpu.launch` operation as is (i.e. the operands for\n grid and block sizes).\n - a variadic number of Workgroup memory attributions.\n - a variadic number of Private memory attributions.\n\n The `function` and `module` attributes are optional and specifies\n the kernel name and a module in which the kernel should be outlined.\n\n Syntax:\n\n ```\n operation ::= `gpu.launch` (`async` (`[` ssa-id-list `]`)? )?\n ( `clusters` `(` ssa-id-list `)` `in` ssa-reassignment )?\n `blocks` `(` ssa-id-list `)` `in` ssa-reassignment\n `threads` `(` ssa-id-list `)` `in` ssa-reassignment\n (dynamic_shared_memory_size ssa-use)?\n (`module(` symbol-ref-id `)`)?\n (`function(` symbol-ref-id `)`)?\n memory-attribution\n region attr-dict?\n ssa-reassignment ::= `(` ssa-id `=` ssa-use (`,` ssa-id `=` ssa-use)* `)`\n memory-attribution ::= (`workgroup` `(` ssa-id-and-type-list `)`)?\n (`private` `(` ssa-id-and-type-list `)`)?\n ```\n\n Example:\n\n ```mlir\n gpu.launch blocks(%bx, %by, %bz) in (%sz_bx = %0, %sz_by = %1, %sz_bz = %2)\n threads(%tx, %ty, %tz) in (%sz_tx = %3, %sz_ty = %4, %sz_tz = %5) {\n // Block and thread identifiers, as well as block/grid sizes are\n // immediately usable inside body region.\n \"some_op\"(%bx, %tx) : (index, index) -> ()\n // Assuming %val1 is defined outside the gpu.launch region.\n %42 = load %val1[%bx] : memref\n }\n\n // Generic syntax explains how the pretty syntax maps to the IR structure.\n \"gpu.launch\"(%cst, %cst, %c1, // Grid sizes.\n %cst, %c1, %c1) // Block sizes.\n\n {/*attributes*/}\n // All sizes and identifiers have \"index\" size.\n : (index, index, index, index, index, index) -> () {\n // The operation passes block and thread identifiers, followed by grid and\n // block sizes.\n ^bb0(%bx : index, %by : index, %bz : index,\n %tx : index, %ty : index, %tz : index,\n %num_bx : index, %num_by : index, %num_bz : index,\n %num_tx : index, %num_ty : index, %num_tz : index)\n \"some_op\"(%bx, %tx) : (index, index) -> ()\n %3 = \"memref.load\"(%val1, %bx) : (memref, index) -> f32\n }\n\n // Launch with memory attributions.\n gpu.launch blocks(%bx, %by, %bz) in (%sz_bx = %0, %sz_by = %1, %sz_bz = %2)\n threads(%tx, %ty, %tz) in (%sz_tx = %3, %sz_ty = %4, %sz_tz = %5)\n workgroup(%workgroup: memref<32xf32, 3>)\n private(%private: memref<1xf32, 5>) {\n // Block and thread identifiers, as well as block/grid sizes are\n // immediately usable inside body region.\n \"some_op\"(%bx, %tx) : (index, index) -> ()\n // Assuming %val1 is defined outside the gpu.launch region.\n %42 = load %workgroup[%bx] : memref<32xf32, 3>\n }\n\n // Launch with clusters.\n gpu.launch clusters(%cx, %cy, %cz) in (%sz_cx = %0, %sz_cy = %1, %sz_cz = %2)\n blocks(%bx, %by, %bz) in (%sz_bx = %3, %sz_by = %4, %sz_bz = %5)\n threads(%tx, %ty, %tz) in (%sz_tx = %6, %sz_ty = %7, %sz_tz = %8)\n {\n // Cluster, block and thread identifiers, as well as cluster/block/grid\n // sizes are immediately usable inside body region.\n \"some_op\"(%cx, %bx, %tx) : (index, index, index) -> ()\n }\n\n // Launch with module and function attributes.\n gpu.launch blocks(%bx, %by, %bz) in (%sz_bx = %0, %sz_by = %1, %sz_bz = %2)\n threads(%tx, %ty, %tz) in (%sz_tx = %3, %sz_ty = %4, %sz_tz = %5)\n module(@kernel_module) function(@kernel_func) {\n \"some_op\"(%bx, %tx) : (index, index) -> ()\n %42 = load %val1[%bx] : memref\n }\n ```\n\n Rationale: using operation/block arguments gives analyses a clear way of\n understanding that a value has additional semantics (e.g., we will need to\n know what value corresponds to threadIdx.x for coalescing). We can recover\n these properties by analyzing the operations producing values, but it is\n easier just to have that information by construction.", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "gridSizeX", "type": "Index" }, { "name": "gridSizeY", "type": "Index" }, { "name": "gridSizeZ", "type": "Index" }, { "name": "blockSizeX", "type": "Index" }, { "name": "blockSizeY", "type": "Index" }, { "name": "blockSizeZ", "type": "Index" }, { "name": "clusterSizeX", "type": "Optional" }, { "name": "clusterSizeY", "type": "Optional" }, { "name": "clusterSizeZ", "type": "Optional" }, { "name": "dynamicSharedMemorySize", "type": "Optional" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "cooperative", "type": "UnitAttr" }, { "name": "module", "type": "OptionalAttr" }, { "name": "function", "type": "OptionalAttr" }, { "name": "workgroup_attributions", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "gpu.launch_func", "summary": "Launches a function as a GPU kernel", "description": "Launch a kernel function on the specified grid of thread blocks.\n `gpu.launch` operations are lowered to `gpu.launch_func` operations by\n outlining the kernel body into a function in a dedicated module, which\n reflects the separate compilation process. The kernel function is required\n to have the `gpu.kernel` attribute. The module containing the kernel\n function is required to be a gpu.module. And finally, the module containing\n the kernel module (which thus cannot be the top-level module) is required\n to have the `gpu.container_module` attribute. The `gpu.launch_func`\n operation has a symbol attribute named `kernel` to identify the fully\n specified kernel function to launch (both the gpu.module and func).\n\n The `gpu.launch_func` supports async dependencies: the kernel does not start\n executing until the ops producing those async dependencies have completed.\n\n By the default, the host implicitly blocks until kernel execution has\n completed. If the `async` keyword is present, the host does not block but\n instead a `!gpu.async.token` is returned. Other async GPU ops can take this\n token as dependency.\n\n The operation requires at least the grid and block sizes along the x,y,z\n dimensions as arguments. When a lower-dimensional kernel is required,\n unused sizes must be explicitly set to `1`.\n\n The remaining operands are optional. The first optional operand corresponds\n to the amount of dynamic shared memory a kernel's workgroup should be\n allocated; when this operand is not present, a zero size is assumed.\n\n The remaining operands if present are passed as arguments to the kernel\n function.\n\n The `gpu.launch_func` also supports kernel launching with clusters if\n supported by the target architecture. The cluster size can be set by\n `clusterSizeX`, `clusterSizeY`, and `clusterSizeZ` arguments. When these\n arguments are present, the Op launches a kernel that clusters the given\n thread blocks. This feature is exclusive to certain architectures.\n\n The `cooperative` attribute indicates that the kernel should be launched\n cooperatively, guaranteeing that all thread blocks in the grid are\n co-resident on the GPU simultaneously. This enables grid-wide\n synchronization patterns.\n\n Example:\n\n ```mlir\n module attributes {gpu.container_module} {\n\n // This module creates a separate compilation unit for the GPU compiler.\n gpu.module @kernels {\n func.func @kernel_1(%arg0 : f32, %arg1 : memref)\n attributes { nvvm.kernel = true } {\n\n // Operations that produce block/thread IDs and dimensions are\n // injected when outlining the `gpu.launch` body to a function called\n // by `gpu.launch_func`.\n %tIdX = gpu.thread_id x\n %tIdY = gpu.thread_id y\n %tIdZ = gpu.thread_id z\n\n %bDimX = gpu.block_dim x\n %bDimY = gpu.block_dim y\n %bDimZ = gpu.block_dim z\n\n %bIdX = gpu.block_id x\n %bIdY = gpu.block_id y\n %bIdZ = gpu.block_id z\n\n %gDimX = gpu.grid_dim x\n %gDimY = gpu.grid_dim y\n %gDimZ = gpu.grid_dim z\n\n // (Optional) Cluster size only for support architectures\n %cIdX = gpu.cluster_id x\n %cIdY = gpu.cluster_id y\n %cIdZ = gpu.cluster_id z\n\n %cDimX = gpu.cluster_dim x\n %cDimY = gpu.cluster_dim y\n %cDimZ = gpu.cluster_dim z\n\n \"some_op\"(%bx, %tx) : (index, index) -> ()\n %42 = load %arg1[%bx] : memref\n }\n }\n\n %t0 = gpu.wait async\n gpu.launch_func\n async // (Optional) Don't block host, return token.\n [%t0] // (Optional) Execute only after %t0 has completed.\n @kernels::@kernel_1 // Kernel function.\n clusters in (%cst, %cst, %cst) // (Optional) Cluster size only for support architectures.\n blocks in (%cst, %cst, %cst) // Grid size.\n threads in (%cst, %cst, %cst) // Block size.\n dynamic_shared_memory_size %s // (Optional) Amount of dynamic shared\n // memory to allocate for a workgroup.\n args(%arg0 : f32, // (Optional) Kernel arguments.\n %arg1 : memref)\n }\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "gridSizeX", "type": "LaunchIndx" }, { "name": "gridSizeY", "type": "LaunchIndx" }, { "name": "gridSizeZ", "type": "LaunchIndx" }, { "name": "blockSizeX", "type": "LaunchIndx" }, { "name": "blockSizeY", "type": "LaunchIndx" }, { "name": "blockSizeZ", "type": "LaunchIndx" }, { "name": "clusterSizeX", "type": "Optional" }, { "name": "clusterSizeY", "type": "Optional" }, { "name": "clusterSizeZ", "type": "Optional" }, { "name": "dynamicSharedMemorySize", "type": "Optional" }, { "name": "kernelOperands", "type": "Variadic" }, { "name": "asyncObject", "type": "Optional" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "kernel", "type": "SymbolRefAttr" }, { "name": "cooperative", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['gridSizeX', 'gridSizeY', 'gridSizeZ', 'blockSizeX', 'blockSizeY', 'blockSizeZ']>" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n (`<` $asyncObject^ `:` type($asyncObject) `>`)?\n $kernel\n ( `clusters` `in` ` ` `(` $clusterSizeX^ `,` $clusterSizeY `,` $clusterSizeZ `)` )?\n `blocks` `in` ` ` `(` $gridSizeX `,` $gridSizeY `,` $gridSizeZ `)`\n `threads` `in` ` ` `(` $blockSizeX `,` $blockSizeY `,` $blockSizeZ `)`\n custom(type($gridSizeX), ref($clusterSizeX), type($clusterSizeX), type($clusterSizeY), type($clusterSizeZ))\n (`dynamic_shared_memory_size` $dynamicSharedMemorySize^)?\n (`cooperative` $cooperative^)?\n custom($kernelOperands, type($kernelOperands)) attr-dict" }, { "name": "gpu.memcpy", "summary": "GPU memcpy operation", "description": "The `gpu.memcpy` operation copies the content of one memref to another.\n\n The op does not execute before all async dependencies have finished\n executing.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token.\n\n Example:\n\n ```mlir\n %token = gpu.memcpy async [%dep] %dst, %src : memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "dst", "type": "AnyMemRef" }, { "name": "src", "type": "AnyMemRef" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $dst`,` $src `:` type($dst)`,` type($src) attr-dict" }, { "name": "gpu.memset", "summary": "GPU memset operation", "description": "The `gpu.memset` operation sets the content of memref to a scalar value.\n\n The op does not execute before all async dependencies have finished\n executing.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token.\n\n Example:\n\n ```mlir\n %token = gpu.memset async [%dep] %dst, %value : memref, f32\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "dst", "type": "AnyMemRef" }, { "name": "value", "type": "AnyType" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $dst`,` $value `:` type($dst)`,` type($value) attr-dict" }, { "name": "gpu.module", "summary": "A top level compilation unit containing code to be run on a GPU.", "description": "GPU module contains code that is intended to be run on a GPU. A host device\n can launch this code through a gpu.launc_func that creates a fully\n qualified symbol through the gpu.module's symbol and a gpu.func symbol\n contained in the gpu.module.\n\n The module's top-level scope is modeled by a single region with a single\n block. GPU modules are required to have a name that is used for symbol\n resolution by the gpu.launch_func operation.\n\n Using an op with a region to define a GPU module enables \"embedding\" GPU\n modules with SIMT execution models in other dialects in a clean manner and\n allows filtering of code regions to execute passes on only code intended to\n or not intended to be run on the separate device.\n\n Modules can contain zero or more target attributes. These attributes encode\n how to transform modules into binary strings and are used by the\n `gpu-module-to-binary` pass to transform modules into GPU binaries.\n\n Modules can contain an optional `OffloadingTranslationAttr` attribute. This\n attribute will be used during the `gpu-module-to-binary` pass to specify the\n `OffloadingTranslationAttr` used when creating the `gpu.binary` operation.\n\n ```\n gpu.module @symbol_name {\n gpu.func {}\n ...\n }\n // Module with offloading handler and target attributes.\n gpu.module @symbol_name2 <#gpu.select_object<1>> [\n #nvvm.target,\n #rocdl.target] {\n gpu.func {}\n ...\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "targets", "type": "OptionalAttr]>>, [ArrayMinCount<1>]>>" }, { "name": "offloadingHandler", "type": "OptionalAttr>" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name\n (`<` $offloadingHandler^ `>`)?\n ($targets^)?\n attr-dict-with-keyword $bodyRegion" }, { "name": "gpu.num_subgroups", "description": "Returns the number of subgroups within a workgroup.\n\n Example:\n\n ```mlir\n %numSg = gpu.num_subgroups : index\n ```\n\n If `upper_bound` is set, executions with more than `upper_bound` subgroups\n per workgroup cause undefined behavior. There is a default upper bound of\n `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "(`upper_bound` $upper_bound^)? attr-dict `:` type($result)" }, { "name": "gpu.printf", "summary": "Device-side printf, as in CUDA or OpenCL, for debugging", "description": "`gpu.printf` takes a literal format string `format` and an arbitrary number of\n scalar arguments that should be printed.\n\n The format string is a C-style printf string, subject to any restrictions\n imposed by one's target platform.", "operands": [ { "name": "args", "type": "Variadic>" } ], "attributes": [ { "name": "format", "type": "StrAttr" } ], "assemblyFormat": "$format attr-dict (`,` $args^ `:` type($args))?" }, { "name": "gpu.return", "summary": "Terminator for GPU functions.", "description": "A terminator operation for regions that appear in the body of `gpu.func`\n functions. The operands to the `gpu.return` are the result values returned\n by an invocation of the `gpu.func`.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "gpu.rotate", "summary": "Rotate values within a subgroup.", "description": "The \"rotate\" op moves values across lanes in a subgroup (a.k.a., local\n invocations) within the same subgroup. The `width` attribute specifies the\n number of lanes that participate in the rotation, and must be uniform across\n all participating lanes. Further, the first `width` lanes of the subgroup\n must be active.\n\n `width` must be a power of two, and `offset` must be in the range\n `[0, width)`.\n\n Return the `rotateResult` of the invocation whose id within the group is\n calculated as follows:\n\n ```mlir\n Invocation ID = ((LaneId + offset) & (width - 1)) + (LaneId & ~(width - 1))\n ```\n\n Returns the `rotateResult` and `true` if the current lane id is smaller than\n `width`, and poison value and `false` otherwise.\n\n example:\n\n ```mlir\n %1, %2 = gpu.rotate %0, 1, 16 : f32\n ```\n\n For lane `k`, returns the value from lane `(k + cst1) % width`.", "operands": [ { "name": "value", "type": "AnyIntegerOrFloatOr1DVector" } ], "results": [ { "name": "rotateResult", "type": "AnyIntegerOrFloatOr1DVector" }, { "name": "valid", "type": "I1" } ], "attributes": [ { "name": "offset", "type": "ConfinedAttr]>" }, { "name": "width", "type": "ConfinedAttr" } ], "traits": [ { "type": "AllTypesMatch<['value', 'rotateResult']>" } ], "assemblyFormat": "$value `,` $offset `,` $width attr-dict `:` type($value)" }, { "name": "gpu.sddmm", "summary": "SDDMM operation", "description": "The `gpu.sddmm` operation performs the SDDMM operation on the given sparse and\n dense matrices, and buffer. The operation expects handles returned by previous\n sparse operations to construct an environment and the operands for SDDMM. The\n buffer must have been allocated on the device.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %token = gpu.sddmm async [%dep] %dnmatA{TRANSPOSE}, %dnmatB{TRANSPOSE}, %spmatC, %buffer into f32\n ```\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "dnmatA", "type": "GPU_SparseDnTensorHandle" }, { "name": "dnmatB", "type": "GPU_SparseDnTensorHandle" }, { "name": "spmatC", "type": "GPU_SparseSpMatHandle" }, { "name": "buffer", "type": "AnyMemRef" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "modeB", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $dnmatA (`{` $modeA^ `}`)? `,` $dnmatB (`{` $modeB^ `}`)? `,` $spmatC `,` $buffer attr-dict `:` type($buffer) `into` $computeType" }, { "name": "gpu.sddmm_buffer_size", "summary": "Precompute buffersize for SDDMM operation", "description": "The `gpu.sddmm_buffer_size` operation returns the buffer size required\n to perform the SDDMM operation on the given sparse and dense matrices.\n The operation expects handles returned by previous sparse operations\n to construct an environment and the operands for SDDMM.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n Example:\n\n ```mlir\n %buffersz, %token = gpu.sddmm_buffer_size async [%dep] %dnmatA{TRANSPOSE}, %dnmatB{TRANSPOSE}, %spmatC into f32\n ```\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "dnmatA", "type": "GPU_SparseDnTensorHandle" }, { "name": "dnmatB", "type": "GPU_SparseDnTensorHandle" }, { "name": "spmatC", "type": "GPU_SparseSpMatHandle" } ], "results": [ { "name": "bufferSz", "type": "Index" }, { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "modeB", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $dnmatA (`{` $modeA^ `}`)? `,` $dnmatB (`{` $modeB^ `}`)? `,` $spmatC attr-dict `into` $computeType" }, { "name": "gpu.set_csr_pointers", "summary": "SpGEMM get size operation", "description": "The `gpu.set_csr_pointers` assigns the given positions, coordinates,\n and values buffer that reside on the device directly to the given sparse\n matrix descriptor in csr format.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a `!gpu.async.token` in addition to the environment.\n\n Example:\n\n ```mlir\n %token = gpu.set_csr_pointers async [%dep] %positions, %coordinates, %values\n : memref, memref, memref\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmat", "type": "GPU_SparseSpMatHandle" }, { "name": "positions", "type": "AnyMemRef" }, { "name": "coordinates", "type": "AnyMemRef" }, { "name": "values", "type": "AnyMemRef" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmat `,` $positions `,` $coordinates `,` $values attr-dict\n `:` type($positions) `,` type($coordinates) `,` type($values)" }, { "name": "gpu.set_default_device", "summary": "Set default GPU for operations after this by index", "description": "Operation that sets the current default GPU, using a zero-based index\n into the set of GPUs on the system. The default GPU setting may be\n thread-local.", "operands": [ { "name": "devIndex", "type": "I32" } ], "assemblyFormat": "attr-dict $devIndex" }, { "name": "gpu.shuffle", "summary": "Shuffles values within a subgroup.", "description": "The \"shuffle\" op moves values across lanes in a subgroup (a.k.a., local\n invocation) within the same subgroup. The `width` argument specifies the\n number of lanes that participate in the shuffle, and must be uniform\n across all lanes. Further, the first `width` lanes of the subgroup must\n be active.\n\n The intepretation of the `offset` arguments depends on the selected\n `mode`.\n\n Returns the `shuffleResult` and `true` if the current lane id is smaller\n than `width`, and an unspecified value and `false` otherwise.\n\n `xor` example:\n\n ```mlir\n %1, %2 = gpu.shuffle xor %0, %offset, %width : f32\n ```\n\n For lane `k`, returns the value `%0` from lane `k ^ offset`. Every lane\n trades value with exactly one other lane.\n\n `down` example:\n\n ```mlir\n %cst1 = arith.constant 1 : i32\n %3, %4 = gpu.shuffle down %0, %cst1, %width : f32\n ```\n\n For lane `k`, returns the value from lane `(k + cst1)`. If `(k + cst1)` is\n bigger than or equal to `width`, the value is poison and `valid` is `false`.\n\n `up` example:\n\n ```mlir\n %cst1 = arith.constant 1 : i32\n %5, %6 = gpu.shuffle up %0, %cst1, %width : f32\n ```\n\n For lane `k`, returns the value from lane `(k - cst1)`. If `(k - cst1)` is\n smaller than `0`, the value is poison and `valid` is `false`.\n\n `idx` example:\n\n ```mlir\n %cst0 = arith.constant 0 : i32\n %7, %8 = gpu.shuffle idx %0, %cst0, %width : f32\n ```\n\n Broadcasts the value from lane 0 to all lanes.", "operands": [ { "name": "value", "type": "AnyIntegerOrFloatOr1DVector" }, { "name": "offset", "type": "I32" }, { "name": "width", "type": "I32" } ], "results": [ { "name": "shuffleResult", "type": "AnyIntegerOrFloatOr1DVector" }, { "name": "valid", "type": "I1" } ], "attributes": [ { "name": "mode", "type": "GPU_ShuffleModeAttr{xor|up|down|idx}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'shuffleResult']>" } ], "assemblyFormat": "$mode $value `,` $offset `,` $width attr-dict `:` type($value)" }, { "name": "gpu.spgemm_copy", "summary": "SpGEMM copy operation", "description": "The `gpu.spgemm_copy` operation copies the sparse matrix result of\n a SpGEMM computation.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a `!gpu.async.token` in addition to the environment.\n\n Example:\n\n ```mlir\n gpu.spgemm_copy %spmatA, %spmatB, %spmatC, %spgemmDesc: f32\n ```\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "desc", "type": "GPU_SparseSpGEMMOpHandle" }, { "name": "spmatA", "type": "GPU_SparseSpMatHandle" }, { "name": "spmatB", "type": "GPU_SparseSpMatHandle" }, { "name": "spmatC", "type": "GPU_SparseSpMatHandle" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "modeB", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmatA (`{` $modeA^ `}`)? `,` $spmatB (`{` $modeB^ `}`)? `,` $spmatC `,` $desc attr-dict `:` $computeType" }, { "name": "gpu.spgemm_create_descr", "summary": "SpGEMM Create Descr operation", "description": "The `gpu.spgemm_create_descr` creates a descriptor for the SpGEMM operation.\n The descriptor describes the SpGEMM operation and stores the internal data\n throughout the computation. It needs to be passed as an argument to\n spgemm_* operations.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a `!gpu.async.token` in addition to the environment.\n\n Example:\n\n ```mlir\n %desc, %token = gpu.spgemm_create_descr async [%dep]\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" } ], "results": [ { "name": "desc", "type": "GPU_SparseSpGEMMOpHandle" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n attr-dict" }, { "name": "gpu.spgemm_destroy_descr", "summary": "SpGEMM Destroy Descr operation", "description": "The `gpu.spgemm_destroy_descr` destroys the SpGEMM operation descriptor.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a `!gpu.async.token` in addition to the environment.\n\n Example:\n\n ```mlir\n %token = gpu.spgemm_destroy_descr async [%dep] %desc\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "desc", "type": "GPU_SparseSpGEMMOpHandle" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $desc attr-dict" }, { "name": "gpu.spgemm_work_estimation_or_compute", "summary": "SpGEMM work estimation operation", "description": "The `gpu.spgemm_work_estimation_or_compute` is used to call\n cusparseSpGEMM_workEstimation or cusparseSpGEMM_compute. Both of them are\n for both determining the buffer size and performing the actual computation.\n The operation expects handles returned by previous sparse operations to\n construct an environment and the operands for SpGEMM.\n The buffer must have been allocated on the device.\n\n C' = alpha * op(A) * op(B) + beta * C\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a `!gpu.async.token` in addition to the environment.\n\n Example:\n\n ```mlir\n %bufferSz, %token = gpu.spgemm_work_estimation_or_compute async [%dep] {COMPUTE}\n %desc, %spmatA{NON_TRANSPOSE}, %spmatB{NON_TRANSPOSE},\n %spmatC, %spgemmDesc, %c0, %alloc: f32 into\n memref<0xi8>\n ```\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "desc", "type": "GPU_SparseSpGEMMOpHandle" }, { "name": "spmatA", "type": "GPU_SparseSpMatHandle" }, { "name": "spmatB", "type": "GPU_SparseSpMatHandle" }, { "name": "spmatC", "type": "GPU_SparseSpMatHandle" }, { "name": "bufferSz", "type": "Index" }, { "name": "buffer", "type": "AnyMemRef" } ], "results": [ { "name": "bufferSzNew", "type": "Index" }, { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "modeB", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" }, { "name": "kind", "type": "GPU_SpGEMMWorkEstimationOrComputeKindAttr{WORK_ESTIMATION|COMPUTE}" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n `{` $kind `}` $spmatA (`{` $modeA^ `}`)? `,` $spmatB (`{` $modeB^ `}`)? `,` $spmatC `,` $desc `,` $bufferSz `,` $buffer attr-dict `:` $computeType `into` type($buffer)" }, { "name": "gpu.spmat_get_size", "summary": "SpMat get size operation", "description": "The `gpu.spmat_get_size` operation retrieves the number of rows, number of\n columns, and number of non-zero elements of a sparse matrix.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a `!gpu.async.token` in addition to the environment.\n\n Example:\n\n ```mlir\n %rows, %cols, %nnz, %token = gpu.spmat_get_size async [%dep] %spmatC\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmat", "type": "GPU_SparseSpMatHandle" } ], "results": [ { "name": "rows", "type": "Index" }, { "name": "cols", "type": "Index" }, { "name": "nnz", "type": "Index" }, { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmat attr-dict" }, { "name": "gpu.spmm", "summary": "SpMM operation", "description": "The `gpu.spmm` operation performs the SpMM operation on the given sparse and\n dense matrix, and buffer. The operation expects handles returned by previous\n sparse operations to construct an environment and the operands for SpMM. The\n buffer must have been allocated on the device.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.\n\n Example:\n\n ```mlir\n %token = gpu.spmm async [%dep] %spmatA{TRANSPOSE}, %dnmatB{TRANSPOSE}, %dnmatC, %buffers : type($buffers) into f32\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmatA", "type": "GPU_SparseSpMatHandle" }, { "name": "dnmatB", "type": "GPU_SparseDnTensorHandle" }, { "name": "dnmatC", "type": "GPU_SparseDnTensorHandle" }, { "name": "buffers", "type": "Variadic" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "modeB", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmatA (`{` $modeA^ `}`)? `,` $dnmatB (`{` $modeB^ `}`)? `,` $dnmatC `,` $buffers attr-dict `:` type($buffers) `into` $computeType" }, { "name": "gpu.spmm_buffer_size", "summary": "Precompute buffersize for SpMM operation", "description": "The `gpu.spmm_buffer_size` operation returns the buffer size required\n to perform the SpMM operation on the given sparse and dense matrix.\n The operation expects handles returned by previous sparse operations\n to construct an environment and the operands for SpMM.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.\n\n Example:\n\n ```mlir\n %bufferszs, %token = gpu.spmm_buffer_size async [%dep] %spmatA{TRANSPOSE}, %dnmatB{TRANSPOSE}, %dnmatC : i64 into f32\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmatA", "type": "GPU_SparseSpMatHandle" }, { "name": "dnmatB", "type": "GPU_SparseDnTensorHandle" }, { "name": "dnmatC", "type": "GPU_SparseDnTensorHandle" } ], "results": [ { "name": "bufferSzs", "type": "Variadic" }, { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "modeB", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmatA (`{` $modeA^ `}`)? `,` $dnmatB (`{` $modeB^ `}`)? `,` $dnmatC attr-dict `:` type($bufferSzs) `into` $computeType" }, { "name": "gpu.spmv", "summary": "SpMV operation", "description": "The `gpu.spmv` operation performs the SpMV operation on the given sparse matrix,\n dense vectors, and buffer. The operation expects handles returned by previous\n sparse operations to construct an environment and the operands for SpMV. The\n buffer must have been allocated on the device.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.\n\n Example:\n\n ```mlir\n %token = gpu.spmv async [%dep] %spmatA{TRANSPOSE}, %dnX, %dnY : memref into bf16\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmatA", "type": "GPU_SparseSpMatHandle" }, { "name": "dnX", "type": "GPU_SparseDnTensorHandle" }, { "name": "dnY", "type": "GPU_SparseDnTensorHandle" }, { "name": "buffer", "type": "AnyMemRef" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmatA (`{` $modeA^ `}`)? `,` $dnX `,` $dnY `,` $buffer attr-dict `:` type($buffer) `into` $computeType" }, { "name": "gpu.spmv_buffer_size", "summary": "Precompute buffersize for SpMV operation", "description": "The `gpu.spmv_buffer_size` operation returns the buffer size required\n to perform the SpMV operation on the given sparse matrix and dense vectors.\n The operation expects handles returned by previous sparse operations\n to construct an environment and the operands for SpMV.\n\n If the `async` keyword is present, the op is executed asynchronously (i.e.\n it does not block until the execution has finished on the device). In\n that case, it returns a !gpu.async.token in addition to the environment.\n\n The matrix arguments can also be associated with one of the following\n operators: NON_TRANSPOSE, TRANSPOSE, CONJUGATE_TRANSPOSE. The default value\n is NON_TRANSPOSE.\n\n Example:\n\n ```mlir\n %buffersz, %token = gpu.spmv_buffer_size async [%dep] %spmatA{TRANSPOSE}, %dnX, %dnY into f32\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" }, { "name": "spmatA", "type": "GPU_SparseSpMatHandle" }, { "name": "dnX", "type": "GPU_SparseDnTensorHandle" }, { "name": "dnY", "type": "GPU_SparseDnTensorHandle" } ], "results": [ { "name": "bufferSz", "type": "Index" }, { "name": "asyncToken", "type": "Optional" } ], "attributes": [ { "name": "modeA", "type": "GPU_TransposeModeAttr{NON_TRANSPOSE|TRANSPOSE|CONJUGATE_TRANSPOSE}" }, { "name": "computeType", "type": "TypeAttr" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies)\n $spmatA (`{` $modeA^ `}`)? `,` $dnX `,` $dnY attr-dict `into` $computeType" }, { "name": "gpu.subgroup_broadcast", "summary": "Broadcasts a value from the specific lane across subgroup", "description": "Broadcasts a value from one lane to all active lanes in a subgroup. The\n result is guaranteed to be uniform across the active lanes in subgroup.\n\n The possible broadcast types are:\n\n * `first_active_lane` - broadcasts the value from the first active lane\n in the subgroup.\n * `specific_lane` - broadcasts from the specified lane. The lane index\n must be uniform and within the subgroup size. The result is poison if the\n lane index is invalid, non subgroup-uniform, or if the source lane is not\n active.", "operands": [ { "name": "src", "type": "AnyType" }, { "name": "lane", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "broadcast_type", "type": "GPU_BroadcastTypeAttr{first_active_lane|specific_lane}" } ], "traits": [ { "type": "AllTypesMatch<['result', 'src']>" } ], "assemblyFormat": "$src `,` $broadcast_type ($lane^)? attr-dict `:` type($result)" }, { "name": "gpu.subgroup_id", "description": "Returns the subgroup id, i.e., the index of the current subgroup within the\n workgroup.\n\n Example:\n\n ```mlir\n %sgId = gpu.subgroup_id : index\n ```\n\n Executions where there are more than `upper_bound` subgroups per workgroup\n cause undefined behavior. There is an implicit upper bound of `kMaxDim`\n (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "(`upper_bound` $upper_bound^)? attr-dict `:` type($result)" }, { "name": "gpu.subgroup_mma_compute", "summary": "GPU warp synchronous matrix multiply accumulate", "description": "The `gpu.subgroup_mma_compute` operation performs a matrix-multiply accumulate (mma)\n operation using all the threads in a subgroup.\n\n This operation takes three `!gpu.mma_matrix`s as arguments: these hold `A`,\n `B` and `C`operands for the mma operation. The operation performed is represented\n as `C += A * B`. The op returns a `!gpu.mma_matrix` which contains the result of\n the operation held by all threads in a subgroup. `a_transpose` or\n `b_transpose` if present, signify that the respective operand was loaded in a\n transposed manner. The transpose operands are required to map to correct\n underlying intrisics but they currently do not seem to affect correctness\n even if they are absent given that the operands were loaded correctly using\n the `transpose` attribute in `gpu.subgroup_mma_load_matrix` op.\n\n For integer types, the `A` and `B` matrices carry their signedness with their\n types. The accumulator type is expected to be signless and imply a signed integer\n with a greater width than the other two operands.\n\n This op is meant to be used along with `gpu.subgroup_mma_store_matrix` and\n `gpu.subgroup_mma_load_matrix` ops.\n\n Example:\n\n ```mlir\n %D = gpu.subgroup_mma_compute_matrix %A, %B, %C :\n !gpu.mma_matrix<16x16xf16, \"AOp\">, !gpu.mma_matrix<16x16xf16, \"BOp\">>\n -> !gpu.mma_matrix<16x16xf16, \"COp\">\n ```", "operands": [ { "name": "opA", "type": "MMAMatrixOf<[ SI8, UI8, F16, F32, F64 ]>" }, { "name": "opB", "type": "MMAMatrixOf<[ SI8, UI8, F16, F32, F64 ]>" }, { "name": "opC", "type": "MMAMatrixOf<[ I32, F16, F32, F64 ]>" } ], "results": [ { "name": "res", "type": "GPU_MMAMatrix" } ], "attributes": [ { "name": "a_transpose", "type": "OptionalAttr" }, { "name": "b_transpose", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['opC', 'res']>" } ], "assemblyFormat": "$opA`,` $opB`,` $opC attr-dict `:` type($opA)`,` type($opB) `->` type($res)" }, { "name": "gpu.subgroup_mma_constant_matrix", "summary": "GPU warp synchronous constant matrix", "description": "The `gpu.subgroup_mma_constant_matrix` creates a `!gpu.mma_matrix` with\n constant elements.\n\n The operation takes a scalar input and return a `!gpu.mma_matrix` where\n each element of is equal to the operand constant. The destination\n mma_matrix type must have elememt type equal to the constant type. Since\n the layout of `!gpu.mma_matrix` is opaque this only support setting all the\n elements to the same value.\n\n This op is meant to be used along with `gpu.subgroup_mma_compute`.\n\n Example:\n\n ```mlir\n %0 = gpu.subgroup_mma_constant_matrix %a :\n !gpu.mma_matrix<16x16xf16, \"AOp\">\n %1 = gpu.subgroup_mma_constant_matrix %b :\n !gpu.mma_matrix<16x16xf32, \"COp\">\n ```", "operands": [ { "name": "value", "type": "AnyTypeOf<[SI8, UI8, I32, F16, F32]>" } ], "results": [ { "name": "res", "type": "GPU_MMAMatrix" } ], "traits": [ { "type": "TypesMatchWith<'res', 'value', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$value attr-dict `:` type($res)" }, { "name": "gpu.subgroup_mma_elementwise", "summary": "GPU warp elementwise operation on a matrix", "description": "The `gpu.subgroup_mma_elementwise` takes `!gpu.mma_matrix` inputs and\n compute a new `!gpu.mma_matrix` by applying an elementwise operation to each\n element.\n\n Since the operation is elementwise and the matrix type must match, the\n matrix elements are processed independently of the matrix layout.\n\n This op is meant to be used along with `gpu.subgroup_mma_compute`.\n\n Example:\n\n ```mlir\n %0 = %A, %B { opType = \"ADD\" } :\n (!gpu.mma_matrix<16x16xf16, \"COp\">, !gpu.mma_matrix<16x16xf16, \"COp\">)\n -> !gpu.mma_matrix<16x16xf16, \"COp\">\n ```", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "res", "type": "GPU_MMAMatrix" } ], "attributes": [ { "name": "opType", "type": "MMAElementWiseAttr{addf|mulf|subf|maxf|minf|divf|addi|muli|subi|divs|divu|negatef|negates|extf|truncf}" } ], "traits": [ { "type": "AllTypesMatch<['args']>" } ], "assemblyFormat": "$opType $args attr-dict `:` functional-type($args, $res)" }, { "name": "gpu.subgroup_mma_extract_thread_local", "summary": "Extract a value from GPU warp by invocation and indices", "description": "The `gpu.subgroup_mma_extract_thread_local` operation extracts a value from `!gpu.mma_matrix`\n that is stored at subgroup level.\n\n This operation takes `!gpu.mma_matrix` as its first operand. It is the source\n matrix across a subgroup. The op returns a scalar value stored in the invocation\n in the subgroup.\n\n Since `matrix` is packed into the the threads within a subgroup, `indices` are\n the indices into the values stored by each thread. That is, an index of 0 (or [0, 0])\n does not necessarily refer to the first element of the matrix, but the first element\n that a particular thread holds.\n\n The mapping of matrix elements to threads is not defined by this operation and may\n not be defined by some lowerings (such as the lowering to SPIR-V). However, if the\n size of the subgroup is S, then `subgroup_mma_extract_thread_local` at each index in\n `[0, (M * N) / S)` will have the entire matrix extracted across the subgroup.\n\n Example:\n\n ```mlir\n %c0 = arith.constant 0 : index\n %val = gpu.subgroup_mma_extract_thread_local %m[%c0] : !gpu.mma_matrix<16x16xf32, \"AOp\"> -> f32\n ```", "operands": [ { "name": "matrix", "type": "GPU_MMAMatrix" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "res", "type": "AnyIntegerOrFloat" } ], "traits": [ { "type": "TypesMatchWith<'matrix', 'res', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$matrix`[`$indices`]` attr-dict `:` type($matrix) `->` type($res)" }, { "name": "gpu.subgroup_mma_insert_thread_local", "summary": "Insert a value into GPU warp by invocation and indices", "description": "The `gpu.subgroup_mma_insert_thread_local` operation inserts a value to `!gpu.mma_matrix`\n that is stored at subgroup level.\n\n This operation takes scalar value as its first operand and `!gpu.mma_matrix`\n as its second operand. The op inserts the scalar value to the matrix.\n\n Since `matrix` is packed into the the threads within a subgroup, `indices` are\n the indices into the values stored by each thread. That is, an index of 0 (or [0, 0])\n does not necessarily refer to the first element of the matrix, but the first element\n that a particular thread holds.\n\n The mapping of matrix elements to threads is not defined by this operation and may\n not be defined by some lowerings (such as the lowering to SPIR-V). However, if the\n size of the subgroup is S, then `subgroup_mma_insert_thread_local` at each index in\n `[0, (M * N) / S)` will have the entire matrix inserted across the subgroup.\n\n The op returns `!gpu.mma_matrix` with the updated value.\n\n Example:\n\n ```mlir\n %c0 = arith.constant 0 : index\n %s0 = gpu.subgroup_mma_insert_thread_local %val, %m[%c0] : f16, !gpu.mma_matrix<16x16xf16, \"COp\">\n -> !gpu.mma_matrix<16x16xf16, \"COp\">\n ```", "operands": [ { "name": "value", "type": "AnyIntegerOrFloat" }, { "name": "matrix", "type": "GPU_MMAMatrix" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "res", "type": "GPU_MMAMatrix" } ], "traits": [ { "type": "TypesMatchWith<'matrix', 'value', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$value`,` $matrix`[`$indices`]` attr-dict `:` type($value)`,` type($matrix) `->` type($res)" }, { "name": "gpu.subgroup_mma_load_matrix", "summary": "GPU warp synchronous matrix load", "description": "The `gpu.subgroup_mma_load_matrix` operation loads a matrix collectively\n using all the threads in a subgroup.\n\n This operation takes a memref as its first operand: it is the source matrix\n from which data is to be loaded. The op returns a `!gpu.mma_matrix`. The\n source memref can be in global memory or shared memory. The load address is\n determined using `indices`. The matrix being loaded into is the result. The\n `leadDimension` attribute specifies the leading dimension size of the source\n matrix which eventually allows the lowering to determine the size of each\n row. If the `transpose` attribute is present then the op does a transposed load.\n\n The memory indices along each dimension must be in-bounds for that dimension\n as with an ordinary `memref.load`.\n\n For integer types, the resulting `!gpu.mma_matrix` type needs to specify the\n signedness of the data if the matrix type is an `A` or `B` operand for\n `gpu.subgroup_mma_compute`.\n\n This op is often meant to be used along with `gpu.subgroup_mma_store_matrix` and\n `gpu.subgroup_mma_compute`.\n\n Example:\n\n ```mlir\n %0 = gpu.subgroup_mma_load_matrix src[%i,%j] : {leadDimension = 32 : i32}\n : memref<32x32xf16, 3>, !gpu.mma_matrix<16x16xf16, \"AOp\">\n ```", "operands": [ { "name": "srcMemref", "type": "GPU_MMAMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "res", "type": "GPU_MMAMatrix" } ], "attributes": [ { "name": "leadDimension", "type": "IndexAttr" }, { "name": "transpose", "type": "OptionalAttr" } ], "assemblyFormat": "$srcMemref`[`$indices`]` attr-dict `:` type($srcMemref) `->` type($res)" }, { "name": "gpu.subgroup_mma_store_matrix", "summary": "GPU warp synchronous matrix store", "description": "The `gpu.subgroup_mma_store_matrix` operation stores a matrix collectively\n using all the threads in a subgroup.\n\n This operation takes a `!gpu.mma_matrix` and a memref as operands.\n `!gpu.mma_matrix` is the source value containing the data to be stored into the\n destination memref which can be in global or shared memory. The store address\n is determined using the indices provided. The `leadDimension` attribute\n specifies the leading dimension of the destination matrix. If the\n `transpose` attribute is present then the op does a transposed store.\n\n This op is often meant to be used along with `gpu.subgroup_mma_load_matrix` and\n `gpu.subgroup_mma_compute`.\n\n The memory indices along each dimension must be in-bounds for that dimension\n as with an ordinary `memref.load`.\n\n Example:\n\n ```mlir\n gpu.subgroup_mma_store_matrix %D, %sg[%i,%j] : { leadDimension = 32 : i32}\n : !gpu.mma_matrix<16x16xf16, \"COp\">, memref<32x32xf16, 3>\n ```", "operands": [ { "name": "src", "type": "MMAMatrixOf<[ SI8, UI8, I32, F16, F32, F64 ]>" }, { "name": "dstMemref", "type": "GPU_MMAMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "leadDimension", "type": "IndexAttr" }, { "name": "transpose", "type": "OptionalAttr" } ], "assemblyFormat": "$src`,` $dstMemref`[`$indices`]` attr-dict `:` type($src)`,` type($dstMemref)" }, { "name": "gpu.subgroup_reduce", "summary": "Reduce values among subgroup.", "description": "The `subgroup_reduce` op reduces the values of lanes (work items) across a\n subgroup.\n\n The subgroup is divided into clusters starting at lane index 0. Within each\n cluster, there are `size` lanes, and the lane index advances by `stride`.\n A reduction is done for each cluster in parallel: every lane in the cluster\n is reduced, and the result is equal for all lanes in the cluster. If `size`\n is omitted, there is a single cluster covering the entire subgroup. If\n `stride` is omitted, the stride is 1 (the cluster's lanes are contiguous).\n\n When the reduced value is of a vector type, each vector element is reduced\n independently. Only 1-d vector types are allowed.\n\n Example:\n\n ```mlir\n %1 = gpu.subgroup_reduce add %a : (f32) -> f32\n %2 = gpu.subgroup_reduce add %b : (vector<4xf16>) -> vector<4xf16>\n %3 = gpu.subgroup_reduce add %c cluster(size = 4) : (f32) -> f32\n %3 = gpu.subgroup_reduce add %c cluster(size = 4, stride = 2) : (f32) -> f32\n ```\n\n If `uniform` flag is set either none or all lanes of a subgroup need to execute\n this op in convergence.\n\n The reduction operation must be one of:\n * Integer types: `add`, `mul`, `minui`, `minsi`, `maxui`, `maxsi`, `and`,\n `or`, `xor`\n * Floating point types: `add`, `mul`, `minnumf`, `maxnumf`, `minimumf`,\n `maximumf`", "operands": [ { "name": "value", "type": "AnyIntegerOrFloatOr1DVector" } ], "results": [ { "name": "result", "type": "AnyIntegerOrFloatOr1DVector" } ], "attributes": [ { "name": "op", "type": "GPU_AllReduceOperationAttr{add|mul|minui|minsi|minnumf|maxui|maxsi|maxnumf|and|or|xor|minimumf|maximumf}" }, { "name": "uniform", "type": "UnitAttr" }, { "name": "cluster_size", "type": "OptionalAttr" }, { "name": "cluster_stride", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "custom($op) $value\n (`uniform` $uniform^)?\n (`cluster` `(` `size` `=` $cluster_size^ (`,` `stride` `=` $cluster_stride^)? `)`)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "gpu.subgroup_size", "description": "Returns the number of threads within a subgroup.\n\n Example:\n\n ```mlir\n %sgSz = gpu.subgroup_size : index\n ```\n\n Executions where the number of threads per subgroup exceed `upper_bound` cause\n undefined behavior. When no `upper_bound` is specified, range analyses and\n similar machinery assume the default bound of `kMaxSubgroupSize`, currently\n 128.", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "(`upper_bound` $upper_bound^)? attr-dict `:` type($result)" }, { "name": "gpu.terminator", "summary": "Terminator for GPU launch regions.", "description": "A terminator operation for regions that appear in the body of `gpu.launch`\n operation. These regions are not expected to return any value so the\n terminator takes no operands.", "assemblyFormat": "attr-dict" }, { "name": "gpu.thread_id", "description": "Returns the thread id, i.e. the index of the current thread within the block\n along the x, y, or z `dimension`.\n\n Example:\n\n ```mlir\n %tIdX = gpu.thread_id x\n ```\n\n If `upper_bound` is set, or if one can be inferred from `known_block_size`-type\n annotations in context, executions where the thread index would be greater\n than or equal to that bound cause undefined behavior.\n\n There is an implicit upper bound of `kMaxDim` (currently uint32_t::max).", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "GPU_DimensionAttr{x|y|z}" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "$dimension (`upper_bound` $upper_bound^)? attr-dict" }, { "name": "gpu.wait", "summary": "Wait for async gpu ops to complete.", "description": "This op synchronizes the host or the device with a list of dependent ops.\n\n If the op contains the `async` keyword, it returns a new async token which\n is synchronized with the op arguments. This new token is merely a shortcut\n to the argument list, and one could replace the uses of the result with the\n arguments for the same effect. The async version of this op is primarily\n used to make each async token have a single use during lowering and\n thereby make forks in async execution explicit. Example usage:\n\n ```mlir\n %t0 = gpu.foo async : !gpu.async.token\n %t1 = gpu.bar async : !gpu.async.token\n %t2 = gpu.wait async [%t0, %t1]\n // gpu.baz doesn't run until gpu.foo and gpu.bar have both completed, just\n // as if the async dependencies were [%t0, %t1].\n %t3 = gpu.baz async [%t2]\n ```\n\n If the op does not contain the `async` keyword, it does not return a new\n async token but blocks until all ops producing the async dependency tokens\n finished execution. All dependent memory operations are visible to the host\n once this op completes. Example usage:\n\n ```mlir\n %t0 = gpu.foo async : !gpu.async.token\n %t1 = gpu.bar async : !gpu.async.token\n // The gpu.wait op blocks until gpu.foo and gpu.bar have completed.\n gpu.wait [%t0, %t1]\n ```", "operands": [ { "name": "asyncDependencies", "type": "Variadic" } ], "results": [ { "name": "asyncToken", "type": "Optional" } ], "assemblyFormat": "custom(type($asyncToken), $asyncDependencies) attr-dict" }, { "name": "gpu.warp_execute_on_lane_0", "summary": "Executes operations in the associated region on thread #0 of aSPMD program", "description": "`warp_execute_on_lane_0` is an operation used to bridge the gap between\n vector programming and SPMD programming model like GPU SIMT. It allows to\n trivially convert a region of vector code meant to run on a multiple threads\n into a valid SPMD region and then allows incremental transformation to\n distribute vector operations on the threads.\n\n Any code present in the region would only be executed on first thread/lane\n based on the `laneid` operand. The `laneid` operand is an integer ID between\n [0, `warp_size`). The `warp_size` attribute indicates the number of lanes in\n a warp.\n\n Operands are vector values distributed on all lanes that may be used by\n the single lane execution. The matching region argument is a vector of all\n the values of those lanes available to the single active lane. The\n distributed dimension is implicit based on the shape of the operand and\n argument. the properties of the distribution may be described by extra\n attributes (e.g. affine map).\n\n Return values are distributed on all lanes using laneId as index. The\n vector is distributed based on the shape ratio between the vector type of\n the yield and the result type.\n If the shapes are the same this means the value is broadcasted to all lanes.\n In the future the distribution can be made more explicit using affine_maps\n and will support having multiple Ids.\n\n Therefore the `warp_execute_on_lane_0` operations allow to implicitly copy\n between lane0 and the lanes of the warp. When distributing a vector\n from lane0 to all the lanes, the data are distributed in a block cyclic way.\n For example `vector<64xf32>` gets distributed on 32 threads and map to\n `vector<2xf32>` where thread 0 contains vector[0] and vector[1].\n\n During lowering values passed as operands and return value need to be\n visible to different lanes within the warp. This would usually be done by\n going through memory.\n\n The region is *not* isolated from above. For values coming from the parent\n region not going through operands only the lane 0 value will be accesible so\n it generally only make sense for uniform values.\n\n Example:\n ```\n // Execute in parallel on all threads/lanes.\n gpu.warp_execute_on_lane_0 (%laneid)[32] {\n // Serial code running only on thread/lane 0.\n ...\n }\n // Execute in parallel on all threads/lanes.\n ```\n\n This may be lowered to an scf.if region as below:\n ```\n // Execute in parallel on all threads/lanes.\n %cnd = arith.cmpi eq, %laneid, %c0 : index\n scf.if %cnd {\n // Serial code running only on thread/lane 0.\n ...\n }\n // Execute in parallel on all threads/lanes.\n ```\n\n When the region has operands and/or return values:\n ```\n // Execute in parallel on all threads/lanes.\n %0 = gpu.warp_execute_on_lane_0(%laneid)[32]\n args(%v0 : vector<4xi32>) -> (vector<1xf32>) {\n ^bb0(%arg0 : vector<128xi32>) :\n // Serial code running only on thread/lane 0.\n ...\n gpu.yield %1 : vector<32xf32>\n }\n // Execute in parallel on all threads/lanes.\n ```\n\n values at the region boundary would go through memory:\n ```\n // Execute in parallel on all threads/lanes.\n ...\n // Store the data from each thread into memory and Synchronization.\n %tmp0 = memreg.alloc() : memref<128xf32>\n %tmp1 = memreg.alloc() : memref<32xf32>\n %cnd = arith.cmpi eq, %laneid, %c0 : index\n vector.store %v0, %tmp0[%laneid] : memref<128xf32>, vector<4xf32>\n some_synchronization_primitive\n scf.if %cnd {\n // Serialized code running only on thread 0.\n // Load the data from all the threads into a register from thread 0. This\n // allow threads 0 to access data from all the threads.\n %arg0 = vector.load %tmp0[%c0] : memref<128xf32>, vector<128xf32>\n ...\n // Store the data from thread 0 into memory.\n vector.store %1, %tmp1[%c0] : memref<32xf32>, vector<32xf32>\n }\n // Synchronization and load the data in a block cyclic way so that the\n // vector is distributed on all threads.\n some_synchronization_primitive\n %0 = vector.load %tmp1[%laneid] : memref<32xf32>, vector<32xf32>\n // Execute in parallel on all threads/lanes.\n ```", "operands": [ { "name": "laneid", "type": "Index" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "warp_size", "type": "I64Attr" } ], "regions": [ { "name": "warpRegion", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "gpu.yield", "summary": "GPU yield operation", "description": "`gpu.yield` is a special terminator operation for blocks inside regions\n in gpu ops. It returns values to the immediately enclosing gpu op.\n\n Example:\n\n ```mlir\n gpu.yield %f0, %f1 : f32, f32\n ```", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($values^ `:` type($values))?" }, { "name": "hal_inline.buffer_view.assert", "summary": "Buffer view contents assertion.", "description": "Asserts that the buffer view contains a data compatible tensor with the\n given encoding. Program execution will abort as if `std.assert` had been\n used.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" }, { "name": "element_type", "type": "HAL_ElementType" }, { "name": "encoding_type", "type": "HAL_EncodingType" }, { "name": "shape", "type": "Variadic" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `message` `(` $message `)`\n `shape` `(` `[` $shape `]` `)`\n `type` `(` $element_type `)`\n `encoding` `(` $encoding_type `)`\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.buffer", "summary": "Buffer view buffer accessor.", "description": "Returns the buffer backing this view's contents.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_BufferType" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.create", "summary": "Buffer view reference initializer.", "description": "Creates a reference to a buffer with a particular shape and element type.\n The buffer is not copied and both the original and view references must be\n synchronized. This makes it easier to associate commonly-carried metadata\n along with the contents.", "operands": [ { "name": "source_buffer", "type": "HAL_BufferType" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "source_length", "type": "HAL_DeviceSize" }, { "name": "element_type", "type": "HAL_ElementType" }, { "name": "encoding_type", "type": "HAL_EncodingType" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HAL_BufferView" } ], "assemblyFormat": "`buffer` `(` $source_buffer `:` type($source_buffer) `)`\n `` `[` $source_offset `,` $source_length `]`\n `shape` `(` `[` $shape `]` `)`\n `type` `(` $element_type `)`\n `encoding` `(` $encoding_type `)`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.dim", "summary": "Buffer view dimension value query.", "description": "Returns the value of the given dimension.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_Dim" } ], "attributes": [ { "name": "index", "type": "IndexAttr" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `` `[` $index `]`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.element_type", "summary": "Buffer view element type query.", "description": "Returns the element type of the buffer view.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_ElementType" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.encoding_type", "summary": "Buffer view encoding type query.", "description": "Returns the encoding type of the buffer view.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_EncodingType" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.rank", "summary": "Buffer view rank query.", "description": "Returns the rank of the buffer view.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_Dim" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer_view.trace", "summary": "Trace value(s) operation.", "description": "Traces out to a runtime trace sink (console, log file, etc) the given buffer\n views and titles them with the given key. The key is informational only and\n useful for titling/marking specific sets of buffers for easier searching.", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "StrAttr" } ], "assemblyFormat": "$key `=`\n $operands `:` type($operands)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer.allocate", "summary": "Empty buffer allocation operation.", "description": "Allocates a buffer of the given size.\n The size of the buffer returned may be larger than the requested size if the\n allocator has specific alignment requirements or minimum allocation sizes.", "operands": [ { "name": "minimum_alignment", "type": "HAL_DeviceSize" }, { "name": "allocation_size", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_Buffer" }, { "name": "storage", "type": "Util_BufferType" } ], "assemblyFormat": "`alignment` `(` $minimum_alignment `)`\n `:` custom(type($result), $allocation_size) `in` type($storage)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer.allocate.initialized", "summary": "Buffer allocation with cloning.", "description": "Allocates a buffer with a copy of the provided contents.", "operands": [ { "name": "minimum_alignment", "type": "HAL_DeviceSize" }, { "name": "source", "type": "Util_BufferType" }, { "name": "offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_Buffer" }, { "name": "storage", "type": "Util_BufferType" } ], "assemblyFormat": "`source` `(` $source `:` type($source) `)` `` `[` $offset `,` $length `]`\n `alignment` `(` $minimum_alignment `)`\n `:` custom(type($result), ref($length)) `in` type($storage)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer.length", "summary": "Buffer byte length accessor.", "description": "Returns the allocated size of a buffer in bytes.\n May be less than the underlying buffer allocation if this is a subspan or\n view into another buffer.", "operands": [ { "name": "buffer", "type": "HAL_BufferType" } ], "results": [ { "name": "result", "type": "HAL_DeviceSize" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer.storage", "summary": "Buffer backing storage accessor.", "description": "Returns the host backing storage of the HAL buffer as a subspan limited to\n to the buffer's logical range (meaning that byte 0 of the returned buffer is\n byte 0 of the HAL buffer).", "operands": [ { "name": "buffer", "type": "HAL_BufferType" } ], "results": [ { "name": "storage", "type": "Util_BufferType" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n `:` type($storage)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer.subspan", "summary": "Buffer subspan operation.", "description": "Returns a reference to a subspan of the buffer.", "operands": [ { "name": "source_buffer", "type": "HAL_BufferType" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_BufferType" } ], "assemblyFormat": "`<` $source_buffer `:` type($source_buffer) `>`\n `` `[` $source_offset `,` $length `]`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.buffer.wrap", "summary": "Host buffer wrapping operation.", "description": "Tries wrapping a !hal.buffer around host memory backed by the given byte\n buffer.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_Buffer" } ], "assemblyFormat": "`source` `(` $source `:` type($source) `)` `` `[` $offset `,` $length `]`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_inline.device.query", "summary": "Returns a runtime configuration parameter from the device.", "description": "Queries a device configuration parameter with the given key.\n Returns a status indicating whether the pair was recognized/available and if\n it was the value converted to the specified type. Queries must return the\n same value for the lifetime of the module though may vary from run to run.\n\n This is roughly equivalent to the `sysconf` linux syscall\n (https://man7.org/linux/man-pages/man3/sysconf.3.html) in that the exact\n set of keys available and their interpretation is target-dependent.\n\n Users of the op must check the `ok` result before using the value as what\n set of keys is available may change over time. If in doubt: don't use this.\n Each key used adds additional versioning and testing complexity as runtime\n code path changes will explode combinatorially and should be treated with as\n much care as a binary file format change. Keys should be prefixed with `ex.`\n when experimental indicating that they are not expected to be present\n forever; all non-experimental keys should be vetted.\n\n Well-known keys: (none yet)", "results": [ { "name": "ok", "type": "I1" }, { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "category", "type": "StrAttr" }, { "name": "key", "type": "StrAttr" }, { "name": "default_value", "type": "OptionalAttr" } ], "assemblyFormat": "`key` `(` $category `:` `` `:` $key `)`\n `:` type($ok) `,` type($value)\n (`=` $default_value^)?\n attr-dict-with-keyword" }, { "name": "hal_loader.executable.dispatch", "summary": "Inline executable dispatch operation.", "description": "Dispatches execution to an executable entry point with the given parameters.", "operands": [ { "name": "executable", "type": "HAL_Executable" }, { "name": "entry_point", "type": "HAL_FunctionId" }, { "name": "workgroup_x", "type": "HAL_Dim" }, { "name": "workgroup_y", "type": "HAL_Dim" }, { "name": "workgroup_z", "type": "HAL_Dim" }, { "name": "constants", "type": "Variadic" }, { "name": "binding_buffers", "type": "Variadic" }, { "name": "binding_offsets", "type": "Variadic" }, { "name": "binding_lengths", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`executable` `(` $executable `:` type($executable) `)`\n `` `[` $entry_point `]`\n `workgroups` `(` `[`\n $workgroup_x `,`\n $workgroup_y `,`\n $workgroup_z\n `]` `)`\n (`constants` `(` `[` $constants^ `]` `)`)?\n `bindings` `(` `[`\n custom($binding_buffers,\n type($binding_buffers),\n $binding_offsets,\n $binding_lengths)\n `]` `)`\n attr-dict-with-keyword" }, { "name": "hal_loader.executable.export.ordinal", "summary": "Executable export ordinal lookup pseudo-op.", "description": "Resolves an executable export ordinal to a value once ordinals have been\n assigned.", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "entry_point", "type": "SymbolRefAttr" } ], "assemblyFormat": "`target` `(` $entry_point `)`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_loader.executable.load", "summary": "Dynamically loads an executable.", "description": "Creates, loads, and dynamically links an executable.\n\n Optional constants provide for specialization of the executable based on\n runtime-derived parameters.", "operands": [ { "name": "data", "type": "Util_BufferType" }, { "name": "constants", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HAL_Executable" } ], "attributes": [ { "name": "format", "type": "StrAttr" } ], "assemblyFormat": "`format` `(` $format `)`\n `data` `(` $data `)`\n (`constants` `(` `[` $constants^ `]` `)`)?\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_loader.executable.lookup", "summary": "Executable cache lookup pseudo-op.", "description": "Used during conversion to provide a placeholder for a globally cached and\n possibly lazy-initialized executable.", "results": [ { "name": "result", "type": "HAL_Executable" } ], "attributes": [ { "name": "executable", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`executable` `(` $executable `)`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_loader.executable.lookup.function", "summary": "Executable function lookup pseudo-op.", "description": "Resolves an executable export name to a runtime function id. The result is\n only meaningful for the executable operand and must be treated as opaque by\n compiler IR. The function reference is retained as a SymbolRefAttr so\n executable linking passes can rewrite it, but it may intentionally stop\n resolving after executable serialization strips the original export\n declarations.", "operands": [ { "name": "executable", "type": "HAL_Executable" } ], "results": [ { "name": "result", "type": "HAL_FunctionId" } ], "attributes": [ { "name": "entry_point", "type": "SymbolRefAttr" } ], "assemblyFormat": "`target` `(` $executable `:` type($executable) `)`\n `function` `(` $entry_point `)`\n `:` type($result)\n attr-dict-with-keyword" }, { "name": "hal_loader.executable.query_support", "summary": "Queries whether an executable format is supported.", "description": "Returns true if the given format is supported by the device loader. This\n does not guarantee that loading will succeed as the executable may require\n functionality that cannot be met my the hosting runtime environment.", "results": [ { "name": "supported", "type": "I1" } ], "attributes": [ { "name": "executable_format", "type": "StrAttr" } ], "assemblyFormat": "`format` `(` $executable_format `)`\n `:` type($supported)\n attr-dict-with-keyword" }, { "name": "hal.allocator.allocate", "summary": "Empty buffer allocation operation.", "description": "Allocates a buffer of the given size from the allocator.\n The size of the buffer returned may be larger than the requested size if the\n allocator has specific alignment requirements or minimum allocation sizes.", "operands": [ { "name": "allocator", "type": "HAL_Allocator" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "memory_types", "type": "HAL_MemoryType" }, { "name": "buffer_usage", "type": "HAL_BufferUsage" }, { "name": "result_size", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_Buffer" } ], "assemblyFormat": "`<` $allocator `:` type($allocator) `>`\n `affinity` `(` $queue_affinity `)`\n `type` `(` $memory_types `)`\n `usage` `(` $buffer_usage `)`\n `:` custom(type($result), $result_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.allocator.compute_size", "hasCustomAssemblyFormat": 1 }, { "name": "hal.allocator.import", "summary": "Allocator-supported host buffer import operation.", "description": "Tries importing host memory backed by the given byte buffer into a\n device accessible `!hal.buffer`. The returned buffer may be host-only and\n not directly usable on devices. If the mapping cannot be completed (such as\n trying to map the host memory as device-local on devices with discrete\n memory) then `did_import` will indicate that the returned buffer is null.", "operands": [ { "name": "allocator", "type": "HAL_Allocator" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "memory_types", "type": "HAL_MemoryType" }, { "name": "buffer_usage", "type": "HAL_BufferUsage" }, { "name": "source", "type": "Util_BufferType" }, { "name": "offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "results": [ { "name": "did_import", "type": "I1" }, { "name": "result", "type": "HAL_Buffer" } ], "assemblyFormat": "`<` $allocator `:` type($allocator) `>`\n `source` `(` $source `:` type($source) `)` `` `[` $offset `,` $length `]`\n `affinity` `(` $queue_affinity `)`\n `type` `(` $memory_types `)`\n `usage` `(` $buffer_usage `)`\n `:` type($did_import) `,` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.allocator.resolve_memory_properties", "summary": "Resolves memory properties from resource lifetime and affinity.", "description": "Resolves the required memory types and buffer usage for a resource with\n the given lifetime and affinity. This operation encapsulates the logic\n for deriving buffer properties based on stream resource semantics.\n\n This operation can be resolved later in compilation either by canonicalization\n for single device affinities or using the topology attribute for multiple devices.\n\n Example:\n ```mlir\n %memory_types, %buffer_usage = hal.allocator.resolve_memory_properties\n for(#hal.device.affinity<@device_a>)\n lifetime(transient) : i32, i32\n ```", "results": [ { "name": "memory_types", "type": "HAL_MemoryType" }, { "name": "buffer_usage", "type": "HAL_BufferUsage" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" }, { "name": "lifetime", "type": "HAL_LifetimeAttr{*|external|staging|transient|variable|constant}" } ], "assemblyFormat": "(`for` `(` $affinity^ `)`)?\n `lifetime` `(` $lifetime `)`\n `:` type($memory_types) `,` type($buffer_usage)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.allocator.select", "summary": "Selects a device/queue from the given set for allocations.", "description": "Chooses one device and queue affinity pair from the given optimal set that\n can service the requested memory type and usage for all devices in the set.\n Returns a null device if no pair is able to satisfy the conditions.", "operands": [ { "name": "devices", "type": "Variadic" }, { "name": "queue_affinities", "type": "Variadic" }, { "name": "memory_types", "type": "HAL_MemoryType" }, { "name": "buffer_usage", "type": "HAL_BufferUsage" } ], "results": [ { "name": "selected_device", "type": "HAL_Device" }, { "name": "selected_queue_affinity", "type": "HAL_DeviceQueueAffinity" } ], "assemblyFormat": "`from` `(` custom($devices, type($devices), $queue_affinities) `)`\n `type` `(` $memory_types `)`\n `usage` `(` $buffer_usage `)`\n `:`\n type($selected_device) `,` type($selected_queue_affinity)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_usage", "summary": "An iree_hal_buffer_usage_t for the given usage bits.", "description": "Maps buffer usage bits to a runtime `iree_hal_buffer_usage_t` value.", "results": [ { "name": "result", "type": "HAL_BufferUsage" } ], "attributes": [ { "name": "usage", "type": "HAL_BufferUsageBitfieldAttr{None|TransferSource|TransferTarget|Transfer|DispatchIndirectParameters|DispatchUniformRead|DispatchStorageRead|DispatchStorageWrite|DispatchStorage|DispatchImageRead|DispatchImageWrite|DispatchImage|SharingExport|SharingReplicate|SharingConcurrent|SharingImmutable|MappingScoped|MappingPersistent|MappingOptional|MappingAccessRandom|MappingAccessSequentialWrite|Mapping}" } ], "assemblyFormat": "`<` $usage `>`\n attr-dict\n `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.assert", "summary": "Buffer view contents assertion.", "description": "Asserts that the buffer view contains a data compatible tensor with the\n given encoding. Program execution will abort as if `std.assert` had been\n used.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" }, { "name": "element_type", "type": "HAL_ElementType" }, { "name": "encoding_type", "type": "HAL_EncodingType" }, { "name": "shape", "type": "Variadic" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `message` `(` $message `)`\n `shape` `(` `[` $shape `]` `)`\n `type` `(` $element_type `)`\n `encoding` `(` $encoding_type `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.buffer", "summary": "Buffer view buffer accessor.", "description": "Returns the buffer backing this view's contents.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_BufferType" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.create", "summary": "Buffer view reference initializer.", "description": "Creates a reference to a buffer with a particular shape and element type.\n The buffer is not copied and both the original and view references must be\n synchronized. This makes it easier to associate commonly-carried metadata\n along with the contents.", "operands": [ { "name": "source_buffer", "type": "HAL_BufferType" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "source_length", "type": "HAL_DeviceSize" }, { "name": "element_type", "type": "HAL_ElementType" }, { "name": "encoding_type", "type": "HAL_EncodingType" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HAL_BufferView" } ], "assemblyFormat": "`buffer` `(` $source_buffer `:` type($source_buffer) `)`\n `` `[` $source_offset `,` $source_length `]`\n `shape` `(` `[` $shape `]` `)`\n `type` `(` $element_type `)`\n `encoding` `(` $encoding_type `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.dim", "summary": "Buffer view dimension value query.", "description": "Returns the value of the given dimension.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_Dim" } ], "attributes": [ { "name": "index", "type": "IndexAttr" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `` `[` $index `]`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.element_type", "summary": "Buffer view element type query.", "description": "Returns the element type of the buffer view.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_ElementType" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.encoding_type", "summary": "Buffer view encoding type query.", "description": "Returns the encoding type of the buffer view.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_EncodingType" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.rank", "summary": "Buffer view rank query.", "description": "Returns the rank of the buffer view.", "operands": [ { "name": "buffer_view", "type": "HAL_BufferView" } ], "results": [ { "name": "result", "type": "HAL_Dim" } ], "assemblyFormat": "`<` $buffer_view `:` type($buffer_view) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer_view.trace", "summary": "Trace value(s) operation.", "description": "Traces out to a runtime trace sink (console, log file, etc) the given buffer\n views and titles them with the given key. The key is informational only and\n useful for titling/marking specific sets of buffers for easier searching.", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "StrAttr" } ], "assemblyFormat": "$key `=`\n $operands `:` type($operands)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.allocation.discard", "summary": "Discards ownership of the underlying buffer allocation by the caller.", "description": "Decrementing the preserve count indicates that the owner is releasing its\n ownership. When the last owner discards their ownership it is safe to\n deallocate the buffer allocation even if there are still references\n remaining to the buffer object.\n\n Any code that _may_ receive asynchronously allocated buffers must properly\n balance their preserves and discards. Code that will never receive\n asynchronously allocated buffers - such as those using the inline HAL - can\n ignore tracking as there's no asynchronous deallocation and allocation\n lifetime is tied to buffer object lifetime. Note that unbalanced discards\n will result in either correctness issues (buffer is deallocated too early)\n or extended lifetime (buffer cannot be deallocated until all buffer object\n references have been released).\n\n Returns true if the caller was the last owner of the allocation and it can\n now be deallocated.", "operands": [ { "name": "buffer", "type": "HAL_BufferType" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.allocation.is_terminal", "summary": "Returns true if the underlying buffer allocation has a single owner.", "description": "This can be used to reuse a buffer that has no other owners.\n\n Note that an allocated buffer may have multiple suballocations referencing\n it and this query is only for the entire allocation. When reusing a buffer\n one should ensure the allocation size matches (or is within threshold) so\n that a reuse of 16MB doesn't keep an underlying allocation of 16GB wired.\n\n Since device allocators are expected to reuse memory if in doubt prefer to\n dealloca and alloca. This method should only be used in situations where the\n buffer types are known to the application (such as fixed input and output\n buffers).", "operands": [ { "name": "buffer", "type": "HAL_BufferType" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.allocation.preserve", "summary": "Preserves the underlying buffer allocation for the caller.", "description": "Preservation is a way to track lifetime of an asynchronously-allocated\n buffer on multiple device timelines. Incrementing the preserve count\n indicates that there is a new co-owner of the buffer lifetime and that owner\n must make a corresponding `hal.buffer.allocation.discard` call to release\n their ownership and possibly deallocate the buffer.\n\n Though intended for asynchronously-allocated buffers it is fine to preserve\n synchronously-allocated ones. Any code that _may_ receive asynchronously\n allocated buffers must properly balance their preserves and discards. Code\n that will never receive asynchronously allocated buffers - such as those\n using the inline HAL - can ignore tracking.\n\n This preservation roughly translates to retaining logical ownership of the\n allocation and may differ from the buffer object reference count. As an\n example if the Python GC hasn't run there may still be several references to\n the buffer object even after the application has stopped using the buffer.\n Tracking the preserve count independently allows the application to eagerly\n deallocate the buffer without relying on the lifetime of the object to do\n so.\n\n A preserved buffer will still be deallocated if there are no longer any\n references to the buffer object. Preserving the buffer only prevents any\n other owner from deallocating it while there are references outstanding.\n See `hal.buffer.allocation.discard` for more information about releasing\n ownership.", "operands": [ { "name": "buffer", "type": "HAL_BufferType" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.assert", "summary": "Buffer compatibility assertion.", "description": "Asserts that the buffer is compatible with the given allocator and usage.\n Program execution will abort as if `std.assert` had been used.\n\n This only checks that the buffer can be used and not that it matches the\n given parameters exactly. Buffers may be from other allocators so long as\n the allocators are compatible (devices can address each other's memory),\n the type and usage contain all the requested bits (having more bits is ok),\n and the length is at least the requested minimum (as padding may be\n ignored).", "operands": [ { "name": "buffer", "type": "HAL_Buffer" }, { "name": "allocator", "type": "HAL_Allocator" }, { "name": "minimum_length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "message", "type": "StrAttr" }, { "name": "memory_types", "type": "HAL_MemoryTypeBitfieldAttr{None|Optimal|HostVisible|HostCoherent|HostCached|HostLocal|DeviceVisible|DeviceLocal}" }, { "name": "buffer_usage", "type": "HAL_BufferUsageBitfieldAttr{None|TransferSource|TransferTarget|Transfer|DispatchIndirectParameters|DispatchUniformRead|DispatchStorageRead|DispatchStorageWrite|DispatchStorage|DispatchImageRead|DispatchImageWrite|DispatchImage|SharingExport|SharingReplicate|SharingConcurrent|SharingImmutable|MappingScoped|MappingPersistent|MappingOptional|MappingAccessRandom|MappingAccessSequentialWrite|Mapping}" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n `message` `(` $message `)`\n `allocator` `(` $allocator `:` type($allocator) `)`\n `minimum_length` `(` $minimum_length `)`\n `type` `(` $memory_types `)`\n `usage` `(` $buffer_usage `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.length", "summary": "Buffer byte length accessor.", "description": "Returns the allocated size of a buffer in bytes.\n May be less than the underlying buffer allocation if this is a subspan or\n view into another buffer.", "operands": [ { "name": "buffer", "type": "HAL_BufferType" } ], "results": [ { "name": "result", "type": "HAL_DeviceSize" } ], "assemblyFormat": "`<` $buffer `:` type($buffer) `>`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.load", "summary": "Buffer element load operation.", "description": "Loads a value from a buffer by mapping it.", "operands": [ { "name": "source_buffer", "type": "HAL_BufferType" }, { "name": "source_offset", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[HAL_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "assemblyFormat": "`<` $source_buffer `:` type($source_buffer) `>`\n `` `[` $source_offset `]`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.store", "summary": "Buffer element store operation.", "description": "Stores a value into a buffer by mapping it.", "operands": [ { "name": "value", "type": "AnyTypeOf<[HAL_PrimitiveType, AnyVectorOfNonZeroRank]>" }, { "name": "target_buffer", "type": "HAL_BufferType" }, { "name": "target_offset", "type": "HAL_DeviceSize" } ], "assemblyFormat": "`<` $target_buffer `:` type($target_buffer) `>`\n `` `[` $target_offset `]`\n `value` `(` $value `:` type($value) `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.buffer.subspan", "summary": "Buffer subspan operation.", "description": "Returns a reference to a subspan of the buffer.", "operands": [ { "name": "source_buffer", "type": "HAL_BufferType" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_BufferType" } ], "assemblyFormat": "`<` $source_buffer `:` type($source_buffer) `>`\n `` `[` $source_offset `,` $length `]`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.channel.create", "summary": "Creates a new channel for collective communication.", "description": "Returns a new channel with the given rank associated with the given device\n queue. Collective operations using this channel must only be submitted on\n compatible queues.\n\n The group and ID are optional and may be null. A rank or count of -1 can be\n used to indicate a default inherited from the environment or device\n configuration.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "id", "type": "Util_BufferType" }, { "name": "group", "type": "Util_BufferType" }, { "name": "rank", "type": "I32" }, { "name": "count", "type": "I32" } ], "results": [ { "name": "result", "type": "HAL_Channel" } ], "attributes": [ { "name": "flags", "type": "HAL_ChannelFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `affinity` `(` $queue_affinity `)`\n `flags` `(` $flags `)`\n `id` `(` $id `)`\n `group` `(` $group `)`\n `rank` `(` $rank `)`\n `count` `(` $count `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.channel.rank_and_count", "summary": "Returns the rank of the local participant in the group.", "description": "Returns the rank the channel represents as a participant in a collective\n group in `[0, count)` and the total participant count.", "operands": [ { "name": "channel", "type": "HAL_Channel" } ], "results": [ { "name": "rank", "type": "I32" }, { "name": "count", "type": "I32" } ], "assemblyFormat": "`<` $channel `:` type($channel) `>`\n `:` type($rank) `,` type($count)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.channel.split", "summary": "Splits a collective communication channel.", "description": "Partitions the group associated with the given channel into disjoint\n subgroups for each unique value of color. Each new subgroup contains all\n participants of the same color and within each subgroup the key argument\n is used to define the rank order. When multiple participants in a group\n use the same key the tie will be broken using their rank in the parent\n group. A color of -1 indicates that the rank does not participate in any\n subgroup and will return a null channel.", "operands": [ { "name": "channel", "type": "HAL_Channel" }, { "name": "color", "type": "I32" }, { "name": "key", "type": "I32" } ], "results": [ { "name": "result", "type": "HAL_Channel" } ], "attributes": [ { "name": "flags", "type": "HAL_ChannelFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $channel `:` type($channel) `>`\n `color` `(` $color `)`\n `key` `(` $key `)`\n `flags` `(` $flags `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.begin", "hasCustomAssemblyFormat": 1 }, { "name": "hal.command_buffer.begin_debug_group", "summary": "Pushes a command buffer debug group label.", "description": "Pushes a new debug group with the given label.\n All commands between this and a mandatory matching call to\n `hal.command_buffer.end_debug_group` will be grouped together with the\n given label.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "attributes": [ { "name": "label", "type": "StrAttr" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `label` `(` $label `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.collective", "summary": "Command buffer collective dispatch recording operation.", "description": "Dispatches a collective operation defined by op using the given buffers.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "channel", "type": "HAL_Channel" }, { "name": "element_count", "type": "HAL_DeviceSize" }, { "name": "param", "type": "Optional" }, { "name": "send_buffer", "type": "Optional>" }, { "name": "send_offset", "type": "Optional" }, { "name": "send_length", "type": "Optional" }, { "name": "recv_buffer", "type": "Optional>" }, { "name": "recv_offset", "type": "Optional" }, { "name": "recv_length", "type": "Optional" } ], "attributes": [ { "name": "op", "type": "HAL_CollectiveAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `channel` `(` $channel `:` type($channel) `)`\n `op` `(` $op `)`\n (`param` `(` $param^ `:` type($param) `)`)?\n (`send` `(` $send_buffer^ `:` type($send_buffer) `)`\n `` `[` $send_offset `,` $send_length `]`)?\n (`recv` `(` $recv_buffer^ `:` type($recv_buffer) `)`\n `` `[` $recv_offset `,` $recv_length `]`)?\n `count` `(` $element_count `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.copy_buffer", "summary": "Command buffer buffer copy recording operation.", "description": "Copies a range of one buffer to another.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "source_buffer", "type": "AnyTypeOf<[Index, HAL_BufferType]>" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "target_buffer", "type": "AnyTypeOf<[Index, HAL_BufferType]>" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "flags", "type": "HAL_CopyFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `source` `(` $source_buffer `:` type($source_buffer) `)`\n `` `[` $source_offset `]`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.create", "summary": "Command buffer allocation operation.", "description": "Returns a command buffer from the device pool ready to begin recording.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "binding_capacity", "type": "Optional" } ], "results": [ { "name": "result", "type": "HAL_CommandBuffer" } ], "attributes": [ { "name": "modes", "type": "HAL_CommandBufferModeBitfieldAttr{None|OneShot|AllowInlineExecution}" }, { "name": "command_categories", "type": "HAL_CommandCategoryBitfieldAttr{None|Transfer|Dispatch}" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `mode` `(` $modes `)`\n `categories` `(` $command_categories `)`\n `affinity` `(` $queue_affinity `)`\n (`bindings` `(` $binding_capacity^ `)`)?\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.device", "summary": "Command buffer device query operation.", "description": "Used during conversion to access the device used to create a command buffer.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "results": [ { "name": "device", "type": "HAL_Device" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `:` type($device)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.dispatch", "summary": "Command buffer dispatch recording operation.", "description": "Dispatches an execution request.\n The request may execute overlapped with any other transfer operation or\n dispatch made within the same barrier-defined sequence.\n\n The provided constant data and binding list will be recorded into the\n command buffer and need not remain live beyond the call. Push constants are\n always 4-byte values and treated as opaque, meaning that they may be\n bit-casted floats, bit-packed booleans, etc. The provided buffers may either\n be HAL buffers or indirect references into the command buffer binding table.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "executable", "type": "HAL_Executable" }, { "name": "entry_point", "type": "HAL_FunctionId" }, { "name": "workgroup_x", "type": "HAL_Dim" }, { "name": "workgroup_y", "type": "HAL_Dim" }, { "name": "workgroup_z", "type": "HAL_Dim" }, { "name": "constants", "type": "Variadic" }, { "name": "binding_buffers", "type": "Variadic>" }, { "name": "binding_offsets", "type": "Variadic" }, { "name": "binding_lengths", "type": "Variadic" } ], "attributes": [ { "name": "flags", "type": "HAL_DispatchFlagsAttr{None|Reserved}" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `target` `(` $executable `:` type($executable) `)`\n `` `[` $entry_point `]`\n `workgroups` `(` `[`\n $workgroup_x `,`\n $workgroup_y `,`\n $workgroup_z\n `]` `)`\n (`constants` `(` `[` $constants^ `]` `)`)?\n `bindings` `(` `[`\n custom($binding_buffers,\n type($binding_buffers),\n $binding_offsets,\n $binding_lengths)\n `]` `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.dispatch.indirect", "summary": "Command buffer indirect dispatch recording operation.", "description": "Dispatches an execution request with a deferred workgroup count.\n This is the same as iree_hal_command_buffer_dispatch but the workgroup count\n is read from the given |workgroups_ref| buffer at the specified offset as\n 3 uint32_t XYZ values immediately before performing the dispatch. This\n allows prior dispatches within the command sequence to populate the\n workgroup count or the workgroup count to change across submissions of the\n same reusable command buffer.\n\n The provided constant data and binding list will be recorded into the\n command buffer and need not remain live beyond the call. Push constants are\n always 4-byte values and treated as opaque, meaning that they may be\n bit-casted floats, bit-packed booleans, etc. The provided buffers may either\n be HAL buffers or indirect references into the command buffer binding table.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "executable", "type": "HAL_Executable" }, { "name": "entry_point", "type": "HAL_FunctionId" }, { "name": "workgroups_buffer", "type": "AnyTypeOf<[Index, HAL_BufferType]>" }, { "name": "workgroups_offset", "type": "HAL_DeviceSize" }, { "name": "constants", "type": "Variadic" }, { "name": "binding_buffers", "type": "Variadic>" }, { "name": "binding_offsets", "type": "Variadic" }, { "name": "binding_lengths", "type": "Variadic" } ], "attributes": [ { "name": "flags", "type": "HAL_DispatchFlagsAttr{None|Reserved}" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `target` `(` $executable `:` type($executable) `)`\n `` `[` $entry_point `]`\n `workgroups` `(` $workgroups_buffer `:` type($workgroups_buffer) `)`\n `` `[` $workgroups_offset `]`\n (`constants` `(` `[` $constants^ `]` `)`)?\n `bindings` `(` `[`\n custom($binding_buffers,\n type($binding_buffers),\n $binding_offsets,\n $binding_lengths)\n `]` `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.dispatch.symbol", "hasCustomAssemblyFormat": 1 }, { "name": "hal.command_buffer.end", "hasCustomAssemblyFormat": 1 }, { "name": "hal.command_buffer.end_debug_group", "summary": "Pops a command buffer debug group label.", "description": "Pops a debug group from the stack.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.execution_barrier", "summary": "Command buffer execution barrier recording operation.", "description": "Defines an execution dependency between all commands recorded before the\n barrier and all commands recorded after the barrier. Only the stages\n provided will be affected.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "attributes": [ { "name": "source_stage_mask", "type": "HAL_ExecutionStageBitfieldAttr{None|CommandIssue|CommandProcess|Dispatch|Transfer|CommandRetire|Host}" }, { "name": "target_stage_mask", "type": "HAL_ExecutionStageBitfieldAttr{None|CommandIssue|CommandProcess|Dispatch|Transfer|CommandRetire|Host}" }, { "name": "flags", "type": "HAL_ExecutionBarrierFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `source` `(` $source_stage_mask `)`\n `target` `(` $target_stage_mask `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.fill_buffer", "summary": "Command buffer buffer fill recording operation.", "description": "Fills the target buffer with the given repeating value.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "target_buffer", "type": "AnyTypeOf<[Index, HAL_BufferType]>" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" }, { "name": "pattern", "type": "HAL_FillPatternType" } ], "attributes": [ { "name": "flags", "type": "HAL_FillFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `,` $length `]`\n `pattern` `(` $pattern `:` type($pattern) `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.finalize", "summary": "Finalizes command buffer recording.", "description": "Ends recording into the command buffer and prepares it for submission.\n No more commands may be recorded into the command buffer.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.command_buffer.push_descriptor_set", "hasCustomAssemblyFormat": 1 }, { "name": "hal.command_buffer.update_buffer", "summary": "Command buffer buffer update recording operation.", "description": "Copies a range of a host buffer into a device buffer. The host buffer\n contents will be captured at the time of the call and embedded in the\n command buffer.", "operands": [ { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "source_buffer", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Util_Size" }, { "name": "target_buffer", "type": "AnyTypeOf<[Index, HAL_BufferType]>" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "flags", "type": "HAL_UpdateFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $command_buffer `:` type($command_buffer) `>`\n `source` `(` $source_buffer `:` type($source_buffer) `{` $source_size `}` `)`\n `` `[` $source_offset `]`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.descriptor_set_layout.create", "hasCustomAssemblyFormat": 1 }, { "name": "hal.device.allocator", "summary": "Device allocator accessor operation.", "description": "Returns the allocator that can be used to allocate buffers compatible with\n the device.", "operands": [ { "name": "device", "type": "HAL_Device" } ], "results": [ { "name": "result", "type": "HAL_Allocator" } ], "assemblyFormat": "`<` $device `:` type($device) `>` `:` type($result) attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.memoize", "summary": "Memoizes resources for a particular device and queue affinity.", "description": "Executes the nested region once per device and affinity mask and memoizes\n the results such that future references return the previously memoized\n values. The initial execution may happen on demand or be hoisted to module\n initialization time.\n\n Any uses of the device or affinity specified within the nested region will\n be substituted with the appropriate device and affinity during memoization.\n All other implicitly captured values must be either constant or global\n values available at the time the memoization occurs.\n\n It is valid for the nested region contents to be inlined in place and never\n memoized. This can be useful when diagnosing memoization issues and can be\n forced with the `--iree-hal-memoization=false` flag.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `->` type($results)\n attr-dict-with-keyword\n $body", "hasCustomAssemblyFormat": true }, { "name": "hal.device.query", "summary": "Returns a runtime configuration parameter from the device.", "description": "Queries a device configuration parameter with the given key.\n Returns a status indicating whether the pair was recognized/available and if\n it was the value converted to the specified type. Queries must return the\n same value for the lifetime of the module though may vary from run to run.\n\n This is roughly equivalent to the `sysconf` linux syscall\n (https://man7.org/linux/man-pages/man3/sysconf.3.html) in that the exact\n set of keys available and their interpretation is target-dependent.\n\n Users of the op must check the `ok` result before using the value as what\n set of keys is available may change over time. If in doubt: don't use this.\n Each key used adds additional versioning and testing complexity as runtime\n code path changes will explode combinatorially and should be treated with as\n much care as a binary file format change. Keys should be prefixed with `ex.`\n when experimental indicating that they are not expected to be present\n forever; all non-experimental keys should be vetted.\n\n Well-known keys:\n\n * hal.device.id :: {some id pattern}\n Returns 1 if the device identifier matches the given pattern string.\n\n * hal.executable.format :: {some format pattern}\n Returns 1 if the given format is supported by the device loader.\n\n * hal.device :: concurrency\n The maximum concurrently executable submissions, mapping roughly to the\n queue count. The actual concurrency available may be less than this based\n on dynamic runtime parameters such as power/thermal modes, quota limits,\n or user choice.\n\n * hal.dispatch :: concurrency\n The maximum concurrently executable workgroups for a particular dispatch.\n The actual concurrency available may be less depending on device state.", "operands": [ { "name": "device", "type": "HAL_Device" } ], "results": [ { "name": "ok", "type": "I1" }, { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "category", "type": "StrAttr" }, { "name": "key", "type": "StrAttr" }, { "name": "default_value", "type": "OptionalAttr" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `key` `(` $category `:` `` `:` $key `)`\n `:` type($ok) `,` type($value)\n (`=` $default_value^)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.alloca", "summary": "Allocates a queue-ordered transient buffer.", "description": "Returns a queue-ordered transient buffer that will be available for use when\n the signal fence is reached. The allocation will not be made until the\n wait fence has been reached.\n\n The size of the buffer returned may be larger than the requested size if the\n allocator has specific alignment requirements or minimum allocation sizes.\n\n The buffer handle will remain live so long as there are retainers but the\n contents are undefined before the allocation signal fence has been signaled\n and after the deallocation wait fence has been reached.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "pool", "type": "HAL_DeviceQueuePool" }, { "name": "memory_types", "type": "HAL_MemoryType" }, { "name": "buffer_usage", "type": "HAL_BufferUsage" }, { "name": "result_size", "type": "HAL_DeviceSize" } ], "results": [ { "name": "result", "type": "HAL_Buffer" } ], "attributes": [ { "name": "flags", "type": "HAL_AllocaFlagBitfieldAttr{None|IndeterminateLifetime}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `pool` `(` $pool `)`\n `type` `(` $memory_types `)`\n `usage` `(` $buffer_usage `)`\n `flags` `(` $flags `)`\n `:` custom(type($result), $result_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.barrier", "summary": "Enqueues an execution barrier.", "description": "Signals the provided fence once the wait fence is reached.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" } ], "attributes": [ { "name": "flags", "type": "HAL_ExecuteFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.copy", "summary": "Copies one device-visible buffer to another.", "description": "The source buffer and target buffer must both be visible to the device\n queue performing the copy. In most cases the queue affinity should be set to\n where the target buffer will be consumed so that it has a chance of being\n cached. The source buffer must have transfer-source usage and the target\n buffer must have transfer-target usage.\n\n Note that individual queue transfer operations have a high overhead and they\n should be batched with other operations in command buffers.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_buffer", "type": "HAL_Buffer" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "target_buffer", "type": "HAL_Buffer" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "flags", "type": "HAL_CopyFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `source` `(` $source_buffer `:` type($source_buffer) `)`\n `` `[` $source_offset `]`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.dealloca", "summary": "Deallocates a queue-ordered transient buffer.", "description": "Deallocates a queue-ordered transient buffer.\n The deallocation will not be made until the wait fence has been reached and\n once the storage is available for reuse the signal fence will be signaled.\n\n After deallocation the contents of the buffer may still be accessible but\n will have undefined contents as other operations reuse the memory.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "buffer", "type": "HAL_Buffer" } ], "attributes": [ { "name": "flags", "type": "HAL_DeallocaFlagBitfieldAttr{None|PreferOrigin}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `buffer` `(` $buffer `:` type($buffer) `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.execute", "summary": "Enqueues command buffer execution.", "description": "Executes a command buffer on a device queue.\n No commands will execute until the wait fence has been reached and the\n signal fence will be signaled when all commands have completed.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "attributes": [ { "name": "flags", "type": "HAL_ExecuteFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `commands` `(` $command_buffer `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.execute.indirect", "summary": "Enqueues command buffer execution.", "description": "Executes a command buffer on a device queue with the given binding table.\n No commands will execute until the wait fence has been reached and the\n signal fence will be signaled when all commands have completed.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "command_buffer", "type": "HAL_CommandBuffer" }, { "name": "binding_buffers", "type": "Variadic" }, { "name": "binding_offsets", "type": "Variadic" }, { "name": "binding_lengths", "type": "Variadic" } ], "attributes": [ { "name": "flags", "type": "HAL_ExecuteFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `commands` `(` $command_buffer `)`\n `bindings` `(` `[`\n custom($binding_buffers,\n type($binding_buffers),\n $binding_offsets,\n $binding_lengths)\n `]` `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.fill", "summary": "Fills a buffer with a repeating pattern.", "description": "The target buffer must be visible to the device queue performing the update.\n In most cases the queue affinity should be set to where the target buffer\n will be consumed so that it has a chance of being cached.\n\n Note that individual queue transfer operations have a high overhead and they\n should be batched with other operations in command buffers.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "target_buffer", "type": "HAL_Buffer" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" }, { "name": "pattern", "type": "HAL_FillPatternType" } ], "attributes": [ { "name": "flags", "type": "HAL_FillFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `pattern` `(` $pattern `:` type($pattern) `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.flush", "summary": "Flushes locally-pending submissions to the queue.", "description": "Flushes any locally-pending submissions in the queue.\n When submitting many queue operations this can be used to eagerly flush\n earlier submissions while later ones are still being constructed.\n This may be a no-op.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.read", "summary": "Reads a segment from a file into a device buffer.", "description": "Enqueues a file read operation that streams a segment of the source file\n defined by the source offset and length into the target HAL buffer at the\n specified target offset. The queue affinity should be set to where the\n target buffer will be consumed. The source file must have read permission\n and the target buffer must have transfer-target usage. Read failure will\n result in propagated semaphore failure or device loss.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_file", "type": "HAL_File" }, { "name": "source_offset", "type": "I64" }, { "name": "target_buffer", "type": "HAL_Buffer" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "flags", "type": "HAL_ReadFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `source` `(` $source_file `:` type($source_file) `)`\n `` `[` $source_offset `]`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.update", "summary": "Updates a buffer with the contents of a host buffer.", "description": "The provided host source buffer will be captured and need not remain live or\n unchanged while the operation is queued. The target buffer must be visible\n to the device queue performing the update. In most cases the queue affinity\n should be set to where the target buffer will be consumed so that it has a\n chance of being cached.\n\n Some implementations may have limits on the size of the update or may\n perform poorly if the size is larger than an implementation-defined limit.\n Updates should be kept as small and infrequent as possible.\n\n Note that individual queue transfer operations have a high overhead and they\n should be batched with other operations in command buffers.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_buffer", "type": "Util_BufferType" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "target_buffer", "type": "HAL_Buffer" }, { "name": "target_offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "flags", "type": "HAL_UpdateFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `source` `(` $source_buffer `:` type($source_buffer) `)`\n `` `[` $source_offset `]`\n `target` `(` $target_buffer `:` type($target_buffer) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.queue.write", "summary": "Writes a segment from a device buffer into a file.", "description": "Enqueues a file write operation that streams a segment of the source HAL\n buffer defined by the source offset and length into the target file at the\n specified target offset. The queue affinity should be set to where the\n source buffer was produced. The source buffer must have transfer-source\n usage and the target file must have write permission. Write failure will\n result in propagated semaphore failure or device loss.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_buffer", "type": "HAL_Buffer" }, { "name": "source_offset", "type": "HAL_DeviceSize" }, { "name": "target_file", "type": "HAL_File" }, { "name": "target_offset", "type": "I64" }, { "name": "length", "type": "HAL_DeviceSize" } ], "attributes": [ { "name": "flags", "type": "HAL_WriteFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `source` `(` $source_buffer `:` type($source_buffer) `)`\n `` `[` $source_offset `]`\n `target` `(` $target_file `:` type($target_file) `)`\n `` `[` $target_offset `]`\n `length` `(` $length `)`\n `flags` `(` $flags `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.device.resolve", "summary": "Resolves device handles based on affinity.", "description": "Examples:\n ```\n // Returns a HAL device.\n = hal.device.resolve on(#something) : !hal.device\n // Returns a HAL device, allocator, and (optional) queue affinity.\n = hal.device.resolve on(#something) : !hal.device, !hal.allocator, i64\n // Returns a HAL allocator and (optional) queue affinity.\n = hal.device.resolve on(#something) : !hal.allocator, i64\n // Returns \"any\" device. Should only be used as a fallback.\n = hal.device.resolve : !hal.device\n ```", "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` qualified($affinity)^ `)`)?\n attr-dict `:` type($results)", "hasCustomAssemblyFormat": true }, { "name": "hal.device.switch", "hasCustomAssemblyFormat": 1 }, { "name": "hal.devices.count", "summary": "Returns the number of available devices.", "description": "Returns the total number of available devices registered at runtime.", "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.devices.get", "summary": "Returns the device with the given index.", "description": "Returns the device with the given index in the [0, hal.devices.count) range.\n Devices may be lazily initialized upon first use.", "operands": [ { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "HAL_Device" } ], "assemblyFormat": "$index attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.dispatch.extern", "summary": "A dispatch of workgroups across a 3-dimensional grid.", "description": "Dispatches some number of workgroups across a 3-dimensional grid using a\n function defined externally in one or more referenced objects. Objects are\n declared per executable target and selected automatically during linking\n based on where the dispatch is used. Semantically this is equivalent to\n a `flow.dispatch.workgroups` but with the workgroup region invisible to the\n compiler. See `hal.executable` for more information about object linkage.\n\n Note that since this happens at tensor level the dispatch operation has\n value semantics: some tensors (and optionally other primitive types) are\n consumed and one or more new result tensors are produced. Inside each\n workgroup, however, the input and output tensors are available for arbitrary\n loads and stores. In many cases each workgroup will load some particular\n tile(s) from the input tensors and store some particular tile(s) to the\n output tensors unique to that workgroup. Though it's possible for multiple\n workgroups to load the same regions of the input tensors behavior is\n undefined if multiple workgroups store to the same regions of the output\n tensors. Codegen guarantees this behavior but when sourcing externally\n authored dispatch functions it's critical that this behavior is observed.\n\n Though the representation is similar to the GPU-style grid dispatch model\n here we still have not yet allocated buffers, determined the target device\n for execution, or even completed fully resolving shapes/types/etc. Because\n of this it's important that the workgroup body use the platform-dependent\n primitives for accessing workgroup ID, size, and count intrinsics instead\n of hardcoding them to a particular set of values. Assume that any workgroup\n dispatch may end up being specialized for several different target devices\n and even several different variants for a particular target device\n (differing workgroup sizes, etc). To aid deduplication code producing these\n external dispatches should try not to specialize early for particular shapes\n and instead emit the most generic code possible as having 500 slightly\n different `hal.dispatch.extern` ops pointing at the same object file is\n likely to require 500 copies of the object instead of 500 calls to the same\n object.\n\n Because at this point in the layering devices have not yet been selected the\n workgroup count cannot be fully evaluated. Instead workload parameters are\n captured that are then passed to a function that when later evaluated\n computes the actual workgroup count based on target information. The\n workload is not limited to the 3D XYZ grid dispatch of the workgroup count\n and can contain any number of parameters used to compute it. If workgroup\n size or distribution varies based on the target device a `!hal.device`\n argument can be used by the workgroup count calculation region to factor in\n device parameters. See `hal.device.query` for more information on how to\n query information.\n\n ```mlir\n %r = hal.dispatch.extern \"some_function\"[%c5, %c5](%0, %1)\n : (tensor<5x5xf32>, tensor<5xf32>) -> tensor<5x5xf32>\n ...\n ```\n\n The number of results of the operation is equal to the number of results\n in the type signature (`(tensor<5x5xf32>, tensor<5xf32>) -> tensor<5x5xf32>`).\n Each tensor argument and result in the type signature has a corresponding\n pipeline layout slot and must be declared. If multiple arguments or results\n share the same layout slot they can be aliased using the `bindings`\n attribute and otherwise each is assumed unique.\n\n There are no `arguments` operands for results, but a result can be tied an\n argument by writing the argument operand's SSA value instead of its type:\n E.g., in the above example, `-> %0` would tie the first argument to the\n result. In that case, there would be no separate block argument for the\n result.\n\n Objects for multiple targets can be specified and the ones used are selected\n based on their target and an optional condition region that returns true if\n the variant is valid for use on the provided runtime `!hal.device`. If no\n variants within an executable are valid then loading will fail at runtime.\n If multiple variants are valid the first valid one found will be loaded and\n used for execution.", "operands": [ { "name": "workload", "type": "Variadic" }, { "name": "arguments", "type": "Variadic" }, { "name": "argument_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "export_name", "type": "StrAttr" }, { "name": "layout", "type": "HAL_PipelineLayoutAttr" }, { "name": "targets", "type": "ArrayAttr" }, { "name": "target_ordinals", "type": "TypedArrayAttrBase" }, { "name": "target_objects", "type": "ArrayAttr" }, { "name": "workgroup_size", "type": "OptionalAttr>>" }, { "name": "subgroup_size", "type": "OptionalAttr" }, { "name": "workgroup_local_memory", "type": "OptionalAttr" }, { "name": "tied_operands", "type": "OptionalAttr>" } ], "regions": [ { "name": "workgroup_count", "type": "AnyRegion" }, { "name": "target_regions", "type": "VariadicRegion" } ], "traits": [ { "type": "IsolatedFromAbove" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$export_name\n (`[` $workload^ `]`)? ``\n `(` $arguments `)` `:`\n custom(ref($arguments),\n type($arguments), $argument_dims,\n type($results), $result_dims,\n $tied_operands)\n `count` `` custom($workgroup_count)\n `layout` `(` $layout `)`\n `objects` `(` `{` custom($targets,\n $target_ordinals,\n $target_objects,\n $target_regions) `}` `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.element_type", "summary": "An iree_hal_element_type_t for the given MLIR type.", "description": "Maps an MLIR type to a runtime `iree_hal_element_type_t` value for all types\n that are convertible.", "results": [ { "name": "result", "type": "HAL_ElementType" } ], "attributes": [ { "name": "type", "type": "TypeAttr" } ], "assemblyFormat": "`<` $type `>`\n attr-dict\n `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.encoding_type", "summary": "An iree_hal_encoding_type_t for the given MLIR encoding.", "description": "Maps an MLIR encoding to a runtime `iree_hal_encoding_type_t` value for all\n encodings that are convertible.", "results": [ { "name": "result", "type": "HAL_EncodingType" } ], "attributes": [ { "name": "encoding", "type": "OptionalAttr" } ], "assemblyFormat": "`<` ($encoding^):( `` `dense_row_major`)? `>`\n attr-dict\n `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.ex.file.from_memory", "summary": "Creates a file mapped into a byte range of a host buffer.", "description": "Returns a file handle that is backed by the given `buffer` contents.\n Behavior is undefined if the buffer contents change while the accesses are\n in-flight.\n\n Experimental as the exact interface for getting files from module contents\n still needs iteration. Most hardware APIs require a file descriptor or\n native platform handle but here we only have host pointers. When\n memory-mapped some systems allow for retrieval of the platform handle from\n a virtual address (GetMappedFileNameA/posix_mem_offset) but the APIs are\n sketchy and likely slow. Instead we should probably have a way to query for\n a file handle derived from the calling module by stack-walking and asking\n the VM module for its handle. Until we can figure this out this method will\n be marked experimental.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "buffer", "type": "Util_BufferType" }, { "name": "offset", "type": "HAL_DeviceSize" }, { "name": "length", "type": "HAL_DeviceSize" }, { "name": "flags", "type": "I32" } ], "results": [ { "name": "result", "type": "HAL_File" } ], "attributes": [ { "name": "access", "type": "HAL_MemoryAccessBitfieldAttr{None|Read|Write|Discard|MayAlias|Unaligned|Any}" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `affinity` `(` $queue_affinity `)`\n `access` `(` $access `)`\n `buffer` `(` $buffer `:` type($buffer) `)`\n `` `[` $offset `for` $length `]`\n `flags` `(` $flags `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.ex.shared_device", "summary": "Returns the shared device instance.", "description": "Deprecated operation that returns the shared device instance.", "results": [ { "name": "result", "type": "HAL_Device" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "hal.ex.submit_and_wait", "summary": "Submits a command buffer and waits for completion.", "description": "Deprecated operation that submits a command buffer to the device and waits for its completion.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "command_buffer", "type": "HAL_CommandBuffer" } ], "assemblyFormat": "$device `,` $command_buffer attr-dict" }, { "name": "hal.executable", "summary": "Target-specific executable module.", "description": "An executable module representing a target-specific compiled\n kernel/shader/etc. Executables are treated as independent compilation units\n and may contain multiple exported entry points that are able to share code\n internally. To support multi-targeting each executable may have one or more\n target-specific variants that are lowered independently during compilation\n while still appearing as one executable at runtime (ala fat binaries).\n\n At runtime executables are loaded during module initialization and cached\n for the lifetime of the module. If the `lazy` attribute is set the\n executable _may_ have its loading deferred until first use.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "lazy", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n (`lazy` $lazy^)?\n $sym_name\n attr-dict-with-keyword\n regions", "hasCustomAssemblyFormat": true }, { "name": "hal.executable_end", "summary": "Terminator pseudo-op for the executable op.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.executable_layout.create", "hasCustomAssemblyFormat": 1 }, { "name": "hal.executable_layout.lookup", "hasCustomAssemblyFormat": 1 }, { "name": "hal.executable.binary", "summary": "Compiled executable binary data.", "description": "A compiled executable binary with an optional nested module containing the\n IR prior to serialization (for debugging).", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "format", "type": "StrAttr" }, { "name": "data", "type": "Util_AnySerializableAttr" }, { "name": "mime_type", "type": "OptionalAttr" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.calculate_workgroups", "summary": "Calculates workgroup count from workload for an exported function.", "description": "Calculates the workgroup count (grid XYZ) based on the given workload using\n the workgroup count calculation region of the target\n `hal.executable.export` op.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "workload", "type": "Variadic" } ], "results": [ { "name": "workgroup_x", "type": "HAL_Dim" }, { "name": "workgroup_y", "type": "HAL_Dim" }, { "name": "workgroup_z", "type": "HAL_Dim" } ], "attributes": [ { "name": "entry_point", "type": "SymbolRefAttr" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `target` `(` $entry_point `)`\n (`workload` `(` `[` $workload^ `]` `)`)?\n `:` type($workgroup_x) `,` type($workgroup_y) `,` type($workgroup_z)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.condition", "summary": "Host code to determine if the executable is enabled.", "description": "Variants are selected based on their target and this optional condition\n op that returns true if the variant is valid for use on the provided\n runtime `!hal.device`. If no variants within an executable are valid then\n loading will fail at runtime. If multiple variants are valid the first valid\n one found will be loaded and used for execution.", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "hal.executable.constant.block", "summary": "Executable constant block initializer.", "description": "Initializes one or more constants in the executable constant block by\n returning one value per identified constant. Each constant block is\n evaluated on the host prior to instantiating the executable for a given\n device and allows for the executable to be specialized based on device\n capabilities and limits.\n\n The keys specified are unique per variant and will be deduplicated across\n multiple constant blocks when present. They are only used during lowering\n and will not survive to runtime so they need only have descriptive enough\n names to avoid collisions and represent the semantics of the value.\n\n Constant values can be loaded in the device code with the\n `hal.executable.constant.load` op:\n\n ```mlir\n hal.executable.variant public @target {\n hal.executable.constant.block(%device: !hal.device) -> (i32, i32) as (\"foo\", \"bar\") {\n %0 = hal.device.query<%device> key(\"some.device.prop\")...\n %1 = hal.device.query<%device> key(\"another.device.prop\")...\n hal.return %0, %1 : i32, i32\n }\n builtin.module {\n func @dispatch0() {\n %0 = hal.executable.constant.load \"foo\" : i32\n %1 = hal.executable.constant.load \"bar\" : i32\n return\n }\n }\n }\n ```\n\n Each target backend will implement the constant initialization and access in\n a way compatible with its execution model. Examples:\n - CPU: read-only buffer initialized on load and passed to each dispatch\n - CUDA: read-only buffer initialized on load and passed to each dispatch\n - SPIR-V: specialization constants\n - Metal: function constants\n - WebGPU: pipeline-overridable constants", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "keys", "type": "ArrayAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "hal.executable.constant.load", "summary": "Loads a constant value from the executable constant block.", "description": "Loads a scalar constant value from the static executable constant block.\n The value provided by a constant block with the given key will be loaded and\n bitcast (possibly with truncation or zero-extension) to the result type.\n\n Note that backends are allowed to implement their own mechanisms for\n referencing constant block values and this is provided only as a default for\n those not needing special behavior.", "results": [ { "name": "result", "type": "HAL_PrimitiveType" } ], "attributes": [ { "name": "key", "type": "StrAttr" } ], "assemblyFormat": "$key attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.create", "summary": "Creates an executable.", "description": "Creates a target-dependent executable cached on the provided device. Entry\n points contained within the executable can be dispatched using the resulting\n executable handle.\n\n Depending on the driver creation may take a non-trivial amount of time\n (such as when JITing/etc). As the cache is internally synchronized callers\n can issue preparation requests from multiple threads - even for the same\n executables - and calls will block until preparation completes.\n\n Optional constants provide for specialization of the executable based on\n runtime-derived parameters.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "constants", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HAL_Executable" } ], "attributes": [ { "name": "executable_target", "type": "SymbolRefAttr" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `affinity` `(` $queue_affinity `)`\n `target` `(` $executable_target `)`\n (`constants` `(` `[` $constants^ `]` `)`)?\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.entry_point", "hasCustomAssemblyFormat": 1 }, { "name": "hal.executable.export", "summary": "Executable entry point declaration.", "description": "An entry point exported by the executable with statically-available\n information describing the IO interface it uses and other dispatch metadata.\n\n The `workgroup_count` region represents the computation that\n returns the number of workgroups to use in the 3D grid dispatch.\n The arguments to the region represents the workload as captured by each\n dispatch. It returns the number of workgroups along x, y, and z.\n\n The optional `condition` region provides boolean logic determining whether\n the export should be dispatched given the device and workload or if a\n specified fallback export in the same executable should be dispatched\n instead. Multiple exports can be chained together as fallbacks to allow for\n arbitrarily complex decisions trees. Fallbacks for an export must match the\n layout and workload exactly but may vary any other attribute (such as\n workgroup size or translation configuration).\n\n Workgroup count and condition regions that have dependencies on dynamic\n workload information will be executed using indirect dispatch. If the\n information is available on the host at the time a command buffer containing\n the dispatch is available the indirect dispatch _may_ have lower overhead\n by using `IREE_HAL_DISPATCH_FLAG_STATIC_INDIRECT_PARAMETERS`. If the\n information required is data-dependent on work within the same command\n buffer some backends will suffer a performance penalty. Condition regions\n consuming dynamic workloads in particular may result in long chains of\n indirect dispatches sent to the device or even host round-trips.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "ordinal", "type": "OptionalAttr" }, { "name": "layout", "type": "HAL_PipelineLayoutAttr" }, { "name": "condition_fallback", "type": "OptionalAttr" }, { "name": "workgroup_size", "type": "OptionalAttr>>" }, { "name": "subgroup_size", "type": "OptionalAttr" }, { "name": "workgroup_local_memory", "type": "OptionalAttr" }, { "name": "source_locs", "type": "OptionalAttr" } ], "regions": [ { "name": "workgroup_count", "type": "AnyRegion" }, { "name": "condition", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n (`ordinal` `(` $ordinal^ `)`)?\n `layout` `(` qualified($layout) `)`\n (`condition` `` custom($condition)^)?\n (`fallback` `(` $condition_fallback^ `)`)?\n (`count` `` custom($workgroup_count)^)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.export.ordinal", "summary": "Executable export ordinal lookup pseudo-op.", "description": "Resolves an executable export ordinal to a value once ordinals have been\n assigned.", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "entry_point", "type": "SymbolRefAttr" } ], "assemblyFormat": "`target` `(` $entry_point `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.lookup", "summary": "Executable cache lookup pseudo-op.", "description": "Used during conversion to provide a placeholder for a globally cached and\n possibly lazy-initialized executable.", "operands": [ { "name": "device", "type": "HAL_Device" } ], "results": [ { "name": "result", "type": "HAL_Executable" } ], "attributes": [ { "name": "executable", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `executable` `(` $executable `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.lookup.function", "summary": "Executable function lookup pseudo-op.", "description": "Resolves an executable export name to a runtime function id. The result is\n only meaningful for the executable operand and must be treated as opaque by\n compiler IR. The function reference is retained as a SymbolRefAttr so\n executable linking passes can rewrite it, but it may intentionally stop\n resolving after executable serialization strips the original export\n declarations.", "operands": [ { "name": "executable", "type": "HAL_Executable" } ], "results": [ { "name": "result", "type": "HAL_FunctionId" } ], "attributes": [ { "name": "entry_point", "type": "SymbolRefAttr" } ], "assemblyFormat": "`target` `(` $executable `:` type($executable) `)`\n `function` `(` $entry_point `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.source", "summary": "Generic source contents of an executable op.", "description": "This is an unspecialized source representation of an executable\n module without an assigned target. This is useful for hand-authoring\n executables prior to device specification.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "objects", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n attr-dict-with-keyword\n $body", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.source_end", "summary": "Terminator pseudo-op for the executable source op.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.variant", "summary": "Target-specific variant of an executable op.", "description": "The target IR for the executable. This can be preserved for debugging but\n is usually removed during transformation.\n\n Variants are selected based on their target and an optional condition\n op that returns true if the variant is valid for use on the provided\n runtime `!hal.device`. If no variants within an executable are valid then\n loading will fail at runtime. If multiple variants are valid the first valid\n one found will be loaded and used for execution.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "target", "type": "HAL_ExecutableTargetAttr" }, { "name": "objects", "type": "OptionalAttr>" }, { "name": "sources", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n `target` `(` $target `)`\n (`objects` `(` $objects^ `)` )?\n (`sources` `(` $sources^ `)` )?\n attr-dict-with-keyword\n $body", "hasCustomAssemblyFormat": true }, { "name": "hal.executable.variant_end", "summary": "Terminator pseudo-op for the executable variant op.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.fence.await", "summary": "Asynchronous fence wait operation.", "description": "Yields the caller until all fences is reached. Returns the `status` of the\n fence after the wait, with a non-zero value indicating failure.", "operands": [ { "name": "timeout_millis", "type": "I32" }, { "name": "fences", "type": "Variadic" } ], "results": [ { "name": "status", "type": "Util_Status" } ], "attributes": [ { "name": "flags", "type": "HAL_WaitFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`until` `(` `[` $fences `]` `)`\n `timeout_millis` `(` $timeout_millis `)`\n `flags` `(` $flags `)`\n `:` type($status)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.fence.create", "summary": "Creates an unsignaled fence.", "description": "Returns a fence that defines a point in time. By default fences will remain\n unsignaled unless they are explicitly signaled with `hal.fence.signal` or\n asynchronously signaled by the device by passing them as an operand to\n queue submission ops.", "operands": [ { "name": "device", "type": "HAL_Device" } ], "results": [ { "name": "result", "type": "HAL_Fence" } ], "attributes": [ { "name": "flags", "type": "HAL_FenceFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`device` `(` $device `:` type($device) `)`\n `flags` `(` $flags `)`\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.fence.fail", "summary": "Fence failure operation.", "description": "Signals the fence with a failure. The `status` will be returned from\n each timepoint semaphores `hal.semaphore.query` and `hal.semaphore.signal`\n for the lifetime of each semaphore.", "operands": [ { "name": "fence", "type": "HAL_Fence" }, { "name": "status", "type": "Util_Status" } ], "assemblyFormat": "`<` $fence `:` type($fence) `>`\n `status` `(` $status `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.fence.join", "summary": "Creates a fence from the given timepoints.", "description": "Returns a fence that joins the input fences as a wait-all operation.", "operands": [ { "name": "fences", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HAL_Fence" } ], "attributes": [ { "name": "flags", "type": "HAL_FenceFlagBitfieldAttr{None|Reserved}" } ], "assemblyFormat": "`at` `(` `[` $fences `]` `)`\n `flags` `(` $flags `)`\n `->` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.fence.query", "summary": "Fence query operation.", "description": "Queries whether the fence has been reached and its status.\n Returns OK if the fence has been signaled successfully, DEFERRED if it is\n unsignaled, and otherwise an error indicating the failure.", "operands": [ { "name": "fence", "type": "HAL_Fence" } ], "results": [ { "name": "status", "type": "Util_Status" } ], "assemblyFormat": "`<` $fence `:` type($fence) `>`\n `:` type($status)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.fence.signal", "summary": "Fence signal operation.", "description": "Signals the fence to indicate that the timepoints contained have been\n reached. Waiting work may begin immediately.", "operands": [ { "name": "fence", "type": "HAL_Fence" } ], "assemblyFormat": "`<` $fence `:` type($fence) `>`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.instrument.memory.load", "summary": "Emits a memory load instrumentation event.", "description": "Emits a workgroup-specific memory load event indicating that a number of\n bytes from the given resolved pointer have been loaded by the workgroup.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "workgroupKey", "type": "Index" }, { "name": "loadValue", "type": "AnyType" }, { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['loadValue', 'result']>" } ], "assemblyFormat": "`` `[` $buffer `:` type($buffer) `for` $workgroupKey `]`\n $base `[` $indices `]` `,` $loadValue\n attr-dict `:` type($base) `,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.instrument.memory.store", "summary": "Emits a memory store instrumentation event.", "description": "Emits a workgroup-specific memory store event indicating that a number of\n bytes have been stored to the given resolved pointer by the workgroup.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "workgroupKey", "type": "Index" }, { "name": "storeValue", "type": "AnyType" }, { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['storeValue', 'result']>" } ], "assemblyFormat": "`` `[` $buffer `:` type($buffer) `for` $workgroupKey `]`\n $base `[` $indices `]` `,` $storeValue\n attr-dict `:` type($base) `,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.instrument.print", "summary": "Emits a human-readable printf-style string event.", "description": "Formats a string using a limited subset of printf format specifiers and the\n provided values and then emits an `iree_instrument_dispatch_print_t` event. Final\n formatted string lengths may be limited to as much as 1024 characters and\n should be kept as small as possible to avoid easily exceeding the\n instrumentation storage buffers with redundant strings.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "workgroupKey", "type": "Index" }, { "name": "values", "type": "Variadic" } ], "attributes": [ { "name": "format", "type": "StrAttr" } ], "assemblyFormat": "`` `[` $buffer `:` type($buffer) `for` $workgroupKey `]`\n $format (`*` `(` $values^ `:` type($values) `)`)?\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.instrument.value", "summary": "Emits a scalar value instrumentation event.", "description": "Emits a workgroup-specific typed value with the given workgroup-relative\n ordinal.\n\n This op will be preserved even if the output is not used as it is only for\n debugging purposes.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "workgroupKey", "type": "Index" }, { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "ordinal", "type": "AnyI8Attr" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "`` `[` $buffer `:` type($buffer) `for` $workgroupKey `]`\n $ordinal `=` $operand attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "hal.instrument.workgroup", "summary": "Emits a dispatch workgroup instrumentation event.", "description": "Emits an `iree_instrument_dispatch_workgroup_t` event into the\n instrumentation stream. The workgroup event identifies the unique dispatch,\n its workgroup count, and the ID of the emitting workgroup within the\n dispatch. Optionally targets that support querying the processor ID\n executing the workgroup can attach that information for tracking purposes.\n\n On targets such as CPUs where entire workgroups execute as atomic units\n only one workgroup event should be emitted. On targets such as GPUs where\n there may be multiple invocations executing as part of a single workgroup\n only the first invocation within the workgroup should emit the workgroup\n event (by checking if the LocalInvocationIndex or threadIdx == 0, etc).\n\n The resulting workgroup key is used by subsequent workgroup-specific\n instrumentation events.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "dispatchId", "type": "I32" } ], "results": [ { "name": "workgroupKey", "type": "Index" } ], "assemblyFormat": "`` `[` $buffer `:` type($buffer) `]`\n `dispatch` `(` $dispatchId `)`\n attr-dict `:` type($workgroupKey)", "hasCustomAssemblyFormat": true }, { "name": "hal.interface", "hasCustomAssemblyFormat": 1 }, { "name": "hal.interface.binding", "hasCustomAssemblyFormat": 1 }, { "name": "hal.interface.binding.subspan", "summary": "Returns an alias to a subspan of interface binding data.", "description": "Returns a subspan of an interface binding storage buffer in a generic type.\n The exact shape, type, and alignment of the returned type are defined by\n the result type (tensor, memref, etc).\n\n An optional alignment indicates the byte alignment of the base binding\n resource. Note that the byte offset is added to the base and the alignment\n will be the minimum of the two.", "operands": [ { "name": "byte_offset", "type": "Optional" }, { "name": "dynamic_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "layout", "type": "HAL_PipelineLayoutAttr" }, { "name": "binding", "type": "IndexAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "descriptor_flags", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`layout` `(` $layout `)`\n `binding` `(` $binding `)`\n (`alignment` `(` $alignment^ `)`)?\n (`offset` `(` $byte_offset^ `)`)?\n (`flags` `(` $descriptor_flags^ `)`)?\n attr-dict `:` type($result) (`{` $dynamic_dims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "hal.interface.constant.load", "summary": "Loads a constant value from the interface constant block.", "description": "Loads a scalar constant value from an executable IO push constant block.\n The value will be loaded from the given constant offset and will be\n bitcast (possibly with truncation or zero-extension) to the result type.\n\n An optional alignment indicates the byte alignment of potential values for\n the constant when it could be determined from analysis. If omitted the value\n may be anything and its interpretation is up to the usage. This is intended\n to provide pointer alignment-like semantics to constants that are used to\n index into binding resources.\n\n An optional set of values indicates all possible values that can be passed\n to the constant from all dispatch sites in the program. If omitted the value\n may be from an unanalyzable source (outside of the program, indirect, etc)\n and must be assumed to have any value.", "results": [ { "name": "result", "type": "HAL_PrimitiveType" } ], "attributes": [ { "name": "layout", "type": "HAL_PipelineLayoutAttr" }, { "name": "ordinal", "type": "HAL_HostSizeAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "values", "type": "OptionalAttr" } ], "assemblyFormat": "`layout` `(` $layout `)`\n `ordinal` `(` $ordinal `)`\n (`alignment` `(` $alignment^ `)`)?\n (`values` `(` $values^ `)`)?\n attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.interface.workgroup.count", "summary": "Returns the total workgroup count of the grid.", "description": "The total number of workgroups along each dimension in the dispatch grid.\n Matches what was passed to the `hal.command_buffer.dispatch` command (or\n what was indirectly specified).\n\n Corresponds to the `NumWorkgroups` SPIR-V built-in and the `gridDim` CUDA\n built-in variable.\n\n ```mlir\n %x = hal.interface.workgroup.count[0] : index\n %y = hal.interface.workgroup.count[1] : index\n %z = hal.interface.workgroup.count[2] : index\n ```", "results": [ { "name": "result", "type": "HAL_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "`[` $dimension `]` (`upper_bound` $upper_bound^)? attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.interface.workgroup.id", "summary": "Returns the index of the current workgroup in the grid.", "description": "The global workgroup ID of the current tile in the range of\n `[0, hal.interface.workgroup.count)` along each XYZ dimension.\n\n Corresponds to the `WorkgroupId` SPIR-V built-in and the `blockIdx` CUDA\n built-in variable.\n\n ```mlir\n %x = hal.interface.workgroup.id[0] : index\n %y = hal.interface.workgroup.id[1] : index\n %z = hal.interface.workgroup.id[2] : index\n ```", "results": [ { "name": "result", "type": "HAL_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "`[` $dimension `]` (`upper_bound` $upper_bound^)? attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.interface.workgroup.size", "summary": "Returns the size of each workgroup in invocations.", "description": "The number of local invocations within the current workgroup along each\n dimension. Depending on backend this may map to the SIMT thread count or\n inner loop nest parameters.\n\n Corresponds to the `WorkgroupSize` SPIR-V built-in and the `blockDim` CUDA\n built-in variable.\n\n ```mlir\n %x = hal.interface.workgroup.size[0] : index\n %y = hal.interface.workgroup.size[1] : index\n %z = hal.interface.workgroup.size[2] : index\n ```", "results": [ { "name": "result", "type": "HAL_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "assemblyFormat": "`[` $dimension `]` (`upper_bound` $upper_bound^)? attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.memory_type", "summary": "An iree_hal_memory_type_t for the given memory type bits.", "description": "Maps memory type bits to a runtime `iree_hal_memory_type_t` value.", "results": [ { "name": "result", "type": "HAL_MemoryType" } ], "attributes": [ { "name": "type", "type": "HAL_MemoryTypeBitfieldAttr{None|Optimal|HostVisible|HostCoherent|HostCached|HostLocal|DeviceVisible|DeviceLocal}" } ], "assemblyFormat": "`<` $type `>`\n attr-dict\n `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "hal.return", "summary": "Return from a hal.* region.", "description": "Returns the given values from the region and back to the host code.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "($operands^ `:` type($operands))? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.tensor.alias", "summary": "Hints that tensor storage should alias a HAL buffer view.", "description": "Hints that the backing storage of an entire tensor aliases the given storage\n buffer. There's no guarantee that the storage will alias and instead only\n that the tensor contents will be written to the storage as if a copy had\n occurred. This allows the compiler to avoid copies in the ideal case of a\n producer that is able to produce directly into the target storage but still\n handle cases where the producer is not able to be in-place.\n\n The storage buffer provided must have sufficient space for the tensor once\n encoded. Dynamically shaped tensors may not consume the entire provided\n storage. If a buffer view is provided the metadata is ignored and only the\n backing buffer is used.\n\n An optional wait fence can be provided in cases where the storage is not\n immediately available. Producers that may alias the storage will wait until\n the storage is available before updating the contents.\n\n Explicit aliasing side-steps any analysis that may be performed by the\n compiler and requires users to guarantee that the safety of the aliasing.\n Copy-on-write, alias analysis for overlap detection, and ordering via\n use-def chains are all ignorant of the aliased buffer memory and only ensure\n the compiler consumes or produces the aliased memory consistent with itself.\n\n Example:\n ```mlir\n %init = tensor.empty\n %value = linalg.generic ... outs(%init)\n %aliased = hal.tensor.alias %value : tensor<...> to %buffer : !hal.buffer\n ... linalg.generic ins(%aliased) ...\n ```", "operands": [ { "name": "source", "type": "AnyTensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "storage", "type": "AnyTypeOf<[HAL_Buffer, HAL_BufferView]>" }, { "name": "wait_fence", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`wait` `(` $wait_fence^ `)` `=` `` `>`)?\n $source `:` type($source) (`{` $source_dims^ `}`)?\n `to`\n $storage `:` type($storage)\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.tensor.barrier", "summary": "Signals a fence when all tensors are available.", "description": "Defines a barrier that is used to indicate availability of an entire set of\n tensors by signaling a fence. The source tensors are returned for chaining.", "operands": [ { "name": "sources", "type": "Variadic" }, { "name": "signal_fence", "type": "HAL_Fence" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AllTypesMatch<['sources', 'results']>" } ], "assemblyFormat": "`join` `` `(` $sources `:` type($sources) `)`\n `=` `` `>`\n $signal_fence `:` type($signal_fence)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "hal.tensor.cast", "hasCustomAssemblyFormat": 1 }, { "name": "hal.tensor.export", "summary": "Exports a tensor to a HAL buffer view.", "description": "Defines an export of an SSA-form tensor to an external HAL buffer view.\n\n The provided `source_encoding`, if different from the `source` type,\n indicates that the ABI-facing type may differ from the internal\n representation. The types must be bitcastable (same storage size) and\n dynamically shaped values must have the same number of dynamic dimensions.\n This allows for casting between rank-0 and rank-N types, different element\n types, etc.", "operands": [ { "name": "source", "type": "AnyTensor" }, { "name": "source_dims", "type": "Variadic" } ], "results": [ { "name": "target", "type": "AnyTypeOf<[HAL_Buffer, HAL_BufferView]>" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source\n ($name^)?\n `:`\n custom($source_encoding, type($source)) (`{` $source_dims^ `}`)?\n `->`\n type($target)\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.tensor.import", "summary": "Imports a tensor from a HAL buffer view.", "description": "Defines an import of an external HAL buffer view into a SSA-form tensor.\n An optional fence can be specified indicating when the buffer view is\n available for use. If no fence is provided it is assumed the buffer view is\n immediately available.\n\n The provided `target_encoding`, if different from the `target` type,\n indicates that the ABI-facing type may differ from the internal\n representation. The types must be bitcastable (same storage size) and\n dynamically shaped values must have the same number of dynamic dimensions.\n This allows for casting between rank-0 and rank-N types, different element\n types, etc.\n\n `consume` can be used to indicate a transfer of ownership. Though the\n imported value may still have external references when consumed a resource\n will be conceptually released from its existing owner and retained by the\n importer atomically.", "operands": [ { "name": "source", "type": "AnyTypeOf<[HAL_Buffer, HAL_BufferView]>" }, { "name": "target_dims", "type": "Variadic" }, { "name": "wait_fence", "type": "Optional" }, { "name": "byte_offset", "type": "Optional" } ], "results": [ { "name": "target", "type": "AnyTensor" } ], "attributes": [ { "name": "target_encoding", "type": "TypeAttr" }, { "name": "consume", "type": "UnitAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`wait` `(` $wait_fence^ `)` `=` `` `>`)?\n (`consume` $consume^)?\n $source\n (`offset` `(` $byte_offset^ `)`)?\n ($name^)?\n `:` type($source) `->`\n custom($target_encoding, type($target)) (`{` $target_dims^ `}`)?\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "hal.tensor.transients", "summary": "Annotates a tensor to use transient storage from a provided buffer.", "description": "Annotates that any transient memory used in the production of the given\n tensor should be suballocated from the provided storage buffer. This allows\n users to control transient allocations by providing their own storage,\n enabling zero-allocation execution in steady state.\n\n The storage buffer provided must have sufficient space for all transient\n allocations required to produce the tensor. Unless otherwise overridden the\n compiler will verify that all allocation sizes are computable and generate\n size query functions to allow users to query the required buffer size. If\n size checks are disabled then the user must ensure they pass in a buffer\n with sufficient capacity.\n\n The storage buffer is assumed to be immediately usable (i.e., any previous\n work using it has completed). Users must ensure proper synchronization if\n reusing storage across multiple operations. Future work may add explicit\n wait semantics to enable pipelining, but for now synchronization is the\n caller's responsibility.\n\n This operation preserves SSA use-def chains by returning the same tensor\n value it receives. It exists purely for annotation purposes and will be\n lowered away during compilation.\n\n Example:\n ```mlir\n %result = some.operation(%input) : tensor\n %annotated = hal.tensor.transients %result : tensor{%dim} from %storage : !hal.buffer\n ```", "operands": [ { "name": "source", "type": "AnyTensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "storage", "type": "AnyTypeOf<[HAL_Buffer, HAL_BufferView]>" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:` type($source) (`{` $source_dims^ `}`)?\n `from`\n $storage `:` type($storage)\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "ifrt.After", "summary": "Get a control handle for array materialization.", "description": "When depending on the `control_output`, the op will be not be scheduled\n until all `inputs` are materialized. For example, this could mean the data\n transfer is completed from a `Reshard` op.\n\n Moreover, this op provides fine-grained control dependency on `CallOp`'s\n result. Consider\n %0, %1, %ctrl_0 = \"ifrt.Call\" @callee() ...\n The following 3 control handles may resolve at difference time instances:\n \"ifrt.After\"(%0)\n \"ifrt.After\"(%1)\n %ctrl_0", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "control_output", "type": "Ifrt_ControlType" } ] }, { "name": "ifrt.Assemble", "summary": "Assembles single device arrays to a sharded array", "description": "Builds a larger array out of individual per-device arrays.\n\n On each device, the local shard of the result array is the input array.\n Thus, in an efficient implementation, no buffer transfer is needed.\n\n The inputs' `device` parameter must have size 1. They should be distinct and\n combine to the output's `device` list.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Ifrt_ArrayType" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $inputs `)` oilist(`after` $control_inputs) attr-dict\n `:` functional-type($inputs, $output)" }, { "name": "ifrt.BitcastArrays", "summary": "Bitcasts `Array`s to new `Array`s with a different type.", "description": "A metadata-only op that can change the per-shard interpretation without\n changing the per-sharding location. The new arrays must use the same\n devices, have the same on-device size, and have the same memory kind.\n\n The `dtype`, `shape`, `sharding`, and `layout` of the new arrays might be\n different from the input arrays.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "attributes": [ { "name": "donated", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $inputs `)` oilist(`after` $control_inputs) attr-dict\n `:` functional-type($inputs, $outputs)" }, { "name": "ifrt.Call", "summary": "Call some function on a set of devices", "description": "The callee is a global FuncOp to be sharded onto the given set of devices.\n It's up to the IFRT implementation to define which dialects are legal in the\n callee.\n\n The callee's inputs/outputs should be regular tensors, the shape of which\n are the same as inputs/outputs' global shape, correspondingly. Every\n input/output of the callee must have a `ifrt.sharding` attribute matching\n that on the corresponding input/output of this CallOp.\n\n The callee doesn't specify the device placement. It's specified at the\n `devices` attribute of this CallOp. Every input/output must be placed on\n a subset of these devices.\n\n `io_aliases` represents pairs of inputs and outputs, where the input buffer\n may be aliased and used as the output buffer. The aliased pair must have the\n same byte size. It's up to IFRT implementations whether to respect this\n hint or not. Alternatively, if the index of an input is In\n `donated_input_indices` then the input buffer might be donated to the\n callee if an output with the same byte size is found.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "callee", "type": "SymbolRefAttr" }, { "name": "devices", "type": "Ifrt_DevicesAttr" }, { "name": "io_aliases", "type": "DefaultValuedAttr ]>>, {}>" }, { "name": "donated_input_indices", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee `(` $inputs `)` oilist(`after` $control_inputs)\n `on` `devices` $devices attr-dict `:` functional-type($inputs, $outputs)" }, { "name": "ifrt.CallLoadedExecutable", "summary": "Call some loaded executable", "description": "The callee is a LoadedExecutableOp that declares the signature of the\n LoadedExecutable. The actual LoadedExecutable instance is bound through\n CompileOptions.\n\n The callee is placed on devices because it's loaded. Every input/output must\n be placed on a subset of these devices.\n\n `io_aliases` represents pairs of inputs and outputs, where the input buffer\n may be aliased and used as the output buffer. The aliased pair must have the\n same byte size. It's up to IFRT implementations whether to respect this\n hint or not. Alternatively, if the index of an input is In\n `donated_input_indices` then the input buffer might be donated to the\n callee if an output with the same byte size is found.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "callee", "type": "SymbolRefAttr" }, { "name": "io_aliases", "type": "DefaultValuedAttr ]>>, {}>" }, { "name": "donated_input_indices", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee `(` $inputs `)` oilist(`after` $control_inputs) attr-dict\n `:` functional-type($inputs, $outputs)" }, { "name": "ifrt.CopyArrays", "summary": "Copies arrays to a new set of devices", "description": "Copies the input arrays to the output arrays.\n\n This op requires that all input arrays have use the same devices and memory\n kind, and all the output arrays use the same devices and memory kind. Note\n that the devices and memory kind used by the input and output arrays might\n not be the same. Moreover, the corresponding output array of an input array\n must have the same sharding as the op can not reshard.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "attributes": [ { "name": "donated", "type": "DefaultValuedOptionalAttr" }, { "name": "reuse", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $inputs `)` oilist(`after` $control_inputs) attr-dict\n `:` functional-type($inputs, $outputs)" }, { "name": "ifrt.Disassemble", "summary": "Disassembles a sharded array to single device arrays", "description": "Breaks an array up into per-device arrays.\n\n On each device, the result array is its local shard in the input array.\n Thus, in an efficient implementation, no buffer transfer is needed.\n\n The outputs' `devices` parameter must have size 1. They should be distinct\n and combine to the input's `devices` list.", "operands": [ { "name": "input", "type": "Ifrt_ArrayType" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "assemblyFormat": "`(` $input `)` oilist(`after` $control_inputs) attr-dict\n `:` functional-type($input, $outputs)" }, { "name": "ifrt.LoadedExecutable", "summary": "Declare a loaded executable", "description": "The inputs/outputs of `function_type` should be IFRT arrays. They should be\n placed on a subset of the `devices`.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "devices", "type": "Ifrt_DevicesAttr" } ], "assemblyFormat": "$sym_name `on` `devices` $devices attr-dict `:` $function_type" }, { "name": "ifrt.RemapArrays", "summary": "Remaps shards from input `Array`s to create new `Array`s.", "description": "A metadata-only op that remaps shards across input `Array`s to create\n new `Array`s based on a plan remapping array shards. The op can shuffle\n or extract input array shards without causing a data copy or transfer. It\n must meet the following requirements:\n - All input/output `Array`s must have the same `DType` and per-shard shape.\n - An input shard can be used at most once.\n - Every output shard must have exactly one input shard mapped.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "attributes": [ { "name": "mappings", "type": "TypedArrayAttrBase" }, { "name": "donated", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $inputs `)` `mappings` `=` $mappings oilist(`after` $control_inputs)\n attr-dict `:` functional-type($inputs, $outputs)" }, { "name": "ifrt.Reshard", "summary": "Reshards a sequence of host tensors or device arrays", "description": "Copies the host tensors or device arrays to a new sharding.\n\n The corresponding output of each input must have the same global shape\n as the input.\n\n An input and its corresponding output are allowed to have the same sharding\n and devices. In this case, this ReshardOp will have no transfer across\n devices.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Ifrt_ControlType" } ], "attributes": [ { "name": "donated", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $inputs `)` oilist(`after` $control_inputs) attr-dict\n `:` functional-type($inputs, $outputs)" }, { "name": "index.add", "summary": "index addition", "description": "The `index.add` operation takes two index values and computes their sum.\n\n Example:\n\n ```mlir\n // c = a + b\n %c = index.add %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.and", "summary": "index bitwise and", "description": "The `index.and` operation takes two index values and computes their bitwise\n and.\n\n Example:\n\n ```mlir\n // c = a & b\n %c = index.and %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.bool.constant", "summary": "boolean constant", "description": "The `index.bool.constant` operation produces an bool-typed SSA value equal\n to either `true` or `false`.\n\n This operation is used to materialize bool constants that arise when folding\n `index.cmp`.\n\n Example:\n\n ```mlir\n %0 = index.bool.constant true\n ```", "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "value", "type": "BoolAttr" } ], "assemblyFormat": "attr-dict $value" }, { "name": "index.casts", "summary": "index signed cast", "description": "The `index.casts` operation enables conversions between values of index type\n and concrete fixed-width integer types. If casting to a wider integer, the\n value is sign-extended. If casting to a narrower integer, the value is\n truncated.\n\n Example:\n\n ```mlir\n // Cast to i32\n %0 = index.casts %a : index to i32\n\n // Cast from i64\n %1 = index.casts %b : i64 to index\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[AnyInteger, Index]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[AnyInteger, Index]>" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($output)" }, { "name": "index.castu", "summary": "index unsigned cast", "description": "The `index.castu` operation enables conversions between values of index type\n and concrete fixed-width integer types. If casting to a wider integer, the\n value is zero-extended. If casting to a narrower integer, the value is\n truncated.\n\n Example:\n\n ```mlir\n // Cast to i32\n %0 = index.castu %a : index to i32\n\n // Cast from i64\n %1 = index.castu %b : i64 to index\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[AnyInteger, Index]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[AnyInteger, Index]>" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($output)" }, { "name": "index.ceildivs", "summary": "index signed ceil division", "description": "The `index.ceildivs` operation takes two index values and computes their\n signed quotient. Treats the leading bit as the sign and rounds towards\n positive infinity, i.e. `7 / -2 = -3`.\n\n Note: division by zero and signed division overflow are undefined behaviour.\n\n Example:\n\n ```mlir\n // c = ceil(a / b)\n %c = index.ceildivs %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.ceildivu", "summary": "index unsigned ceil division", "description": "The `index.ceildivu` operation takes two index values and computes their\n unsigned quotient. Treats the leading bit as the most significant and rounds\n towards positive infinity, i.e. `6 / -2 = 1`.\n\n Note: division by zero is undefined behaviour.\n\n Example:\n\n ```mlir\n // c = ceil(a / b)\n %c = index.ceildivu %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.cmp", "summary": "index compare", "description": "The `index.cmp` operation takes two index values and compares them according\n to the comparison predicate and returns an `i1`. The following comparisons\n are supported:\n\n - `eq`: equal\n - `ne`: not equal\n - `slt`: signed less than\n - `sle`: signed less than or equal\n - `sgt`: signed greater than\n - `sge`: signed greater than or equal\n - `ult`: unsigned less than\n - `ule`: unsigned less than or equal\n - `ugt`: unsigned greater than\n - `uge`: unsigned greater than or equal\n\n The result is `1` if the comparison is true and `0` otherwise.\n\n Example:\n\n ```mlir\n // Signed less than comparison.\n %0 = index.cmp slt(%a, %b)\n\n // Unsigned greater than or equal comparison.\n %1 = index.cmp uge(%a, %b)\n\n // Not equal comparison.\n %2 = index.cmp ne(%a, %b)\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "pred", "type": "IndexCmpPredicateAttr{eq|ne|slt|sle|sgt|sge|ult|ule|ugt|uge}" } ], "assemblyFormat": "$pred `(` $lhs `,` $rhs `)` attr-dict" }, { "name": "index.constant", "summary": "index constant", "description": "The `index.constant` operation produces an index-typed SSA value equal to\n some index-typed integer constant.\n\n Example:\n\n ```mlir\n %0 = index.constant 42\n ```", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "value", "type": "IndexAttr" } ], "assemblyFormat": "attr-dict $value" }, { "name": "index.divs", "summary": "index signed division", "description": "The `index.divs` operation takes two index values and computes their signed\n quotient. Treats the leading bit as the sign and rounds towards zero, i.e.\n `6 / -2 = -3`.\n\n Note: division by zero and signed division overflow are undefined behaviour.\n\n Example:\n\n ```mlir\n // c = a / b\n %c = index.divs %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.divu", "summary": "index unsigned division", "description": "The `index.divu` operation takes two index values and computes their\n unsigned quotient. Treats the leading bit as the most significant and rounds\n towards zero, i.e. `6 / -2 = 0`.\n\n Note: division by zero is undefined behaviour.\n\n Example:\n\n ```mlir\n // c = a / b\n %c = index.divu %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.floordivs", "summary": "index signed floor division", "description": "The `index.floordivs` operation takes two index values and computes their\n signed quotient. Treats the leading bit as the sign and rounds towards\n negative infinity, i.e. `5 / -2 = -3`.\n\n Note: division by zero and signed division overflow are undefined behaviour.\n\n Example:\n\n ```mlir\n // c = floor(a / b)\n %c = index.floordivs %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.maxs", "summary": "index signed maximum", "description": "The `index.maxs` operation takes two index values and computes their signed\n maximum value. Treats the leading bit as the sign, i.e. `max(-2, 6) = 6`.\n\n Example:\n\n ```mlir\n // c = max(a, b)\n %c = index.maxs %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.maxu", "summary": "index unsigned maximum", "description": "The `index.maxu` operation takes two index values and computes their\n unsigned maximum value. Treats the leading bit as the most significant, i.e.\n `max(15, 6) = 15` or `max(-2, 6) = -2`.\n\n Example:\n\n ```mlir\n // c = max(a, b)\n %c = index.maxu %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.mins", "summary": "index signed minimum", "description": "The `index.mins` operation takes two index values and computes their signed\n minimum value. Treats the leading bit as the sign, i.e. `min(-2, 6) = -2`.\n\n Example:\n\n ```mlir\n // c = min(a, b)\n %c = index.mins %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.minu", "summary": "index unsigned minimum", "description": "The `index.minu` operation takes two index values and computes their\n unsigned minimum value. Treats the leading bit as the most significant, i.e.\n `min(15, 6) = 6` or `min(-2, 6) = 6`.\n\n Example:\n\n ```mlir\n // c = min(a, b)\n %c = index.minu %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.mul", "summary": "index multiplication", "description": "The `index.mul` operation takes two index values and computes their product.\n\n Example:\n\n ```mlir\n // c = a * b\n %c = index.mul %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.or", "summary": "index bitwise or", "description": "The `index.or` operation takes two index values and computes their bitwise\n or.\n\n Example:\n\n ```mlir\n // c = a | b\n %c = index.or %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.rems", "summary": "index signed remainder", "description": "The `index.rems` operation takes two index values and computes their signed\n remainder. Treats the leading bit as the sign, i.e. `6 % -2 = 0`.\n\n Example:\n\n ```mlir\n // c = a % b\n %c = index.rems %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.remu", "summary": "index unsigned remainder", "description": "The `index.remu` operation takes two index values and computes their\n unsigned remainder. Treats the leading bit as the most significant, i.e.\n `6 % -2 = 6`.\n\n Example:\n\n ```mlir\n // c = a % b\n %c = index.remu %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.shl", "summary": "index shift left", "description": "The `index.shl` operation shifts an index value to the left by a variable\n amount. The low order bits are filled with zeroes. The RHS operand is always\n treated as unsigned. If the RHS operand is equal to or greater than the\n index bitwidth, the result is a poison value.\n\n Example:\n\n ```mlir\n // c = a << b\n %c = index.shl %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.shrs", "summary": "signed index shift right", "description": "The `index.shrs` operation shifts an index value to the right by a variable\n amount. The LHS operand is treated as signed. The high order bits are filled\n with copies of the most significant bit. If the RHS operand is equal to or\n greater than the index bitwidth, the result is a poison value.\n\n Example:\n\n ```mlir\n // c = a >> b\n %c = index.shrs %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.shru", "summary": "unsigned index shift right", "description": "The `index.shru` operation shifts an index value to the right by a variable\n amount. The LHS operand is treated as unsigned. The high order bits are\n filled with zeroes. If the RHS operand is equal to or greater than the index\n bitwidth, the result is a poison value.\n\n Example:\n\n ```mlir\n // c = a >> b\n %c = index.shru %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.sizeof", "summary": "size in bits of the index type", "description": "The `index.sizeof` operation produces an index-typed SSA value equal to the\n size in bits of the `index` type. For example, on 32-bit systems, the result\n is `32 : index`, and on 64-bit systems, the result is `64 : index`.\n\n Example:\n\n ```mlir\n %0 = index.sizeof\n ```", "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict" }, { "name": "index.sub", "summary": "index subtraction", "description": "The `index.sub` operation takes two index values and computes the difference\n of the first from the second operand.\n\n Example:\n\n ```mlir\n // c = a - b\n %c = index.sub %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "index.xor", "summary": "index bitwise xor", "description": "The `index.xor` operation takes two index values and computes their bitwise\n xor.\n\n Example:\n\n ```mlir\n // c = a ^ b\n %c = index.xor %a, %b\n ```", "operands": [ { "name": "lhs", "type": "Index" }, { "name": "rhs", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "interpreter.print", "summary": "Print operation", "description": "Print the value to stdout.\n\n This is useful to print intermediate states of the tensors while debugging.\n This should only be used to debug small tensors since every instance of this\n op and its contents are printed to stdout. To gather information in bulk for\n larger tensors, prefer using ProbeOp.\n\n Example:\n ```mlir\n interpreter.print %operand : tensor\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "interpreter.probe", "description": "Probe and store the values of the input tensor at runtime, using the NumPy\n file format. Writes tensor input value to\n `/_.npy` (where output-dir is specified by\n the `--probe_output_dir` flag). Additionally, adds an entry to\n /index.csv metadata file which maps probe IDs, types and\n filenames with their tensor values.\n\n The `probe` operation will not modify its input in any way. Probe\n instrumentation may however slow down the interpretation of a module as\n there will be increased file I/O.\n\n Note that `probe_id` should be unique for each `probe` instruction in a\n StableHLO module. A `probe` may run more than once, in which case it will\n produce separate serialized data for each iteration in the form\n `probe_id_#` where # is a 1-based counter.\n\n Example:\n ```mlir\n %result = interpreter.probe %operand, probe_id = \"probe0\" : tensor<3xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "probe_id", "type": "StrAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `,` `probe_id` `=` $probe_id attr-dict `:` type($result)" }, { "name": "interpreter.run_parallel", "summary": "RunParallel operation", "description": "Runs a two-dimensional grid of `num_replicas` by `num_partitions` StableHLO\n processes based on programs specified by two-dimensional grid of `programs`.\n\n Given that each program in the grid can have a different number of inputs\n and outputs, we'd want a ragged three-dimensional tensor to model `inputs`\n and `results`, which cannot be easily achieved via conventional means.\n\n Instead, `inputs` and `results` are represented in a flattened way, obtained\n by reshaping the said three-dimensional tensors into a one-dimensional form\n (with the same semantics as StableHLO's reshape). This is a reversible\n transformation because StableHLO programs have a static number of inputs and\n outputs.\n\n For example, for a 2x2 StableHLO process grid, `inputs` first has inputs\n from the process `(0, 0)` (i.e. replica_id = 0 and partition_id = 0),\n then `(0, 1)` (i.e. replica_id = 0 and partition_id = 1), etc.\n\n Example:\n ```mlir\n %results:2 = \"interpreter.run_parallel\"() {\n infeed=[@infeed_queue0, @infeed_queue1]\n programs=[[@foo], [@bar]]\n } : () -> (tensor, tensor)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "infeed", "type": "OptionalAttr>" }, { "name": "programs", "type": "TypedArrayAttrBase>" } ] }, { "name": "io_parameters.gather", "summary": "Gathers multiple parameters from a parameter scope.", "description": "Asynchronously gathers one or more parameters into a single target buffer.\n This is equivalent to one read per parameter but allows implementations that\n can batch operations to do so without additional overhead.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_scope", "type": "Optional" }, { "name": "source_keys", "type": "Variadic" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "target_buffer", "type": "HAL_Buffer" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "target_lengths", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n $target_buffer, type($target_buffer), $target_offsets, $target_lengths)\n `}`\n attr-dict-with-keyword" }, { "name": "io_parameters.load", "summary": "Reads one or more parameters from a parameter scope.", "description": "Asynchronously reads one or more parameters from an external parameter\n provider and returns the resulting buffers. Depending on the parameter and\n buffer types this may alias existing cached storage or be directly mapped to\n the parameter origin or result in a copy as if an allocate + read had been\n used.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_scope", "type": "Optional" }, { "name": "source_keys", "type": "Variadic" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "memory_types", "type": "HAL_MemoryType" }, { "name": "buffer_usage", "type": "HAL_BufferUsage" }, { "name": "lengths", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `type` `(` $memory_types `)`\n `usage` `(` $buffer_usage `)`\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n type($results), $lengths)\n `}`\n attr-dict-with-keyword" }, { "name": "io_parameters.scatter", "summary": "Scatters multiple parameters to a parameter scope.", "description": "Asynchronously scatters one or more parameters from a single source buffer\n into one or more parameters. This is equivalent to one write per parameter\n but allows implementations that can batch operations to do so without\n additional overhead.", "operands": [ { "name": "device", "type": "HAL_Device" }, { "name": "queue_affinity", "type": "HAL_DeviceQueueAffinity" }, { "name": "wait_fence", "type": "HAL_Fence" }, { "name": "signal_fence", "type": "HAL_Fence" }, { "name": "source_buffer", "type": "HAL_Buffer" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "source_lengths", "type": "Variadic" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_keys", "type": "Variadic" }, { "name": "target_offsets", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`<` $device `:` type($device) `>`\n `affinity` `(` $queue_affinity `)`\n `wait` `(` $wait_fence `)`\n `signal` `(` $signal_fence `)`\n `{`\n custom(\n $source_buffer, type($source_buffer), $source_offsets, $source_lengths,\n $target_scope, $target_keys, $target_offsets)\n `}`\n attr-dict-with-keyword" }, { "name": "irdl.all_of", "summary": "Constraints to the intersection of the provided constraints", "description": "`irdl.all_of` defines a constraint that accepts any type or attribute that\n satisfies all of its provided constraints.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex_f32 {\n %0 = irdl.is i32\n %1 = irdl.is f32\n %2 = irdl.any_of(%0, %1) // is 32-bit\n\n %3 = irdl.is f32\n %4 = irdl.is f64\n %5 = irdl.any_of(%3, %4) // is a float\n\n %6 = irdl.all_of(%2, %5) // is a 32-bit float\n irdl.parameters(%6)\n }\n }\n ```\n\n The above program defines a type `complex` inside the dialect `cmath` that\n has one parameter that must be 32-bit long and a float (in other\n words, that must be `f32`).", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` $args `)` ` ` attr-dict" }, { "name": "irdl.any", "summary": "Accept any type or attribute", "description": "`irdl.any` defines a constraint that accepts any type or attribute.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex_flexible {\n %0 = irdl.any\n irdl.parameters(%0)\n }\n }\n ```\n\n The above program defines a type `complex_flexible` inside the dialect\n `cmath` that has a single parameter that can be any attribute.", "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "assemblyFormat": "attr-dict" }, { "name": "irdl.any_of", "summary": "Constraints to the union of the provided constraints", "description": "`irdl.any_of` defines a constraint that accepts any type or attribute that\n satisfies at least one of its provided type constraints.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex {\n %0 = irdl.is i32\n %1 = irdl.is i64\n %2 = irdl.is f32\n %3 = irdl.is f64\n %4 = irdl.any_of(%0, %1, %2, %3)\n irdl.parameters(%4)\n }\n }\n ```\n\n The above program defines a type `complex` inside the dialect `cmath` that\n has a single type parameter that can be either `i32`, `i64`, `f32` or\n `f64`.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` $args `)` ` ` attr-dict" }, { "name": "irdl.attribute", "summary": "Define a new attribute", "description": "`irdl.attribute` defines a new attribute belonging to the `irdl.dialect`\n parent.\n\n The attribute parameters can be defined with an `irdl.parameters` operation\n in the optional region.\n\n Example:\n\n ```mlir\n irdl.dialect @testd {\n irdl.attribute @enum_attr {\n %0 = irdl.is \"foo\"\n %1 = irdl.is \"bar\"\n %2 = irdl.any_of(%0, %1)\n irdl.parameters(%2)\n }\n }\n ```\n\n The above program defines an `enum_attr` attribute inside the `testd`\n dialect. The attribute has one `StringAttr` parameter that should be\n either a `\"foo\"` or a `\"bar\"`.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name attr-dict-with-keyword custom($body)" }, { "name": "irdl.attributes", "summary": "Define the attributes of an operation", "description": "`irdl.attributes` defines the attributes of the `irdl.operation` parent\n operation definition.\n\n In the following example, `irdl.attributes` defines the attributes of the\n `attr_op` operation:\n\n ```mlir\n irdl.dialect @example {\n\n irdl.operation @attr_op {\n %0 = irdl.any\n %1 = irdl.is i64\n irdl.attibutes {\n \"attr1\" = %0,\n \"attr2\" = %1\n }\n }\n }\n ```\n\n The operation will expect an arbitrary attribute \"attr1\" and an\n attribute \"attr2\" with value `i64`.", "operands": [ { "name": "attributeValues", "type": "Variadic" } ], "attributes": [ { "name": "attributeValueNames", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "custom($attributeValues, $attributeValueNames) attr-dict" }, { "name": "irdl.base", "summary": "Constraints an attribute/type base", "description": "`irdl.base` defines a constraint that only accepts a single type\n or attribute base, e.g. an `IntegerType`. The attribute base is defined\n either by a symbolic reference to the corresponding IRDL definition,\n or by the name of the base. Named bases are prefixed with `!` or `#`\n respectively for types and attributes.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex {\n %0 = irdl.base \"!builtin.integer\"\n irdl.parameters(%0)\n }\n\n irdl.type @complex_wrapper {\n %0 = irdl.base @cmath::@complex\n irdl.parameters(%0)\n }\n }\n ```\n\n The above program defines a `cmath.complex` type that expects a single\n parameter, which is a type with base name `builtin.integer`, which is the\n name of an `IntegerType` type.\n It also defines a `cmath.complex_wrapper` type that expects a single\n parameter, which is a type of base type `cmath.complex`.", "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "attributes": [ { "name": "base_ref", "type": "OptionalAttr" }, { "name": "base_name", "type": "OptionalAttr" } ], "assemblyFormat": "($base_ref^)? ($base_name^)? ` ` attr-dict" }, { "name": "irdl.c_pred", "summary": "Constraints an attribute using a C++ predicate", "description": "`irdl.c_pred` defines a constraint that is written in C++.\n\n Dialects using this operation cannot be registered at runtime, as it relies\n on C++ code.\n\n Special placeholders can be used to refer to entities in the context where\n this predicate is used. They serve as \"hooks\" to the enclosing environment.\n The following special placeholders are supported in constraints for an op:\n\n * `$_builder` will be replaced by a mlir::Builder instance.\n * `$_op` will be replaced by the current operation.\n * `$_self` will be replaced with the entity this predicate is attached to.\n Compared to ODS, `$_self` is always of type `mlir::Attribute`, and types\n are manipulated as `TypeAttr` attributes.\n\n Example:\n ```mlir\n irdl.type @op_with_attr {\n %0 = irdl.c_pred \"::llvm::isa<::mlir::IntegerAttr>($_self)\"\n irdl.parameters(%0)\n }\n ```\n\n In this example, @op_with_attr is defined as a type with a single\n parameter, which is an `IntegerAttr`, as constrained by the C++ predicate.", "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "attributes": [ { "name": "pred", "type": "StrAttr" } ], "assemblyFormat": "$pred ` ` attr-dict" }, { "name": "irdl.dialect", "summary": "Define a new dialect", "description": "The `irdl.dialect` operation defines a dialect. All operations, attributes,\n and types defined inside its region will be part of the dialect.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n ...\n }\n ```\n\n The above program defines a `cmath` dialect.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name attr-dict-with-keyword custom($body)" }, { "name": "irdl.IRDL_Dialect", "summary": "Define a new dialect", "description": "The `irdl.dialect` operation defines a dialect. All operations, attributes,\n and types defined inside its region will be part of the dialect.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n ...\n }\n ```\n\n The above program defines a `cmath` dialect.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "assemblyFormat": "$sym_name attr-dict-with-keyword custom($body)", "hasCustomAssemblyFormat": 0 }, { "name": "irdl.is", "summary": "Constraints an attribute/type to be a specific attribute instance", "description": "`irdl.is` defines a constraint that only accepts a specific instance of a\n type or attribute.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex_i32 {\n %0 = irdl.is i32\n irdl.parameters(%0)\n }\n }\n ```\n\n The above program defines a `complex_i32` type inside the dialect `cmath`\n that can only have a `i32` as its parameter.", "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "attributes": [ { "name": "expected", "type": "AnyAttr" } ], "assemblyFormat": "$expected ` ` attr-dict" }, { "name": "irdl.operands", "summary": "Define the operands of an operation", "description": "`irdl.operands` define the operands of the `irdl.operation` parent operation\n definition. Each operand is named after an identifier.\n\n In the following example, `irdl.operands` defines the operands of the\n `mul` operation:\n\n ```mlir\n irdl.dialect @cmath {\n\n irdl.type @complex { /* ... */ }\n\n irdl.operation @mul {\n %0 = irdl.any\n %1 = irdl.parametric @cmath::@complex<%0>\n irdl.results(res: %1)\n irdl.operands(lhs: %1, rhs: %1)\n }\n }\n ```\n\n The `mul` operation will expect two operands of type `cmath.complex`, that\n have the same type, and return a result of the same type.\n\n The operands can also be marked as variadic or optional:\n ```mlir\n irdl.operands(foo: %0, bar: single %1, baz: optional %2, qux: variadic %3)\n ```\n\n Here, foo and bar are required single operands, baz is an optional operand,\n and qux is a variadic operand.\n\n When more than one operand is marked as optional or variadic, the operation\n will expect a 'operandSegmentSizes' attribute that defines the number of\n operands in each segment.", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" }, { "name": "variadicity", "type": "VariadicityArrayAttr" } ], "assemblyFormat": "`` custom($args, $names, $variadicity) attr-dict" }, { "name": "irdl.operation", "summary": "Define a new operation", "description": "`irdl.operation` defines a new operation belonging to the `irdl.dialect`\n parent.\n\n Operations can define constraints on their operands and results with the\n `irdl.results` and `irdl.operands` operations. If these operations are not\n present in the region, the results or operands are expected to be empty.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n\n irdl.type @complex { /* ... */ }\n\n irdl.operation @norm {\n %0 = irdl.any\n %1 = irdl.parametric @cmath::@complex<%0>\n irdl.results(%0)\n irdl.operands(%1)\n }\n }\n ```\n\n The above program defines an operation `norm` inside the dialect `cmath`.\n The operation expects a single operand of base type `cmath.complex`, and\n returns a single result of the element type of the operand.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name attr-dict-with-keyword custom($body)" }, { "name": "irdl.parameters", "summary": "Define the constraints on parameters of a type/attribute definition", "description": "`irdl.parameters` defines the constraints on parameters of a type or\n attribute definition. Each parameter is named after an identifier.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex {\n %0 = irdl.is i32\n %1 = irdl.is i64\n %2 = irdl.any_of(%0, %1)\n irdl.parameters(elem: %2)\n }\n }\n ```\n\n The above program defines a type `complex` inside the dialect `cmath`. The\n type has a single parameter `elem` that should be either `i32` or `i64`.", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "`` custom($args, $names) attr-dict" }, { "name": "irdl.parametric", "summary": "Constraints an attribute/type base and its parameters", "description": "`irdl.parametric` defines a constraint that accepts only a single type\n or attribute base. The attribute base is defined by a symbolic reference\n to the corresponding definition. It will additionally constraint the\n parameters of the type/attribute.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n\n irdl.type @complex { /* ... */ }\n\n irdl.operation @norm {\n %0 = irdl.any\n %1 = irdl.parametric @cmath::@complex<%0>\n irdl.operands(%1)\n irdl.results(%0)\n }\n }\n ```\n\n The above program defines an operation `norm` inside the dialect `cmath` that\n for any `T` takes a `cmath.complex` with parameter `T` and returns a `T`.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "IRDL_AttributeType" } ], "attributes": [ { "name": "base_type", "type": "SymbolRefAttr" } ], "assemblyFormat": "$base_type `<` $args `>` ` ` attr-dict" }, { "name": "irdl.region", "summary": "Define a region of an operation", "description": "The irdl.region construct defines a set of characteristics\n that a region of an operation should satify. Each region is named after\n an identifier.\n\n These characteristics include constraints for the entry block arguments\n of the region and the total number of blocks it contains.\n The number of blocks must be a non-zero and non-negative integer,\n and it is optional by default.\n The set of constraints for the entry block arguments may be optional or\n empty. If no parentheses are provided, the set is assumed to be optional,\n and the arguments are not constrained in any way. If parentheses are\n provided with no arguments, it means that the region must have\n no entry block arguments\n\n\n Example:\n\n ```mlir\n irdl.dialect @example {\n irdl.operation @op_with_regions {\n %r0 = irdl.region\n %r1 = irdl.region()\n %v0 = irdl.is i32\n %v1 = irdl.is i64\n %r2 = irdl.region(%v0, %v1)\n %r3 = irdl.region with size 3\n\n irdl.regions(foo: %r0, bar: %r1, baz: %r2, qux: %r3)\n }\n }\n ```\n\n The above snippet demonstrates an operation named `@op_with_regions`,\n which is constrained to have four regions.\n\n * Region `foo` doesn't have any constraints on the arguments\n or the number of blocks.\n * Region `bar` should have an empty set of arguments.\n * Region `baz` should have two arguments of types `i32` and `i64`.\n * Region `qux` should contain exactly three blocks.", "operands": [ { "name": "entryBlockArgs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "IRDL_RegionType" } ], "attributes": [ { "name": "numberOfBlocks", "type": "OptionalAttr" }, { "name": "constrainedArguments", "type": "UnitAttr" } ], "assemblyFormat": "``(`(` $entryBlockArgs $constrainedArguments^ `)`)?\n ``(` ` `with` `size` $numberOfBlocks^)? attr-dict" }, { "name": "irdl.regions", "summary": "Define the regions of an operation", "description": "`irdl.regions` defines the regions of an operation by accepting\n values produced by `irdl.region` operation as arguments. Each\n region has an identifier as name.\n\n Example:\n\n ```mlir\n irdl.dialect @example {\n irdl.operation @op_with_regions {\n %r1 = irdl.region with size 3\n %0 = irdl.any\n %r2 = irdl.region(%0)\n irdl.regions(foo: %r1, bar: %r2)\n }\n }\n ```\n\n In the snippet above the operation is constrained to have two regions.\n The first region (`foo`) should contain three blocks.\n The second region (`bar`) should have one region with one argument.", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "`` custom($args, $names) attr-dict" }, { "name": "irdl.results", "summary": "Define the results of an operation", "description": "`irdl.results` define the results of the `irdl.operation` parent operation\n definition. Each result is named after an identifier.\n\n In the following example, `irdl.results` defines the results of the\n `get_values` operation:\n\n ```mlir\n irdl.dialect @cmath {\n\n irdl.type @complex { /* ... */ }\n\n /// Returns the real and imaginary parts of a complex number.\n irdl.operation @get_values {\n %0 = irdl.any\n %1 = irdl.parametric @cmath::@complex<%0>\n irdl.results(re: %0, im: %0)\n irdl.operands(complex: %1)\n }\n }\n ```\n\n The operation will expect one operand of the `cmath.complex` type, and two\n results that have the underlying type of the `cmath.complex`.\n\n The results can also be marked as variadic or optional:\n ```mlir\n irdl.results(foo: %0, bar: single %1, baz: optional %2, qux: variadic %3)\n ```\n\n Here, foo and bar are required single results, baz is an optional result,\n and qux is a variadic result.\n\n When more than one result is marked as optional or variadic, the operation\n will expect a 'resultSegmentSizes' attribute that defines the number of\n results in each segment.", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" }, { "name": "variadicity", "type": "VariadicityArrayAttr" } ], "assemblyFormat": "`` custom($args, $names, $variadicity) attr-dict" }, { "name": "irdl.type", "summary": "Define a new type", "description": "`irdl.type` defines a new type belonging to the `irdl.dialect` parent.\n\n The type parameters can be defined with an `irdl.parameters` operation in\n the optional region.\n\n Example:\n\n ```mlir\n irdl.dialect @cmath {\n irdl.type @complex {\n %0 = irdl.is i32\n %1 = irdl.is i64\n %2 = irdl.any_of(%0, %1)\n irdl.parameters(%2)\n }\n }\n ```\n\n The above program defines a type `complex` inside the dialect `cmath`. The\n type has a single parameter that should be either `i32` or `i64`.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name attr-dict-with-keyword custom($body)" }, { "name": "iree_codegen.constraints", "summary": "SMT constraints for a codegen configuration of root ops.", "description": "Declares SMT constraints over problem dimensions and configuration\n knobs for a codegen pipeline, targeting a set of root ops.\n\n `target`: A `#iree_codegen.root_op` attribute identifying\n which root op set these constraints apply to. All ops marked with\n the same `#iree_codegen.root_op` attribute share the same\n lowering config. This decouples constraints from SSA values, so ops\n with zero or multiple results are supported.\n\n `pipeline`: The codegen pipeline to use. This is a fixed choice,\n not decided by the solver.\n\n `knobs`: DictionaryAttr mirroring GPULoweringConfigAttr. Leaves\n that are `#iree_codegen.int_knob<\"name\">` attrs name tunable SMT\n constants (materialized by `iree_codegen.knob` ops in the body).\n Integer/attr leaves are fixed.\n\n `problem_dims`: index-typed problem dimensions; corresponding block\n arguments are !smt.int.\n\n Does not have any execution semantics and is meant to be used by the\n tuner or verification passes, and erased before lowering.\n\n Example:\n ```mlir\n // The matmul is marked: {root_op = #iree_codegen.root_op}\n iree_codegen.constraints target = , pipeline = LLVMGPUVectorDistribute,\n knobs = {workgroup = [#iree_codegen.int_knob<\"wg_m\">, #iree_codegen.int_knob<\"wg_n\">]}\n dims(%M, %N, %K) {\n ^bb0(%m: !smt.int, %n: !smt.int, %k: !smt.int):\n %wg_m = iree_codegen.knob \"wg_m\" : !smt.int\n %wg_n = iree_codegen.knob \"wg_n\" : !smt.int\n }\n ```", "operands": [ { "name": "problem_dims", "type": "Variadic" } ], "attributes": [ { "name": "target", "type": "IREECodegen_RootOpAttr" }, { "name": "pipeline", "type": "AnyAttrOf<[DispatchLoweringPassPipelineAttr{CPUDefault|CPUDoubleTilingExpert|CPUConvTileAndDecomposeExpert|Mmt4dTilingExpert|CPUBufferOpsTileAndVectorize|CPUDataTiling|CPULinalgExtTileAndVectorize|LLVMGPUDefault|LLVMGPUBaseLowering|LLVMGPUDistribute|LLVMGPUVectorize|LLVMGPUVectorDistribute|LLVMGPUWinogradVectorize|LLVMGPUTileAndFuse|SPIRVBaseLowering|SPIRVBaseDistribute|SPIRVBaseVectorize|SPIRVSubgroupReduce|SPIRVMatmulPromoteVectorize|SPIRVCooperativeMatrixVectorize|SPIRVWinogradVectorize|VMVXDefault|TransformDialectCodegen|Custom|None}, IREECodegen_PipelineAttrInterface]>" }, { "name": "knobs", "type": "DictionaryAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`target` `=` $target `,` `pipeline` `=` custom($pipeline) `,`\n custom($knobs)\n `dims` `(` $problem_dims `)` attr-dict-with-keyword\n $body" }, { "name": "iree_codegen.dispatch_config", "summary": "Holds the workgroup count computation for a dispatch.", "description": "A module-level op that captures the workgroup count computation and\n dispatch metadata for a function. The region computes the workgroup\n count (x, y, z) from workload values passed as block arguments.\n The terminator must yield exactly 3 index values, matching the\n contract of `hal.executable.export`'s workgroup count region.\n\n The `function_ref` is a symbol reference to the corresponding\n `func.func`. The op itself is not a Symbol because it lives\n alongside the `func.func` of the same name in a `builtin.module`\n symbol table, and two ops cannot define the same symbol.\n\n Example:\n ```mlir\n iree_codegen.dispatch_config @matmul\n workgroup_size = [64, 16, 1] subgroup_size = 64\n workgroup_local_memory = 4096 {\n ^bb0(%w0: index, %w1: index, %w2: index, %w3: index):\n %0 = affine.apply affine_map<()[s0] -> (s0 ceildiv 256)>()[%w2]\n %c1 = arith.constant 1 : index\n iree_codegen.yield %0, %c1, %c1 : index, index, index\n }\n ```", "attributes": [ { "name": "function_ref", "type": "FlatSymbolRefAttr" }, { "name": "workgroup_size", "type": "OptionalAttr" }, { "name": "subgroup_size", "type": "OptionalAttr" }, { "name": "workgroup_local_memory", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$function_ref\n (`workgroup_size` `=` $workgroup_size^)?\n (`subgroup_size` `=` $subgroup_size^)?\n (`workgroup_local_memory` `=` $workgroup_local_memory^)?\n $body attr-dict" }, { "name": "iree_codegen.extract_strided_metadata", "summary": "Extracts a buffer base with offset and strides.", "description": "This op is implemented similarly to the upstream MemRef::ExtractStridedMetadataOp\n with the following differences.\n\n 1. It does not fold away static offset/stride information.\n Hence unlike the upstream Op the link between the memref and consumers of the\n metadata is not broken when later passes change this information. A common\n example in IREE of this is buffer binding optimizations.\n\n 2. Helper functions getConstifiedMixed{Offset|Strides|Sizes} are not implemented\n as the expectation is you should lower to the upstream op before using those\n functions if you need them.\n\n Copy of MemRef::ExtractStridedMetadataOp description for reference below.\n Extracts a base buffer, offset and strides. This op allows additional layers\n of transformations and foldings to be added as lowering progresses from\n higher-level dialect to lower-level dialects such as the LLVM dialect.\n\n The op requires a strided memref source operand. If the source operand is not\n a strided memref, then verification fails.\n\n This operation is also useful for completeness to the existing memref.dim op.\n While accessing strides, offsets and the base pointer independently is not\n available, this is useful for composing with its natural complement op:\n `memref.reinterpret_cast`.\n\n Intended Use Cases:\n\n The main use case is to expose the logic for manipulate memref metadata at a\n higher level than the LLVM dialect.\n This makes lowering more progressive and brings the following benefits:\n - not all users of MLIR want to lower to LLVM and the information to e.g.\n lower to library calls---like libxsmm---or to SPIR-V was not available.\n - foldings and canonicalizations can happen at a higher level in MLIR:\n before this op existed, lowering to LLVM would create large amounts of\n LLVMIR. Even when LLVM does a good job at folding the low-level IR from\n a performance perspective, it is unnecessarily opaque and inefficient to\n send unkempt IR to LLVM.", "operands": [ { "name": "source", "type": "AnyStridedMemRef" } ], "results": [ { "name": "base_buffer", "type": "AnyStridedMemRefOfRank<0>" }, { "name": "offset", "type": "Index" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$source `:` type($source) `->` type(results) attr-dict" }, { "name": "iree_codegen.fusion_barrier", "summary": "Prevents fusion through a tensor value", "operands": [ { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $source `:` type($result)" }, { "name": "iree_codegen.index_hint", "summary": "Compiler hint providing semantic information about an index", "description": "Pure pass-through operation that annotates an index value with semantic\n information about how it varies across parallel workers (e.g., GPU lanes).\n\n The hint attribute describes the index behavior. Common hints include:\n - `#iree_gpu.lane_constant`: Index is uniform within groups of N lanes\n - `#iree_gpu.lane_increment`: Index increments by 1 within groups of N lanes\n\n This operation is always safe to remove (replace with input). It exists\n purely to guide optimization passes.\n\n Example:\n ```mlir\n %row = iree_codegen.index_hint %idx(#iree_gpu.lane_constant<16>) : index\n %col = iree_codegen.index_hint %idx(#iree_gpu.lane_increment<16>) : index\n ```", "operands": [ { "name": "input", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "hint", "type": "AnyAttr" } ], "assemblyFormat": "$input `(` $hint `)` attr-dict `:` type($input)" }, { "name": "iree_codegen.inner_tiled", "summary": "Generic operation on tiled operands based on an intrinsic.", "description": "Each operand's shape is viewed as `outer_dims x inner_tile`:\n - The outer dims are those described by the operand's indexing map; they\n are iterated by an outer loop nest specified by `iterator_types` and\n `indexing_maps`, with the same conventions as `vector.contract`.\n - The remaining trailing dims form the operand's inner tile. At each\n outer iteration point, the output inner tiles are updated from the\n input inner tiles by the intrinsic named by `kind`.\n\n Operands may be tensors, memrefs or vectors. Inner-tile dims are generally\n static, the only exception being scalable vectors dimensions which\n correspond to dynamic tensor dimensions.\n\n ### Attributes\n\n - `kind` (`InnerTileDescAttrInterface`): names the intrinsic. It fixes\n the number of inputs/outputs and, together with `semantics`, the\n canonical inner-tile vector type of each operand.\n - `semantics` (`InnerTiledSemanticsAttrInterface`): controls how strictly\n operand inner tiles are checked against `kind`. Different `semantics`\n attributes from different dialects may adopt different conventions, but\n there are generally two main modes:\n * `opaque = true`: only the element type and total element count of\n each inner tile must match the canonical vector type. Shape and\n rank are otherwise free. Scalable vectors and dynamic tensor dims\n are not allowed in this mode.\n * Default / `opaque = false`: after dropping non-scalable unit dims, the\n operand inner-tile shape must match the (permuted) canonical shape\n one-to-one. Scalable vector dimensions are supported and must correspond\n to dynamic tensor dimensions. Every other tensor dimension must be static.\n - `indexing_maps`: one projected-permutation `AffineMap` per operand\n (inputs first, then outputs), all sharing the same number of dims\n (equal to `iterator_types.size()`) and no symbols.\n - `iterator_types`: one of `parallel` / `reduction` for each outer\n iterator dim.\n - `permutations` (optional): If present, there is one entry per operand,\n each a permutation vector\n `p` of length equal to that operand's inner rank, giving the\n relationship between the canonical inner-tile shape `C` (from\n `kind`/`semantics`) and the operand's actual inner-tile shape `S`:\n `S[i] == C[p[i]]`.\n\n ### Examples\n\n Subgroup-level (undistributed) MMA on tensors using the AMD MFMA\n intrinsic `MFMA_F32_32x32x8_F16`, whose canonical per-operand inner\n tiles are LHS = `32x8` (M, K), RHS = `8x32` (K, N) and ACC = `32x32`\n (M, N). In practice the RHS is typically stored with its inner dims\n swapped (the matmul is really an MMT at the tile level); this is\n expressed by the `[1, 0]` entry in `permutations` on the RHS operand,\n which makes its inner-tile shape `canonical[1] x canonical[0]` =\n `N x K` = `32 x 8`.\n\n ```mlir\n %0 = iree_codegen.inner_tiled ins(%lhs, %rhs) outs(%acc) {\n indexing_maps = [\n affine_map<(m, n, k) -> (m, k)>,\n affine_map<(m, n, k) -> (n, k)>,\n affine_map<(m, n, k) -> (m, n)>\n ],\n iterator_types = [\n #linalg.iterator_type,\n #linalg.iterator_type,\n #linalg.iterator_type\n ],\n kind = #iree_gpu.mma_layout,\n semantics = #iree_gpu.mma_semantics,\n permutations = [array, array, array]\n } : tensor, tensor\n into tensor\n ```\n\n After distribution across the 64 lanes of a wave, the per-operand\n inner tiles become the canonical *per-lane* shares of the intrinsic:\n `256 / 64 = 4` f16 elements per lane for LHS and RHS, `1024 / 64 = 16`\n f32 elements per lane for ACC.\n\n ```mlir\n %0 = iree_codegen.inner_tiled ins(%lhs, %rhs) outs(%acc) {\n indexing_maps = [\n affine_map<(m, n, k) -> (m, k)>,\n affine_map<(m, n, k) -> (n, k)>,\n affine_map<(m, n, k) -> (m, n)>\n ],\n iterator_types = [\n #linalg.iterator_type,\n #linalg.iterator_type,\n #linalg.iterator_type\n ],\n kind = #iree_gpu.mma_layout,\n semantics = #iree_gpu.mma_semantics\n } : tensor, tensor\n into tensor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "iterator_types", "type": "TypedArrayAttrBase" }, { "name": "kind", "type": "IREECodegen_AnyInnerTileDescAttr" }, { "name": "semantics", "type": "IREECodegen_AnyInnerTiledSemanticscAttr" }, { "name": "permutations", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`ins` `(` $inputs `)` `outs` `(` $outputs `)` attr-dict\n `:` type($inputs) `into` type($outputs)" }, { "name": "iree_codegen.knob", "summary": "Declare an SMT constant for a tunable configuration knob.", "description": "Materializes a named SMT constant (!smt.int) for use in constraint\n expressions. The name must match an `#iree_codegen.int_knob<\"name\">`\n leaf in the enclosing `iree_codegen.constraints` op's `knobs`\n dictionary.\n\n In SMT terminology this is a constant (0-ary function), not a variable.\n The tuner assigns concrete integer values to these constants.\n\n Example:\n ```mlir\n %wg_m = iree_codegen.knob \"wg_m\" : !smt.int\n ```", "results": [ { "name": "result", "type": "IntType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name attr-dict `:` type($result)" }, { "name": "iree_codegen.load_from_buffer", "summary": "Loads a tensor from a memref.", "description": "Loads a tensor from a memref with a compatible shape and the same element\n type.", "operands": [ { "name": "buffer", "type": "AnyStridedMemRef" } ], "results": [ { "name": "tensor", "type": "AnyRankedTensor" } ], "assemblyFormat": "$buffer attr-dict `:` type($buffer) `->` type($tensor)" }, { "name": "iree_codegen.null_pointer", "summary": "Returns a null_pointer value.", "description": "This is meant to be used only as arguments to microkernels.", "results": [ { "name": "result", "type": "NullPointer" } ], "assemblyFormat": "attr-dict" }, { "name": "iree_codegen.query_tile_sizes", "summary": "Yields tile sizes for the specified tensor type.", "description": "For targets where tile sizes can't be resolved at compile time, this\n operation allows querying the sizes at runtime. Today this only applies\n to VMVX.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "tensor_type", "type": "TensorTypeAttr" } ], "assemblyFormat": "attr-dict $tensor_type `->` type($results)" }, { "name": "iree_codegen.smt.assert", "summary": "Named SMT assertion for constraint verification.", "description": "Asserts that a boolean SMT expression holds, with a human-readable\n format string describing what is being checked. The format string may\n contain `{}` placeholders that correspond positionally to the `args`\n operands. An evaluator or verifier can substitute concrete values into\n the placeholders for diagnostics.\n\n Args are restricted to `!smt.int` because all constraint knobs and\n dimension values are integers.\n\n Used inside `iree_codegen.smt.constraints` regions.\n\n Examples:\n ```mlir\n // Static message (no args):\n iree_codegen.smt.assert %cond, \"dim_0 == 128\" : !smt.bool\n\n // Format string with args:\n iree_codegen.smt.assert %cond, \"wg_x ({}) < wg_y ({})\", %x, %y : !smt.bool, !smt.int, !smt.int\n ```", "operands": [ { "name": "condition", "type": "BoolType" }, { "name": "printArgs", "type": "Variadic" } ], "attributes": [ { "name": "msg", "type": "StrAttr" } ], "assemblyFormat": "$condition `,` $msg (`,` $printArgs^)?\n `:` type($condition) (`,` type($printArgs)^)? attr-dict" }, { "name": "iree_codegen.smt.constraints", "summary": "SMT constraints for a codegen configuration of root ops.", "description": "Declares SMT constraints over problem dimensions and configuration\n knobs for a codegen pipeline, targeting a set of root ops.\n\n `target`: A `#iree_codegen.root_op` attribute identifying\n which root op set these constraints apply to. All ops marked with\n the same `#iree_codegen.root_op` attribute share the same\n lowering config. This decouples constraints from SSA values, so ops\n with zero or multiple results are supported.\n\n `pipeline`: The codegen pipeline to use. This is a fixed choice,\n not decided by the solver.\n\n `knobs`: DictionaryAttr mirroring GPULoweringConfigAttr. Leaves\n that are `#iree_codegen.smt.int_knob<\"name\">` attrs name tunable SMT\n constants (materialized by `iree_codegen.smt.knob` ops in the body).\n Integer/attr leaves are fixed.\n\n `problem_dims`: index-typed problem dimensions; corresponding block\n arguments are !smt.int.\n\n Does not have any execution semantics and is meant to be used by the\n tuner or verification passes, and erased before lowering.\n\n Example:\n ```mlir\n // The matmul is marked: {root_op = #iree_codegen.root_op}\n iree_codegen.smt.constraints target = , pipeline = #iree_gpu.pipeline,\n knobs = {workgroup = [#iree_codegen.smt.int_knob<\"wg_m\">, #iree_codegen.smt.int_knob<\"wg_n\">]}\n dims(%M, %N, %K) {\n ^bb0(%m: !smt.int, %n: !smt.int, %k: !smt.int):\n %wg_m = iree_codegen.smt.knob \"wg_m\" : !smt.int\n %wg_n = iree_codegen.smt.knob \"wg_n\" : !smt.int\n }\n ```", "operands": [ { "name": "problem_dims", "type": "Variadic" } ], "attributes": [ { "name": "target", "type": "IREECodegen_RootOpAttr" }, { "name": "pipeline", "type": "IREECodegen_PipelineAttrInterface" }, { "name": "knobs", "type": "DictionaryAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`target` `=` $target `,` `pipeline` `=` $pipeline `,`\n custom($knobs)\n `dims` `(` $problem_dims `)` attr-dict-with-keyword\n $body" }, { "name": "iree_codegen.smt.knob", "summary": "Declare an SMT constant for a tunable configuration knob.", "description": "Materializes a named SMT constant (!smt.int) for use in constraint\n expressions. The name must match an `#iree_codegen.smt.int_knob<\"name\">`\n or `#iree_codegen.smt.one_of_knob<\"name\", [...]>` leaf in the\n enclosing `iree_codegen.smt.constraints` op's `knobs` dictionary.\n\n In SMT terminology this is a constant (0-ary function), not a variable.\n The tuner assigns concrete integer values to these constants.\n\n Example:\n ```mlir\n %wg_m = iree_codegen.smt.knob \"wg_m\" : !smt.int\n ```", "results": [ { "name": "result", "type": "IntType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name attr-dict `:` type($result)" }, { "name": "iree_codegen.smt.lookup", "summary": "Integer table lookup for SMT constraints.", "description": "Maps an SMT integer index to an integer value via a sparse key-value\n table. Used to derive values from enumerated knobs (e.g., MMA shape\n dimensions from an mma_idx knob).\n\n TODO: During constraint verification, the lookup will be evaluated\n directly. During SMT-LIB export, it will be lowered to a chain of\n `smt.ite` ops. Neither pass is implemented yet.\n\n Example:\n ```mlir\n %mma_m = iree_codegen.smt.lookup %idx [3, 7, 12] -> [16, 32, 64] : !smt.int\n ```", "operands": [ { "name": "index", "type": "IntType" } ], "results": [ { "name": "result", "type": "IntType" } ], "attributes": [ { "name": "keys", "type": "DenseI64ArrayAttr" }, { "name": "values", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$index $keys `->` $values attr-dict `:` type($result)" }, { "name": "iree_codegen.store_to_buffer", "summary": "Stores a tensor into a memref.", "description": "Stores a tensor into a memref with a compatible shape and the same element\n type.", "operands": [ { "name": "tensor", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyStridedMemRef" } ], "assemblyFormat": "$tensor `,` $buffer\n attr-dict `:` type($tensor) `into` type($buffer)" }, { "name": "iree_codegen.swizzle_hint", "summary": "Hint to swizzle accesses according to an access pattern.", "description": "Optimization hint to swizzle all accesses to the memref or tensor that this takes a\n view of. This only affects reads/writes that immediately consume this operation\n and is best effort. If the desired swizzling is not apparently possible, this\n op will no-op. As a result, it should not be relied on for correctness.\n\n Any subviews on this operation will cause the swizzle application to fail. The\n expectation is for all view like operations to fold into the accessing ops\n (loads/stores) before this op takes effect.\n\n Note that this only rewrites direct users. If there are any aliased loads\n or stores of the data from/to the |src| memref of a hintOp, those accesses\n will not be swizzled. This allows reusing an allocation with different\n swizzled access patterns as long as there is no data dependency between\n memory with different layouts. For example:\n\n ```\n %0 = alloc()\n %1 = iree_codegen.swizzle_hint %0, #layout_0\n %2 = iree_codegen.swizzle_hint %0, #layout_1\n {\n vector.store %1\n vector.load %1\n ^\n |\n unrelated\n |\n v\n vector.store %2\n vector.load %2\n }\n ```\n\n If there is a data dependency between the accesses of %1 and %2, for example\n a value stored to %1 is loaded from %2, this is undefined behavior. Aliasing\n is otherwise perfectly legal.", "operands": [ { "name": "operand", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "result", "type": "AnyRankedTensorOrMemRef" } ], "attributes": [ { "name": "swizzle", "type": "IREECodegen_AnySwizzleAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `[` $swizzle attr-dict `]` `:` type($result)" }, { "name": "iree_codegen.ukernel.generic", "summary": "Generic Microkernel operator.", "description": "Operation to wrap a computation forwarded to a microkernel.\n\n This operation is a generic representation of the DAG that is to be\n lowered into a micro-kernel. The name of the microkernel is specified\n as a `StrAttr`. The DAG to be forwarded is meant to be captured at\n tensor-level. The operation implements the `DestinationStyleOpInterface`\n so all tensors in the `outs` list must match the number and type of the\n results of the operation.\n After bufferization the tensor operands in `outs` are converted to\n a memref type. At the memref-level, the operands are expected to\n match directly into a function call with the arguments to the\n function call being the `ins`, `outs` and `other_operands`.\n\n The operands of `memref` type are expected to lower to this sequence of\n function arguments:\n `base_pointer, offset, stride0, stride1, stride2, ...`\n By default, all N strides are passed for each memref of rank N. This can be\n overridden by the optional `strided_dims` attribute: if set, its value\n is a list of dimensions for which strides are passed for each ShapedType\n operand, in the order that they appear as operands. Non-ShapedType operands\n are ignored in the strided_dims list.\n\n Note that `memref` semantics only guarantee that a `base_pointer + offset`\n represents the position to read from. So all micro-kernel implementations\n are expected to take at least a `base_pointer, offset` pair for each\n operand (input or output) of `memref` type. The `offset` has to be added to\n the `base_pointer` before dereferencing to read/write data. Also note that\n the `offset` is in number of elements.\n\n All other operands are expected to be scalar types.\n TODO: `vector` types can be supported as well, but needs better\n ABI specification.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" }, { "name": "other_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "u_kernel_fn_name", "type": "StrAttr" }, { "name": "fn_def_attrs", "type": "OptionalAttr" }, { "name": "strided_dims", "type": "OptionalAttr>>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $u_kernel_fn_name\n (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n (`outs` `(` $outputs^ `:` type($outputs) `)`)?\n (`(` $other_operands^ `:` type($other_operands) `)`)?\n ( `fn_def_attrs` $fn_def_attrs^ )?\n (`strided_dims` `(` $strided_dims^ `)`)? (`->` type($results)^)?" }, { "name": "iree_codegen.workgroup_count_hint", "summary": "Hints at the workgroup count to set", "description": "Captures a set of values to use as the workgroup count. The backward slice\n starting from this op's operands is cloned into the workgroup count region\n of all transitive callers.\n\n The sizes are specified in logical order (innermost to outermost), matching\n the workgroup count region's (x, y, z) convention. If fewer than 3 sizes\n are provided, the remaining dimensions default to 1.\n\n If multiple hints inform the same entry point, the **elementwise maximum**\n across all hints is used as the count along each dimension. For example:\n\n ```mlir\n hal.executable.export @entry_point\n module {\n func.func @entry_point() {\n iree_codegen.workgroup_count_hint sizes(%a, %b, %c)\n iree_codegen.workgroup_count_hint sizes(%x, %y, %z)\n }\n }\n ```\n\n resolves to:\n\n ```mlir\n hal.executable.export @entry_point {\n %wx = arith.maxsi %a, %x\n %wy = arith.maxsi %b, %y\n %wz = arith.maxsi %c, %z\n hal.return %wx, %wy, %wz\n }\n ```\n\n #### Common Usage: Linearized Workgroup Counts\n\n The most common use case for this operation involves computing a linearized\n (1-D) workgroup count and specifying it as a single size.\n\n ```mlir\n %num_workgroups = arith.ceildivui %total_iterations, %tile_size : index\n iree_codegen.workgroup_count_hint sizes(%num_workgroups)\n ```\n\n This results in `(%num_workgroups, 1, 1)` as the final workgroup count.", "operands": [ { "name": "sizes", "type": "Variadic" } ], "attributes": [ { "name": "static_sizes", "type": "DenseI64ArrayAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "iree_codegen.yield", "summary": "IREECodegen yield op.", "description": "`iree_codegen.yield` is a special terminator operation for blocks inside\n regions in `iree_codegen` ops.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "iree_encoding.set_encoding", "summary": "Perform pack and pad operation on source.", "description": "Operation to assign an encoding to a tensor. The operation does not change\n the rank or extent of a tensor. Instead it adds a LayoutResolverAttr\n attribute to the tensor type to represent a change in layout.\n\n The optional `encoding_dims` operand carries dynamic values needed by the\n encoding (e.g., M, N, K dimensions for matmul encodings). These values are\n used for runtime layout selection based on problem size.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "encoding_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "attr-dict $source (`encoding_dims` `{` $encoding_dims^ `}`)? `:` type($source) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "iree_encoding.unset_encoding", "summary": "Perform unpack and extract operation on source.", "description": "Operation to convert a tensor with LayoutResolverAttr encoding that\n represents its data layout into a tensor with default layout\n (i.e. no encoding). For now in IREE the default layout is row-major.\n\n The optional `encoding_dims` operand carries dynamic values needed by the\n encoding (e.g., M, N, K dimensions for matmul encodings). These values are\n used for runtime layout selection based on problem size.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "result_dims", "type": "Variadic" }, { "name": "encoding_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict $source (`encoding_dims` `{` $encoding_dims^ `}`)? `:` type($source) `->` type($result) (`` `{` $result_dims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "iree_gpu.async_dma", "summary": "Asynchronous data movement", "description": "Represents an asynchronous data movement from one memory to another without\n intermediate materialization of the values in registers.\n\n The `transfer_type` attribute is a `VectorType` describing the shape and\n element type of the transfer. The shape is used to determine the transfer\n tile and to validate gather indices.\n\n Each source index can be either a scalar `index` (contiguous read starting\n at that offset) or a `vector` (gather: read N elements at the\n positions specified by the vector). When a source index is a vector, its\n size must match the transfer_type size in the corresponding destination\n dimension.\n\n Source and destination ranks may differ. When they do, a `permutation_map`\n must be provided to map source dimensions to destination/layout dimensions.\n When omitted, identity mapping is assumed (requires equal ranks).\n\n This operation exists in two forms: tensor-based (value-semantic) and\n buffer-based (memref-semantic). In tensor form, the operation returns a\n result that aliases the `dest` operand and can be used in combination with\n `iree_gpu.value_barrier` to synchronize with the data movement. In memref\n form, the operation has no result and writes directly to the `dest` memref.\n\n Example:\n ```mlir\n %result = iree_gpu.async_dma %src[%i, %j] to %dst[%c0], vector<64xf16>\n permutation_map affine_map<(d0, d1) -> (d1)>\n in_bounds [true]\n : tensor<20x256xf16>, tensor<128xf16, #gpu.address_space>\n -> tensor<128xf16, #gpu.address_space>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensorOrMemRef" }, { "name": "source_indices", "type": "Variadic ]>>" }, { "name": "dest", "type": "AnyRankedTensorOrMemRef" }, { "name": "dest_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "transfer_type", "type": "TypeAttr" }, { "name": "permutation_map", "type": "OptionalAttr" }, { "name": "in_bounds", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `[` $source_indices `]` `to` $dest `[` $dest_indices `]` `,`\n $transfer_type\n oilist(\n `permutation_map` $permutation_map |\n `in_bounds` $in_bounds\n )\n attr-dict `:` type($source)\n ``\n custom(ref($source_indices), type($source_indices))\n `` `,` type($dest) ( `->` type($result)^ )?" }, { "name": "iree_gpu.barrier_region", "summary": "Synchronizes workers on a region of shared code.", "description": "This op is designed to represent synchronization of workers on the operands\n and results of the given region. This operation naturally arises when combining\n the regions of producer-consumer `scf.forall` operations that share a\n mapping type.\n\n For example, consider the following pair of parallel loops.\n ```mlir\n %0 = scf.forall (%idy, %idx) in (2, 32) shared_outs(%init = %empty) -> (tensor<4x128xf32>) {\n %in = ...\n %2 = affine.apply #affine_map<(d0) -> (d0 * 2)> (%idy)\n %3 = affine.apply #affine_map<(d0) -> (d0 * 4)> (%idx)\n scf.forall.in_parallel {\n tensor.parallel_insert_slice %in into %init[%2, %3] [2, 4] [1, 1]\n : tensor<2x4xf32> into tensor<4x128xf32>\n }\n } {mapping = [#gpu.thread, #gpu.thread]}\n %1 = scf.forall (%idy, %idx) in (8, 8) -> (tensor<128x128xf32>) {\n %4 = affine.apply #affine_map<(d0) -> (d0 * 16)> (%idx)\n %extracted_slice = tensor.extract_slice %0[0, %4] [4, 16] [1, 1]\n : tensor<4x128xf32> to tensor<4x16xf32>\n ...\n } {mapping = [#gpu.thread, #gpu.thread]}\n ```\n\n Because these loops share the same worker type and total count, the bodies\n of these two loops can be merged with a barrier an insert_slice and a\n shuffle where the boundary of the loops currently is.\n\n ```mlir\n %0 = scf.forall (%idy, %idx) in (8, 8) -> (tensor<4x128xf32>) {\n %alloc = bufferization.alloc_tensor {memory_space = #gpu.address_space}\n : tensor<4x128xf32>\n %barrier = iree_gpu.barrier_region %alloc {\n ^bb0(%shared: tensor<4x128xf32>):\n %ids = affine.delinearize_index %idy * 8 + %idx to (2, 32) : index\n %in = ...\n %2 = affine.apply #affine_map<(d0) -> (d0 * 2)> (%ids#0)\n %3 = affine.apply #affine_map<(d0) -> (d0 * 4)> (%ids#1)\n %inserted_slice = tensor.insert_slice %in into %shared[%2, %3] [2, 4] [1, 1]\n : tensor<2x4xf32> to tensor<4x128xf32>\n iree_gpu.yield %slice : tensor<4x16xf32>\n } : tensor<4x128xf32> -> tensor<4x16xf32>\n %4 = affine.apply #affine_map<(d0) -> (d0 * 16)> (%idx)\n %slice = tensor.extract_slice %barrier[0, %4] [4, 16] [1, 1] : tensor<4x128xf32> to tensor<4x16xf32>\n ...\n } {mapping = [#gpu.thread, #gpu.thread]}\n ```\n\n A barrier_region can be lowered to two barriers, one on the input operands\n and a second one on the results.\n\n Movtivation and Intended Use Cases:\n\n The primary way this op is generated is when fusing parallel loops with\n tensor results. This operation helps to make lowerings more progressive\n and flexible.\n - Lowering directly to an alloc + reads and writes breaks the dependency\n chain making transformations like barrier placement and pipelining\n potentially more difficult.\n - Allows the option of non-vector based lowering paths.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "(`ins` `(` $inputs^ `:` type($inputs) `)` )?\n $region attr-dict `:` type($results)" }, { "name": "iree_gpu.buffer_resource_cast", "summary": "Represents a cast to addr_space<7> (buffer resource) before bufferization.", "description": "Nominal cast of a tensor to AMDGPU buffer resource memory space before\n bufferization. This op takes the parameters with which to perform the cast\n if |input| bufferizes to `storage_buffer` memory space. If |input| resolves\n to any other memory space this op is silently dropped and has no effect.\n\n If |cache_swizzle_stride| is present, there is verification before\n bufferization that all producers of |input| are view-like and single source\n and user (i.e. trivially no alias). In all other cases this op is best\n effort and has no verification or failure modes.\n\n // TODO: Add other parameters for casting as needed.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "cache_swizzle_stride", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "AllTypesMatch<['input', 'result']>" } ], "assemblyFormat": "$input oilist (`cacheSwizzleStride` `(` $cache_swizzle_stride `)` )\n attr-dict `:` type($result)" }, { "name": "iree_gpu.coalesced_gather_dma", "summary": "Coalesced gather DMA operation for efficient GPU memory access", "description": "Performs a coalesced gather operation.\n This operation can exist in two forms: a tensor-based\n (value-semantic) form and a buffer-based (memref-semantic) form.\n\n In both forms, it reads elements from a source operand based on the\n optional `indices` operand and writes the gathered data into the\n destination `init` operand using destination-passing style.\n\n The `indices` operand is optional. The `source` represents the data\n loaded by this thread, while `init` is the collective output for all\n threads in the subgroup. Therefore, `source` and `init` may have\n different shapes (typically source is smaller, representing one\n thread's portion).\n\n The operation is specifically designed for subgroup-level\n parallelism, where threads within a subgroup cooperatively gather\n data with coalesced memory accesses. It implements\n ParallelCombiningOpInterface and must live inside an op implementing\n `InParallelOpInterface`, such as `scf.forall.in_parallel`.\n\n ## Lowering Paths\n\n Two lowering strategies are supported:\n 1. Lowers to `amdgpu.gather_to_lds` operations when lowering\n requirements are met.\n 2. Default lowering using `vector.gather` operations.\n\n ## Operands and Results\n\n * `$indices`: The variadic `indices` operand is an optional tensor\n or vector of indices to gather from `source`. If the indices are\n present, their shape must be a prefix of the `init`/`result` type.\n Each element of `indices` must be a 1D tensor or vector whose\n length matches the length of the corresponding dimension of `source`.\n\n The values in `indices` form indices into the memref starting at\n `source` from which a given thread will gather data, and each\n tensor/vector component in `indices` corresponds to one index\n dimension in `source`.\n Any component that is not specified is implicitly assumed to be\n `[0, 1, ..., len - 1]` where `len` is the length of the\n corresponding dimension of source. That is, gather all the\n elements along that dimension.\n\n This operation will gather data into its result as by setting:\n ```\n forall (i0, i1, ... iN) in (dim(source, 0), dim(source, 1), ...\n dim(source, N)):\n result[i0, i1, ... iN-1, iN + lane_id * dim(init, N)] =\n source[indices[0][i0], indices[1][i1], ..., indices[N][iN]]\n ```\n where `lane_id` is the ID of the thread within its subgroup.\n\n Note that, in order to enable efficient gathers, the trailing\n dimension of `source` must have unspecified indices and the dim's\n size must be a supported DMA width for your target.\n\n `$indices` supports both index and i32 element types. The reason\n is that one lowering path (from linalg_ext.gather) already have\n indices in i32 type.\n\n * `$source`: Source tensor/memref containing the data to be gathered.\n * `$init`: Destination tensor/memref receiving the gathered data\n (destination-passing style).\n * `lane`: The lane that specifies the coalescing store's offset within the\n workgroup/shared memory.\n\n ## In-Bounds Attribute\n\n The optional `in_bounds` attribute is a boolean array with one entry per\n dimension of `init`. When not present, all dimensions are treated as\n in-bounds (source and init must have matching sizes for non-indexed dims).\n\n When present, `in_bounds[i] = false` indicates that the source may be\n smaller than init along dimension `i`. Reads beyond the source extent\n return zero (padding semantics). This enables fusion of `tensor.pad`\n with zero padding into the DMA operation.\n\n `in_bounds[i] = true` means the source and init sizes match along that\n dimension, and no padding is needed.\n\n ## Example of a single subgroup using coalesced_gather_dma in copy mode\n for transferring tensor<4x128xf32>, with an intended DMA width of 128 bits\n (4 x f32), with subgroup size 32:\n ```mlir\n scf.forall (%arg6) in (32) ... {\n %2 = %arg6 * 4\n %thread_slice = ... : tensor<4x128xf32>\n %dest_slice = ... : tensor<4x128xf32>\n scf.forall.in_parallel {\n iree_gpu.coalesced_gather_dma %thread_slice into %dest_slice lane(%arg6) : ...\n }\n } {mapping = [#gpu.lane_id]}\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensorOrMemRef" }, { "name": "indices", "type": "Variadic>" }, { "name": "init", "type": "AnyRankedTensorOrMemRef" }, { "name": "lane", "type": "Index" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "in_bounds", "type": "OptionalAttr>" } ], "assemblyFormat": "$source (`[` $indices^ `]`)? `into` $init `lane` `(` $lane `)`\n (`in_bounds` $in_bounds^)?\n attr-dict `:` type(operands) ( `->` type($result)^ )?" }, { "name": "iree_gpu.global_load_dma", "summary": "Does a global load DMA operation", "description": "This operation represents a subgroup-level global load DMA operation.\n It is used to represent a direct gathering operation from global memory to workgroup.\n To be specific, the thread gathers data from the global memoryspace at the designated\n indices, and stores it to the thread's lane-offset of the workgroup memref at the\n designated indices.\n\n Specifically, if the thread's subgroup lane id is `lane_id`, the thread will load the data\n from `$source[sourceIndices]` and store it to `$target[targetIndices] + lane_id`.\n Collectively, all threads in the subgroup orchestrate the load DMA operation.\n\n Note: each gather has a load width is 32bit.", "operands": [ { "name": "source", "type": "AnyMemRef" }, { "name": "sourceIndices", "type": "Variadic" }, { "name": "target", "type": "AnyMemRef" }, { "name": "targetIndices", "type": "Variadic" } ], "assemblyFormat": "$source`[` $sourceIndices `]` `->` $target `[` $targetIndices `]` attr-dict\n `:` type($source) `->` type($target)" }, { "name": "iree_gpu.global_subgroup_barrier", "summary": "Synchronization-only barrier across all subgroups.", "description": "All subgroups in the workgroup must reach any instance of this op before\n any can proceed past it. Unlike `gpu.barrier`, this op has no memory\n fence semantics - memory operations can be freely reordered with respect\n to it. Fences are handled separately.\n\n This operation operates on a single, global workgroup-wide barrier object\n that can implement such dynamic join and must not be used if such a barrier\n isn't available.", "assemblyFormat": "attr-dict" }, { "name": "iree_gpu.subgroup_scan", "summary": "Prefix scan across subgroup lanes with total.", "description": "Performs a prefix scan of a scalar value across lanes within a subgroup\n cluster, and returns the cluster total as a second result. The scan can\n be either inclusive or exclusive:\n\n - **Inclusive** (`inclusive` keyword present): lane at logical position `p`\n receives `val_0 op val_1 op ... op val_p`. No identity is needed.\n - **Exclusive** (default, no `inclusive` keyword): lane at position `p`\n receives `identity op val_0 op ... op val_{p-1}`. Lane 0 receives the\n identity. The `identity` operand is required for exclusive mode.\n\n The combiner is specified by the region body, which takes two arguments\n of the value type and yields one result.\n\n The subgroup is divided into clusters of `size` lanes starting at lane 0\n with inter-lane `stride`.\n\n The second result `total` is the reduction of all values in the cluster:\n `val_0 op val_1 op ... op val_{size-1}`.\n\n The combiner must be associative. It does not need to be commutative.\n\n Examples:\n ```mlir\n // Exclusive scan:\n %scan, %total = iree_gpu.subgroup_scan(%x, identity = %zero : f32)\n cluster(size = 4, stride = 2) {\n ^bb0(%lhs: f32, %rhs: f32):\n %add = arith.addf %lhs, %rhs : f32\n iree_gpu.yield %add : f32\n } : f32\n\n // Inclusive scan:\n %scan, %total = iree_gpu.subgroup_scan inclusive (%x)\n cluster(size = 4) {\n ^bb0(%lhs: f32, %rhs: f32):\n %add = arith.addf %lhs, %rhs : f32\n iree_gpu.yield %add : f32\n } : f32\n ```", "operands": [ { "name": "value", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat]>" }, { "name": "identity", "type": "Optional>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat]>" }, { "name": "total", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat]>" } ], "attributes": [ { "name": "inclusive", "type": "UnitAttr" }, { "name": "cluster_size", "type": "OptionalAttr" }, { "name": "cluster_stride", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "combiner", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result', 'total']>" } ], "assemblyFormat": "(`inclusive` $inclusive^)?\n `(` $value (`,` `identity` `=` $identity^ `:` type($identity))? `)`\n (`cluster` `(` `size` `=` $cluster_size^\n (`,` `stride` `=` $cluster_stride^)? `)`)?\n $combiner attr-dict `:` type($value)" }, { "name": "iree_gpu.value_barrier", "summary": "Synchronizes workers on a value semantic tensor or vector.", "description": "This operation acts as a barrier on a value semantic SSA values (tensor or\n vector). It takes multiple operands and produces a value equivalent to each\n input. This does not have copy and/or data movement semantics and simply\n represents a barrier on all writes in the tensor case, and a barrier until\n all threads acquire the input vector in the vector case.\n\n The inputs must be either all tensors, or all vectors.\n\n This operation is a no-op when not present in a parallel context. This\n operation is pure as it only requires synchronization for the value it\n produces.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AllTypesMatch<['inputs', 'results']>" } ], "assemblyFormat": "$inputs attr-dict `:` type($inputs)" }, { "name": "iree_gpu.yield", "summary": "Yield values from a iree_gpu region.", "description": "This operation is used to yield values from a within a region.", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($values^ `:` type($values))?" }, { "name": "iree_linalg_ext.arg_compare", "summary": "Performs an arg-reduction using a user-defined comparator.", "description": "The `arg_compare` op performs a reduction over a given dimension of a tensor,\n returning both the selected value and its corresponding index. The selection\n logic is defined by a user-specified comparator region.\n\n The operation supports three index modes for flexibility in tiling:\n\n 1. Implicit-index without index_base (single input, no index_base):\n Indices are computed from local position (linalg.index on reduction dimension).\n Used for untiled operations or when global offset is not needed.\n\n 2. Implicit-index with index_base (single input, with index_base):\n Indices are computed as: index_base + local position.\n Used in OuterParallel tiling where each parallel chunk has a fixed offset.\n\n 3. Explicit-index (two inputs: values + indices, no index_base):\n Indices are provided as input tensor alongside values.\n Used in OuterReduction tiling and merge operations where indices are\n accumulated across iterations.\n\n The comparator region defines the sorting rule, e.g., \"greater than\" for argmax or\n \"less than\" for argmin, allowing for generalization beyond simple argmax-style\n behavior.\n\n Example (implicit-index mode - argmax over dim 1):\n ```mlir\n %input = memref<2x10xf32>\n %out_val = memref<2xf32>\n %out_idx = memref<2xi32>\n iree_linalg_ext.arg_compare\n dimension(1)\n ins(%input : memref<2x10xf32>)\n outs(%out_val, %out_idx : memref<2xf32>, memref<2xi32>) {\n ^bb0(%a: f32, %b: f32):\n %cmp = arith.cmpf ogt, %a, %b : f32\n iree_linalg_ext.yield %cmp : i1\n }\n ```\n\n Example (implicit-index mode with index_base = 5):\n ```mlir\n %input = memref<2x10xf32>\n %out_val = memref<2xf32>\n %out_idx = memref<2xi32>\n %base = arith.constant 5 : index\n iree_linalg_ext.arg_compare\n dimension(1)\n ins(%input : memref<2x10xf32>)\n outs(%out_val, %out_idx : memref<2xf32>, memref<2xi32>)\n index_base(%base : index) {\n ^bb0(%a: f32, %b: f32):\n %cmp = arith.cmpf ogt, %a, %b : f32\n iree_linalg_ext.yield %cmp : i1\n }\n ```\n\n Example (explicit-index mode - combining partial results):\n ```mlir\n %partial_vals = memref<2x4xf32>\n %partial_idxs = memref<2x4xi32>\n %out_val = memref<2xf32>\n %out_idx = memref<2xi32>\n iree_linalg_ext.arg_compare\n dimension(1)\n ins(%partial_vals, %partial_idxs : memref<2x4xf32>, memref<2x4xi32>)\n outs(%out_val, %out_idx : memref<2xf32>, memref<2xi32>) {\n ^bb0(%a: f32, %b: f32):\n %cmp = arith.cmpf ogt, %a, %b : f32\n iree_linalg_ext.yield %cmp : i1\n }\n ```\n\n The `index_base` is optional. When specified, it is added to the selected index\n in the result, which is useful when reducing over a tiled or sliced subregion.", "operands": [ { "name": "input_value", "type": "AnyShaped" }, { "name": "input_index", "type": "Optional" }, { "name": "output_value", "type": "AnyShaped" }, { "name": "output_index", "type": "AnyShaped" }, { "name": "index_base", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n `ins` `(` $input_value (`,` $input_index^)? `:` type($input_value) (`,` type($input_index)^)? `)`\n `outs` `(` $output_value `,` $output_index `:` type($output_value) `,` type($output_index) `)`\n (`index_base` `(` $index_base^ `:` type($index_base) `)`)?\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.attention", "summary": "Attention operator.", "description": "Computes the scaled dot product attention function:\n\n attention(Q, K, V, scale) = softmax(Q @ K.T * scale) @ V\n\n Here Q, K, V are given tensors and scale is a scalar value specifying\n the scale to use.\n\n If an additional mask argument M is included, the result of the first matmul is modified according to:\n\n Q @ K.T += M", "operands": [ { "name": "query", "type": "AnyShaped" }, { "name": "key", "type": "AnyShaped" }, { "name": "value", "type": "AnyShaped" }, { "name": "scale", "type": "AnyFloat" }, { "name": "mask", "type": "Optional" }, { "name": "output", "type": "AnyShaped" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "decomposition_config", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict\n `ins` `(` $query `,` $key `,` $value `,` $scale (`,` $mask^)? `:` type($query) `,` type($key) `,` type($value) `,` type($scale) (`,` type($mask)^ )?`)`\n `outs` `(` $output `:` type($output) `)`\n $region\n (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.custom_op", "summary": "Custom operation for compiling with IREE.", "description": "This operation is meant to allow computation sequences that are fused at\n tile level prescriptively. This is to account for cases where such fusion\n cannot/is not yet discovered appropriately.\n\n The operation implements all the interfaces needed to be able to\n 1. Compile e2e using IREE\n 2. Still be able to fuse with other operations that the compiler can\n figure out automatically.\n\n Similar to how `LinalgOp`s represent a perfectly nested loop computation\n with\n - `indexing_maps` representing how the `ins`/`outs` are accessed\n - `region` representing the scalar computation performed\n - `iterator_types` representing the dependence along each iteration space\n dimension\n this operation represent a tiled computation with perfectly nested\n inter-tile loop nest.\n - `indexing_maps` represent what slices slices of the `ins`/`outs` are\n needed for each iteration of the tiled computation.\n - `region` represents the tiled computation performed using these slices\n - `iterator_types` represents the dependence between tiles along each\n iteration space.\n\n Some modifications required to handle the tile-level semantics are\n - Some dimensions of operands might not be accessed by dimensions of the\n inter-tile iteration space. This means that along these dimensions the\n slice size matches the dimension size. This access pattern of operands\n is captured in the respective indexing map using a `symbol` to represent\n that the entire dimension needs to be sliced.\n - The basic block arguments of the region represent the slice of the\n operand. These are either scalar types (if the corresponding operand is a\n scalar), or a `tensor` type with dynamic shapes (if the corresponding\n operand is a `tensor` type).\n\n For example, one could represent a prescriptively fused matmul computation\n as follows\n\n ```\n %0:2 = iree_linalg_ext.custom_op {\n indexing_maps = [affine_map<(d0, d1)[s0, s1] -> (d0, s0)>,\n affine_map<(d0, d1)[s0, s1] -> (s0, s1)>,\n affine_map<(d0, d1)[s0, s1] -> (s1, d1)>,\n affine_map<(d0, d1)[s0, s1] -> (d0, s1)>,\n affine_map<(d0, d1)[s0, s1] -> (d0, d1)],\n iterator_types = [\"parallel\", \"parallel\"]}\n ins(%lhs1, %rhs1, %rhs2\n : tensor<1000000x?xf32>, tensor, tensor)\n outs(%outs1, %outs2 : tensor<1000000x?xf32>, tensor<1000000x?xf32>) {\n ^bb0(%t0 : tensor, %t1 : tensor, %t2 : tensor,\n %t3 : tensor, %t4 : tensor) :\n %0 = linalg.matmul ins(%t0, %t1 : tensor, tensor)\n outs(%t3 : tensor) -> tensor\n %1 = linalg.matmul ins(%0, %t2 : tensor, tensor)\n outs(%t4 : tensor) -> tensor\n iree_linalg_ext.yield %0, %1 : tensor, tensor\n } -> tensor<1000000x?xf32>, tensor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "iterator_types", "type": "TypedArrayAttrBase" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`{` `indexing_maps` `=` $indexing_maps `,`\n `iterator_types` `=` $iterator_types `}`\n attr-dict-with-keyword\n (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n (`outs` `(` $outputs^ `:` type($outputs) `)`)?\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.exp_reduction", "summary": "A linalg.generic extension with support for exponential reduction.", "description": "This operation is a restricted form of a linalg.generic operation,\n representing a reduction over `e^{x}` where `x` is an input, and it is known\n that the function's result is independent of translation over x,\n i.e. f(x) = f(x + c).\n\n Since `e{x}` grows exponentially for `x > 0`, if the values of `x` are\n unbounded, the intermediate computation for `e^{x}` in `f(x)`, may not fit\n in the floating point range, even if the result does. To prevent such\n numerical inaccuracies, we can instead compute `f(max(x) - x)`, which will\n ensure that `e{max(x) - x}` always fits in the range (0, 1], because\n 0 < e{negative} <= 1.\n\n These properties allow us to compute an online normalization of this\n function, in which we don't have to compute the `max(x)` as a separate\n reduction, but as a running max.\n\n Generally, these properties are hard to infer from a linalg.generic, because\n two back-to-back reduction combiners in a linalg.generic can have hard to\n infer properties. This restricted form ensures we don't have to do\n complicated analysis to infer these properties.\n\n The first input and output operands are intrinsically linked.\n - The first output operand is always the maximum of the first input operand,\n henceforth 'nmax'.\n - The first input operand in the basic block is always `2^{nmax-x}`, where\n `x` is the value\n\n `norm` is calculated by `2^{nmax - pmax}`, where\n - `pmax` is the value from the previous iteration.\n - `nmax` is the new maximum, read from the current element from the input\n tensor\n\n The other input operands are unaffected.\n\n The operands listed in `exp_reduced_operands` will be multiplied by `norm`\n before executing the basic block. Other output operands are unaffected.\n\n For example, we write the online normalized softmax algorithm as follows:\n\n ```mlir\n // compute the exponentials and the sum\n %M, %O = iree_linalg_ext.exp_reduction {\n indexing_maps = [\n affine_map<(i) -> (i)>,\n affine_map<(i) -> ()>,\n affine_map<(i) -> ()>\n ],\n iterator_types = [\n #iree_linalg_ext.iterator_type\n ],\n exp_reduced_operands = [ 1 ] // 1 corresponds to %s being normalized by %m\n } ins(%V: tensor<256xf32>)\n outs(%M_init, %S: tensor, tensor) {\n ^bb0(%exp_v: f32, %m: f32, %s: f32):\n // take note of the operand names when comparing with the subsequent\n // code snippets\n %add = arith.addf %exp_v, %s : f32\n linalg.yield %m, %add : f32, f32\n } -> tensor, tensor\n ```\n\n This encodes the following computation, sans handling of the norms\n\n ```\n %M, %O = linalg.generic {\n indexing_maps = [\n affine_map<(i) -> (i)>,\n affine_map<(i) -> ()>,\n affine_map<(i) -> ()>\n ],\n } ins(%V: tensor<256xf32>)\n outs(%M_init, %S: tensor, tensor) {\n ^bb0(%v: f32, %m: f32, %s: f32):\n %exp_v = math.exp2 %v : f32\n %add = arith.addf %exp_v, %s : f32\n linalg.yield %m, %add : f32, f32\n } -> tensor, tensor\n ```\n\n And decomposes into operations equivalent to the following:\n\n ```\n %M, %O = linalg.generic {\n indexing_maps = [\n affine_map<(i) -> (i)>,\n affine_map<(i) -> ()>,\n affine_map<(i) -> ()>\n ],\n } ins(%V: tensor<256xf32>)\n outs(%M_init, %S: tensor, tensor) {\n ^bb0(%v: f32, %prev_m: f32, %prev_s: f32):\n %m = arith.maximumf %v, %prev_m : f32\n %m_diff = arith.subf %m, %prev_m : f32\n %norm = math.exp2 %m_diff : f32\n\n %exp_v = math.exp2 %v : f32 // raise v to the exponent\n %s = arith.mulf %prev_s, %norm : f32 // multiply s by the norm\n %add = arith.addf %exp_v, %s : f32\n linalg.yield %m, %add : f32, f32\n } -> tensor, tensor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "iterator_types", "type": "TypedArrayAttrBase" }, { "name": "exp_reduced_operands", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`{`\n `indexing_maps` `=` $indexing_maps `,`\n `iterator_types` `=` $iterator_types `,`\n `exp_reduced_operands` `=` $exp_reduced_operands\n `}`\n attr-dict\n `ins` `(` $inputs `:` type($inputs) `)`\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.fft", "summary": "Fft operator.", "description": "Apply 1D FFT to innermost dim. This is an iterative FFT, not recurrsive.\n Thus, the bit reversal is assumed applied on the input. The op carries an\n input -- stage, which indicates the level of reduction loop in the\n algorithm. It represents the computation body. For more details, see\n \"Data reordering, bit reversal, and in-place algorithms\" section in\n https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm\n\n The size of innermost dim is expected to be a power of 2.\n\n It is optional to carry coefficient tensors/buffers as inputs. In this\n context, they will be the second and third inputs.", "operands": [ { "name": "stage", "type": "AnyType" }, { "name": "real_coeff", "type": "Optional" }, { "name": "imag_coeff", "type": "Optional" }, { "name": "real", "type": "AnyShaped" }, { "name": "imag", "type": "AnyShaped" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `ins` `(` $stage (`,` $real_coeff^ `,` $imag_coeff)? `:` type($stage) (`,` type($real_coeff)^ `,` type($imag_coeff))? `)`\n `outs` `(` $real `,` $imag `:` type($real) `,` type($imag) `)`\n (`:` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.gather", "summary": "Gathers slices from a source based on a tensor of indices.", "description": "Takes two or three inputs (`source`, `indices`, and optional `mask`) and\n one output value (`output`). The operation returns the value at the slices\n specified by `indices`.\n\n The size of the `dimension_map` attribute is used to determine how many\n indices are used to index into `source`, i.e. `index_depth`. The\n `dimension_map` attribute describes which index value maps to which dimension\n in the destination.\n\n This operation preforms the opposite operation of `iree_linalg_ext.scatter`.\n Instead of scattering `updates` into `original`, it gathers the values from\n `source` into `output` using the indices in `indices`. See the documentation\n on `iree_linalg_ext.scatter` for more details regarding the indexing/shape\n semantics.\n\n If the optional operand `mask` is present, it must have batch shape and a\n boolean element type (`i1`, or storage-legalized `i8` in backend\n pipelines). A `false` mask value suppresses the corresponding gather\n update, leaving `output` unchanged for that batch element.", "operands": [ { "name": "source", "type": "AnyRankedTensorOrMemRef" }, { "name": "indices", "type": "AnyRankedTensorOrMemRef" }, { "name": "mask", "type": "Optional" }, { "name": "output", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension_map", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "attr-dict `dimension_map` `=` $dimension_map\n `ins` `(` $source `,` $indices (`,` $mask^)? `:` type($source) `,` type($indices) (`,` type($mask)^)? `)`\n `outs` `(` $output `:` type($output) `)`\n (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.im2col", "summary": "Im2col operation for convolutions.", "description": "Transforms a convolution input tensor into a GEMM-compatible layout. Each\n output position `(batch, m, k)` maps to a specific input element determined\n by the convolution metadata (strides, dilations, kernel_size).\n\n #### Attributes\n\n **Convolution metadata** — derived from the original convolution:\n - `strides`: source-coordinate stride per `m_pos` dimension.\n - `dilations`: source-coordinate dilation per `m_pos` dimension.\n - `kernel_size`: filter/window extent per `m_pos` dimension.\n\n Spatial `m_pos` dimensions use the original convolution window metadata.\n `m_pos` dimensions without a real filter window, such as convolution batch\n dimensions, use synthetic unit metadata (`stride = dilation = kernel = 1`).\n\n **Dimension mapping** — describes which input dimensions are GEMM batch,\n M, or K dimensions:\n - `batch_pos`: input dimensions that are GEMM batch/pass-through dims.\n For convolution lowering, this is used for depth/group-like dimensions,\n not convolution batch dimensions that only index the image/output.\n - `m_pos`: input dimensions that form GEMM M coordinates. For convolution\n lowering, this includes convolution batch dimensions and output image\n dimensions.\n - `k_pos`: input dimensions that form direct GEMM K coordinates, such as\n input channel dimensions.\n\n **Indexing**:\n - `offsets`: one offset per output dimension in canonical\n `[Batch..., M..., K...]` order. Updated by tiling to reflect the tile\n position; `output_sizes` remain unchanged.\n - `output_sizes`: nested list of delinearization sizes per output dimension.\n Each entry describes how to delinearize that output dimension back to\n spatial/channel coordinates. For example:\n `output_sizes = [[2], [32], [32], [1, 3, 3, 640]]` with empty\n `batch_pos` means M dims delinearize into [N=2], [OH=32], [OW=32], and K\n delinearizes into [unit N window=1, KH=3, KW=3, C=640].\n\n **Layout permutations**:\n - `input_k_perm`: permutation that maps the delinearized K output dimension\n coordinates (window offsets from M dims, synthetic unit coordinates, and\n channel indices) to their corresponding input dimension positions. Used\n when the filter layout differs from the input layout (e.g., input=HWC,\n filter=CHW requires `input_k_perm = [2, 0, 1]`). The identity permutation\n means the layouts are already aligned.\n - `output_perm`: permutation of the canonical `[Batch, M, K]` order to the\n actual output tensor layout. For example, `output_perm = [2, 0, 1]` means\n the result is in `KxBxM` layout.\n\n **Padding** (optional):\n - `input_pad_low` / `input_pad_high`: per-input-dimension padding amounts,\n representing absorbed input padding (e.g., from a folded tensor.pad).\n Source coordinates are computed in the padded coordinate space; reads\n outside the unpadded input bounds produce `pad_value`.\n - `output_pad_low` / `output_pad_high`: per-output-dimension padding\n amounts in actual output tensor dim order, representing how many\n positions at the start/end of each output dimension are outside the\n valid region. Valid region for output dim d is\n `[output_pad_low[d], tensor_dim[d] - output_pad_high[d])`.\n Updated during tiling to reflect tile-local padding amounts.\n - `pad_value`: the value for out-of-bounds positions. Can be present\n without `input_pad_low`/`input_pad_high` when only output padding exists\n (e.g., from GEMM alignment). When absent, there is no padding.\n\n #### Semantics\n\n For each output position, the op computes input coordinates, where `i`\n indexes over `m_pos` dimensions and `j` indexes over `k_pos` dimensions:\n ```\n m_input_coord[i] = m_coord[i] * stride[i] + window_offset[i] * dilation[i]\n channel_coord[j] = k_coord[j]\n ```\n where `m_coord` and `window_offset`/`k_coord` come from delinearizing the\n M and K output indices using `output_sizes`. For a convolution batch M dim,\n the synthetic unit metadata makes `window_offset = 0`, so the input\n coordinate is the M coordinate directly.\n\n #### Examples\n\n Basic im2col (NHWC conv, 3x3 kernel):\n ```mlir\n %im2col = iree_linalg_ext.im2col\n strides = [1, 1, 1] dilations = [1, 1, 1] kernel_size = [1, 3, 3]\n offsets = [0, 0, 0, 0]\n output_sizes = [[2], [32], [32], [1, 3, 3, 640]]\n batch_pos = [] m_pos = [0, 1, 2] k_pos = [3]\n input_k_perm = [0, 1, 2, 3] output_perm = [0, 1, 2, 3]\n ins(%in : tensor<2x34x34x640xf32>)\n outs(%out : tensor<2x32x32x5760xf32>) -> tensor<2x32x32x5760xf32>\n ```\n\n With input padding (same padding absorbed from tensor.pad):\n ```mlir\n %im2col = iree_linalg_ext.im2col\n strides = [1, 1, 1] dilations = [1, 1, 1] kernel_size = [1, 3, 3]\n offsets = [0, 0, 0, 0]\n output_sizes = [[2], [34], [34], [1, 3, 3, 640]]\n batch_pos = [] m_pos = [0, 1, 2] k_pos = [3]\n input_k_perm = [0, 1, 2, 3] output_perm = [0, 1, 2, 3]\n input_pad_low = [0, 1, 1, 0] input_pad_high = [0, 1, 1, 0]\n pad_value(%cst : f32)\n ins(%in : tensor<2x34x34x640xf32>)\n outs(%out : tensor<2x34x34x5760xf32>) -> tensor<2x34x34x5760xf32>\n ```\n\n With output-only padding (GEMM alignment, no input padding):\n ```mlir\n // K valid = 1*3*3*640 = 5760; output has 5768 (8 extra K positions\n // filled with pad_value for GEMM alignment).\n %im2col = iree_linalg_ext.im2col\n strides = [1, 1, 1] dilations = [1, 1, 1] kernel_size = [1, 3, 3]\n offsets = [0, 0, 0, 0]\n output_sizes = [[2], [32], [32], [1, 3, 3, 640]]\n batch_pos = [] m_pos = [0, 1, 2] k_pos = [3]\n input_k_perm = [0, 1, 2, 3] output_perm = [0, 1, 2, 3]\n output_pad_low = [0, 0, 0, 0] output_pad_high = [0, 0, 0, 8]\n pad_value(%cst : f32)\n ins(%in : tensor<2x34x34x640xf32>)\n outs(%out : tensor<2x32x32x5768xf32>) -> tensor<2x32x32x5768xf32>\n ```", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" }, { "name": "kernel_size", "type": "Variadic" }, { "name": "offsets", "type": "Variadic" }, { "name": "output_sizes", "type": "Variadic" }, { "name": "input_pad_low", "type": "Variadic" }, { "name": "input_pad_high", "type": "Variadic" }, { "name": "output_pad_low", "type": "Variadic" }, { "name": "output_pad_high", "type": "Variadic" }, { "name": "pad_value", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DenseI64ArrayAttr" }, { "name": "dilations", "type": "DenseI64ArrayAttr" }, { "name": "static_kernel_size", "type": "DenseI64ArrayAttr" }, { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_output_sizes", "type": "ArrayAttr" }, { "name": "batch_pos", "type": "DenseI64ArrayAttr" }, { "name": "m_pos", "type": "DenseI64ArrayAttr" }, { "name": "k_pos", "type": "DenseI64ArrayAttr" }, { "name": "input_k_perm", "type": "DenseI64ArrayAttr" }, { "name": "output_perm", "type": "DenseI64ArrayAttr" }, { "name": "static_input_pad_low", "type": "DefaultValuedAttr" }, { "name": "static_input_pad_high", "type": "DefaultValuedAttr" }, { "name": "static_output_pad_low", "type": "DefaultValuedAttr" }, { "name": "static_output_pad_high", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `strides` `=` $strides\n `dilations` `=` $dilations\n `kernel_size` `=`\n custom($kernel_size, $static_kernel_size)\n `offsets` `=`\n custom($offsets, $static_offsets)\n `output_sizes` `=`\n custom($output_sizes, $static_output_sizes)\n `batch_pos` `=` $batch_pos\n `m_pos` `=` $m_pos\n `k_pos` `=` $k_pos\n `input_k_perm` `=` $input_k_perm\n `output_perm` `=` $output_perm\n (`input_pad_low` `=`\n custom($input_pad_low, $static_input_pad_low)\n `input_pad_high` `=`\n custom($input_pad_high, $static_input_pad_high)^)?\n (`output_pad_low` `=`\n custom($output_pad_low, $static_output_pad_low)\n `output_pad_high` `=`\n custom($output_pad_high, $static_output_pad_high)^)?\n (`pad_value` `(` $pad_value^ `:` type($pad_value) `)`)?\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `:` type($output) `)`\n (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.index", "summary": "LinalgExt index operation.", "description": "This operation is a mirror of `linalg.index` operation and has the same\n semantics, except that `linalg.index` enforces that the parent op is a\n `LinalgOp`, and the `iree_linalg_ext.index` operation enforces that the\n parent op is one of `IREE::LinalgExt::CustomOp`,\n `IREE::LinalgExt::AttentionOp`, or `IREE::LinalgExt::OnlineAttentionOp`.", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "ConfinedAttr]>" } ], "assemblyFormat": "$dim attr-dict `:` type($result)" }, { "name": "iree_linalg_ext.map_gather", "summary": "Gather with a mapping from result indices to source indices.", "description": "Takes two operands, `source` and `output`, and reads every element from\n the `source` based on a computed index mapping to store into the `output`.\n If the operands are tensors, the op will also return a Value for the result.\n For an element of the `output`, the index to read from the `source` is\n determined by index computation mapping the index in the `output` value to\n an index in the `source` value. This computation is contained in the\n `transformation_region`, which contains a single block, with one argument\n for each dimension in the `output` value. The block arguments represent the\n index of a given element along the corresponding dimension (i.e., block arg\n `i` represents the index along dimension `i` of the `output` value). The\n block is terminated by an iree_linalg_ext.yield op, which yields one index\n for each dimension in the `source`, and an additional padding value which\n represents the value to use if the computed source indices are out of bounds.", "operands": [ { "name": "source", "type": "AnyShaped" }, { "name": "output", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "transformation_region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict $source `into` $output\n $transformation_region\n `:` type($source) `into` type($output) (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.map_load", "summary": "Load with a mapping from result indices to source indices.", "description": "Takes two operands, `source` and `output`, and reads every element from\n the `source` based on a computed index mapping to store into the `output`.\n If the operands are tensors, the op will also return a Value for the result.\n For an element of the `output`, the index to read from the `source` is\n determined by index computation mapping the index in the `output` value to\n an index in the `source` value. This computation is contained in the\n `transformation_region`, which contains a single block, with one argument\n for each dimension in the `output` value. The block arguments represent the\n index of a given element along the corresponding dimension (i.e., block arg\n `i` represents the index along dimension `i` of the `output` value). The\n block is terminated by an iree_linalg_ext.yield op, which yields one index\n for each dimension in the `source`, and an additional padding value which\n represents the value to use if the computed source indices are out of bounds.", "operands": [ { "name": "source", "type": "AnyShaped" }, { "name": "output", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "transformation_region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict $source `into` $output\n $transformation_region\n `:` type($source) `into` type($output) (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.map_scatter", "summary": "Scatter with a mapping from source indices to result indices.", "description": "Takes two operands, `input` and `output`, and stores every element of\n `input` to a unique location in `output`. If the operands are tensors, the\n op will also return a Value for the result. For an element of the `input`,\n the index to store into the `output` is determined by index computation\n mapping the index in the `input` value to an index in the `output` value.\n This computation is contained in the `transformation_region`, which contains\n a single block, with one argument for each dimension in the `input` value.\n The block arguments represent the index of a given element along the\n corresponding dimension (i.e., block arg `i` represents the index along\n dimension `i` of the `input` value). The block is terminated by an\n iree_linalg_ext.yield op, which yields one index for each dimension in\n the `output`, and an additional `i1` Value, which represents a mask on\n whether or not to write to the `output` at the yielded set of indices. If\n the mask value is true, the input value will be written.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "transformation_region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict $input `into` $output\n $transformation_region\n `:` type($input) `into` type($output) (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.map_store", "summary": "Store with a mapping from source indices to result indices.", "description": "Takes two operands, `input` and `output`, and stores every element of\n `input` to a unique location in `output`. If the operands are tensors, the\n op will also return a Value for the result. For an element of the `input`,\n the index to store into the `output` is determined by index computation\n mapping the index in the `input` value to an index in the `output` value.\n This computation is contained in the `transformation_region`, which contains\n a single block, with one argument for each dimension in the `input` value.\n The block arguments represent the index of a given element along the\n corresponding dimension (i.e., block arg `i` represents the index along\n dimension `i` of the `input` value). The block is terminated by an\n iree_linalg_ext.yield op, which yields one index for each dimension in\n the `output`, and an additional `i1` Value, which represents a mask on\n whether or not to write to the `output` at the yielded set of indices. If\n the mask value is true, the input value will be written.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "transformation_region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict $input `into` $output\n $transformation_region\n `:` type($input) `into` type($output) (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.online_attention", "summary": "Online Attention operator.", "description": "Traditional scaled dot product attention computes:\n\n attention(Q, K, V, scale) = softmax(Q @ K.T * scale) @ V\n\n Online Attention on the other hand, uses an online normalizer instead of\n softmax:\n\n online_attention(Q, K, V, scale, running_max, running_sum)\n = online_normalizer(Q @ K.T * scale, running_max, running_sum) @ V\n\n If an additional mask argument M is included, the result of the first matmul is modified according to:\n\n Q @ K.T += M\n\n The advantage of this online_normalizer is that it can be tiled along\n its reduction dimension, making the online_attention operator:\n - Tilable along softmax reduction dimension\n - Associative along softmax reduction dimension\n - Commutative along softmax associative dimension\n\n Note: The results of online_attention need to be combined after computing\n it over the entire softmax reduction dimension by:\n x, _, sum : results\n x = (1 / sum) * x\n\n Decomposition Configuration:\n The `decomposition_config` attribute is a DictionaryAttr that controls how\n this operation is decomposed into lower-level operations. It supports:\n - \"qk_attrs\": DictionaryAttr - Attributes to attach to the Q@K matmul\n operation after decomposition (e.g., lowering_config, attention markers)\n - \"pv_attrs\": DictionaryAttr - Attributes to attach to the P@V matmul\n operation after decomposition\n - \"use_exp2\": BoolAttr - If true, uses exp2 with log2(e) scaling instead\n of exp. (Gives better perf on some hardware, but trades off accuracy)", "operands": [ { "name": "query", "type": "AnyShaped" }, { "name": "key", "type": "AnyShaped" }, { "name": "value", "type": "AnyShaped" }, { "name": "scale", "type": "AnyFloat" }, { "name": "mask", "type": "Optional" }, { "name": "output", "type": "AnyShaped" }, { "name": "max", "type": "AnyShaped" }, { "name": "sum", "type": "AnyShaped" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "decomposition_config", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict\n `ins` `(` $query `,` $key `,` $value `,` $scale (`,` $mask^)? `:` type($query) `,` type($key) `,` type($value) `,` type($scale) (`,` type($mask)^ )?`)`\n `outs` `(` $output `,` $max `,` $sum `:` type($output) `,` type($max) `,` type($sum) `)`\n $region\n (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.pack", "summary": "LinalgExt pack operation for both tensors and buffers.", "description": "The pack operation converts an `input` into a tiled and packed layout. The\n dimensions to be tiled are obtained from `inner_dims_pos` and the size of the\n tile is obtained from `inner_tiles`. The dimensions listed in `inner_dims_pos`\n do not need to be contiguous in which case the tile will get transposed. We\n handle only full tiles if `padding_value` is not set; it is UB if the tile does\n not perfectly divide the dimension. If `padding_value` is set, it will pad\n along high dimensions, i.e., it pads at the bottom and on the right if the\n input has rank 2, and the result type shape, will be dynamic in any dimension\n if and only if the input shape is. As optional input, the operation takes\n `outer_dims_perm` that allows to permute the tiled loops.\n\n Example KC_to_KCck:\n\n ```mlir\n iree_linalg_ext.pack %arg0 inner_dims_pos = [1, 0]\n inner_tiles = [32, 8] into %arg1 : (memref<128x256xf32> memref<16x8x32x8xf32>)\n ```\n\n Example NC_to_NCnc:\n\n ```mlir\n iree_linalg_ext.pack %arg0 inner_dims_pos = [0, 1]\n inner_tiles = [8, 32] into %arg1 : (memref<128x256xf32> memref<16x8x8x32xf32>)\n ```\n Example KC_to_CKkc\n\n ```mlir\n iree_linalg_ext.pack %arg0 outer_dims_perm = [1, 0] inner_dims_pos = [0, 1]\n inner_tiles = [32, 8] into %arg1 : (memref<128x256xf32> memref<32x4x32x8xf32>)\n ```\n\n In all cases, dimension at position 0 in the input memref (128) is tiled\n with a factor of 8, while dimension at position 1 (256) is tiled with a factor\n of 32. In the KC_to_KCck example, the point loops are interchanged, while in the\n KC_to_CKkc example the tiled loops.\n\n Example NC_to_NCnc with padding:\n\n ```mlir\n iree_linalg_ext.pack %arg padding_value(%pad : f32) inner_dims_pos = [0, 1]\n inner_tiles = [8, 2] into %arg1 : (memref<13x15xf32> memref<2x8x8x2xf32>)\n ```", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" }, { "name": "inner_tiles", "type": "Variadic" }, { "name": "padding_value", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "outer_dims_perm", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_dims_pos", "type": "DenseI64ArrayAttr" }, { "name": "static_inner_tiles", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n $input\n (`padding_value` `(` $padding_value^ `:` type($padding_value) `)`)?\n (`outer_dims_perm` `=` $outer_dims_perm^)?\n `inner_dims_pos` `=` $inner_dims_pos\n `inner_tiles` `=`\n custom($inner_tiles, $static_inner_tiles)\n `into` $output `:` `(` type($input) type($output) `)`\n (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.scan", "summary": "Scan operator.", "description": "Computes the inclusive/exclusive scan along a given dimension.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" }, { "name": "accumulator", "type": "AnyShaped" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" }, { "name": "inclusive", "type": "BoolAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n `inclusive` `(` $inclusive `)`\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `,` $accumulator `:` type($output) `,` type($accumulator) `)`\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.scatter", "summary": "Scatters an input in slices based on a tensor of indices.", "description": "Takes two or three `inputs` (`update`, `indices`, and optional `mask`) and\n one `outputs` value (`original`).\n The operation updates the value at the slices specified by `indices` by\n combining the current value with the value in `updates` using the computation\n specified in `region`. The `region` specifies a binary operation\n of signature `(T, T) -> T`, where `T` is the element-type of\n `updates` (and `original`). The first argument is from `updates`,\n and the second is from `original`.\n\n The size of the `dimension_map` attribute is used to determine how many\n indices are used to index into `original`, i.e. `index_depth`. The\n `dimension_map` attribute describes which index value maps to which dimension\n in the destination.\n\n The operand `indices` is a N-D tensor/memref type that is composed\n of two logical parts. The first `N-1` dimensions represent the batch of\n updates. The last dim (at index `N-1`) is the `index_depth`, which can be\n omitted if `index_depth` is 1.\n\n The operand `update` is a M-D tensor/memref type and similarly\n consists of two parts. The first `N-1` dimensions represent the batch of\n updates. This must exactly match to the first `N-1` dimensions in `indices`.\n Dimensions `N..M-1` represent the slice scattered into `original`,\n `update_slice`, and must match the last dimensions in original. This\n represents a contiguous slice to be inserted into `original`.\n\n The operand `original` is a DPS init representing the destination that\n `update` gets scattered to.\n Where `rank(original) = rank(update_slice) + index_depth`\n\n If the optional operand `mask` is present, it must have batch shape and a\n boolean element type (`i1`, or storage-legalized `i8` in backend\n pipelines). A `false` mask value suppresses the corresponding scatter\n update, leaving `original` unchanged for that batch element.\n\n The unique_indices attribute carries the information whether all the\n indices are unique. If `unique_indices` is `true` and two or more updates\n scatter to the same location in `original` the final value in `original` is\n not guaranteed. If `unique_indices` is set to false, the first\n `batch_rank` iteration loops will be marked as reduction.\n\n The shapes definition follows tensorflow operations. See more information in\n https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update", "operands": [ { "name": "updates", "type": "AnyRankedTensorOrMemRef" }, { "name": "indices", "type": "AnyRankedTensorOrMemRef" }, { "name": "mask", "type": "Optional" }, { "name": "original", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension_map", "type": "DenseI64ArrayAttr" }, { "name": "unique_indices", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict `dimension_map` `=` $dimension_map\n `unique_indices` `(` $unique_indices `)`\n `ins` `(` $updates `,` $indices (`,` $mask^)? `:` type($updates) `,` type($indices) (`,` type($mask)^)? `)`\n `outs` `(` $original `:` type($original) `)`\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.sort", "summary": "Sorts a tensor a specified dimension.", "description": "Based on XLA operation semantics, sorts the given `operands` at the given\n `dimension` with the given `comparator`.\n\n See https://www.tensorflow.org/xla/operation_semantics#sort.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.topk", "summary": "Top-K operator.", "description": "A Top-K operation for N-D tensors. Reduces the target dimension from the input\n size N down to K elements based on the supplied binary region.\n\n Accepts an N-D tensor input consisting of values and an optional N-D tensor\n for indices of those values (i32 type). If input indices aren't provided, the\n index mapping is inferred based on the k dim. Both input values/indices\n tensors and output values/indices tensors must have the same shape. Top-K is\n computed along the target dimension (from dimension()). Returns two output\n tensors of values and the indices of Top-K results. The output dimensions\n must match the input save for the dimension that is reduced to K results.\n\n Region accepts lhs=[next N input] and rhs=[exiting K output] and yields an\n i1. If true, the two values are swapped:\n - For Top-K compoarision: >\n - For Min-K comparison: <\n Note: when the two values are equal, the first occurrence is always selected.", "operands": [ { "name": "values", "type": "AnyShaped" }, { "name": "indices", "type": "Optional" }, { "name": "output_values", "type": "AnyShaped" }, { "name": "output_indices", "type": "AnyShaped" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n `ins` `(` $values (`,` $indices^)? `:` type($values) (`,` type($indices)^)? `)`\n `outs` `(` $output_values `,` $output_indices `:` type($output_values) `,` type($output_indices) `)`\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.topk_v2", "summary": "Top-K v2 operator.", "description": "Selects the top-K elements along the given `dimension` using the given\n `comparator`. K is determined by the output shape. The output sort\n dimension must be less than or equal to the input sort dimension.\n\n This op replaces the legacy `topk` op with several improvements:\n output indices are optional instead of mandatory, input indices of any\n integer type are supported for pre-permuted inputs, and the comparator\n region uses a pure ordering predicate decoupled from the swap semantics\n of the legacy op.\n\n Accepts a single N-D input tensor of values and an optional N-D tensor of\n input indices (any integer type). If input indices aren't provided, the\n index mapping defaults to [0, N) along the sort dimension, where N is\n the input size. Input indices may only be provided when output indices\n are also present, since the comparator operates solely on values and\n input indices only carry positional provenance to the output. Produces\n output values and optionally output indices (integer type) tracking\n original positions.\n\n When `is_sorted` is present, the output top-K elements are guaranteed to\n be in sorted order along the sort dimension. When absent (default), the\n top-K elements are returned but their relative order is unspecified.\n\n Comparator region accepts two scalar arguments of the input value element\n type and yields an i1 indicating whether the first argument should be\n ordered before the second.", "operands": [ { "name": "values", "type": "AnyShaped" }, { "name": "input_indices", "type": "Optional" }, { "name": "output_values", "type": "AnyShaped" }, { "name": "output_indices", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" }, { "name": "is_sorted", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n (`is_sorted` $is_sorted^)?\n `ins` `(` $values (`,` $input_indices^)? `:` type($values) (`,` type($input_indices)^)? `)`\n `outs` `(` $output_values (`,` $output_indices^)? `:`\n type($output_values) (`,` type($output_indices)^)? `)`\n $region (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.unpack", "summary": "LinalgExt unpack operation for both tensors and buffers.", "description": "The unpack operation converts a tiled and packed input to an unpacked\n output. See `pack` for more details on `inner_tiles` and `dims_pos`; it is UB\n if the tile does not perfectly divide the dimension. Optionally, the operation\n also supports permuting the tiled loops.\n\n Example KCck_to_KC:\n\n ```mlir\n iree_linalg_ext.unpack %arg0 dims_pos = [1, 0]\n inner_tiles = [32, 8] into %arg1 : (memref<16x8x32x8xf32> memref<128x256xf32>)\n ```\n\n Example NCnc_to_NC:\n\n ```mlir\n iree_linalg_ext.unpack %arg0 dims_pos = [0, 1]\n inner_tiles = [8, 32] into %arg1 : (memref<16x8x8x32xf32> memref<128x256xf32>)\n ```\n\n Example CKkc_to_KC:\n\n ```mlir\n iree_linalg_ext.unpack %arg1 outer_dims_perm = [1, 0] inner_dims_pos = [0, 1]\n inner_tiles = [32, 8] into %arg0 : (memref<32x4x32x8xf32> memref<128x256xf32>)\n ```", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" }, { "name": "inner_tiles", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "outer_dims_perm", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_dims_pos", "type": "DefaultValuedAttr" }, { "name": "static_inner_tiles", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "attr-dict\n $input\n (`outer_dims_perm` `=` $outer_dims_perm^)?\n `inner_dims_pos` `=` $inner_dims_pos\n `inner_tiles` `=`\n custom($inner_tiles, $static_inner_tiles)\n `into` $output `:` `(` type($input) type($output) `)`\n (`->` type($results)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.winograd.filter_transform", "summary": "Winograd Filter Transform operator.", "description": "This operator is part of the first step in converting a convolution to\n its Winograd equivalent. Given a tile of a convolution filter (F),\n this operator computes matmul(G, matmul(F, transpose(B))).\n The filter tile is assumed to be the full m x m convolutional kernel,\n and the result of the transformation on this tile is a square with each\n side of size m + r - 1, where the output tile size is r x r. G is a constant\n 2-d matrix of shape (m + r - 1) x m. The input to the operator is a filter\n of shape (H, W, C, F) or (F, C, H, W) and the output is an operator of shape\n (m + r - 1, m + r - 1, C, F). The result of this operator is first collapsed\n and then fed to a batch matmul op.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "output_tile_size", "type": "I64Attr" }, { "name": "kernel_size", "type": "I64Attr" }, { "name": "kernel_dimensions", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "attr-dict\n `output_tile_size` `(` $output_tile_size `)`\n `kernel_size` `(` $kernel_size `)`\n `kernel_dimensions` `(` $kernel_dimensions `)`\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `:` type($output) `)`\n (`->` type($result)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.winograd.input_transform", "summary": "Winograd Input Transform operator.", "description": "This operator is part of the first step in converting a convolution to\n its Winograd equivalent. Given a tile of an input image (I),\n this operator computes matmul(transpose(B), matmul(I, B)).\n The input tile is assumed to be square with each side of size m + r - 1,\n where the convolutional kernel is m x m and the output tile size is r x r.\n B is a constant 2-d square matrix of the same shape as the input tile I.\n The input to the operator is an image of shape (N, H, W, C) or (N, C, H, W)\n and the output is an operator of shape (m + r - 1, m + r - 1, N, H', W', C)\n where H' = ceil((H - m + 1)/r) and W' = ceil((W - m + 1)/r). The result\n of this operator is first collapsed and then fed to a batch matmul op.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "output_tile_size", "type": "I64Attr" }, { "name": "kernel_size", "type": "I64Attr" }, { "name": "image_dimensions", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "attr-dict\n `output_tile_size` `(` $output_tile_size `)`\n `kernel_size` `(` $kernel_size `)`\n `image_dimensions` `(` $image_dimensions `)`\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `:` type($output) `)`\n (`->` type($result)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.winograd.output_transform", "summary": "Winograd Output Transform operator.", "description": "This operator is the last transform in converting a convolution to\n its Winograd equivalent. After convolution in the Winograd domain\n (which turns into an elementwise product for a single channel and\n batch matrix multiplication for many channels), this operator converts\n the output back into the original domain. Given a tile of the\n output (O) in the Winograd domain, this operator computes\n matmul(transpose(A), matmul(O, A)). The output tile is square with\n each side of size m + r - 1, where the convolutional kernel is m x m\n and the output tile size is r x r. A is a constant 2-d matrix of\n shape (m + r - 1) x r. The input to the operator is a tensor of\n shape (m + r - 1, m + r - 1, N, H', W', C) and the output is a\n tensor of shape (N, H, W, C) or (N, C, H, W) where H = r H' and W = r W'.\n This operator is followed by a tensor.extract_slice which extracts\n only the non-padded part of the output.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "output_tile_size", "type": "I64Attr" }, { "name": "kernel_size", "type": "I64Attr" }, { "name": "image_dimensions", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "attr-dict\n `output_tile_size` `(` $output_tile_size `)`\n `kernel_size` `(` $kernel_size `)`\n `image_dimensions` `(` $image_dimensions `)`\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `:` type($output) `)`\n (`->` type($result)^)?", "hasCustomAssemblyFormat": true }, { "name": "iree_linalg_ext.yield", "summary": "LinalgExt yield op.", "description": "`iree_linalg_ext.yield` is a special terminator operation for blocks inside\n regions in `iree_linalg_ext` ops.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "iree_tensor_ext.barrier.end", "summary": "Tensor barrier end operation", "description": "This barrier prevents certain transformations (like reshape propagation)\n from moving operations up across this boundary.\n The operand is returned as the result with identical type.", "operands": [ { "name": "value", "type": "AnyRankedTensor" }, { "name": "value_dims", "type": "IREETensorExt_ShapeDynamicDims" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$value `:` type($value) (`{` $value_dims^ `}`)? `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "iree_tensor_ext.barrier.start", "summary": "Tensor barrier start operation", "description": "This barrier prevents certain transformations (like reshape propagation)\n from moving operations down across this boundary.\n The operand is returned as the result with identical type.", "operands": [ { "name": "value", "type": "AnyRankedTensor" }, { "name": "value_dims", "type": "IREETensorExt_ShapeDynamicDims" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$value `:` type($value) (`{` $value_dims^ `}`)? `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "iree_tensor_ext.bitcast", "summary": "Bitcasts a tensor without modifying the contents.", "description": "Bitcasts a tensor |source| to the shape implied by this operations result\n type interleaved with |result_dims|, potentially with a different element\n type. For example,\n\n ```\n result_dims = {%0, %1}\n result_type = tensor<1x?x2x?x3 x!eltype>\n ```\n\n produces a tensor of shape [1, %0, 2, %1, 3] and element type `!eltype`.\n Note that the source and result tensors must serialized to the same size.\n\n Different from the flow.bitcast op, the op is allowed to be cloned into\n dispatch regions and supports transformations required by executable\n translation such as bufferization.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "result_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `:`\n type($source) (`{` $source_dims^ `}`)? `->`\n type($result) (`{` $result_dims^ `}`)?\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.cast_to_ragged_shape", "summary": "Create a shaped type with ragged rows.", "description": "The op takes a shaped type and reinterprets its contents as a ragged shaped type. The\n dimensions specified by `ragged_dim` in the source is interpreted as two\n dimensions at `ragged_dim` and `ragged_dim + 1` in the result shaped type. The\n result shaped type has a rank of one more than that of the `source`. The result\n type also has the encoding set to an attribute of type `RaggedShapeAttr`\n with the specified `ragged_dim` used to specify the `raggedRow` in the\n encoding attribute. (See description of `RaggedShapeAttr`). The number of\n ragged rows is specified using `num_ragged_rows` argument. The size of each\n row is specified using `column_lengths` argument, which is a single rank\n shaped type of size `num_rows + 1` and where size of the `i`-th row of the result\n is computed using\n\n ```\n column_lengths[i+1] - column_lengths[i]\n ```\n\n In other words, `column_lengths` is same as the `ROW_INDEX` in CSR\n representation (https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_(CSR,_CRS_or_Yale_format)).\n For example, if the `n` and `n+1` dimensions of the result represent this ragged structure\n\n ```\n OOOO\n OOOOOO\n OOO\n OOOOO\n ```\n\n then,\n - `ragged_dim` is `n`\n - `num_ragged_rows` is 4\n - `column_lengths` is [0, 4, 10, 13, 18]\n - result has an encoding attribute of `#iree_tensor_ext.ragged_shape`.\n\n Constraints are\n 1. `ragged_dim` < rank(`source`)\n 2. rank(`columnLengths`) == 1.\n 3. dim(`columnLengths`, 0) == `num_rows` + 1.\n 4. dim(`result`, `raggedRowDim` + 1) >=\n (`columnLengths`[k+1] - `columnLengths`[k])\n for all 0 <= k < dim(`result`, `raggedRowDim`)", "operands": [ { "name": "source", "type": "AnyTypeOf<[AnyRankedTensor, AnyMemRef]>" }, { "name": "columnLengths", "type": "AnyTypeOf<[AnyRankedTensor, AnyMemRef]>" }, { "name": "numRaggedRows", "type": "Optional" }, { "name": "sourceDynamicDims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyRankedTensor, AnyMemRef]>" } ], "attributes": [ { "name": "raggedDim", "type": "IndexAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `ragged_dim` `(` $raggedDim `)`\n `column_lengths` `(` $columnLengths `)`\n (`num_ragged_rows` `(` $numRaggedRows^ `)`)?\n attr-dict `:`\n `(` type($source) (`{` $sourceDynamicDims^ `}`)? `,` type($columnLengths) `)`\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.compute_barrier.end", "summary": "Tensor compute barrier end operation", "description": "This barrier prevents certain transformations (like reshape propagation)\n from moving operations up across this boundary.\n The operand is returned as the result with identical type.", "operands": [ { "name": "value", "type": "AnyRankedTensor" }, { "name": "value_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$value `:` type($value) (`{` $value_dims^ `}`)? `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.compute_barrier.start", "summary": "Tensor compute barrier start operation", "description": "This barrier prevents certain transformations (like reshape propagation)\n from moving operations down across this boundary.\n The operand is returned as the result with identical type.", "operands": [ { "name": "value", "type": "AnyRankedTensor" }, { "name": "value_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$value `:` type($value) (`{` $value_dims^ `}`)? `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.dispatch.tensor.load", "summary": "Loads a tensor from a dispatch input placeholder.", "description": "Loads an input tensor or subtensor from an input placeholder. As each\n workgroup executes concurrently all workgroups will receive identical loaded\n results of regions that may overlap.", "operands": [ { "name": "source", "type": "IREETensorExt_DispatchTensor" }, { "name": "source_dims", "type": "Variadic" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source\n `,` `offsets` `=` custom(\n $offsets, $static_offsets)\n `,` `sizes` `=` custom(\n $sizes, $static_sizes)\n `,` `strides` `=` custom(\n $strides, $static_strides)\n attr-dict `:` type($source) (`{` $source_dims^ `}`)? `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.dispatch.tensor.store", "summary": "Stores a tensor into a dispatch output placeholder.", "description": "Stores a tensor or subtensor into an output tensor placeholder. As each\n workgroup executes concurrently behavior is undefined if more than one\n workgroup stores into overlapping regions of the full output tensor.", "operands": [ { "name": "value", "type": "AnyRankedTensor" }, { "name": "target", "type": "IREETensorExt_WritableDispatchTensor" }, { "name": "target_dims", "type": "Variadic" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$value `,` $target\n `,` `offsets` `=` custom(\n $offsets, $static_offsets)\n `,` `sizes` `=` custom(\n $sizes, $static_sizes)\n `,` `strides` `=` custom(\n $strides, $static_strides)\n attr-dict `:` type($value) `->` type($target) (`{` $target_dims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.dispatch.workgroup_count_from_dag_root", "summary": "Workgroup count computed based on iteration range of the root of the DAG\n for ops within the dispatch.", "description": "When using tile + distribution of the root of the DAG (Directed Acyclic\n Graph) of ops within the dispatch to split the work amongst workgroups. The\n workload captured is the size of the iteration space of the root of the DAG.\n This op represents the computation that given the workload returns the\n number of workgroups to use. The backends are responsible for lowering this\n op into actual computation (typically based on the tile sizes used to tile\n and distribute the root of the DAG).", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "x", "type": "Index" }, { "name": "y", "type": "Index" }, { "name": "z", "type": "Index" } ], "assemblyFormat": "attr-dict `(` $operands `)`", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.dispatch.workgroup_count_from_slice", "summary": "Place holder to signify default workgroup count calculation.", "description": "The default computation of the number of workgroups (or workgroup count)\n assumes that the dispatch + captured values is enough to compute the\n workgroup count. It does so by using a program slice of the values\n within the dispatch that represent the number of workgroups when available\n within the dispatch.\n Currently the arguments of index types captured by the\n `flow.dispatch.workgroups` is treated as the workload for the operation.\n It is a requirement that the slice of the program that computes the\n number of workgroups will need to have its leaves be these captured values.\n\n TODO: This could be generalized in future to allow the slices to encompass\n arbitrary computation. The computation of the workgroup count can then be\n done on the device itself, if this is data dependent. In such cases the\n workload could be more than just values of index types.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "x", "type": "Index" }, { "name": "y", "type": "Index" }, { "name": "z", "type": "Index" } ], "assemblyFormat": "attr-dict `(` $operands `)`", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.dispatch.workgroup_count_split_reduction_modifier", "summary": "Modifies the workgroup count calculation to account for split reductions.", "description": "A split reduction dispatch contains an `scf.forall` within which the\n partial reduction computation is done. The `scf.forall` represents parallel\n partial reduction computations. `workgroup_x`, `workgroup_y`, and\n `workgroup_z` represent the workgroups needed to execute the inner compute\n ops. This is combined with `workload` to determine the total number of\n workgroups required to run the computation after accounting for the\n `scf.forall`.", "operands": [ { "name": "workgroup_x", "type": "Index" }, { "name": "workgroup_y", "type": "Index" }, { "name": "workgroup_z", "type": "Index" }, { "name": "workload", "type": "Variadic" } ], "results": [ { "name": "result_x", "type": "Index" }, { "name": "result_y", "type": "Index" }, { "name": "result_z", "type": "Index" } ], "assemblyFormat": "attr-dict `workgroups` `(` $workgroup_x `,` $workgroup_y `,` $workgroup_z `)` `workload` `(` $workload `)`", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.dispatch.workload.ordinal", "summary": "Annotates the values captured as workload within the body of\n `flow.dispatch.workgroups` op.", "description": "The arguments that represent the captured/returned values of the\n `flow.dispatch.workgroups`, i.e. the signature of the body of the op is not\n preserved during IREEs compilation. Since the workloads are derived from\n the operands captured by the operation, this op denotes the values captured\n as workloads. This can be used in the backends to map back to the workload\n values while materializing the workgroup count computation.\n\n TODO: Find a better way to represent this information, either by somehow\n propagating the signature of the created dispatch workgroup op through\n the compilation stack until the codegen backends, or as a separate\n list/attribute that can be plumbed through without using explicit ops.", "operands": [ { "name": "operand", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "ordinal", "type": "IndexAttr" } ], "assemblyFormat": "attr-dict $operand `,` $ordinal `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "iree_tensor_ext.linearize_ragged_dims", "summary": "Linearizes the sparse dimensions of a ragged shaped value.", "description": "Linearizes the contiguous sparse dimensions of a tensor or memref with a\n `#iree_tensor_ext.ragged_shape` encoding/layout into a single dense\n dimension. The result has the same element type, preserves all non-sparse\n dimensions, removes the ragged encoding/layout, and has rank:\n\n ```\n rank(source) - num_sparse_dimensions + 1\n ```\n\n Dynamic result dimensions are provided by `resultDynamicDims`.", "operands": [ { "name": "source", "type": "AnyTypeOf<[AnyRankedTensor, AnyMemRef]>" }, { "name": "resultDynamicDims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyRankedTensor, AnyMemRef]>" } ], "assemblyFormat": "$source attr-dict `:` type($source) `->` type($result)(`{` $resultDynamicDims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "iree_vector_ext.arg_compare", "summary": "Vectorized arg-reduction using a user-defined comparator.", "description": "The `iree_vector_ext.arg_compare` op is the vectorized form of\n `iree_linalg_ext.arg_compare`. It performs a reduction over a given\n dimension of a vector, returning both the selected value and its\n corresponding index.\n\n **Comparator region semantics:**\n\n The comparator region defines the predication logic that determines the\n selection rule for the reduction (e.g., \"greater than\" for argmax or\n \"less than\" for argmin). The region takes two scalar values of the input\n element type as arguments and returns a single `i1` result via\n `iree_vector_ext.yield`.\n\n The region is invoked during the reduction to determine which element to\n select: when the comparison yields `true`, the first argument is selected;\n otherwise, the second argument is selected.\n\n The region must contain only pure operations (operations with the `Pure`\n trait). This ensures the comparator can be safely executed in any order\n during the reduction.\n\n Example (implicit-index mode - argmax over dim 1):\n ```mlir\n %input_vec = vector<4x128xf32>\n %out_val_vec = vector<4xf32>\n %out_idx_vec = vector<4xi32>\n %result:2 = iree_vector_ext.arg_compare\n dimension(1)\n ins(%input_vec : vector<4x128xf32>)\n inits(%out_val_vec, %out_idx_vec : vector<4xf32>, vector<4xi32>) {\n ^bb0(%a: f32, %b: f32):\n %cmp = arith.cmpf ogt, %a, %b : f32\n iree_vector_ext.yield %cmp : i1\n } -> vector<4xf32>, vector<4xi32>\n ```\n\n Example (explicit-index mode):\n ```mlir\n %partial_vals = vector<4x32xf32>\n %partial_idxs = vector<4x32xi32>\n %out_val = vector<4xf32>\n %out_idx = vector<4xi32>\n %result:2 = iree_vector_ext.arg_compare\n dimension(1)\n ins(%partial_vals, %partial_idxs : vector<4x32xf32>, vector<4x32xi32>)\n inits(%out_val, %out_idx : vector<4xf32>, vector<4xi32>) {\n ^bb0(%a: f32, %b: f32):\n %cmp = arith.cmpf ogt, %a, %b : f32\n iree_vector_ext.yield %cmp : i1\n } -> vector<4xf32>, vector<4xi32>\n ```\n\n The `index_base` is an optional offset value that, when specified, is added\n to the computed indices in the result. This is useful when reducing over a\n sliced subregion where the indices need to be adjusted to reflect their\n position in the original vector. The `index_base` can only be used in\n implicit-index mode (single input).\n\n The `inits` operands provide the initial accumulator values for the\n reduction (initial max/min value and index).", "operands": [ { "name": "input_value", "type": "AnyVectorOfAnyRank" }, { "name": "input_index", "type": "Optional" }, { "name": "init_value", "type": "AnyVectorOfAnyRank" }, { "name": "init_index", "type": "AnyVectorOfAnyRank" }, { "name": "index_base", "type": "Optional" } ], "results": [ { "name": "result_value", "type": "AnyVectorOfAnyRank" }, { "name": "result_index", "type": "AnyVectorOfAnyRank" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['init_value', 'result_value']>" }, { "type": "AllTypesMatch<['init_index', 'result_index']>" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n `ins` `(` $input_value (`,` $input_index^)? `:` type($input_value) (`,` type($input_index)^)? `)`\n `inits` `(` $init_value `,` $init_index `:` type($init_value) `,` type($init_index) `)`\n (`index_base` `(` $index_base^ `:` type($index_base) `)`)?\n $region `->` type($result_value) `,` type($result_index)" }, { "name": "iree_vector_ext.to_layout", "summary": "Layout conversion operator.", "description": "The layout conversion operator takes a shaped value and a layout and\n transforms the value to have that layout.\n\n If the \"shared_memory_conversion\" attribute is set, then this layout\n change has to be materialized through shared memory. GPU codegen expects\n the attribute value to implement the IREE::GPU::PromotionAttr interface.", "operands": [ { "name": "input", "type": "AnyShaped" } ], "results": [ { "name": "output", "type": "AnyShaped" } ], "attributes": [ { "name": "layout", "type": "VectorLayoutInterface" }, { "name": "shared_memory_conversion", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['input', 'output']>" } ], "assemblyFormat": "$input `to` `layout` `(` $layout `)` attr-dict `:` type($input)" }, { "name": "iree_vector_ext.to_simd", "summary": "SIMT to SIMD conversion operation.", "description": "This operation is a temporary operation useful for source/target\n materializations when doing type conversions between distributed and not\n distributed vectors.", "operands": [ { "name": "input", "type": "AnyVectorOfAnyRank" } ], "results": [ { "name": "output", "type": "AnyVectorOfAnyRank" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "iree_vector_ext.to_simt", "summary": "SIMD to SIMT conversion operation.", "description": "This operation is a temporary operation useful for source/target\n materializations when doing type conversions between distributed and not\n distributed vectors.", "operands": [ { "name": "input", "type": "AnyVectorOfAnyRank" } ], "results": [ { "name": "output", "type": "AnyVectorOfAnyRank" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "iree_vector_ext.transfer_gather", "summary": "Gathers a supervector from a shaped source into an SSA vector value.", "description": "The `transfer_gather` operation reads elements from a shaped source (memref\n or tensor) into a vector, where each source dimension can be independently\n contiguous, gathered, or broadcast.\n\n Semantically, for each position in the result vector:\n\n ```\n result[d0, d1, ...] = base[offsets[0] + f0(d, s), offsets[1] + f1(d, s), ...]\n ```\n\n where each `fi` is the i-th result of the source indexing map evaluated at\n the vector position `d = (d0, d1, ...)` and gathered index values\n `s = (s0, s1, ...)`.\n\n The `indexing_maps` attribute describes all indexing. Every map has\n `numDims = result vector rank` and `numSymbols = number of index vecs`:\n\n - Map 0 (source map): `(vector_dims)[symbols] -> (source_dims)`.\n A dim expr means the source dimension is contiguous (iterated in\n lockstep with the vector dimension). A symbol expr means the source\n dimension is gathered (looked up via the corresponding index vector).\n A constant 0 means the source dimension is broadcast (always reads\n at the base offset).\n - Maps 1..N (index vec maps): `(vector_dims)[symbols] -> (index_vec_dims)`.\n Describes how each index vector is indexed from the vector iteration\n space. Only dim exprs are allowed.\n - Optional last map (mask map): present only when a mask operand is\n provided. Only dim exprs are allowed.\n\n Example — embedding lookup: reading rows from a 3D source where the row\n index is gathered from an index vector, while the column is contiguous:\n\n ```\n // result[i, j] = base[0, indices[i], j]\n %result = iree_vector_ext.transfer_gather %base[%c0, %c0, %c0]\n [%indices : vector<16xindex>], %pad {\n indexing_maps = [\n affine_map<(d0, d1)[s0] -> (0, s0, d1)>,\n affine_map<(d0, d1)[s0] -> (d0)>\n ]\n } : memref<4096x512x8xf16>, vector<16x8xf16>\n ```", "operands": [ { "name": "base", "type": "AnyShaped" }, { "name": "offsets", "type": "Variadic" }, { "name": "index_vecs", "type": "Variadic ]>>" }, { "name": "padding", "type": "AnyType" }, { "name": "mask", "type": "Optional>" } ], "results": [ { "name": "vector", "type": "AnyVectorOfAnyRank" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'base', 'padding', 'getElementTypeOrSelf($_self)'>" } ], "assemblyFormat": "$base `[` $offsets `]` (`[` $index_vecs^ `:` type($index_vecs) `]`)? `,` $padding (`,` $mask^)? attr-dict `:` type($base) `,` type($vector) (`,` type($mask)^)?" }, { "name": "iree_vector_ext.transfer_scatter", "summary": "Scatters a supervector from an SSA vector value into a shaped destination.", "description": "The `transfer_scatter` operation is the write counterpart of\n `transfer_gather`. It writes elements from a vector into a shaped\n destination (memref or tensor), where each destination dimension can be\n independently contiguous, scattered, or broadcast.\n\n The scatter indices are expected to be unique. If multiple vector elements\n map to the same destination location, the behavior is undefined. I.e., There may be data races.\n\n For tensor operands, the operation returns the modified tensor. For memref\n operands, the operation has no result.\n\n Example — scatter write: writing values into scattered rows of a 2D dest:\n\n ```\n // dest[indices[i], j] = vector[i, j]\n %result = iree_vector_ext.transfer_scatter %vector into %dest[%c0, %c0]\n [%indices : vector<16xindex>] {\n indexing_maps = [\n affine_map<(d0, d1)[s0] -> (s0, d1)>,\n affine_map<(d0, d1)[s0] -> (d0)>\n ]\n } : vector<16x8xf16>, tensor<4096x8xf16> -> tensor<4096x8xf16>\n ```\n\n Semantically, for each position in the source vector:\n\n ```\n dest[offsets[0] + f0(d, s), offsets[1] + f1(d, s), ...] = vector[d0, d1, ...]\n ```\n\n where each `fi` is the i-th result of the dest indexing map evaluated at\n the vector position `d = (d0, d1, ...)` and scattered index values\n `s = (s0, s1, ...)`.\n\n The `indexing_maps` attribute follows the same structure as\n `transfer_gather`. See `transfer_gather` documentation for details. The\n only difference is that Map 0 describes the destination indexing rather\n than the source indexing.", "operands": [ { "name": "base", "type": "AnyShaped" }, { "name": "vector", "type": "AnyVectorOfAnyRank" }, { "name": "offsets", "type": "Variadic" }, { "name": "index_vecs", "type": "Variadic ]>>" }, { "name": "mask", "type": "Optional>" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$vector `into` $base `[` $offsets `]`\n (`[` $index_vecs^ `:` type($index_vecs) `]`)?\n (`,` $mask^)?\n attr-dict `:` type($vector) `,` type($base)\n (`,` type($mask)^)?\n (`->` type($result)^)?" }, { "name": "iree_vector_ext.yield", "summary": "Yield operation for VectorExt operations with regions", "description": "Yields values from regions in VectorExt operations.", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($values^ `:` type($values))?" }, { "name": "kernel.call", "summary": "calls a kernel defined in a `gpu.module`", "description": "The `kernel.call` operation calls (launches/executes) a kernel that is\n defined within a `gpu.module`. The `kernel.call` operation cannot be\n nested within a `gpu.module` since it represents an operation executed on\n the host. The kernel accepts `grid_size` values (at least one and up to\n three values). The grid size indicates the size of the grid of threadblocks\n that should be launched. The total number of threadblocks launched is the\n product of all the values given to `grid_size`.\n\n A kernel may yield some number of results, in which case it is in\n destination-passing style and the results are tied to the `outs` arguments.\n\n #### Example:\n\n ```mlir\n gpu.module @kernels {\n func.func @kernel(%arg0: memref<1xf32>, %arg1: memref<1xf32>) {\n %c0 = arith.constant 0 : index\n %0 = memref.load %arg0[%c0] : memref<1xf32>\n memref.store %0, %arg1[%c0] : memref<1xf32>\n return\n }\n }\n\n func.func @caller(%arg0: memref<1xf32>, %arg1: memref<1xf32>) {\n kernel.call @kernels::@kernel(%arg0) outs(%arg1) : (memref<1xf32>)->(memref<1xf32>)\n return\n }\n ```", "operands": [ { "name": "grid_size", "type": "Variadic" }, { "name": "block_size", "type": "Variadic" }, { "name": "inputs", "type": "Variadic" }, { "name": "outs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "kernel_sym", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$kernel_sym `grid` `[` $grid_size `]`\n `block` `[` $block_size `]` `(` $inputs `)` `outs` `(` $outs `)`\n attr-dict `:` custom(\n ref($inputs),\n ref($outs),\n type($inputs), type($outs), type($results))" }, { "name": "kernel.combiner", "description": "`kernel.combiner` represents a group of scalar operations which\n collectively represent an associative reduction operation.\n\n The purpose of this operation is to allow the programmer or a previous\n compiler pass to specify that a group of inline scalar operations\n has an associative property (and optionally one can also specify that the\n group is commutative).\n\n For example, the following 'kernel.combiner' represents the so-called\n \"online softmax\" reduction function, which is both associative and commutative:\n\n ```\n func.func @test_associative(%arg0: f32, %arg1: f32, %arg2: f32, %arg3: f32) -> (f32, f32) {\n %0, %1 = kernel.combiner (%arg0, %arg1, %arg2, %arg3) : f32, f32, f32, f32 {\n ^bb0(%in0: f32, %in1: f32, %out0: f32, %out1: f32):\n %max = arith.maximumf %in0, %out0 : f32\n %0 = arith.subf %in0, %max : f32\n %1 = arith.subf %out0, %max : f32\n %2 = math.exp %0 : f32\n %3 = math.exp %1 : f32\n %4 = arith.mulf %2, %in1 : f32\n %5 = arith.addf %4, %3 : f32\n kernel.yield %max, %5 : f32, f32\n }\n return %0, %1 : f32, f32\n }\n ```\n\n The assembly format is very basic and in the future could be improved. The\n semantic of the operation is simply that it forwards the operands to the\n block arguments, executes the operations in the body, and yields the results\n back to the parent. However, the operation also has certain requirements:\n\n 1. It must have an even number of arguments\n 2. The types of the first half of the arguments must match the last half.\n 3. The number of results is half the number of arguments and the types\n are taken from the first half of the arguments.\n\n Conceptually, it indicates that the following represents an associative\n reduction on a pair of 2-tuples:\n\n ```\n f( [in0, in1], [out0, out1]) := [\n max(in0, out0),\n in1 * exp(in0 - max(in0, out0)) + in1 * exp(out0 - max(in0, out0))\n ]\n ````\n\n Note that no actual verification is performed to ensure that the operation\n is actually commutative since that would be very expensive. The analysis should\n come from the creator (programmer or compiler pass).", "operands": [ { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "commutative", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` ( $inputs^ `)` ) : ( `)` ) ?\n attr-dict-with-keyword `:` type($inputs)\n $body" }, { "name": "kernel.ext_call", "summary": "extended kernel call with tensor support and explicit aliasing", "description": "The `kernel.ext_call` operation is an extended version of `kernel.call` that\n accepts tensors directly with explicit side-effect and aliasing annotations.\n\n Key features:\n - Single unified argument list (no ins/outs split)\n - Explicit side effects per argument: \"r\" (read), \"rw\" (read/write), \"-\" (none)\n - Explicit aliasing: maps arguments to results for in-place operations\n - Automatic bufferization integration\n\n The `result_aliases` attribute is an array of argument indices that specifies\n which arguments alias which results. For each `i` in `range(0, num_results)`,\n `result[i]` must alias `args[result_aliases[i]]`.\n\n The `effects` attribute specifies memory effects for each argument:\n - \"r\": read-only (for memref/tensor arguments)\n - \"rw\": read-write (for in-place modified arguments)\n - \"-\": no effect (for scalars)\n\n #### Example:\n\n ```mlir\n %results:2 = kernel.ext_call @kernels::@my_kernel\n grid[%gx] block[%bx]\n args(%keys, %temps, %ping : tensor, tensor, i1)\n result_aliases = [0, 1], // result[0] aliases arg[0], result[1] aliases arg[1]\n effects = [\"rw\", \"rw\", \"-\"] // read/write, read/write, no effect\n : tensor, tensor\n ```", "operands": [ { "name": "grid_size", "type": "Variadic" }, { "name": "block_size", "type": "Variadic" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "kernel_sym", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "result_aliases", "type": "DenseI32ArrayAttr" }, { "name": "effects", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$kernel_sym `grid` `[` $grid_size `]`\n `block` `[` $block_size `]`\n `args` `(` $args `:` type($args) `)`\n `result_aliases` `=` $result_aliases\n `,` `effects` `=` $effects\n attr-dict (`:` type($results)^)?" }, { "name": "kernel.scatter", "description": "The `kernel.scatter` operation performs scatters updates to the\n `init` tensor and returns a new updated tensor.\n\n The `init` tensor is the starting tensor, and the `updates` tensor\n contains the values to be scattered into the `init` tensor. The `indices`\n tensor specifies the indices of the elements in the `init` tensor\n that should be updated.\n\n The update is performed by combining the value from `init` with the\n scalar value from `updates` using the `update_computation` region.\n\n The semantics of this operation exactly match those of\n `stablehlo.scatter`. See the following spec for more details:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#scatter\n\n This operation implements TilingInterface and ToLoopsOpInterface,\n and it is not currently bufferizable. The expected usage pattern\n is to lower to loops via ToLoopsOpInterface prior to\n bufferization.", "operands": [ { "name": "indices", "type": "AnyShaped" }, { "name": "updates", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "update_window_dims", "type": "DenseI64ArrayAttr" }, { "name": "inserted_window_dims", "type": "DefaultValuedAttr" }, { "name": "input_batching_dims", "type": "DefaultValuedAttr" }, { "name": "scatter_indices_batching_dims", "type": "DefaultValuedAttr" }, { "name": "scatter_dims_to_operand_dims", "type": "DenseI64ArrayAttr" }, { "name": "index_vector_dim", "type": "I64Attr" }, { "name": "indices_are_sorted", "type": "UnitAttr" }, { "name": "unique_indices", "type": "UnitAttr" } ], "regions": [ { "name": "update_computation", "type": "SizedRegion<1>" } ], "assemblyFormat": "`updates` `(` $updates `:` type($updates) `)`\n `into` `(` $inits `:` type($inits) `)`\n `at` `(` $indices `:` type($indices) `)`\n $update_computation\n attr-dict `:` type($result)" }, { "name": "kernel.sort", "summary": "Merge sort operator for keys-only or key-value pairs", "description": "The `kernel.sort` operation performs a merge sort on the input tensor(s)\n and returns sorted result(s). It supports two modes:\n\n 1. Keys-only: Sorts a single input tensor of keys\n 2. Key-value: Sorts keys and rearranges corresponding values\n\n The sort is performed along the innermost (fastest-varying) dimension.\n The implementation uses a CUB-inspired two-stage GPU merge sort:\n - Stage 1: Block-level sort using bitonic sort within threads and merge across threads\n - Stage 2: Multi-pass global merge using merge path algorithm\n\n Configuration parameters:\n - `block_threads`: Number of threads per block (default: 128, recommended: 128)\n - `items_per_thread`: Nominal number of elements per thread (default: 4, recommended: 4)\n\n ## Type-Based Tuning (Automatic)\n\n The `items_per_thread` parameter is automatically scaled based on the key type's\n size to maintain constant register pressure. This follows CUB's\n `Nominal4BItemsToItems` strategy (see cub/util/util_math.cuh).\n\n Formula: `actual_items = min(nominal, max(1, nominal * 4 / sizeof(KeyType)))`\n\n Examples with `items_per_thread = 4`:\n - `i8` (1 byte): 4 items/thread (no scaling needed)\n - `i32` (4 bytes): 4 items/thread (optimal baseline)\n - `i64` (8 bytes): 2 items/thread (scaled down to prevent register spills)\n - `f64` (8 bytes): 2 items/thread (scaled down to prevent register spills)\n\n This means you can use the same configuration for all types, and the compiler\n will automatically optimize for each type:\n\n ```mlir\n // Same config works optimally for all types!\n %sorted_i32 = kernel.sort ins(%keys_i32 : tensor)\n outs(%out_i32 : tensor)\n {block_threads = 128, items_per_thread = 4}\n -> tensor\n\n %sorted_i64 = kernel.sort ins(%keys_i64 : tensor)\n outs(%out_i64 : tensor)\n {block_threads = 128, items_per_thread = 4}\n -> tensor\n // Automatically uses 2 items/thread for i64 to prevent register spills!\n ```\n\n ## Recommended Configuration\n\n For best performance on Hopper/Blackwell GPUs with MLIR codegen:\n - `block_threads = 128`\n - `items_per_thread = 4`\n\n These defaults are empirically tuned for MLIR's codegen and provide 35% better\n performance than larger tile sizes. Smaller tiles maximize occupancy and enable\n better memory coalescing with our explicit loop unrolling optimizations.\n\n Note: These defaults differ from CUB's tuning (256x17) because:\n - MLIR codegen benefits from smaller tiles and better occupancy\n - Hopper architecture prefers more concurrent blocks with smaller working sets\n - Our loop unrolling optimizations work best with smaller tiles\n\n Users typically do not need to tune these parameters.\n\n ## Examples\n\n Example (keys-only with recommended config):\n ```mlir\n %sorted = kernel.sort ins(%keys : tensor)\n outs(%out : tensor)\n {block_threads = 128, items_per_thread = 4}\n -> tensor\n ```\n\n Example (key-value):\n ```mlir\n %sorted_keys, %sorted_values = kernel.sort\n ins(%keys, %values : tensor, tensor)\n outs(%out_keys, %out_values : tensor, tensor)\n {block_threads = 128, items_per_thread = 4}\n -> tensor, tensor\n ```\n\n ## References\n\n - CUB DeviceMergeSort: https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceMergeSort.html\n - CUB Nominal4BItemsToItems: cub/util/util_math.cuh lines 86-91", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "block_threads", "type": "DefaultValuedAttr" }, { "name": "items_per_thread", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` ( $inputs^ `)` ) : ( `)` )?\n `<` `block_threads` `=` $block_threads\n `,` `items_per_thread` `=` $items_per_thread `>` attr-dict\n ( `:` type($inputs)^ )?" }, { "name": "kernel.yield", "operands": [ { "name": "results", "type": "Variadic>" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "krnl.acos", "summary": "Krnl acos scalar operation", "description": "Krnl acos scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.acosh", "summary": "Krnl acosh scalar operation", "description": "Krnl acosh scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.asin", "summary": "Krnl asin scalar operation", "description": "Krnl asin scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.asinh", "summary": "Krnl asinh scalar operation", "description": "Krnl asinh scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.atan", "summary": "Krnl atan scalar operation", "description": "Krnl atan scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.atanh", "summary": "Krnl atanh scalar operation", "description": "Krnl atanh scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.block", "summary": "Krnl block operation", "description": "Block a single for loop by a constant tile size. For instance,\n ```\n $ib, $il = krnl.block %i, 4\n ```\n means to block the for loop referred to by %i using a tile size of 4.", "operands": [ { "name": "loop", "type": "AnyType" } ], "results": [ { "name": "loop_block", "type": "AnyType" }, { "name": "loop_local", "type": "AnyType" } ], "attributes": [ { "name": "tile_size", "type": "I64Attr" } ], "assemblyFormat": "$loop $tile_size attr-dict `:` functional-type($loop, results)" }, { "name": "krnl.call", "summary": "call operation", "description": "The call operation provides a generic way to replace an ONNX Op with a call\n to an external function at Krnl level.\n `funcName` attributes determines which function to call.\n `parameters` is the inputs to Krnl.Call. It includes the outputs and inputs\n of the ONNX Op. The outputs and inputs are already lowered to MemRefs.\n The external function is assumed NOT to allocate or free any memory.\n 'numOfOutput` attribute to tell how manu outputs Memref in parameters.\n mlir::OpTrait::AttrSizedOperandSegments is not used to put outputs and\n inputs into separate variadic parameters because I am thinking of mixing\n the inputs and outpus as required by external library.\n\n The attributes of the ONNX Op will be copied to KrnlCallOp under the control\n of the user.\n In Krnl To llvm lowering, the parameters and attributes will be lowered to\n parameters of the llvm function call.\n\n Several builder is defined to help translating an ONNX Op to Krnl.Call.\n User can provides the allocated MemRefs for outputs and the inputs\n separately. The inputs are usually the operands of the ONNX Op.\n The attributes of ONNX Op can be copied or not copied based on a bool\n parameter in the builder. Builder also provide a mechanism for user\n to selectively copy some attributes.\n\n The krnl.call op will be lowered to llvm at krnl-to-llvm conversion in which\n OMTensor is used as a container for MemRef arguments. Other representation\n of parameters, such as data pointer only, will be supported in future.", "operands": [ { "name": "parameters", "type": "Variadic" } ], "results": [ { "name": "returnValue", "type": "Variadic>" } ], "attributes": [ { "name": "funcName", "type": "StrAttr" }, { "name": "numOfOutput", "type": "DefaultValuedAttr" } ] }, { "name": "krnl.copy_from_tile_buffer", "summary": "Copy from buffer.", "description": "Operation that copy a destination memory from a buffer memory.\n Starts indicate where the buffer data starts to go into the destination\n memory. Start values must be at multiples of buffer size in all dimensions.\n The buffer rank and dimensions are compile time constants.\n\n If the buffer was oversized with respect of the actual data contained\n in the tile, the actual tile size can be given using the tileSize\n optional attribute. This attributes has the same rank as the buffer size,\n and each dimension must be smaller or equal to the actual buffer size.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "dest", "type": "AnyMemRef" }, { "name": "starts", "type": "Variadic" } ], "attributes": [ { "name": "tileSize", "type": "OptionalAttr>" } ], "assemblyFormat": "$buffer `,` $dest `[` $starts `]` attr-dict `:` type($buffer) `,` type($dest)" }, { "name": "krnl.copy_to_tile_buffer", "summary": "Copy to buffer.", "description": "Operation that copy a source memory to a buffer memory.\n Starts indicate where the source data starts to come from within\n the source memory. Start values must be at multiples of buffer size\n in all dimensions. The buffer rank and dimensions are compile time\n constants.\n\n The buffer will be entirely filled with the source data. By default,\n the amount of data to copy is given by the size of the buffer.\n In some cases, we may want to oversize a buffer for better cache,\n simd, or loop unroll and jam reasons. If that is the case, the\n actual tile size of the data to be copied over is given by an\n optional tileSize attribute. This attributes has the same rank as\n the buffer size, and each dimension must be smaller or equal to\n the actual buffer size.\n\n If there is not enough data in the source memory to fill the buffer,\n because the operation reaches the upper bounds of the source memory,\n several actions may happen.\n\n * If`padToNext` attribute is given, the pad value will be copied from\n the last source data of to the next index for which index modulo `padToNext`\n is zero, i.e. to the end of a \"cache line\" of side `padToLine`. Pad\n of 1 means no padding, pad of buffer size means fully pad the buffer.\n Default is no padding (1). `PadValue` is used to initialized the padded\n areas.\n\n * If `overreadToNext` attribute is given, the copy may read source past\n its upper bound value. This enable optimized code, e.g. using SIMD\n read operations even if going past the last value of the source\n memory, or unrolling and jamming copy loops to reduce memory latency.\n `overreadToNext` is expressed like padToNext: value of 1 means no\n reading past boundary; value of buffer size enables reading\n as many additional source value as needed to fill the full\n buffer. Default is buffer-size.\n\n `padToNext` and `overreadToNex`t are of the same rank as source and memory\n memrefs.", "operands": [ { "name": "buffer", "type": "AnyMemRef" }, { "name": "source", "type": "AnyMemRef" }, { "name": "starts", "type": "Variadic" }, { "name": "padValue", "type": "AnyType" } ], "attributes": [ { "name": "tileSize", "type": "OptionalAttr>" }, { "name": "padToNext", "type": "OptionalAttr>" }, { "name": "transpose", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'source', 'padValue', 'mlir::cast($_self).getElementType()'>" }, { "type": "TypesMatchWith<'buffer', 'padValue', 'mlir::cast($_self).getElementType()'>" } ], "assemblyFormat": "$buffer `,` $source `[` $starts `]` `,` $padValue attr-dict\n `:` type($buffer) `,` type($source)" }, { "name": "krnl.define_loops", "summary": "define_loops operation", "description": "The \"krnl.define_loops\" operation is used to define input loops,\n those are the for loops appearing in the input program that we\n intend to optimize.", "results": [ { "name": "result", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "krnl.entry_point", "summary": "Indicate ONNX entry point", "description": "The \"krnl.entry_point\" function indicates the main entry\n point of ONNX model.", "attributes": [ { "name": "func", "type": "SymbolRefAttr" }, { "name": "numInputs", "type": "IntegerAttr" }, { "name": "numOutputs", "type": "IntegerAttr" }, { "name": "signature", "type": "StringAttr" } ] }, { "name": "krnl.erf", "summary": "Krnl erf scalar operation", "description": "Krnl erf scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.find_index", "summary": "Retrieve an index into a perfect hash table described by G and V.", "description": "This operation can be used to generate a call to a runtime function which,\n given two arrays of int32_t values (G and V), which are used to represent a perfect\n hash table for a dictionary, returns the index corresponding to the input value.\n The index returned is valid only if 'input' is in the dictionary described by G and V.", "operands": [ { "name": "input", "type": "AnyTypeOf<[StringType, I64]>" }, { "name": "G", "type": "I32MemRef" }, { "name": "V", "type": "I32MemRef" }, { "name": "len", "type": "I32" } ], "results": [ { "name": "index", "type": "Index" } ] }, { "name": "krnl.get_induction_var_value", "summary": "Krnl", "description": "Krnl operation to convert loop references to corresponding induction\n variable values. This is useful for accessing optimized loop induction\n variables, as they are not otherwise accessible during Krnl Dialect.\n\n For example, this operation can be applied to loop references corresponding to\n inter-tile iterations. The return values will be the starting index of the\n current tile being iterated over.", "operands": [ { "name": "loops", "type": "Variadic" } ], "results": [ { "name": "ind_var_vals", "type": "Variadic" } ], "assemblyFormat": "`(` $loops `)` attr-dict `:` functional-type($loops, results)" }, { "name": "krnl.get_linear_offset_index", "summary": "A Krnl operation to compute a linear offset index from a N-D index.", "description": "Given a MemRef and an N-D index (id_1, id_2, ..., id_n), where n is\n the rank of the MemRef, this operation computes a linear offset index.", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "krnl.global", "summary": "Krnl global operation", "description": "Operation for holding global data values. A global constant can have a\n meaningful name recorded as its `name` attribute. Its content is stored\n in the `value` dense element attribute.", "results": [ { "name": "output", "type": "AnyTypeOf<[AnyMemRef]>" } ], "attributes": [ { "name": "shape", "type": "AnyAttr" }, { "name": "name", "type": "StrAttr" }, { "name": "value", "type": "OptionalAttr" }, { "name": "offset", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" } ] }, { "name": "krnl.isinf", "summary": "Krnl isinf scalar operation", "description": "Krnl isinf scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "I1" } ] }, { "name": "krnl.isnan", "summary": "Krnl isnan scalar operation", "description": "Krnl isnan scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "I1" } ] }, { "name": "krnl.iterate", "summary": "iterate operation", "description": "The \"krnl.iterate\" operation is conceptually equivalent to a nested for loops.\n\n For instance, say we have the following two\n ```\n %l0, %l1 = krnl.define_loops 2\n %o0, %o1 = krnl.optimize_loops {\n // Identity schedule.\n krnl.return_loops %l0, %l1\n }\n ```\n\n Then, consider the following krnl.iterate operation:\n ```\n krnl.iterate (%o0, %o1) with (%l0 -> %i0 = 0 to 10, %l1 -> %i1 = 0 to 10) {\n // Some operations.\n }\n ```\n\n It is equivalent to:\n ```\n for (i0 = 0; i0 < 10; i0++)\n for (i1 = 0; i1 < 10; i1++)\n // Some operations.\n ```", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "krnl.load", "summary": "A Krnl operation to load data from the memref.", "description": "The `krnl.load` op reads an element from a memref specified by an index\n list. The output of load is a new value with the same type as the elements\n of the memref. The arity of indices is the rank of the memref (i.e., if the\n memref loaded from is of rank 3, then 3 indices are required for the load\n following the memref identifier).", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'memref', 'result', 'mlir::cast($_self).getElementType()'>" } ], "assemblyFormat": "$memref `[` $indices `]` attr-dict `:` type($memref)" }, { "name": "krnl.matmul", "summary": "Matmul operation for a single pannel.", "description": "Perform a matrix multiplication AA * BB + CC with sizes `[IxK] * [KxJ] + [IxJ]`.\n The original matrices AA, BB, and CC can be buffered in buffered arrays\n which may be padded. The original matrices and the padded array might\n have a higher rank than 2, but the actual matrix multiplication operation\n only deal with the innermost 2 ranks of the matrices to perform its matrix\n multiplication operations.\n\n The computations may also compute only a sub-tile of the buffered arrays.\n This region is depicted using stars '*' below.\n\n All indices passed to this operation are the global indices in the original\n computation, so as to better know if we have boundary conditions.\n\n ORIGINAL ARRAY: denoted as AA, BB, CC with sizes AA: `*xIxK`; BB: `*xKxJ`; CC: `*xI*J`).\n\n BUFFER ARRAYS: denoted as A, B, and C. Note that this operation does\n not require the use of buffers arrays. If none are used, then A=AA,\n B=BB, C=CC. If buffers are used, it is the responsibility of the caller\n to properly fill the buffers with the appropriate data. Buffers are\n typically used for cache tiling.\n\n ORIGINAL ARRAY\n\n```\n -------------------------------------------------\n | ]\n | ]\n | buffer array buffer pad ]\n | (3)---------------- ++++ ]\n | | | + ]\n | | (1)**** | + ]\n | | * * | + ]\n | | * * | + ]\n | | ****(5) | + ]\n | | | + ]\n | | | + ]\n | ------------------| + ]\n | + + ]\n | +++++++++++++++++++++(4) ]\n | ]\n -----------------------------------------------(2)\n```\n\n* (1) `iGlobalIndexComputeStart`/`jGlobalIndexComputeStart`/`kGlobalIndexComputeStart`,\n required, each three are global 1D indices.\n* (2) `iGlobalUB`/`jGlobalUB`/`jGlobalUB`, required, each three are global 1D indices.\n* (3) `aGlobalIndexMemStart`/`bGlobalIndexMemStart`/`cGlobalIndexMemStart`,\n required, global nD indices with the same rank as the buffers A, B, and C.\n* (4) `aTileSize`/`bTileSize`/`cTileSize`, required when padding, each 2D sizes.\n* (5) `computeTileSizes`, required when tiled computation within buffer, 3D sizes (I, J, K).\n\n The `iGlobalIndexComputeStart`/`jGlobalIndexComputeStart`/\n `kGlobalIndexComputeStart` (1) indicate the global indices of the\n first element of a tile to be computed in the original computations.\n\n The `iGlobalUB`/`jGlobalUB`/`kGlobalUB` (2) indicate the global upper bounds\n in the original computations.\n\n We provide 3 buffers for matrix multiply: A, B, and C. For each buffer,\n we indicate the global indices pointing the beginning of the buffer:\n `aGlobalIndexMemStart`, `bGlobalIndexMemStart`, and `cGlobalIndexMemStart` (3).\n If no buffers are used, i.e. the computation starts directly in the\n original memory, the global index is 0. If a buffer for AA is used to\n put data into it starting at indices `[i1, k1]`, where `i1` & `k1` are the\n global indices in the original computations, then `aGlobalIndexMemStart0`\n and `aGlobalIndexMemStart1` are `i1` & `k1`, respectively.\n\n If the A, B, or C buffers are larger than the actual data tile they\n contain (see `copy_to_tile_buffer`), then the actual tile size must be\n given using an optional attribute: `aTileSize`, `bTileSize`, or `cTileSize` (4).\n These optional tile size have a rank of 2, and their values must be\n equal or smaller than their corresponding buffer memrefs.\n\n If the computation are further tiled with respect to the size of the\n buffers A, B, or C, then the actual computation tile is given by\n the optional tile attribute `computeTileSize` (5). Its rank is 3, for the\n I, J, and K dimension. The actual A, B, and C buffer tile size\n (possibly specified by the optional parameters) must be a multiple of\n the I, J, and K `computeTileSizes`, in their respective\n dimensions (A: `[IxK]`, B: `[KxJ]`, C: `[IxJ]`).\n\n Note that the buffers A, B, and C can be of higher dimensionality than\n the traditional 2D mentioned up to now, because of broadcasting rules.\n At this time, we only support broadcast of arrays having ranks of 2 or\n more. Because of the broadcast rules, the higher dimensions have a\n constant index during one matrix multiply. These fixed indices are\n given as prefix dimensions in the starting indices for AA, BB, and CC\n as described above. E.g. if AA has a rank of 3, and BB has a rank of 2,\n the starting indices for AA are `[d, i1, k1]` where `i1` and `k1` are as\n above, and d is index pointing to the current instance of the `IxK`\n AA matrix to be computed. B start indices would be unchanged at `[k1, j1]`.\n\n Simdize is used to state if simdization is requested.\n Unrolling is used to unroll and jam loops as warranted.\n\n Below is an example calculating a matrix multiply with pre-zeroed\n C matrix with the sizes below.\n\n```\n %A: memref<40x60xf32>, %B: memref<60x80xf32>, %C: memref<40x80xf32>\n\n // 3 tiled loops.\n %ii, %jj, %kk = krnl.define_loops 3\n %ib, %il = krnl.block %ii 10 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n %jb, %jl = krnl.block %jj 8 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n %kb, %kl = krnl.block %kk 10 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n // 3 subtiles.\n %ilb, %ill = krnl.block %il 5 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n %jlb, %jll = krnl.block %jl 4 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n %klb, %kll = krnl.block %kl 5 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n // Permute.\n krnl.permute(%ib, %ilb, %ill, %jb, %jlb, %jll, %kb, %klb, %kll)\n [0, 3, 6, 1, 4, 7, 2, 5, 8] :\n !krnl.loop, !krnl.loop, !krnl.loop, !krnl.loop, !krnl.loop,\n !krnl.loop, !krnl.loop, !krnl.loop, !krnl.loop\n // Outer 2 for i, j.\n krnl.iterate(%ib, %jb) with (%ii -> %i = 0 to 40,\n %jj -> %j = 0 to 80,\n %kk -> %k = 0 to 60) {\n %i1, %j1 = krnl.get_induction_var_value(%ib, %jb) :\n (!krnl.loop,!krnl.loop) -> (index, index)\n // Fill C buffer.\n %Cbuff = alloca(): memref<10x8xf32> // n x m_simd\n krnl.copy_to_tile_buffer %Cbuff, %C[%i1, %j1], %f0 :\n memref<10x8xf32>, memref<40x80xf32>\n // Outer 1 for k.\n krnl.iterate(%kb) with () {\n %k1 = krnl.get_induction_var_value(%kb) : (!krnl.loop) -> (index)\n // Fill A and B buffer\n %Abuff = alloca(): memref<10x10xf32> // i x k\n %Bbuff = alloca(): memref<10x8xf32> // k x j_simd\n krnl.copy_to_tile_buffer %Abuff, %A[%i1, %k1], %f0 :\n memref<10x10xf32>, memref<40x60xf32>\n krnl.copy_to_tile_buffer %Bbuff, %B[%k1, %j1], %f0 :\n memref<10x8xf32>, memref<60x80xf32>\n\n // Inner iterations for subtiles.\n krnl.iterate(%ilb, %jlb, %klb) with () {\n %i2, %j2, %k2 = krnl.get_induction_var_value(%ilb, %jlb, %klb) :\n (!krnl.loop,!krnl.loop,!krnl.loop) -> (index,index,index)\n\n krnl.matmul %Abuff[%i1, %k1], %Bbuff[%k1, %j1], %Cbuff[%i1, %j1],\n (%ill, %jll, %kll), (%i2, %j2, %k2), (%c40, %c80, %c60)\n { computeTileSize=[5,4,5], simdize=false, unroll=false } :\n memref<10x10xf32>, memref<10x8xf32>, memref<10x8xf32>,\n (!krnl.loop,!krnl.loop,!krnl.loop)\n }\n }\n // Copy back the data into C.\n krnl.copy_from_tile_buffer %Cbuff, %C[%i1, %j1] :\n memref<10x8xf32>, memref<40x80xf32>\n }\n```\n\n Note that code is simdized along the J dim (last dim of B and C matrices).\n For simd to be enabled, the simdized flag must be set to true, and the\n following condition must be true:\n 1) The vector length is the second entry of (i, j, k) compute tile size.\n The vector length must be a compile time constant.", "operands": [ { "name": "A", "type": "AnyMemRef" }, { "name": "aGlobalIndexMemStart", "type": "Variadic" }, { "name": "B", "type": "AnyMemRef" }, { "name": "bGlobalIndexMemStart", "type": "Variadic" }, { "name": "C", "type": "AnyMemRef" }, { "name": "cGlobalIndexMemStart", "type": "Variadic" }, { "name": "loops", "type": "Variadic" }, { "name": "iGlobalIndexComputeStart", "type": "Index" }, { "name": "jGlobalIndexComputeStart", "type": "Index" }, { "name": "kGlobalIndexComputeStart", "type": "Index" }, { "name": "iGlobalUB", "type": "Index" }, { "name": "jGlobalUB", "type": "Index" }, { "name": "kGlobalUB", "type": "Index" } ], "attributes": [ { "name": "computeTileSize", "type": "OptionalAttr>" }, { "name": "aTileSize", "type": "OptionalAttr>" }, { "name": "bTileSize", "type": "OptionalAttr>" }, { "name": "cTileSize", "type": "OptionalAttr>" }, { "name": "simdize", "type": "DefaultValuedAttr" }, { "name": "unroll", "type": "DefaultValuedAttr" }, { "name": "overcompute", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$A `[` $aGlobalIndexMemStart `]` `,`\n $B `[` $bGlobalIndexMemStart `]` `,`\n $C `[` $cGlobalIndexMemStart `]` `,`\n `(` $loops `)` `,`\n `(` $iGlobalIndexComputeStart `,` $jGlobalIndexComputeStart `,`\n $kGlobalIndexComputeStart `)` `,`\n `(` $iGlobalUB `,` $jGlobalUB `,` $kGlobalUB `)`\n attr-dict `:` type($A) `,` type($B)`,` type($C) `,` `(` type($loops) `)`" }, { "name": "krnl.memcpy", "summary": "Krnl memcpy operation", "description": "Copy `num_elems` elements from `src` to `dest` MemRef.\n\n Starting positions for `src` and `dest` are defined by `src_offset` and\n `dest_offset`, respectively.\n\n It is the users' responsibility to make sure there is no out-of-bound read/write.", "operands": [ { "name": "dest", "type": "AnyMemRef" }, { "name": "src", "type": "AnyMemRef" }, { "name": "num_elems", "type": "I64" }, { "name": "dest_offset", "type": "Index" }, { "name": "src_offset", "type": "Index" } ] }, { "name": "krnl.memset", "summary": "Set buffer to a given value.", "description": "Krnl operation that sets a buffer to a given value.\n In case that the buffer is a MemRef with affine_map, `delayed` indicates\n whether we set values along original or extended iteration space.\n\n For example, given\n - an affine_map `#tile = affine_map < (i)->(i floordiv 4, i mod 4) >`, and\n - a buffer of type `memref<5xf32, #tile>`\n\n Original iteration space is along the first axis that has 5 elements.\n\n If we do normalization, the memref becomes `memref<2x4xf32>`. Now we have\n an extended iteration space along two axes of sizes 2 and 4, respectively.\n This extended iteration space has 8 elements in total.\n\n If `delayed = false`, the original iteration space is used to set values.\n In the above example, only 5 out of 8 elementes will be set to the given value.\n\n If `delayed = true`, the extended iteration space is used to set values.\n In the above example, all 8 elements will be set to the given value.", "operands": [ { "name": "dest", "type": "AnyMemRef" }, { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "delayed", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'dest', 'value', 'mlir::cast($_self).getElementType()'>" } ], "assemblyFormat": "$dest `,` $value attr-dict `:` type($dest)" }, { "name": "krnl.movable", "summary": "Krnl movable operation", "description": "Encapsulates a list of operations, which should be moved under a newly lowered\n affine for operation eventually, but cannot presently because the destination\n affine for operation is not materialized yet.\n\n This operation is automatically generated by the lowering of Krnl to affine dialect\n to assist with maintaining the relative positioning of loop and inner-loop statements.\n This construct is particularly helpful, for example, for lowering statements that\n are nested imperfectly between an \"eager\" and a \"lazy\" loop.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "krnl.noValue", "summary": "An operation representing the absence of a value.", "description": "This operation can be used to represent the absence of a value. It is\n typically used as an argument to operators that have optional parameters,\n and converted into nullptr while krnl to llvm lowering.\n Typically it is used for optional arguments used in KrnlCallop.", "results": [ { "name": "none_val", "type": "NoneType" } ], "attributes": [ { "name": "value", "type": "UnitAttr" } ] }, { "name": "krnl.parallel", "summary": "Mark Krnl loops as parallel loops", "description": "Parallelize the specified loops. When multiple loop specifiers are passed\n as parameters, there loops can be parallelized as a collapsed loop.\n krnl.parallel should be placed as the last operator before krnl.iterate,\n Since we do not want to parallelize the loop until we interpret krnl.block,\n krnl.permute and krnl.unroll.\n\n Optionally, a value may specifiy the number of threads requested for the\n parallel loop. A proc_bind string may also be specified; valid values are\n \"primary\", \"close\", or \"spread\". Default values are used when not specified.\n\n ```\n krnl.parallel (%i0, %i1) : !Krnl.loop, !Krnl.loop\n ```", "operands": [ { "name": "loops", "type": "Variadic" }, { "name": "num_threads", "type": "Optional" } ], "attributes": [ { "name": "proc_bind", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $loops `)` (`,` `num_threads` `(` $num_threads^ `)`)? attr-dict `:` type($loops)" }, { "name": "krnl.parallel_clause", "summary": "Attach OpenMP clauses to an index varialbe", "description": "Attach OpenMP clauses to an index variable. That index variable\n is used to uniquely associate a parallel loop with its clauses.", "operands": [ { "name": "parallel_loop_index", "type": "Index" }, { "name": "num_threads", "type": "Optional" } ], "attributes": [ { "name": "proc_bind", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $parallel_loop_index `)` (`,` `num_threads` `(` $num_threads^ `)`)? \n attr-dict `:` type($parallel_loop_index)" }, { "name": "krnl.permute", "summary": "Krnl permute operation", "description": "Permute a set of affine for loops using a specified permutation map.\n The permutation map `map` should be constructed in such way that the\n for loop referred to by the i-th operand to permute operation is sent\n to the `map[i]`-th position.\n\n For example, the following krnl dialect IR:\n ```\n %ii, %jj, %kk = krnl.define_loops 3\n krnl.permute(%ii, %jj, %kk) [1, 2, 0] : !krnl.loop, !krnl.loop, !krnl.loop\n krnl.iterate (%ii, %jj, %kk) with (%ii -> %i = 0 to 10, %jj -> %j = 0 to 20, %kk -> %k = 0 to 30) {}\n ```\n will be lowered to:\n ```\n // Referenced by %kk\n affine.for %arg0 = 0 to 30 {\n // Referenced by %ii\n affine.for %arg1 = 0 to 10 {\n // Referenced by %jj\n affine.for %arg2 = 0 to 20 {\n }\n }\n }\n ```\n\n For a more complicated example, we demonstrate 3-D tiling using krnl.block in\n conjunction with krnl.permute:\n ```\n %ii, %jj, %kk = krnl.define_loops 3\n // Blocking each loop by a factor of 4.\n %ib, %il = krnl.block %ii 4 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n %jb, %jl = krnl.block %jj 4 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n %kb, %kl = krnl.block %kk 4 : (!krnl.loop) -> (!krnl.loop, !krnl.loop)\n // Move iteration over tile coordinates to be the outer loops and iterateion over\n // the inter-tile elements to be the inner loops.\n krnl.permute(%ib, %il, %jb, %jl, %kb, %kl) [0, 3, 1, 4, 2, 5] : !krnl.loop, !krnl.loop, !krnl.loop, !krnl.loop, !krnl.loop, !krnl.loop\n krnl.iterate(%ib, %il, %jb, %jl, %kb, %kl) with (%ii -> %i = 0 to 1024, %jj -> %j = 0 to 2048, %kk -> %k = 0 to 4096) {\n }\n ```\n\n The above IR gets lowered to:\n ```\n affine.for %arg0 = 0 to 1024 step 4 {\n affine.for %arg1 = 0 to 2048 step 4 {\n affine.for %arg2 = 0 to 4096 step 4 {\n affine.for %arg3 = #map0(%arg0) to #map1(%arg0) {\n affine.for %arg4 = #map0(%arg1) to #map1(%arg1) {\n affine.for %arg5 = #map0(%arg2) to #map1(%arg2) {\n }\n }\n }\n }\n }\n }\n ```", "operands": [ { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "map", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "`(` $loops `)` $map attr-dict `:` type($loops)" }, { "name": "krnl.prefetch", "summary": "A Krnl operation to compute a linear offset index from a N-D index.", "description": "Given a MemRef and an N-D index (id_1, id_2, ..., id_n), prefetch the memory\n location pointed by this memory reference.", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "isWrite", "type": "BoolAttr" }, { "name": "localityHint", "type": "ConfinedAttr, IntMaxValue<3>]>" }, { "name": "isDataCache", "type": "BoolAttr" }, { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "krnl.print", "summary": "Print a value.", "description": "This operation can be used to print the input value. The user needs to provide a\n format string (à la printf) to specify how to print the input value.\n If the input value is not specified the operator will print the format string.", "operands": [ { "name": "input", "type": "Optional" } ], "attributes": [ { "name": "format", "type": "StrAttr" } ] }, { "name": "krnl.print_tensor", "summary": "Print a tensor.", "description": "This operation can be used to generate a call to a runtime function which prints a tensor.\n At the beginning of the msg string, user can add formatting instructions. The flags are:\n\n * `%s`: detailed signature (including shape, type, offsets),\n * `%t`: compact type (ala MLIR: `32x16xfloat`),\n * `%d`: data values.\n\n When no formatting is provided, `%s%d` is used (detailed signature and data) by default.\n Print operation ends with a newline, except when only requesting a compact types (`%t`).", "operands": [ { "name": "input", "type": "AnyMemRef" } ], "attributes": [ { "name": "msg", "type": "StrAttr" } ] }, { "name": "krnl.random_normal", "summary": "Generate a random normal tensor.", "description": "Operation that generates a random normally distributed tensor.", "operands": [ { "name": "output", "type": "AnyTypeOf<[ AnyMemRef ]>" }, { "name": "numberOfValues", "type": "Index" }, { "name": "mean", "type": "AnyFloat" }, { "name": "scale", "type": "AnyFloat" }, { "name": "seed", "type": "AnyFloat" } ] }, { "name": "krnl.region", "summary": "Affine boundary for krnl loops", "description": "This Op has a region with AffineScope trait and is used to limit the\n scope of `affine.for`. The loop inside `krnl.region` can be affined if\n its boundary is defined at the level of `krnl.region`. The `krnl.region` does\n not guarantee or require the loops inside it to be affine.\n With `krnl.region`, a krnl loop may not be affine if its boundary symbol\n is not defined inside a enclosing region without AffineScope trait.\n In MLIR, FuncOp has the AffineScope trait.\n The `krnl.region` will be removed after affine.for is lowered.\n ToFix: current `krnl.region` does not have input and output. You cannot\n create a new memref inside the region and use it outside of the region.", "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ] }, { "name": "krnl.round_even", "summary": "Krnl round to nearest even operation", "description": "Krnl round to nearest even operation. Accept scalar or vector float values.\n Vector must be 1D of a size that is a multiple of the hardware vector size.", "operands": [ { "name": "in", "type": "FloatLike" } ], "results": [ { "name": "out", "type": "FloatLike" } ] }, { "name": "krnl.runtime_instrument", "summary": "instrumentation point.", "description": "Operation that invokes the runtime instrument utility.\n May be used for gdb.", "attributes": [ { "name": "opName", "type": "StrAttr" }, { "name": "tag", "type": "I64Attr" }, { "name": "nodeName", "type": "OptionalAttr" } ] }, { "name": "krnl.runtime_instrument_init", "summary": "instrumentation init point.", "description": "Operation that initializes the runtime instrumentation. Emitted once before\n the first KrnlInstrumentOp in a function. Lowers to a call to\n OMInstrumentPointInit(tag, omCompilationInfo()) so the runtime receives\n model compilation metadata without relying on the weak/strong symbol\n override mechanism at print time.", "attributes": [ { "name": "tag", "type": "I64Attr" } ] }, { "name": "krnl.seqalloc", "summary": "Krnl create a sequence", "description": "This op allocates a memref for a new sequence according to the input Type and length.\n The output is tagged with Allocate side effect, and a deallocation is defined for\n sequence. This deallocation will free all the elements in the sequence as well as\n the sequence itself.", "operands": [ { "name": "length", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyMemRef" } ] }, { "name": "krnl.seqdealloc", "summary": "Krnl dealloc a sequence", "description": "This op deallocate the elements in the sequence and the sequence itself\n with memref::dealloc. This Op is a deep dealloc for sequence type.", "operands": [ { "name": "input_sequence", "type": "AnyMemRef" } ] }, { "name": "krnl.seqextract", "summary": "Krnl load from a sequence", "description": "This op loads an element from the input sequence 'seq' at position 'index'.\n The loaded element is copied and then return.\n The position value is guaranteed to be positive. Negative position allowed\n by ONNX Op definition should be handled before lowered to KrnlSeqExtract.\n\n Attribute 'copy' provides an optimization for copying.\n When the attribute 'copy' is 1 (default value): the extracted element is copied and then return.\n When the attribute 'copy' is 0: the extracted element is directly returned\n without copy.\n\n The returned element is marked as allocated by this Op with the bufferation\n interface so that deallocation can be generated correctly through the\n Bufferization::Deallocation pass.", "operands": [ { "name": "seq", "type": "AnyMemRef" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "output", "type": "AnyType" } ], "attributes": [ { "name": "copy", "type": "DefaultValuedAttr" } ] }, { "name": "krnl.seqstore", "summary": "Krnl store into a seq", "description": "This op is similar to KrnSeqInsertOp but assumes that the input seq has\n the space for the new element and\n only need to copy the element and store it into the sequence.\n There is no return of a new seq, different from KrnlSeqInsertOp.\n This Op is introduced to accumulate a dynamic tensor in a LoopOp with\n statically known iteration count.", "operands": [ { "name": "input", "type": "AnyType" }, { "name": "seq", "type": "AnyMemRef" }, { "name": "index", "type": "Index" } ] }, { "name": "krnl.specialized_kernel", "summary": "Krnl specialized kernel op", "description": "Krnl operation to convert.", "operands": [ { "name": "loops", "type": "Variadic" } ], "assemblyFormat": "`(` $loops `)` attr-dict `:` type($loops)" }, { "name": "krnl.store", "summary": "A Krnl operation to store data to the memref.", "description": "The `krnl.store` stores a value to a memref location given by indices. The\n value stored should have the same type as the elemental type of the memref.\n The number of arguments provided within brackets need to match the rank of\n the memref.", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "traits": [ { "type": "TypesMatchWith<'memref', 'value', 'mlir::cast($_self).getElementType()'>" } ], "assemblyFormat": "$value `,` $memref `[` $indices `]` attr-dict `:` type($memref)" }, { "name": "krnl.strlen", "summary": "Compute the length of a string.", "description": "Krnl operation that computes the length of a string.", "operands": [ { "name": "str", "type": "StringType" } ], "results": [ { "name": "res", "type": "I64" } ] }, { "name": "krnl.strncmp", "summary": "Perform string comparison up to N bytes.", "description": "Krnl operation that performs a string comparison up to N bytes.", "operands": [ { "name": "str1", "type": "StringType" }, { "name": "str2", "type": "StringType" }, { "name": "len", "type": "I64" } ], "results": [ { "name": "res", "type": "I32" } ] }, { "name": "krnl.tan", "summary": "Krnl tan scalar operation", "description": "Krnl tan scalar operation.", "operands": [ { "name": "in", "type": "AnyFloat" } ], "results": [ { "name": "out", "type": "AnyFloat" } ] }, { "name": "krnl.terminate", "summary": "Krnl terminator operation", "description": "Krnl terminator is a special terminator operation for blocks inside krnl\n iterate operations. It unconditionally transmits the control flow to the\n successor of the operation enclosing the region.\n\n This operation does _not_ have a custom syntax. However, krnl control\n operations omit the terminator in their custom syntax for brevity." }, { "name": "krnl.unroll", "summary": "Krnl unroll operation", "description": "Fully unroll the specified loops.\n ```\n krnl.unroll %i\n ```\n unrolls the loop referred to by %i fully.", "operands": [ { "name": "loop", "type": "AnyType" } ], "assemblyFormat": "$loop attr-dict `:` type($loop)" }, { "name": "krnl.vector_type_cast", "summary": "vector type cast operation", "description": "The \"vector_type_cast\" operation converts a memref from an non-vector\n element type to another memref of a vector elemental type while not changing\n the source memref's element type. The last dimension size of the source\n dimension is divided (floor division) by the vector size to obtain the\n corresponding dimension for target memref type.\n\n ```\n %MV = vector_type_cast %M : memref<64x16xf32> to memref<64x2xvector<8xf32>>\n %AV = vector_type_cast %A : memref to memref>\n ```", "operands": [ { "name": "source", "type": "AnyMemRef" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($result)" }, { "name": "krnl.yield", "summary": "Yield values to parent operation", "description": "The `krnl.yield` yields zero or more SSA values from an krnl.iterate op region and\n terminates the region. The semantics of how the values yielded are used\n is defined by the parent operation.\n If `krnl.yield` has any operands, the operands must match the parent\n operation's results.\n If the parent operation defines no values, then the `krnl.yield` may be\n left out in the custom syntax and the builders will insert one implicitly.\n Otherwise, it has to be present in the syntax to indicate which values are\n yielded.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "lagrad.diff", "summary": "Annotate a function for automatic differentiation via Enzyme", "description": "The `lagrad.diff` operation annotates a function for automatic differentiation via Enzyme.", "operands": [ { "name": "input", "type": "FunctionType" } ], "results": [ { "name": "res", "type": "FunctionType" } ], "assemblyFormat": "$input attr-dict `:` type($input) `,` type($res)" }, { "name": "lagrad.grad", "summary": "Reverse-mode autodiff a standard function.", "description": "The `lagrad.grad` operation performs a source transformation to compute the gradient of a func op.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "F", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$F `(` $operands `)` attr-dict `:` functional-type($operands, $results)" }, { "name": "lagrad.pack", "summary": "convert fully materialized triangular tensor to packed", "description": "The `lagrad.pack` operation denotes a conversion from a fully materialized strictly lower triangular tensor to a packed triangular tensor.", "operands": [ { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "dest", "type": "AnyRankedTensor" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "lagrad.tangent", "summary": "Forward-mode autodiff a standard function.", "description": "The `lagrad.tangent` operation performs a source transformation to compute the forward-mode (tangent) gradient of a function.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "F", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$F `(` $operands `)` attr-dict `:` functional-type($operands, $results)" }, { "name": "layer.box", "summary": "layer container operation", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "op", "type": "StrAttr" }, { "name": "attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$op `(` $operands `)` attr-dict `:` type($operands) `->` type($results) $body" }, { "name": "layer.return", "summary": "Return results from a layer", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "linalg.abs", "summary": "Applies abs(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.add", "summary": "Adds two tensors elementwise.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.add` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.batch_matmul", "summary": "Performs a batched matrix multiplication of two 3D inputs.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\n them to the same data type as the accumulator/output.\n\n Broadcast and Transpose semantics can be appiled by specifying the explicit attribute\n 'indexing_maps' as shown below. This is a list attribute, so must include maps for all\n arguments if specified.\n\n Example Transpose:\n ```mlir\n linalg.batch_matmul\n indexing_maps = [affine_map<(batch, m, n, k) -> (batch, k, m)>, // transpose\n affine_map<(batch, m, n, k) -> (batch, k, n)>,\n affine_map<(batch, m, n, k) -> (batch, m, n)>]\n ins(%arg0, %arg1 : memref<2x5x3xf32>,memref<2x5x7xf32>)\n outs(%arg2: memref<2x3x7xf32>)\n ```\n\n Example Broadcast:\n ```mlir\n linalg.batch_matmul\n indexing_maps = [affine_map<(batch, m, n, k) -> (k)>, // broadcast\n affine_map<(batch, m, n, k) -> (batch, k, n)>,\n affine_map<(batch, m, n, k) -> (batch, m, n)>]\n ins(%arg0, %arg1 : memref<5xf32>, memref<2x5x7xf32>)\n outs(%arg2: memref<2x3x7xf32>)\n ```\n\n Example Broadcast and Transpose:\n ```mlir\n linalg.batch_matmul\n indexing_maps = [affine_map<(batch, m, n, k) -> (m, k)>, // broadcast\n affine_map<(batch, m, n, k) -> (batch, n, k)>, // transpose\n affine_map<(batch, m, n, k) -> (batch, m, n)>]\n ins(%arg0, %arg1 : memref<3x5xf32>, memref<2x7x5xf32>)\n outs(%arg2: memref<2x3x7xf32>)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "DefaultValuedOptionalAttr, BatchMatmulOp::getDefaultIndexingMaps($_builder.getContext())>" }, { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.batch_matvec", "summary": "Performs a batched matrix-vector multiplication.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.batch_mmt4d", "summary": "Performs a batched matrix-matrix-transpose multiplication of two\nbatched-4D (5D) inputs.", "description": "Besides the outermost batch dimension has the same semantic as\nlinalg.batch_matmul, the differences from linalg.batch_matmul in the\nnon-batch dimensions are the same as linalg.mmt4d vs. linalg.matmul. See the\ndescription of lingalg.mmt4d.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.batch_reduce_matmul", "summary": "Performs a batch-reduce matrix multiplication on two inputs.\n The partial multiplication results are reduced into a 2D output.", "description": "Numeric casting is performed on the operands to the inner multiply,\n promoting them to the same data type as the accumulator/output.\n\n Broadcast and Transpose semantics can be applied by specifying the explicit attribute\n 'indexing_maps' as shown below. This is a list attribute, so must include maps for all\n arguments if specified.\n\n Example Transpose:\n ```mlir\n linalg.batch_reduce_matmul\n indexing_maps = [affine_map<(batch, m, n, k) -> (batch, k, m)>, // transpose\n affine_map<(batch, m, n, k) -> (batch, k, n)>,\n affine_map<(batch, m, n, k) -> (m, n)>]\n ins(%arg0, %arg1 : memref<2x5x3xf32>,memref<2x5x7xf32>)\n outs(%arg2: memref<3x7xf32>)\n ```\n\n Example Broadcast:\n ```mlir\n linalg.batch_reduce_matmul\n indexing_maps = [affine_map<(batch, m, n, k) -> (k)>, // broadcast\n affine_map<(batch, m, n, k) -> (batch, k, n)>,\n affine_map<(batch, m, n, k) -> (m, n)>]\n ins(%arg0, %arg1 : memref<5xf32>, memref<2x5x7xf32>)\n outs(%arg2: memref<3x7xf32>)\n ```\n\n Example Broadcast and Transpose:\n ```mlir\n linalg.batch_reduce_matmul\n indexing_maps = [affine_map<(batch, m, n, k) -> (m, k)>, // broadcast\n affine_map<(batch, m, n, k) -> (batch, n, k)>, // transpose\n affine_map<(batch, m, n, k) -> (m, n)>]\n ins(%arg0, %arg1 : memref<3x5xf32>, memref<2x7x5xf32>)\n outs(%arg2: memref<3x7xf32>)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "DefaultValuedOptionalAttr, BatchReduceMatmulOp::getDefaultIndexingMaps($_builder.getContext())>" }, { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.batch_vecmat", "summary": "Performs a batched matrix-vector multiplication.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.broadcast", "summary": "Static broadcast operator", "description": "Broadcast the input into the given shape by adding `dimensions`.\n\n Example:\n ```mlir\n %bcast = linalg.broadcast\n ins(%input:tensor<16xf32>)\n outs(%init:tensor<16x64xf32>)\n dimensions = [1]\n ```", "operands": [ { "name": "input", "type": "TensorOrMemref" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimensions", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.ceil", "summary": "Applies ceil(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.contract", "summary": "Perform a contraction on two inputs, accumulating into the third.", "description": "The semantics of contracting inputs `A` and `B` on top of `C` to produce\n output `D` is given by\n\n `D[H] = (SUM_{(I ∪ J) \\ H} A[I] * B[J]) + C[H]`\n\n where `I`, `J`, and `H` are tuples of (pairwise distinct) dimension\n identifiers - meant to range over valid indices - corresponding to the\n results of the mandatory (projected permutation) `indexing_maps` for `A`,\n `B` and `C`. `SUM_{dims}` means reduce over all valid indices for the\n dimensions in the set `dims` (with `I`, `J`, and `K` treated as _sets_ of\n dim identifiers).\n\n The iteration space consists of all dimensions in `I`, `J` and `H`, i.e. the\n domain of each of the `affine_map`s. Like for einsums, the iteration type of\n each dim is inferred and is either:\n\n - reduction: the dim is used to index into `A` and `B` but not `C`. Per the\n above semantics, these dims will be contracted, i.e. reduced over.\n\n - parallel: the dim is used to index into `C` and at least one of `A` and\n `B`, and - deriving from matmul terminology - is either an \"M-like\" dim\n (if used on `A` and `C`), an \"N-like\" dim (if used on `B` and `C`) or a\n \"batch\"-dim (if used to index into `A`, `B`, and `C`).\n\n For example, batch-matmul is given by `I = ⟨ b, m, k ⟩`, `J = ⟨ b, k, n ⟩`,\n `H = ⟨ b, m, n ⟩` (with `k` as a contracting reduction-dimension while `m`,\n `n` and `b` have parallel iteration-type) and gets represented as:\n\n ```mlir\n %D = linalg.contract\n indexing_maps = [affine_map<(batch, m, n, k) -> (batch, m, k)>,\n affine_map<(batch, m, n, k) -> (batch, k, n)>,\n affine_map<(batch, m, n, k) -> (batch, m, n)>]\n ins(%A, %B: tensor, tensor)\n outs(%C: tensor) -> tensor\n ```\n\n Note that by permuting dims in the `affine_map`s' results, accesses to\n to the inputs and output can be arbitrarily transposed. Similarly, arbitrary\n broadcasts can be achieved through leaving out dims on either input operand.\n For example, the following is a variant of batch-matmul with a transposition\n applied to `A` while `B`'s 2D-matrix gets broadcasted along the batch dim:\n\n ```mlir\n linalg.contract\n indexing_maps = [affine_map<(batch, m, n, k) -> (batch, k, m)>,\n affine_map<(batch, m, n, k) -> (k, n)>,\n affine_map<(batch, m, n, k) -> (batch, m, n)>]\n ins(%A, %B: memref, memref)\n outs(%C: memref)\n ```\n\n Numeric casting is performed on the operands to the inner multiplication,\n promoting/truncating them to the same data type as the accumulator/output.\n\n TODO: Allow control over the combining/accumulating op and possibly the\n multiplication op.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "combiner", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.conv", "summary": "", "description": "", "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_1d", "summary": "Performs 1-D convolution with no channels.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_1d_ncw_fcw", "summary": "Performs 1-D convolution.", "description": "Layout:\n * Input: NCW.\n * Kernel: FCW.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_1d_nwc_wcf", "summary": "Performs 1-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d", "category": "Layer", "summary": "Performs 2-D convolution with no channels.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nchw_fchw", "summary": "Performs 2-D convolution.", "description": "Layout:\n * Input: NCHW.\n * Kernel: FCHW.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nchw_fchw_q", "summary": "Performs 2-D convolution with zero point offsets.", "description": "Layout:\n * Input: NCHW.\n * Kernel: FCHW.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. This includes the zero\npoint offsets common to quantized operations.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_ngchw_fgchw", "summary": "Performs 2-D grouped convolution.", "description": "Layout:\n * Input: NGCHW.\n * Kernel: FGCHW.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_ngchw_gfchw", "summary": "Performs 2-D grouped convolution.", "description": "Layout:\n * Input: NGCHW.\n * Kernel: GFCHW.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_ngchw_gfchw_q", "summary": "Performs 2-D grouped convolution with zero-point offsets.", "description": "Layout:\n * Input: NGCHW.\n * Kernel: GFCHW.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. This includes the zero\npoint offsets common to quantized operations.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nhwc_fhwc", "summary": "Performs 2-D convolution.", "description": "Layout:\n * Input: NHWC.\n * Kernel: FHWC.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nhwc_fhwc_q", "summary": "Performs 2-D convolution with zero point offsets.", "description": "Layout:\n * Input: NHWC.\n * Kernel: FHWC.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. This includes the zero\npoint offsets common to quantized operations.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nhwc_hwcf", "summary": "Performs 2-D convolution.", "description": "Layout:\n * Input: NHWC.\n * Kernel: HWCF.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nhwc_hwcf_q", "summary": "Performs 2-D convolution with zero point offsets.", "description": "Layout:\n * Input: NHWC.\n * Kernel: HWCF.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. This includes the zero\npoint offsets common to quantized operations.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nhwgc_gfhwc", "summary": "Performs 2-D grouped convolution.", "description": "Layout:\n * Input: NHWGC.\n * Kernel: GFHWC.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_2d_nhwgc_gfhwc_q", "summary": "Performs 2-D grouped convolution with zero point offsets.", "description": "Layout:\n * Input: NHWGC.\n * Kernel: GFHWC.\n\nNumeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. This includes the zero\npoint offsets common to quantized operations.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_3d", "summary": "Performs 3-D convolution with no channels.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_3d_ncdhw_fcdhw", "summary": "Performs 3-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_3d_ndhwc_dhwcf", "summary": "Performs 3-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.conv_3d_ndhwc_dhwcf_q", "summary": "Performs 3-D convolution with zero point offsets.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. This includes the zero\npoint offsets common to quantized operations.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.copy", "summary": "Copies the tensor elementwise.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_1d_ncw_cw", "summary": "Performs depth-wise 1-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. Multiplier is set to 1\nwhich is a special case for most depthwise convolutions.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_1d_nwc_wc", "summary": "Performs depth-wise 1-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. Multiplier is set to 1\nwhich is a special case for most depthwise convolutions.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_1d_nwc_wcm", "summary": "Performs depth-wise 1-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_2d_nchw_chw", "summary": "Performs depth-wise 2-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. Multiplier is set to 1\nwhich is a special case for most depthwise convolutions.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_2d_nhwc_hwc", "summary": "Performs depth-wise 2-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. Multiplier is set to 1\nwhich is a special case for most depthwise convolutions.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_2d_nhwc_hwc_q", "summary": "Performs depth-wise 2-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_2d_nhwc_hwcm", "summary": "Performs depth-wise 2-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_2d_nhwc_hwcm_q", "summary": "Performs depth-wise 2-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_3d_ncdhw_cdhw", "summary": "Performs depth-wise 3-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. Multiplier is set to 1\nwhich is a special case for most depthwise convolutions.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_3d_ndhwc_dhwc", "summary": "Performs depth-wise 3-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. Multiplier is set to 1\nwhich is a special case for most depthwise convolutions.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.depthwise_conv_3d_ndhwc_dhwcm", "summary": "Performs depth-wise 3-D convolution.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.div", "summary": "Divides the first tensor by the second tensor, elementwise.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.div` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.div_unsigned", "summary": "Divides the first tensor by the second tensor, elementwise. For integer\ntypes, performs an unsigned division.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.div` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.dot", "summary": "Performs a dot product of two vectors to a scalar result.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.elementwise", "summary": "Performs element-wise operation", "description": "The attribute `kind` describes arithmetic operation to perform. The\n operation kind can be unary (e.g. max), binary (e.g. add) or ternary\n (e.g. select).\n\n By default, all indexing maps are identities. In the case of default\n indexing map, all input and output shapes must match. The number of dims in\n each of the identity maps is equal to the rank of the output type.\n\n Affine-maps for operands and result are required to be provided by the user\n when a transpose and/or broadcast is needed on any operand. When a map is not\n provided, default identity maps are inferred for each operand.\n\n Iterator-types are always all `parallel`.\n Iterator-types are needed for constructing the underlying structured op.\n\n The number of dims of the iterator-types are inferred from the rank of\n the result type.\n\n Example:\n\n Defining a unary linalg.elementwise with default indexing-map:\n ```mlir\n %exp = linalg.elementwise\n kind=#linalg.elementwise_kind\n ins(%x : tensor<4x16x8xf32>)\n outs(%y: tensor<4x16x8xf32>) -> tensor<4x16x8xf32>\n ```\n\n Defining a binary linalg.elementwise with user-defined indexing-map:\n ```mlir\n %add = linalg.elementwise\n kind=#linalg.elementwise_kind\n indexing_maps = [#transpose, #broadcast, #identity]\n ins(%exp, %arg1 : tensor<4x16x8xf32>, tensor<4x16xf32>)\n outs(%arg2: tensor<4x8x16xf32>) -> tensor<4x8x16xf32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "kind", "type": "ElementwiseKindAttr" }, { "name": "indexing_maps", "type": "DefaultValuedOptionalAttr, {}>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.erf", "summary": "Applies erf(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.exp", "summary": "Applies exp(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.fill", "summary": "Fills the output tensor with the given value.", "description": "Works for arbitrary ranked output tensors since the operation performs scalar\naccesses only and is thus rank polymorphic. Numeric casting is performed on\nthe value operand, promoting it to the same data type as the output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.fill_rng_2d", "summary": "Fills the output tensor with pseudo random numbers.", "description": "The operation generations pseudo random numbers using a linear congruential\ngenerator. It provides no guarantees regarding the distribution of the\ngenerated random numbers. Instead of generating the random numbers\nsequentially, it instantiates one random number generator per data element\nand runs them in parallel. The seed operand and the indices of the data\nelement seed the random number generation. The min and max operands limit\nthe range of the generated random numbers.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.floor", "summary": "Applies floor(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.generic", "description": "Generic Linalg op form where the key properties of the computation are\n specified as attributes. In pretty form, a `linalg.generic` op is written\n as:\n\n ```mlir\n linalg.generic #trait_attribute\n ins(%A, %B : memref,\n memref)\n outs(%C : memref)\n attrs = {other-optional-attributes}\n {region}\n ```\n\n Where #trait_attributes is an alias of a dictionary attribute containing:\n - doc [optional]: a documentation string\n - indexing_maps: a list of AffineMapAttr, one AffineMapAttr per each input\n and output view. Such AffineMapAttr specifies the mapping between the\n loops and the indexing within each view.\n - library_call [optional]: a StringAttr containing the name of an\n external library function that the linalg.generic operation maps to.\n The external library is assumed to be dynamically linked and no strong\n compile-time guarantees are provided. In the absence of such a library\n call, linalg.generic will always lower to loops.\n - iterator_types: an ArrayAttr specifying the type of the enclosing loops.\n Each element of the list represents and iterator of one of the following\n types:\n parallel, reduction, window\n\n Example:\n Defining a #matmul_trait attribute in MLIR can be done as follows:\n ```mlir\n #matmul_accesses = [\n (m, n, k) -> (m, k),\n (m, n, k) -> (k, n),\n (m, n, k) -> (m, n)\n ]\n #matmul_trait = {\n doc = \"C(m, n) += A(m, k) * B(k, n)\",\n indexing_maps = #matmul_accesses,\n library_call = \"linalg_matmul\",\n iterator_types = [\"parallel\", \"parallel\", \"reduction\"]\n }\n ```\n\n And can be reused in multiple places as:\n ```mlir\n linalg.generic #matmul_trait\n ins(%A, %B : memref,\n memref)\n outs(%C : memref)\n {other-optional-attributes} {\n ^bb0(%a: f32, %b: f32, %c: f32) :\n %d = arith.mulf %a, %b: f32\n %e = arith.addf %c, %d: f32\n linalg.yield %e : f32\n }\n ```\n\n This may lower to either:\n ```mlir\n call @linalg_matmul(%A, %B, %C) :\n (memref,\n memref,\n memref)\n -> ()\n ```\n\n or IR resembling:\n ```mlir\n scf.for %m = %c0 to %M step %c1 {\n scf.for %n = %c0 to %N step %c1 {\n scf.for %k = %c0 to %K step %c1 {\n %a = load %A[%m, %k] : memref\n %b = load %B[%k, %n] : memref\n %c = load %C[%m, %n] : memref\n %d = arith.mulf %a, %b: f32\n %e = arith.addf %c, %d: f32\n store %e, %C[%m, %n] : memref\n }\n }\n }\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "TypedArrayAttrBase" }, { "name": "iterator_types", "type": "TypedArrayAttrBase" }, { "name": "doc", "type": "OptionalAttr" }, { "name": "library_call", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.index", "summary": "linalg index operation", "description": "The `linalg.index` operation returns the iteration index of the immediately\n enclosing linalg structured operation for the iteration dimension `dim`. The\n `dim` attribute specifies the position of the accessed dimension in the\n indexing map domain.\n\n Example:\n\n ```mlir\n #map = affine_map<(i, j) -> (i, j)>\n linalg.generic {indexing_maps = [#map, #map],\n iterator_types = [\"parallel\", \"parallel\"]}\n outs(%I, %J : memref, memref) {\n ^bb0(%arg0 : index, %arg1 : index):\n // Access the outer iteration dimension i\n %i = linalg.index 0 : index\n // Access the inner iteration dimension j\n %j = linalg.index 1 : index\n linalg.yield %i, %j : index, index\n }\n ```\n\n This may lower to IR resembling:\n\n ```mlir\n %0 = dim %I, %c0 : memref\n %1 = dim %I, %c1 : memref\n scf.for %i = %c0 to %0 step %c1 {\n scf.for %j = %c0 to %1 step %c1 {\n store %i, %I[%i, %j] : memref\n store %j, %J[%i, %j] : memref\n }\n }\n ```", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "ConfinedAttr]>" } ], "assemblyFormat": "$dim attr-dict `:` type($result)" }, { "name": "linalg.init_tensor", "summary": "Replace all init_tensor ops by alloc_tensor ops.", "description": "init_tensor ops return a tensor of unspecified contents who's only purpose is to carry the tensor shape. This pass converts such ops to bufferization.alloc_tensor ops, which bufferize to buffer allocations.", "hasCustomAssemblyFormat": 1 }, { "name": "linalg.log", "summary": "Applies log(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.map", "summary": "Elementwise operations", "description": "Models elementwise operations on tensors in terms of arithmetic operations\n on the corresponding elements.\n\n Example:\n ```mlir\n %add = linalg.map\n ins(%lhs, %rhs : tensor<64xf32>, tensor<64xf32>)\n outs(%init: tensor<64xf32>)\n (%lhs_elem: f32, %rhs_elem: f32) {\n %0 = arith.addf %lhs_elem, %rhs_elem: f32\n linalg.yield %0: f32\n }\n ```\n\n Shortened print form is available for simple maps where the body contains exactly\n two operations (the payload operation and a yield), the payload operation has\n the same number of operands as block arguments with operands matching block\n arguments in order, and the yield operand is the result of the payload operation.\n\n The example above will be printed using the shortened form as:\n ```mlir\n %add = linalg.map { arith.addf }\n ins(%lhs, %rhs : tensor<64xf32>, tensor<64xf32>)\n outs(%init: tensor<64xf32>)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "mapper", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.matmul", "summary": "Performs a matrix multiplication of two 2D inputs without broadcast or transpose.", "description": "Numeric casting is performed on the operands to the inner multiply,\n promoting them to the same data type as the accumulator/output.\n\n Broadcast and Transpose semantics can be appiled by specifying the explicit attribute\n 'indexing_maps' as shown below.This is a list attribute, so the list must include all\n the maps if specified.\n\n Example Transpose:\n ```mlir\n linalg.matmul\n indexing_maps = [affine_map<(m, n, k) -> (k, m)>, // transpose\n affine_map<(m, n, k) -> (k, n)>,\n affine_map<(m, n, k) -> (m, n)>]\n ins(%arg0, %arg1 : memref<5x3xf32>,memref<5x7xf32>)\n outs(%arg2: memref<3x7xf32>)\n ```\n\n Example Broadcast:\n ```mlir\n linalg.matmul\n indexing_maps = [affine_map<(m, n, k) -> (k)>, // broadcast\n affine_map<(m, n, k) -> (k, n)>,\n affine_map<(m, n, k) -> (m, n)>]\n ins(%arg0, %arg1 : memref<3xf32>, memref<5x7xf32>)\n outs(%arg2: memref<3x7xf32>)\n ```\n\n Example Broadcast and transpose:\n ```mlir\n linalg.matmul\n indexing_maps = [affine_map<(m, n, k) -> (k, m)>, // transpose\n affine_map<(m, n, k) -> (k)>, // broadcast\n affine_map<(m, n, k) -> (m, n)>]\n ins(%arg0, %arg1 : memref<5x3xf32>, memref<7xf32>)\n outs(%arg2: memref<3x7xf32>)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "indexing_maps", "type": "DefaultValuedOptionalAttr, MatmulOp::getDefaultIndexingMaps($_builder.getContext())>" }, { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.matmul_transpose_a", "category": "Layer", "summary": "Performs a matrix multiplication with transposed LHS.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.matmul_transpose_b", "summary": "Performs a matrix multiplication with transposed RHS.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "cast", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.matvec", "summary": "Performs a matrix-vector multiplication.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.max", "summary": "Takes the max (signed) between two inputs, elementwise.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.max` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.min", "summary": "Takes the min (signed) between two inputs, elementwise.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.min` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.mmt4d", "summary": "Performs a matrix-matrix-transpose multiplication of two 4D inputs.", "description": "Differences from linalg.matmul:\n* The right hand side is transposed, whence the 't' in 'mmt'.\n* The input and output tensors have a 4D shape instead of a 2D shape. They\n are interpreted as 2D matrices with one level of 2D tile subdivision,\n whence the 2+2=4 dimensions. The inner tile dimensions are identified with\n '0' suffixes below, for instance the LHS matrix shape (M, K, M0, K0) reads\n as: MxK tiles, each of shape M0xK0.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.mul", "summary": "Multiplies two tensors elementwise.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.mul` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.negf", "summary": "Applies negf(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pack", "summary": "linalg.pack operation", "description": "The \"pack\" operation converts a source tensor of rank `n` into a result\n tensor of rank `n + k` with a tiled and packed layout (maybe with padding)\n and optionally transposes the tiled source tensor dimensions.\n\n `inner_tiles` (mandatory) specifies `k` tile sizes. These tile sizes\n correspond to the least significant (\"inner\") result tensor dimension sizes,\n in the same order. Tile sizes can be static or dynamic.\n\n `inner_dims_pos` (mandatory) specifies `k` source tensor dimensions that are\n being tiled, where `0 <= k <= n`.\n - `inner_dims_pos[i]` specifies the source tensor dimension tiled by\n `inner_tiles[i]` where `0 <= i < k`. All the values in `inner_dims_pos` are\n within [0, n).\n - The tiled dimensions (of size `inner_tiles`) are added to the end of the\n result tensor in the order in which they appear, i.e.\n `shape(result)[rank(source) + i] = inner_tiles[i]` for `0 <= i < k`.\n - The following relationship for the tiled dimensions holds:\n `shape(result)[inner_dims_pos[i]] = shape(source)[inner_dims_pos[i]] / inner_tiles[i]`,\n where (⌈/⌉ indicates CeilDiv).\n\n\n Example: If `inner_tiles = [16, 32]`, the result tensor has a shape of\n `...x16x32`. If `inner_dims_pos = [0, 1]`, the 0th source dimension is tiled\n by 16 and the 1st source dimension is tiled by 32. Other source dimensions\n (if any) are not tiled. If `inner_dims_pos = [1, 0]`, the 1st dimension is\n tiled by 16 and the 0th dimension is tiled by 32.\n\n Example:\n ```mlir\n // NC to NCnc\n %0 = linalg.pack %source inner_dims_pos = [0, 1] inner_tiles = [8, 32]\n into %dest : tensor<128x256xf32> -> tensor<16x8 x 8x32 xf32>\n // \\ / \\ /\n // Outer Dims: 16x8 Inner Dims: 8x32\n\n // CHW to CHWhw\n %0 = linalg.pack %source inner_dims_pos = [2, 1] inner_tiles = [4, 2]\n into %dest : tensor<3x20x24xf32> -> tensor<3x10x6 x 4x2 xf32>\n // \\ / \\ /\n // Outer Dims: 3x10x6 Inner Dims: 4x2\n\n // HCW to HCWhw\n %0 = linalg.pack %source inner_dims_pos = [2, 0] inner_tiles = [4, 2]\n into %dest : tensor<18x3x32xf32> -> tensor<9x3x8 x 4x2 xf32>\n // \\ / \\ /\n // Outer Dims: 9x3x8 Inner Dims: 4x2\n ```\n\n `outer_dims_perm` (optional) specifies a permutation for the outer\n dimensions. If specified, it must have `n` elements.\n\n Example:\n ```mlir\n // CK to KCck\n %0 = linalg.pack %source outer_dims_perm = [1, 0] inner_dims_pos = [0, 1]\n inner_tiles = [8, 32] into %dest\n : tensor<128x256xf32> -> tensor<8x16 x 8x32 xf32>\n // \\ /\n // compare with \"NC to NCnc\": outer dims are transposed\n ```\n\n `padding_value` specifies a padding value at the boundary on non-perfectly\n divisible dimensions. Padding is optional:\n - If absent, it is assumed that for all inner tiles,\n `shape(source)[inner_dims_pos[i]] % inner_tiles[i] == 0`, i.e. all inner\n tiles divide perfectly the corresponding outer dimension in the result\n tensor. It is UB if the tile does not perfectly divide the dimension.\n - If present, it will pad along high dimensions (high-padding) to make the\n tile complete. Note that it is not allowed to have artificial padding that\n is not strictly required by linalg.pack (i.e., padding past what is needed\n to complete the last tile along each packed dimension). It is UB if extra\n padding is requested.\n It is not possible to verify the requirements statically with dynamic\n shapes, so they are treated as UB.\n\n Example:\n ```mlir\n %0 = linalg.pack %arg0 padding_value(%pad : f32) outer_dims_perm = [2, 1, 0]\n inner_dims_pos = [1] inner_tiles = [2] into %arg1\n : tensor<200x127x256xf32> -> tensor<256x64x200x2xf32>\n // \\\n // padded and tiled dim\n //\n // Source dimension 1 is tiled. 64 does not divide 127 evenly, so 1 padded\n // element is added at the end.\n //\n // Note: Only tiled dimensions can be padded.\n ```\n\n Invalid example that has artificial padding:\n ```mlir\n %0 = linalg.pack %src padding_value(%cst : f32) inner_dims_pos = [0]\n inner_tiles = [8] into %dest\n : tensor<9xf32> -> tensor<3x8xf32>\n // \\\n // expect tensor<2x8xf32> because CeilDiv(9, 8) = 2\n ```", "operands": [ { "name": "source", "type": "TensorOrMemRef<[AnyType]>" }, { "name": "dest", "type": "TensorOrMemRef<[AnyType]>" }, { "name": "padding_value", "type": "Optional" }, { "name": "inner_tiles", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "outer_dims_perm", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_dims_pos", "type": "DenseI64ArrayAttr" }, { "name": "static_inner_tiles", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'dest', 'result', '$_self'>" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.pooling_nchw_max", "summary": "Performs max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nchw_sum", "summary": "Performs sum pooling.", "description": "Layout:\n * Input: NCHW.\n * Kernel: HW.\n\nNumeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_ncw_max", "summary": "Performs max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_ncw_sum", "summary": "Performs sum pooling.", "description": "Layout:\n * Input: NCW.\n * Kernel: W.\n\nNumeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_ndhwc_max", "summary": "Performs 3D max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_ndhwc_min", "summary": "Performs 3D min pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_ndhwc_sum", "summary": "Performs 3D sum pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nhwc_max", "summary": "Performs max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nhwc_max_unsigned", "summary": "Performs unsigned max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nhwc_min", "summary": "Performs min pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nhwc_min_unsigned", "summary": "Performs unsigned min pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nhwc_sum", "summary": "Performs sum pooling.", "description": "Layout:\n * Input: NHWC.\n * Kernel: HW.\n\nNumeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nwc_max", "summary": "Performs max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nwc_max_unsigned", "summary": "Performs unsigned max pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nwc_min", "summary": "Performs min pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nwc_min_unsigned", "summary": "Performs unsigned min pooling.", "description": "Numeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.pooling_nwc_sum", "summary": "Performs sum pooling.", "description": "Layout:\n * Input: NWC.\n * Kernel: W.\n\nNumeric casting is performed on the input operand, promoting it to the same\ndata type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "attributes": [ { "name": "strides", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.powf", "summary": "Takes the powf(lhs, rhs) between two inputs, elementwise. For powf(arg, 2) use `linalg.square`.", "description": "Only applies to floating point values.\n\nThe shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.powf` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.quantized_batch_matmul", "summary": "Performs a batched matrix multiplication of two 3D inputs.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. The quantized variant\nincludes zero-point adjustments for the left and right operands of the\nmatmul.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.quantized_matmul", "summary": "Performs a matrix multiplication of two 2D inputs.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output. The quantized variant\nincludes zero-point adjustments for the left and right operands of the\nmatmul.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.reciprocal", "summary": "Applies reciprocal(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.reduce", "summary": "Reduce operator", "description": "Executes `combiner` on the `dimensions` of `inputs` and returns the\n reduced result. The `dimensions` attribute needs to list the reduction\n dimensions in increasing order.\n\n Example:\n ```mlir\n %reduce = linalg.reduce\n ins(%input:tensor<16x32x64xf32>)\n outs(%init:tensor<16x64xf32>)\n dimensions = [1]\n (%in: f32, %out: f32) {\n %0 = arith.addf %out, %in: f32\n linalg.yield %0: f32\n }\n ```\n\n Shortened print form is available for simple reduces where the body contains exactly\n two operations (the payload operation and a yield), the payload operation has the\n same number of operands as block arguments, the first block argument (init) is the\n last operand of the payload operation with remaining operands matching remaining\n block arguments in order, and the yield operand is the result of the payload operation.\n\n The example above will be printed using the shortened form as:\n ```mlir\n %reduce = linalg.reduce { arith.addf }\n ins(%input:tensor<16x32x64xf32>)\n outs(%init:tensor<16x64xf32>)\n dimensions = [1]\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimensions", "type": "ConfinedAttr]>" } ], "regions": [ { "name": "combiner", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.round", "summary": "Applies round(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.rsqrt", "summary": "Applies rsqrt(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.select", "summary": "Chooses one value based on a binary condition supplied as its first operand.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.select` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.softmax", "category": "Activation", "summary": "Softmax operator", "description": "linalg.softmax computes a numerically stable version of softmax.\n\n For a given input tensor and a specified dimension `d`, compute:\n 1. the max `m` along that dimension `d`\n 2. f(x) = exp(x - m)\n 3. sum f(x) along dimension d to get l(x).\n 4. compute the final result f(x) / l(x).\n\n This is an aggregate linalg operation that further reduces to a small DAG of\n structured operations.\n\n Warning: Regarding the tiling capabilities, the implementation doesn't\n check that the provided dimensions make sense. This is the responsability\n of the transformation calling the tiling to ensure that the provided\n sizes for each dimension make sense with respect to the semantic of\n softmax.", "operands": [ { "name": "input", "type": "AnyShaped" }, { "name": "output", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `:` type($output) `)`\n (`->` type($result)^)?" }, { "name": "linalg.sqrt", "summary": "Applies sqrt(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.square", "summary": "Applies square(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.sub", "summary": "Subtracts two tensors elementwise.", "description": "The shapes and element types must be identical. The appropriate casts,\nbroadcasts and reductions should be done previously to calling this op.\n\nThis means reduction/broadcast/element cast semantics is explicit. Further\npasses can take that into account when lowering this code. For example,\na `linalg.broadcast` + `linalg.sub` sequence can be lowered to a\n`linalg.generic` with different affine maps for the two operands.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.tanh", "category": "Activation", "summary": "Applies tanh(x) elementwise.", "description": "No numeric casting is performed on the input operand.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.transpose", "category": "Transform", "summary": "Transpose operator", "description": "Permutes the dimensions of `input` according to the given `permutation`.\n `dim(result, i) = dim(input, permutation[i])`\n\n This op actually moves data, unlike `memref.transpose` which is a metadata\n operation only that produces a transposed \"view\".\n\n Example:\n ```mlir\n %transpose = linalg.transpose\n ins(%input:tensor<16x64xf32>)\n outs(%init:tensor<64x16xf32>)\n permutation = [1, 0]\n ```", "operands": [ { "name": "input", "type": "TensorOrMemref" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "permutation", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.unpack", "summary": "linalg.unpack operation", "description": "The \"unpack\" operation converts a source tensor of rank `n` with a tiled and\n packed layout to a result tensor of rank `n - k`.\n\n `inner_tiles` (mandatory) specifies `k` tile sizes. These tile sizes\n correspond to the least significant (\"inner\") source tensor dimension sizes.\n The behavior of this op is undefined if:\n - `inner_tiles` do not exactly match with the corresponding source tensor\n dimension sizes.\n - Or, `inner_tiles[i]` does not divide the size of dimension\n `inner_dims_pos[i]` (assuming that `outer_dims_perm` is not specified)\n evenly.\n\n `inner_dims_pos` (mandatory) specifies `k` result tensor (i.e. unpacked\n tensor) dimensions that were tiled with the `inner_tiles` to create the\n packed source tensor. The source tensor (i.e. packed tensor) dimensions can\n be unpacked given `inner_dims_pos` as follows.\n - For `0 <= i < k` the following relationship holds:\n `shape(result)[inner_dims_pos[i]] <= shape(source)[n-k+i] * shape(source)[inner_dims_pos[i]]`.\n - For `0 <= j < n-k` and `j` not in `inner_dims_pos` the following relationship holds:\n `shape(result)[j] = shape(source)[j]`.\n\n `outer_dims_perm` (optional) specifies a permutation for the outer\n dimensions. If specified, it must have `n - k` elements. If specified, this\n permutation is applied before combining any dimensions.\n\n Note, the unpack operation may drop any padding introduced by the pack\n operation and hence the following holds\n `NumElementsOf(source) >= NumElementsOf(result)`.\n\n Examples:\n\n ```mlir\n // NCnc to NC:\n %0 = linalg.unpack %source inner_dims_pos = [0, 1] inner_tiles = [8, 32]\n into %dest : tensor<16x8 x 8x32 xf32> -> tensor<128x256xf32>\n // \\ / \\ /\n // Outer Dims: 16x8 Inner Dims: 8x32\n\n // CK to KCck:\n %0 = linalg.unpack %source outer_dims_perm = [1, 0] inner_dims_pos = [0, 1]\n inner_tiles = [8, 32]\n into %dest : tensor<8x16 x 8x32 xf32> -> tensor<128x256xf32>\n // \\ / \\ /\n // Outer Dims: 8x16 Inner Dims: 8x32\n\n // CHW to CHWhw:\n %0 = linalg.unpack %source inner_dims_pos = [2, 1] inner_tiles = [4, 2]\n into %dest : tensor<3x10x6 x 4x2 xf32> -> tensor<3x20x24xf32>\n // \\ / \\ /\n // Outer Dims: 3x10x6 Inner Dims: 4x2\n\n // HCW to HCWhw\n %0 = linalg.unpack %source inner_dims_pos = [2, 0] inner_tiles = [4, 2]\n into %dest : tensor<9x3x8 x 4x2 xf32> -> tensor<18x3x32xf32>\n // \\ / \\ /\n // Outer Dims: 9x3x8 Inner Dims: 4x2\n ```", "operands": [ { "name": "source", "type": "TensorOrMemRef<[AnyType]>" }, { "name": "dest", "type": "TensorOrMemRef<[AnyType]>" }, { "name": "inner_tiles", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "outer_dims_perm", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_dims_pos", "type": "DenseI64ArrayAttr" }, { "name": "static_inner_tiles", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "TypesMatchWith<'dest', 'result', '$_self'>" } ], "hasCustomAssemblyFormat": true }, { "name": "linalg.vecmat", "summary": "Performs a vector-matrix multiplication.", "description": "Numeric casting is performed on the operands to the inner multiply, promoting\nthem to the same data type as the accumulator/output.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result_tensors", "type": "Variadic" } ], "hasCustomAssemblyFormat": 1 }, { "name": "linalg.winograd_filter_transform", "summary": "Winograd filter transform operator", "description": "Winograd Conv2D algorithm will convert linalg Conv2D operator into batched\n matrix multiply. Before the matrix multiply, it will convert filter and\n input into a format suitable for batched matrix multiply. After the matrix\n multiply, it will convert output to the final result tensor.\n\n The algorithm F(m x m, r x r) is\n\n Y = A^T x [(G x g x G^T) @ (B^T x d x B)] x A\n\n The size of output Y is m x m. The size of filter g is r x r. The size of\n input d is (m + r - 1) x (m + r - 1). A^T, A, G^T, G, B^T, and B are\n transformation matrices.\n\n This operator is defined to represent the high level concept of filter\n transformation (G x g x G^T) in the Winograd Conv2D algorithm.", "operands": [ { "name": "filter", "type": "TensorRankOf<[AnyType], [4]>" }, { "name": "output", "type": "TensorRankOf<[AnyType], [4]>" } ], "results": [ { "name": "result", "type": "TensorRankOf<[AnyType], [4]>" } ], "attributes": [ { "name": "fmr", "type": "WinogradConv2DFmr{F_2_3|F_4_3|F_2_5}" } ], "assemblyFormat": "attr-dict\n `fmr` `(` $fmr `)`\n `ins` `(` $filter `:` type($filter) `)`\n `outs` `(` $output `:` type($output) `)`\n `->` type($result)" }, { "name": "linalg.winograd_input_transform", "summary": "Winograd input transform operator", "description": "Winograd Conv2D algorithm will convert linalg Conv2D operator into batched\n matrix multiply. Before the matrix multiply, it will convert filter and\n input into a format suitable for batched matrix multiply. After the matrix\n multiply, it will convert output to the final result tensor.\n\n The algorithm F(m x m, r x r) is\n\n Y = A^T x [(G x g x G^T) @ (B^T x d x B)] x A\n\n The size of output Y is m x m. The size of filter g is r x r. The size of\n input d is (m + r - 1) x (m + r - 1). A^T, A, G^T, G, B^T, and B are\n transformation matrices.\n\n This operator is defined to represent the high level concept of input\n transformation (B^T x d x B) in the Winograd Conv2D algorithm.", "operands": [ { "name": "input", "type": "TensorRankOf<[AnyType], [4]>" }, { "name": "output", "type": "TensorRankOf<[AnyType], [6]>" } ], "results": [ { "name": "result", "type": "TensorRankOf<[AnyType], [6]>" } ], "attributes": [ { "name": "fmr", "type": "WinogradConv2DFmr{F_2_3|F_4_3|F_2_5}" } ], "assemblyFormat": "attr-dict\n `fmr` `(` $fmr `)`\n `ins` `(` $input `:` type($input) `)`\n `outs` `(` $output `:` type($output) `)`\n `->` type($result)" }, { "name": "linalg.winograd_output_transform", "summary": "Winograd output transform operator", "description": "Winograd Conv2D algorithm will convert linalg Conv2D operator into batched\n matrix multiply. Before the matrix multiply, it will convert filter and\n input into a format suitable for batched matrix multiply. After the matrix\n multiply, it will convert output to the final result tensor.\n\n The algorithm F(m x m, r x r) is\n\n Y = A^T x [(G x g x G^T) @ (B^T x d x B)] x A\n\n The size of output Y is m x m. The size of filter g is r x r. The size of\n input d is (m + r - 1) x (m + r - 1). A^T, A, G^T, G, B^T, and B are\n transformation matrices.\n\n This operator is defined to represent the high level concept of output\n transformation (A^T x y x A) in the Winograd Conv2D algorithm.", "operands": [ { "name": "value", "type": "TensorRankOf<[AnyType], [6]>" }, { "name": "output", "type": "TensorRankOf<[AnyType], [4]>" } ], "results": [ { "name": "result", "type": "TensorRankOf<[AnyType], [4]>" } ], "attributes": [ { "name": "fmr", "type": "WinogradConv2DFmr{F_2_3|F_4_3|F_2_5}" } ], "assemblyFormat": "attr-dict\n `fmr` `(` $fmr `)`\n `ins` `(` $value `:` type($value) `)`\n `outs` `(` $output `:` type($output) `)`\n `->` type($result)" }, { "name": "linalg.yield", "summary": "Linalg yield operation", "description": "`linalg.yield` is a special terminator operation for blocks inside regions\n in `linalg` generic ops. It returns values to the immediately enclosing\n `linalg` generic op.\n\n Example:\n\n ```mlir\n linalg.yield %f0, %f1 : f32, f32\n ```", "operands": [ { "name": "values", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "linalgx.copy", "summary": "tensor copy operation", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "output", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "inputMap", "type": "OptionalAttr" }, { "name": "outputMap", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`(` $input `,` $output `)` attr-dict `:` type($input) `,` type($output)\n `->` type($result)\n custom($region, ref(type($input)), ref(type($input)))", "hasCustomAssemblyFormat": true }, { "name": "llvm.add", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "overflowFlags", "type": "LLVM_IntegerOverflowFlagsProp" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($overflowFlags^)? attr-dict `:` type($res)" }, { "name": "llvm.addrspacecast", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.alloca", "operands": [ { "name": "arraySize", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" }, { "name": "elem_type", "type": "TypeAttr" }, { "name": "inalloca", "type": "UnitAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.and", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.ashr", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`exact` $isExact^)? $lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.atomicrmw", "operands": [ { "name": "bin_op", "type": "AtomicBinOp{xchg|add|sub|_and|nand|_or|_xor|max|min|umax|umin|fadd|fsub|fmax|fmin|uinc_wrap|udec_wrap}" }, { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "val", "type": "LLVM_AtomicRMWType" }, { "name": "ordering", "type": "AtomicOrdering{not_atomic|unordered|monotonic|acquire|release|acq_rel|seq_cst}" } ], "results": [ { "name": "res", "type": "LLVM_AtomicRMWType" } ], "attributes": [ { "name": "syncscope", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "volatile_", "type": "UnitAttr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "TypesMatchWith<'val', 'res', '$_self'>" } ], "assemblyFormat": "(`volatile` $volatile_^)? $bin_op $ptr `,` $val\n (`syncscope` `(` $syncscope^ `)`)? $ordering attr-dict `:`\n qualified(type($ptr)) `,` type($val)" }, { "name": "llvm.bitcast", "operands": [ { "name": "arg", "type": "LLVM_AnyNonAggregate" } ], "results": [ { "name": "res", "type": "LLVM_AnyNonAggregate" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.blockaddress", "summary": "Creates a LLVM blockaddress ptr", "description": "Creates an SSA value containing a pointer to a basic block. The block\n address information (function and block) is given by the `BlockAddressAttr`\n attribute. This operation assumes an existing `llvm.blocktag` operation\n identifying an existing MLIR block within a function. Example:\n\n ```mlir\n llvm.mlir.global private @g() : !llvm.ptr {\n %0 = llvm.blockaddress > : !llvm.ptr\n llvm.return %0 : !llvm.ptr\n }\n\n llvm.func @fn() {\n llvm.br ^bb1\n ^bb1: // pred: ^bb0\n llvm.blocktag \n llvm.return\n }\n ```", "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "block_addr", "type": "LLVM_BlockAddressAttr" } ], "assemblyFormat": "$block_addr\n attr-dict `:` qualified(type($res))" }, { "name": "llvm.blocktag", "description": "This operation uses a `tag` to uniquely identify an MLIR block in a\n function. The same tag is used by `llvm.blockaddress` in order to compute\n the target address.\n\n A given function should have at most one `llvm.blocktag` operation with a\n given `tag`. This operation cannot be used as a terminator.\n\n Example:\n\n ```mlir\n llvm.func @f() -> !llvm.ptr {\n %addr = llvm.blockaddress > : !llvm.ptr\n llvm.br ^bb1\n ^bb1:\n llvm.blocktag \n llvm.return %addr : !llvm.ptr\n }\n ```", "attributes": [ { "name": "tag", "type": "LLVM_BlockTagAttr" } ], "assemblyFormat": "$tag attr-dict" }, { "name": "llvm.br", "operands": [ { "name": "destOperands", "type": "Variadic" } ], "attributes": [ { "name": "loop_annotation", "type": "OptionalAttr" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict" }, { "name": "llvm.call", "summary": "Call to an LLVM function.", "description": "In LLVM IR, functions may return either 0 or 1 value. LLVM IR dialect\n implements this behavior by providing a variadic `call` operation for 0- and\n 1-result functions. Even though MLIR supports multi-result functions, LLVM\n IR dialect disallows them.\n\n The `call` instruction supports both direct and indirect calls. Direct calls\n start with a function name (`@`-prefixed) and indirect calls start with an\n SSA value (`%`-prefixed). The direct callee, if present, is stored as a\n function attribute `callee`. For indirect calls, the callee is of `!llvm.ptr` type\n and is stored as the first value in `callee_operands`. If and only if the\n callee is a variadic function, the `var_callee_type` attribute must carry\n the variadic LLVM function type. The trailing type list contains the\n optional indirect callee type and the MLIR function type, which differs from\n the LLVM function type that uses an explicit void type to model functions\n that do not return a value.\n\n If this operatin has the `no_inline` attribute, then this specific function call\n will never be inlined. The opposite behavior will occur if the call has `always_inline`\n attribute. The `inline_hint` attribute indicates that it is desirable to inline\n this function call.\n\n Examples:\n\n ```mlir\n // Direct call without arguments and with one result.\n %0 = llvm.call @foo() : () -> (f32)\n\n // Direct call with arguments and without a result.\n llvm.call @bar(%0) : (f32) -> ()\n\n // Indirect call with an argument and without a result.\n %1 = llvm.mlir.addressof @foo : !llvm.ptr\n llvm.call %1(%0) : !llvm.ptr, (f32) -> ()\n\n // Direct variadic call.\n llvm.call @printf(%0, %1) vararg(!llvm.func) : (!llvm.ptr, i32) -> i32\n\n // Indirect variadic call\n llvm.call %1(%0) vararg(!llvm.func) : !llvm.ptr, (i32) -> ()\n ```", "operands": [ { "name": "callee_operands", "type": "Variadic" }, { "name": "op_bundle_operands", "type": "VariadicOfVariadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "var_callee_type", "type": "OptionalAttr>" }, { "name": "callee", "type": "OptionalAttr" }, { "name": "fastmathFlags", "type": "DefaultValuedAttr" }, { "name": "CConv", "type": "DefaultValuedAttr" }, { "name": "TailCallKind", "type": "DefaultValuedAttr" }, { "name": "memory_effects", "type": "OptionalAttr" }, { "name": "convergent", "type": "UnitAttr" }, { "name": "no_unwind", "type": "UnitAttr" }, { "name": "will_return", "type": "UnitAttr" }, { "name": "noreturn", "type": "UnitAttr" }, { "name": "returns_twice", "type": "UnitAttr" }, { "name": "hot", "type": "UnitAttr" }, { "name": "cold", "type": "UnitAttr" }, { "name": "noduplicate", "type": "UnitAttr" }, { "name": "no_caller_saved_registers", "type": "UnitAttr" }, { "name": "nocallback", "type": "UnitAttr" }, { "name": "modular_format", "type": "OptionalAttr" }, { "name": "nobuiltins", "type": "OptionalAttr" }, { "name": "allocsize", "type": "OptionalAttr" }, { "name": "optsize", "type": "UnitAttr" }, { "name": "minsize", "type": "UnitAttr" }, { "name": "builtin", "type": "UnitAttr" }, { "name": "nobuiltin", "type": "UnitAttr" }, { "name": "save_reg_params", "type": "UnitAttr" }, { "name": "zero_call_used_regs", "type": "OptionalAttr" }, { "name": "trap_func_name", "type": "OptionalAttr" }, { "name": "default_func_attrs", "type": "OptionalAttr" }, { "name": "op_bundle_sizes", "type": "DenseI32ArrayAttr" }, { "name": "op_bundle_tags", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "no_inline", "type": "UnitAttr" }, { "name": "always_inline", "type": "UnitAttr" }, { "name": "inline_hint", "type": "UnitAttr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.call_intrinsic", "summary": "Call to an LLVM intrinsic function.", "description": "Call the specified llvm intrinsic. If the intrinsic is overloaded, use\n the MLIR function type of this op to determine which intrinsic to call.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "op_bundle_operands", "type": "VariadicOfVariadic" } ], "results": [ { "name": "results", "type": "Optional" } ], "attributes": [ { "name": "intrin", "type": "StrAttr" }, { "name": "fastmathFlags", "type": "DefaultValuedAttr" }, { "name": "op_bundle_sizes", "type": "DenseI32ArrayAttr" }, { "name": "op_bundle_tags", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.cmpxchg", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "cmp", "type": "LLVM_AtomicCmpXchgType" }, { "name": "val", "type": "LLVM_AtomicCmpXchgType" }, { "name": "success_ordering", "type": "AtomicOrdering{not_atomic|unordered|monotonic|acquire|release|acq_rel|seq_cst}" }, { "name": "failure_ordering", "type": "AtomicOrdering{not_atomic|unordered|monotonic|acquire|release|acq_rel|seq_cst}" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "syncscope", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "weak", "type": "UnitAttr" }, { "name": "volatile_", "type": "UnitAttr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "TypesMatchWith<'val', 'cmp', '$_self'>" }, { "type": "TypesMatchWith<'val', 'res', 'getValAndBoolStructType($_self)'>" } ], "assemblyFormat": "(`weak` $weak^)? (`volatile` $volatile_^)? $ptr `,` $cmp `,` $val\n (`syncscope` `(` $syncscope^ `)`)? $success_ordering $failure_ordering\n attr-dict `:` qualified(type($ptr)) `,` type($val)" }, { "name": "llvm.comdat", "summary": "LLVM dialect comdat region", "description": "Provides access to object file COMDAT section/group functionality.\n\n Examples:\n ```mlir\n llvm.comdat @__llvm_comdat {\n llvm.comdat_selector @any any\n }\n llvm.mlir.global internal constant @has_any_comdat(1 : i64) comdat(@__llvm_comdat::@any) : i64\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$sym_name $body attr-dict" }, { "name": "llvm.comdat_selector", "summary": "LLVM dialect comdat selector declaration", "description": "Provides access to object file COMDAT section/group functionality.\n\n Examples:\n ```mlir\n llvm.comdat @__llvm_comdat {\n llvm.comdat_selector @any any\n }\n llvm.mlir.global internal constant @has_any_comdat(1 : i64) comdat(@__llvm_comdat::@any) : i64\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "comdat", "type": "Comdat{any|exactmatch|largest|nodeduplicate|samesize}" } ], "assemblyFormat": "$sym_name $comdat attr-dict" }, { "name": "llvm.cond_br", "operands": [ { "name": "condition", "type": "I1" }, { "name": "trueDestOperands", "type": "Variadic" }, { "name": "falseDestOperands", "type": "Variadic" } ], "attributes": [ { "name": "branch_weights", "type": "OptionalAttr" }, { "name": "loop_annotation", "type": "OptionalAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$condition ( `weights` `(` $branch_weights^ `)` )? `,`\n $trueDest (`(` $trueDestOperands^ `:` type($trueDestOperands) `)`)? `,`\n $falseDest (`(` $falseDestOperands^ `:` type($falseDestOperands) `)`)?\n attr-dict" }, { "name": "llvm.dso_local_equivalent", "summary": "Creates a LLVM dso_local_equivalent ptr", "description": "Creates an SSA value containing a pointer to a global value (function or\n alias to function). It represents a function which is functionally\n equivalent to a given function, but is always defined in the current\n linkage unit. The target function may not have `extern_weak` linkage.\n\n Examples:\n\n ```mlir\n llvm.mlir.global external constant @const() : i64 {\n %0 = llvm.mlir.addressof @const : !llvm.ptr\n %1 = llvm.ptrtoint %0 : !llvm.ptr to i64\n %2 = llvm.dso_local_equivalent @func : !llvm.ptr\n %4 = llvm.ptrtoint %2 : !llvm.ptr to i64\n llvm.return %4 : i64\n }\n ```", "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "function_name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$function_name attr-dict `:` qualified(type($res))" }, { "name": "llvm.extractelement", "summary": "Extract an element from an LLVM vector.", "operands": [ { "name": "vector", "type": "LLVM_AnyVector" }, { "name": "position", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "TypesMatchWith<'vector', 'res', '::llvm::cast<::mlir::VectorType>($_self).getElementType()'>" } ], "assemblyFormat": "$vector `[` $position `:` type($position) `]` attr-dict `:` type($vector)" }, { "name": "llvm.extractvalue", "summary": "Extract a value from an LLVM struct.", "operands": [ { "name": "container", "type": "LLVM_AnyAggregate" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "position", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$container `` $position attr-dict `:` type($container)\n custom(type($res), ref(type($container)),\n ref($position))" }, { "name": "llvm.fadd", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.fcmp", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "predicate", "type": "FCmpPredicate{_false|oeq|ogt|oge|olt|ole|one|ord|ueq|ugt|uge|ult|ule|une|uno|_true}" }, { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'lhs', 'res', '::getI1SameShape($_self)'>" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.fdiv", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.fence", "operands": [ { "name": "ordering", "type": "AtomicOrdering{not_atomic|unordered|monotonic|acquire|release|acq_rel|seq_cst}" } ], "attributes": [ { "name": "syncscope", "type": "OptionalAttr" } ], "assemblyFormat": "(`syncscope` `(` $syncscope^ `)`)? $ordering attr-dict" }, { "name": "llvm.fmul", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.fneg", "operands": [ { "name": "operand", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($res)" }, { "name": "llvm.fpext", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$arg (`fastmath` `` $fastmathFlags^)? attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.fptosi", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.fptoui", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.fptrunc", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$arg (`fastmath` `` $fastmathFlags^)? attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.freeze", "operands": [ { "name": "val", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$val attr-dict `:` type($val)" }, { "name": "llvm.frem", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.fsub", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.func", "summary": "LLVM dialect function.", "description": "MLIR functions are defined by an operation that is not built into the IR\n itself. The LLVM dialect provides an `llvm.func` operation to define\n functions compatible with LLVM IR. These functions have LLVM dialect\n function type but use MLIR syntax to express it. They are required to have\n exactly one result type. LLVM function operation is intended to capture\n additional properties of LLVM functions, such as linkage and calling\n convention, that may be modeled differently by the built-in MLIR function.\n\n ```mlir\n // The type of @bar is !llvm<\"i64 (i64)\">\n llvm.func @bar(%arg0: i64) -> i64 {\n llvm.return %arg0 : i64\n }\n\n // Type type of @foo is !llvm<\"void (i64)\">\n // !llvm.void type is omitted\n llvm.func @foo(%arg0: i64) {\n llvm.return\n }\n\n // A function with `internal` linkage.\n llvm.func internal @internal_func() {\n llvm.return\n }\n ```", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "linkage", "type": "DefaultValuedAttr" }, { "name": "dso_local", "type": "UnitAttr" }, { "name": "CConv", "type": "DefaultValuedAttr" }, { "name": "comdat", "type": "OptionalAttr" }, { "name": "convergent", "type": "UnitAttr" }, { "name": "personality", "type": "OptionalAttr" }, { "name": "garbageCollector", "type": "OptionalAttr" }, { "name": "passthrough", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "function_entry_count", "type": "OptionalAttr" }, { "name": "memory_effects", "type": "OptionalAttr" }, { "name": "visibility_", "type": "DefaultValuedAttr" }, { "name": "arm_streaming", "type": "UnitAttr" }, { "name": "arm_locally_streaming", "type": "UnitAttr" }, { "name": "arm_streaming_compatible", "type": "UnitAttr" }, { "name": "arm_new_za", "type": "UnitAttr" }, { "name": "arm_in_za", "type": "UnitAttr" }, { "name": "arm_out_za", "type": "UnitAttr" }, { "name": "arm_inout_za", "type": "UnitAttr" }, { "name": "arm_preserves_za", "type": "UnitAttr" }, { "name": "section", "type": "OptionalAttr" }, { "name": "unnamed_addr", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "vscale_range", "type": "OptionalAttr" }, { "name": "frame_pointer", "type": "OptionalAttr" }, { "name": "target_cpu", "type": "OptionalAttr" }, { "name": "tune_cpu", "type": "OptionalAttr" }, { "name": "reciprocal_estimates", "type": "OptionalAttr" }, { "name": "prefer_vector_width", "type": "OptionalAttr" }, { "name": "target_features", "type": "OptionalAttr" }, { "name": "no_signed_zeros_fp_math", "type": "OptionalAttr" }, { "name": "denormal_fpenv", "type": "OptionalAttr" }, { "name": "fp_contract", "type": "OptionalAttr" }, { "name": "instrument_function_entry", "type": "OptionalAttr" }, { "name": "instrument_function_exit", "type": "OptionalAttr" }, { "name": "no_inline", "type": "UnitAttr" }, { "name": "always_inline", "type": "UnitAttr" }, { "name": "inline_hint", "type": "UnitAttr" }, { "name": "no_unwind", "type": "UnitAttr" }, { "name": "will_return", "type": "UnitAttr" }, { "name": "noreturn", "type": "UnitAttr" }, { "name": "optimize_none", "type": "UnitAttr" }, { "name": "returns_twice", "type": "UnitAttr" }, { "name": "hot", "type": "UnitAttr" }, { "name": "cold", "type": "UnitAttr" }, { "name": "noduplicate", "type": "UnitAttr" }, { "name": "no_caller_saved_registers", "type": "UnitAttr" }, { "name": "nocallback", "type": "UnitAttr" }, { "name": "modular_format", "type": "OptionalAttr" }, { "name": "nobuiltins", "type": "OptionalAttr" }, { "name": "allocsize", "type": "OptionalAttr" }, { "name": "optsize", "type": "OptionalAttr" }, { "name": "minsize", "type": "OptionalAttr" }, { "name": "save_reg_params", "type": "OptionalAttr" }, { "name": "zero_call_used_regs", "type": "OptionalAttr" }, { "name": "default_func_attrs", "type": "OptionalAttr" }, { "name": "vec_type_hint", "type": "OptionalAttr" }, { "name": "work_group_size_hint", "type": "OptionalAttr" }, { "name": "reqd_work_group_size", "type": "OptionalAttr" }, { "name": "intel_reqd_sub_group_size", "type": "OptionalAttr" }, { "name": "uwtable_kind", "type": "OptionalAttr" }, { "name": "use_sample_profile", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.getelementptr", "description": "This operation mirrors LLVM IRs 'getelementptr' operation that is used to\n perform pointer arithmetic.\n\n Like in LLVM IR, it is possible to use both constants as well as SSA values\n as indices. In the case of indexing within a structure, it is required to\n either use constant indices directly, or supply a constant SSA value.\n\n The no-wrap flags can be used to specify the low-level pointer arithmetic\n overflow behavior that LLVM uses after lowering the operation to LLVM IR.\n Valid options include 'inbounds' (pointer arithmetic must be within object\n bounds), 'nusw' (no unsigned signed wrap), and 'nuw' (no unsigned wrap).\n Note that 'inbounds' implies 'nusw' which is ensured by the enum\n definition. The flags can be set individually or in combination.\n\n Examples:\n\n ```mlir\n // GEP with an SSA value offset\n %0 = llvm.getelementptr %1[%2] : (!llvm.ptr, i64) -> !llvm.ptr, f32\n\n // GEP with a constant offset and the inbounds attribute set\n %0 = llvm.getelementptr inbounds %1[3] : (!llvm.ptr) -> !llvm.ptr, f32\n\n // GEP with constant offsets into a structure\n %0 = llvm.getelementptr %1[0, 1]\n : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<(i32, f32)>\n ```", "operands": [ { "name": "base", "type": "LLVM_ScalarOrVectorOf" }, { "name": "dynamicIndices", "type": "Variadic>" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "rawConstantIndices", "type": "DenseI32ArrayAttr" }, { "name": "elem_type", "type": "TypeAttr" }, { "name": "noWrapFlags", "type": "GEPNoWrapFlagsProp{none|inbounds_flag|nusw|nuw|inbounds}" } ], "assemblyFormat": "($noWrapFlags^)?\n $base `[` custom($dynamicIndices, $rawConstantIndices) `]` attr-dict\n `:` functional-type(operands, results) `,` $elem_type" }, { "name": "llvm.icmp", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[LLVM_ScalarOrVectorOf, LLVM_ScalarOrVectorOf]>" }, { "name": "rhs", "type": "AnyTypeOf<[LLVM_ScalarOrVectorOf, LLVM_ScalarOrVectorOf]>" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "predicate", "type": "ICmpPredicate{eq|ne|slt|sle|sgt|sge|ult|ule|ugt|uge}" } ], "traits": [ { "type": "TypesMatchWith<'lhs', 'res', '::getI1SameShape($_self)'>" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.indirectbr", "description": "Transfer control flow to address in `$addr`. A list of possible target\n blocks in `$successors` can be provided and maybe used as a hint in LLVM:\n\n ```mlir\n ...\n llvm.func @g(...\n %dest = llvm.blockaddress > : !llvm.ptr\n llvm.indirectbr %dest : !llvm.ptr, [\n ^head\n ]\n ^head:\n llvm.blocktag \n llvm.return %arg0 : i32\n ...\n ```\n\n It also supports a list of operands that can be passed to a target block:\n\n ```mlir\n llvm.indirectbr %dest : !llvm.ptr, [\n ^head(%arg0 : i32),\n ^tail(%arg1, %arg0 : i32, i32)\n ]\n ^head(%r0 : i32):\n llvm.return %r0 : i32\n ^tail(%r1 : i32, %r2 : i32):\n ...\n ```", "operands": [ { "name": "addr", "type": "LLVM_AnyPointer" }, { "name": "succOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "indbr_operand_segments", "type": "DenseI32ArrayAttr" } ], "successors": [ { "name": "successors", "type": "VariadicSuccessor" } ], "assemblyFormat": "$addr `:` type($addr) `,`\n custom(ref(type($addr)),\n $successors,\n $succOperands,\n type($succOperands))\n attr-dict" }, { "name": "llvm.inline_asm", "description": "The InlineAsmOp mirrors the underlying LLVM semantics with a notable\n exception: the embedded `asm_string` is not allowed to define or reference\n any symbol or any global variable: only the operands of the op may be read,\n written, or referenced.\n Attempting to define or reference any symbol or any global behavior is\n considered undefined behavior at this time.\n If `tail_call_kind` is used, the operation behaves like the specified\n tail call kind. The `musttail` kind it's not available for this operation,\n since it isn't supported by LLVM's inline asm.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "res", "type": "Optional" } ], "attributes": [ { "name": "asm_string", "type": "StrAttr" }, { "name": "constraints", "type": "StrAttr" }, { "name": "has_side_effects", "type": "UnitAttr" }, { "name": "is_align_stack", "type": "UnitAttr" }, { "name": "tail_call_kind", "type": "DefaultValuedAttr" }, { "name": "asm_dialect", "type": "OptionalAttr>" }, { "name": "operand_attrs", "type": "OptionalAttr" } ], "assemblyFormat": "(`has_side_effects` $has_side_effects^)?\n (`is_align_stack` $is_align_stack^)?\n (`tail_call_kind` `=` $tail_call_kind^)?\n (`asm_dialect` `=` $asm_dialect^)?\n (`operand_attrs` `=` $operand_attrs^)?\n attr-dict\n $asm_string `,` $constraints\n operands `:` functional-type(operands, results)" }, { "name": "llvm.insertelement", "summary": "Insert an element into an LLVM vector.", "operands": [ { "name": "vector", "type": "LLVM_AnyVector" }, { "name": "value", "type": "LLVM_PrimitiveType" }, { "name": "position", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "traits": [ { "type": "TypesMatchWith<'vector', 'value', '::llvm::cast<::mlir::VectorType>($_self).getElementType()'>" }, { "type": "AllTypesMatch<['res', 'vector']>" } ], "assemblyFormat": "$value `,` $vector `[` $position `:` type($position) `]` attr-dict `:`\n type($vector)" }, { "name": "llvm.insertvalue", "summary": "Insert a value into an LLVM struct.", "operands": [ { "name": "container", "type": "LLVM_AnyAggregate" }, { "name": "value", "type": "LLVM_PrimitiveType" } ], "results": [ { "name": "res", "type": "LLVM_AnyAggregate" } ], "attributes": [ { "name": "position", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['container', 'res']>" } ], "assemblyFormat": "$value `,` $container `` $position attr-dict `:` type($container)\n custom(type($value), ref(type($container)),\n ref($position))" }, { "name": "llvm.intr.abs", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "is_int_min_poison", "type": "I1Attr" } ] }, { "name": "llvm.intr.acos", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.annotation", "operands": [ { "name": "integer", "type": "AnySignlessInteger" }, { "name": "annotation", "type": "LLVM_AnyPointer" }, { "name": "fileName", "type": "LLVM_AnyPointer" }, { "name": "line", "type": "I32" } ], "results": [ { "name": "res", "type": "AnySignlessInteger" } ], "traits": [ { "type": "AllTypesMatch<['res', 'integer']>" }, { "type": "AllTypesMatch<['annotation', 'fileName']>" } ] }, { "name": "llvm.intr.arithmetic.fence", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.asin", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.assume", "operands": [ { "name": "cond", "type": "I1" }, { "name": "op_bundle_operands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "op_bundle_sizes", "type": "DenseI32ArrayAttr" }, { "name": "op_bundle_tags", "type": "OptionalAttr" } ], "assemblyFormat": "$cond\n ( custom($op_bundle_operands, type($op_bundle_operands),\n $op_bundle_tags)^ )?\n `:` type($cond) attr-dict" }, { "name": "llvm.intr.atan", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.atan2", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.bitreverse", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.bswap", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.ceil", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.copysign", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.align", "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.intr.coro.begin", "operands": [ { "name": "token", "type": "Token" }, { "name": "mem", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$token `,` $mem attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.end", "operands": [ { "name": "handle", "type": "LLVM_AnyPointer" }, { "name": "unwind", "type": "I1" }, { "name": "retvals", "type": "Token" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$handle `,` $unwind `,` $retvals attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.free", "operands": [ { "name": "id", "type": "Token" }, { "name": "handle", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$id `,` $handle attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.id", "operands": [ { "name": "align", "type": "I32" }, { "name": "promise", "type": "LLVM_AnyPointer" }, { "name": "coroaddr", "type": "LLVM_AnyPointer" }, { "name": "fnaddrs", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$align `,` $promise `,` $coroaddr `,` $fnaddrs attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.promise", "operands": [ { "name": "handle", "type": "LLVM_AnyPointer" }, { "name": "align", "type": "I32" }, { "name": "from", "type": "I1" } ], "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$handle `,` $align `,` $from attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.resume", "operands": [ { "name": "handle", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$handle attr-dict `:` qualified(type($handle))" }, { "name": "llvm.intr.coro.save", "operands": [ { "name": "handle", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$handle attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.coro.size", "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.intr.coro.suspend", "operands": [ { "name": "save", "type": "Token" }, { "name": "final", "type": "I1" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$save `,` $final attr-dict `:` type($res)" }, { "name": "llvm.intr.cos", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.cosh", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.ctlz", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "is_zero_poison", "type": "I1Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "llvm.intr.ctpop", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.cttz", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "is_zero_poison", "type": "I1Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "llvm.intr.dbg.declare", "summary": "Describes how the address relates to a source language variable.", "operands": [ { "name": "addr", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "varInfo", "type": "LLVM_DILocalVariableAttr" }, { "name": "locationExpr", "type": "DefaultValuedAttr" } ], "assemblyFormat": "qualified($varInfo) (qualified($locationExpr)^)? `=` $addr`:` qualified(type($addr)) attr-dict" }, { "name": "llvm.intr.dbg.label", "summary": "Relates the program to a debug information label.", "attributes": [ { "name": "label", "type": "LLVM_DILabelAttr" } ], "assemblyFormat": "$label attr-dict" }, { "name": "llvm.intr.dbg.value", "summary": "Describes how the value relates to a source language variable.", "operands": [ { "name": "value", "type": "LLVM_Type" } ], "attributes": [ { "name": "varInfo", "type": "LLVM_DILocalVariableAttr" }, { "name": "locationExpr", "type": "DefaultValuedAttr" } ], "assemblyFormat": "qualified($varInfo) (qualified($locationExpr)^)? `=` $value`:` qualified(type($value)) attr-dict" }, { "name": "llvm.intr.debugtrap", "assemblyFormat": "attr-dict" }, { "name": "llvm.intr.eh.typeid.for", "operands": [ { "name": "type_info", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$type_info attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.exp", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.exp10", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.exp2", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.expect", "operands": [ { "name": "val", "type": "AnySignlessInteger" }, { "name": "expected", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$val `,` $expected attr-dict `:` type($val)" }, { "name": "llvm.intr.expect.with.probability", "operands": [ { "name": "val", "type": "AnySignlessInteger" }, { "name": "expected", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "prob", "type": "F64Attr" } ], "traits": [ { "type": "AllTypesMatch<['val', 'expected', 'res']>" } ], "assemblyFormat": "$val `,` $expected `,` $prob attr-dict `:` type($val)" }, { "name": "llvm.intr.experimental.constrained.fadd", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.fdiv", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.fma", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" }, { "name": "arg_2", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 `,` $arg_2 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.fmul", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.fmuladd", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" }, { "name": "arg_2", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 `,` $arg_2 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.fpext", "operands": [ { "name": "arg_0", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "assemblyFormat": "$arg_0 $fpExceptionBehavior attr-dict `:` type($arg_0) `to` type(results)" }, { "name": "llvm.intr.experimental.constrained.fptrunc", "operands": [ { "name": "arg_0", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "assemblyFormat": "$arg_0 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0) `to` type(results)" }, { "name": "llvm.intr.experimental.constrained.frem", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.fsub", "operands": [ { "name": "arg_0", "type": "LLVM_Type" }, { "name": "arg_1", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$arg_0 `,` $arg_1 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0)" }, { "name": "llvm.intr.experimental.constrained.sitofp", "operands": [ { "name": "arg_0", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "assemblyFormat": "$arg_0 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0) `to` type(results)" }, { "name": "llvm.intr.experimental.constrained.uitofp", "operands": [ { "name": "arg_0", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "roundingmode", "type": "ConfinedAttr]>" }, { "name": "fpExceptionBehavior", "type": "FPExceptionBehaviorAttr{ignore|maytrap|strict}" } ], "assemblyFormat": "$arg_0 $roundingmode $fpExceptionBehavior attr-dict `:` type($arg_0) `to` type(results)" }, { "name": "llvm.intr.experimental.noalias.scope.decl", "attributes": [ { "name": "scope", "type": "LLVM_AliasScopeAttr" } ], "assemblyFormat": "$scope attr-dict" }, { "name": "llvm.intr.experimental.vp.strided.load", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "stride", "type": "AnySignlessInteger" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.experimental.vp.strided.store", "operands": [ { "name": "val", "type": "LLVM_AnyVector" }, { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "stride", "type": "AnySignlessInteger" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ] }, { "name": "llvm.intr.fabs", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.fake.use", "operands": [ { "name": "args", "type": "Variadic" } ], "assemblyFormat": "$args attr-dict `:` type($args)" }, { "name": "llvm.intr.floor", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.fma", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.fmuladd", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.frexp", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.fshl", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.fshr", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.get.active.lane.mask", "operands": [ { "name": "base", "type": "AnySignlessInteger" }, { "name": "n", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$base `,` $n attr-dict `:` type($base) `,` type($n) `to` type($res)" }, { "name": "llvm.intr.invariant.end", "operands": [ { "name": "start", "type": "LLVM_DefaultPointer" }, { "name": "ptr", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "size", "type": "I64Attr" } ], "assemblyFormat": "$start `,` $size `,` $ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.invariant.start", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_DefaultPointer" } ], "attributes": [ { "name": "size", "type": "I64Attr" } ], "assemblyFormat": "$size `,` $ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.is.constant", "operands": [ { "name": "val", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "I1" } ] }, { "name": "llvm.intr.is.fpclass", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "bit", "type": "I32Attr" } ] }, { "name": "llvm.intr.launder.invariant.group", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.ldexp", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" }, { "name": "power", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.lifetime.end", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.lifetime.start", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.llrint", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.llround", "operands": [ { "name": "val", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.log", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.log10", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.log2", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.lrint", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.lround", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.masked.compressstore", "operands": [ { "name": "value", "type": "LLVM_AnyVector" }, { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "LLVM_VectorOf" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.masked.expandload", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "passthru", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.masked.gather", "operands": [ { "name": "ptrs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "pass_thru", "type": "Variadic" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "alignment", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.masked.load", "operands": [ { "name": "data", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "pass_thru", "type": "Optional" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "alignment", "type": "I32Attr" }, { "name": "nontemporal", "type": "UnitAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.masked.scatter", "operands": [ { "name": "value", "type": "LLVM_AnyVector" }, { "name": "ptrs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" } ], "attributes": [ { "name": "alignment", "type": "I32Attr" } ], "assemblyFormat": "$value `,` $ptrs `,` $mask attr-dict `:` type($value) `,` type($mask) `into` type($ptrs)" }, { "name": "llvm.intr.masked.store", "operands": [ { "name": "value", "type": "LLVM_AnyVector" }, { "name": "data", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "LLVM_VectorOf" } ], "attributes": [ { "name": "alignment", "type": "I32Attr" }, { "name": "nontemporal", "type": "UnitAttr" } ], "assemblyFormat": "$value `,` $data `,` $mask attr-dict `:` type($value) `,` type($mask) `into` qualified(type($data))" }, { "name": "llvm.intr.matrix.column.major.load", "operands": [ { "name": "data", "type": "LLVM_AnyPointer" }, { "name": "stride", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "isVolatile", "type": "I1Attr" }, { "name": "rows", "type": "I32Attr" }, { "name": "columns", "type": "I32Attr" } ], "assemblyFormat": "$data `,` `<` `stride` `=` $stride `>` attr-dict`:` type($res) `from` qualified(type($data)) `stride` type($stride)" }, { "name": "llvm.intr.matrix.column.major.store", "operands": [ { "name": "matrix", "type": "LLVM_AnyVector" }, { "name": "data", "type": "LLVM_AnyPointer" }, { "name": "stride", "type": "AnySignlessInteger" } ], "attributes": [ { "name": "isVolatile", "type": "I1Attr" }, { "name": "rows", "type": "I32Attr" }, { "name": "columns", "type": "I32Attr" } ], "assemblyFormat": "$matrix `,` $data `,` `<` `stride` `=` $stride `>` attr-dict`:` type($matrix) `to` qualified(type($data)) `stride` type($stride)" }, { "name": "llvm.intr.matrix.multiply", "operands": [ { "name": "lhs", "type": "LLVM_AnyVector" }, { "name": "rhs", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "lhs_rows", "type": "I32Attr" }, { "name": "lhs_columns", "type": "I32Attr" }, { "name": "rhs_columns", "type": "I32Attr" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` `(` type($lhs) `,` type($rhs) `)` `->` type($res)" }, { "name": "llvm.intr.matrix.transpose", "operands": [ { "name": "matrix", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "rows", "type": "I32Attr" }, { "name": "columns", "type": "I32Attr" } ], "assemblyFormat": "$matrix attr-dict `:` type($matrix) `into` type($res)" }, { "name": "llvm.intr.maximum", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.maxnum", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.memcpy", "operands": [ { "name": "dst", "type": "LLVM_AnyPointer" }, { "name": "src", "type": "LLVM_AnyPointer" }, { "name": "len", "type": "AnySignlessInteger" } ], "attributes": [ { "name": "isVolatile", "type": "I1Attr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.memcpy.inline", "operands": [ { "name": "dst", "type": "LLVM_AnyPointer" }, { "name": "src", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "len", "type": "APIntAttr" }, { "name": "isVolatile", "type": "I1Attr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.memmove", "operands": [ { "name": "dst", "type": "LLVM_AnyPointer" }, { "name": "src", "type": "LLVM_AnyPointer" }, { "name": "len", "type": "AnySignlessInteger" } ], "attributes": [ { "name": "isVolatile", "type": "I1Attr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.memset", "operands": [ { "name": "dst", "type": "LLVM_AnyPointer" }, { "name": "val", "type": "I8" }, { "name": "len", "type": "AnySignlessInteger" } ], "attributes": [ { "name": "isVolatile", "type": "I1Attr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.memset.inline", "operands": [ { "name": "dst", "type": "LLVM_AnyPointer" }, { "name": "val", "type": "I8" } ], "attributes": [ { "name": "len", "type": "APIntAttr" }, { "name": "isVolatile", "type": "I1Attr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "llvm.intr.minimum", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.minnum", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.nearbyint", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.pow", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.powi", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" }, { "name": "power", "type": "AnySignlessInteger" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.prefetch", "operands": [ { "name": "addr", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "rw", "type": "I32Attr" }, { "name": "hint", "type": "I32Attr" }, { "name": "cache", "type": "I32Attr" } ] }, { "name": "llvm.intr.ptr.annotation", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "annotation", "type": "LLVM_AnyPointer" }, { "name": "fileName", "type": "LLVM_AnyPointer" }, { "name": "line", "type": "I32" }, { "name": "attr", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "traits": [ { "type": "AllTypesMatch<['res', 'ptr']>" }, { "type": "AllTypesMatch<['annotation', 'fileName', 'attr']>" } ] }, { "name": "llvm.intr.ptrmask", "operands": [ { "name": "ptr", "type": "LLVM_ScalarOrVectorOf" }, { "name": "mask", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['ptr', 'res']>" } ], "assemblyFormat": "$ptr `,` $mask attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.rint", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.round", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.roundeven", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.sadd.sat", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.sadd.with.overflow", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.scmp", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.sin", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.sincos", "operands": [ { "name": "val", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.sinh", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.smax", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.smin", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.smul.with.overflow", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.sqrt", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.ssa.copy", "operands": [ { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "llvm.intr.sshl.sat", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.ssub.sat", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.ssub.with.overflow", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.stackrestore", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.stacksave", "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict `:` qualified(type($res))" }, { "name": "llvm.intr.stepvector", "results": [ { "name": "res", "type": "LLVM_VectorOf" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.intr.strip.invariant.group", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "llvm.intr.tan", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.tanh", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.threadlocal.address", "operands": [ { "name": "global", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.trap", "assemblyFormat": "attr-dict" }, { "name": "llvm.intr.trunc", "operands": [ { "name": "in", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.uadd.sat", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.uadd.with.overflow", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.ubsantrap", "attributes": [ { "name": "failureKind", "type": "I8Attr" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "llvm.intr.ucmp", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.umax", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.umin", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.umul.with.overflow", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.ushl.sat", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.usub.sat", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.usub.with.overflow", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vacopy", "summary": "Copies the current argument position from `src_list` to `dest_list`.", "operands": [ { "name": "dest_list", "type": "LLVM_AnyPointer" }, { "name": "src_list", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$src_list `to` $dest_list attr-dict `:` type(operands)" }, { "name": "llvm.intr.vaend", "summary": "Destroys `arg_list`, which has been initialized by `intr.vastart` or `intr.vacopy`.", "operands": [ { "name": "arg_list", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$arg_list attr-dict `:` qualified(type($arg_list))" }, { "name": "llvm.intr.var.annotation", "operands": [ { "name": "val", "type": "LLVM_AnyPointer" }, { "name": "annotation", "type": "LLVM_AnyPointer" }, { "name": "fileName", "type": "LLVM_AnyPointer" }, { "name": "line", "type": "I32" }, { "name": "attr", "type": "LLVM_AnyPointer" } ], "traits": [ { "type": "AllTypesMatch<['annotation', 'fileName', 'attr']>" } ] }, { "name": "llvm.intr.vastart", "summary": "Initializes `arg_list` for subsequent variadic argument extractions.", "operands": [ { "name": "arg_list", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "$arg_list attr-dict `:` qualified(type($arg_list))" }, { "name": "llvm.intr.vector.deinterleave2", "operands": [ { "name": "vec", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.extract", "operands": [ { "name": "srcvec", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "pos", "type": "I64Attr" } ], "assemblyFormat": "$srcvec `[` $pos `]` attr-dict `:` type($res) `from` type($srcvec)" }, { "name": "llvm.intr.vector.insert", "operands": [ { "name": "dstvec", "type": "LLVM_AnyVector" }, { "name": "srcvec", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "pos", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['dstvec', 'res']>" } ], "assemblyFormat": "$srcvec `,` $dstvec `[` $pos `]` attr-dict `:` type($srcvec) `into` type($res)" }, { "name": "llvm.intr.vector.interleave2", "operands": [ { "name": "vec1", "type": "LLVM_AnyVector" }, { "name": "vec2", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "AllTypesMatch<['vec1', 'vec2']>" } ] }, { "name": "llvm.intr.vector.reduce.add", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.and", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.fadd", "operands": [ { "name": "start_value", "type": "AnyFloat" }, { "name": "input", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ] }, { "name": "llvm.intr.vector.reduce.fmax", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.vector.reduce.fmaximum", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.vector.reduce.fmin", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.vector.reduce.fminimum", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` functional-type(operands, results)" }, { "name": "llvm.intr.vector.reduce.fmul", "operands": [ { "name": "start_value", "type": "AnyFloat" }, { "name": "input", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ] }, { "name": "llvm.intr.vector.reduce.mul", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.or", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.smax", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.smin", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.umax", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.umin", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vector.reduce.xor", "operands": [ { "name": "in", "type": "LLVM_VectorOf" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.add", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.and", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.ashr", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fadd", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fdiv", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fma", "operands": [ { "name": "op1", "type": "LLVM_VectorOf" }, { "name": "op2", "type": "LLVM_VectorOf" }, { "name": "op3", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fmul", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fmuladd", "operands": [ { "name": "op1", "type": "LLVM_VectorOf" }, { "name": "op2", "type": "LLVM_VectorOf" }, { "name": "op3", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fneg", "operands": [ { "name": "op", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fpext", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fptosi", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fptoui", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fptrunc", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.frem", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.fsub", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.inttoptr", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.load", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.lshr", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.merge", "operands": [ { "name": "cond", "type": "LLVM_VectorOf" }, { "name": "true_val", "type": "LLVM_AnyVector" }, { "name": "false_val", "type": "LLVM_AnyVector" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.mul", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.or", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.ptrtoint", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.add", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.and", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.fadd", "operands": [ { "name": "satrt_value", "type": "AnyFloat" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.fmax", "operands": [ { "name": "satrt_value", "type": "AnyFloat" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.fmin", "operands": [ { "name": "satrt_value", "type": "AnyFloat" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.fmul", "operands": [ { "name": "satrt_value", "type": "AnyFloat" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.mul", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.or", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.smax", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.smin", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.umax", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.umin", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.reduce.xor", "operands": [ { "name": "satrt_value", "type": "AnySignlessInteger" }, { "name": "val", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.sdiv", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.select", "operands": [ { "name": "cond", "type": "LLVM_VectorOf" }, { "name": "true_val", "type": "LLVM_AnyVector" }, { "name": "false_val", "type": "LLVM_AnyVector" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.sext", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.shl", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.sitofp", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.smax", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.smin", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.srem", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.store", "operands": [ { "name": "val", "type": "LLVM_AnyVector" }, { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ] }, { "name": "llvm.intr.vp.sub", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.trunc", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.udiv", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.uitofp", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.umax", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.umin", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.urem", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.xor", "operands": [ { "name": "lhs", "type": "LLVM_VectorOf" }, { "name": "rhs", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vp.zext", "operands": [ { "name": "src", "type": "LLVM_VectorOf" }, { "name": "mask", "type": "LLVM_VectorOf" }, { "name": "evl", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.intr.vscale", "results": [ { "name": "res", "type": "LLVM_Type" } ] }, { "name": "llvm.inttoptr", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "dereferenceable", "type": "OptionalAttr" } ], "assemblyFormat": "$arg (`dereferenceable` `` $dereferenceable^)? attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.invoke", "operands": [ { "name": "callee_operands", "type": "Variadic" }, { "name": "normalDestOperands", "type": "Variadic" }, { "name": "unwindDestOperands", "type": "Variadic" }, { "name": "op_bundle_operands", "type": "VariadicOfVariadic" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "var_callee_type", "type": "OptionalAttr>" }, { "name": "callee", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "branch_weights", "type": "OptionalAttr" }, { "name": "CConv", "type": "DefaultValuedAttr" }, { "name": "op_bundle_sizes", "type": "DenseI32ArrayAttr" }, { "name": "op_bundle_tags", "type": "OptionalAttr" } ], "successors": [ { "name": "normalDest", "type": "AnySuccessor" }, { "name": "unwindDest", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.landingpad", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "cleanup", "type": "UnitAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.linker_options", "summary": "Options to pass to the linker when the object file is linked", "description": "Pass the given options to the linker when the resulting object file is linked.\n This is used extensively on Windows to determine the C runtime that the object\n files should link against.\n\n Examples:\n ```mlir\n // Link against the MSVC static threaded CRT.\n llvm.linker_options [\"/DEFAULTLIB:\", \"libcmt\"]\n\n // Link against aarch64 compiler-rt builtins\n llvm.linker_options [\"-l\", \"clang_rt.builtins-aarch64\"]\n ```", "attributes": [ { "name": "options", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$options attr-dict" }, { "name": "llvm.load", "description": "The `load` operation is used to read from memory. A load may be marked as\n atomic, volatile, and/or nontemporal, and takes a number of optional\n attributes that specify aliasing information.\n\n An atomic load only supports a limited set of pointer, integer, and\n floating point types, and requires an explicit alignment.\n\n Examples:\n ```mlir\n // A volatile load of a float variable.\n %0 = llvm.load volatile %ptr : !llvm.ptr -> f32\n\n // A nontemporal load of a float variable.\n %0 = llvm.load %ptr {nontemporal} : !llvm.ptr -> f32\n\n // An atomic load of an integer variable.\n %0 = llvm.load %ptr atomic monotonic {alignment = 8 : i64}\n : !llvm.ptr -> i64\n ```\n\n See the following link for more details:\n https://llvm.org/docs/LangRef.html#load-instruction", "operands": [ { "name": "addr", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_LoadableType" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" }, { "name": "volatile_", "type": "UnitAttr" }, { "name": "nontemporal", "type": "UnitAttr" }, { "name": "invariant", "type": "UnitAttr" }, { "name": "invariantGroup", "type": "UnitAttr" }, { "name": "ordering", "type": "DefaultValuedAttr" }, { "name": "syncscope", "type": "OptionalAttr" }, { "name": "dereferenceable", "type": "OptionalAttr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "(`volatile` $volatile_^)? $addr\n (`atomic` (`syncscope` `(` $syncscope^ `)`)? $ordering^)?\n (`invariant` $invariant^)?\n (`invariant_group` $invariantGroup^)?\n (`dereferenceable` `` $dereferenceable^)?\n attr-dict `:` qualified(type($addr)) `->` type($res)" }, { "name": "llvm.lshr", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`exact` $isExact^)? $lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.mlir.addressof", "summary": "Creates a pointer pointing to a global, alias or a function", "description": "Creates an SSA value containing a pointer to a global value (function,\n variable or alias). The global value can be defined after its first\n referenced. If the global value is a constant, storing into it is not\n allowed.\n\n Examples:\n\n ```mlir\n func @foo() {\n // Get the address of a global variable.\n %0 = llvm.mlir.addressof @const : !llvm.ptr\n\n // Use it as a regular pointer.\n %1 = llvm.load %0 : !llvm.ptr -> i32\n\n // Get the address of a function.\n %2 = llvm.mlir.addressof @foo : !llvm.ptr\n\n // The function address can be used for indirect calls.\n llvm.call %2() : !llvm.ptr, () -> ()\n\n // Get the address of an aliased global.\n %3 = llvm.mlir.addressof @const_alias : !llvm.ptr\n }\n\n // Define the global.\n llvm.mlir.global @const(42 : i32) : i32\n\n // Define an alias.\n llvm.mlir.alias @const_alias : i32 {\n %0 = llvm.mlir.addressof @const : !llvm.ptr\n llvm.return %0 : !llvm.ptr\n }\n ```", "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "global_name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$global_name attr-dict `:` qualified(type($res))" }, { "name": "llvm.mlir.alias", "summary": "LLVM dialect alias.", "description": "`llvm.mlir.alias` is a top level operation that defines a global alias for\n global variables and functions. The operation is always initialized by\n using a initializer region which could be a direct map to another global\n value or contain some address computation on top of it.\n\n It uses a symbol for its value, which will be uniqued by the module\n with respect to other symbols in it.\n\n Similarly to functions and globals, they can also have a linkage attribute.\n This attribute is placed between `llvm.mlir.alias` and the symbol name. If\n the attribute is omitted, `external` linkage is assumed by default.\n\n Examples:\n\n ```mlir\n // Global alias use @-identifiers.\n llvm.mlir.alias external @foo_alias {addr_space = 0 : i32} : !llvm.ptr {\n %0 = llvm.mlir.addressof @some_function : !llvm.ptr\n llvm.return %0 : !llvm.ptr\n }\n\n // More complex initialization.\n llvm.mlir.alias linkonce_odr hidden @glob\n {addr_space = 0 : i32, dso_local} : !llvm.array<32 x i32> {\n %0 = llvm.mlir.constant(1234 : i64) : i64\n %1 = llvm.mlir.addressof @glob.private : !llvm.ptr\n %2 = llvm.ptrtoint %1 : !llvm.ptr to i64\n %3 = llvm.add %2, %0 : i64\n %4 = llvm.inttoptr %3 : i64 to !llvm.ptr\n llvm.return %4 : !llvm.ptr\n }\n ```", "attributes": [ { "name": "alias_type", "type": "TypeAttr" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "linkage", "type": "Linkage" }, { "name": "dso_local", "type": "UnitAttr" }, { "name": "thread_local_", "type": "UnitAttr" }, { "name": "unnamed_addr", "type": "OptionalAttr" }, { "name": "visibility_", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "initializer", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.mlir.constant", "summary": "Defines a constant of LLVM type.", "description": "Unlike LLVM IR, MLIR does not have first-class constant values. Therefore,\n all constants must be created as SSA values before being used in other\n operations. `llvm.mlir.constant` creates such values for scalars, vectors,\n strings, structs, and array of structs. It has a mandatory `value` attribute\n whose type depends on the type of the constant value. The type of the constant\n value must correspond to the attribute type converted to LLVM IR type.\n\n When creating constant scalars, the `value` attribute must be either an\n integer attribute or a floating point attribute. The type of the attribute\n may be omitted for `i64` and `f64` types that are implied.\n\n When creating constant vectors, the `value` attribute must be either an\n array attribute, a dense attribute, or a sparse attribute that contains\n integers or floats. The number of elements in the result vector must match\n the number of elements in the attribute.\n\n When creating constant strings, the `value` attribute must be a string\n attribute. The type of the constant must be an LLVM array of `i8`s, and the\n length of the array must match the length of the attribute.\n\n When creating constant structs, the `value` attribute must be an array\n attribute that contains integers or floats. The type of the constant must be\n an LLVM struct type. The number of fields in the struct must match the\n number of elements in the attribute, and the type of each LLVM struct field\n must correspond to the type of the corresponding attribute element converted\n to LLVM IR.\n\n When creating an array of structs, the `value` attribute must be an array\n attribute, itself containing zero, or undef, or array attributes for each\n potential nested array type, and the elements of the leaf array attributes\n for must match the struct element types or be zero or undef attributes.\n\n Examples:\n\n ```mlir\n // Integer constant, internal i32 is mandatory\n %0 = llvm.mlir.constant(42 : i32) : i32\n\n // It's okay to omit i64.\n %1 = llvm.mlir.constant(42) : i64\n\n // Floating point constant.\n %2 = llvm.mlir.constant(42.0 : f32) : f32\n\n // Splat dense vector constant.\n %3 = llvm.mlir.constant(dense<1.0> : vector<4xf32>) : vector<4xf32>\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` type($res)" }, { "name": "llvm.mlir.global", "summary": "LLVM dialect global.", "description": "Since MLIR allows for arbitrary operations to be present at the top level,\n global variables are defined using the `llvm.mlir.global` operation. Both\n global constants and variables can be defined, and the value may also be\n initialized in both cases.\n\n There are two forms of initialization syntax. Simple constants that can be\n represented as MLIR attributes can be given in-line:\n\n ```mlir\n llvm.mlir.global @variable(32.0 : f32) : f32\n ```\n\n This initialization and type syntax is similar to `llvm.mlir.constant` and\n may use two types: one for MLIR attribute and another for the LLVM value.\n These types must be compatible.\n\n More complex constants that cannot be represented as MLIR attributes can be\n given in an initializer region:\n\n ```mlir\n // This global is initialized with the equivalent of:\n // i32* getelementptr (i32* @g2, i32 2)\n llvm.mlir.global constant @int_gep() : !llvm.ptr {\n %0 = llvm.mlir.addressof @g2 : !llvm.ptr\n %1 = llvm.mlir.constant(2 : i32) : i32\n %2 = llvm.getelementptr %0[%1]\n : (!llvm.ptr, i32) -> !llvm.ptr, i32\n // The initializer region must end with `llvm.return`.\n llvm.return %2 : !llvm.ptr\n }\n ```\n\n Only one of the initializer attribute or initializer region may be provided.\n\n `llvm.mlir.global` must appear at top-level of the enclosing module. It uses\n an @-identifier for its value, which will be uniqued by the module with\n respect to other @-identifiers in it.\n\n Examples:\n\n ```mlir\n // Global values use @-identifiers.\n llvm.mlir.global constant @cst(42 : i32) : i32\n\n // Non-constant values must also be initialized.\n llvm.mlir.global @variable(32.0 : f32) : f32\n\n // Strings are expected to be of wrapped LLVM i8 array type and do not\n // automatically include the trailing zero.\n llvm.mlir.global @string(\"abc\") : !llvm.array<3 x i8>\n\n // For strings globals, the trailing type may be omitted.\n llvm.mlir.global constant @no_trailing_type(\"foo bar\")\n\n // A complex initializer is constructed with an initializer region.\n llvm.mlir.global constant @int_gep() : !llvm.ptr {\n %0 = llvm.mlir.addressof @g2 : !llvm.ptr\n %1 = llvm.mlir.constant(2 : i32) : i32\n %2 = llvm.getelementptr %0[%1]\n : (!llvm.ptr, i32) -> !llvm.ptr, i32\n llvm.return %2 : !llvm.ptr\n }\n ```\n\n Similarly to functions, globals have a linkage attribute. In the custom\n syntax, this attribute is placed between `llvm.mlir.global` and the optional\n `constant` keyword. If the attribute is omitted, `external` linkage is\n assumed by default.\n\n Examples:\n\n ```mlir\n // A constant with internal linkage will not participate in linking.\n llvm.mlir.global internal constant @cst(42 : i32) : i32\n\n // By default, \"external\" linkage is assumed and the global participates in\n // symbol resolution at link-time.\n llvm.mlir.global @glob(0 : f32) : f32\n\n // Alignment is optional\n llvm.mlir.global private constant @y(dense<1.0> : tensor<8xf32>) : !llvm.array<8 x f32>\n ```\n\n Like global variables in LLVM IR, globals can have an (optional)\n alignment attribute using keyword `alignment`. The integer value of the\n alignment must be a positive integer that is a power of 2.\n\n Examples:\n\n ```mlir\n // Alignment is optional\n llvm.mlir.global private constant @y(dense<1.0> : tensor<8xf32>) { alignment = 32 : i64 } : !llvm.array<8 x f32>\n ```\n\n The `target_specific_attrs` attribute provides a mechanism to preserve\n target-specific LLVM IR attributes that are not explicitly modeled in the\n LLVM dialect.\n\n The attribute is an array containing either string attributes or\n two-element array attributes of strings. The value of a standalone string\n attribute is interpreted as the name of an LLVM IR attribute on the global.\n A two-element array is interpreted as a key-value pair.\n\n Example:\n\n ```mlir\n llvm.mlir.global external @example() {\n target_specific_attrs = [\"value-less-attr\", [\"int-attr\", \"4\"], [\"string-attr\", \"string\"]]} : f64\n ```", "attributes": [ { "name": "global_type", "type": "TypeAttr" }, { "name": "constant", "type": "UnitAttr" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "linkage", "type": "Linkage" }, { "name": "dso_local", "type": "UnitAttr" }, { "name": "thread_local_", "type": "UnitAttr" }, { "name": "externally_initialized", "type": "UnitAttr" }, { "name": "value", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "addr_space", "type": "DefaultValuedAttr, 0>" }, { "name": "unnamed_addr", "type": "OptionalAttr" }, { "name": "section", "type": "OptionalAttr" }, { "name": "comdat", "type": "OptionalAttr" }, { "name": "dbg_exprs", "type": "OptionalAttr>" }, { "name": "visibility_", "type": "DefaultValuedAttr" }, { "name": "target_specific_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "initializer", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "llvm.mlir.global_ctors", "summary": "LLVM dialect global_ctors.", "description": "Specifies a list of constructor functions, priorities, and associated data.\n The functions referenced by this array will be called in ascending order\n of priority (i.e. lowest first) when the module is loaded. The order of\n functions with the same priority is not defined. This operation is\n translated to LLVM's global_ctors global variable. The initializer\n functions are run at load time. However, if the associated data is not\n `#llvm.zero`, functions only run if the data is not discarded.\n\n Examples:\n\n ```mlir\n llvm.func @ctor() {\n ...\n llvm.return\n }\n llvm.mlir.global_ctors ctors = [@ctor], priorities = [0],\n data = [#llvm.zero]\n ```", "attributes": [ { "name": "ctors", "type": "TypedArrayAttrBase" }, { "name": "priorities", "type": "TypedArrayAttrBase" }, { "name": "data", "type": "ArrayAttr" } ], "assemblyFormat": "`ctors` `=` $ctors\n `,` `priorities` `=` $priorities\n `,` `data` `=` $data\n attr-dict" }, { "name": "llvm.mlir.global_dtors", "summary": "LLVM dialect global_dtors.", "description": "Specifies a list of destructor functions and priorities. The functions\n referenced by this array will be called in descending order of priority\n (i.e. highest first) when the module is unloaded. The order of functions\n with the same priority is not defined. This operation is translated to\n LLVM's global_dtors global variable. The destruction functions are run at\n load time. However, if the associated data is not `#llvm.zero`, functions\n only run if the data is not discarded.\n\n Examples:\n\n ```mlir\n llvm.func @dtor() {\n llvm.return\n }\n llvm.mlir.global_dtors dtors = [@dtor], priorities = [0],\n data = [#llvm.zero]\n ```", "attributes": [ { "name": "dtors", "type": "TypedArrayAttrBase" }, { "name": "priorities", "type": "TypedArrayAttrBase" }, { "name": "data", "type": "ArrayAttr" } ], "assemblyFormat": "`dtors` `=` $dtors\n `,` `priorities` `=` $priorities\n `,` `data` `=` $data\n attr-dict" }, { "name": "llvm.mlir.ifunc", "summary": "LLVM dialect ifunc", "description": "`llvm.mlir.ifunc` is a top level operation that defines a global ifunc.\n It defines a new symbol and takes a symbol refering to a resolver function.\n IFuncs can be called as regular functions. The function type is the same\n as the IFuncType. The symbol is resolved at runtime by calling a resolver\n function.\n\n Examples:\n\n ```mlir\n // IFuncs resolve a symbol at runtime using a resovler function.\n llvm.mlir.ifunc external @foo: !llvm.func, !llvm.ptr @resolver\n\n llvm.func @foo_1(i64) -> f32\n llvm.func @foo_2(i64) -> f32\n\n llvm.func @resolve_foo() -> !llvm.ptr attributes {\n %0 = llvm.mlir.addressof @foo_2 : !llvm.ptr\n %1 = llvm.mlir.addressof @foo_1 : !llvm.ptr\n\n // ... Logic selecting from foo_{1, 2}\n\n // Return function pointer to the selected function\n llvm.return %7 : !llvm.ptr\n }\n\n llvm.func @use_foo() {\n // IFuncs are called as regular functions\n %res = llvm.call @foo(%value) : i64 -> f32\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "i_func_type", "type": "TypeAttr" }, { "name": "resolver", "type": "FlatSymbolRefAttr" }, { "name": "resolver_type", "type": "TypeAttr" }, { "name": "linkage", "type": "Linkage" }, { "name": "dso_local", "type": "UnitAttr" }, { "name": "address_space", "type": "DefaultValuedAttr, 0>" }, { "name": "unnamed_addr", "type": "DefaultValuedAttr" }, { "name": "visibility_", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($linkage) ($visibility_^)? ($unnamed_addr^)?\n $sym_name `:` $i_func_type `,` $resolver_type $resolver attr-dict" }, { "name": "llvm.mlir.metadata_as_value", "summary": "Wraps an LLVM `metadata` constant so it can be used as an SSA value.", "description": "Materializes an `!llvm.metadata` SSA value that mirrors LLVM IR's\n `llvm::MetadataAsValue`: a wrapper that lifts an arbitrary\n `llvm::Metadata` node into the value domain so it can be used as an\n operand to instructions that take `metadata` arguments (for example the\n constrained floating-point intrinsics or `llvm.read_register`).\n\n The wrapped metadata is described by the `metadata` attribute, which\n must be one of the LLVM dialect's metadata-attribute classes:\n\n * `#llvm.md_string<\"...\">` -> `llvm::MDString`.\n * `#llvm.md_const<...>` -> `llvm::ConstantAsMetadata`.\n * `#llvm.md_func<@symbol>` -> `llvm::ValueAsMetadata` of a function.\n * `#llvm.md_node<...>` -> `llvm::MDNode` over any of the above.\n\n These can be nested arbitrarily to form metadata trees. Lowering to LLVM\n IR materialises the corresponding `llvm::Metadata` via the dialect's\n metadata-attribute converter and wraps the result with\n `llvm::MetadataAsValue::get(ctx, md)`.\n\n Example:\n\n ```mlir\n // Rounding-mode operand of a constrained-FP intrinsic:\n %rm = llvm.mlir.metadata_as_value #llvm.md_string<\"round.tonearest\">\n : !llvm.metadata\n // Named-register metadata for llvm.read_register:\n %nr = llvm.mlir.metadata_as_value #llvm.md_node<#llvm.md_string<\"sp\">>\n : !llvm.metadata\n ```", "results": [ { "name": "res", "type": "LLVM_MetadataType" } ], "attributes": [ { "name": "metadata", "type": "LLVM_AnyMDAttr" } ], "assemblyFormat": "$metadata attr-dict" }, { "name": "llvm.mlir.none", "summary": "Defines a value containing an empty token to LLVM type.", "description": "MLIR does not have a way to spell the LLVM IR `none` token literal. This\n operation produces a builtin `!token` SSA value that lowers to\n `llvm::ConstantTokenNone` in LLVM IR.\n\n Examples:\n\n ```mlir\n %0 = llvm.mlir.none : !token\n ```", "results": [ { "name": "res", "type": "Token" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.mlir.poison", "summary": "Creates a poison value of LLVM dialect type.", "description": "Unlike LLVM IR, MLIR does not have first-class poison values. Such values\n must be created as SSA values using `llvm.mlir.poison`. This operation has\n no operands or attributes. It creates a poison value of the specified LLVM\n IR dialect type.\n\n Example:\n\n ```mlir\n // Create a poison value for a structure with a 32-bit integer followed\n // by a float.\n %0 = llvm.mlir.poison : !llvm.struct<(i32, f32)>\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.mlir.undef", "summary": "Creates an undefined value of LLVM dialect type.", "description": "Unlike LLVM IR, MLIR does not have first-class undefined values. Such values\n must be created as SSA values using `llvm.mlir.undef`. This operation has no\n operands or attributes. It creates an undefined value of the specified LLVM\n IR dialect type.\n\n Example:\n\n ```mlir\n // Create a structure with a 32-bit integer followed by a float.\n %0 = llvm.mlir.undef : !llvm.struct<(i32, f32)>\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.mlir.zero", "summary": "Creates a zero-initialized value of LLVM dialect type.", "description": "Unlike LLVM IR, MLIR does not have first-class zero-initialized values.\n Such values must be created as SSA values using `llvm.mlir.zero`. This\n operation has no operands or attributes. It creates a zero-initialized\n value of the specified LLVM IR dialect type.\n\n Example:\n\n ```mlir\n // Create a zero-initialized value for a structure with a 32-bit integer\n // followed by a float.\n %0 = llvm.mlir.zero : !llvm.struct<(i32, f32)>\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "llvm.module_flags", "summary": "Information about module properties", "description": "Represents the equivalent in MLIR for LLVM's `llvm.module.flags` metadata,\n which requires a list of metadata triplets (combining kind, name, value),\n either specified directly by a `ModuleFlagAttr` or defined by an attribute\n implementing `ModuleFlagAttrInterface` (which is used to wrap the details\n of metadata combining, provided other verifications, etc.)\n\n Example:\n ```mlir\n llvm.module.flags [\n #llvm.mlir.module_flag,\n #llvm.mlir.module_flag\n ]\n ```", "attributes": [ { "name": "flags", "type": "ArrayAttr" } ], "assemblyFormat": "$flags attr-dict" }, { "name": "llvm.mul", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "overflowFlags", "type": "LLVM_IntegerOverflowFlagsProp" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($overflowFlags^)? attr-dict `:` type($res)" }, { "name": "llvm.named_metadata", "summary": "Module-level named metadata", "description": "Represents an LLVM named metadata node (`llvm::NamedMDNode`). Named\n metadata nodes are module-level metadata that associate a name string\n with a list of metadata nodes. Each operand must be an `#llvm.md_node`.\n\n Note: cyclic metadata graphs are not supported. Because metadata attributes\n are represented as MLIR attributes (which form a tree), there is no way to\n express a metadata node that directly or transitively references itself.\n LLVM IR permits such cycles (e.g. `!0 = !{!0}`), but they cannot be\n represented here and will not round-trip through this op.\n\n Example:\n ```mlir\n llvm.named_metadata \"foo.version\" [\n #llvm.md_node<#llvm.md_const<2 : i32>,\n #llvm.md_const<9 : i32>,\n #llvm.md_const<0 : i32>\n >\n ]\n llvm.named_metadata \"foo.kernel\" [\n #llvm.md_node<\n #llvm.md_func<@my_kernel>,\n #llvm.md_node<>,\n #llvm.md_node<\n #llvm.md_node<#llvm.md_const<0 : i32>,\n #llvm.md_string<\"foo.buffer\">\n >\n >\n >\n ]\n ```", "attributes": [ { "name": "metadata_name", "type": "StrAttr" }, { "name": "nodes", "type": "ArrayAttr" } ], "assemblyFormat": "$metadata_name $nodes attr-dict" }, { "name": "llvm.or", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "isDisjoint", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`disjoint` $isDisjoint^)? $lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.ptrtoaddr", "description": "Operation mirroring LLVM's `ptrtoaddr` operation.\n\n This operation casts a pointer (or a vector of pointers) to an integer\n (or a vector of integers) without capturing the provenance of the pointer.\n Therefore, an integer returned or derived from `llvm.ptrtoaddr` does not\n create a legal-to-access pointer when used in `llvm.inttoptr`.\n Code that only cares about the address value of a pointer\n (e.g. pointer subtraction) should prefer `llvm.ptrtoaddr` over\n `llvm.ptrtoint`.\n\n The integer type used as the result type is required to be equal in width\n to the pointer type as specified in the data layout.\n Use the `llvm-target-to-data-layout` pass to derive an MLIR datalayout from\n an LLVM datalayout.\n\n Examples:\n ```\n llvm.func @default_64_bit_ptrtoaddr(%arg0 : !llvm.ptr) -> i64 {\n %0 = llvm.ptrtoaddr %arg0 : !llvm.ptr to i64\n llvm.return i64\n }\n\n module attributes { dlti.dl_spec = #dlti.dl_spec<\n #dlti.dl_entry : vector<3xi64>>\n >} {\n llvm.func @datalayout_32_bit(%arg0 : !llvm.ptr) -> i32 {\n %0 = llvm.ptrtoaddr %arg0 : !llvm.ptr to i32\n llvm.return %0 : i32\n }\n }\n ```", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.ptrtoint", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.resume", "operands": [ { "name": "value", "type": "LLVM_Type" } ], "assemblyFormat": "$value attr-dict `:` type($value)" }, { "name": "llvm.return", "operands": [ { "name": "arg", "type": "Optional" } ], "assemblyFormat": "attr-dict ($arg^ `:` type($arg))?" }, { "name": "llvm.sdiv", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`exact` $isExact^)? $lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.select", "operands": [ { "name": "condition", "type": "LLVM_ScalarOrVectorOf" }, { "name": "trueValue", "type": "LLVM_Type" }, { "name": "falseValue", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fastmathFlags", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['trueValue', 'falseValue', 'res']>" } ], "assemblyFormat": "operands attr-dict `:` type($condition) `,` type($res)" }, { "name": "llvm.sext", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.shl", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "overflowFlags", "type": "LLVM_IntegerOverflowFlagsProp" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($overflowFlags^)? attr-dict `:` type($res)" }, { "name": "llvm.shufflevector", "summary": "Construct a permutation of two vectors.", "operands": [ { "name": "v1", "type": "LLVM_AnyVector" }, { "name": "v2", "type": "LLVM_AnyVector" } ], "results": [ { "name": "res", "type": "LLVM_AnyVector" } ], "attributes": [ { "name": "mask", "type": "DenseI32ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['v1', 'v2']>" } ], "assemblyFormat": "$v1 `,` $v2 $mask attr-dict `:` type($v1)\n custom(ref(type($v1)), type($res), ref($mask))" }, { "name": "llvm.sitofp", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.srem", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.store", "description": "The `store` operation is used to write to memory. A store may be marked as\n atomic, volatile, and/or nontemporal, and takes a number of optional\n attributes that specify aliasing information.\n\n An atomic store only supports a limited set of pointer, integer, and\n floating point types, and requires an explicit alignment.\n\n Examples:\n ```mlir\n // A volatile store of a float variable.\n llvm.store volatile %val, %ptr : f32, !llvm.ptr\n\n // A nontemporal store of a float variable.\n llvm.store %val, %ptr {nontemporal} : f32, !llvm.ptr\n\n // An atomic store of an integer variable.\n llvm.store %val, %ptr atomic monotonic {alignment = 8 : i64}\n : i64, !llvm.ptr\n ```\n\n See the following link for more details:\n https://llvm.org/docs/LangRef.html#store-instruction", "operands": [ { "name": "value", "type": "LLVM_LoadableType" }, { "name": "addr", "type": "LLVM_AnyPointer" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" }, { "name": "volatile_", "type": "UnitAttr" }, { "name": "nontemporal", "type": "UnitAttr" }, { "name": "invariantGroup", "type": "UnitAttr" }, { "name": "ordering", "type": "DefaultValuedAttr" }, { "name": "syncscope", "type": "OptionalAttr" }, { "name": "access_groups", "type": "OptionalAttr>" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "(`volatile` $volatile_^)? $value `,` $addr\n (`atomic` (`syncscope` `(` $syncscope^ `)`)? $ordering^)?\n (`invariant_group` $invariantGroup^)?\n attr-dict `:` type($value) `,` qualified(type($addr))" }, { "name": "llvm.sub", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "overflowFlags", "type": "LLVM_IntegerOverflowFlagsProp" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs ($overflowFlags^)? attr-dict `:` type($res)" }, { "name": "llvm.switch", "operands": [ { "name": "value", "type": "AnySignlessInteger" }, { "name": "defaultOperands", "type": "Variadic" }, { "name": "caseOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "case_values", "type": "OptionalAttr" }, { "name": "case_operand_segments", "type": "DenseI32ArrayAttr" }, { "name": "branch_weights", "type": "OptionalAttr" } ], "successors": [ { "name": "defaultDestination", "type": "AnySuccessor" }, { "name": "caseDestinations", "type": "VariadicSuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$value `:` type($value) `,`\n $defaultDestination (`(` $defaultOperands^ `:` type($defaultOperands) `)`)?\n custom(ref(type($value)), $case_values, $caseDestinations,\n $caseOperands, type($caseOperands))\n attr-dict" }, { "name": "llvm.trunc", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "overflowFlags", "type": "LLVM_IntegerOverflowFlagsProp" } ], "assemblyFormat": "$arg ($overflowFlags^)? attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.udiv", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "isExact", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`exact` $isExact^)? $lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.uitofp", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "nonNeg", "type": "UnitAttr" } ], "assemblyFormat": "(`nneg` $nonNeg^)? $arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "llvm.unreachable", "assemblyFormat": "attr-dict" }, { "name": "llvm.urem", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.va_arg", "operands": [ { "name": "arg", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$arg attr-dict `:` functional-type($arg, $res)" }, { "name": "llvm.xor", "operands": [ { "name": "lhs", "type": "LLVM_ScalarOrVectorOf" }, { "name": "rhs", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "llvm.zext", "operands": [ { "name": "arg", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "nonNeg", "type": "UnitAttr" } ], "assemblyFormat": "(`nneg` $nonNeg^)? $arg attr-dict `:` type($arg) `to` type($res)" }, { "name": "math.absf", "summary": "floating point absolute-value operation", "description": "The `absf` operation computes the absolute value. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result\n of the same type.\n\n Example:\n\n ```mlir\n // Scalar absolute value.\n %a = math.absf %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.absi", "summary": "integer absolute-value operation", "description": "The `absi` operation computes the absolute value. It takes one operand of\n integer type (i.e., scalar, tensor or vector) and returns one result of the\n same type.\n\n Example:\n\n ```mlir\n // Scalar absolute value.\n %a = math.absi %b : i64\n ```", "operands": [ { "name": "operand", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "math.acos", "summary": "arcus cosine of the specified value", "description": "The `acos` operation computes the arcus cosine of a given value. It takes one\n operand of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar arcus cosine value.\n %a = math.acos %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.acosh", "summary": "Hyperbolic arcus cosine of the given value", "description": "Syntax:\n\n ```\n operation ::= ssa-id `=` `math.acosh` ssa-use `:` type\n ```\n\n The `acosh` operation computes the arcus cosine of a given value. It takes\n one operand of floating point type (i.e., scalar, tensor or vector) and returns\n one result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Hyperbolic arcus cosine of scalar value.\n %a = math.acosh %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.asin", "summary": "arcus sine of the given value", "description": "Syntax:\n\n ```\n operation ::= ssa-id `=` `math.asin` ssa-use `:` type\n ```\n\n The `asin` operation computes the arcus sine of a given value. It takes\n one operand of floating point type (i.e., scalar, tensor or vector) and returns\n one result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Arcus sine of scalar value.\n %a = math.asin %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.asinh", "summary": "hyperbolic arcus sine of the given value", "description": "Syntax:\n\n ```\n operation ::= ssa-id `=` `math.asinh` ssa-use `:` type\n ```\n\n The `asinh` operation computes the hyperbolic arcus sine of a given value. It takes\n one operand of floating point type (i.e., scalar, tensor or vector) and returns\n one result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Hyperbolic arcus sine of scalar value.\n %a = math.asinh %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.atan", "summary": "arcus tangent of the given value", "description": "The `atan` operation computes the arcus tangent of a given value. It takes\n one operand of floating point type (i.e., scalar, tensor or vector) and returns\n one result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Arcus tangent of scalar value.\n %a = math.atan %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.atan2", "summary": "2-argument arcus tangent of the given values", "description": "The `atan2` operation takes two operands and returns one result, all of\n which must be of the same type. The operands must be of floating point type\n (i.e., scalar, tensor or vector).\n\n The 2-argument arcus tangent `atan2(y, x)` returns the angle in the\n Euclidian plane between the positive x-axis and the ray through the point\n (x, y). It is a generalization of the 1-argument arcus tangent which\n returns the angle on the basis of the ratio y/x.\n\n See also https://en.wikipedia.org/wiki/Atan2\n\n Example:\n\n ```mlir\n // Scalar variant.\n %a = math.atan2 %b, %c : f32\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.atanh", "summary": "hyperbolic arcus tangent of the given value", "description": "Syntax:\n\n ```\n operation ::= ssa-id `=` `math.atanh` ssa-use `:` type\n ```\n\n The `atanh` operation computes the hyperbolic arcus tangent of a given value. It takes\n one operand of floating point type (i.e., scalar, tensor or vector) and returns\n one result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Hyperbolic arcus tangent of scalar value.\n %a = math.atanh %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.cbrt", "summary": "cube root of the specified value", "description": "The `cbrt` operation computes the cube root. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result\n of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar cube root value.\n %a = math.cbrt %b : f64\n ```\n\n Note: This op is not equivalent to powf(..., 1/3.0).", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.ceil", "summary": "ceiling of the specified value", "description": "The `ceil` operation computes the ceiling of a given value. It takes one\n operand of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar ceiling value.\n %a = math.ceil %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.clampf", "summary": "floating point clamping operation", "description": "The `clampf` operation takes three operands and returns one result, each of\n these is required to be the same type. Operands must be of floating point type\n (i.e., scalar, tensor or vector).\n\n The semantics of the operation are described by:\n ```\n clampf(value, min, max) = maxf(minf(value, max), min)\n ```\n If `min > max` the resulting value is poison.\n\n Example:\n\n ```mlir\n %d = math.clampf %value to [%min, %max] : f64\n ```", "operands": [ { "name": "value", "type": "FloatLike" }, { "name": "min", "type": "FloatLike" }, { "name": "max", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$value `to` ` ` `[` $min `,` $max `]` (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.copysign", "summary": "A copysign operation", "description": "The `copysign` returns a value with the magnitude of the first operand and\n the sign of the second operand. It takes two operands and returns one result of\n the same type. The operands must be of floating point type (i.e., scalar,\n tensor or vector). It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar copysign value.\n %a = math.copysign %b, %c : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.cos", "summary": "cosine of the specified value", "description": "The `cos` operation computes the cosine of a given value. It takes one\n operand of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar cosine value.\n %a = math.cos %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.cosh", "summary": "hyperbolic cosine of the specified value", "description": "The `cosh` operation computes the hyperbolic cosine. It takes one operand\n of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar hyperbolic cosine value.\n %a = math.cosh %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.ctlz", "summary": "counts the leading zeros an integer value", "description": "The `ctlz` operation computes the number of leading zeros of an integer value.\n It operates on scalar, tensor or vector.\n\n Example:\n\n ```mlir\n // Scalar ctlz function value.\n %a = math.ctlz %b : i32\n ```", "operands": [ { "name": "operand", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "math.ctpop", "summary": "counts the number of set bits of an integer value", "description": "The `ctpop` operation computes the number of set bits of an integer value.\n It operates on scalar, tensor or vector.\n\n Example:\n\n ```mlir\n // Scalar ctpop function value.\n %a = math.ctpop %b : i32\n ```", "operands": [ { "name": "operand", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "math.cttz", "summary": "counts the trailing zeros an integer value", "description": "The `cttz` operation computes the number of trailing zeros of an integer value.\n It operates on scalar, tensor or vector.\n\n Example:\n\n ```mlir\n // Scalar cttz function value.\n %a = math.cttz %b : i32\n ```", "operands": [ { "name": "operand", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "math.erf", "summary": "error function of the specified value", "description": "The `erf` operation computes the error function. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result of\n the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar error function value.\n %a = math.erf %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.erfc", "summary": "complementary error function of the specified value", "description": "The `erfc` operation computes the complementary error function, defined as\n 1-erf(x). This function is part of libm and is needed for accuracy, since\n simply calculating 1-erf(x) when x is close to 1 will give inaccurate results.\n It takes one operand of floating point type (i.e., scalar,\n tensor or vector) and returns one result of the same type. It has no\n standard attributes.\n\n Example:\n\n ```mlir\n // Scalar error function value.\n %a = math.erfc %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.exp", "summary": "base-e exponential of the specified value", "description": "The `exp` operation takes one operand of floating point type (i.e., scalar,\n tensor or vector) and returns one result of the same type. It has no standard\n attributes.\n\n Example:\n\n ```mlir\n // Scalar natural exponential.\n %a = math.exp %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.exp2", "summary": "base-2 exponential of the specified value", "description": "The `exp` operation takes one operand of floating point type (i.e., scalar,\n tensor or vector) and returns one result of the same type. It has no standard\n attributes.\n\n Example:\n\n ```mlir\n // Scalar natural exponential.\n %a = math.exp2 %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.expm1", "summary": "base-e exponential of the specified value minus 1", "description": "expm1(x) := exp(x) - 1\n\n The `expm1` operation takes one operand of floating point type (i.e.,\n scalar, tensor or vector) and returns one result of the same type. It has no\n standard attributes.\n\n Example:\n\n ```mlir\n // Scalar natural exponential minus 1.\n %a = math.expm1 %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.floor", "summary": "floor of the specified value", "description": "The `floor` operation computes the floor of a given value. It takes one\n operand of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar floor value.\n %a = math.floor %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.fma", "summary": "floating point fused multipy-add operation", "description": "The `fma` operation takes three operands and returns one result, each of\n these is required to be the same type. Operands must be of floating point type\n (i.e., scalar, tensor or vector).\n\n Example:\n\n ```mlir\n // Scalar fused multiply-add: d = a*b + c\n %d = math.fma %a, %b, %c : f64\n\n // With an explicit IEEE-754 rounding mode.\n %e = math.fma %a, %b, %c to_nearest_even : f64\n ```\n\n The semantics of the operation correspond to those of the `llvm.fma`\n [intrinsic](https://llvm.org/docs/LangRef.html#llvm-fma-intrinsic). When\n no rounding mode is set, lowering to LLVM is guaranteed to produce the\n `llvm.fma.*` intrinsic. When a rounding mode is set, the LLVM lowering\n instead produces `llvm.experimental.constrained.fma`.", "operands": [ { "name": "a", "type": "FloatLike" }, { "name": "b", "type": "FloatLike" }, { "name": "c", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" }, { "name": "roundingmode", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$a `,` $b `,` $c ($roundingmode^)?\n (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.fpowi", "summary": "floating point raised to the signed integer power", "description": "The `fpowi` operation takes a `base` operand of floating point type\n (i.e. scalar, tensor or vector) and a `power` operand of integer type\n (also scalar, tensor or vector) and returns one result of the same type\n as `base`. The result is `base` raised to the power of `power`.\n The operation is elementwise for non-scalars, e.g.:\n\n ```mlir\n %v = math.fpowi %base, %power : vector<2xf32>, vector<2xi32>\n ```\n\n The result is a vector of:\n\n ```\n [, ]\n ```\n\n Example:\n\n ```mlir\n // Scalar exponentiation.\n %a = math.fpowi %base, %power : f64, i32\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'result']>" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($lhs) `,` type($rhs)" }, { "name": "math.ipowi", "summary": "signed integer raised to the power of operation", "description": "The `ipowi` operation takes two operands of integer type (i.e., scalar,\n tensor or vector) and returns one result of the same type. Operands\n must have the same type.\n\n Example:\n\n ```mlir\n // Scalar signed integer exponentiation.\n %a = math.ipowi %b, %c : i32\n ```", "operands": [ { "name": "lhs", "type": "SignlessIntegerOrIndexLike" }, { "name": "rhs", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($result)" }, { "name": "math.isfinite", "summary": "returns true if the operand classifies as finite", "description": "Determines if the given floating-point number has finite value i.e. it\n is normal, subnormal or zero, but not infinite or NaN.\n\n Example:\n\n ```mlir\n %f = math.isfinite %a : f32\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', '::getI1SameShape($_self)'>" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "math.isinf", "summary": "returns true if the operand classifies as infinite", "description": "Determines if the given floating-point number is positive or negative\n infinity.\n\n Example:\n\n ```mlir\n %f = math.isinf %a : f32\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', '::getI1SameShape($_self)'>" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "math.isnan", "summary": "returns true if the operand classifies as NaN", "description": "Determines if the given floating-point number is a not-a-number (NaN)\n value.\n\n Example:\n\n ```mlir\n %f = math.isnan %a : f32\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', '::getI1SameShape($_self)'>" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "math.isnormal", "summary": "returns true if the operand classifies as normal", "description": "Determines if the given floating-point number is normal, i.e. is neither\n zero, subnormal, infinite, nor NaN.\n\n Example:\n\n ```mlir\n %f = math.isnormal %a : f32\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', '::getI1SameShape($_self)'>" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "math.log", "summary": "base-e logarithm of the specified value", "description": "Computes the base-e logarithm of the given value. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result of\n the same type.\n\n Example:\n\n ```mlir\n // Scalar log operation.\n %y = math.log %x : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.log10", "summary": "base-10 logarithm of the specified value", "description": "Computes the base-10 logarithm of the given value. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result of\n the same type.\n\n Example:\n\n ```mlir\n // Scalar log10 operation.\n %y = math.log10 %x : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.log1p", "summary": "Computes the natural logarithm of one plus the given value", "description": "Computes the base-e logarithm of one plus the given value. It takes one\n operand of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type.\n\n log1p(x) := log(1 + x)\n\n Example:\n\n ```mlir\n // Scalar log1p operation.\n %y = math.log1p %x : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.log2", "summary": "base-2 logarithm of the specified value", "description": "Computes the base-2 logarithm of the given value. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result of\n the same type.\n\n Example:\n\n ```mlir\n // Scalar log2 operation.\n %y = math.log2 %x : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.powf", "summary": "floating point raised to the power of operation", "description": "The `powf` operation takes two operands of floating point type (i.e.,\n scalar, tensor or vector) and returns one result of the same type. Operands\n must have the same type.\n\n Example:\n\n ```mlir\n // Scalar exponentiation.\n %a = math.powf %b, %c : f64\n ```", "operands": [ { "name": "lhs", "type": "FloatLike" }, { "name": "rhs", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.round", "summary": "round of the specified value", "description": "The `round` operation returns the operand rounded to the nearest integer\n value in floating-point format. It takes one operand of floating point type\n (i.e., scalar, tensor or vector) and produces one result of the same type. The\n operation rounds the argument to the nearest integer value in floating-point\n format, rounding halfway cases away from zero, regardless of the current\n rounding direction.\n\n Example:\n\n ```mlir\n // Scalar round operation.\n %a = math.round %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.roundeven", "summary": "round of the specified value with halfway cases to even", "description": "The `roundeven` operation returns the operand rounded to the nearest integer\n value in floating-point format. It takes one operand of floating point type\n (i.e., scalar, tensor or vector) and produces one result of the same type. The\n operation rounds the argument to the nearest integer value in floating-point\n format, rounding halfway cases to even, regardless of the current\n rounding direction.\n\n Example:\n\n ```mlir\n // Scalar round operation.\n %a = math.roundeven %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.rsqrt", "summary": "reciprocal of sqrt (1 / sqrt of the specified value)", "description": "The `rsqrt` operation computes the reciprocal of the square root. It takes\n one operand of floating point type (i.e., scalar, tensor or vector) and returns\n one result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar reciprocal square root value.\n %a = math.rsqrt %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.sin", "summary": "sine of the specified value", "description": "The `sin` operation computes the sine of a given value. It takes one\n operand of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar sine value.\n %a = math.sin %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.sincos", "summary": "sine and cosine of the specified value", "description": "The `sincos` operation computes both the sine and cosine of a given value\n simultaneously. It takes one operand of floating point type (i.e., scalar,\n tensor or vector) and returns two results of the same type. This operation\n can be more efficient than computing sine and cosine separately when both\n values are needed.\n\n Example:\n\n ```mlir\n // Scalar sine and cosine values.\n %sin, %cos = math.sincos %input : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "sin", "type": "FloatLike" }, { "name": "cos", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($operand)" }, { "name": "math.sinh", "summary": "hyperbolic sine of the specified value", "description": "The `sinh` operation computes the hyperbolic sine. It takes one operand\n of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar hyperbolic sine value.\n %a = math.sinh %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.sqrt", "summary": "sqrt of the specified value", "description": "The `sqrt` operation computes the square root. It takes one operand of\n floating point type (i.e., scalar, tensor or vector) and returns one result of\n the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar square root value.\n %a = math.sqrt %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.tan", "summary": "tangent of the specified value", "description": "The `tan` operation computes the tangent. It takes one operand\n of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar tangent value.\n %a = math.tan %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.tanh", "summary": "hyperbolic tangent of the specified value", "description": "The `tanh` operation computes the hyperbolic tangent. It takes one operand\n of floating point type (i.e., scalar, tensor or vector) and returns one\n result of the same type. It has no standard attributes.\n\n Example:\n\n ```mlir\n // Scalar hyperbolic tangent value.\n %a = math.tanh %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "math.trunc", "summary": "trunc of the specified value", "description": "The `trunc` operation returns the operand rounded to the nearest integer\n value in floating-point format. It takes one operand of floating point type\n (i.e., scalar, tensor or vector) and produces one result of the same type.\n The operation always rounds to the nearest integer not larger in magnitude\n than the operand, regardless of the current rounding direction.\n\n Example:\n\n ```mlir\n // Scalar trunc operation.\n %a = math.trunc %b : f64\n ```", "operands": [ { "name": "operand", "type": "FloatLike" } ], "results": [ { "name": "result", "type": "FloatLike" } ], "attributes": [ { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand (`fastmath` `` $fastmath^)?\n attr-dict `:` type($result)" }, { "name": "memref.alloc", "summary": "memory allocation operation", "description": "The `alloc` operation allocates a region of memory, as specified by its\n memref type.\n\n Example:\n\n ```mlir\n %0 = memref.alloc() : memref<8x64xf32, 1>\n ```\n\n The optional list of dimension operands are bound to the dynamic dimensions\n specified in its memref type. In the example below, the ssa value '%d' is\n bound to the second dimension of the memref (which is dynamic).\n\n ```mlir\n %0 = memref.alloc(%d) : memref<8x?xf32, 1>\n ```\n\n The optional list of symbol operands are bound to the symbols of the\n memrefs affine map. In the example below, the ssa value '%s' is bound to\n the symbol 's0' in the affine map specified in the allocs memref type.\n\n ```mlir\n %0 = memref.alloc()[%s] : memref<8x64xf32,\n affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>, 1>\n ```\n\n This operation returns a single ssa value of memref type, which can be used\n by subsequent load and store operations.\n\n The optional `alignment` attribute may be specified to ensure that the\n region of memory that will be indexed is aligned at the specified byte\n boundary.\n\n ```mlir\n %0 = memref.alloc()[%s] {alignment = 8} :\n memref<8x64xf32, affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>, 1>\n ```", "operands": [ { "name": "dynamicSizes", "type": "Variadic" }, { "name": "symbolOperands", "type": "Variadic" } ], "results": [ { "name": "memref", "type": "AnyMemRef" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(`$dynamicSizes`)` (`` `[` $symbolOperands^ `]`)? attr-dict `:` type($memref)" }, { "name": "memref.alloca", "summary": "stack memory allocation operation", "description": "The `alloca` operation allocates memory on the stack, to be automatically\n released when control transfers back from the region of its closest\n surrounding operation with an\n [`AutomaticAllocationScope`](../Traits/#automaticallocationscope) trait.\n The amount of memory allocated is specified by its memref and additional\n operands. For example:\n\n ```mlir\n %0 = memref.alloca() : memref<8x64xf32>\n ```\n\n The optional list of dimension operands are bound to the dynamic dimensions\n specified in its memref type. In the example below, the SSA value '%d' is\n bound to the second dimension of the memref (which is dynamic).\n\n ```mlir\n %0 = memref.alloca(%d) : memref<8x?xf32>\n ```\n\n The optional list of symbol operands are bound to the symbols of the\n memref's affine map. In the example below, the SSA value '%s' is bound to\n the symbol 's0' in the affine map specified in the allocs memref type.\n\n ```mlir\n %0 = memref.alloca()[%s] : memref<8x64xf32,\n affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>>\n ```\n\n This operation returns a single SSA value of memref type, which can be used\n by subsequent load and store operations. An optional alignment attribute, if\n specified, guarantees alignment at least to that boundary. If not specified,\n an alignment on any convenient boundary compatible with the type will be\n chosen.", "operands": [ { "name": "dynamicSizes", "type": "Variadic" }, { "name": "symbolOperands", "type": "Variadic" } ], "results": [ { "name": "memref", "type": "AnyMemRef" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(`$dynamicSizes`)` (`` `[` $symbolOperands^ `]`)? attr-dict `:` type($memref)" }, { "name": "memref.alloca_scope", "summary": "explicitly delimited scope for stack allocation", "description": "The `memref.alloca_scope` operation represents an explicitly-delimited\n scope for the alloca allocations. Any `memref.alloca` operations that are\n used within this scope are going to be cleaned up automatically once\n the control-flow exits the nested region. For example:\n\n ```mlir\n memref.alloca_scope {\n %myalloca = memref.alloca(): memref<4x3xf32>\n ...\n }\n ```\n\n Here, `%myalloca` memref is valid within the explicitly delimited scope\n and is automatically deallocated at the end of the given region. Conceptually,\n `memref.alloca_scope` is a passthrough operation with\n `AutomaticAllocationScope` that spans the body of the region within the operation.\n\n `memref.alloca_scope` may also return results that are defined in the nested\n region. To return a value, one should use `memref.alloca_scope.return`\n operation:\n\n ```mlir\n %result = memref.alloca_scope -> f32 {\n %value = arith.constant 1.0 : f32\n ...\n memref.alloca_scope.return %value : f32\n }\n ```\n\n If `memref.alloca_scope` returns no value, the `memref.alloca_scope.return ` can\n be left out, and will be inserted implicitly.", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "memref.alloca_scope.return", "summary": "terminator for alloca_scope operation", "description": "`memref.alloca_scope.return` operation returns zero or more SSA values\n from the region within `memref.alloca_scope`. If no values are returned,\n the return operation may be omitted. Otherwise, it has to be present\n to indicate which values are going to be returned. For example:\n\n ```mlir\n memref.alloca_scope.return %value : f32\n ```", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "memref.assume_alignment", "summary": "assumption that gives alignment information to the input memref", "description": "The `assume_alignment` operation takes a memref and an integer alignment\n value. It returns a new SSA value of the same memref type, but associated\n with the assumption that the underlying buffer is aligned to the given\n alignment.\n\n If the buffer isn't aligned to the given alignment, its result is poison.\n This operation doesn't affect the semantics of a program where the\n alignment assumption holds true. It is intended for optimization purposes,\n allowing the compiler to generate more efficient code based on the\n alignment assumption. The optimization is best-effort.", "operands": [ { "name": "memref", "type": "AnyMemRef" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "alignment", "type": "ConfinedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$memref `,` $alignment attr-dict `:` type($memref)" }, { "name": "memref.atomic_rmw", "summary": "atomic read-modify-write operation", "description": "The `memref.atomic_rmw` operation provides a way to perform a read-modify-write\n sequence that is free from data races. The kind enumeration specifies the\n modification to perform. The value operand represents the new value to be\n applied during the modification. The memref operand represents the buffer\n that the read and write will be performed against, as accessed by the\n specified indices. The arity of the indices is the rank of the memref. The\n result represents the latest value that was stored.\n\n Example:\n\n ```mlir\n %x = memref.atomic_rmw \"addf\" %value, %I[%i] : (f32, memref<10xf32>) -> f32\n ```", "operands": [ { "name": "value", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat]>" }, { "name": "memref", "type": "MemRefOf<[ AnySignlessInteger, AnyFloat ]>" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat]>" } ], "attributes": [ { "name": "kind", "type": "AtomicRMWKindAttr{addf|addi|andi|assign|maximumf|maxnumf|maxs|maxu|minimumf|minnumf|mins|minu|mulf|muli|ori|xori}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" }, { "type": "TypesMatchWith<'memref', 'value', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$kind $value `,` $memref `[` $indices `]` attr-dict `:` `(` type($value) `,`\n type($memref) `)` `->` type($result)" }, { "name": "memref.atomic_yield", "summary": "yield operation for GenericAtomicRMWOp", "description": "\"memref.atomic_yield\" yields an SSA value from a\n GenericAtomicRMWOp region.", "operands": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "memref.cast", "summary": "memref cast operation", "description": "The `memref.cast` operation converts a memref from one type to an equivalent\n type with a compatible shape. The source and destination types are\n compatible if:\n\n a. Both are ranked memref types with the same element type, address space,\n and rank and:\n 1. Both have the same layout or both have compatible strided layouts.\n 2. The individual sizes (resp. offset and strides in the case of strided\n memrefs) may convert constant dimensions to dynamic dimensions and\n vice-versa.\n\n If the cast converts any dimensions from an unknown to a known size, then it\n acts as an assertion that fails at runtime if the dynamic dimensions\n disagree with resultant destination size.\n\n Example:\n\n ```mlir\n // Assert that the input dynamic shape matches the destination static shape.\n %2 = memref.cast %1 : memref to memref<4x4xf32>\n // Erase static shape information, replacing it with dynamic information.\n %3 = memref.cast %1 : memref<4xf32> to memref\n\n // The same holds true for offsets and strides.\n\n // Assert that the input dynamic shape matches the destination static stride.\n %4 = memref.cast %1 : memref<12x4xf32, strided<[?, ?], offset: ?>> to\n memref<12x4xf32, strided<[4, 1], offset: 5>>\n // Erase static offset and stride information, replacing it with\n // dynamic information.\n %5 = memref.cast %1 : memref<12x4xf32, strided<[4, 1], offset: 5>> to\n memref<12x4xf32, strided<[?, ?], offset: ?>>\n ```\n\n b. Either or both memref types are unranked with the same element type, and\n address space.\n\n Example:\n\n ```mlir\n // Cast to concrete shape.\n %4 = memref.cast %1 : memref<*xf32> to memref<4x?xf32>\n\n // Erase rank information.\n %5 = memref.cast %1 : memref<4x?xf32> to memref<*xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "dest", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "memref.collapse_shape", "summary": "operation to produce a memref with a smaller rank.", "description": "The `memref.collapse_shape` op produces a new view with a smaller rank\n whose sizes are a reassociation of the original `view`. The operation is\n limited to such reassociations, where subsequent, contiguous dimensions are\n collapsed into a single dimension. Such reassociations never require\n additional allocs or copies.\n\n Collapsing non-contiguous dimensions is undefined behavior. When a group of\n dimensions can be statically proven to be non-contiguous, collapses of such\n groups are rejected in the verifier on a best-effort basis. In the general\n case, collapses of dynamically-sized dims with dynamic strides cannot be\n proven to be contiguous or non-contiguous due to limitations in the memref\n type.\n\n A reassociation is defined as a continuous grouping of dimensions and is\n represented with an array of DenseI64ArrayAttr attribute.\n\n Note: Only the dimensions within a reassociation group must be contiguous.\n The remaining dimensions may be non-contiguous.\n\n The result memref type can be zero-ranked if the source memref type is\n statically shaped with all dimensions being unit extent. In such a case, the\n reassociation indices must be empty.\n\n Examples:\n\n ```mlir\n // Dimension collapse (i, j) -> i' and k -> k'\n %1 = memref.collapse_shape %0 [[0, 1], [2]] :\n memref into memref\n ```\n\n For simplicity, this op may not be used to cast dynamicity of dimension\n sizes and/or strides. I.e., a result dimension must be dynamic if and only\n if at least one dimension in the corresponding reassociation group is\n dynamic. Similarly, the stride of a result dimension must be dynamic if and\n only if the corresponding start dimension in the source type is dynamic.\n\n Note: This op currently assumes that the inner strides are of the\n source/result layout map are the faster-varying ones.", "operands": [ { "name": "src", "type": "AnyStridedMemRef" } ], "results": [ { "name": "result", "type": "AnyStridedMemRef" } ], "attributes": [ { "name": "reassociation", "type": "TypedArrayAttrBase>" } ], "assemblyFormat": "$src $reassociation attr-dict `:` type($src) `into` type($result)" }, { "name": "memref.copy", "description": "Copies the data from the source to the destination memref.\n\n Usage:\n\n ```mlir\n memref.copy %arg0, %arg1 : memref to memref\n ```\n\n Source and destination are expected to have the same element type and shape.\n Otherwise, the result is undefined. They may have different layouts.", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "target", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$source `,` $target attr-dict `:` type($source) `to` type($target)" }, { "name": "memref.dealloc", "summary": "memory deallocation operation", "description": "The `dealloc` operation frees the region of memory referenced by a memref\n which was originally created by the `alloc` operation.\n The `dealloc` operation should not be called on memrefs which alias an\n alloc'd memref (e.g. memrefs returned by `view` operations).\n\n Example:\n\n ```mlir\n %0 = memref.alloc() : memref<8x64xf32, affine_map<(d0, d1) -> (d0, d1)>, 1>\n memref.dealloc %0 : memref<8x64xf32, affine_map<(d0, d1) -> (d0, d1)>, 1>\n ```", "operands": [ { "name": "memref", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$memref attr-dict `:` type($memref)" }, { "name": "memref.dim", "summary": "dimension index operation", "description": "The `dim` operation takes a memref and a dimension operand of type `index`.\n It returns the size of the requested dimension of the given memref.\n If the dimension index is out of bounds the behavior is undefined.\n\n The specified memref type is that of the first operand.\n\n Example:\n\n ```mlir\n // Always returns 4, can be constant folded:\n %c0 = arith.constant 0 : index\n %x = memref.dim %A, %c0 : memref<4 x ? x f32>\n\n // Returns the dynamic dimension of %A.\n %c1 = arith.constant 1 : index\n %y = memref.dim %A, %c1 : memref<4 x ? x f32>\n\n // Equivalent generic form:\n %x = \"memref.dim\"(%A, %c0) : (memref<4 x ? x f32>, index) -> index\n %y = \"memref.dim\"(%A, %c1) : (memref<4 x ? x f32>, index) -> index\n ```", "operands": [ { "name": "source", "type": "AnyNon0RankedOrUnrankedMemRef" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict $source `,` $index `:` type($source)" }, { "name": "memref.distinct_objects", "summary": "assumption that acesses to specific memrefs will never alias", "description": "The `distinct_objects` operation takes a list of memrefs and returns the same\n memrefs, with the additional assumption that accesses to them will never\n alias with each other. This means that loads and stores to different\n memrefs in the list can be safely reordered.\n\n If the memrefs do alias, the load/store behavior is undefined. This\n operation doesn't affect the semantics of a valid program. It is\n intended for optimization purposes, allowing the compiler to generate more\n efficient code based on the non-aliasing assumption. The optimization is\n best-effort.\n\n Example:\n\n ```mlir\n %1, %2 = memref.distinct_objects %a, %b : memref, memref\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$operands attr-dict `:` type($operands)" }, { "name": "memref.dma_start", "summary": "non-blocking DMA operation that starts a transfer", "description": "Syntax:\n\n ```\n operation ::= `memref.dma_start` ssa-use`[`ssa-use-list`]` `,`\n ssa-use`[`ssa-use-list`]` `,` ssa-use `,`\n ssa-use`[`ssa-use-list`]` (`,` ssa-use `,` ssa-use)?\n `:` memref-type `,` memref-type `,` memref-type\n ```\n\n DmaStartOp starts a non-blocking DMA operation that transfers data from a\n source memref to a destination memref. The source and destination memref\n need not be of the same dimensionality, but need to have the same elemental\n type. The operands include the source and destination memref's each followed\n by its indices, size of the data transfer in terms of the number of elements\n (of the elemental type of the memref), a tag memref with its indices, and\n optionally at the end, a stride and a number_of_elements_per_stride\n arguments. The tag location is used by a DmaWaitOp to check for completion.\n The indices of the source memref, destination memref, and the tag memref\n have the same restrictions as any load/store. The optional stride arguments\n should be of 'index' type, and specify a stride for the slower memory space\n (memory space with a lower memory space id), transferring chunks of\n number_of_elements_per_stride every stride until %num_elements are\n transferred. Either both or no stride arguments should be specified. If the\n source and destination locations overlap the behavior of this operation is\n not defined.\n\n For example, a DmaStartOp operation that transfers 256 elements of a memref\n '%src' in memory space 0 at indices [%i, %j] to memref '%dst' in memory\n space 1 at indices [%k, %l], would be specified as follows:\n\n ```mlir\n %num_elements = arith.constant 256 : index\n %idx = arith.constant 0 : index\n %tag = memref.alloc() : memref<1 x i32, affine_map<(d0) -> (d0)>, 2>\n memref.dma_start %src[%i, %j], %dst[%k, %l], %num_elements, %tag[%idx] :\n memref<40 x 128 x f32, affine_map<(d0, d1) -> (d0, d1)>, 0>,\n memref<2 x 1024 x f32, affine_map<(d0, d1) -> (d0, d1)>, 1>,\n memref<1 x i32, affine_map<(d0) -> (d0)>, 2>\n ```\n\n If %stride and %num_elt_per_stride are specified, the DMA is expected to\n transfer %num_elt_per_stride elements every %stride elements apart from\n memory space 0 until %num_elements are transferred.\n\n ```mlir\n memref.dma_start %src[%i, %j], %dst[%k, %l], %num_elements, %tag[%idx], %stride,\n %num_elt_per_stride :\n ```\n\n * TODO: add additional operands to allow source and destination striding, and\n multiple stride levels.\n * TODO: Consider replacing src/dst memref indices with view memrefs.", "operands": [ { "name": "operands", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "memref.dma_wait", "summary": "blocking DMA operation that waits for transfer completion", "description": "DmaWaitOp blocks until the completion of a DMA operation associated with the\n tag element '%tag[%index]'. %tag is a memref, and %index has to be an index\n with the same restrictions as any load/store index. %num_elements is the\n number of elements associated with the DMA operation.\n\n Example:\n\n ```mlir\n memref.dma_start %src[%i, %j], %dst[%k, %l], %num_elements, %tag[%index] :\n memref<2048 x f32, affine_map<(d0) -> (d0)>, 0>,\n memref<256 x f32, affine_map<(d0) -> (d0)>, 1>,\n memref<1 x i32, affine_map<(d0) -> (d0)>, 2>\n ...\n ...\n dma_wait %tag[%index], %num_elements : memref<1 x i32, affine_map<(d0) -> (d0)>, 2>\n ```", "operands": [ { "name": "tagMemRef", "type": "AnyMemRef" }, { "name": "tagIndices", "type": "Variadic" }, { "name": "numElements", "type": "Index" } ], "assemblyFormat": "$tagMemRef `[` $tagIndices `]` `,` $numElements attr-dict `:` type($tagMemRef)" }, { "name": "memref.expand_shape", "summary": "operation to produce a memref with a higher rank.", "description": "The `memref.expand_shape` op produces a new view with a higher rank whose\n sizes are a reassociation of the original `view`. The operation is limited\n to such reassociations, where a dimension is expanded into one or multiple\n contiguous dimensions. Such reassociations never require additional allocs\n or copies.\n\n A reassociation is defined as a grouping of dimensions and is represented\n with an array of DenseI64ArrayAttr attributes.\n\n Example:\n\n ```mlir\n %r = memref.expand_shape %0 [[0, 1], [2]] output_shape [%sz0, %sz1, 32]\n : memref into memref\n ```\n\n If an op can be statically proven to be invalid (e.g, an expansion from\n `memref<10xf32>` to `memref<2x6xf32>`), it is rejected by the verifier. If\n it cannot statically be proven invalid (e.g., the full example above; it is\n unclear whether the first source dimension is divisible by 5), the op is\n accepted by the verifier. However, if the op is in fact invalid at runtime,\n the behavior is undefined.\n\n The source memref can be zero-ranked. In that case, the reassociation\n indices must be empty and the result shape may only consist of unit\n dimensions.\n\n For simplicity, this op may not be used to cast dynamicity of dimension\n sizes and/or strides. I.e., if and only if a source dimension is dynamic,\n there must be a dynamic result dimension in the corresponding reassociation\n group. Same for strides.\n\n The representation for the output shape supports a partially-static\n specification via attributes specified through the `static_output_shape`\n argument. A special sentinel value `ShapedType::kDynamic` encodes that the\n corresponding entry has a dynamic value. Both the number of SSA inputs in\n `output_shape` and the number of `ShapedType::kDynamic` entries in\n `static_output_shape` match the number of dynamic dimensions in the result\n type.\n\n Note: This op currently assumes that the inner strides are of the\n source/result layout map are the faster-varying ones.", "operands": [ { "name": "src", "type": "AnyStridedMemRef" }, { "name": "output_shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyStridedMemRef" } ], "attributes": [ { "name": "reassociation", "type": "TypedArrayAttrBase>" }, { "name": "static_output_shape", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$src $reassociation `output_shape`\n custom($output_shape, $static_output_shape) attr-dict `:`\n type($src) `into` type($result)" }, { "name": "memref.extract_aligned_pointer_as_index", "summary": "Extracts a memref's underlying aligned pointer as an index", "description": "Extracts the underlying aligned pointer as an index.\n\n This operation is useful for lowering to lower-level dialects while still\n avoiding the need to define a pointer type in higher-level dialects such as\n the memref dialect.\n\n This operation is intended solely as step during lowering, it has no side\n effects. A reverse operation that creates a memref from an index interpreted\n as a pointer is explicitly discouraged.\n\n Example:\n\n ```\n %0 = memref.extract_aligned_pointer_as_index %arg : memref<4x4xf32> -> index\n %1 = arith.index_cast %0 : index to i64\n %2 = llvm.inttoptr %1 : i64 to !llvm.ptr\n call @foo(%2) : (!llvm.ptr) ->()\n ```", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "aligned_pointer", "type": "Index" } ], "assemblyFormat": "$source `:` type($source) `->` type(results) attr-dict" }, { "name": "memref.extract_strided_metadata", "summary": "Extracts a buffer base with offset and strides", "description": "Extracts a base buffer, offset and strides. This op allows additional layers\n of transformations and foldings to be added as lowering progresses from\n higher-level dialect to lower-level dialects such as the LLVM dialect.\n\n The op requires a strided memref source operand. If the source operand is not\n a strided memref, then verification fails.\n\n This operation is also useful for completeness to the existing memref.dim op.\n While accessing strides, offsets and the base pointer independently is not\n available, this is useful for composing with its natural complement op:\n `memref.reinterpret_cast`.\n\n Intended Use Cases:\n\n The main use case is to expose the logic for manipulate memref metadata at a\n higher level than the LLVM dialect.\n This makes lowering more progressive and brings the following benefits:\n - not all users of MLIR want to lower to LLVM and the information to e.g.\n lower to library calls---like libxsmm---or to SPIR-V was not available.\n - foldings and canonicalizations can happen at a higher level in MLIR:\n before this op existed, lowering to LLVM would create large amounts of\n LLVMIR. Even when LLVM does a good job at folding the low-level IR from\n a performance perspective, it is unnecessarily opaque and inefficient to\n send unkempt IR to LLVM.\n\n Example:\n\n ```mlir\n %base, %offset, %sizes:2, %strides:2 =\n memref.extract_strided_metadata %memref : memref<10x?xf32>\n -> memref, index, index, index, index, index\n\n // After folding, the type of %m2 can be memref<10x?xf32> and further\n // folded to %memref.\n %m2 = memref.reinterpret_cast %base to\n offset: [%offset],\n sizes: [%sizes#0, %sizes#1],\n strides: [%strides#0, %strides#1]\n : memref to memref>\n ```", "operands": [ { "name": "source", "type": "AnyStridedMemRef" } ], "results": [ { "name": "base_buffer", "type": "AnyStridedMemRefOfRank<0>" }, { "name": "offset", "type": "Index" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$source `:` type($source) `->` type(results) attr-dict" }, { "name": "memref.generic_atomic_rmw", "summary": "atomic read-modify-write operation with a region", "description": "The `memref.generic_atomic_rmw` operation provides a way to perform a\n read-modify-write sequence that is free from data races. The memref operand\n represents the buffer that the read and write will be performed against, as\n accessed by the specified indices. The arity of the indices is the rank of\n the memref. The result represents the latest value that was stored. The\n region contains the code for the modification itself. The entry block has\n a single argument that represents the value stored in `memref[indices]`\n before the write is performed. No side-effecting ops are allowed in the\n body of `GenericAtomicRMWOp`.\n\n Example:\n\n ```mlir\n %x = memref.generic_atomic_rmw %I[%i] : memref<10xf32> {\n ^bb0(%current_value : f32):\n %c1 = arith.constant 1.0 : f32\n %inc = arith.addf %c1, %current_value : f32\n memref.atomic_yield %inc : f32\n }\n ```", "operands": [ { "name": "memref", "type": "MemRefOf<[ AnySignlessInteger, AnyFloat ]>" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat]>" } ], "regions": [ { "name": "atomic_body", "type": "AnyRegion" } ], "traits": [ { "type": "TypesMatchWith<'memref', 'result', '::llvm::cast($_self).getElementType()'>" } ], "hasCustomAssemblyFormat": true }, { "name": "memref.get_global", "summary": "get the memref pointing to a global variable", "description": "The `memref.get_global` operation retrieves the memref pointing to a\n named global variable. If the global variable is marked constant, writing\n to the result memref (such as through a `memref.store` operation) is\n undefined.\n\n Example:\n\n ```mlir\n %x = memref.get_global @foo : memref<2xf32>\n ```", "results": [ { "name": "result", "type": "AnyStaticShapeMemRef" } ], "attributes": [ { "name": "name", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$name `:` type($result) attr-dict" }, { "name": "memref.global", "summary": "declare or define a global memref variable", "description": "The `memref.global` operation declares or defines a named global memref\n variable. The backing memory for the variable is allocated statically and is\n described by the type of the variable (which should be a statically shaped\n memref type). The operation is a declaration if no `initial_value` is\n specified, else it is a definition. The `initial_value` can either be a unit\n attribute to represent a definition of an uninitialized global variable, or\n an elements attribute to represent the definition of a global variable with\n an initial value. The global variable can also be marked constant using the\n `constant` unit attribute. Writing to such constant global variables is\n undefined.\n\n The global variable can be accessed by using the `memref.get_global` to\n retrieve the memref for the global variable. Note that the memref\n for such global variable itself is immutable (i.e., memref.get_global for a\n given global variable will always return the same memref descriptor).\n\n Example:\n\n ```mlir\n // Private variable with an initial value.\n memref.global \"private\" @x : memref<2xf32> = dense<[0.0, 2.0]>\n\n // Private variable with an initial value and an alignment (power of 2).\n memref.global \"private\" @x : memref<2xf32> = dense<[0.0, 2.0]> {alignment = 64}\n\n // Declaration of an external variable.\n memref.global \"private\" @y : memref<4xi32>\n\n // Uninitialized externally visible variable.\n memref.global @z : memref<3xf16> = uninitialized\n\n // Externally visible constant variable.\n memref.global constant @c : memref<2xi32> = dense<[1, 4]>\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "type", "type": "MemRefTypeAttr" }, { "name": "initial_value", "type": "OptionalAttr" }, { "name": "constant", "type": "UnitAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "($sym_visibility^)?\n (`constant` $constant^)?\n $sym_name `:`\n custom($type, $initial_value)\n attr-dict" }, { "name": "memref.load", "summary": "load operation", "description": "The `load` op reads an element from a memref at the specified indices.\n\n The number of indices must match the rank of the memref. The indices must\n be in-bounds: `0 <= idx < dim_size`.\n\n Lowerings of `memref.load` may emit no-wrap flags on\n `llvm.getelementptr` when converting to LLVM. The `inbounds` flag is\n always emitted (valid since indices are guaranteed in-bounds) and causes\n undefined behavior if that precondition is violated. The `nuw` flag is\n emitted only when all strides of the memref are statically non-negative;\n with negative strides, `nuw` would propagate to intermediate `mul`\n operations and cause unsigned overflow (poison) even for in-bounds\n indices.\n\n The single result of `memref.load` is a value with the same type as the\n element type of the memref.\n\n A set `nontemporal` attribute indicates that this load is not expected to\n be reused in the cache. For details, refer to the\n [LLVM load instruction](https://llvm.org/docs/LangRef.html#load-instruction).\n\n A set `invariant` attribute indicates that the referenced memory location\n contains the same value at all points in the program where it is\n dereferenceable, so the load may be treated as invariant. For details, refer\n to the\n [LLVM load instruction](https://llvm.org/docs/LangRef.html#load-instruction).\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n load operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violations may lead to\n architecture-specific faults or performance penalties.\n A value of 0 indicates no specific alignment requirement.\n Example:\n\n ```mlir\n %0 = memref.load %A[%a, %b] : memref<8x?xi32, #layout, memspace0>\n ```", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "nontemporal", "type": "DefaultValuedOptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" }, { "name": "invariant", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "TypesMatchWith<'memref', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$memref `[` $indices `]` attr-dict `:` type($memref)" }, { "name": "memref.memory_space_cast", "summary": "memref memory space cast operation", "description": "This operation casts memref values between memory spaces.\n The input and result will be memrefs of the same types and shape that alias\n the same underlying memory, though, for some casts on some targets,\n the underlying values of the pointer stored in the memref may be affected\n by the cast.\n\n The input and result must have the same shape, element type, rank, and layout.\n\n If the source and target address spaces are the same, this operation is a noop.\n\n Finally, if the target memory-space is the generic/default memory-space,\n then it is assumed this cast can be bubbled down safely. See the docs of\n `MemorySpaceCastOpInterface` interface for more details.\n\n Example:\n\n ```mlir\n // Cast a GPU private memory attribution into a generic pointer\n %2 = memref.memory_space_cast %1 : memref to memref\n // Cast a generic pointer to workgroup-local memory\n %4 = memref.memory_space_cast %3 : memref<5x4xi32> to memref<5x34xi32, 3>\n // Cast between two non-default memory spaces\n %6 = memref.memory_space_cast %5\n : memref<*xmemref, 5> to memref<*xmemref, 3>\n ```", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "dest", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "memref.prefetch", "summary": "prefetch operation", "description": "The \"prefetch\" op prefetches data from a memref location described with\n subscript indices similar to memref.load, and with three attributes: a\n read/write specifier, a locality hint, and a cache type specifier as shown\n below:\n\n ```mlir\n memref.prefetch %0[%i, %j], read, locality<3>, data : memref<400x400xi32>\n ```\n\n The read/write specifier is either 'read' or 'write', the locality hint\n ranges from locality<0> (no locality) to locality<3> (extremely local keep\n in cache). The cache type specifier is either 'data' or 'instr'\n and specifies whether the prefetch is performed on data cache or on\n instruction cache.", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "isWrite", "type": "BoolAttr" }, { "name": "localityHint", "type": "ConfinedAttr, IntMaxValue<3>]>" }, { "name": "isDataCache", "type": "BoolAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "memref.rank", "summary": "rank operation", "description": "The `memref.rank` operation takes a memref operand and returns its rank.\n\n Example:\n\n ```mlir\n %0 = memref.rank %arg0 : memref<*xf32>\n %1 = memref.rank %arg1 : memref\n ```", "operands": [ { "name": "memref", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$memref attr-dict `:` type($memref)" }, { "name": "memref.realloc", "summary": "memory reallocation operation", "description": "The `realloc` operation changes the size of a memory region. The memory\n region is specified by a 1D source memref and the size of the new memory\n region is specified by a 1D result memref type and an optional dynamic Value\n of `Index` type. The source and the result memref must be in the same memory\n space and have the same element type.\n\n The operation may move the memory region to a new location. In this case,\n the content of the memory block is preserved up to the lesser of the new\n and old sizes. If the new size if larger, the value of the extended memory\n is undefined. This is consistent with the ISO C realloc.\n\n The operation returns an SSA value for the memref.\n\n Example:\n\n ```mlir\n %0 = memref.realloc %src : memref<64xf32> to memref<124xf32>\n ```\n\n The source memref may have a dynamic shape, in which case, the compiler will\n generate code to extract its size from the runtime data structure for the\n memref.\n\n ```mlir\n %1 = memref.realloc %src : memref to memref<124xf32>\n ```\n\n If the result memref has a dynamic shape, a result dimension operand is\n needed to spefify its dynamic dimension. In the example below, the ssa value\n '%d' specifies the unknown dimension of the result memref.\n\n ```mlir\n %2 = memref.realloc %src(%d) : memref to memref\n ```\n\n An optional `alignment` attribute may be specified to ensure that the\n region of memory that will be indexed is aligned at the specified byte\n boundary. This is consistent with the fact that memref.alloc supports such\n an optional alignment attribute. Note that in ISO C standard, neither alloc\n nor realloc supports alignment, though there is aligned_alloc but not\n aligned_realloc.\n\n ```mlir\n %3 = memref.realloc %src {alignment = 8} : memref<64xf32> to memref<124xf32>\n ```\n\n Referencing the memref through the old SSA value after realloc is undefined\n behavior.\n\n ```mlir\n %new = memref.realloc %old : memref<64xf32> to memref<124xf32>\n %4 = memref.load %new[%index] : memref<124xf32> // ok\n %5 = memref.load %old[%index] : memref<64xf32> // undefined behavior\n ```", "operands": [ { "name": "source", "type": "MemRefRankOf<[ AnyType ], [ 1 ]>" }, { "name": "dynamicResultSize", "type": "Optional" } ], "results": [ { "name": "result", "type": "MemRefRankOf<[ AnyType ], [ 1 ]>" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$source (`(` $dynamicResultSize^ `)`)? attr-dict\n `:` type($source) `to` type(results)" }, { "name": "memref.reinterpret_cast", "summary": "memref reinterpret cast operation", "description": "Modify offset, sizes and strides of an unranked/ranked memref.\n\n Example 1:\n\n Consecutive `reinterpret_cast` operations on memref's with static\n dimensions.\n\n We distinguish between *underlying memory* — the sequence of elements as\n they appear in the contiguous memory of the memref — and the\n *strided memref*, which refers to the underlying memory interpreted\n according to specified offsets, sizes, and strides.\n\n ```mlir\n %result1 = memref.reinterpret_cast %arg0 to\n offset: [9],\n sizes: [4, 4],\n strides: [16, 2]\n : memref<8x8xf32, strided<[8, 1], offset: 0>> to\n memref<4x4xf32, strided<[16, 2], offset: 9>>\n\n %result2 = memref.reinterpret_cast %result1 to\n offset: [0],\n sizes: [2, 2],\n strides: [4, 2]\n : memref<4x4xf32, strided<[16, 2], offset: 9>> to\n memref<2x2xf32, strided<[4, 2], offset: 0>>\n ```\n\n The underlying memory of `%arg0` consists of a linear sequence of integers\n from 1 to 64. Its memref has the following 8x8 elements:\n\n ```mlir\n [[1, 2, 3, 4, 5, 6, 7, 8],\n [9, 10, 11, 12, 13, 14, 15, 16],\n [17, 18, 19, 20, 21, 22, 23, 24],\n [25, 26, 27, 28, 29, 30, 31, 32],\n [33, 34, 35, 36, 37, 38, 39, 40],\n [41, 42, 43, 44, 45, 46, 47, 48],\n [49, 50, 51, 52, 53, 54, 55, 56],\n [57, 58, 59, 60, 61, 62, 63, 64]]\n ```\n\n Following the first `reinterpret_cast`, the strided memref elements\n of `%result1` are:\n\n ```mlir\n [[10, 12, 14, 16],\n [26, 28, 30, 32],\n [42, 44, 46, 48],\n [58, 60, 62, 64]]\n ```\n\n Note: The offset and strides are relative to the underlying memory of\n `%arg0`.\n\n The second `reinterpret_cast` results in the following strided memref\n for `%result2`:\n\n ```mlir\n [[1, 3],\n [5, 7]]\n ```\n\n Notice that it does not matter if you use %result1 or %arg0 as a source\n for the second `reinterpret_cast` operation. Only the underlying memory\n pointers will be reused.\n\n The offset and stride are relative to the base underlying memory of the\n memref, starting at 1, not at 10 as seen in the output of `%result1`.\n This behavior contrasts with the `subview` operator, where values are\n relative to the strided memref (refer to `subview` examples).\n Consequently, the second `reinterpret_cast` behaves as if `%arg0` were\n passed directly as its argument.\n\n Example 2:\n ```mlir\n memref.reinterpret_cast %ranked to\n offset: [0],\n sizes: [%size0, 10],\n strides: [1, %stride1]\n : memref to memref>\n\n memref.reinterpret_cast %unranked to\n offset: [%offset],\n sizes: [%size0, %size1],\n strides: [%stride0, %stride1]\n : memref<*xf32> to memref>\n ```\n\n This operation creates a new memref descriptor using the base of the\n source and applying the input arguments to the other metadata.\n In other words:\n ```mlir\n %dst = memref.reinterpret_cast %src to\n offset: [%offset],\n sizes: [%sizes],\n strides: [%strides] :\n memref<*xf32> to memref>\n ```\n means that `%dst`'s descriptor will be:\n ```mlir\n %dst.base = %src.base\n %dst.aligned = %src.aligned\n %dst.offset = %offset\n %dst.sizes = %sizes\n %dst.strides = %strides\n ```", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyStridedMemRef" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `to` `offset` `` `:`\n custom($offsets, $static_offsets)\n `` `,` `sizes` `` `:`\n custom($sizes, $static_sizes)\n `` `,` `strides` `` `:`\n custom($strides, $static_strides)\n attr-dict `:` type($source) `to` type($result)" }, { "name": "memref.reshape", "category": "Shape", "summary": "memref reshape operation", "description": "The `reshape` operation converts a memref from one type to an\n equivalent type with a provided shape. The data is never copied or\n modified. The source and destination types are compatible if both have the\n same element type, same number of elements, address space and identity\n layout map. The following combinations are possible:\n\n a. Source type is ranked or unranked. Shape argument has static size.\n Result type is ranked.\n\n ```mlir\n // Reshape statically-shaped memref.\n %dst = memref.reshape %src(%shape)\n : (memref<4x1xf32>, memref<1xi32>) -> memref<4xf32>\n %dst0 = memref.reshape %src(%shape0)\n : (memref<4x1xf32>, memref<2xi32>) -> memref<2x2xf32>\n // Flatten unranked memref.\n %dst = memref.reshape %src(%shape)\n : (memref<*xf32>, memref<1xi32>) -> memref\n ```\n\n b. Source type is ranked or unranked. Shape argument has dynamic size.\n Result type is unranked.\n\n ```mlir\n // Reshape dynamically-shaped 1D memref.\n %dst = memref.reshape %src(%shape)\n : (memref, memref) -> memref<*xf32>\n // Reshape unranked memref.\n %dst = memref.reshape %src(%shape)\n : (memref<*xf32>, memref) -> memref<*xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "shape", "type": "MemRefRankOf<[ AnySignlessInteger, Index ], [ 1 ]>" } ], "results": [ { "name": "result", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$source `(` $shape `)` attr-dict `:` functional-type(operands, results)" }, { "name": "memref.store", "summary": "store operation", "description": "The `store` op stores an element into a memref at the specified indices.\n\n The number of indices must match the rank of the memref. The indices must\n be in-bounds: `0 <= idx < dim_size`.\n\n Lowerings of `memref.store` may emit no-wrap flags on\n `llvm.getelementptr` when converting to LLVM. The `inbounds` flag is\n always emitted (valid since indices are guaranteed in-bounds) and causes\n undefined behavior if that precondition is violated. The `nuw` flag is\n emitted only when all strides of the memref are statically non-negative;\n with negative strides, `nuw` would propagate to intermediate `mul`\n operations and cause unsigned overflow (poison) even for in-bounds\n indices.\n\n A set `nontemporal` attribute indicates that this store is not expected to\n be reused in the cache. For details, refer to the\n [LLVM store instruction](https://llvm.org/docs/LangRef.html#store-instruction).\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n store operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violations may lead to\n architecture-specific faults or performance penalties.\n A value of 0 indicates no specific alignment requirement.\n Example:\n\n ```mlir\n memref.store %val, %A[%a, %b] : memref<8x?xi32, #layout, memspace0>\n ```", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "nontemporal", "type": "DefaultValuedOptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "traits": [ { "type": "TypesMatchWith<'memref', 'value', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$value `,` $memref `[` $indices `]` attr-dict `:` type($memref)" }, { "name": "memref.subview", "summary": "memref subview operation", "description": "The `subview` operation converts a memref type to a memref type which\n represents a reduced-size view of the original memref as specified by the\n operation's offsets, sizes and strides arguments.\n\n The `subview` operation supports the following arguments:\n\n * source: the \"base\" memref on which to create a \"view\" memref.\n * offsets: memref-rank number of offsets into the \"base\" memref at which to\n create the \"view\" memref.\n * sizes: memref-rank number of sizes which specify the sizes of the result\n \"view\" memref type.\n * strides: memref-rank number of strides that compose multiplicatively with\n the base memref strides in each dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value `ShapedType::kDynamic` encodes that the corresponding entry\n has a dynamic value.\n\n A `subview` operation may additionally reduce the rank of the resulting\n view by removing dimensions that are statically known to be of size 1.\n\n In the absence of rank reductions, the resulting memref type is computed\n as follows:\n ```\n result_sizes[i] = size_operands[i]\n result_strides[i] = src_strides[i] * stride_operands[i]\n result_offset = src_offset + dot_product(offset_operands, src_strides)\n ```\n\n The offset, size and stride operands must be in-bounds with respect to the\n source memref. When possible, the static operation verifier will detect\n out-of-bounds subviews. Subviews that cannot be confirmed to be in-bounds\n or out-of-bounds based on compile-time information are valid. However,\n performing an out-of-bounds subview at runtime is undefined behavior.\n\n Example 1:\n\n Consecutive `subview` operations on memref's with static dimensions.\n\n We distinguish between *underlying memory* — the sequence of elements as\n they appear in the contiguous memory of the memref — and the\n *strided memref*, which refers to the underlying memory interpreted\n according to specified offsets, sizes, and strides.\n\n ```mlir\n %result1 = memref.subview %arg0[1, 1][4, 4][2, 2]\n : memref<8x8xf32, strided<[8, 1], offset: 0>> to\n memref<4x4xf32, strided<[16, 2], offset: 9>>\n\n %result2 = memref.subview %result1[1, 1][2, 2][2, 2]\n : memref<4x4xf32, strided<[16, 2], offset: 9>> to\n memref<2x2xf32, strided<[32, 4], offset: 27>>\n ```\n\n The underlying memory of `%arg0` consists of a linear sequence of integers\n from 1 to 64. Its memref has the following 8x8 elements:\n\n ```mlir\n [[1, 2, 3, 4, 5, 6, 7, 8],\n [9, 10, 11, 12, 13, 14, 15, 16],\n [17, 18, 19, 20, 21, 22, 23, 24],\n [25, 26, 27, 28, 29, 30, 31, 32],\n [33, 34, 35, 36, 37, 38, 39, 40],\n [41, 42, 43, 44, 45, 46, 47, 48],\n [49, 50, 51, 52, 53, 54, 55, 56],\n [57, 58, 59, 60, 61, 62, 63, 64]]\n ```\n\n Following the first `subview`, the strided memref elements of `%result1`\n are:\n\n ```mlir\n [[10, 12, 14, 16],\n [26, 28, 30, 32],\n [42, 44, 46, 48],\n [58, 60, 62, 64]]\n ```\n\n Note: The offset and strides are relative to the strided memref of `%arg0`\n (compare to the corresponding `reinterpret_cast` example).\n\n The second `subview` results in the following strided memref for\n `%result2`:\n\n ```mlir\n [[28, 32],\n [60, 64]]\n ```\n\n Unlike the `reinterpret_cast`, the values are relative to the strided\n memref of the input (`%result1` in this case) and not its\n underlying memory.\n\n Example 2:\n\n ```mlir\n // Subview of static memref with strided layout at static offsets, sizes\n // and strides.\n %1 = memref.subview %0[4, 2][8, 2][3, 2]\n : memref<64x4xf32, strided<[7, 9], offset: 91>> to\n memref<8x2xf32, strided<[21, 18], offset: 137>>\n ```\n\n Example 3:\n\n ```mlir\n // Subview of static memref with identity layout at dynamic offsets, sizes\n // and strides.\n %1 = memref.subview %0[%off0, %off1][%sz0, %sz1][%str0, %str1]\n : memref<64x4xf32> to memref>\n ```\n\n Example 4:\n\n ```mlir\n // Subview of dynamic memref with strided layout at dynamic offsets and\n // strides, but static sizes.\n %1 = memref.subview %0[%off0, %off1][4, 4][%str0, %str1]\n : memref> to\n memref<4x4xf32, strided<[?, ?], offset: ?>>\n ```\n\n Example 5:\n\n ```mlir\n // Rank-reducing subviews.\n %1 = memref.subview %0[0, 0, 0][1, 16, 4][1, 1, 1]\n : memref<8x16x4xf32> to memref<16x4xf32>\n %3 = memref.subview %2[3, 4, 2][1, 6, 3][1, 1, 1]\n : memref<8x16x4xf32> to memref<6x3xf32, strided<[4, 1], offset: 210>>\n ```\n\n Example 6:\n\n ```mlir\n // Identity subview. The subview is the full source memref.\n %1 = memref.subview %0[0, 0, 0] [8, 16, 4] [1, 1, 1]\n : memref<8x16x4xf32> to memref<8x16x4xf32>\n ```", "operands": [ { "name": "source", "type": "AnyMemRef" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `to` type($result)" }, { "name": "memref.tensor_load", "hasCustomAssemblyFormat": 1 }, { "name": "memref.transpose", "category": "Transform", "summary": "`transpose` produces a new strided memref (metadata-only)", "description": "The `transpose` op produces a strided memref whose sizes and strides\n are a permutation of the original `in` memref. This is purely a metadata\n transformation.\n\n Example:\n\n ```mlir\n %1 = memref.transpose %0 (i, j) -> (j, i) : memref to memref (d1 * s0 + d0)>>\n ```", "operands": [ { "name": "in", "type": "AnyStridedMemRef" } ], "results": [ { "name": "result", "type": "AnyStridedMemRef" } ], "attributes": [ { "name": "permutation", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "memref.view", "summary": "memref view operation", "description": "The \"view\" operation extracts an N-D contiguous memref with empty layout map\n with arbitrary element type from a 1-D contiguous memref with empty layout\n map of i8 element type. The ViewOp supports the following arguments:\n\n * A single dynamic byte-shift operand must be specified which represents a\n a shift of the base 1-D memref pointer from which to create the resulting\n contiguous memref view with identity layout.\n * A dynamic size operand that must be specified for each dynamic dimension\n in the resulting view memref type.\n\n The \"view\" operation gives a structured indexing form to a flat 1-D buffer.\n Unlike \"subview\" it can perform a type change. The type change behavior\n requires the op to have special semantics because, e.g. a byte shift of 3\n cannot be represented as an offset on f64.\n For now, a \"view\" op:\n\n 1. Only takes a contiguous source memref with 0 offset and empty layout.\n 2. Must specify a byte_shift operand (in the future, a special integer\n attribute may be added to support the folded case).\n 3. Returns a contiguous memref with 0 offset and empty layout.\n\n Example:\n\n ```mlir\n // Allocate a flat 1D/i8 memref.\n %0 = memref.alloc() : memref<2048xi8>\n\n // ViewOp with dynamic offset and static sizes.\n %1 = memref.view %0[%offset_1024][] : memref<2048xi8> to memref<64x4xf32>\n\n // ViewOp with dynamic offset and two dynamic size.\n %2 = memref.view %0[%offset_1024][%size0, %size1] :\n memref<2048xi8> to memref\n ```", "operands": [ { "name": "source", "type": "MemRefRankOf<[I8], [1]>" }, { "name": "byte_shift", "type": "Index" }, { "name": "sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "$source `[` $byte_shift `]` `` `[` $sizes `]` attr-dict\n `:` type($source) `to` type(results)" }, { "name": "mhlo.abs", "summary": "Abs operation", "description": "Performs element-wise abs operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#abs\n\n Example:\n ```mlir\n %result = mhlo.abs %operand : tensor<3xi32>\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[ MHLO_SInt, MHLO_Float, MHLO_Complex, MHLO_QuantizedInt ]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[ MHLO_SInt, MHLO_Float, MHLO_QuantizedInt ]>" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.acos", "summary": "Acos operation", "description": "Performs element-wise acos operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.acos %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.acosh", "summary": "Acosh operation", "description": "Performs element-wise acosh operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.acosh %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.add", "summary": "Add operation", "description": "Performs element-wise addition of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#add\n\n Example:\n ```mlir\n %result = mhlo.add %lhs, %rhs : tensor<2x2xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.add_dependency", "summary": "AddDependency operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation two operands: a data operand and a token. The\n output of the operation is the data operand. When used with AfterAll this\n operation enables ordering non-side-effecting operations (those that do not\n produce token values).\n\n Example:\n ```mlir\n %1 = mhlo.add_dependency %arg0, %0 : (tensor<3x4xf32>, !mhlo.token) -> tensor<3x4xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_TensorOrAnyToken" }, { "name": "token", "type": "MHLO_AnyToken" } ], "results": [ { "name": "output", "type": "MHLO_TensorOrAnyToken" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.after_all", "summary": "AfterAll operation", "description": "Ensures that the operations producing the `inputs` are executed before any\n operations that depend on `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#after_all\n\n Example:\n ```mlir\n %result = mhlo.after_all %input0, %input1 : !mhlo.token\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_Token" } ], "assemblyFormat": "$inputs attr-dict\n `:` custom(ref($inputs), type($inputs), type($result))" }, { "name": "mhlo.all_gather", "summary": "AllGather operation", "description": "Within each process group in the process grid, concatenates the values of the\n operand tensor from each process along `all_gather_dim` and produces a\n result tensor. The `computation` is applied separately for each operand in\n `operands`, producing one result per operand.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_gather\n\n Example:\n ```mlir\n %result = \"mhlo.all_gather\"(%operand) {\n all_gather_dim = 1 : i64,\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>\n // channel_id = 0\n channel_handle = #mhlo.channel_handle,\n // use_global_device_ids = false\n } : (tensor<2x2xf32>) -> tensor<2x4xf32>\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "all_gather_dim", "type": "ConfinedAttr" }, { "name": "replica_groups", "type": "MHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" }, { "name": "use_global_device_ids", "type": "UnitAttr" } ] }, { "name": "mhlo.all_reduce", "summary": "AllReduce operation", "description": "Within each process group in the process grid, applies a reduction function\n `computation` to the values of an operand tensor from each process and\n produces a result tensor. The `computation` is applied separately for each\n operand in `operands`, producing one result per operand.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_reduce\n\n Example:\n ```mlir\n %result = \"mhlo.all_reduce\"(%operand) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = mhlo.add %arg1, %arg2 : tensor\n mhlo.return %0 : tensor\n }) {\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>\n // channel_id = 0\n channel_handle = #mhlo.channel_handle\n // use_global_device_ids = false\n } : (tensor<4xf32>) -> tensor<4xf32>\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "replica_groups", "type": "MHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" }, { "name": "use_global_device_ids", "type": "UnitAttr" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.all_to_all", "summary": "AllToAll operation", "description": "Within each process group in the process grid, splits the values of the\n `operand` tensor along `split_dimension` into parts, scatters the split parts\n between the processes, concatenates the scattered parts along `concat_dimension`\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_to_all\n\n Example:\n ```mlir\n %result = \"mhlo.all_to_all\"(%operand) {\n split_dimension = 1 : i64,\n concat_dimension = 0 : i64,\n split_count = 2 : i64,\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>\n } : (tensor<2x4xf32>) -> tensor<4x2xf32>\n ```", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "split_dimension", "type": "OptionalAttr>" }, { "name": "concat_dimension", "type": "OptionalAttr>" }, { "name": "split_count", "type": "OptionalAttr>" }, { "name": "replica_groups", "type": "MHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" } ] }, { "name": "mhlo.and", "summary": "And operation", "description": "Performs element-wise AND of two tensors `lhs` and `rhs` and produces a\n `result` tensor\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#and\n\n Example:\n ```mlir\n %result = mhlo.and %lhs, %rhs : tensor<2x2xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_PredOrIntTensor" }, { "name": "rhs", "type": "MHLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.asin", "summary": "Asin operation", "description": "Performs element-wise asin operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.asin %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.asinh", "summary": "Asinh operation", "description": "Performs element-wise asinh operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.asinh %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.async_done", "summary": "AsyncDone operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation blocks until the end of an asynchronous computation.\n It returns the final result of the asynchronous computation.\n\n See the documentation for AsyncStart for more information.", "operands": [ { "name": "bundle", "type": "MHLO_AsyncBundle" } ], "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "mhlo.async_start", "summary": "AsyncStart operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation kicks off an asynchronous computation.\n\n This is used when there are functions that contain both asynchronous waits\n (such as DMAs) and on-thread computation. For example, a function might\n consist of a computation, a DMA, another computation, a second DMA, and a\n final computation. This would be represented as an async_start followed by\n and async_update and an async_done. The async_start would do the first\n computation on-thread and then start the DMA. The async_update would wait\n for the DMA to complete if it wasn't yet done, then execute the second\n computation in the function, and start the second DMA. Finally, the\n async_done would wait on this last DMA, and then run the last computation\n that needs to be run on-thread and return the result of that final\n computation.\n\n `operands` are passed to the computation directly\n `called_computation` is the function that will be run asynchronously\n `execution_thread` is the name of the thread in which it will be run. The main\n thread is called \"main\". All threads have names.\n\n This returns all the state needed between async ops. After buffer\n assignment, the return values represents the space needed to hold the input,\n results, and any scratchpads needed or edited by the async op.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_AsyncBundle" } ], "attributes": [ { "name": "called_computation", "type": "FlatSymbolRefAttr" }, { "name": "execution_thread", "type": "StrAttr" } ] }, { "name": "mhlo.async_update", "summary": "AsyncUpdate operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation blocks on an asynchronous computation until a\n sync barrier. This returns `bundle` after operating on it.\n\n See the documentation for AsyncStart for more information.", "operands": [ { "name": "bundle", "type": "MHLO_AsyncBundle" } ], "results": [ { "name": "result", "type": "MHLO_AsyncBundle" } ] }, { "name": "mhlo.atan2", "summary": "Atan2 operation", "description": "Performs element-wise atan2 operation on `lhs` and `rhs` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#atan2\n\n Example:\n ```mlir\n %result = mhlo.atan2 %lhs, %rhs : tensor<3xf32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_FpComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.atanh", "summary": "Atanh operation", "description": "Performs element-wise atanh operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.atanh %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.batch_norm_grad", "summary": "BatchNormGrad operation", "description": "Computes gradients of several inputs of BatchNormTrainingOp backpropagating\n from `grad_output`, and produces `grad_operand`, `grad_scale` and\n `grad_offset` tensors.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#batch_norm_grad\n\n Example:\n ```mlir\n %grad_operand, %grad_scale, %grad_offset =\n \"mhlo.batch_norm_grad\"(%operand, %scale, %mean, %variance, %grad_output) {\n epsilon = 0.0 : f32,\n feature_index = 2 : i64\n } : (tensor<2x2x2xf32>, tensor<2xf32>, tensor<2xf32>, tensor<2xf32>,\n tensor<2x2x2xf32>) -> (tensor<2x2x2xf32>, tensor<2xf32>, tensor<2xf32>)\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" }, { "name": "scale", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "mean", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "variance", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "grad_output", "type": "MHLO_FpTensor" } ], "results": [ { "name": "grad_operand", "type": "MHLO_FpTensor" }, { "name": "grad_scale", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "grad_offset", "type": "1DTensorOf<[MHLO_Float]>" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "feature_index", "type": "ConfinedAttr" } ] }, { "name": "mhlo.batch_norm_inference", "summary": "BatchNormInference operation", "description": "Normalizes the `operand` tensor across all dimensions except for the\n `feature_index` dimension and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#batch_norm_inference\n\n Example:\n ```mlir\n %result = \"mhlo.batch_norm_inference\"(%operand, %scale, %offset, %mean, %variance) {\n epsilon = 0.0 : f32,\n feature_index = 2 : i64\n } : (tensor<2x2x2xf32>, tensor<2xf32>, tensor<2xf32>, tensor<2xf32>, tensor<2xf32>) -> tensor<2x2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" }, { "name": "scale", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "offset", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "mean", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "variance", "type": "1DTensorOf<[MHLO_Float]>" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "feature_index", "type": "ConfinedAttr" } ] }, { "name": "mhlo.batch_norm_training", "summary": "BatchNormTraining operation", "description": "Computes mean and variance across batch and spatial dimensions and\n normalizes the `operand` tensor, for each feature in the `feature_index`\n dimension and produces `output`, `batch_mean` and `batch_var` tensors.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#batch_norm_training\n\n Example:\n ```mlir\n %output, %batch_mean, %batch_var = \"mhlo.batch_norm_training\"(%operand, %scale, %offset) {\n epsilon = 0.0 : f32,\n feature_index = 2 : i64\n } : (tensor<2x2x2xf32>, tensor<2xf32>, tensor<2xf32>) -> (tensor<2x2x2xf32>, tensor<2xf32>, tensor<2xf32>)\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" }, { "name": "scale", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "offset", "type": "1DTensorOf<[MHLO_Float]>" } ], "results": [ { "name": "output", "type": "MHLO_FpTensor" }, { "name": "batch_mean", "type": "1DTensorOf<[MHLO_Float]>" }, { "name": "batch_var", "type": "1DTensorOf<[MHLO_Float]>" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "feature_index", "type": "ConfinedAttr" } ] }, { "name": "mhlo.bitcast", "summary": "Bitcast operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation changes the shape of the input in the way that\n the physical arrangement of elements are unchanged.\n\n This operation needs layout information to make sense of \"physical\n arrangement of elements\", and layout support in MHLO is currently a work\n in progress.\n\n Example:\n ```mlir\n %0 = mhlo.bitcast %arg0 : (tensor<3x4xf32>) -> tensor<3x4x1xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.bitcast_convert", "summary": "BitcastConvert operation", "description": "Performs a bitcast operation on `operand` tensor and produces a `result`\n tensor where the bits of the entire `operand` tensor are reinterpreted using\n the type of the `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#bitcast_convert\n\n Example:\n ```mlir\n %result = mhlo.bitcast_convert %operand : (tensor<2xf32>) -> tensor<2x4xi8>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.broadcast", "summary": "Broadcast operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as XLA's Broadcast:\n https://www.tensorflow.org/xla/operation_semantics#broadcast\n\n Example:\n ```mlir\n %result = mhlo.broadcast %operand, sizes = [1, 2] : (tensor<3xi32>) -> tensor<1x2x3xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "broadcast_sizes", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.broadcast_in_dim", "summary": "BroadcastInDim operation", "description": "Expands the dimensions and/or rank of an input tensor by duplicating the\n data in the `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#broadcast_in_dim\n\n Example:\n ```mlir\n %result = mhlo.broadcast_in_dim %operand, dims = [2, 1] : (tensor<1x3xi32>) -> tensor<2x3x2xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_StaticShapeOrBoundedDimTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "MHLO_BroadcastDimAttr" } ] }, { "name": "mhlo.case", "summary": "Case operation", "description": "Produces the output from executing exactly one `function` from `branches`\n depending on the value of `index`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#case\n\n Example:\n ```mlir\n %result0, %result1 = \"mhlo.case\"(%index) ({\n mhlo.return %result_branch0, %result_branch0 : tensor<2xi64>, tensor<2xi64>\n }, {\n mhlo.return %result_branch1, %result_branch1 : tensor<2xi64>, tensor<2xi64>\n }) : (tensor) -> (tensor<2xi64>, tensor<2xi64>)\n ```", "operands": [ { "name": "index", "type": "I32Tensor" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "branches", "type": "VariadicRegion>" } ] }, { "name": "mhlo.cbrt", "summary": "Cbrt operation", "description": "Performs element-wise cubic root operation on `operand` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cbrt\n\n Example:\n ```mlir\n %result = mhlo.cbrt %operand : tensor<4xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.ceil", "summary": "Ceil operation", "description": "Performs element-wise ceil of `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#ceil\n\n Example:\n ```mlir\n %result = mhlo.ceil %operand : tensor<5xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.cholesky", "summary": "Cholesky operation", "description": "Computes the Cholesky decomposition of a batch of matrices.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cholesky\n\n Example:\n ```mlir\n %result = mhlo.cholesky %a, lower = true : tensor<3x3xf32>\n ```", "operands": [ { "name": "a", "type": "MHLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpOrComplexTensor" } ], "attributes": [ { "name": "lower", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "mhlo.clamp", "summary": "Clamp operation", "description": "Clamps every element of the `operand` tensor between a minimum and maximum\n value and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#clamp\n\n Example:\n ```mlir\n %result = mhlo.clamp %min, %operand, %max : tensor<3xi32>\n ```", "operands": [ { "name": "min", "type": "MHLO_Tensor" }, { "name": "operand", "type": "MHLO_Tensor" }, { "name": "max", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$min `,` $operand `,` $max attr-dict\n `:` custom(type($min), type($operand), type($max), type($result))" }, { "name": "mhlo.collective_broadcast", "summary": "CollectiveBroadcast operation", "description": "Within each process group in the process grid, send the value of the\n `operand` tensor from the source process to the target processes and produce a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#collective_broadcast\n\n Example:\n ```mlir\n %result = \"mhlo.collective_broadcast\"(%operand) {\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>,\n channel_handle = #mhlo.channel_handle\n } : (tensor<1x2xi64>) -> tensor<1x2xi64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "replica_groups", "type": "MHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" } ] }, { "name": "mhlo.collective_permute", "summary": "CollectivePermute operation", "description": "Within each process group in the process grid, sends the value of the\n `operand` tensor from the source process to the target process and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#collective_permute\n\n Example:\n ```mlir\n %result = \"mhlo.collective_permute\"(%operand) {\n source_target_pairs = dense<[[0, 1], [1, 2]]> : tensor<2x2xi64>,\n // channel_id = 0\n channel_handle = #mhlo.channel_handle\n } : (tensor<4x2xf32>) -> tensor<4x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "source_target_pairs", "type": "I64ElementsAttr" }, { "name": "channel_handle", "type": "OptionalAttr" } ] }, { "name": "mhlo.compare", "summary": "Compare operation", "description": "Performs element-wise comparison of `lhs` and `rhs` tensors according to\n `comparison_direction` and `compare_type`, and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#compare\n\n Example:\n ```mlir\n %result = mhlo.compare LT, %lhs, %rhs, FLOAT : (tensor<2xf32>, tensor<2xf32>) -> tensor<2xi1>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_PredTensor" } ], "attributes": [ { "name": "comparison_direction", "type": "MHLO_ComparisonDirectionAttr{EQ|NE|GE|GT|LE|LT}" }, { "name": "compare_type", "type": "OptionalAttr" } ], "assemblyFormat": "$comparison_direction `,` $lhs `,` $rhs (`,` $compare_type^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.complex", "summary": "Complex operation", "description": "Performs element-wise conversion to a complex value from a pair of real and\n imaginary values, `lhs` and `rhs`, and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#complex\n\n Example:\n ```mlir\n %result = mhlo.complex %lhs, %rhs : tensor<2xcomplex>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Fp32Or64Tensor" }, { "name": "rhs", "type": "MHLO_Fp32Or64Tensor" } ], "results": [ { "name": "result", "type": "MHLO_ComplexTensor" } ], "assemblyFormat": "operands attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.composite", "summary": "Composite operation", "description": "Encapsulates an operation made up (composed) of other StableHLO operations,\n taking `inputs` and `composite_attributes` and producing `results`. The\n semantics of the op are implemented by the `decomposition` attribute. The\n `composite` op can be replaced with its decomposition without changing program\n semantics. In cases where inlining the decomposition does not provide the same\n op semantics, prefer using `custom_call`.\n\n The `version` field (defaults to `0`) is used to denote when a composite's\n semantics change.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#composite\n\n Example:\n ```mlir\n %results = mhlo.composite \"my.op\" %arg0, %arg1 {\n decomposition = @my_op,\n composite_attributes = { my_attribute = \"my_value\" },\n version = 1 : i32\n } : (tensor, tensor) -> tensor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "composite_attributes", "type": "DefaultValuedOptionalAttr" }, { "name": "decomposition", "type": "FlatSymbolRefAttr" }, { "name": "version", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "composite_regions", "type": "VariadicRegion" } ], "assemblyFormat": "$name operands (` ` `(` $composite_regions^ `)`)? attr-dict\n `:` functional-type(operands, results)" }, { "name": "mhlo.compute_reshape_shape", "summary": "Compute input for reshape with any dynamic dim resolved", "description": "This operation handles the dynamic aspect of a TF/NumPy/CHLO reshape. The\n dynamic aspect is that a single extent can be -1 and that dimension will\n instead be computed. This handles the computation and can then be passed to\n an HLO DynamicReshapeOp to replicate the TF/NumPy reshape behavior.\n\n This op has undefined behavior if the dimensions do not evenly divide the\n number of elements, or if there are multiple -1 values. It is an identity op\n if no dimensions are -1.\n\n ```\n %0 = hlo.compute_reshape_shape 12, [2, -1] -> [2, 6]\n ```", "operands": [ { "name": "num_elements", "type": "Index" }, { "name": "dynamic_shape", "type": "1DTensorOf<[AnyInteger, Index]>" } ], "results": [ { "name": "result", "type": "1DTensorOf<[AnyInteger, Index]>" } ], "assemblyFormat": "$num_elements `,` $dynamic_shape attr-dict `:` type($num_elements) `,` type($dynamic_shape) `->` type($result)" }, { "name": "mhlo.concatenate", "summary": "Concatenate operation", "description": "Concatenates a variadic number of tensors in `inputs` along `dimension`\n dimension in the same order as the given arguments and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#concatenate\n\n Example:\n ```mlir\n %result = mhlo.concatenate %input0, %input1, dim = 0 : (tensor<3x2xi64>, tensor<1x2xi64>) -> tensor<4x2xi64>\n ```", "operands": [ { "name": "val", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" } ] }, { "name": "mhlo.constant", "summary": "Constant operation", "description": "Produces an `output` tensor from a constant `value`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#constant\n\n Example:\n ```mlir\n %output = mhlo.constant dense<[[0.0, 1.0], [2.0, 3.0]]> : tensor<2x2xf32>\n ```", "results": [ { "name": "output", "type": "MHLO_StaticShapeTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "mhlo.convert", "summary": "Convert operation", "description": "Performs an element-wise conversion from one element type to another on\n `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#convert\n\n Example:\n ```mlir\n %result = mhlo.convert %operand : (tensor<3xi32>) -> tensor<3xcomplex>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.convolution", "summary": "Convolution operation", "description": "Computes dot products between windows of `lhs` and slices of `rhs` and\n produces `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#convolution\n\n Example:\n ```mlir\n %result = \"mhlo.convolution\"(%lhs, %rhs) {\n window_strides = dense<4> : tensor<2xi64>,\n padding = dense<0> : tensor<2x2xi64>,\n lhs_dilation = dense<2> : tensor<2xi64>,\n rhs_dilation = dense<1> : tensor<2xi64>,\n window_reversal = dense : tensor<2xi1>,\n dimension_numbers = #mhlo.conv<[b, 0, 1, f]x[0, 1, i, o]->[b, 0, 1, f]>,\n feature_group_count = 1 : i64,\n batch_group_count = 1 : i64,\n precision_config = [#stablehlo, #stablehlo]\n } : (tensor<1x4x4x1xi32>, tensor<3x3x1x1xi32>) -> tensor<1x2x2x1xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "window_strides", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" }, { "name": "lhs_dilation", "type": "OptionalAttr" }, { "name": "rhs_dilation", "type": "OptionalAttr" }, { "name": "window_reversal", "type": "OptionalAttr" }, { "name": "dimension_numbers", "type": "MHLO_ConvDimensionNumbers" }, { "name": "feature_group_count", "type": "ConfinedAttr" }, { "name": "batch_group_count", "type": "ConfinedAttr" }, { "name": "precision_config", "type": "OptionalAttr>" } ], "assemblyFormat": "`(`operands`)`\n `dim_numbers` `=` custom($dimension_numbers) `,`\n `window` `=` `{` custom($window_strides, $padding,\n $lhs_dilation, $rhs_dilation,\n $window_reversal) `}`\n attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.copy", "summary": "Copy operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation a copy of `operand`. Depending on the metadata\n attached to the operation, it can behave quite differently from a no-op.\n\n Example:\n ```mlir\n %0 = mhlo.copy %arg0 : tensor\n ```", "operands": [ { "name": "operand", "type": "MHLO_TensorOrTokenOrTuple" } ], "results": [ { "name": "result", "type": "MHLO_TensorOrTokenOrTuple" } ], "attributes": [ { "name": "cross_program_prefetch_index", "type": "OptionalAttr" } ], "assemblyFormat": "operands attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.cosh", "summary": "Cosh operation", "description": "Performs element-wise cosh operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.cosh %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.cosine", "summary": "Cosine operation", "description": "Performs element-wise cosine operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cosine\n\n Example:\n ```mlir\n %result = mhlo.cosine %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.count_leading_zeros", "summary": "Clz operation", "description": "Performs element-wise count of the number of leading zero bits in the\n `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#count_leading_zeros\n\n Example:\n ```mlir\n %result = mhlo.count_leading_zeros %operand : tensor<2x2xi8>\n ```", "operands": [ { "name": "operand", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.create_token", "summary": "CreateToken operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as AfterAllOp with 0 inputs:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#after_all\n\n Example:\n ```mlir\n %output = mhlo.create_token : !mhlo.token\n ```", "results": [ { "name": "output", "type": "MHLO_Token" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "mhlo.cross-replica-sum", "summary": "CrossReplicaSum operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as AllReduceOp with\n `channel_id = 0`, `use_global_device_ids = false` and `computation`\n implementing addition:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_reduce\n\n Example:\n ```mlir\n %result = \"mhlo.cross-replica-sum\"(%operand) {\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>\n } : (tensor<4xf32>) -> tensor<4xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "replica_groups", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.cstr_reshapable", "summary": "Compute input for reshape with any dynamic dim resolved", "description": "This operation creates a witness on the constraint that a given shape would\n be a valid reshape for the given number of elements.\n\n ```\n %0 = mhlo.cstr_reshapable 12, [2, -1] -> success\n %1 = mhlo.cstr_reshapable 13, [2, -1] -> failure\n ```", "operands": [ { "name": "num_elements", "type": "Index" }, { "name": "dynamic_shape", "type": "1DTensorOf<[AnyInteger, Index]>" } ], "results": [ { "name": "result", "type": "Shape_WitnessType" } ], "assemblyFormat": "$num_elements `,` $dynamic_shape attr-dict `:` type($num_elements) `,` type($dynamic_shape)" }, { "name": "mhlo.custom_call", "summary": "CustomCall operation", "description": "Encapsulates an implementation-defined operation `call_target_name` that\n takes `inputs` and `called_computations` and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#custom_call\n\n Example:\n ```mlir\n %results = \"mhlo.custom_call\"(%input0) {\n call_target_name = \"foo\",\n has_side_effect = false,\n backend_config = \"bar\",\n api_version = 1 : i32,\n called_computations = [@foo]\n } : (tensor) -> tensor\n\n A custom call invokes code external to XLA. The `inputs` are passed to the\n external code, and the external code is expected to produce a result of the\n given type. The exact mechanism is backend-specific. For example, in the CPU\n backend, a call instruction is emitted which targets a symbol with the name\n `call_target_name`.\n\n If XLA runtime is enabled for a backend, then custom calls use the runtime\n custom call calling convention to call into the external functions. This\n calling convention defines an ABI for encoding arguments, attributes and\n results.\n\n Depending on the API version there are two ways to pass extra bits of static\n information to the external function:\n\n 1. For `API_VERSION_TYPED_FFI` custom calls `backend_config` must be a\n dictionary attribute, that will be encoded according to the custom call\n calling convention and passed to the external function as the attributes\n argument. External code is expected to use declarative bindings (see\n `xla/runtime/custom_call.h`) to decode them at run time. These custom\n calls are only supported if XLA uses XLA runtime.\n\n 2. For previous API versions it is the user responsibility to encode extra\n bits of static information as a string `backend_config` attribute, and\n decode it at run time.\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "call_target_name", "type": "StrAttr" }, { "name": "has_side_effect", "type": "DefaultValuedOptionalAttr" }, { "name": "backend_config", "type": "OptionalAttr>" }, { "name": "api_version", "type": "DefaultValuedOptionalAttr" }, { "name": "called_computations", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "custom_call_schedule", "type": "DefaultValuedOptionalAttr" }, { "name": "operand_layouts", "type": "OptionalAttr>" }, { "name": "result_layouts", "type": "OptionalAttr>" }, { "name": "output_operand_aliases", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "result_tilings", "type": "OptionalAttr>>" } ], "assemblyFormat": "custom($call_target_name) `(` $inputs `)`\n attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.dequantize", "summary": "Dequantize operator", "description": "Dequantize the quantized input of packed uint32 to bfloat16. Only uint8 or\n uint16 is supported for the original unpacked input.\n\n Returns a tensor of shape [d0,..., dn * unpack_size] if unpacked input shape\n is [d0, ..., dn], where unpack_size = sizeof(unit32) / sizeof(T), where T is\n the unpacked input type. If transpose_output is true, will return a tensor\n of shape [dn * unpack_size, dn-1, ..., d1, d0]. transpose_output is faster\n when input's rank higher than 1. The input needs to be transposed to use\n transpose_output feature.", "operands": [ { "name": "input", "type": "TensorOf<[I32]>" } ], "results": [ { "name": "output", "type": "TensorOf<[BF16]>" } ], "attributes": [ { "name": "min_range", "type": "F32Attr" }, { "name": "max_range", "type": "F32Attr" }, { "name": "mode", "type": "HLO_DequantizeModeAttr" }, { "name": "transpose_output", "type": "BoolAttr" }, { "name": "is_16bits", "type": "DefaultValuedAttr" } ] }, { "name": "mhlo.divide", "summary": "Div operation", "description": "Performs element-wise division of dividend `lhs` and divisor `rhs` tensors\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#divide\n\n Example:\n ```mlir\n %result = mhlo.divide %lhs, %rhs : tensor<4xf32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.domain", "summary": "Domain operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, these operations are used to group instructions with the same\n DomainMetadata property. ShardingMetadata is the main use case today to\n group instructions on the same device. Domain instructions provide two\n major benefits:\n - Prevent unintentionally optimizing instructions across domains.\n - Automatically assign the metadata of the instructions created in the domain.\n Without domain instructions, each HLO optimization pass would have to check\n and propagate the metadata, which would be easy to miss and also adds\n complexity to the compiler. Since domain instructions connect two different\n domains, each domain instruction is associated with two DomainMetadata --\n one on the operand side and one on the user side of the domain.", "operands": [ { "name": "operand", "type": "MHLO_TensorOrToken" } ], "results": [ { "name": "result", "type": "MHLO_TensorOrToken" } ], "attributes": [ { "name": "kind", "type": "MHLO_DomainKindAttr{sharding}" }, { "name": "entry_metadata", "type": "StrAttr" }, { "name": "exit_metadata", "type": "StrAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ] }, { "name": "mhlo.dot", "summary": "Dot operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as XLA's Dot:\n https://www.tensorflow.org/xla/operation_semantics#dot\n\n Example:\n ```mlir\n %0 = mhlo.dot %arg0, %arg1 : (tensor<1x2xi32>, tensor<2x1xi32>) -> tensor<1x1xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "precision_config", "type": "OptionalAttr>" } ] }, { "name": "mhlo.dot_general", "summary": "DotGeneral operation", "description": "Computes dot products between slices of `lhs` and slices of `rhs` and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dot_general\n\n Example:\n ```mlir\n %result = \"mhlo.dot_general\"(%lhs, %rhs) {\n dot_dimension_numbers = #mhlo.dot<\n lhs_batching_dimensions = [0],\n rhs_batching_dimensions = [0],\n lhs_contracting_dimensions = [2],\n rhs_contracting_dimensions = [1]\n >,\n precision_config = [#stablehlo, #stablehlo]\n } : (tensor<2x2x2xi32>, tensor<2x2x2xi32>) -> tensor<2x2x2xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dot_dimension_numbers", "type": "MHLO_DotDimensionNumbers" }, { "name": "precision_config", "type": "OptionalAttr>" }, { "name": "algorithm", "type": "OptionalAttr" } ] }, { "name": "mhlo.dynamic_broadcast_in_dim", "summary": "DynamicBroadcastInDim operation", "description": "This operation is functionally identical to\n [broadcast_in_dim](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#broadcast_in_dim)\n op, but the result shape is specified dynamically via `output_dimensions`.\n\n It also accepts optional attributes to express static knowledge about the\n expanding behavior of dimensions. If not specified, all dimensions are\n assumed to be possibly expanding. The sets of dimensions that are known to\n be expanding and the set of dimensions that are known to be non-expanding\n must be disjoint and they must be a subset of the operand's dimensions.\n\n See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_broadcast_in_dim\n\n Example:\n ```mlir\n %operand = mhlo.constant dense<[[1, 2, 3]]> : tensor<1x3xi64>\n %output_dimensions = mhlo.constant dense<[2, 3, 2]> : tensor<3xi64>\n %result = \"mhlo.dynamic_broadcast_in_dim\"(%operand, %output_dimensions) {\n broadcast_dimensions = array,\n known_expanding_dimensions = array,\n known_nonexpanding_dimensions = array\n } : (tensor<1x3xi64>, tensor<3xi64>) -> tensor<2x3x2xi64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "output_dimensions", "type": "MHLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "MHLO_BroadcastDimAttr" }, { "name": "known_expanding_dimensions", "type": "OptionalAttr" }, { "name": "known_nonexpanding_dimensions", "type": "OptionalAttr" } ] }, { "name": "mhlo.dynamic_conv", "summary": "DynamicConv operation", "description": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/8.\n\n Informally, this operation does the same thing as ConvolutionOp except\n that `padding` is specified dynamically via `d_padding`:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#convolution\n\n Example:\n ```mlir\n %result = \"mhlo.dynamic_conv\"(%lhs, %rhs, %d_padding) {\n window_strides = dense<4> : tensor<2xi64>,\n lhs_dilation = dense<2> : tensor<2xi64>,\n rhs_dilation = dense<1> : tensor<2xi64>,\n window_reversal = dense : tensor<2xi1>,\n dimension_numbers = #mhlo.conv<[b, 0, 1, f]x[0, 1, i, o]->[b, 0, 1, f]>,\n feature_group_count = 1 : i64,\n batch_group_count = 1 : i64,\n precision_config = [#stablehlo, #stablehlo]\n } : (tensor<1x4x4x1xi32>, tensor<3x3x1x1xi32>, tensor<2x2xi64>) -> tensor<1x2x2x1xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" }, { "name": "d_padding", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "window_strides", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" }, { "name": "lhs_dilation", "type": "OptionalAttr" }, { "name": "rhs_dilation", "type": "OptionalAttr" }, { "name": "window_reversal", "type": "OptionalAttr" }, { "name": "dimension_numbers", "type": "MHLO_ConvDimensionNumbers" }, { "name": "feature_group_count", "type": "ConfinedAttr" }, { "name": "batch_group_count", "type": "ConfinedAttr" }, { "name": "precision_config", "type": "OptionalAttr>" } ] }, { "name": "mhlo.dynamic_gather", "summary": "DynamicGather operation", "description": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/8.\n\n Informally, this operation does the same thing as GatherOp except\n that `slice_sizes` are specified dynamically:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#gather\n\n Example:\n ```mlir\n %result = \"mhlo.dynamic_gather\"(%operand, %start_indices, %slice_sizes) {\n dimension_numbers = #mhlo.gather<\n offset_dims = [2, 3],\n collapsed_slice_dims = [0],\n start_index_map = [0, 2],\n index_vector_dim = 2>,\n indices_are_sorted = false\n } : (tensor<3x4x2xi32>, tensor<2x3x2xi64>, tensor<3xi64>) -> tensor<2x3x2x2xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "start_indices", "type": "MHLO_IntTensor" }, { "name": "slice_sizes", "type": "MHLO_Static1DIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "MHLO_GatherDimensionNumbers" }, { "name": "indices_are_sorted", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "mhlo.dynamic_iota", "summary": "DynamicIota operation", "description": "This operation is functionally identical to\n [iota](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#iota)\n op, but the result shape is specified dynamically via `output_shape`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_iota\n\n Example:\n ```mlir\n %0 = mhlo.dynamic_iota %arg0, dim = 0 : (tensor<1xindex>) -> tensor<4xi32>\n ```", "operands": [ { "name": "output_shape", "type": "MHLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "iota_dimension", "type": "ConfinedAttr" } ] }, { "name": "mhlo.dynamic_pad", "summary": "DynamicPad operation", "description": "Dynamically Pads the `operand`, with amount of padding added at\n low-end/high-end/interior is passed through input tensors.", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "padding_value", "type": "MHLO_Tensor" }, { "name": "edge_padding_low", "type": "MHLO_DimensionTensor" }, { "name": "edge_padding_high", "type": "MHLO_DimensionTensor" }, { "name": "interior_padding", "type": "MHLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['edge_padding_low', 'edge_padding_high', 'interior_padding']>" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.dynamic_reshape", "summary": "DynamicReshape operation", "description": "This operation is functionally identical to\n [reshape](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reshape)\n op, but the result shape is specified dynamically via `output_shape`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_reshape\n\n Example:\n ```mlir\n %output_shape = mhlo.constant dense<[3, 2]> : tensor<2xi64>\n %result = mhlo.dynamic_reshape %operand, %output_shape : (tensor<2x3xi64>, tensor<2xi64>) -> tensor<3x2xi64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_AnyTensor" }, { "name": "output_shape", "type": "MHLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "MHLO_AnyTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.dynamic_slice", "summary": "DynamicSlice operation", "description": "Extracts a slice from the `operand` using dynamically-computed starting\n indices and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_slice\n\n Example:\n ```mlir\n %result = mhlo.dynamic_slice %operand, %start_indices0, %start_indices1, sizes = [2, 2]\n : (tensor<4x4xi32>, tensor, tensor) -> tensor<2x2xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "slice_sizes", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.dynamic_update_slice", "summary": "DynamicUpdateSlice operation", "description": "Produces a `result` tensor which is equal to the `operand` tensor except\n that the slice starting at `start_indices` is updated with the values in\n `update`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_update_slice\n\n Example:\n ```mlir\n %result = mhlo.dynamic_update_slice %operand, %update, %start_indices0, %start_indices1\n : (tensor<4x4xi32>, tensor<2x2xi32>, tensor, tensor) -> tensor<4x4xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "update", "type": "MHLO_Tensor" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.dynamic-slice", "summary": "Dynamic Slice operator", "description": "Extracts a sub-array from the input array at dynamic start_indices.\n\n See https://www.tensorflow.org/xla/operation_semantics#dynamicslice.", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "slice_sizes", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.dynamic-update-slice", "summary": "Dynamic Update Slice operator", "description": "DynamicUpdateSlice generates a result which is the value of the input array\n operand, with a slice update overwritten at start_indices.\n\n See https://www.tensorflow.org/xla/operation_semantics#dynamicupdateslice.", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "update", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ] }, { "name": "mhlo.einsum", "summary": "Einsum operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as TF's einsum:\n https://www.tensorflow.org/api_docs/python/tf/einsum\n\n Example:\n ```mlir\n %result = \"mhlo.einsum\"(%lhs, %rhs) {\n einsum_config = \"ab,bc->ac\"\n } : (tensor<4x16xf32>, tensor<16x4xf32>) -> tensor<4x4xf32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "einsum_config", "type": "StrAttr" } ] }, { "name": "mhlo.erf", "summary": "Erf operation", "description": "Performs element-wise erf operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.erf %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.exponential", "summary": "Exp operation", "description": "Performs element-wise exponential operation on `operand` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#exponential\n\n Example:\n ```mlir\n %result = mhlo.exponential %operand : tensor<2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.exponential_minus_one", "summary": "Expm1 operation", "description": "Performs element-wise exponential minus one operation on `operand` tensor\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#exponential_minus_one\n\n Example:\n ```mlir\n %result = mhlo.exponential_minus_one %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.fft", "summary": "Fft operation", "description": "Performs the forward and inverse Fourier transforms for real and complex\n inputs/outputs.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#fft\n\n Example:\n ```mlir\n %result = mhlo.fft %operand, type = FFT, length = [4] : (tensor<4xcomplex>) -> tensor<4xcomplex>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "fft_type", "type": "MHLO_FftTypeAttr{FFT|IFFT|RFFT|IRFFT}" }, { "name": "fft_length", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.floor", "summary": "Floor operation", "description": "Performs element-wise floor of `operand` tensor and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#floor\n\n Example:\n ```mlir\n %result = mhlo.floor %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.fusion", "summary": "Fusion operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation consists of a group of basic ops (represented as\n a region attached to it). It serves as a hint to the backend that it is\n beneficial to emit the contained ops into a single loop nest or kernel.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "fusion_kind", "type": "OptionalAttr" }, { "name": "output_operand_aliases", "type": "DefaultValuedOptionalAttr, {}>" } ], "regions": [ { "name": "fused_computation", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.gather", "summary": "Gather operation", "description": "Gathers slices from `operand` tensor from offsets specified in\n `start_indices` and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#gather\n\n Example:\n ```mlir\n %result = \"mhlo.gather\"(%operand, %start_indices) {\n dimension_numbers = #stablehlo.gather<\n offset_dims = [3, 4],\n collapsed_slice_dims = [1],\n operand_batching_dims = [0],\n start_indices_batching_dims = [1],\n start_index_map = [2, 1],\n index_vector_dim = 3>,\n slice_sizes = dense<[0, 2, 2]> : tensor<3xi64>,\n indices_are_sorted = false\n } : (tensor<2x3x4x2xi64>, tensor<2x2x3x2xi64>) -> tensor<2x2x3x2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "start_indices", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "MHLO_GatherDimensionNumbers" }, { "name": "slice_sizes", "type": "I64ElementsAttr" }, { "name": "indices_are_sorted", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "mhlo.get_dimension_size", "summary": "GetDimensionSize operation", "description": "Produces the size of the given `dimension` of the `operand`.\n\n See\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#get_dimension_size\n\n Example:\n ```mlir\n %result = mhlo.get_dimension_size %operand, dim = 1 : (tensor<2x3xf32>) -> tensor\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "I32Tensor" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" } ] }, { "name": "mhlo.get_tuple_element", "summary": "GetTupleElement operation", "description": "Extracts element at `index` position of the `operand` tuple and produces a\n `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#get_tuple_element\n\n Example:\n ```mlir\n %result = mhlo.get_tuple_element %operand[0] : (tuple, tuple>>) -> tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tuple" } ], "results": [ { "name": "result", "type": "MHLO_TensorOrTokenOrTupleOrBuffer" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `[` $index `]` attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.if", "summary": "If operation", "description": "Produces the output from executing exactly one branch from `true_branch` or\n `false_branch` depending on the value of `pred`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#if\n\n Example:\n %result = \"mhlo.if\"(%pred) ({\n \"mhlo.return\"(%result_true_branch) : (tensor) -> ()\n }, {\n \"mhlo.return\"(%result_false_branch) : (tensor) -> ()\n }) : (tensor) -> tensor", "operands": [ { "name": "pred", "type": "MHLO_PredTensor" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "true_branch", "type": "SizedRegion<1>" }, { "name": "false_branch", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.imag", "summary": "Imag operation", "description": "Extracts the imaginary part, element-wise, from the `operand` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#imag\n\n Example:\n ```mlir\n %result = mhlo.imag %operand : (tensor<2xcomplex>) -> tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.infeed", "summary": "Infeed operation", "description": "Reads data from the infeed and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#infeed\n\n Example:\n ```mlir\n %results:2 = \"mhlo.infeed\"(%token) {\n infeed_config = \"\"\n } : (!mhlo.token) -> (tensor<3x3x3xi32>, !mhlo.token)\n ```", "operands": [ { "name": "token", "type": "MHLO_Token" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "infeed_config", "type": "DefaultValuedStrAttr" }, { "name": "layout", "type": "OptionalAttr" } ] }, { "name": "mhlo.iota", "summary": "Iota operation", "description": "Fills an `output` tensor with values in increasing order starting from zero\n along the `iota_dimension` dimension.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#iota\n\n Example:\n ```mlir\n %output = mhlo.iota dim = 0 : tensor<4x5xi32>\n ```", "results": [ { "name": "output", "type": "MHLO_StaticShapeIntFpOrComplexTensor" } ], "attributes": [ { "name": "iota_dimension", "type": "ConfinedAttr" } ] }, { "name": "mhlo.is_finite", "summary": "IsFinite operation", "description": "Performs element-wise check whether the value in `x` is finite (i.e. is\n neither +Inf, -Inf, nor NaN) and produces a `y` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#is_finite\n\n Example:\n ```mlir\n %y = mhlo.is_finite %x : (tensor<7xf32>) -> tensor<7xi1>\n ```", "operands": [ { "name": "x", "type": "MHLO_FpTensor" } ], "results": [ { "name": "y", "type": "MHLO_PredTensor" } ], "assemblyFormat": "$x attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.log", "summary": "Log operation", "description": "Performs element-wise logarithm operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#log\n\n Example:\n ```mlir\n %result = mhlo.log %operand : tensor<2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.log_plus_one", "summary": "Log1p operation", "description": "Performs element-wise logarithm plus one operation on `operand` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#log_plus_one\n\n Example:\n ```mlir\n %result = mhlo.log_plus_one %operand : tensor<6xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.logistic", "summary": "Logistic operation", "description": "Performs element-wise logistic operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#logistic\n\n Example:\n ```mlir\n %result = mhlo.logistic %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.map", "summary": "Map operation", "description": "Applies a map function `computation` to `inputs` along the `dimensions` and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#map\n\n Example:\n ```mlir\n %result = \"mhlo.map\"(%input0, %input1) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = mhlo.multiply %arg0, %arg1 : tensor\n mhlo.return %0 : tensor\n }) {\n dimensions = dense<[0, 1]> : tensor<2xi64>\n } : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dimensions", "type": "I64ElementsAttr" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.maximum", "summary": "Max operation", "description": "Performs element-wise max operation on tensors `lhs` and `rhs` and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#maximum\n\n Example:\n ```mlir\n %result = mhlo.maximum %lhs, %rhs : tensor<4xf32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.minimum", "summary": "Min operation", "description": "Performs element-wise min operation on tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#minimum\n\n Example:\n ```mlir\n %result = mhlo.minimum %lhs, %rhs : tensor<4xf32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.minimum_broadcast_shapes", "summary": "Minimizes the rank of two or more shapes to be broadcasted", "description": "Given two or more 1D tensors representing shapes, returns one 1D tensor for\n each operand, where operand `i` corresponds to output `i`.\n\n The returned tensors have the property that they specify a shape which is a\n reshape of the corresponding input shape, and the broadcasted output shape\n (using shape::BroadcastOp) of the returned shapes is a reshape of the\n broadcasted output shape of the input shapes. Among all possibilities with\n this property, the one is chosen which minimizes the rank of each returned\n shape.\n\n The general idea of this op is that it can be used for ops which have a\n broadcasting semantic to operate on shapes with a possibly smaller rank\n while preserving equivalence of the computed values. After computing the\n result of the op using reshaped operands, the result can be reshaped to the\n result that would have been originally computed.\n\n Here is an example with two input shapes:\n\n ```mlir\n mhlo.minimum_broadcast_shapes [1, 2, 3, 1, 2, 1],\n [1, 1, 1, 2, 3] -> [6, 2, 1], [2, 3]\n ```\n\n The broadcasted output shape of the operands is [1, 2, 3, 1, 2, 3], the\n broadcasted output shape of the outputs is [6, 2, 3]. These two shapes are\n reshapes of each other, and also each output is a reshape of the\n corresponding input.", "operands": [ { "name": "shapes", "type": "Variadic<1DTensorOf<[ Index ]>>" } ], "results": [ { "name": "results", "type": "Variadic<1DTensorOf<[ Index ]>>" } ], "assemblyFormat": "$shapes attr-dict `:` type($shapes) `->` type($results)" }, { "name": "mhlo.mulhi", "summary": "Mulhi operation", "description": "Performs element-wise multiplication of two integer tensors `lhs` and `rhs`,\n returning the most significant bits of the product.", "operands": [ { "name": "lhs", "type": "MHLO_IntTensor" }, { "name": "rhs", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.multiply", "summary": "Mul operation", "description": "Performs element-wise product of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#multiply\n\n Example:\n ```mlir\n %result = mhlo.multiply %lhs, %rhs : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.negate", "summary": "Neg operation", "description": "Performs element-wise negation of `operand` tensor and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#negate\n\n Example:\n ```mlir\n %result = mhlo.negate %operand : tensor<2x3xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.not", "summary": "Not operation", "description": "Performs element-wise NOT of tensor `operand` of type integer and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#not\n\n Example:\n ```mlir\n %result = mhlo.not %operand : tensor<5x3x1xi1>\n ```", "operands": [ { "name": "operand", "type": "MHLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_PredOrIntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.optimization_barrier", "summary": "OptimizationBarrier operation", "description": "Ensures that the operations that produce the `operand` are executed before any\n operations that depend on the `result` and prevents compiler transformations\n from moving operations across the barrier. Other than that, the operation is\n an identity, i.e. `result` = `operand`.\n\n See\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#optimization_barrier\n\n Example:\n ```mlir\n %result0, %result1 = mhlo.optimization_barrier %operand0, %operand1 : tensor, tensor\n ```", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operand^ `:` custom(type($operand), type($result))):(`(` `)`)?" }, { "name": "mhlo.or", "summary": "Or operation", "description": "Performs element-wise OR of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#or\n\n Example:\n ```mlir\n %result = mhlo.or %lhs, %rhs : tensor<2xi1>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_PredOrIntTensor" }, { "name": "rhs", "type": "MHLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.outfeed", "summary": "Outfeed operation", "description": "Writes `inputs` to the outfeed and produces a `result` token.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#outfeed\n\n Example:\n ```mlir\n %result = \"mhlo.outfeed\"(%input0, %token) {\n outfeed_config = \"\"\n } : (tensor<3x3x3xi32>, !mhlo.token) -> !mhlo.token\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "MHLO_Token" } ], "results": [ { "name": "result", "type": "MHLO_Token" } ], "attributes": [ { "name": "outfeed_config", "type": "DefaultValuedStrAttr" } ] }, { "name": "mhlo.pad", "summary": "Pad operation", "description": "Expands `operand` by padding around the tensor as well as between the\n elements of the tensor with the given `padding_value`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#pad\n\n Example:\n ```mlir\n %0 = mhlo.pad %arg0, %arg1, low = [0, 1], high = [2, 1], interior = [1, 2]\n : (tensor<2x3xi32>, tensor) -> tensor<5x9xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "padding_value", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "edge_padding_low", "type": "I64ElementsAttr" }, { "name": "edge_padding_high", "type": "I64ElementsAttr" }, { "name": "interior_padding", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.partition_id", "summary": "PartitionId operation", "description": "Produces `partition_id` of the current process.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#partition_id\n\n Example:\n ```mlir\n %result = mhlo.partition_id : tensor\n ```", "results": [ { "name": "result", "type": "UI32RankedTensor" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "mhlo.popcnt", "summary": "PopulationCount operation", "description": "Performs element-wise count of the number of bits set in the `operand`\n tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#popcnt\n\n Example:\n ```mlir\n %result = mhlo.popcnt %operand : tensor<4xi8>\n ```", "operands": [ { "name": "operand", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.power", "summary": "Pow operation", "description": "Performs element-wise exponentiation of `lhs` tensor by `rhs` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#power\n\n Example:\n ```mlir\n %result = mhlo.power %lhs, %rhs : tensor<6xf32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.print", "summary": "Print operation", "description": "PrintOp is used to print tensor, which can be used to debug.", "operands": [ { "name": "input", "type": "HLO_Tensor" } ], "results": [ { "name": "output", "type": "HLO_Tensor" } ] }, { "name": "mhlo.ragged_dot", "summary": "Ragged matrix multiplication over a single ragged dimension", "description": "This operation takes three tensor args---lhs, rhs, and group_sizes---and\n a \"ragged_dot_dimension_numbers\" attribute. Like dot_general, the lhs and\n rhs are allowed arbitrary batch and contracting dimensions. Additionally,\n the lhs is required to have one ragged dimension, and the rhs may have at\n most one group dimension. The op has three modes, depending on the kind of\n the lhs ragged dimension.\n\n In mode 1, the shape-signature is `[b,m,k], [g,b,k,n], [b,g] -> [b,m,n]`.\n Here the ragged dimension is an lhs non-contracting dimension (`m`). The\n dimensions `b` and `k` represent batch and contracting dimensions\n respectively. The rhs is required to have a group dimension (`g`).\n\n In mode 2, the shape-signature is `[b,m,k], [b,k,n], [b,g] -> [g,b,m,n]`.\n Here the ragged dimension is an lhs/rhs contracting dimension (`k`).\n\n In mode 3, the shape-signature is `[b,m,k], [b,k,n], [g] -> [b,m,n]`. Here\n the ragged dimension is an lhs/rhs batch dimension (`b`).", "operands": [ { "name": "lhs", "type": "MHLO_Tensor" }, { "name": "rhs", "type": "MHLO_Tensor" }, { "name": "group_sizes", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "ragged_dot_dimension_numbers", "type": "MHLO_RaggedDotDimensionNumbers" }, { "name": "precision_config", "type": "OptionalAttr>" } ] }, { "name": "mhlo.real", "summary": "Real operation", "description": "Extracts the real part, element-wise, from the `operand` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#real\n\n Example:\n ```mlir\n %result = mhlo.real %operand : (tensor<2xcomplex>) -> tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.real_dynamic_slice", "summary": "RealDynamicSlice operation", "description": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/8.\n\n Informally, this operation does the same thing as SliceOp except\n that `start_indices`, `limit_indices` and `strides` are specified dynamically:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#slice\n\n Example:\n ```mlir\n %result = mhlo.real_dynamic_slice %operand,\n %start_indices, %limit_indices, %strides\n : (tensor<256x?xf32>, tensor<2xindex>, tensor<2xindex>, tensor<2xindex>) -> tensor<256x?xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "start_indices", "type": "MHLO_DimensionTensor" }, { "name": "limit_indices", "type": "MHLO_DimensionTensor" }, { "name": "strides", "type": "MHLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['start_indices', 'limit_indices', 'strides']>" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.recv", "summary": "Recv operation", "description": "Receives data from a channel with `channel_id` and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#recv\n\n Example:\n ```mlir\n %results:2 = \"mhlo.recv\"(%token) {\n // channel_id = 5 : i64,\n // channel_type = #stablehlo,\n channel_handle = #mhlo.channel_handle,\n is_host_transfer = false,\n source_target_pairs = dense<[[0, 1], [1, 2]]> : tensor<2x2xi64>\n } : (!mhlo.token) -> (tensor<3x4xi32>, !mhlo.token)\n ```", "operands": [ { "name": "token", "type": "MHLO_Token" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "channel_handle", "type": "MHLO_ChannelHandle" }, { "name": "is_host_transfer", "type": "DefaultValuedOptionalAttr" }, { "name": "source_target_pairs", "type": "OptionalAttr" } ] }, { "name": "mhlo.reduce", "summary": "Reduce operation", "description": "Applies a reduction function `body` to `inputs` and `init_values` along the\n `dimensions` and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce\n\n Example:\n ```mlir\n %result = \"mhlo.reduce\"(%input, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"mhlo.add\"(%arg0, %arg1) : (tensor, tensor) -> tensor\n \"mhlo.return\"(%0) : (tensor) -> ()\n }) {\n dimensions = dense<1> : tensor<1xi64>\n } : (tensor<1x6xi32>, tensor) -> tensor<1xi32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimensions", "type": "I64ElementsAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "mhlo.reduce_precision", "summary": "ReducePrecision operation", "description": "Performs element-wise conversion of `operand` to another floating-point type\n that uses `exponent_bits` and `mantissa_bits` and back to the original\n floating-point type and produces an `output` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce_precision\n\n Example:\n ```mlir\n %output = mhlo.reduce_precision %operand, format = e5m2 : tensor<6xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" } ], "results": [ { "name": "output", "type": "MHLO_FpTensor" } ], "attributes": [ { "name": "exponent_bits", "type": "ConfinedAttr" }, { "name": "mantissa_bits", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `,` `format` `=` custom($exponent_bits, $mantissa_bits)\n attr-dict `:` custom(type($operand), type($output))" }, { "name": "mhlo.reduce_scatter", "summary": "ReduceScatter operation", "description": "Within each process group in the process grid, performs reduction, using\n `computations`, over the values of the `operand` tensor from each process,\n splits the reduction result along `scatter_dimension` into parts, and\n scatters the split parts between the processes to produce the `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce_scatter\n\n Example:\n ```mlir\n %result = \"mhlo.reduce_scatter\"(%operand) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = mhlo.add %arg0, %arg1 : tensor\n mhlo.return %0 : tensor\n }) {\n scatter_dimension = 1 : i64,\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>,\n // channel_id = 0\n channel_handle = #mhlo.channel_handle\n // use_global_device_ids = false\n } : (tensor<2x4xf32>) -> tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "scatter_dimension", "type": "ConfinedAttr" }, { "name": "replica_groups", "type": "MHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" }, { "name": "use_global_device_ids", "type": "UnitAttr" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.reduce_window", "summary": "ReduceWindow operation", "description": "Applies a reduction function `body` to windows of `inputs` and `init_values`\n and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce_window\n\n Example:\n ```mlir\n %result = \"mhlo.reduce_window\"(%input, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = mhlo.add %arg0, %arg1 : tensor\n mhlo.return %0 : tensor\n }) {\n window_dimensions = dense<[2, 1]> : tensor<2xi64>,\n window_strides = dense<[4, 1]> : tensor<2xi64>,\n base_dilations = dense<[2, 1]> : tensor<2xi64>,\n window_dilations = dense<[3, 1]> : tensor<2xi64>,\n padding = dense<[[2, 1], [0, 0]]> : tensor<2x2xi64>\n } : (tensor<3x2xi32>, tensor) -> tensor<2x2xi32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "window_dimensions", "type": "I64ElementsAttr" }, { "name": "window_strides", "type": "OptionalAttr" }, { "name": "base_dilations", "type": "OptionalAttr" }, { "name": "window_dilations", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.remainder", "summary": "Rem operation", "description": "Performs element-wise remainder of dividend `lhs` and divisor `rhs` tensors\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#remainder\n\n Example:\n ```mlir\n %result = mhlo.remainder %lhs, %rhs : tensor<4xi64>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.replica_id", "summary": "ReplicaId operation", "description": "Produces `replica_id` of the current process.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#replica_id\n\n Example:\n ```mlir\n %result = mhlo.replica_id : tensor\n ```", "results": [ { "name": "result", "type": "UI32RankedTensor" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "mhlo.reshape", "summary": "Reshape operation", "description": "Performs reshape of `operand` tensor to a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reshape\n\n Example:\n ```mlir\n %result = mhlo.reshape %operand : (tensor<2xf32>) -> tensor<1x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_AnyTensor" } ], "results": [ { "name": "result", "type": "MHLO_StaticShapeOrBoundedDimTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "mhlo.return", "summary": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/425.\n\n Informally, this operation serves as a terminator for regions defined by\n the StableHLO ops. Non-StableHLO ops, e.g. `func.func`, have their own\n terminators, e.g. `func.return`.\n\n Example:\n ```mlir\n %result = \"mhlo.reduce\"(%input, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"mhlo.add\"(%arg0, %arg1) : (tensor, tensor) -> tensor\n \"mhlo.return\"(%0) : (tensor) -> ()\n }) {\n dimensions = dense<1> : tensor<1xi64>\n } : (tensor<1x6xi32>, tensor) -> tensor<1xi32>\n ```", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$results attr-dict (`:` type($results)^)?" }, { "name": "mhlo.reverse", "summary": "Reverse operation", "description": "Reverses the order of elements in the `operand` along the specified\n `dimensions` and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reverse\n\n Example:\n ```mlir\n %result = mhlo.reverse %operand, dims = [1] : tensor<3x2xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dimensions", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.rng", "summary": "Rng operation", "description": "Generates random numbers using the `rng_distribution` algorithm and produces\n a `result` tensor of a given shape `shape`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#rng\n\n Example:\n ```mlir\n %result = mhlo.rng %a, %b, %shape, distribution = NORMAL : (tensor, tensor, tensor<2xi64>) -> tensor<3x3xi32>\n ```", "operands": [ { "name": "a", "type": "0DTensorOf<[MHLO_Pred, MHLO_Int, MHLO_Float]>" }, { "name": "b", "type": "0DTensorOf<[MHLO_Pred, MHLO_Int, MHLO_Float]>" }, { "name": "shape", "type": "MHLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "MHLO_PredIntOrFpTensor" } ], "attributes": [ { "name": "rng_distribution", "type": "MHLO_RngDistributionAttr{UNIFORM|NORMAL}" } ] }, { "name": "mhlo.rng_bit_generator", "summary": "RngBitGenerator operation", "description": "Returns an `output` filled with uniform random data and an updated output\n state `output_state` given an initial state `initial_state` using the\n pseudorandom number generator algorithm `rng_algorithm`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#rng_bit_generator\n\n Example:\n ```mlir\n %output_state, %output = mhlo.rng_bit_generator %initial_state, algorithm = THREE_FRY : (tensor<2xui64>) -> (tensor<2xui64>, tensor<2x2xui64>)\n ```", "operands": [ { "name": "initial_state", "type": "MHLO_IntOrFpTensor" } ], "results": [ { "name": "output_state", "type": "MHLO_IntOrFpTensor" }, { "name": "output", "type": "MHLO_StaticShapeIntOrFpTensor" } ], "attributes": [ { "name": "rng_algorithm", "type": "MHLO_RngAlgorithmAttr{DEFAULT|THREE_FRY|PHILOX}" } ] }, { "name": "mhlo.rng_normal", "summary": "RNG with normal distribution.", "description": "Constructs an output of a given shape with random numbers generated\n following the normal distribution with parameters `mu` and `sigma`. The\n parameters and output shape have to have a floating point elemental type.\n The parameters furthermore have to be scalar valued.\n\n See https://www.tensorflow.org/xla/operation_semantics#rngnormal.", "operands": [ { "name": "mu", "type": "HLO_FpTensor" }, { "name": "sigma", "type": "HLO_FpTensor" }, { "name": "shape", "type": "HLO_DimensionTensor" } ] }, { "name": "mhlo.rng_uniform", "summary": "RNG with uniform distribution.", "description": "Constructs an output of a given shape with random numbers generated\n following the uniform distribution over the interval `[a,b)`. The parameters\n and output element type have to be a boolean type, an integral type or a\n floating point types, and the types have to be consistent.\n\n See https://www.tensorflow.org/xla/operation_semantics#rnguniform.", "operands": [ { "name": "a", "type": "HLO_PredIntOrFpTensor" }, { "name": "b", "type": "HLO_PredIntOrFpTensor" }, { "name": "shape", "type": "HLO_DimensionTensor" } ] }, { "name": "mhlo.round_nearest_afz", "summary": "Round operation", "description": "Performs element-wise rounding towards the nearest integer, breaking ties\n away from zero, on the `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#round_nearest_afz\n\n Example:\n ```mlir\n %result = mhlo.round_nearest_afz %operand : tensor<5xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.round_nearest_even", "summary": "RoundNearestEven operation", "description": "Performs element-wise rounding towards the nearest integer, breaking ties\n towards the even integer, on the `operand` tensor and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#round_nearest_even\n\n Example:\n ```mlir\n %result = mhlo.round_nearest_even %operand : tensor<5xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.rsqrt", "summary": "Rsqrt operation", "description": "Performs element-wise reciprocal square root operation on `operand` tensor\n and produces a `result` tensor, implementing the `rSqrt` operation from the\n IEEE-754 specification.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#rsqrt\n\n Example:\n ```mlir\n %result = mhlo.rsqrt %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.scan", "summary": "Scan operation", "description": "Applies a reduction function `body` to `inputs` and `inits` along the\n `dimension` and produces `results` (comprising `outputs` and `carries`).\n\n If `is_reverse` is true, the scan is performed in reverse order.\n `is_associative` indicates whether the reduction function is associative.\n\n See: https://www.tensorflow.org/xla/operation_semantics#scan", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "carries", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" }, { "name": "scan_dim_size", "type": "OptionalAttr>" }, { "name": "is_reverse", "type": "DefaultValuedOptionalAttr" }, { "name": "is_associative", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "mhlo.scatter", "summary": "Scatter operation", "description": "Produces `results` tensors which are equal to `inputs` tensors except that\n several slices specified by `scatter_indices` are updated with the values\n `updates` using `update_computation`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#scatter\n\n Example:\n ```mlir\n %result = \"mhlo.scatter\"(%input, %scatter_indices, %update) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = mhlo.add %arg0, %arg1 : tensor\n mhlo.return %0 : tensor\n }) {\n scatter_dimension_numbers = #mhlo.scatter<\n update_window_dims = [3, 4],\n inserted_window_dims = [1],\n input_batching_dims = [0],\n scatter_indices_batching_dims = [1],\n scatter_dims_to_operand_dims = [2, 1],\n index_vector_dim = 3>,\n indices_are_sorted = false,\n unique_indices = false\n } : (tensor<2x3x4x2xi64>, tensor<2x2x3x2xi64>, tensor<2x2x3x2x2xi64>) -> tensor<2x3x4x2xi64>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "scatter_indices", "type": "RankedTensorOf<[AnyInteger, Index]>" }, { "name": "updates", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "scatter_dimension_numbers", "type": "MHLO_ScatterDimensionNumbers" }, { "name": "indices_are_sorted", "type": "DefaultValuedOptionalAttr" }, { "name": "unique_indices", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "update_computation", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.select", "summary": "Select operation", "description": "Produces a `result` tensor where each element is selected from `on_true` or\n `on_false` tensor based on the value of the corresponding element of `pred`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#select\n\n Example:\n ```mlir\n %result = mhlo.select %pred, %on_true, %on_false : tensor<2x2xi1>, tensor<2x2xi32>\n ```", "operands": [ { "name": "pred", "type": "MHLO_PredTensor" }, { "name": "on_true", "type": "MHLO_Tensor" }, { "name": "on_false", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "operands attr-dict `:`\n custom(type($pred), type($on_true), type($on_false), type($result))" }, { "name": "mhlo.select_and_scatter", "summary": "SelectAndScatter operation", "description": "Scatters the values from the `source` tensor using `scatter` based on the\n outcome of `reduce_window` of the `input` tensor using `select` and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#select_and_scatter\n\n Example:\n ```mlir\n %result = \"mhlo.select_and_scatter\"(%operand, %source, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"mhlo.compare\"(%arg0, %arg1) {\n comparison_direction = #stablehlo\n } : (tensor, tensor) -> tensor\n \"mhlo.return\"(%0) : (tensor) -> ()\n }, {\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"mhlo.add\"(%arg0, %arg1) : (tensor, tensor) -> tensor\n \"mhlo.return\"(%0) : (tensor) -> ()\n }) {\n window_dimensions = dense<[3, 1]> : tensor<2xi64>,\n window_strides = dense<[2, 1]> : tensor<2xi64>,\n padding = dense<[[0, 1], [0, 0]]> : tensor<2x2xi64>\n } : (tensor<4x2xi32>, tensor<2x2xi32>, tensor) -> tensor<4x2xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "source", "type": "MHLO_Tensor" }, { "name": "init_value", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "window_dimensions", "type": "OptionalAttr" }, { "name": "window_strides", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" } ], "regions": [ { "name": "select", "type": "SizedRegion<1>" }, { "name": "scatter", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.send", "summary": "Send operation", "description": "Sends `inputs` to a channel `channel_id` and produces a `result` token.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#send\n\n Example:\n ```mlir\n %result = \"mhlo.send\"(%operand, %token) {\n // channel_id = 5 : i64,\n // channel_type = #stablehlo,\n channel_handle = #mhlo.channel_handle,\n is_host_transfer = false,\n source_target_pairs = dense<[[0, 1], [1, 2]]> : tensor<2x2xi64>\n } : (tensor<3x4xi32>, !mhlo.token) -> !mhlo.token\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "MHLO_Token" } ], "results": [ { "name": "result", "type": "MHLO_Token" } ], "attributes": [ { "name": "channel_handle", "type": "MHLO_ChannelHandle" }, { "name": "is_host_transfer", "type": "DefaultValuedOptionalAttr" }, { "name": "source_target_pairs", "type": "OptionalAttr" } ] }, { "name": "mhlo.set_dimension_size", "summary": "SetDimensionSize operation", "description": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/8.\n\n Informally, this operation does the same thing as XLA's SetDimensionSize:\n https://www.tensorflow.org/xla/operation_semantics#setdimensionsize\n\n Example:\n ```mlir\n %0 = mhlo.set_dimension_size %arg0, %arg1, dim = 1 : (tensor<4x2xf32>, tensor) -> tensor<4x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "size", "type": "I32Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" } ] }, { "name": "mhlo.shift_left", "summary": "ShiftLeft operation", "description": "Performs element-wise left-shift operation on the `lhs` tensor by `rhs`\n number of bits and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#shift_left\n\n Example:\n ```mlir\n %result = mhlo.shift_left %lhs, %rhs : tensor<6xi8>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntTensor" }, { "name": "rhs", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.shift_right_arithmetic", "summary": "ShiftRightArithmetic operation", "description": "Performs element-wise arithmetic right-shift operation on the `lhs` tensor\n by `rhs` number of bits and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#shift_right_arithmetic\n\n Example:\n ```mlir\n %result = mhlo.shift_right_arithmetic %lhs, %rhs : tensor<6xi8>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntTensor" }, { "name": "rhs", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.shift_right_logical", "summary": "ShiftRightLogical operation", "description": "Performs element-wise logical right-shift operation on the `lhs` tensor by\n `rhs` number of bits and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#shift_right_logical\n\n Example:\n ```mlir\n %result = mhlo.shift_right_logical %lhs, %rhs : tensor<6xi8>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntTensor" }, { "name": "rhs", "type": "MHLO_IntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.sign", "summary": "Sign operation", "description": "Returns the sign of the `operand` element-wise and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sign\n\n Example:\n ```mlir\n %result = mhlo.sign %operand : tensor<7xf32>\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[ MHLO_SInt, MHLO_Float, MHLO_Complex, HLO_QuantizedInt ]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[ MHLO_SInt, MHLO_Float, MHLO_Complex, HLO_QuantizedInt ]>" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.sine", "summary": "Sine operation", "description": "Performs element-wise sine operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sine\n\n Example:\n ```mlir\n %result = mhlo.sine %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.sinh", "summary": "Sinh operation", "description": "Performs element-wise sinh operation on `operand` tensor and produces a\n `result` tensor.\n\n Example:\n ```mlir\n %result = mhlo.sinh %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_AnyFpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_AnyFpOrComplexTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.slice", "summary": "Slice operation", "description": "Extracts a slice from the `operand` using statically-computed starting\n indices and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#slice\n\n Example:\n ```mlir\n %result = \"mhlo.slice\" (%operand) {\n start_indices = dense<[1, 2]> : tensor<2xi64>,\n limit_indices = dense<[3, 4]> : tensor<2xi64>,\n strides = dense<1> : tensor<2xi64>\n } : (tensor<3x4xi64>) -> tensor<2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "start_indices", "type": "I64ElementsAttr" }, { "name": "limit_indices", "type": "I64ElementsAttr" }, { "name": "strides", "type": "I64ElementsAttr" } ], "traits": [ { "type": "AllTypesMatch<['start_indices', 'limit_indices', 'strides']>" } ] }, { "name": "mhlo.sort", "summary": "Sort operation", "description": "Sorts a variadic number of tensors in `inputs` together, according to a\n custom `comparator`, along the given `dimension` and produces a variadic\n number of tensors as `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sort\n\n Example:\n ```mlir\n %result0, %result1 = \"mhlo.sort\"(%input0, %input1) ({\n ^bb0(%arg0: tensor, %arg1: tensor, %arg2: tensor, %arg3: tensor):\n %predicate = \"mhlo.compare\"(%arg0, %arg1) {\n comparison_direction = #stablehlo\n } : (tensor, tensor) -> tensor\n \"mhlo.return\"(%predicate) : (tensor) -> ()\n }) {\n dimension = 0 : i64,\n is_stable = true\n } : (tensor<2x3xi32>, tensor<2x3xi32>) -> (tensor<2x3xi32>, tensor<2x3xi32>)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stable", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "comparator", "type": "SizedRegion<1>" } ] }, { "name": "mhlo.sqrt", "summary": "Sqrt operation", "description": "Performs element-wise square root operation on `operand` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sqrt\n\n Example:\n ```mlir\n %result = mhlo.sqrt %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.stochastic_convert", "summary": "StochasticConvert operation", "description": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/295.\n\n Informally, this operation performs element-wise conversion of values from\n a bigger type to a smaller one with stochastic rounding using the random\n number passed in.", "operands": [ { "name": "operand", "type": "MHLO_FpTensor" }, { "name": "random", "type": "RankedTensorOf<[MHLO_UInt]>" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ] }, { "name": "mhlo.subtract", "summary": "Subtract operation", "description": "Performs element-wise subtraction of two tensors `lhs` and `rhs` and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#subtract\n\n Example:\n ```mlir\n %result = mhlo.subtract %lhs, %rhs : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "mhlo.tan", "summary": "Tan operation", "description": "This operation is a work in progress, so it is not yet included in\n the specification: https://github.com/openxla/stablehlo/issues/954.\n\n Informally, this operation returns `Tan(operand)` element-wise.\n\n Example:\n ```mlir\n %0 = mhlo.tan %arg0 : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.tanh", "summary": "Tanh operation", "description": "Performs element-wise hyperbolic tangent operation on `operand` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#tanh\n\n Example:\n ```mlir\n %result = mhlo.tanh %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.topk", "summary": "TopK operation", "description": "Returns top `k` values and their indices, along the last\n dimension of the operand if `largest=true` or the bottom `k` values if\n `largest=false`.\n\n If `is_stable=true` (the default), the original relative order of equal\n elements is preserved. If `is_stable=false`, the order of equal elements\n is undefined, which may allow for more efficient execution on some backends.\n\n See:\n https://www.tensorflow.org/xla/operation_semantics#top-k\n\n Example:\n ```mlir\n %values, %indices = mhlo.topk(%operand, k=5, largest=true)\n : tensor<100xf32> -> (tensor<5xf32>, tensor<5xi32>)\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "values", "type": "MHLO_Tensor" }, { "name": "indices", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "k", "type": "I64Attr" }, { "name": "largest", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stable", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "`(`$operand `,` `k` `=` $k (`,` `largest` `=` $largest^)? (`,` `is_stable` `=` $is_stable^)? `)` attr-dict `:`\n type($operand) `->` `(`type($values)`,` type($indices)`)`" }, { "name": "mhlo.torch_index_select", "summary": "TorchIndexSelect operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as PyTorch's index_select,\n augmented with support for batch dimensions:\n https://pytorch.org/docs/stable/generated/torch.index_select.html.\n\n The `batch_dims` attribute specifies the number of major batch dimensions\n (0 or more) that act like a multidimensional loop over both the operand and\n the index.\n\n Example:\n ```mlir\n %result = \"mhlo.torch_index_select\"(%operand, %index) {\n dim = 2 : i64,\n batch_dims = 1 : i64\n } : (tensor<8x128x3072x64xf32>, tensor<8x16x1024xi32>) -> tensor<8x128x16x1024x64xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" }, { "name": "index", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" }, { "name": "batch_dims", "type": "I64Attr" } ] }, { "name": "mhlo.trace", "summary": "Trace operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the specification: https://github.com/openxla/stablehlo/issues/604.\n\n It is not used by JAX, PyTorch or TensorFlow, so it looks like we should've\n classified it as \"Private to XLA\" and not included it in StableHLO in the\n first place. With that in mind, its semantics will not be documented here.\n\n Example:\n ```mlir\n mhlo.trace %arg0, \"In test code.\" : tensor<5x1x5xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "tag", "type": "StrAttr" } ], "assemblyFormat": "$operand `,` $tag attr-dict `:` type($operand)" }, { "name": "mhlo.transpose", "summary": "Transpose operation", "description": "Permutes the dimensions of `operand` tensor using `permutation` and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#transpose\n\n Example:\n ```mlir\n %0 = mhlo.transpose %arg0, dims = [2, 1, 0] : (tensor<1x2x3xi32>) -> tensor<3x2x1xi32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_Tensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "attributes": [ { "name": "permutation", "type": "I64ElementsAttr" } ] }, { "name": "mhlo.triangular_solve", "summary": "TriangularSolve operation", "description": "Solves batches of systems of linear equations with lower or upper triangular\n coefficient matrices.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#triangular_solve\n\n Example:\n ```mlir\n %result = \"mhlo.triangular_solve\"(%a, %b) {\n left_side = true,\n lower = true,\n unit_diagonal = false,\n transpose_a = #stablehlo\n } : (tensor<3x3xf32>, tensor<3x3xf32>) -> tensor<3x3xf32>\n ```", "operands": [ { "name": "a", "type": "MHLO_FpOrComplexTensor" }, { "name": "b", "type": "MHLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpOrComplexTensor" } ], "attributes": [ { "name": "left_side", "type": "BoolAttr" }, { "name": "lower", "type": "BoolAttr" }, { "name": "unit_diagonal", "type": "BoolAttr" }, { "name": "transpose_a", "type": "MHLO_TransposeAttr{TRANSPOSE_INVALID|NO_TRANSPOSE|TRANSPOSE|ADJOINT}" } ] }, { "name": "mhlo.tuple", "summary": "Tuple operation", "description": "Produces a `result` tuple from values `val`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#tuple\n\n Example:\n ```mlir\n %result = mhlo.tuple %val0, %val1 : tuple, tuple>>\n ```", "operands": [ { "name": "val", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MHLO_Tuple" } ], "assemblyFormat": "$val attr-dict `:` custom(type($val), type($result))" }, { "name": "mhlo.unary_einsum", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "attributes": [ { "name": "einsum_config", "type": "StrAttr" } ] }, { "name": "mhlo.uniform_dequantize", "summary": "UniformDequantize operation", "description": "Performs element-wise conversion of quantized tensor `operand` to a\n floating-point tensor `result` according to the quantization parameters\n defined by the `operand` type.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#uniform_dequantize\n\n Example:\n ```mlir\n %result = mhlo.uniform_dequantize %operand : (tensor<16x16x!quant.uniform>) -> tensor<16x16xf32>\n ```", "operands": [ { "name": "operand", "type": "MHLO_QuantizedIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.uniform_quantize", "summary": "UniformQuantize operation", "description": "Performs element-wise conversion of floating-point tensor or quantized\n tensor `operand` to a quantized tensor `result` according to the\n quantization parameters defined by the `result` type.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#uniform_quantize\n\n Example:\n ```mlir\n %result = mhlo.uniform_quantize %operand : (tensor<16x16xf32>) -> tensor<16x16x!quant.uniform>\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[ MHLO_Float, MHLO_QuantizedInt ]>" } ], "results": [ { "name": "result", "type": "MHLO_QuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict\n `:` custom(type($operand), type($result))" }, { "name": "mhlo.while", "summary": "While operation", "description": "Produces the output from executing `body` function 0 or more times while the\n `cond` function outputs `true`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#while\n\n Example:\n ```mlir\n %results0, %results1 = \"mhlo.while\"(%operand0, %operand1) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"mhlo.compare\"(%arg0, %arg1) {\n comparison_direction = #stablehlo\n } : (tensor, tensor) -> tensor\n \"mhlo.return\"(%0) : (tensor) -> ()\n }, {\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"mhlo.add\"(%arg0, %constant0) : (tensor, tensor) -> tensor\n \"mhlo.return\"(%0, %arg1) : (tensor, tensor) -> ()\n }) : (tensor, tensor) -> (tensor, tensor)\n ```", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "cond", "type": "SizedRegion<1>" }, { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "mhlo.xla.rng_get_and_update_state", "summary": "XlaRngGetAndUpdateState operation", "description": "This operation is private to the XLA compiler, so it is does not yet have\n a specification.\n\n Informally, this operation represents the change of the global random number\n generator state for rng instructions. The global state is incremented by\n delta and the old state is returned.\n\n The output is currently defined for a single output type. If this changes in\n the future to support multiple types, lowering to use of a global memref\n must ensure that a single memref is still used and updated appropriately.", "results": [ { "name": "result", "type": "StaticShapeTensorOf<[UI64]>" } ], "attributes": [ { "name": "delta", "type": "I64Attr" } ], "assemblyFormat": "attr-dict" }, { "name": "mhlo.xor", "summary": "Xor operation", "description": "Performs element-wise XOR of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#xor\n\n Example:\n ```mlir\n %result = mhlo.xor %lhs, %rhs : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "MHLO_PredOrIntTensor" }, { "name": "rhs", "type": "MHLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "MHLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "michelson.get_amount", "summary": "Get the amount of the current transaction.", "description": "The `michelson.get_amount` operation returns the amount of the current transaction.\n\n Example:\n ```mlir\n %0 = michelson.get_amount() : !michelson.mutez\n ```", "results": [ { "name": "res", "type": "MichelsonMutez" } ] }, { "name": "migraphx.abs", "summary": "Elementwise abs", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.add", "summary": "Elementwise add of two shaped values with broadcast", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.backwards_data_convolution", "summary": "Backwards data convolution", "description": "The `migraphx.backwards_data_convolution` op computes a transposed\n convolution op which effectively reverses a standard convolution's\n spatial transformation. It is an upsampling technique that increases\n the height and width of an input feature map.", "operands": [ { "name": "input", "type": "MIXRShapedOf<[F32, F16, BF16]>" }, { "name": "filter", "type": "MIXRShapedOf<[F32, F16, BF16]>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf<[F32, F16, BF16]>" } ], "attributes": [ { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilation", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "I64Attr" }, { "name": "padding_mode", "type": "OptionalAttr" }, { "name": "perf_config", "type": "OptionalAttr" } ], "assemblyFormat": "$input `,` $filter attr-dict\n `:` type($input) `,` type($filter) `->` type($output)" }, { "name": "migraphx.batch_norm_inference", "summary": "batch_norm_inference", "description": "The `migraphx.batch_norm_inference` op computes batch_norm.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" }, { "name": "a", "type": "AnyMIXRShaped" }, { "name": "b", "type": "AnyMIXRShaped" }, { "name": "c", "type": "AnyMIXRShaped" }, { "name": "d", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "momentum", "type": "F32Attr" }, { "name": "bn_mode", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` type(operands) `->` type($output)" }, { "name": "migraphx.broadcast", "summary": "Broadcast tensor", "description": "The `migraphx.broadcast` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "out_lens", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.ceil", "summary": "Elementwise ceil", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.clip", "summary": "Elementwise clip", "description": "Elementwise clip: output = min(max(x, minVals), maxVals)", "operands": [ { "name": "x", "type": "AnyMIXRShaped" }, { "name": "minVals", "type": "AnyMIXRShaped" }, { "name": "maxVals", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$x `,` $minVals `,` $maxVals attr-dict\n `:` type($x) `,` type($minVals) `,` type($maxVals) `->` type($output)" }, { "name": "migraphx.code_object", "summary": "OP representing a code object", "description": "The `migraphx.code_object` op. Holds the compiled kernel binary and arguments.", "operands": [ { "name": "kernelArgs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "kernel", "type": "SymbolRefAttr" }, { "name": "globalSize", "type": "TypedArrayAttrBase" }, { "name": "localSize", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "attr-dict `(`$kernelArgs`)` `:` `(`type($kernelArgs)`)` `->` type($outputs)" }, { "name": "migraphx.convert", "summary": "Elementwise type conversion", "description": "Type conversion. Due to impedance mismatches between MIGraphX and Tosa,\n currently only supports float to float conversions", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `to` type($output)" }, { "name": "migraphx.convolution", "summary": "convolution forward", "description": "The `migraphx.convolution` op computes convolution forward.", "operands": [ { "name": "input", "type": "MIXRShapedOf<[F32, F16, BF16, F8E4M3FNUZ, F8E5M2FNUZ, F8E5M2, F8E4M3FN]>" }, { "name": "filter", "type": "MIXRShapedOf<[F32, F16, BF16, F8E4M3FNUZ, F8E5M2FNUZ, F8E5M2, F8E4M3FN]>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf<[F32, F16, BF16, F8E4M3FNUZ, F8E5M2FNUZ, F8E5M2, F8E4M3FN]>" } ], "attributes": [ { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilation", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "I64Attr" }, { "name": "padding_mode", "type": "OptionalAttr" }, { "name": "perf_config", "type": "OptionalAttr" } ], "assemblyFormat": "$input `,` $filter attr-dict\n `:` type($input) `,` type($filter) `->` type($output)" }, { "name": "migraphx.dequantizelinear", "summary": "Channelwise dequantization", "description": "De-Quantization tensor channelwise. It computes the following:\n tensor[n,c,h,w] = to_float(tensor[n,c,h,w] - quantBias[c]) * quantScale[c]", "operands": [ { "name": "input", "type": "MIXRShapedOf<[AnyInteger, AnyFloat]>" }, { "name": "scale", "type": "MIXRShapedOf<[AnyFloat]>" }, { "name": "bias", "type": "Optional>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf<[AnyFloat]>" } ], "assemblyFormat": "$input `,` $scale (`,` $bias^)? attr-dict\n `:` type($input) `,` type($scale) (`,` type($bias)^)? `->` type($output)" }, { "name": "migraphx.div", "summary": "Elementwise div of two shaped values with broadcast", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.dot", "summary": "Dot product of tensors", "description": "The `migraphx.dot` op computes the dot product of two tensors.", "operands": [ { "name": "in_a", "type": "MIXRShapedOf" }, { "name": "in_b", "type": "MIXRShapedOf" } ], "results": [ { "name": "output", "type": "MIXRShapedOf" } ], "assemblyFormat": "$in_a `,` $in_b attr-dict `:` type($in_a) `,` type($in_b) `->` type($output)" }, { "name": "migraphx.equal", "summary": "Elementwise equality comparison", "description": "Returns the truth value of (input1 == input2) element-wise.\n\n Returns a tensor with the same element type as the inputs (not i1) to\n match MIGraphX's IR representation. This allows direct use with\n `migraphx.where`, which requires I8/SI8/UI8 condition tensors.", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.erf", "summary": "Gauss error function", "description": "compute gauss error function", "operands": [ { "name": "inA", "type": "MIXRShapedOf<[AnyFloat]>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf<[AnyFloat]>" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.exp", "summary": "Elementwise exp", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.flatten", "summary": "Flatten tensor", "description": "The `migraphx.flatten` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.floor", "summary": "Elementwise floor", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.greater", "summary": "Elementwise greater of two shaped values with broadcast", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.literal", "summary": "MIGraphX literal op", "description": "A MLIR operation corresponding to MIGraphX's literals.\n\n The provided value should be a tensor containing the bytes of the relevant\n literal or a splat tensor. Non-splat tensors must be in standard form.", "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` type($output)" }, { "name": "migraphx.log", "summary": "Elementwise log", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.mlir.as.logical.shape", "summary": "View an input shaped type as its logical shape", "description": "Convert a MIXR shaped value to a tensor, ensuring that reads from the tensor\n lead to reads from the underlying memory implied by the strides.\n\n In the case of a standard-layout type, this is a noop.\n\n When dealing with non-standard layouts, such as NHWC tensors, this will\n lower to `tosa.transpose` and potentially `tosa.slice` and/or a broadcast\n by way of `tosa.add`.\n\n Strides that don't neatly form a (padded) rectangle, that is, cases where\n (ignoring broadcasted dimensions), you can't permute the nonzero strides into\n [s1, ..., sL] such that sL is 1 and sK = prod_(i = K + 1)^L s_i with\n and sK >= prod_(i = K + 1)^L size_i , are unsupported\n\n Equivalently, you have to be able to create a tensor type that you can then\n `tosa.transpose`, `tosa.slice`, and then potentially broadcast to get the\n logical shape, otherwise we can't easily evaluate the correctness of kernels\n during testing.\n\n That is, unpacked shapes like !mixr.shaped<3x2xf32, 2x6> are unsupported.", "operands": [ { "name": "in", "type": "AnyMIXRShaped" } ], "results": [ { "name": "out", "type": "AnyRankedTensor" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "migraphx.mlir.as.underlying.shape", "summary": "View a logical tensor as its underlying shape in memory", "description": "Convert a tensor to a MIXR shaped type, such that writes to it (after\n bufferization) lead to the memory locations indicated by the strides in\n the underlying shaped type.\n\n In the case of a standard-layout type, this is a noop.\n\n When dealing with non-standard layouts, such as NHWC tensors, this will\n lower to tosa.transpose.\n\n Currently, the operation must be implementable as `tosa.transpose`, that is,\n the strides of the underlying memory must be a permutation of the strides\n that would be used if the type were in standard form. That is, types like\n `!migraphx.shaped<3x2xf32, 4x1>` or `!migraphx.shaped<3x2xf32, 2x6>` are\n unsupported.", "operands": [ { "name": "in", "type": "AnyRankedTensor" } ], "results": [ { "name": "out", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$in attr-dict `:` type($in) `to` type($out)" }, { "name": "migraphx.mul", "summary": "Elementwise mul of two shaped values with broadcast", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.multibroadcast", "summary": "Broadcast tensor in multiple dimensions", "description": "The `migraphx.multibroadcast` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "out_lens", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.neg", "summary": "Elementwise neg", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.pad", "summary": "Pad operation", "description": "The `migraphx.pad` op adds padding to the tensor.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "F32Attr" }, { "name": "mode", "type": "PadOpModeAttr{constant_pad|reflect_pad|edge_pad}" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.pooling", "summary": "Pooling operation", "description": "The `migraphx.pooling` op computes average/max pooling op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "mode", "type": "StrAttr" }, { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "length", "type": "TypedArrayAttrBase" }, { "name": "ceil_mode", "type": "I64Attr" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.pow", "summary": "Elementwise pow of two shaped values with broadcast", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.quant_convolution", "summary": "quantized convolution forward", "description": "The `migraphx.quant_convolution` op computes quantized convolution forward.", "operands": [ { "name": "input", "type": "MIXRShapedOf<[F8E4M3FNUZ, F8E5M2FNUZ, F8E5M2, F8E4M3FN, I8, SI8]>" }, { "name": "filter", "type": "MIXRShapedOf<[F8E4M3FNUZ, F8E5M2FNUZ, F8E5M2, F8E4M3FN, I8, SI8]>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf<[F32, I32, SI32]>" } ], "attributes": [ { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilation", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "I64Attr" }, { "name": "padding_mode", "type": "OptionalAttr" }, { "name": "perf_config", "type": "OptionalAttr" } ], "assemblyFormat": "$input `,` $filter attr-dict\n `:` type($input) `,` type($filter) `->` type($output)" }, { "name": "migraphx.quant_dot", "summary": "Dot product of quantized tensors", "description": "The `migraphx.quant_dot` op computes the dot product of two tensors. This operation is used when converting MIGraphX IR's quant_dot operation to MIGraphX Dialect. \n Usually `migraphx.quant_dot` operations have QuantizeLinear and DequantizeLinear operations to convert data types from higher precision to lower precision. \n `migraphx.quant_dot` operation is also used for \"scaled\" GEMMs.", "operands": [ { "name": "in_a", "type": "MIXRShapedOf" }, { "name": "in_b", "type": "MIXRShapedOf" }, { "name": "scaleA", "type": "Optional>" }, { "name": "scaleB", "type": "Optional>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$in_a (`scaled` `by` $scaleA^)? `,` $in_b (`scaled` `by` $scaleB^)? attr-dict\n `:` type($in_a) (`scaled` `by` type($scaleA)^)? `,` type($in_b)\n (`scaled` `by` type($scaleB)^)?\n `->` type($output)" }, { "name": "migraphx.quantizelinear", "summary": "Channelwise quantization", "description": "Quantization tensor channelwise. It computes the following:\n tensor[n,c,h,w] = clamping_truncate(round(tensor[n,c,h,w] / quantScale[c]) + quantBias[c])", "operands": [ { "name": "input", "type": "MIXRShapedOf<[AnyFloat]>" }, { "name": "scale", "type": "MIXRShapedOf<[AnyFloat]>" }, { "name": "bias", "type": "Optional>" } ], "results": [ { "name": "output", "type": "MIXRShapedOf<[AnyInteger, AnyFloat]>" } ], "assemblyFormat": "$input `,` $scale (`,` $bias^)? attr-dict\n `:` type($input) `,` type($scale) (`,` type($bias)^)? `->` type($output)" }, { "name": "migraphx.recip", "summary": "Elementwise recip", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.reduce_max", "summary": "Get the max of the values in given axis", "description": "The `migraphx.reduce_max` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.reduce_mean", "summary": "Get the mean of the values in given axis", "description": "The `migraphx.reduce_mean` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.reduce_sum", "summary": "Get the sum of the values in given axis", "description": "The `migraphx.reduce_sum` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.relu", "summary": "Elementwise relu", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.reshape", "summary": "reshape a tensor", "description": "The `migraphx.reshape` op.\n\n `dims` can contain values of -1 and 0. A value of -1 means to infer this \n dimension from the others. i.e., If we have an output shape of\n `<4x2xf32, 0x1>` and the dims are `[4, -1]`, then the second dimension will\n be inferred to be 2. A value of 0 means explicit zero-length dimension.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "dims", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.rsqrt", "summary": "Elementwise rsqrt", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.sigmoid", "summary": "Elementwise sigmoid", "description": "Sigmoid function, aka 1 / (1 + exp(-x)).", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.slice", "summary": "slice a tensor", "description": "The `migraphx.slice` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" }, { "name": "ends", "type": "TypedArrayAttrBase" }, { "name": "starts", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.softmax", "summary": "softmax operation", "description": "The `migraphx.softmax` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.sqrt", "summary": "Elementwise sqrt", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.sub", "summary": "Elementwise sub of two shaped values with broadcast", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA `,` $inB attr-dict\n `:` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.tanh", "summary": "Elementwise tanh", "operands": [ { "name": "inA", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$inA attr-dict `:` type($inA) `->` type($output)" }, { "name": "migraphx.transpose", "summary": "transpose dimensions", "description": "The `migraphx.transpose` op.", "operands": [ { "name": "input", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "attributes": [ { "name": "permutation", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($output)" }, { "name": "migraphx.unpack", "summary": "Unpack int4 values stored as bytes", "description": "Given a shaped tensor of bytes, double the length of `axis` by\n ```\n out[..., 2*i, ...] = in[..., i, ...] & 0xf\n out[..., 2*i + 1, ...] = in[ ..., i, ...] >>[unsigned] 4\n ```\n\n That is, the `axis` dimension of `in` consists of, in MLIR terms,\n `vector<2xi4>`, which we then turn into `vector<2xi8>` by zero-extension\n and then we flatten out the elements back into `axis`.\n\n To enable MLIR rewrites, this can also take a tensor of i4 and return\n the corresponding tensor of i8 (in which case, the `i4` are exposed as an\n extra dimension and not flattened) or another tensor of i4. This allows us to\n progressively move unpack up to function boundaries.", "operands": [ { "name": "in", "type": "MIXRShapedOf<[I8, UI8, SI8, I<4>, SI<4>, UI<4>]>" } ], "results": [ { "name": "out", "type": "MIXRShapedOf<[I8, UI8, SI8, I<4>, SI<4>, UI<4>]>" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "assemblyFormat": "$in attr-dict `:` type($in) `->` type($out)" }, { "name": "migraphx.where", "summary": "Elementwise select", "description": "output[x] = cond[x] ? inA[x] : inB[x]", "operands": [ { "name": "cond", "type": "MIXRShapedOf<[I8, SI8, UI8]>" }, { "name": "inA", "type": "AnyMIXRShaped" }, { "name": "inB", "type": "AnyMIXRShaped" } ], "results": [ { "name": "output", "type": "AnyMIXRShaped" } ], "assemblyFormat": "$cond `,` $inA `,` $inB attr-dict\n `:` type($cond) `,` type($inA) `,` type($inB) `->` type($output)" }, { "name": "migraphx.yield", "summary": "Terminator for MIGraphX regions", "description": "Terminates a region in a MIGraphX operation (e.g., the preSoftmaxBody\n of migraphx.attention), yielding a value back to the enclosing op.", "operands": [ { "name": "value", "type": "Optional" } ], "assemblyFormat": "($value^ `:` type($value))? attr-dict" }, { "name": "ml_program.func", "summary": "Function containing a single `SSACFG` region", "description": "This simple function container represents callables in an ML program where\n the body is an `SSACFG` region. It must be terminated by a `return` op which\n yields values with the same arity and types as the `FunctionType` results\n of the containing `func`.\n\n This op is a `Symbol` but does not introduce a new `SymbolTable`. As such,\n it cannot represent nested symbols.\n\n Example:\n\n ```mlir\n ml_program.func private @some_extern(i32) -> i32\n ml_program.func @compute(%arg0 : i32) -> i32 {\n ml_program.return %arg0 : i32\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "ml_program.global", "summary": "Module level declaration of a global variable", "description": "Declares a named global variable (or constant).\n\n A global contains a value of a specified type which can be accessed at\n runtime via appropriate load/store operations. It can be mutable or\n constant, optionally taking an initial value or declared as\n extern (in which case, the initial value is found in external storage\n by symbol name).\n\n Generally, the type of the global and the type of the initial value\n will be the same. However, for type hierarchies which can have a more\n generalized bounding type that can be assigned from a narrow type, this\n is allowed (but not verified).\n\n Examples:\n\n ```mlir\n // Constant global.\n ml_program.global @foobar(dense<4> : tensor<4xi32>) : tensor\n\n // Constant with external linkage.\n ml_program.global mutable @foobar(#ml_program.extern>)\n : tensor\n\n // Mutable global with an undefined initial value.\n ml_program.global mutable @foobar : tensor\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "value", "type": "OptionalAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name ``\n custom($type, $value)\n attr-dict" }, { "name": "ml_program.global_load", "summary": "Direct load of a mutable value from a global", "description": "Performs a non-atomic, non-volatile, non-synchronized load from a global\n that may be mutable.\n\n It is fully expected that these constraints are not suitable for\n all situations, and alternative ops should be defined and used for more\n advanced cases.\n\n This op is side effecting and may not be valid to use in graph regions\n without additional consideration to evaluation order constraints. See\n `global_load_graph` for op which allows for explicit ordering constraints.\n\n Example:\n\n ```mlir\n %0 = ml_program.global_load @foobar : tensor\n ```", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "global", "type": "SymbolRefAttr" } ], "assemblyFormat": "$global `:` type($result) attr-dict" }, { "name": "ml_program.global_load_const", "summary": "Direct load a constant value from a global", "description": "Loads a constant (immutable) value from a global directly by symbol.\n\n This op is only legal for globals that are not mutable and exists because\n such a load can be considered to have no side effects.\n\n Example:\n\n ```mlir\n %0 = ml_program.global_load_const @foobar : tensor\n ```", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "global", "type": "SymbolRefAttr" } ], "assemblyFormat": "$global `:` type($result) attr-dict" }, { "name": "ml_program.global_load_graph", "summary": "Direct load of a mutable value from a global in Graph region", "description": "Performs a non-atomic, non-volatile, non-synchronized load from a global\n that may be mutable.\n\n It is fully expected that these constraints are not suitable for all\n situations, and alternative ops should be defined and used for more advanced\n cases.\n\n This op is side effecting and may not be valid to use in graph regions\n without additional consideration to evaluation order constraints.\n\n Example:\n\n ```mlir\n %0, %cstr = ml_program.global_load_graph @foobar\n ordering (%token -> !ml_program.token) : tensor\n ```", "operands": [ { "name": "consumeTokens", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" }, { "name": "produceToken", "type": "MLProgram_TokenType" } ], "attributes": [ { "name": "global", "type": "SymbolRefAttr" } ], "assemblyFormat": "$global `` custom($consumeTokens, type($produceToken)) `:` type($result) attr-dict" }, { "name": "ml_program.global_store", "summary": "Direct store of a value into a mutable global", "description": "Performs a non-atomic, non-volatile, non-synchronized store to a mutable\n global.\n\n It is fully expected that these constraints are not suitable for\n all situations, and alternative ops should be defined and used for more\n advanced cases.\n\n This op is side effecting and may not be valid to use in graph regions\n without additional consideration to evaluation order constraints. See\n `global_store_graph` for op which allows for explicit ordering constraints.\n\n Example:\n\n ```mlir\n ml_program.global_store @foobar = %0 : tensor\n ```", "operands": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "global", "type": "SymbolRefAttr" } ], "assemblyFormat": "$global `=` $value `:` type($value) attr-dict" }, { "name": "ml_program.global_store_graph", "summary": "Direct store of a value into a mutable global", "description": "Performs a non-atomic, non-volatile, non-synchronized store to a mutable\n global.\n\n It is fully expected that these constraints are not suitable for\n all situations, and alternative ops should be defined and used for more\n advanced cases.\n\n This op is side effecting and may not be valid to use in graph regions\n without additional consideration to evaluation order constraints.\n\n Example:\n\n ```mlir\n %token = ml_program.global_store @foobar = %0 : tensor\n ordering (%in_token -> !ml_program.token) : tensor\n ```", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "consumeTokens", "type": "Variadic" } ], "results": [ { "name": "produceToken", "type": "MLProgram_TokenType" } ], "attributes": [ { "name": "global", "type": "SymbolRefAttr" } ], "assemblyFormat": "$global `=` $value `` custom($consumeTokens, type($produceToken)) `:` type($value) attr-dict" }, { "name": "ml_program.output", "summary": "Outputs values from a subgraph function", "description": "The `output` operation terminates a subgraph by yielding values\n to the caller.\n The operation takes variable number of operands and produces no results.\n The operand number and types must match the signature of the function\n that contains the operation.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "ml_program.return", "summary": "Returns values from a `func` function", "description": "The `return` operation terminates a `func` function by yielding values\n to the caller.\n The operation takes variable number of operands and produces no results.\n The operand number and types must match the signature of the function\n that contains the operation.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "ml_program.subgraph", "summary": "An function containing a single `Graph` region", "description": "This simple function container represents callables in an ML program where\n the body is a `Graph` region containing a single block. It must be\n terminated by an `output` op which yields values with the same arity and\n types as the `FunctionType` results of the containing `subgraph`.\n\n This op is a `Symbol` but does not introduce a new `SymbolTable`. As such,\n it cannot represented nested symbols.\n\n Example:\n\n ```mlir\n ml_program.subgraph private @some_extern(i32) -> i32\n ml_program.subgraph @compute(%arg0 : i32) -> i32 {\n ml_program.output %arg0 : i32\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "ml_program.token", "summary": "Produces a new token value", "description": "Token values are used to chain side effecting ops in a graph so as to\n establish an execution order. This op produces a token.", "results": [ { "name": "token", "type": "MLProgram_TokenType" } ], "assemblyFormat": "attr-dict" }, { "name": "mlrt.allocate_control_futures", "summary": "Allocate futures and corresponding promises", "description": "Allocate futures and corresponding promises.\n\n $num: The number of futures to be allocated.\n\n $promises: There are $num promises, and promises[i] shares the state with futures[i].\n $futures: There are $num futures, and futures[i] shares the state with promises[i].", "results": [ { "name": "promises", "type": "Variadic" }, { "name": "futures", "type": "Variadic" } ], "attributes": [ { "name": "num", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "mlrt.async", "summary": "Launches a function asynchronously.", "description": "Launch a function asynchronously.\n\n $args: a list of arguments to be passed.\n $callee: The function to be launched. Its return op must not have operands.\n\n $handle: This op returns a handle object that manages the context of the async execution.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "MlrtAsyncHandleType" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $args `)` attr-dict `:` functional-type($args, $handle)" }, { "name": "mlrt.await_all_control", "summary": "Awaits multiple signals", "description": "Awaits multiple signals\n\n $futures: A list of !mlrt.futures", "operands": [ { "name": "futures", "type": "Variadic" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` type($futures)" }, { "name": "mlrt.await_all_handle", "summary": "Awaits multiple async executions", "description": "Awaits multiple async execution.\n\n $handles: A list of handles returned by mlrt.async ops.", "operands": [ { "name": "handles", "type": "Variadic" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` type($handles)" }, { "name": "mlrt.await_control", "summary": "Await a signal from a future", "description": "Await a signal, instead of a value, from a future.\n\n $future: A value of !mlrt.future type.", "operands": [ { "name": "future", "type": "MlrtFutureType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "mlrt.await_handle", "summary": "Awaits an async execution", "description": "Awaits an async execution.\n\n $handle: The handle returned by mlrt.async op.", "operands": [ { "name": "handle", "type": "MlrtAsyncHandleType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "mlrt.case", "summary": "An n-way switch statement which calls a single branch function.", "description": "An n-way switch statement, implementing the following:\n ```\n switch (branch_index) {\n case 0:\n outputs = branches[0](inputs);\n break;\n case 1:\n outputs = branches[1](inputs);\n break;\n ...\n case [[nbranches-1]]:\n default:\n outputs = branches[nbranches-1](inputs);\n break;\n }\n ```\n Example: %res = mlrt.case %branch_idx [@branch0, @branch1] (%arg0, %arg1) : (i32, i32) -> (i32)", "operands": [ { "name": "branch_index", "type": "I32" }, { "name": "branch_operands", "type": "Variadic" } ], "results": [ { "name": "branch_outputs", "type": "Variadic" } ], "attributes": [ { "name": "branches", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$branch_index $branches `(` $branch_operands `)` attr-dict `:` `(` type($branch_operands) `)` `->` `(` type($branch_outputs) `)`" }, { "name": "mlrt.cond", "summary": "mlrt.cond op", "description": "Execute $a_true_fn with $args if $cond is true; otherwise, %b_false_fn is\n executed.", "operands": [ { "name": "cond", "type": "I1" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "a_true_fn", "type": "SymbolRefAttr" }, { "name": "b_false_fn", "type": "SymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$cond $a_true_fn $b_false_fn `(` $args `)` attr-dict `:` `(` type($args) `)` `->` `(` type($results) `)`" }, { "name": "mlrt.promise_control", "summary": "Set a control promise", "description": "Set a control promise.\n\n $promise: A value of !mlrt.promise type.", "operands": [ { "name": "promise", "type": "MlrtPromiseType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "mlrt.while", "summary": "while operation", "description": "cond: The boolean to control whether the first iteration should be\n executed.\n operands: The arguments to the first iteration.\n results: The results of the last iteration. The number and types of results\n excluding the last one are the same as the number and types of operands. The\n last element of results is an I1 value that is false.\n body_fn: The body function that takes the arguments and returns the results\n that includes an I1 value to indicate whether next iteration should be executed.\n\n The pseudo code:\n\n while(cond) {\n results = body_fn(operands)\n cond = results#1\n }\n return results", "operands": [ { "name": "cond", "type": "I1" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "body_fn", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$cond $body_fn `(` $arguments `)` attr-dict `:` `(` type($arguments) `)` `->` `(` type(results) `)`" }, { "name": "mpi.allgather", "summary": "Equivalent to `MPI_Allgather(sendbuf, sendcount, sendtype,\n recvbuf, recvcount, recvtype,\n comm)`.", "description": "MPI_Allgather collects data from all processes in a given communicator and\n stores the gathered data in the receive buffer of each process.\n\n Each process contributes the same amount of data defined by `sendbuf`.\n The MPI call specifies the number of elements contributed by each process\n via the `recvcount` parameter. However, this operation, assumes `recvbuf`\n to be sufficiently large to hold the data contributed by all processes.\n Therefore, `recvcount` is implicitly defined as\n `num_elements(recvbuf) / MPI_Comm_size(comm)`.\n\n This operation may optionally return an !mpi.retval value, which can be\n used for error checking.", "operands": [ { "name": "sendbuf", "type": "AnyMemRef" }, { "name": "recvbuf", "type": "AnyMemRef" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "`(` $sendbuf `,` $recvbuf `,` $comm `)` attr-dict `:` type($sendbuf) `,` type($recvbuf) (`->` type($retval)^)?" }, { "name": "mpi.allreduce", "summary": "Equivalent to `MPI_Allreduce(sendbuf, recvbuf, op, comm)`", "description": "MPI_Allreduce performs a reduction operation on the values in the sendbuf\n array and stores the result in the recvbuf array. The operation is \n performed across all processes in the communicator.\n\n The `op` attribute specifies the reduction operation to be performed.\n Currently only the `MPI_Op` predefined in the standard (e.g. `MPI_SUM`) are\n supported.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "sendbuf", "type": "AnyMemRef" }, { "name": "recvbuf", "type": "AnyMemRef" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" } ], "attributes": [ { "name": "op", "type": "MPI_ReductionOpEnum{MPI_OP_NULL|MPI_MAX|MPI_MIN|MPI_SUM|MPI_PROD|MPI_LAND|MPI_BAND|MPI_LOR|MPI_BOR|MPI_LXOR|MPI_BXOR|MPI_MINLOC|MPI_MAXLOC|MPI_REPLACE}" } ], "assemblyFormat": "`(` $sendbuf `,` $recvbuf `,` $op `,` $comm `)` attr-dict `:` type($sendbuf) `,` type($recvbuf) (`->` type($retval)^)?" }, { "name": "mpi.barrier", "summary": "Equivalent to `MPI_Barrier(comm)`", "description": "MPI_Barrier blocks execution until all processes in the communicator have\n reached this routine.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "`(` $comm `)` attr-dict\n (`->` type($retval)^)?" }, { "name": "mpi.comm_rank", "summary": "Get the current rank, equivalent to `MPI_Comm_rank(comm, &rank)`", "description": "This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" }, { "name": "rank", "type": "I32" } ], "assemblyFormat": "`(` $comm `)` attr-dict `:` type(results)" }, { "name": "mpi.comm_size", "summary": "Get the size of the group associated to the communicator, equivalent to `MPI_Comm_size(comm, &size)`", "description": "This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" }, { "name": "size", "type": "I32" } ], "assemblyFormat": "`(` $comm `)` attr-dict `:` type(results)" }, { "name": "mpi.comm_split", "summary": "Partition the group associated with the given communicator into disjoint subgroups", "description": "This operation splits the communicator into multiple sub-communicators.\n The color value determines the group of processes that will be part of the\n new communicator. The key value determines the rank of the calling process\n in the new communicator.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "comm", "type": "MPI_Comm" }, { "name": "color", "type": "I32" }, { "name": "key", "type": "I32" } ], "results": [ { "name": "retval", "type": "Optional" }, { "name": "newcomm", "type": "MPI_Comm" } ], "assemblyFormat": "`(` $comm `,` $color `,` $key `)` attr-dict `:` type(results)" }, { "name": "mpi.comm_world", "summary": "Get the World communicator, equivalent to `MPI_COMM_WORLD`", "description": "This operation returns the predefined MPI_COMM_WORLD communicator.", "results": [ { "name": "comm", "type": "MPI_Comm" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "mpi.error_class", "summary": "Get the error class from an error code, equivalent to the `MPI_Error_class` function", "description": "`MPI_Error_class` maps return values from MPI calls to a set of well-known\n MPI error classes.", "operands": [ { "name": "val", "type": "MPI_Retval" } ], "results": [ { "name": "errclass", "type": "MPI_Retval" } ], "assemblyFormat": "$val attr-dict `:` type($val)" }, { "name": "mpi.finalize", "summary": "Finalize the MPI library, equivalent to `MPI_Finalize()`", "description": "This function cleans up the MPI state. Afterwards, no MPI methods may \n be invoked (excpet for MPI_Get_version, MPI_Initialized, and MPI_Finalized).\n Notably, MPI_Init cannot be called again in the same program.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "attr-dict (`:` type($retval)^)?" }, { "name": "mpi.init", "summary": "Initialize the MPI library, equivalent to `MPI_Init(NULL, NULL)`", "description": "This operation must preceed most MPI calls (except for very few exceptions,\n please consult with the MPI specification on these).\n\n Passing &argc, &argv is not supported currently.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "attr-dict (`:` type($retval)^)?" }, { "name": "mpi.irecv", "summary": "Equivalent to `MPI_Irecv(ptr, size, dtype, source, tag, comm, &req)`", "description": "MPI_Irecv begins a non-blocking receive of `size` elements of type `dtype` \n from rank `source`. The `tag` value and communicator enables the library to\n determine the matching of multiple sends and receives between the same \n ranks.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "ref", "type": "AnyMemRef" }, { "name": "tag", "type": "I32" }, { "name": "source", "type": "I32" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" }, { "name": "req", "type": "MPI_Request" } ], "assemblyFormat": "`(` $ref `,` $tag `,` $source `,` $comm`)` attr-dict `:` type($ref) `,` type($tag) `,` type($source)`->` type(results)" }, { "name": "mpi.isend", "summary": "Equivalent to `MPI_Isend(ptr, size, dtype, dest, tag, comm)`", "description": "MPI_Isend begins a non-blocking send of `size` elements of type `dtype` to\n rank `dest`. The `tag` value and communicator enables the library to\n determine the matching of multiple sends and receives between the same\n ranks.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "ref", "type": "AnyMemRef" }, { "name": "tag", "type": "I32" }, { "name": "dest", "type": "I32" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" }, { "name": "req", "type": "MPI_Request" } ], "assemblyFormat": "`(` $ref `,` $tag `,` $dest `,` $comm`)` attr-dict `:` type($ref) `,` type($tag) `,` type($dest) `->` type(results)" }, { "name": "mpi.recv", "summary": "Equivalent to `MPI_Recv(ptr, size, dtype, source, tag, comm, MPI_STATUS_IGNORE)`", "description": "MPI_Recv performs a blocking receive of `size` elements of type `dtype` \n from rank `source`. The `tag` value and communicator enables the library to\n determine the matching of multiple sends and receives between the same \n ranks.\n\n The MPI_Status is set to `MPI_STATUS_IGNORE`, as the status object \n is not yet ported to MLIR.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "ref", "type": "AnyMemRef" }, { "name": "tag", "type": "I32" }, { "name": "source", "type": "I32" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "`(` $ref `,` $tag `,` $source `,` $comm `)` attr-dict `:` type($ref) `,` type($tag) `,` type($source) (`->` type($retval)^)?" }, { "name": "mpi.reduce_scatter_block", "summary": "Equivalent to `MPI_Reduce_scatter_block(sendbuf, recvbuf, recvcount, dtype, op, comm)`", "description": "MPI_Reduce_scatter_block first performs an element-wise reduction on the\n sendbuf across all processes in the communicator, then scatters the result\n by distributing equal-sized blocks to each process into recvbuf.\n\n The `op` attribute specifies the reduction operation to be performed.\n Currently only the `MPI_Op` predefined in the standard (e.g. `MPI_SUM`) are\n supported.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "sendbuf", "type": "AnyNon0RankedMemRef" }, { "name": "recvbuf", "type": "AnyNon0RankedMemRef" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" } ], "attributes": [ { "name": "op", "type": "MPI_ReductionOpEnum{MPI_OP_NULL|MPI_MAX|MPI_MIN|MPI_SUM|MPI_PROD|MPI_LAND|MPI_BAND|MPI_LOR|MPI_BOR|MPI_LXOR|MPI_BXOR|MPI_MINLOC|MPI_MAXLOC|MPI_REPLACE}" } ], "assemblyFormat": "`(` $sendbuf `,` $recvbuf `,` $op `,` $comm `)` attr-dict `:` type($sendbuf) `,` type($recvbuf) (`->` type($retval)^)?" }, { "name": "mpi.retval_check", "summary": "Check an MPI return value against an error class", "description": "This operation compares MPI status codes to known error class\n constants such as `MPI_SUCCESS`, or `MPI_ERR_COMM`.", "operands": [ { "name": "val", "type": "MPI_Retval" } ], "results": [ { "name": "res", "type": "I1" } ], "attributes": [ { "name": "errclass", "type": "MPI_ErrorClassAttr{MPI_SUCCESS|MPI_ERR_ACCESS|MPI_ERR_AMODE|MPI_ERR_ARG|MPI_ERR_ASSERT|MPI_ERR_BAD_FILE|MPI_ERR_BASE|MPI_ERR_BUFFER|MPI_ERR_COMM|MPI_ERR_CONVERSION|MPI_ERR_COUNT|MPI_ERR_DIMS|MPI_ERR_DISP|MPI_ERR_DUP_DATAREP|MPI_ERR_ERRHANDLER|MPI_ERR_FILE|MPI_ERR_FILE_EXISTS|MPI_ERR_FILE_IN_USE|MPI_ERR_GROUP|MPI_ERR_INFO|MPI_ERR_INFO_KEY|MPI_ERR_INFO_NOKEY|MPI_ERR_INFO_VALUE|MPI_ERR_IN_STATUS|MPI_ERR_INTERN|MPI_ERR_IO|MPI_ERR_KEYVAL|MPI_ERR_LOCKTYPE|MPI_ERR_NAME|MPI_ERR_NO_MEM|MPI_ERR_NO_SPACE|MPI_ERR_NO_SUCH_FILE|MPI_ERR_NOT_SAME|MPI_ERR_OP|MPI_ERR_OTHER|MPI_ERR_PENDING|MPI_ERR_PORT|MPI_ERR_PROC_ABORTED|MPI_ERR_QUOTA|MPI_ERR_RANK|MPI_ERR_READ_ONLY|MPI_ERR_REQUEST|MPI_ERR_RMA_ATTACH|MPI_ERR_RMA_CONFLICT|MPI_ERR_RMA_FLAVOR|MPI_ERR_RMA_RANGE|MPI_ERR_RMA_SHARED|MPI_ERR_RMA_SYNC|MPI_ERR_ROOT|MPI_ERR_SERVICE|MPI_ERR_SESSION|MPI_ERR_SIZE|MPI_ERR_SPAWN|MPI_ERR_TAG|MPI_ERR_TOPOLOGY|MPI_ERR_TRUNCATE|MPI_ERR_TYPE|MPI_ERR_UNKNOWN|MPI_ERR_UNSUPPORTED_DATAREP|MPI_ERR_UNSUPPORTED_OPERATION|MPI_ERR_VALUE_TOO_LARGE|MPI_ERR_WIN|MPI_ERR_LASTCODE}" } ], "assemblyFormat": "$val `=` $errclass attr-dict `:` type($res)" }, { "name": "mpi.send", "summary": "Equivalent to `MPI_Send(ptr, size, dtype, dest, tag, comm)`", "description": "MPI_Send performs a blocking send of `size` elements of type `dtype` to rank\n `dest`. The `tag` value and communicator enables the library to determine \n the matching of multiple sends and receives between the same ranks.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "ref", "type": "AnyMemRef" }, { "name": "tag", "type": "I32" }, { "name": "dest", "type": "I32" }, { "name": "comm", "type": "MPI_Comm" } ], "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "`(` $ref `,` $tag `,` $dest `,` $comm `)` attr-dict `:` type($ref) `,` type($tag) `,` type($dest)(`->` type($retval)^)?" }, { "name": "mpi.wait", "summary": "Equivalent to `MPI_Wait(req, MPI_STATUS_IGNORE)`", "description": "MPI_Wait blocks execution until the request has completed.\n\n The MPI_Status is set to `MPI_STATUS_IGNORE`, as the status object \n is not yet ported to MLIR.\n\n This operation can optionally return an `!mpi.retval` value that can be used\n to check for errors.", "operands": [ { "name": "req", "type": "MPI_Request" } ], "results": [ { "name": "retval", "type": "Optional" } ], "assemblyFormat": "`(` $req `)` attr-dict `:` type($req) (`->` type($retval) ^)?" }, { "name": "mpmd.assign", "summary": "assign operation", "description": "Assigns a local tensor to a mesh as fully replicated within that mesh.\n\n This is a temporary op that is introduced when lowering jax ops, to move\n from local types to mesh types. These ops will be eliminated during import,\n when the inputs and results of the func op become mesh tensors.\n\n The mesh name of the result type should correspond to a mesh in the\n topology, and its global type should be identical to the operand type.\n\n The origin of the assign op is the origin of mesh, e.g. named_computation,\n mesh inference, etc.", "operands": [ { "name": "tensor", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "Mpmd_MeshTensorType" } ], "attributes": [ { "name": "origin", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict $tensor `:` functional-type(operands, results)" }, { "name": "mpmd.broadcast", "summary": "broadcast operation", "description": "Allows for a tensor to be transferred (or replicated) in any mesh where it's\n used. Whenever transferred, the origin of the transfer is the current\n location of the operand.", "operands": [ { "name": "tensor", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $tensor `:` type($tensor)" }, { "name": "mpmd.call", "summary": "MPMD specific call function", "description": "A function call operation. Useful to wrap the body of loops in function\n declarations to reduce code size, for example.", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee `(` $tensors `)` attr-dict `:` functional-type(operands, results)" }, { "name": "mpmd.for", "summary": "For operator", "description": "Returns the result of executing a body function for a fixed number of\n iterations, with the iteration index available in the body.\n\n An optional unroll factor, that must divide the number of iterations,\n can be specified to unroll the body of the op by that factor, i.e. for\n unroll factor N, the body is replicated to create N copies and the number of\n iterations is reduced by a factor of 1/N. Each copy except the first uses\n the results of the previous copy instead of the block arguments, and the\n iteration index is multiplied by the unroll factor and incremented after\n every copy.\n\n A for operator can accept and return any types, but the TypeID of these\n must be the same -- e.g. all tensor types or all MPMD mesh types etc. This\n allows us to use the op at various levels, sharing implementation and\n transformations.", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "iterations", "type": "UI32Attr" }, { "name": "unroll_factor", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "mpmd.fragment", "summary": "fragment operation", "description": "Assigns a computation, i.e. a block of operations, to a specific mesh in an\n MPMD topology, that is intended to be executed as an individual SPMD program\n fragment.\n\n The fragment takes and returns only mesh tensors that are assigned to the\n same mesh as the fragment.\n\n The mesh name of the fragment should correspond to a mesh in the topology.\n\n The fragment includes a list of origins, i.e., metadata with information re\n the original named_computations that formed this fragment, and a staged_id\n defined _iff_ it is a user defined fragment, i.e., it has a non-empty list\n of origins. The optional in_shardings specifies the sharding of the\n block arguments of a fragment, which correspond to the operands.\n The optional out_shardings specifies the shardings of the results.\n\n The fragment's region shouldn't have any free variables, and the type of\n each block arguments and returned values in the region is the global tensor\n type of the corresponding mesh tensor.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "origin", "type": "TypedArrayAttrBase" }, { "name": "mesh_name", "type": "StrAttr" }, { "name": "stage_id", "type": "OptionalAttr" }, { "name": "in_shardings", "type": "OptionalAttr" }, { "name": "out_shardings", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "mpmd.fragment_call", "summary": "fragment call operation", "description": "Represents a call to a function that holds an MPMD fragment body, i.e. a\n computation assigned to a specific mesh in an MPMD topology, that is\n intended to be executed as an individual SPMD program fragment.\n\n The mesh name of the fragment should correspond to a mesh in the topology of\n the enclosing function, and that mesh shape should match that of the callee.\n\n The origin specifies the user named computations that contributed to this\n fragment call e.g. through merging.\n\n The function input and result types of the callee must be the local tensor\n types of the corresponding mesh tensors of this op's operands and results\n respectively.\n\n Example:\n\n ```mlir\n %2 = mpmd.fragment_call @my_fragment(%0, %1) :\n (mesh_tensor<...>, mesh_tensor<...>) -> mesh_tensor<...>\n ```", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "origin", "type": "TypedArrayAttrBase" }, { "name": "mesh_name", "type": "StrAttr" }, { "name": "callee", "type": "FlatSymbolRefAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "mpmd.named_computation", "summary": "named scope operation", "description": "Groups a computation, i.e. a block of operations, and gives it a name and\n a transpose count via the UserOrigin attribute. This NamedComputation can be\n used to assign a mesh to the computation in MPMD or for optimizations.\n\n The transpose count (default=0) denotes whether the named computation has\n been produced by a certain number of JAX AD transpose transformations.\n\n The op's region shouldn't have any free variables, and the type of\n each block arguments and returned values in the region must be the same as\n the type of the inputs and the return type of the op.", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "origin", "type": "Mpmd_UserOrigin" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "mpmd.named_tensor", "summary": "Assign a tensor to a mesh", "description": "An identity op that associates the result of the tensor with a given name.\n This NamedTensor can be used to assign a mesh to the tensor in MPMD.\n\n NOTE: this is different than TagOp in that TagOp is used for naming a tensor\n and can be used to partition that tensor. NamedTensorOp is for MPMD programs\n for tensors that may be explicitly assigned to meshes.", "operands": [ { "name": "tensor", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$tensor `name````=```$name attr-dict `:` type($result)" }, { "name": "mpmd.reduce", "summary": "cross-mesh reduce operation", "description": "Allows for a tensor to be reduced across different meshes, and then\n broadcast to wherever it needs to be used.", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "reduction", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`` $reduction attr-dict $tensors `:` functional-type(operands, results)", "hasCustomAssemblyFormat": true }, { "name": "mpmd.return", "summary": "The `mpmd.return` operation terminates the regions attached to mpmd\n region-based ops. It is variadic: it takes as arguments a list of values\n whose types can be any (but of the same kind, e.g. `AnyTensor`) and\n therefore can be reused at various levels of the MPMD IR stack.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict $results (`:` type($results)^)?" }, { "name": "mpmd.transfer", "summary": "transfer operation", "description": "Transfers a distributed tensor from one mesh to another.\n\n The mesh names of the operand and result types should correspond to meshes\n in the topology, and their global types should be identical.", "operands": [ { "name": "tensor", "type": "Mpmd_MeshTensorType" } ], "results": [ { "name": "result", "type": "Mpmd_MeshTensorType" } ], "assemblyFormat": "attr-dict $tensor `:` functional-type(operands, results)" }, { "name": "mpmd.unassign", "summary": "unassign operation", "description": "Unassigns a fully replicated tensor from a mesh.\n\n This is a temporary op that is introduced when lowering jax ops, to move\n from local types to mesh types. These ops will be eliminated during import,\n when the inputs and results of the func op become mesh tensors.\n\n The mesh name of the operand type should correspond to a mesh in the\n topology, and its global type should be identical to the result type.", "operands": [ { "name": "tensor", "type": "Mpmd_MeshTensorType" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "origin", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict $tensor `:` functional-type(operands, results)" }, { "name": "noisy.add", "summary": "Addition operation between noisy ints. Adds noise.", "operands": [ { "name": "lhs", "type": "Noisy_I32" }, { "name": "rhs", "type": "Noisy_I32" } ], "results": [ { "name": "output", "type": "Noisy_I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($output))" }, { "name": "noisy.decode", "summary": "Decodes a noisy integer to a regular integer, failing if the noise is too high.", "operands": [ { "name": "input", "type": "Noisy_I32" } ], "results": [ { "name": "output", "type": "AnyIntOfWidths<[1, 2, 3, 4, 5]>" } ], "assemblyFormat": "$input attr-dict `:` qualified(type($input)) `->` type($output)" }, { "name": "noisy.encode", "summary": "Encodes a noisy i32 from a small-width integer, injecting 12 bits of noise.", "operands": [ { "name": "input", "type": "AnyIntOfWidths<[1, 2, 3, 4, 5]>" } ], "results": [ { "name": "output", "type": "Noisy_I32" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` qualified(type($output))" }, { "name": "noisy.mul", "summary": "Multiplication operation between noisy ints. Multiplies noise.", "operands": [ { "name": "lhs", "type": "Noisy_I32" }, { "name": "rhs", "type": "Noisy_I32" } ], "results": [ { "name": "output", "type": "Noisy_I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($output))" }, { "name": "noisy.reduce_noise", "summary": "Reduces the noise in a noisy integer to a fixed noise level. Expensive!", "operands": [ { "name": "input", "type": "Noisy_I32" } ], "results": [ { "name": "output", "type": "Noisy_I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input attr-dict `:` qualified(type($output))" }, { "name": "noisy.sub", "summary": "Subtraction operation between noisy ints. Adds noise.", "operands": [ { "name": "lhs", "type": "Noisy_I32" }, { "name": "rhs", "type": "Noisy_I32" } ], "results": [ { "name": "output", "type": "Noisy_I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($output))" }, { "name": "nvg.cluster_id", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict" }, { "name": "nvg.device_async_copy", "summary": "device-side asynchronous copy", "description": "The `nvgpu.device_async_copy` op initiates an asynchronous copy operation of\n elements from source (global memory) to the destination (shared memory)\n without blocking the thread. The async copy is added to a group.\n\n This op is meant to be used with `nvgpu.device_async_create_group` and\n `nvgpu.device_async_wait` to synchronize copies as explained in those ops\n descriptions.\n\n `bypassL1` attribute is hint to the hardware to bypass the L1 cache during\n async copy, this hint may be ignored by the hardware.\n\n `dstElements` attribute is the total number of elements written to\n destination (shared memory).\n\n `srcElements` argument is the total number of elements read from\n source (global memory).\n\n `srcElements` is an optional argument and when present the op only reads\n `srcElements` number of elements from the source (global memory) and zero fills\n the rest of the elements in the destination (shared memory).\n\n In order to do a copy and wait for the result we need the following\n combination:\n ```\n // copy 1.\n %cp1 = nvgpu.device_async_copy %A[%c0], %B[%c0], 4 :memref<16xf32> to memref<16xf32, 3>\n // copy 2.\n %cp2 = nvgpu.device_async_copy %C[%c0], %D[%c0], 4 : memref<16xf32> to memref<16xf32, 3>\n // group 1 contains copy 1 and copy 2.\n %token1 = nvgpu.device_async_create_group %cp1, %cp2\n // copy 3.\n %cp3 = nvgpu.device_async_copy %E[%c0], %F[%c0], 4 : memref<16xf32> to memref<16xf32, 3>\n // group 2 contains copy 3.\n %token2 = nvgpu.device_async_create_group %cp3\n // after the wait copy 1 and copy 2 are complete.\n nvgpu.device_async_wait %token1\n // after the wait copy 3 is complete.\n nvgpu.device_async_wait %token2\n ```\n\n Example:\n\n ```mlir\n %0 = nvgpu.device_async_copy %src[%c0, %c0], %dst[%c0, %c0, %c0], 4 :\n memref<4x5xf32> to memref<2x7x5xf32, 3>\n ```", "operands": [ { "name": "dst", "type": "AnyMemRef" }, { "name": "dstIndices", "type": "Variadic" }, { "name": "src", "type": "AnyMemRef" }, { "name": "srcIndices", "type": "Variadic" }, { "name": "srcElements", "type": "Optional" } ], "results": [ { "name": "asyncToken", "type": "NVGPU_DeviceAsyncToken" } ], "attributes": [ { "name": "dstElements", "type": "IndexAttr" }, { "name": "bypassL1", "type": "OptionalAttr" } ], "assemblyFormat": "$src `[` $srcIndices `]` `,` $dst `[` $dstIndices `]` `,` $dstElements (`,` $srcElements^)?\n attr-dict `:` type($src) `to` type($dst)" }, { "name": "nvg.device_async_create_group", "summary": "device side asynchronous create group operation", "description": "The `nvgpu.device_async_create_group` op creates a group of memory accesses\n containing all the pending `device_async_copy` operations associated with\n argument tokens. Each token can only be part of one group.\n\n It returns a token that can be use to wait until the group fully completes.\n\n This is meant to be used with `nvgpu.device_async_wait` to synchronize copies\n as explained in those ops descriptions.\n\n Groups are executed in the order they are created.\n\n Example:\n\n ```mlir\n %0 = nvgpu.device_async_create_group\n ```", "operands": [ { "name": "inputTokens", "type": "Variadic" } ], "results": [ { "name": "asyncToken", "type": "NVGPU_DeviceAsyncToken" } ], "assemblyFormat": "$inputTokens attr-dict" }, { "name": "nvg.device_async_wait", "summary": "Wait for async gpu ops to complete.", "description": "The `nvgpu.device_async_wait` op will block the execution thread until the group\n associated with the source token is fully completed.\n\n The optional `$numGroups` attribute gives an upper bound of the number of\n groups uncompleted when the wait can unblock the thread. For example, if\n 16 async groups are pushe and `$numGroups` is set to 12, then the thread\n will unblock when 12 groups or fewer are in flight (4 groups have\n completed).\n\n Example:\n\n ```mlir\n nvgpu.device_async_wait %0\n ```", "operands": [ { "name": "asyncDependencies", "type": "NVGPU_DeviceAsyncToken" } ], "attributes": [ { "name": "numGroups", "type": "OptionalAttr" } ], "assemblyFormat": "$asyncDependencies attr-dict" }, { "name": "nvg.ld_acquire", "operands": [ { "name": "addr", "type": "LLVM_PointerGlobal" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "NVGPU_ScalarLike" } ], "attributes": [ { "name": "sem", "type": "NVGPU_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "NVGPU_MemSyncScopeAttr{gpu|cta|sys}" } ], "assemblyFormat": "$sem `,` $scope `,` $addr (`,` $mask^)? attr-dict `:` functional-type($addr, $result)" }, { "name": "nvg.ldmatrix", "description": "The `nvgpu.ldmatrix` op represents loading a matrix fragment from\n memory to registers. The source and result type must be compatible\n with lowering to the `nvvm.ldmatrix` instruction. This op represents\n the distributed version of a `vector.transfer_read` as an intermediate\n step between lowering from `vector.transfer_read` to `nvvm.ldmatrix`.\n\n This operation is meant to follow the semantic of described here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-ldmatrix\n\n Example:\n ```mlir\n %0 = nvgpu.ldmatrix %sm[%c0, %c0] {numTiles = 4 : i32, transpose = false} :\n memref -> vector<4x2xf16>\n ```", "operands": [ { "name": "srcMemref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "res", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "transpose", "type": "BoolAttr" }, { "name": "numTiles", "type": "I32Attr" } ], "assemblyFormat": "$srcMemref`[` $indices `]` attr-dict `:` type($srcMemref) `->` type($res)" }, { "name": "nvg.mbarrier.arrive", "summary": "Performs arrive operation on the `nvgpu.mbarrier.arrive`.", "description": "The Op performs arrive-on operation on the `mbarrier` object and returns a \n `nvgpu.mbarrier.token`.\n\n For more information, see\n https://docs.nvidia.com/cuda/parallel-thread-execution/#arrive-on-operation-on-mbarrier-object\n\n Example:\n ```mlir\n %token = nvgpu.mbarrier.arrive %barrier : !nvgpu.mbarrier.barrier> -> !nvgpu.mbarrier.token\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "mbarId", "type": "Index" } ], "results": [ { "name": "token", "type": "NVGPU_MBarrierToken" } ], "assemblyFormat": "$barriers `[` $mbarId `]` attr-dict `:` type($barriers) `->` type($token)" }, { "name": "nvg.mbarrier.arrive.expect_tx", "summary": "Performs expect_tx operation on the `nvgpu.mbarrier.arrive`", "description": "A thread executing the Op performs an expect-tx operation on the mbarrier \n object at the location specified by the address operand $barrier. The \n expect-tx operation, with an $txcount argument, increases the tx-count of \n an mbarrier object by the value specified by $txcount. This makes the \n current phase of the mbarrier object to expect and track the completion of \n additional asynchronous transactions.\n \n The `$txCount` specifies the number of element to the expect-tx operation.\n\n Example:\n ```mlir\n nvgpu.mbarrier.arrive.expect_tx %barrier, %ic0 : !nvgpu.mbarrier.barrier>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "txcount", "type": "Index" }, { "name": "mbarId", "type": "Index" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $txcount (`,` `predicate` `=` $predicate^)? attr-dict `:` type($barriers)" }, { "name": "nvg.mbarrier.arrive.nocomplete", "summary": "Performs arrive operation on the `nvgpu.mbarrier.arrive.nocomplete` as non-blocking.", "description": "The Op performs arrive-on operation on the `mbarrier` object and returns a \n `nvgpu.mbarrier.token`.\n\n The Op does not cause the `nvgpu.mbarrier` to complete its current phase.\n\n Example:\n ```mlir\n %token = nvgpu.mbarrier.arrive.noComplete %barrier, %count : !nvgpu.mbarrier.barrier> -> !nvgpu.mbarrier.token\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "mbarId", "type": "Index" }, { "name": "count", "type": "Index" } ], "results": [ { "name": "token", "type": "NVGPU_MBarrierToken" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $count attr-dict `:` type($barriers) `->` type($token)" }, { "name": "nvg.mbarrier.create", "summary": "Creates a `nvgpu.mbarrier` object.", "description": "The Op generates one or more `mbarrier` object, which is a barrier created in \n shared memory and supports various synchronization behaviors for threads.\n\n The `mbarrier` object has the following type and alignment requirements:\n Type: .b64, Alignment: 8, Memory space: .shared\n \n Example:\n ```mlir\n %barrier = nvgpu.mbarrier.create -> !nvgpu.mbarrier.barrier>\n ```", "results": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" } ], "assemblyFormat": "attr-dict `->` type($barriers)" }, { "name": "nvg.mbarrier.get", "summary": "Return a pointer to an `nvgpu.mbarrier`.", "description": "The `nvgpu.mbarrier.get` operation retrieves a pointer to a specific \n `mbarrier` object from a group of barriers created by the `nvgpu.mbarrier.create` operation.\n\n Example:\n ```mlir\n %mbars = nvgpu.mbarrier.create -> !nvgpu.mbarrier.group, num_barriers = 10>\n %mbar_pointer = nvgpu.mbarrier.get %mbars[%c2] : !nvgpu.mbarrier.group>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "mbarId", "type": "Index" } ], "results": [ { "name": "mbarrierPointer", "type": "AnyTypeOf<[I32, I64]>" } ], "assemblyFormat": "$barriers `[` $mbarId `]` attr-dict `:` type($barriers) `->` type($mbarrierPointer)" }, { "name": "nvg.mbarrier.init", "summary": "Initialize the `nvgpu.mbarrier`.", "description": "The Op initializes the `mbarrier` object with the given number of threads.\n\n Example:\n ```mlir\n %num_threads = gpu.block_dim x\n %barrier = nvgpu.mbarrier.create -> !nvgpu.mbarrier.barrier>\n nvgpu.mbarrier.init %barrier, %num_threads : !nvgpu.mbarrier.barrier>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "count", "type": "Index" }, { "name": "mbarId", "type": "Index" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $count (`,` `predicate` `=` $predicate^)? attr-dict `:` type($barriers)" }, { "name": "nvg.mbarrier.test.wait", "summary": "Checks if the `nvgpu.mbarrier` has completed its current phase.", "description": "Checks whether the mbarrier object has completed the phase. It is is a \n non-blocking instruction which tests for the completion of the phase.\n\n Example:\n ```mlir\n %isComplete = nvgpu.mbarrier.test.wait %barrier, %token : !nvgpu.mbarrier.barrier>, !nvgpu.mbarrier.token\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "token", "type": "NVGPU_MBarrierToken" }, { "name": "mbarId", "type": "Index" } ], "results": [ { "name": "waitComplete", "type": "I1" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $token attr-dict `:` type($barriers) `,` type($token)" }, { "name": "nvg.mbarrier.try_wait.parity", "summary": "Waits for the `nvgpu.mbarrier` to complete its current phase.", "description": "Checks whether the mbarrier object has completed the phase. It is is a \n potentially blocking instruction which tests for the completion of the \n phase. Suspended thread resumes execution when the specified phase completes \n OR before the phase completes following a system-dependent time limit. \n\n The `$phaseParity` specifies either even phase (0) or odd phase (1) to \n wait.\n\n Example:\n ```mlir\n nvgpu.mbarrier.try_wait.parity %barrier, %phaseParity, %ticks : !nvgpu.mbarrier.barrier>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "phaseParity", "type": "I1" }, { "name": "ticks", "type": "Index" }, { "name": "mbarId", "type": "Index" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $phaseParity `,` $ticks attr-dict `:` type($barriers)" }, { "name": "nvg.mma.sp.sync", "description": "The `nvgu.mma.sp.sync` operation performs a warp-distributed MMA operation\n where operand A is \"structured sparse\". In this case, the `matrixA` operand\n represents the (warp-distributed) non-zero values of operand A, and the\n `sparse_metadata` operand provides the indices.\n\n The full description of the sparsity storage format and distribution scheme is\n described in the PTX docs. This operation is meant to follow the semantic\n described in the PTX documentation here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-for-sparse-mma\n\n The way the indices are distributed among the threads in a warp is controlled\n by the optional `sparsity_selector` operand, which is `0` by default. For\n more information, please consult the PTX documentation linked above.\n\n Example (targetingthe f16 16x8x32 `mma.sp` PTX instruction):\n\n ```mlir\n nvgpu.mma.sp.sync (%a, %b, %c) metadata (%meta) {mmaShape = [16, 8, 32]} :\n (vector<4x2xf16>, vector<2x2xf16>, vector<2x2xf16>) -> vector<2x2xf16>\n ```", "operands": [ { "name": "matrixA", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixB", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixC", "type": "AnyVectorOfNonZeroRank" }, { "name": "sparseMetadata", "type": "NVGPU_MmaSparseSyncMetadataType" } ], "results": [ { "name": "res", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "mmaShape", "type": "TypedArrayAttrBase" }, { "name": "sparsitySelector", "type": "DefaultValuedAttr" }, { "name": "tf32Enabled", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $matrixA`,` $matrixB`,` $matrixC `)` `metadata` `(` $sparseMetadata `)` attr-dict\n `:` `(` type($matrixA) `,` type($matrixB) `,` type($matrixC) `)` `->` type($res)" }, { "name": "nvg.mma.sync", "description": "The `nvgpu.mma.sync` op represents the warp-level matrix-multiply-and-\n accumulate (mma) operation that is compatible with `nvvm.mma.sync`.\n The operands and results vector sizes are thread-level onwership to\n the warp-level mma operation shape. `mmaShape` attribute holds the\n warp-level matrix-multiply shape.\n\n The `nvgpu.mma.sync` op serves as an intermediate point between lowering from\n `vector.contract` to `nvvm.mma.sync`.\n\n This operation is meant to follow the semantic of described here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-mma\n\n Example:\n\n ```mlir\n %res = nvgpu.mma.sync (%matrixA, %matrixB, %matrixC) {mmaShape = [16, 8, 16]} :\n (vector<4x2xf16>, vector<2x2xf16>, vector<2x2xf32>) -> vector<2x2xf32>\n ```", "operands": [ { "name": "matrixA", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixB", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixC", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "res", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "mmaShape", "type": "TypedArrayAttrBase" }, { "name": "tf32Enabled", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $matrixA`,` $matrixB`,` $matrixC `)` attr-dict\n `:` `(` type($matrixA) `,` type($matrixB) `,` type($matrixC) `)` `->` type($res)" }, { "name": "nvg.rcp", "summary": "The reciprocal calculation for vector types", "description": "Reciprocal calculation for `vector` types using `nvvm.rcp` OPs.\n\n Currently, only the `approx` rounding mode and `ftz` are supported, and only for the `f32` type.\n\n The input and output must be of the same vector type and shape.", "operands": [ { "name": "in", "type": "VectorOfNonZeroRankOf<[F32]>" } ], "results": [ { "name": "out", "type": "VectorOfNonZeroRankOf<[F32]>" } ], "attributes": [ { "name": "rounding", "type": "DefaultValuedAttr" }, { "name": "ftz", "type": "UnitAttr" } ], "assemblyFormat": "$in `{` `rounding` `=` $rounding (`,` `ftz` $ftz^)? `}` \n attr-dict `:` type($out)" }, { "name": "nvg.tensor_memory_base", "description": "Op to represent base address of tensor memory in a kernel.\n This is used to simplify lowering from TritonGPU to LLVM.", "results": [ { "name": "result", "type": "LLVM_PointerTensorMemory" } ], "assemblyFormat": "attr-dict" }, { "name": "nvg.tma.async.load", "summary": "TMA asynchronous load", "description": "The Op loads a tile memory region from global memory to shared memory by \n Tensor Memory Access (TMA).\n \n `$tensorMapDescriptor` is tensor map descriptor which has information about\n tile shape. The descriptor is created by `nvgpu.tma.create.descriptor`\n\n The Op uses `$barrier` mbarrier based completion mechanism.", "operands": [ { "name": "dst", "type": "AnyMemRef" }, { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" }, { "name": "coordinates", "type": "Variadic" }, { "name": "mbarId", "type": "Index" }, { "name": "multicastMask", "type": "Optional" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$tensorMapDescriptor `[` $coordinates `]` `,` $barriers `[` $mbarId `]` \n `to` $dst\n (`multicast_mask` `=` $multicastMask^ )?\n (`,` `predicate` `=` $predicate^)?\n attr-dict `:` type($tensorMapDescriptor) `,` type($barriers) \n `->` type($dst)" }, { "name": "nvg.tma.async.store", "summary": "TMA asynchronous store", "description": "The Op store a tile memory region from global memory to shared memory by \n Tensor Memory Access (TMA).\n \n `$tensorMapDescriptor` is tensor map descriptor which has information about\n tile shape. The descriptor is created by `nvgpu.tma.create.descriptor`", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" }, { "name": "coordinates", "type": "Variadic" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$src `to` $tensorMapDescriptor `[` $coordinates `]`\n (`,` `predicate` `=` $predicate^)?\n attr-dict `:` type($src)\n `->` type($tensorMapDescriptor)" }, { "name": "nvg.tma.create.descriptor", "summary": "TMA create descriptor", "description": "The Op creates a tensor map descriptor object representing tiled memory \n region. To do that it calls CUDA Driver's `cuTensorMapEncodeTiled`. The \n descriptor is used by Tensor Memory Access (TMA).\n\n The `tensor` is the source tensor to be tiled. \n\n The `boxDimensions` is the size of the tiled memory region in each dimension.\n\n For more information see below:\n https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TENSOR__MEMORY.html", "operands": [ { "name": "tensor", "type": "AnyUnrankedMemRef" }, { "name": "boxDimensions", "type": "Variadic" } ], "results": [ { "name": "tensorMap", "type": "NVGPU_TensorMapDescriptor" } ], "assemblyFormat": "$tensor `box` `[` $boxDimensions `]` attr-dict `:` type($tensor) `->` type($tensorMap)" }, { "name": "nvg.tma.fence.descriptor", "summary": "Insert fence given `nvgpu.tensormap.descriptor`", "description": "The Op fences the given `$tmaDescriptor`. This is necessary if the tensor map\n descriptor was modified from the host using cudaMemcpy. In this case, the\n kernel needs a fence after which it is safe to use `tensor.map`.", "operands": [ { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" } ], "assemblyFormat": "$tensorMapDescriptor attr-dict `:` type($tensorMapDescriptor)" }, { "name": "nvg.tma.prefetch.descriptor", "summary": "Prefetch given `nvgpu.tensormap.descriptor`", "description": "The Op brings the cache line containing the given `$tmaDescriptor` for \n subsequent use by the `tma.async.load` instruction.", "operands": [ { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$tensorMapDescriptor (`,` `predicate` `=` $predicate^)? attr-dict `:` type($tensorMapDescriptor)" }, { "name": "nvg.warpgroup.generate.descriptor", "summary": "Generate a warpgroup matrix descriptor", "description": "This Op builds a `nvgpu.warpgroup.descriptor` that is used by \n `nvgpu.warpgroup.mma` to perform warpgroup-level matrix multiply and \n accumulate.\n\n The descriptor specifies the properties of the matrix in shared memory that \n is a multiplicand in the matrix multiply and accumulate operation.", "operands": [ { "name": "tensor", "type": "AnyMemRef" }, { "name": "tensorMap", "type": "NVGPU_TensorMapDescriptor" } ], "results": [ { "name": "descriptor", "type": "NVGPU_WarpgroupMatrixDescriptor" } ], "assemblyFormat": "$tensor `,` $tensorMap attr-dict `:` type($tensor) `,` type($tensorMap) `->` type($descriptor)" }, { "name": "nvg.warpgroup.mma", "description": "The `nvgpu.warpgroup.mma` op performs the warpgroup-level (4 warps) \n matrix-multiply-and-accumulate (mma) operation that results in \n `nvvm.wgmma.mma_async`. \n \n The operands are `descriptorA` and `descriptorB` that are wgmma matrix \n descriptors that shows the properties of the matrix in shared memory. The \n results are thread-level ownership to the warpgroup-level mma operation \n shape. The shape is deduced from the descriptor types and output vector.\n\n The Op encapsulates multiple `nvvm.wgmma.mma_async` operations to complete \n the given shape. As `nvvm.wgmma.async` Op, or its corresponding PTX \n instruction, is asynchronous, this Op groups the `nvvm.wgmma.async` and \n surrounds them between `wgmma.fence.aligned` and \n `wgmma.commit.group.sync.aligned`, `wgmma.wait.group.sync.aligned` Ops.\n\n Example:\n ```mlir\n %r1,%r2 = nvgpu.warpgroup.mma %descA, %descB, %acc1, %acc2: \n !nvgpu.warpgroup.descriptor>, \n !nvgpu.warpgroup.descriptor>, \n !nvgpu.warpgroup.accumulator>,\n !nvgpu.warpgroup.accumulator>\n -> \n !nvgpu.warpgroup.accumulator>,\n !nvgpu.warpgroup.accumulator>\n ```", "operands": [ { "name": "descriptorA", "type": "NVGPU_WarpgroupMatrixDescriptor" }, { "name": "descriptorB", "type": "NVGPU_WarpgroupMatrixDescriptor" }, { "name": "matrixC", "type": "NVGPU_WarpgroupAccumulator" } ], "results": [ { "name": "matrixD", "type": "NVGPU_WarpgroupAccumulator" } ], "attributes": [ { "name": "waitGroup", "type": "DefaultValuedOptionalAttr" }, { "name": "transposeA", "type": "OptionalAttr" }, { "name": "transposeB", "type": "OptionalAttr" } ], "assemblyFormat": "$descriptorA`,` $descriptorB`,` $matrixC attr-dict\n `:` type($descriptorA) `,` type($descriptorB) `,` type($matrixC) `->` type($matrixD)" }, { "name": "nvg.warpgroup.mma.init.accumulator", "summary": "Initializes the accumulator matrix", "description": "This Op generates and initializes the accumulator matrix for \n `nvgpu.warpgroup.mma` op to perform matrix-multiply-and-accumulate.", "results": [ { "name": "matrixC", "type": "NVGPU_WarpgroupAccumulator" } ], "assemblyFormat": "attr-dict `->` type($matrixC)" }, { "name": "nvg.warpgroup.mma.store", "description": "The `nvgpu.warpgroup.mma.store` op performs the store of fragmented result \n in $matrixD to given memref. \n\n [See the details of register fragment layout for accumulator matrix D]\n (https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#wgmma-64n16-d) \n\n Note that, the op must be run with warp group.", "operands": [ { "name": "matrixD", "type": "NVGPU_WarpgroupAccumulator" }, { "name": "dstMemref", "type": "AnyMemRef" } ], "assemblyFormat": "$matrixD `,` $dstMemref attr-dict `:` type($matrixD) `to` type($dstMemref)" }, { "name": "nvg.wgmma", "operands": [ { "name": "opA", "type": "WGMMA_OperandType" }, { "name": "opB", "type": "WGMMA_OperandType" }, { "name": "useC", "type": "I1" }, { "name": "opC", "type": "Optional" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "m", "type": "I32Attr" }, { "name": "n", "type": "I32Attr" }, { "name": "k", "type": "I32Attr" }, { "name": "eltTypeC", "type": "WGMMA_EltTypeAttr{s8|s32|e4m3|e5m2|f16|bf16|tf32|f32}" }, { "name": "eltTypeA", "type": "WGMMA_EltTypeAttr{s8|s32|e4m3|e5m2|f16|bf16|tf32|f32}" }, { "name": "eltTypeB", "type": "WGMMA_EltTypeAttr{s8|s32|e4m3|e5m2|f16|bf16|tf32|f32}" }, { "name": "layoutA", "type": "WGMMA_LayoutAttr{row|col}" }, { "name": "layoutB", "type": "WGMMA_LayoutAttr{row|col}" } ], "assemblyFormat": "$opA `,` $opB `,` $useC (`,` $opC^)? attr-dict `:` functional-type(operands, $res)" }, { "name": "nvg.wgmma_wait_group", "operands": [ { "name": "input", "type": "LLVM_AnyStruct" } ], "results": [ { "name": "output", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "pendings", "type": "I32Attr" } ], "traits": [ { "type": "AllTypesMatch<['input', 'output']>" } ], "assemblyFormat": "$input attr-dict `:` type($input)" }, { "name": "nvgpu.device_async_copy", "summary": "device-side asynchronous copy", "description": "The `nvgpu.device_async_copy` op initiates an asynchronous copy operation of\n elements from source (global memory) to the destination (shared memory)\n without blocking the thread. The async copy is added to a group.\n\n This op is meant to be used with `nvgpu.device_async_create_group` and\n `nvgpu.device_async_wait` to synchronize copies as explained in those ops\n descriptions.\n\n `bypassL1` attribute is hint to the hardware to bypass the L1 cache during\n async copy, this hint may be ignored by the hardware.\n\n `dstElements` attribute is the total number of elements written to\n destination (shared memory).\n\n `srcElements` argument is the total number of elements read from\n source (global memory).\n\n `srcElements` is an optional argument and when present the op only reads\n `srcElements` number of elements from the source (global memory) and zero fills\n the rest of the elements in the destination (shared memory).\n\n In order to do a copy and wait for the result we need the following\n combination:\n ```\n // copy 1.\n %cp1 = nvgpu.device_async_copy %A[%c0], %B[%c0], 4 :memref<16xf32> to memref<16xf32, 3>\n // copy 2.\n %cp2 = nvgpu.device_async_copy %C[%c0], %D[%c0], 4 : memref<16xf32> to memref<16xf32, 3>\n // group 1 contains copy 1 and copy 2.\n %token1 = nvgpu.device_async_create_group %cp1, %cp2\n // copy 3.\n %cp3 = nvgpu.device_async_copy %E[%c0], %F[%c0], 4 : memref<16xf32> to memref<16xf32, 3>\n // group 2 contains copy 3.\n %token2 = nvgpu.device_async_create_group %cp3\n // after the wait copy 1 and copy 2 are complete.\n nvgpu.device_async_wait %token1\n // after the wait copy 3 is complete.\n nvgpu.device_async_wait %token2\n ```\n\n Example:\n\n ```mlir\n %0 = nvgpu.device_async_copy %src[%c0, %c0], %dst[%c0, %c0, %c0], 4 :\n memref<4x5xf32> to memref<2x7x5xf32, 3>\n ```", "operands": [ { "name": "dst", "type": "AnyMemRef" }, { "name": "dstIndices", "type": "Variadic" }, { "name": "src", "type": "AnyMemRef" }, { "name": "srcIndices", "type": "Variadic" }, { "name": "srcElements", "type": "Optional" } ], "results": [ { "name": "asyncToken", "type": "NVGPU_DeviceAsyncToken" } ], "attributes": [ { "name": "dstElements", "type": "IndexAttr" }, { "name": "bypassL1", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$src `[` $srcIndices `]` `,` $dst `[` $dstIndices `]` `,` $dstElements (`,` $srcElements^)?\n attr-dict `:` type($src) `to` type($dst)" }, { "name": "nvgpu.device_async_create_group", "summary": "device side asynchronous create group operation", "description": "The `nvgpu.device_async_create_group` op creates a group of memory accesses\n containing all the pending `device_async_copy` operations associated with\n argument tokens. Each token can only be part of one group.\n\n It returns a token that can be use to wait until the group fully completes.\n\n This is meant to be used with `nvgpu.device_async_wait` to synchronize copies\n as explained in those ops descriptions.\n\n Groups are executed in the order they are created.\n\n Example:\n\n ```mlir\n %0 = nvgpu.device_async_create_group\n ```", "operands": [ { "name": "inputTokens", "type": "Variadic" } ], "results": [ { "name": "asyncToken", "type": "NVGPU_DeviceAsyncToken" } ], "assemblyFormat": "$inputTokens attr-dict" }, { "name": "nvgpu.device_async_wait", "summary": "Wait for async gpu ops to complete.", "description": "The `nvgpu.device_async_wait` op will block the execution thread until the group\n associated with the source token is fully completed.\n\n The optional `$numGroups` attribute gives an upper bound of the number of\n groups uncompleted when the wait can unblock the thread. For example, if\n 16 async groups are pushe and `$numGroups` is set to 12, then the thread\n will unblock when 12 groups or fewer are in flight (4 groups have\n completed).\n\n Example:\n\n ```mlir\n nvgpu.device_async_wait %0\n ```", "operands": [ { "name": "asyncDependencies", "type": "NVGPU_DeviceAsyncToken" } ], "attributes": [ { "name": "numGroups", "type": "OptionalAttr" } ], "assemblyFormat": "$asyncDependencies attr-dict" }, { "name": "nvgpu.ldmatrix", "description": "The `nvgpu.ldmatrix` op represents loading a matrix fragment from\n memory to registers. The source and result type must be compatible\n with lowering to the `nvvm.ldmatrix` instruction. This op represents\n the distributed version of a `vector.transfer_read` as an intermediate\n step between lowering from `vector.transfer_read` to `nvvm.ldmatrix`.\n\n This operation is meant to follow the semantic of described here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-ldmatrix\n\n Example:\n ```mlir\n %0 = nvgpu.ldmatrix %sm[%c0, %c0] {numTiles = 4 : i32, transpose = false} :\n memref -> vector<4x2xf16>\n ```", "operands": [ { "name": "srcMemref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "res", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "transpose", "type": "BoolAttr" }, { "name": "numTiles", "type": "I32Attr" } ], "assemblyFormat": "$srcMemref`[` $indices `]` attr-dict `:` type($srcMemref) `->` type($res)" }, { "name": "nvgpu.mbarrier.arrive", "summary": "Performs arrive operation on the `nvgpu.mbarrier.arrive`.", "description": "The Op performs arrive-on operation on the `mbarrier` object and returns a \n `nvgpu.mbarrier.token`.\n\n For more information, see\n https://docs.nvidia.com/cuda/parallel-thread-execution/#arrive-on-operation-on-mbarrier-object\n\n Example:\n ```mlir\n %token = nvgpu.mbarrier.arrive %barrier : !nvgpu.mbarrier.barrier> -> !nvgpu.mbarrier.token\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "mbarId", "type": "Index" } ], "results": [ { "name": "token", "type": "NVGPU_MBarrierToken" } ], "assemblyFormat": "$barriers `[` $mbarId `]` attr-dict `:` type($barriers) `->` type($token)" }, { "name": "nvgpu.mbarrier.arrive.expect_tx", "summary": "Performs expect_tx operation on the `nvgpu.mbarrier.arrive`", "description": "A thread executing the Op performs an expect-tx operation on the mbarrier \n object at the location specified by the address operand $barrier. The \n expect-tx operation, with an $txcount argument, increases the tx-count of \n an mbarrier object by the value specified by $txcount. This makes the \n current phase of the mbarrier object to expect and track the completion of \n additional asynchronous transactions.\n \n The `$txCount` specifies the number of element to the expect-tx operation.\n\n Example:\n ```mlir\n nvgpu.mbarrier.arrive.expect_tx %barrier, %ic0 : !nvgpu.mbarrier.barrier>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "txcount", "type": "Index" }, { "name": "mbarId", "type": "Index" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $txcount (`,` `predicate` `=` $predicate^)? attr-dict `:` type($barriers)" }, { "name": "nvgpu.mbarrier.arrive.nocomplete", "summary": "Performs arrive operation on the `nvgpu.mbarrier.arrive.nocomplete` as non-blocking.", "description": "The Op performs arrive-on operation on the `mbarrier` object and returns a \n `nvgpu.mbarrier.token`.\n\n The Op does not cause the `nvgpu.mbarrier` to complete its current phase.\n\n Example:\n ```mlir\n %token = nvgpu.mbarrier.arrive.noComplete %barrier, %count : !nvgpu.mbarrier.barrier> -> !nvgpu.mbarrier.token\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "mbarId", "type": "Index" }, { "name": "count", "type": "Index" } ], "results": [ { "name": "token", "type": "NVGPU_MBarrierToken" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $count attr-dict `:` type($barriers) `->` type($token)" }, { "name": "nvgpu.mbarrier.create", "summary": "Creates a `nvgpu.mbarrier` object.", "description": "The Op generates one or more `mbarrier` object, which is a barrier created in \n shared memory and supports various synchronization behaviors for threads.\n\n The `mbarrier` object has the following type and alignment requirements:\n Type: .b64, Alignment: 8, Memory space: .shared\n \n Example:\n ```mlir\n %barrier = nvgpu.mbarrier.create -> !nvgpu.mbarrier.barrier>\n ```", "results": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" } ], "assemblyFormat": "attr-dict `->` type($barriers)" }, { "name": "nvgpu.mbarrier.get", "summary": "Return a pointer to an `nvgpu.mbarrier`.", "description": "The `nvgpu.mbarrier.get` operation retrieves a pointer to a specific \n `mbarrier` object from a group of barriers created by the `nvgpu.mbarrier.create` operation.\n\n Example:\n ```mlir\n %mbars = nvgpu.mbarrier.create -> !nvgpu.mbarrier.group, num_barriers = 10>\n %mbar_pointer = nvgpu.mbarrier.get %mbars[%c2] : !nvgpu.mbarrier.group>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "mbarId", "type": "Index" } ], "results": [ { "name": "mbarrierPointer", "type": "AnyTypeOf<[I32, I64]>" } ], "assemblyFormat": "$barriers `[` $mbarId `]` attr-dict `:` type($barriers) `->` type($mbarrierPointer)" }, { "name": "nvgpu.mbarrier.init", "summary": "Initialize the `nvgpu.mbarrier`.", "description": "The Op initializes the `mbarrier` object with the given number of threads.\n\n Example:\n ```mlir\n %num_threads = gpu.block_dim x\n %barrier = nvgpu.mbarrier.create -> !nvgpu.mbarrier.barrier>\n nvgpu.mbarrier.init %barrier, %num_threads : !nvgpu.mbarrier.barrier>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "count", "type": "Index" }, { "name": "mbarId", "type": "Index" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $count (`,` `predicate` `=` $predicate^)? attr-dict `:` type($barriers)" }, { "name": "nvgpu.mbarrier.test.wait", "summary": "Checks if the `nvgpu.mbarrier` has completed its current phase.", "description": "Checks whether the mbarrier object has completed the phase. It is a \n non-blocking instruction which tests for the completion of the phase.\n\n Example:\n ```mlir\n %isComplete = nvgpu.mbarrier.test.wait %barrier, %token : !nvgpu.mbarrier.barrier>, !nvgpu.mbarrier.token\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "token", "type": "NVGPU_MBarrierToken" }, { "name": "mbarId", "type": "Index" } ], "results": [ { "name": "waitComplete", "type": "I1" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $token attr-dict `:` type($barriers) `,` type($token)" }, { "name": "nvgpu.mbarrier.try_wait.parity", "summary": "Waits for the `nvgpu.mbarrier` to complete its current phase.", "description": "Checks whether the mbarrier object has completed the phase. It is a \n potentially blocking instruction which tests for the completion of the \n phase. Suspended thread resumes execution when the specified phase completes \n OR before the phase completes following a system-dependent time limit. \n\n The `$phaseParity` specifies either even phase (0) or odd phase (1) to \n wait.\n\n Example:\n ```mlir\n nvgpu.mbarrier.try_wait.parity %barrier, %phaseParity, %ticks : !nvgpu.mbarrier.barrier>\n ```", "operands": [ { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "phaseParity", "type": "I1" }, { "name": "ticks", "type": "Index" }, { "name": "mbarId", "type": "Index" } ], "assemblyFormat": "$barriers `[` $mbarId `]` `,` $phaseParity `,` $ticks attr-dict `:` type($barriers)" }, { "name": "nvgpu.mma.sp.sync", "description": "The `nvgu.mma.sp.sync` operation performs a warp-distributed MMA operation\n where operand A is \"structured sparse\". In this case, the `matrixA` operand\n represents the (warp-distributed) non-zero values of operand A, and the\n `sparse_metadata` operand provides the indices.\n\n The full description of the sparsity storage format and distribution scheme is\n described in the PTX docs. This operation is meant to follow the semantic\n described in the PTX documentation here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-for-sparse-mma\n\n The way the indices are distributed among the threads in a warp is controlled\n by the optional `sparsity_selector` operand, which is `0` by default. For\n more information, please consult the PTX documentation linked above.\n\n Example (targetingthe f16 16x8x32 `mma.sp` PTX instruction):\n\n ```mlir\n nvgpu.mma.sp.sync (%a, %b, %c) metadata (%meta) {mmaShape = [16, 8, 32]} :\n (vector<4x2xf16>, vector<2x2xf16>, vector<2x2xf16>) -> vector<2x2xf16>\n ```", "operands": [ { "name": "matrixA", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixB", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixC", "type": "AnyVectorOfNonZeroRank" }, { "name": "sparseMetadata", "type": "NVGPU_MmaSparseSyncMetadataType" } ], "results": [ { "name": "res", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "mmaShape", "type": "TypedArrayAttrBase" }, { "name": "sparsitySelector", "type": "DefaultValuedAttr" }, { "name": "tf32Enabled", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $matrixA`,` $matrixB`,` $matrixC `)` `metadata` `(` $sparseMetadata `)` attr-dict\n `:` `(` type($matrixA) `,` type($matrixB) `,` type($matrixC) `)` `->` type($res)" }, { "name": "nvgpu.mma.sync", "description": "The `nvgpu.mma.sync` op represents the warp-level matrix-multiply-and-\n accumulate (mma) operation that is compatible with `nvvm.mma.sync`.\n The operands and results vector sizes are thread-level onwership to\n the warp-level mma operation shape. `mmaShape` attribute holds the\n warp-level matrix-multiply shape.\n\n The `nvgpu.mma.sync` op serves as an intermediate point between lowering from\n `vector.contract` to `nvvm.mma.sync`.\n\n This operation is meant to follow the semantic of described here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-mma\n\n Example:\n\n ```mlir\n %res = nvgpu.mma.sync (%matrixA, %matrixB, %matrixC) {mmaShape = [16, 8, 16]} :\n (vector<4x2xf16>, vector<2x2xf16>, vector<2x2xf32>) -> vector<2x2xf32>\n ```", "operands": [ { "name": "matrixA", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixB", "type": "AnyVectorOfNonZeroRank" }, { "name": "matrixC", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "res", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "mmaShape", "type": "TypedArrayAttrBase" }, { "name": "tf32Enabled", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $matrixA`,` $matrixB`,` $matrixC `)` attr-dict\n `:` `(` type($matrixA) `,` type($matrixB) `,` type($matrixC) `)` `->` type($res)" }, { "name": "nvgpu.rcp", "summary": "The reciprocal calculation for vector types", "description": "Reciprocal calculation for `vector` types using `nvvm.rcp` OPs.\n\n Currently, only the `approx` rounding mode and `ftz` are supported, and only for the `f32` type.\n\n The input and output must be of the same vector type and shape.", "operands": [ { "name": "in", "type": "VectorOfNonZeroRankOf<[F32]>" } ], "results": [ { "name": "out", "type": "VectorOfNonZeroRankOf<[F32]>" } ], "attributes": [ { "name": "rounding", "type": "DefaultValuedAttr" }, { "name": "approx", "type": "DefaultValuedAttr" }, { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$in attr-dict `:` type($out)" }, { "name": "nvgpu.tma.async.load", "summary": "TMA asynchronous load", "description": "The Op loads a tile memory region from global memory to shared memory by \n Tensor Memory Access (TMA).\n \n `$tensorMapDescriptor` is tensor map descriptor which has information about\n tile shape. The descriptor is created by `nvgpu.tma.create.descriptor`\n\n The Op uses `$barrier` mbarrier based completion mechanism.", "operands": [ { "name": "dst", "type": "AnyMemRef" }, { "name": "barriers", "type": "NVGPU_MBarrierGroup" }, { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" }, { "name": "coordinates", "type": "Variadic" }, { "name": "mbarId", "type": "Index" }, { "name": "multicastMask", "type": "Optional" }, { "name": "predicate", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$tensorMapDescriptor `[` $coordinates `]` `,` $barriers `[` $mbarId `]` \n `to` $dst\n (`multicast_mask` `=` $multicastMask^ )?\n (`,` `predicate` `=` $predicate^)?\n attr-dict `:` type($tensorMapDescriptor) `,` type($barriers) \n `->` type($dst)" }, { "name": "nvgpu.tma.async.store", "summary": "TMA asynchronous store", "description": "The Op store a tile memory region from global memory to shared memory by \n Tensor Memory Access (TMA).\n \n `$tensorMapDescriptor` is tensor map descriptor which has information about\n tile shape. The descriptor is created by `nvgpu.tma.create.descriptor`", "operands": [ { "name": "src", "type": "AnyMemRef" }, { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" }, { "name": "coordinates", "type": "Variadic" }, { "name": "predicate", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$src `to` $tensorMapDescriptor `[` $coordinates `]`\n (`,` `predicate` `=` $predicate^)?\n attr-dict `:` type($src)\n `->` type($tensorMapDescriptor)" }, { "name": "nvgpu.tma.create.descriptor", "summary": "TMA create descriptor", "description": "The Op creates a tensor map descriptor object representing tiled memory \n region. To do that it calls CUDA Driver's `cuTensorMapEncodeTiled`. The \n descriptor is used by Tensor Memory Access (TMA).\n\n The `tensor` is the source tensor to be tiled. \n\n The `boxDimensions` is the size of the tiled memory region in each dimension.\n\n For more information see below:\n https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TENSOR__MEMORY.html", "operands": [ { "name": "tensor", "type": "AnyUnrankedMemRef" }, { "name": "boxDimensions", "type": "Variadic" } ], "results": [ { "name": "tensorMap", "type": "NVGPU_TensorMapDescriptor" } ], "assemblyFormat": "$tensor `box` `[` $boxDimensions `]` attr-dict `:` type($tensor) `->` type($tensorMap)" }, { "name": "nvgpu.tma.fence.descriptor", "summary": "Insert fence given `nvgpu.tensormap.descriptor`", "description": "The Op fences the given `$tmaDescriptor`. This is necessary if the tensor map\n descriptor was modified from the host using cudaMemcpy. In this case, the\n kernel needs a fence after which it is safe to use `tensor.map`.", "operands": [ { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" } ], "assemblyFormat": "$tensorMapDescriptor attr-dict `:` type($tensorMapDescriptor)" }, { "name": "nvgpu.tma.prefetch.descriptor", "summary": "Prefetch given `nvgpu.tensormap.descriptor`", "description": "The Op brings the cache line containing the given `$tmaDescriptor` for \n subsequent use by the `tma.async.load` instruction.", "operands": [ { "name": "tensorMapDescriptor", "type": "NVGPU_TensorMapDescriptor" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$tensorMapDescriptor (`,` `predicate` `=` $predicate^)? attr-dict `:` type($tensorMapDescriptor)" }, { "name": "nvgpu.warpgroup.generate.descriptor", "summary": "Generate a warpgroup matrix descriptor", "description": "This Op builds a `nvgpu.warpgroup.descriptor` that is used by \n `nvgpu.warpgroup.mma` to perform warpgroup-level matrix multiply and \n accumulate.\n\n The descriptor specifies the properties of the matrix in shared memory that \n is a multiplicand in the matrix multiply and accumulate operation.", "operands": [ { "name": "tensor", "type": "AnyMemRef" }, { "name": "tensorMap", "type": "NVGPU_TensorMapDescriptor" } ], "results": [ { "name": "descriptor", "type": "NVGPU_WarpgroupMatrixDescriptor" } ], "assemblyFormat": "$tensor `,` $tensorMap attr-dict `:` type($tensor) `,` type($tensorMap) `->` type($descriptor)" }, { "name": "nvgpu.warpgroup.mma", "description": "The `nvgpu.warpgroup.mma` op performs the warpgroup-level (4 warps) \n matrix-multiply-and-accumulate (mma) operation that results in \n `nvvm.wgmma.mma_async`. \n \n The operands are `descriptorA` and `descriptorB` that are wgmma matrix \n descriptors that shows the properties of the matrix in shared memory. The \n results are thread-level ownership to the warpgroup-level mma operation \n shape. The shape is deduced from the descriptor types and output vector.\n\n The Op encapsulates multiple `nvvm.wgmma.mma_async` operations to complete \n the given shape. As `nvvm.wgmma.async` Op, or its corresponding PTX \n instruction, is asynchronous, this Op groups the `nvvm.wgmma.async` and \n surrounds them between `wgmma.fence.aligned` and \n `wgmma.commit.group.sync.aligned`, `wgmma.wait.group.sync.aligned` Ops.\n\n Example:\n ```mlir\n %r1,%r2 = nvgpu.warpgroup.mma %descA, %descB, %acc1, %acc2: \n !nvgpu.warpgroup.descriptor>, \n !nvgpu.warpgroup.descriptor>, \n !nvgpu.warpgroup.accumulator>,\n !nvgpu.warpgroup.accumulator>\n -> \n !nvgpu.warpgroup.accumulator>,\n !nvgpu.warpgroup.accumulator>\n ```", "operands": [ { "name": "descriptorA", "type": "NVGPU_WarpgroupMatrixDescriptor" }, { "name": "descriptorB", "type": "NVGPU_WarpgroupMatrixDescriptor" }, { "name": "matrixC", "type": "NVGPU_WarpgroupAccumulator" } ], "results": [ { "name": "matrixD", "type": "NVGPU_WarpgroupAccumulator" } ], "attributes": [ { "name": "waitGroup", "type": "DefaultValuedOptionalAttr" }, { "name": "transposeA", "type": "OptionalAttr" }, { "name": "transposeB", "type": "OptionalAttr" } ], "assemblyFormat": "$descriptorA`,` $descriptorB`,` $matrixC attr-dict\n `:` type($descriptorA) `,` type($descriptorB) `,` type($matrixC) `->` type($matrixD)" }, { "name": "nvgpu.warpgroup.mma.init.accumulator", "summary": "Initializes the accumulator matrix", "description": "This Op generates and initializes the accumulator matrix for \n `nvgpu.warpgroup.mma` op to perform matrix-multiply-and-accumulate.", "results": [ { "name": "matrixC", "type": "NVGPU_WarpgroupAccumulator" } ], "assemblyFormat": "attr-dict `->` type($matrixC)" }, { "name": "nvgpu.warpgroup.mma.store", "description": "The `nvgpu.warpgroup.mma.store` op performs the store of fragmented result \n in $matrixD to given memref. \n\n [See the details of register fragment layout for accumulator matrix D]\n (https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#wgmma-64n16-d) \n\n Note that, the op must be run with warp group.", "operands": [ { "name": "matrixD", "type": "NVGPU_WarpgroupAccumulator" }, { "name": "dstMemref", "type": "AnyMemRef" } ], "assemblyFormat": "$matrixD `,` $dstMemref attr-dict `:` type($matrixD) `to` type($dstMemref)" }, { "name": "nvvm.addf", "summary": "Performs floating point addition of the given arguments `lhs` and `rhs`", "description": "The `nvvm.addf` operation performs floating point addition of two floating \n point operands of the same type.\n\n The rounding mode is specified by the `rnd` attribute, saturation mode by \n the `sat` attribute, and flush-to-zero by the `ftz` attribute.\n\n For more information, see PTX ISA:\n - [floating point addition](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-add)\n - [half-precision floating point addition](https://docs.nvidia.com/cuda/parallel-thread-execution/#half-precision-floating-point-instructions-add)", "operands": [ { "name": "lhs", "type": "SIMTFloatType" }, { "name": "rhs", "type": "SIMTFloatType" } ], "results": [ { "name": "res", "type": "SIMTFloatType" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr]>, FPRoundingMode::NONE>" }, { "name": "sat", "type": "DefaultValuedAttr]>, SaturationMode::NONE>" }, { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "nvvm.bar.warp.sync", "summary": "Warp Barrier Synchronization Op", "description": "The `nvvm.bar.warp.sync` operation performs barrier synchronization for threads \n within a warp. \n\n This operation causes the executing thread to wait until all threads corresponding \n to the `mask` operand have executed a `bar.warp.sync` with the same mask value \n before resuming execution.\n\n The `mask` operand specifies the threads participating in the barrier, where each \n bit position corresponds to the thread's lane ID within the warp. Only threads with \n their corresponding bit set in the mask participate in the barrier synchronization.\n\n **Important constraints**:\n - The behavior is undefined if the executing thread is not included in the mask \n (i.e., the bit corresponding to the thread's lane ID is not set)\n - For compute capability sm_6x or below, all threads in the mask must execute \n the same `bar.warp.sync` instruction in convergence\n\n This operation also guarantees memory ordering among participating threads. \n Threads within the warp that wish to communicate via memory can store to memory, \n execute `bar.warp.sync`, and then safely read values stored by other threads \n in the warp.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-bar-warp-sync)", "operands": [ { "name": "mask", "type": "I32" } ], "assemblyFormat": "$mask attr-dict `:` type($mask)" }, { "name": "nvvm.barrier", "summary": "CTA Barrier Synchronization Op", "description": "The `nvvm.barrier` operation performs barrier synchronization and communication \n within a CTA (Cooperative Thread Array). It causes executing threads to wait for \n all non-exited threads participating in the barrier to arrive.\n\n The operation takes the following optional operands and attributes:\n\n - `barrierId`: Specifies a logical barrier resource with value 0 through 15. \n Each CTA instance has sixteen barriers numbered 0..15. Defaults to 0 if not specified.\n - `numberOfThreads`: Specifies the number of threads participating in the barrier. \n When specified, the value must be a multiple of the warp size. If not specified, \n all threads in the CTA participate in the barrier.\n - `aligned`: Selects between the `.aligned` and non-`.aligned` forms of the\n underlying `@llvm.nvvm.barrier.cta.*` intrinsic family. Defaults to true,\n which requires every thread in the CTA to reach this same barrier\n instruction, otherwise the behavior is undefined. Set it to false to emit\n the non-`.aligned` form.\n\n Reduction variants of the barrier instruction are modeled by the\n `nvvm.barrier.reduction` op.\n\n The barrier operation guarantees that when the barrier completes, prior memory \n accesses requested by participating threads are performed relative to all threads \n participating in the barrier. It also ensures that no new memory access is \n requested by participating threads before the barrier completes.\n\n When a barrier completes, the waiting threads are restarted without delay, and\n the barrier is reinitialized so that it can be immediately reused.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-bar)", "operands": [ { "name": "barrierId", "type": "Optional" }, { "name": "numberOfThreads", "type": "Optional" } ], "attributes": [ { "name": "aligned", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`id` `=` $barrierId^)? (`number_of_threads` `=` $numberOfThreads^)? attr-dict" }, { "name": "nvvm.barrier.arrive", "description": "Thread that executes this op announces their arrival at the barrier with \n given id and continue their execution.\n\n The default barrier id is 0 that is similar to `nvvm.barrier` Op. When \n `barrierId` is not present, the default barrier id is used. \n\n The `aligned` attribute, which defaults to `true`, generates the aligned\n form of the barrier (all threads in the CTA execute the same barrier\n instruction). When set to `false`, the unaligned form is generated.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-bar)", "operands": [ { "name": "barrierId", "type": "Optional" }, { "name": "numberOfThreads", "type": "I32" } ], "attributes": [ { "name": "aligned", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`id` `=` $barrierId^)? `number_of_threads` `=` $numberOfThreads attr-dict" }, { "name": "nvvm.barrier.reduction", "summary": "CTA Barrier Reduction Op", "description": "The `nvvm.barrier.reduction` operation performs barrier synchronization with a\n reduction across the per-thread predicates contributed by participating threads\n in a CTA.\n\n - `barrierId`: Specifies a logical barrier resource with value 0 through 15.\n Optional; defaults to barrier id 0 when not specified.\n - `reductionOp`: The reduction kind (`popc`, `and`, `or`) applied across the\n per-thread predicates.\n - `reductionPredicate`: The per-thread i32 predicate. It is compared against\n zero to form the i1 value fed into the reduction.\n - `aligned`: Selects between the `.aligned` and non-`.aligned` forms of the\n underlying `@llvm.nvvm.barrier.cta.red.*` intrinsic family. Defaults to\n true, which requires every thread in the CTA to reach this same barrier\n instruction, otherwise the behavior is undefined. Set it to false to emit\n the non-`.aligned` form.\n\n The result is the i32 reduction value computed across all threads\n participating in the barrier.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-bar)", "operands": [ { "name": "barrierId", "type": "Optional" }, { "name": "reductionPredicate", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "reductionOp", "type": "BarrierReductionAttr{popc|and|or}" }, { "name": "aligned", "type": "DefaultValuedAttr" } ], "assemblyFormat": "qualified($reductionOp) $reductionPredicate (`id` `=` $barrierId^)? `->` type($res) attr-dict" }, { "name": "nvvm.barrier0", "summary": "CTA Barrier Synchronization Op (Barrier ID 0)", "description": "The `nvvm.barrier0` operation is a convenience operation that performs barrier \n synchronization and communication within a CTA (Cooperative Thread Array) using \n barrier ID 0. It is functionally equivalent to `nvvm.barrier` or `nvvm.barrier id=0`. \n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-bar)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.breakpoint", "summary": "Breakpoint Op", "description": "Breakpoint suspends execution of the program for debugging.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#miscellaneous-instructions-brkpt)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.cluster.arrive", "summary": "Cluster Barrier Arrive Op", "description": "The `cluster.arrive` can be used by the threads within the cluster for synchronization and\n communication. The `cluster.arrive` instruction marks the warps' arrival at the barrier\n without causing the executing thread to wait for other participating threads.\n\n The `aligned` attribute, when provided, generates the .aligned version of the PTX instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-barrier-cluster)", "attributes": [ { "name": "aligned", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.cluster.arrive.relaxed", "summary": "Cluster Barrier Relaxed Arrive Op", "description": "The `cluster.arrive` can be used by the threads within the cluster for synchronization and\n communication. The `cluster.arrive` instruction marks the warps' arrival at the barrier\n without causing the executing thread to wait for other participating threads.\n\n The `aligned` attribute, when provided, generates the .aligned version of the PTX instruction.\n The .relaxed qualifier on `cluster.arrive` specifies that there are no memory\n ordering and visibility guarantees provided for the memory accesses performed prior to\n `cluster.arrive`.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-barrier-cluster)", "attributes": [ { "name": "aligned", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.cluster.wait", "summary": "Cluster Barrier Wait Op", "description": "The `cluster.wait` causes the executing thread to wait for all non-exited threads\n of the cluster to perform `cluster.arrive`. The `aligned` attribute, when provided,\n generates the .aligned version of the PTX instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-barrier-cluster)", "attributes": [ { "name": "aligned", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.clusterlaunchcontrol.query.cancel", "summary": "Query the response of a clusterlaunchcontrol.try.cancel operation", "description": "`clusterlaunchcontrol.query.cancel` queries the response of a \n `clusterlaunchcontrol.try.cancel` operation specified by operand \n `try_cancel_response`.\n\n Operand `query_type` specifies the type of query to perform and can be one \n of the following:\n - `is_canceled` : Returns true if the try cancel request succeeded, \n and false otherwise.\n - `get_first_cta_id_{x/y/z}` : Returns the x, y, or z coordinate of the \n first CTA in the canceled cluster. Behaviour is defined only if the try \n cancel request succeeded. \n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-clusterlaunchcontrol-query-cancel)", "operands": [ { "name": "try_cancel_response", "type": "I128" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[I1, I32]>" } ], "attributes": [ { "name": "query_type", "type": "ClusterLaunchControlQueryTypeAttr{is_canceled|get_first_cta_id_x|get_first_cta_id_y|get_first_cta_id_z}" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`query` `=` $query_type `,` $try_cancel_response attr-dict `:` type($res)" }, { "name": "nvvm.clusterlaunchcontrol.try.cancel", "summary": "Request atomically canceling the launch of a cluster that has not started running yet", "description": "`clusterlaunchcontrol.try.cancel` requests atomically canceling the launch \n of a cluster that has not started running yet. It asynchronously writes an \n opaque response to shared memory indicating whether the operation succeeded \n or failed.\n\n Operand `smemAddress` specifies the naturally aligned address of the \n 16-byte wide shared memory location where the request's response is written.\n\n Operand `mbarrier` specifies the mbarrier object used to track the \n completion of the asynchronous operation.\n\n If `multicast` is specified, the response is asynchronously written to the \n corresponding local shared memory location (specifed by `addr`) of each CTA \n in the requesting cluster.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-clusterlaunchcontrol-try-cancel)", "operands": [ { "name": "smemAddress", "type": "LLVM_PointerShared" }, { "name": "mbarrier", "type": "LLVM_PointerShared" } ], "attributes": [ { "name": "multicast", "type": "UnitAttr" } ], "assemblyFormat": "(`multicast` $multicast^ `,`)? $smemAddress `,` $mbarrier attr-dict" }, { "name": "nvvm.convert.bf16x2.to.f4x2", "summary": "Convert an bf16x2 input to f4x2", "description": "This Op converts each of the givenBF16inputs in anbf16x2 vector to the specified fp4 type.\n The result `dst` is returned as an i8 type where the converted values are \n packed such that the value converted from the first element of `a` is \n stored in the lower 4 bits of `dst` and the value converted from the second \n element of `a` is stored in the upper 4 bits of `dst`.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2]>" } ], "results": [ { "name": "dst", "type": "I8" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttrOf" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.bf16x2.to.f6x2", "summary": "Convert an bf16x2 input to f6x2", "description": "This Op converts each of the givenBF16inputs in anbf16x2 vector to the specified fp6 type. The result `dst` is \n represented either as an i16 type or as a vector of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from the first element of `a` is stored in the \n lower 8 bits of `dst` with 2 MSB bits padded with zeros and the value \n converted from the second element of `a` is stored in the upper 8 bits of \n `dst` with 2 MSB bits padded with zeros.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector with 2 MSB bits padded with zeros.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2]>" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttrOf>" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.bf16x2.to.f8x2", "summary": "Convert a pair of bf16 inputs to f8x2", "description": "This Op converts the given bf16 inputs in a bf16x2 vector to the specified \n f8 type. The result `dst` is represented either as a packed i16 type or as \n a vector of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from the first element of `a` is stored in the \n lower 8 bits of `dst` and the value converted from the second element of \n `a` is stored in the upper 8 bits of `dst`.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector.\n The `rnd` and `sat` attributes specify the rounding and saturation modes \n respectively.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2], [BF16]>" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr" }, { "name": "sat", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttrOf>" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.bf16x2.to.s2f6x2", "summary": "Convert a pair of BF16 inputs to S2F6x2", "description": "This Op converts each of the given BF16 inputs in a bf16x2 vector to the\n S2F6x2 type. The result `dst` can be either a packed i16 type or a vector\n of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from the first element of `a` is stored in the \n lower 8 bits of `dst` and the value converted from the second element of \n `a` is stored in the upper 8 bits of `dst`.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector.\n The `relu` attribute, when set, lowers to the '.relu' variant\n of the cvt instruction.\n The optional scaling-factors for each of the inputs are provided through \n the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported \n as the type of the scale-factor currently.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2], [BF16]>" }, { "name": "scaleFactor", "type": "Optional" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src (`,` $scaleFactor^)? attr-dict `:` type($src) `->` type($dst)" }, { "name": "nvvm.convert.f16x2.to.f4x2", "summary": "Convert an f16x2 input to f4x2", "description": "This Op converts each of the givenF16inputs in anf16x2 vector to the specified fp4 type.\n The result `dst` is returned as an i8 type where the converted values are \n packed such that the value converted from the first element of `a` is \n stored in the lower 4 bits of `dst` and the value converted from the second \n element of `a` is stored in the upper 4 bits of `dst`.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2]>" } ], "results": [ { "name": "dst", "type": "I8" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttrOf" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f16x2.to.f6x2", "summary": "Convert an f16x2 input to f6x2", "description": "This Op converts each of the givenF16inputs in anf16x2 vector to the specified fp6 type. The result `dst` is \n represented either as an i16 type or as a vector of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from the first element of `a` is stored in the \n lower 8 bits of `dst` with 2 MSB bits padded with zeros and the value \n converted from the second element of `a` is stored in the upper 8 bits of \n `dst` with 2 MSB bits padded with zeros.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector with 2 MSB bits padded with zeros.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2]>" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttrOf>" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f16x2.to.f8x2", "summary": "Convert an f16x2 input to f8x2", "description": "This Op converts the given f16 inputs in an f16x2 vector to the specified \n f8 type.\n The result `dst` is represented as an i16 type or as a vector\n of two i8 types.\n If `dst` is returned as an i16 type, the converted values from `a`\n are packed such that the value converted from the first element of `a`\n is stored in the upper 8 bits of `dst` and the value converted from the\n second element of `a` is stored in the lower 8 bits of `dst`.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[2], [F16]>" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$a attr-dict `:` type($a) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f32x2.to.bf16x2", "summary": "Convert two F32 values to packed bf16x2.", "description": "Converts two F32 values to packedbf16x2format with \n the specified rounding mode. The `src_hi` and `src_lo` parameters \n correspond to operands `a` and `b` in the PTX ISA, respectively.\n \n The `random_bits` parameter is required for stochastic rounding and \n provides the [random bits](https://docs.nvidia.com/cuda/parallel-thread-execution/#cvt-rs-rbits-layout-bf16) to be used for the conversion.\n\n The `relu` attribute clamps negative results to 0.\n\n The `sat` attribute determines saturation behavior.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src_hi", "type": "F32" }, { "name": "src_lo", "type": "F32" }, { "name": "random_bits", "type": "Optional" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[ 2 ], [ BF16 ]>" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr" }, { "name": "sat", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src_hi `,` $src_lo (`,` $random_bits^)? attr-dict `:` type($dst)" }, { "name": "nvvm.convert.f32x2.to.f16x2", "summary": "Convert two F32 values to packed f16x2.", "description": "Converts two F32 values to packedf16x2format with \n the specified rounding mode. The `src_hi` and `src_lo` parameters \n correspond to operands `a` and `b` in the PTX ISA, respectively.\n \n The `random_bits` parameter is required for stochastic rounding and \n provides the [random bits](https://docs.nvidia.com/cuda/parallel-thread-execution/#cvt-rs-rbits-layout-f16) to be used for the conversion.\n\n The `relu` attribute clamps negative results to 0.\n\n The `sat` attribute determines saturation behavior.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src_hi", "type": "F32" }, { "name": "src_lo", "type": "F32" }, { "name": "random_bits", "type": "Optional" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[ 2 ], [ F16 ]>" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr" }, { "name": "sat", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src_hi `,` $src_lo (`,` $random_bits^)? attr-dict `:` type($dst)" }, { "name": "nvvm.convert.f32x2.to.f4x2", "summary": "Convert a pair of float inputs to f4x2", "description": "This Op converts each of the given float inputs to the specified fp4 type.\n The result `dst` is returned as an i8 type where the converted values are \n packed such that the value converted from `a` is stored in the upper 4 bits \n of `dst` and the value converted from `b` is stored in the lower 4 bits of \n `dst`.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "a", "type": "F32" }, { "name": "b", "type": "F32" } ], "results": [ { "name": "dst", "type": "I8" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f32x2.to.f6x2", "summary": "Convert a pair of float inputs to f6x2", "description": "This Op converts each of the given float inputs to the specified fp6 type.\n The result `dst` is represented either as an i16 type or as a vector\n of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from `a` is stored in the upper 8 bits of `dst` \n with 2 MSB bits padded with zeros and the value converted from `b` is \n stored in the lower 8 bits of `dst` with 2 MSB bits padded with zeros.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "a", "type": "F32" }, { "name": "b", "type": "F32" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f32x2.to.f8x2", "summary": "Convert a pair of float inputs to f8x2", "description": "This Op converts each of the given float inputs to the specified fp8 type.\n The result `dst` is represented as an i16 type or as a vector\n of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from `a` is stored in the upper 8 bits of `dst` \n and the value converted from `b` is stored in the lower 8 bits of `dst`.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector.\n The `rnd` and `sat` attributes specify the rounding and saturation modes respectively.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "a", "type": "F32" }, { "name": "b", "type": "F32" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr" }, { "name": "sat", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f32x2.to.s2f6x2", "summary": "Convert a pair of f32 inputs to S2F6x2", "description": "This Op converts each of the given f32 inputs to the\n S2F6x2 type. The result `dst` can be either a packed i16 type or a vector\n of two i8 types.\n If `dst` is returned as an i16 type, the converted values are packed such \n that the value converted from `a` is stored in the upper 8 bits of `dst` \n and the value converted from `b` is stored in the lower 8 bits of `dst`.\n If `dst` is returned as a vector type, each converted value is stored as an \n i8 element in the vector.\n The `relu` attribute, when set, lowers to the '.relu' variant\n of the cvt instruction.\n The optional scaling-factors for each of the inputs are provided through \n the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported \n as the type of the scale-factor currently.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "a", "type": "F32" }, { "name": "b", "type": "F32" }, { "name": "scaleFactor", "type": "Optional" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[I16, VectorOfLengthAndType<[2], [I8]>]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b (`,` $scaleFactor^)? attr-dict `:` type($dst)" }, { "name": "nvvm.convert.f32x4.to.f4x4", "summary": "Convert vector<4xf32> to packed f4x4 with stochastic rounding (.rs) and satfinite", "description": "Converts a vector<4xf32> to packedf4x4format using \n stochastic rounding (.rs) mode with SATFINITE saturation. Randomness is \n provided by the `rbits` parameter. The `dstTy` attribute specifies the \n target floating-point format. The `relu` attribute clamps negative results to 0.\n \n Note: These operations always use RS rounding mode and SATFINITE saturation mode.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[4], [F32]>" }, { "name": "rbits", "type": "I32" } ], "results": [ { "name": "dst", "type": "I16" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$src `,` $rbits attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f32x4.to.f6x4", "summary": "Convert vector<4xf32> to packed f6x4 with stochastic rounding (.rs) and satfinite", "description": "Converts a vector<4xf32> to packedf6x4format using \n stochastic rounding (.rs) mode with SATFINITE saturation. Randomness is \n provided by the `rbits` parameter. The `dstTy` attribute specifies the \n target floating-point format. The `relu` attribute clamps negative results to 0.\n \n Note: These operations always use RS rounding mode and SATFINITE saturation mode.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[4], [F32]>" }, { "name": "rbits", "type": "I32" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[ 4 ], [ I8 ]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$src `,` $rbits attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f32x4.to.f8x4", "summary": "Convert vector<4xf32> to packed f8x4 with stochastic rounding (.rs) and satfinite", "description": "Converts a vector<4xf32> to packedf8x4format using \n stochastic rounding (.rs) mode with SATFINITE saturation. Randomness is \n provided by the `rbits` parameter. The `dstTy` attribute specifies the \n target floating-point format. The `relu` attribute clamps negative results to 0.\n \n Note: These operations always use RS rounding mode and SATFINITE saturation mode.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[4], [F32]>" }, { "name": "rbits", "type": "I32" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[ 4 ], [ I8 ]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "dstTy", "type": "TypeAttr" } ], "assemblyFormat": "$src `,` $rbits attr-dict `:` type($src) `->` type($dst) `(` $dstTy `)`" }, { "name": "nvvm.convert.f4x2.to.bf16x2", "summary": "Convert a pair of f4 inputs to bf16x2", "description": "This Op converts the givenf4inputs in apacked i8tobf16.\n\n The result `dst` is represented as a vector ofbf16elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.The `sat` attribute specifies the saturation mode.\n\n The optional scaling-factors for each of the inputs are provided through\n the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported\n as the type of the scale-factor currently.[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)Example:\n\n ```mlir\n // Basic conversion; the f4x2 source is packed in a single i8.\n %res1 = nvvm.convert.f4x2.to.bf16x2 %src\n : i8 (f4E2M1FN) -> vector<2xbf16>\n\n // Conversion with relu and saturation.\n %res2 = nvvm.convert.f4x2.to.bf16x2 %src\n {relu = true, sat = #nvvm.sat_mode}\n : i8 (f4E2M1FN) -> vector<2xbf16>\n\n // Conversion with a packed ue8m0 scale-factor.\n %res3 = nvvm.convert.f4x2.to.bf16x2 %src, %scaleFactor\n : i8 (f4E2M1FN) -> vector<2xbf16>\n ```", "operands": [ { "name": "src", "type": "I8" }, { "name": "scaleFactor", "type": "Optional" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "srcType", "type": "TypeAttrOf>" }, { "name": "sat", "type": "DefaultValuedAttr]>, SaturationMode::NONE>" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src (`,` $scaleFactor^)? attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.convert.f4x2.to.f16x2", "summary": "Convert a pair of f4 inputs to f16x2", "description": "This Op converts the givenf4inputs in apacked i8tof16.\n\n The result `dst` is represented as a vector off16elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "I8" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "srcType", "type": "TypeAttrOf>" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.convert.f6x2.to.bf16x2", "summary": "Convert a pair of f6 inputs to bf16x2", "description": "This Op converts the givenf6inputs in ai8x2 vectortobf16.\n\n The result `dst` is represented as a vector ofbf16elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.The `sat` attribute specifies the saturation mode.\n\n The optional scaling-factors for each of the inputs are provided through\n the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported\n as the type of the scale-factor currently.[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)Example:\n\n ```mlir\n // Basic conversion from f6E2M3FN.\n %res1 = nvvm.convert.f6x2.to.bf16x2 %src\n : vector<2xi8> (f6E2M3FN) -> vector<2xbf16>\n\n // Conversion from f6E3M2FN with relu and saturation.\n %res2 = nvvm.convert.f6x2.to.bf16x2 %src\n {relu = true, sat = #nvvm.sat_mode}\n : vector<2xi8> (f6E3M2FN) -> vector<2xbf16>\n\n // Conversion with a packed ue8m0 scale-factor.\n %res3 = nvvm.convert.f6x2.to.bf16x2 %src, %scaleFactor\n : vector<2xi8> (f6E2M3FN) -> vector<2xbf16>\n ```", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[ 2 ], [ I8 ]>" }, { "name": "scaleFactor", "type": "Optional" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "srcType", "type": "TypeAttrOf>" }, { "name": "sat", "type": "DefaultValuedAttr]>, SaturationMode::NONE>" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src (`,` $scaleFactor^)? attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.convert.f6x2.to.f16x2", "summary": "Convert a pair of f6 inputs to f16x2", "description": "This Op converts the givenf6inputs in ai8x2 vectortof16.\n\n The result `dst` is represented as a vector off16elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[ 2 ], [ I8 ]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "srcType", "type": "TypeAttrOf>" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.convert.f8x2.to.bf16x2", "summary": "Convert a pair of f8 inputs to bf16x2", "description": "This Op converts the givenf8inputs in ai8x2 vectortobf16.\n\n The result `dst` is represented as a vector ofbf16elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.The `sat` attribute specifies the saturation mode.\n\n The optional scaling-factors for each of the inputs are provided through\n the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported\n as the type of the scale-factor currently.[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)Example:\n\n ```mlir\n // Basic conversion from f8E4M3FN.\n %res1 = nvvm.convert.f8x2.to.bf16x2 %src\n : vector<2xi8> (f8E4M3FN) -> vector<2xbf16>\n\n // Conversion from f8E5M2 with relu and saturation.\n %res2 = nvvm.convert.f8x2.to.bf16x2 %src\n {relu = true, sat = #nvvm.sat_mode}\n : vector<2xi8> (f8E5M2) -> vector<2xbf16>\n\n // Conversion with a packed ue8m0 scale-factor.\n %res3 = nvvm.convert.f8x2.to.bf16x2 %src, %scaleFactor\n : vector<2xi8> (f8E4M3FN) -> vector<2xbf16>\n ```", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[ 2 ], [ I8 ]>" }, { "name": "scaleFactor", "type": "Optional" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "srcType", "type": "TypeAttrOf>" }, { "name": "sat", "type": "DefaultValuedAttr]>, SaturationMode::NONE>" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src (`,` $scaleFactor^)? attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.convert.f8x2.to.f16x2", "summary": "Convert a pair of f8 inputs to f16x2", "description": "This Op converts the givenf8inputs in ai8x2 vectortof16.\n\n The result `dst` is represented as a vector off16elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction.[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[ 2 ], [ I8 ]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "srcType", "type": "TypeAttrOf>" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.convert.float.to.tf32", "summary": "Convert the given float input to TF32", "description": "This Op converts the given f32 input to tf32.\n The result `res` is represented as an i32 type.\n The `relu` attribute, when set, lowers to the '.relu' variant of\n the cvt instruction. The `rnd` and `sat` attributes specify the\n the rounding and saturation modes respectively.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr" }, { "name": "sat", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src attr-dict" }, { "name": "nvvm.convert.s2f6x2.to.bf16x2", "summary": "Convert s2f6x2 to bf16x2", "description": "This Op converts a pair of s2f6x2 inputs to bf16x2 type. The result `dst` \n is represented as a vector of two bf16 elements.\n\n The `relu` attribute, when set, lowers to the '.relu' variant\n of the cvt instruction.\n \n The optional scaling-factors for each of the inputs are provided through \n the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported \n as the type of the scale-factor currently.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[2], [I8]>" }, { "name": "scaleFactor", "type": "Optional" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2], [BF16]>" } ], "attributes": [ { "name": "sat", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$src (`,` $scaleFactor^)? attr-dict `:` type($src) `->` type($dst)" }, { "name": "nvvm.convert.x2.to.x2", "summary": "Convert a pair of inputs to x2", "description": "This Op converts the giveninputs in apacked i8to.\n\n The result `dst` is represented as a vector ofelements.The `relu` attribute, when set, lowers to the '.relu' variant of \n the cvt instruction.\"[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)", "operands": [ { "name": "src", "type": "I8" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[2]>" } ], "attributes": [ { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "srcType", "type": "TypeAttr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `(` $srcType `)` `->` type($dst)" }, { "name": "nvvm.cos", "summary": "Cosine (fast approximation)", "description": "Computes a fast approximation of the cosine of the input value (in\n radians). The `ftz` attribute, when set, flushes subnormal inputs\n and results to sign-preserving zero.", "operands": [ { "name": "src", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.cp.async.bulk.commit.group", "description": "This Op commits all prior initiated but uncommitted cp.async.bulk\n instructions into a cp.async.bulk-group.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk-commit-group)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.cp.async.bulk.global.shared.cta", "summary": "Async bulk copy from Shared CTA memory to Global memory", "description": "Initiates an asynchronous copy operation from Shared CTA memory to\n global memory. The 32-bit operand `size` specifies the amount of\n memory to be copied, in terms of number of bytes. `size` must be a\n multiple of 16. The `l2CacheHint` operand is optional, and it is used\n to specify cache eviction policy that may be used during the memory\n access. The `byteMask` operand is optional. The i-th bit in the 16-bit\n wide `byteMask` specifies whether the i-th byte of each 16-byte wide\n chunk of source data is copied to the destination. If the bit is set,\n the byte is copied.\n\n Example:\n ```mlir\n nvvm.cp.async.bulk.global.shared.cta %dst, %src, %size\n : !llvm.ptr<1>, !llvm.ptr<3>\n\n // with l2_cache_hint\n nvvm.cp.async.bulk.global.shared.cta %dst, %src, %size l2_cache_hint = %ch\n : !llvm.ptr<1>, !llvm.ptr<3>\n\n // with byte_mask\n nvvm.cp.async.bulk.global.shared.cta %dst, %src, %size byte_mask = %mask\n : !llvm.ptr<1>, !llvm.ptr<3>\n\n // with both l2_cache_hint and byte_mask\n nvvm.cp.async.bulk.global.shared.cta %dst, %src, %size l2_cache_hint = %ch byte_mask = %mask\n : !llvm.ptr<1>, !llvm.ptr<3>\n ```\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk)", "operands": [ { "name": "dstMem", "type": "LLVM_PointerGlobal" }, { "name": "srcMem", "type": "LLVM_PointerShared" }, { "name": "size", "type": "I32" }, { "name": "l2CacheHint", "type": "Optional" }, { "name": "byteMask", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$dstMem `,` $srcMem `,` $size\n (`l2_cache_hint` `=` $l2CacheHint^ )?\n (`byte_mask` `=` $byteMask^ )?\n attr-dict `:` type($dstMem) `,` type($srcMem)" }, { "name": "nvvm.cp.async.bulk.prefetch", "summary": "Async bulk prefetch from global memory to L2 cache", "description": "Initiates an asynchronous prefetch of data from the location\n specified by `srcMem` to the L2 cache.\n\n The `l2CacheHint` operand is optional, and it is used to specify cache\n eviction policy that may be used during the memory access.\n\n Example:\n ```mlir\n nvvm.cp.async.bulk.prefetch %src, %size : !llvm.ptr<1>\n\n // with l2_cache_hint\n nvvm.cp.async.bulk.prefetch %src, %size l2_cache_hint = %ch : !llvm.ptr<1>\n ```\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk-prefetch)", "operands": [ { "name": "srcMem", "type": "LLVM_PointerGlobal" }, { "name": "size", "type": "I32" }, { "name": "l2CacheHint", "type": "Optional" } ], "assemblyFormat": "$srcMem `,` $size (`l2_cache_hint` `=` $l2CacheHint^ )?\n attr-dict `:` type($srcMem)" }, { "name": "nvvm.cp.async.bulk.shared.cluster.global", "summary": "Async bulk copy from global to Shared {cta or cluster} memory", "description": "Initiates an asynchronous copy operation from global memory to shared\n memory or shared_cluster memory.\n\n The `multicastMask` operand is optional and can be used only when the\n destination is shared::cluster memory. When it is present, this Op copies\n data from global memory to shared memory of multiple CTAs in the cluster.\n Operand `multicastMask` specifies the destination CTAs in the cluster such\n that each bit position in the 16-bit `multicastMask` operand corresponds to\n the `nvvm.read.ptx.sreg.ctaid` of the destination CTA. \n\n The `l2CacheHint` operand is optional, and it is used to specify cache\n eviction policy that may be used during the memory access.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk)", "operands": [ { "name": "dstMem", "type": "AnyTypeOf<[LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "srcMem", "type": "LLVM_PointerGlobal" }, { "name": "mbar", "type": "LLVM_PointerShared" }, { "name": "size", "type": "I32" }, { "name": "multicastMask", "type": "Optional" }, { "name": "l2CacheHint", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$dstMem `,` $srcMem `,` $mbar `,` $size\n (`multicast_mask` `=` $multicastMask^ )?\n (`l2_cache_hint` `=` $l2CacheHint^ )?\n attr-dict `:` type($dstMem) `,` type($srcMem)" }, { "name": "nvvm.cp.async.bulk.shared.cluster.shared.cta", "summary": "Async bulk copy from Shared CTA memory to Shared cluster memory", "description": "Initiates an asynchronous copy operation from Shared CTA memory to Shared\n cluster memory.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk)", "operands": [ { "name": "dstMem", "type": "LLVM_PointerSharedCluster" }, { "name": "srcMem", "type": "LLVM_PointerShared" }, { "name": "mbar", "type": "LLVM_PointerShared" }, { "name": "size", "type": "I32" } ], "assemblyFormat": "$dstMem `,` $srcMem `,` $mbar `,` $size\n attr-dict `:` type($dstMem) `,` type($srcMem)" }, { "name": "nvvm.cp.async.bulk.tensor.global.shared.cta", "description": "Initiates an asynchronous copy of the tensor data from shared::cta\n memory to global memory. This Op supports all the store modes specified in\n `TMAStoreMode`.\n\n The `l2CacheHint` operand is optional, and it is used to specify cache\n eviction policy that may be used during the memory access.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-cp-async-bulk-tensor)", "operands": [ { "name": "tmaDescriptor", "type": "LLVM_PointerGeneric" }, { "name": "srcMem", "type": "LLVM_PointerShared" }, { "name": "coordinates", "type": "Variadic" }, { "name": "l2CacheHint", "type": "Optional" }, { "name": "predicate", "type": "Optional" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$tmaDescriptor `,` \n $srcMem `,` \n `box` `[`$coordinates `]` \n (`l2_cache_hint` `=` $l2CacheHint^ )?\n (`,` `predicate` `=` $predicate^)?\n attr-dict `:` type($tmaDescriptor) `,` type($srcMem)" }, { "name": "nvvm.cp.async.bulk.tensor.prefetch", "description": "Initiates an asynchronous prefetch operation on the tensor data from global\n memory to L2 cache. This Op supports all the load modes specified in\n `TMALoadMode`.\n\n The `l2CacheHint` operand is optional, and it is used to specify cache\n eviction policy that may be used during the memory access.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk-prefetch-tensor)", "operands": [ { "name": "tmaDescriptor", "type": "LLVM_PointerGeneric" }, { "name": "coordinates", "type": "Variadic" }, { "name": "im2colOffsets", "type": "Variadic" }, { "name": "l2CacheHint", "type": "Optional" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$tmaDescriptor `,`\n `box` `[`$coordinates `]`\n (`im2col` `[` $im2colOffsets^ `]` )?\n (`l2_cache_hint` `=` $l2CacheHint^ )?\n attr-dict `:` type($tmaDescriptor)" }, { "name": "nvvm.cp.async.bulk.tensor.reduce", "description": "Initiates an asynchronous reduction operation of tensor data in\n global memory with tensor data in shared memory.\n\n The `mode` attribute indicates whether the copy mode is tile or im2col.\n The `redOp` attribute specifies the reduction operations applied.\n The supported reduction operations are:\n {add, min, max, inc, dec, and, or, xor}\n\n The `l2CacheHint` operand is optional, and it is used to specify cache\n eviction policy that may be used during the memory access.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-reduce-async-bulk-tensor)", "operands": [ { "name": "tmaDescriptor", "type": "LLVM_AnyPointer" }, { "name": "srcMem", "type": "LLVM_PointerShared" }, { "name": "coordinates", "type": "Variadic" }, { "name": "l2CacheHint", "type": "Optional" } ], "attributes": [ { "name": "redKind", "type": "TMAReduxKindAttr{add|max|min|inc|dec|and|or|xor}" }, { "name": "mode", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$tmaDescriptor `,`\n $srcMem `,`\n `box` `[`$coordinates `]`\n (`l2_cache_hint` `=` $l2CacheHint^ )?\n attr-dict `:` type($tmaDescriptor) `,` type($srcMem)" }, { "name": "nvvm.cp.async.bulk.tensor.shared.cluster.global", "description": "Initiates an asynchronous copy operation on the tensor data from global \n memory to shared::cluster (or) shared::cta memory. This Op supports all\n the load modes specified in `TMALoadMode`.\n\n The `multicastMask` operand is optional. When it is present, the Op copies\n data from global memory to shared memory of multiple CTAs in the cluster.\n Operand `multicastMask` specifies the destination CTAs in the cluster such \n that each bit position in the 16-bit `multicastMask` operand corresponds to\n the `nvvm.read.ptx.sreg.ctaid` of the destination CTA. \n\n The `l2CacheHint` operand is optional, and it is used to specify cache \n eviction policy that may be used during the memory access.\n \n When the `isCTAOnly` attribute is set to true, the destination is\n shared::cta only. Hence, `multicastMask` and `CTAGroup` are not applicable\n when `isCTAOnly` is true.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk-tensor)", "operands": [ { "name": "dstMem", "type": "AnyTypeOf<[LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "tmaDescriptor", "type": "LLVM_PointerGeneric" }, { "name": "coordinates", "type": "Variadic" }, { "name": "mbar", "type": "LLVM_PointerShared" }, { "name": "im2colOffsets", "type": "Variadic" }, { "name": "multicastMask", "type": "Optional" }, { "name": "l2CacheHint", "type": "Optional" }, { "name": "predicate", "type": "Optional" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedAttr" }, { "name": "isCTAOnly", "type": "DefaultValuedAttr" }, { "name": "group", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$dstMem `,` \n $tmaDescriptor `,` \n $mbar `,` \n `box` `[`$coordinates `]` \n (`im2col` `[` $im2colOffsets^ `]` )?\n (`multicast_mask` `=` $multicastMask^ )?\n (`l2_cache_hint` `=` $l2CacheHint^ )?\n (`predicate` `=` $predicate^)? \n attr-dict `:` type($dstMem) `,` type($tmaDescriptor)" }, { "name": "nvvm.cp.async.bulk.wait_group", "description": "Op waits for completion of the most recent bulk async-groups.\n\n The `$group` operand tells waiting has to be done until for $group or fewer\n of the most recent bulk async-groups. If `$group` is 0, the op wait until \n all the most recent bulk async-groups have completed.\n\n The `$read` indicates that the waiting has to be done until all the bulk \n async operations in the specified bulk async-group have completed reading \n from their source locations.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk-wait-group)", "attributes": [ { "name": "group", "type": "ConfinedAttr]>" }, { "name": "read", "type": "OptionalAttr" } ], "assemblyFormat": "$group attr-dict" }, { "name": "nvvm.cp.async.commit.group", "assemblyFormat": "attr-dict" }, { "name": "nvvm.cp.async.mbarrier.arrive", "summary": "NVVM Dialect Op for cp.async.mbarrier.arrive", "description": "The `cp.async.mbarrier.arrive` Op makes the *mbarrier object* track\n all prior cp.async operations initiated by the executing thread.\n The `addr` operand specifies the address of the *mbarrier object*\n in generic or shared::cta address space. When it is generic, the\n underlying memory should fall within the shared::cta space;\n otherwise the behavior is undefined. The `noinc` attr impacts\n how the mbarrier's state is updated.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-cp-async-mbarrier-arrive)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" } ], "attributes": [ { "name": "noinc", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr attr-dict `:` type(operands)" }, { "name": "nvvm.cp.async.shared.global", "operands": [ { "name": "dst", "type": "LLVM_PointerShared" }, { "name": "src", "type": "LLVM_PointerGlobal" }, { "name": "cpSize", "type": "Optional" } ], "attributes": [ { "name": "size", "type": "I32Attr" }, { "name": "modifier", "type": "LoadCacheModifierAttr{ca|cg|cs|lu|cv}" } ], "assemblyFormat": "$dst `,` $src `,` $size `,` `cache` `=` $modifier (`,` $cpSize^)? attr-dict `:` type(operands)" }, { "name": "nvvm.cp.async.wait.group", "attributes": [ { "name": "n", "type": "I32Attr" } ], "assemblyFormat": "$n attr-dict" }, { "name": "nvvm.divf", "summary": "Divide one value by another", "description": "Divides lhs by rhs, stores result in res (`res = lhs / rhs`).\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-div)", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[F32, F64]>" }, { "name": "rhs", "type": "AnyTypeOf<[F32, F64]>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[F32, F64]>" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr]>, FPRoundingMode::NONE>" }, { "name": "ftz", "type": "DefaultValuedAttr" }, { "name": "approx", "type": "DefaultValuedAttr" }, { "name": "full", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "nvvm.dot.accumulate.2way", "summary": "Two-way 16-bit to 8-bit dot product-accumulate instruction", "description": "Performs a two-way 16-bit to 8-bit dot-product which is accumulated in a \n 32-bit result.\n Operand `a` is a vector of two 16-bit elements and operand `b` a vector \n of four 8-bit elements between which the dot product is computed.\n\n The `a_type` and `b_type` attributes specify the type of the elements in `a`\n and `b` respectively.\n If `a_type` or `b_type` is `s`, then the elements in the corresponding \n vector are sign-extended to 32-bit before the dot product is computed.\n If `a_type` or `b_type` is `u`, then the elements in the corresponding \n vector are zero-extended to 32-bit instead.\n\n The `b_hi` boolean attribute specifies which two bytes of `b` are used for \n the dot product. If `b_hi` is true, then the dot product is computed \n between `a` and elements at indices 2 and 3 of `b`. If `b_hi` is false, \n then the dot product is computed between `a` and elements at indices 0 and \n 1 of `b`.\n\n Operand `c` is a 32-bit integer to which the result is accumulated. It is\n treated as holding a signed integer if any of `a_type` or `b_type` is \n signed.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#integer-arithmetic-instructions-dp2a)", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[2], [I16]>" }, { "name": "b", "type": "VectorOfLengthAndType<[4], [I8]>" }, { "name": "c", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "a_type", "type": "DotAccumulateTypeAttr{signed|unsigned}" }, { "name": "b_type", "type": "DotAccumulateTypeAttr{signed|unsigned}" }, { "name": "b_hi", "type": "BoolAttr" } ], "assemblyFormat": "$a $a_type `,` $b $b_type `,` $c attr-dict `:` type($a) `,` type($b)" }, { "name": "nvvm.dot.accumulate.4way", "summary": "Four-way byte dot product-accumulate instruction", "description": "Performs a four-way byte dot-product which is accumulated in a 32-bit\n result.\n Operand `a` and `b` are vectors of 4 bytes between which the dot product is \n computed.\n\n The `a_type` and `b_type` attributes specify the type of the elements in `a`\n and `b` respectively.\n If `a_type` or `b_type` is `signed`, then the elements in the corresponding \n vector are sign-extended to 32-bit before the dot product is computed.\n If `a_type` or `b_type` is `unsigned`, then the elements in the \n corresponding vector are zero-extended to 32-bit instead.\n\n Operand `c` is a 32-bit integer to which the result is accumulated. It is\n treated as holding a signed integer if any of `a_type` or `b_type` is `s8`.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#integer-arithmetic-instructions-dp4a)", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[4], [I8]>" }, { "name": "b", "type": "VectorOfLengthAndType<[4], [I8]>" }, { "name": "c", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "a_type", "type": "DotAccumulateTypeAttr{signed|unsigned}" }, { "name": "b_type", "type": "DotAccumulateTypeAttr{signed|unsigned}" } ], "assemblyFormat": "$a $a_type `,` $b $b_type `,` $c attr-dict `:` type($a) `,` type($b)" }, { "name": "nvvm.elect.sync", "summary": "Elect one leader thread", "description": "The `elect.sync` instruction elects one predicated active leader\n thread from among a set of threads specified in the `membermask`.\n When the `membermask` is not provided explicitly, a default value\n of `0xFFFFFFFF` is used. The predicate result is set to `True` for\n the leader thread, and `False` for all other threads.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-elect-sync)", "operands": [ { "name": "membermask", "type": "Optional" } ], "results": [ { "name": "pred", "type": "I1" } ], "assemblyFormat": "($membermask^)? attr-dict `->` type(results)" }, { "name": "nvvm.ex2", "summary": "Base-2 exponential (fast approximation)", "description": "Computes a fast approximation of 2 raised to the power of the input\n value. The `ftz` attribute, when set, flushes subnormal inputs and\n results to sign-preserving zero.", "operands": [ { "name": "src", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.exit", "summary": "Exit Op", "description": "Ends execution of a thread.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#control-flow-instructions-exit)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.fence.mbarrier.init", "description": "Fence operation that applies on the prior nvvm.mbarrier.init\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-membar)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.fence.proxy", "description": "Fence operation with proxy to establish an ordering between memory accesses\n that may happen through different proxies.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-membar)", "attributes": [ { "name": "kind", "type": "ProxyKindNotTensormapOrGeneric" }, { "name": "space", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.fence.proxy.acquire", "summary": "Uni-directional proxy fence operation with acquire semantics", "description": "`fence.proxy.acquire` is a uni-directional fence used to establish ordering\n between a prior memory access performed via the generic proxy and a\n subsequent memory access performed via the tensormap proxy\n\n The address operand `addr` and the operand `size` together specify the\n memory range `[addr, addr+size)` on which the ordering guarantees on the\n memory accesses across the proxies is to be provided. The only supported\n value for the `size` operand is 128 and must be an immediate. Generic Addressing\n is used unconditionally, and the address specified by the operand `addr` must\n fall within the `.global` state space. Otherwise, the behavior is undefined\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-membar)", "operands": [ { "name": "addr", "type": "LLVM_PointerGeneric" }, { "name": "size", "type": "I32" } ], "attributes": [ { "name": "scope", "type": "MemScopeKindAttr{cta|cluster|gpu|sys}" }, { "name": "fromProxy", "type": "DefaultValuedAttr" }, { "name": "toProxy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$scope $addr `,` $size (`from_proxy` `=` $fromProxy^)? (`to_proxy` `=` $toProxy^)? attr-dict" }, { "name": "nvvm.fence.proxy.release", "summary": "Uni-directional proxy fence operation with release semantics", "description": "`fence.proxy.release` is a uni-directional fence used to establish ordering\n between a prior memory access performed via the generic proxy and a\n subsequent memory access performed via the tensormap proxy. `fence.proxy.release`\n operation can form a release sequence that synchronizes with an acquire\n sequence that contains the fence.proxy.acquire proxy fence operation\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-membar)", "attributes": [ { "name": "scope", "type": "MemScopeKindAttr{cta|cluster|gpu|sys}" }, { "name": "fromProxy", "type": "DefaultValuedAttr" }, { "name": "toProxy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$scope (`from_proxy` `=` $fromProxy^)? (`to_proxy` `=` $toProxy^)? attr-dict" }, { "name": "nvvm.fence.proxy.sync_restrict", "summary": "Uni-directional proxy fence operation with sync_restrict", "description": "The `nvvm.fence.proxy.sync_restrict` Op used to establish\n ordering between a prior memory access performed between proxies. Currently,\n the ordering is only supported between async and generic proxies. `sync_restrict`\n restricts `acquire` memory semantics to `shared_cluster` and `release` memory\n semantics to `shared_cta` with cluster scope.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-membar)", "attributes": [ { "name": "order", "type": "MemOrderAcquireOrRelease" }, { "name": "fromProxy", "type": "DefaultValuedAttr" }, { "name": "toProxy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.fence.sc.cluster", "assemblyFormat": "attr-dict" }, { "name": "nvvm.fence.sync_restrict", "summary": "Uni-directional thread fence operation", "description": "The `nvvm.fence.sync_restrict` Op restricts the class of memory\n operations for which the fence instruction provides the memory ordering guarantees.\n `sync_restrict` restricts `acquire` memory semantics to `shared_cluster` and\n `release` memory semantics to `shared_cta` with cluster scope.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-membar)", "attributes": [ { "name": "order", "type": "MemOrderAcquireOrRelease" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.fma", "summary": "Performs floating point fused multiply-add operation with support for mixed \n precision operands", "description": "The `nvvm.fma` operation performs floating point fused multiply-add of \n three operands of the same type.\n\n The rounding mode is specified by the `rnd` attribute, saturation mode by \n the `sat` attribute, flush-to-zero by the `ftz` attribute, and ReLU by the \n `relu` attribute.\n \n Out-of-bounds (OOB) behavior is controlled by the `oob` attribute. `oob` \n clamps the result to 0 if either of the operands is `OOB NaN` (see [Tensors](https://docs.nvidia.com/cuda/parallel-thread-execution/#tensors)).\n\n For more information, see PTX ISA:\n - [floating point fused multiply-add](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-fma)\n - [half-precision floating point fused multiply-add](https://docs.nvidia.com/cuda/parallel-thread-execution/#half-precision-floating-point-instructions-fma)", "operands": [ { "name": "a", "type": "SIMTFloatType" }, { "name": "b", "type": "SIMTFloatType" }, { "name": "c", "type": "SIMTFloatType" } ], "results": [ { "name": "res", "type": "SIMTFloatType" } ], "attributes": [ { "name": "rnd", "type": "ConfinedAttr]>" }, { "name": "sat", "type": "DefaultValuedAttr]>, SaturationMode::NONE>" }, { "name": "ftz", "type": "DefaultValuedAttr" }, { "name": "relu", "type": "DefaultValuedAttr" }, { "name": "oob", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` type($a)" }, { "name": "nvvm.griddepcontrol", "description": "If the $kind attribute is set to `wait`, it causes the \n executing thread to wait until all prerequisite grids in flight \n have completed and all the memory operations from the prerequisite grids \n are performed and made visible to the current grid.\n\n When the $kind is launch_dependents, it signals that specific dependents \n the runtime system designated to react to this instruction can be scheduled \n as soon as all other CTAs in the grid issue the same instruction or have \n completed.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-griddepcontrol)", "attributes": [ { "name": "kind", "type": "GridDepActionAttr{wait|launch_dependents}" } ], "assemblyFormat": "$kind attr-dict" }, { "name": "nvvm.inline_ptx", "summary": "Inline PTX Op", "description": "This op allows using PTX directly within the NVVM \n dialect, while greatly simplifying llvm.inline_asm generation. It \n automatically handles register size selection and sets the correct \n read/write access for each operand. The operation leverages the \n `BasicPtxBuilderInterface` to abstract away low-level details of \n PTX assembly formatting.\n\n The `predicate` attribute is used to specify a predicate for the \n PTX instruction.\n\n Example 1: Read-only Parameters\n ```mlir\n nvvm.inline_ptx \"mbarrier.init.b64 [$0], $1;\" (%barrier_gen, %count) : !llvm.ptr, i32\n\n // Lowers to:\n llvm.inline_asm has_side_effects asm_dialect = att \n \"mbarrier.init.b64 [$0], $1;\", \"l,r\" %arg0, %arg2 : (!llvm.ptr, i32) -> ()\n ```\n\n Example 2: Read-only and Write-only Parameters\n ```mlir\n %0 = nvvm.inline_ptx \"ex2.approx.ftz.f32 $0, $1;\" (%input) : f32 -> f32\n\n // Lowers to:\n %0 = llvm.inline_asm has_side_effects asm_dialect = att \n \"ex2.approx.ftz.f32 $0, $1;\", \"=f,f\" %arg0 : (f32) -> f32\n ```\n\n Example 3: Predicate Usage\n ```mlir\n nvvm.inline_ptx \"mbarrier.init.b64 [$0], $1;\" (%barrier_gen, %count), \n predicate = %pred : !llvm.ptr, i32, i1\n\n // Lowers to:\n llvm.inline_asm has_side_effects asm_dialect = att \n \"@$2 mbarrier.init.b64 [$0], $1;\", \"l,r,b\" %arg0, %arg2, %arg3 \n : (!llvm.ptr, i32, i1) -> ()\n ```", "operands": [ { "name": "readOnlyArgs", "type": "Variadic" }, { "name": "readWriteArgs", "type": "Variadic" }, { "name": "predicate", "type": "Optional" } ], "results": [ { "name": "writeOnlyArgs", "type": "Variadic" } ], "attributes": [ { "name": "ptxCode", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$ptxCode\n ( `ro` `(` $readOnlyArgs^ `:` type($readOnlyArgs) `)` )?\n ( `rw` `(` $readWriteArgs^ `:` type($readWriteArgs) `)` )?\n (`,` `predicate` `=` $predicate^)? \n attr-dict\n ( `->` type($writeOnlyArgs)^ )?" }, { "name": "nvvm.ldmatrix", "summary": "cooperative matrix load", "operands": [ { "name": "ptr", "type": "LLVM_PointerShared" } ], "results": [ { "name": "res", "type": "AnyType" } ], "attributes": [ { "name": "num", "type": "I32Attr" }, { "name": "layout", "type": "MMALayoutAttr{row|col}" }, { "name": "shape", "type": "LdStMatrixShapeAttr" }, { "name": "eltType", "type": "LdStMatrixEltTypeAttr{b16|b8|b8x16.b6x16_p32|b8x16.b4x16_p64}" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$ptr attr-dict `:` functional-type($ptr, $res)" }, { "name": "nvvm.log2", "summary": "Base-2 logarithm (fast approximation)", "description": "Computes a fast approximation of the base-2 logarithm of the input\n value. The `ftz` attribute, when set, flushes subnormal inputs and\n results to sign-preserving zero.", "operands": [ { "name": "src", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.mapa", "operands": [ { "name": "a", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "b", "type": "I32" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerSharedCluster]>" } ], "assemblyFormat": "$a`,` $b attr-dict `:` type($a) `->` type($res)" }, { "name": "nvvm.match.sync", "summary": "Broadcast and compare a value across threads in warp", "description": "The `match.sync` op performs broadcast and compare of operand `val` across \n all non-exited threads in `thread_mask` and returns a mask depending on the \n kind and an optional predicate.\n\n The matching operation kinds are:\n - `any`: Returns a mask corresponding to the non-exited threads in the \n `thread_mask` that have the same value of operand `val`.\n - `all`: Returns a mask and a predicate. If all non-exited threads in the \n `thread_mask` have the same value of operand `val`, the predicate is set to \n true and the mask corresponds to the non-exited threads in the \n `thread_mask`. Otherwise, the predicate is set to false and the mask is 0.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-match-sync)", "operands": [ { "name": "thread_mask", "type": "I32" }, { "name": "val", "type": "AnyTypeOf<[I32, I64]>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[I32, LLVMStructType]>" } ], "attributes": [ { "name": "kind", "type": "MatchSyncKindAttr{any|all}" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$kind $thread_mask `,` $val attr-dict `:` type($val) `->` type($res)" }, { "name": "nvvm.mbarrier.arrive", "summary": "MBarrier Arrive Operation", "description": "The `nvvm.mbarrier.arrive` operation performs an arrive-on operation on the \n *mbarrier object* at the specified address. Uses the default `.release.cta` semantics. \n This release pattern establishes memory ordering for operations occurring in program \n order before this arrive instruction by making operations from the current thread \n visible to subsequent operations in other threads within the CTA. When other threads \n perform corresponding acquire operations (like 'mbarrier.test.wait'), they synchronize \n with this release pattern.\n\n This operation causes the executing thread to signal its arrival at the barrier.\n\n - `res`: When the `space` is not shared_cluster, this operation returns an\n opaque 64-bit value capturing the phase of the *mbarrier object* prior to\n the arrive-on operation. The contents of this return value are\n implementation-specific. An *mbarrier object* located in the shared_cluster\n space cannot return a value.\n\n The operation takes the following operands:\n - `addr`: A pointer to the memory location of the *mbarrier object*. The `addr`\n must be a pointer to generic or shared_cta or shared_cluster memory. When it\n is generic, the underlying address must be within the shared_cta memory space;\n otherwise the behavior is undefined.\n - `count`: This specifies the amount by which the pending arrival count is\n decremented. If the `count` argument is not specified, the pending arrival\n count is decremented by 1.\n - `scope`: This specifies the set of threads that directly observe the memory\n synchronizing effect of the `mbarrier.arrive` operation.\n - `space`: This indicates the memory space where the mbarrier object resides.\n - `relaxed`: When set to true, the `arrive` operation has relaxed memory semantics\n and does not provide any ordering or visibility guarantees.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-arrive)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "count", "type": "Optional" } ], "results": [ { "name": "res", "type": "Optional" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" }, { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr (`,` $count^)? attr-dict `:` type($addr) (`->` type($res)^)?" }, { "name": "nvvm.mbarrier.arrive_drop", "summary": "MBarrier Arrive-Drop Operation", "description": "The `nvvm.mbarrier.arrive_drop` operation decrements the expected arrival\n count of the *mbarrier object* by `count` and then performs an arrive-on\n operation. When `count` is not specified, it defaults to 1. The decrement\n of the expected arrival count applies to all the subsequent phases of the\n *mbarrier object*. The remaining semantics are identical to those of the\n `nvvm.mbarrier.arrive` operation.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-arrive-drop)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "count", "type": "Optional" } ], "results": [ { "name": "res", "type": "Optional" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" }, { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr (`,` $count^)? attr-dict `:` type($addr) (`->` type($res)^)?" }, { "name": "nvvm.mbarrier.arrive_drop.expect_tx", "summary": "MBarrier arrive_drop with expected transaction count", "description": "The `nvvm.mbarrier.arrive_drop.expect_tx` operation is similar to the\n `nvvm.mbarrier.arrive.expect_tx` operation except that it performs an\n `arrive_drop` operation instead of only an `arrive` operation.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-arrive-drop)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "txcount", "type": "I32" } ], "results": [ { "name": "res", "type": "Optional" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" }, { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $txcount attr-dict `:` type(operands) (`->` type($res)^)?" }, { "name": "nvvm.mbarrier.arrive_drop.nocomplete", "summary": "MBarrier Arrive-Drop No-Complete Operation", "description": "The `nvvm.mbarrier.arrive_drop.nocomplete` operation decrements the expected\n arrival count of the *mbarrier object* by the amount `count` and then performs\n an arrive-on operation on the *mbarrier object* with the guarantee that it\n will not cause the barrier to complete its current phase.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-arrive-drop)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "count", "type": "I32" } ], "results": [ { "name": "res", "type": "I64" } ], "assemblyFormat": "$addr `,` $count attr-dict `:` type(operands) `->` type($res)" }, { "name": "nvvm.mbarrier.arrive.expect_tx", "summary": "MBarrier Arrive with Expected Transaction Count", "description": "The `nvvm.mbarrier.arrive.expect_tx` operation performs an expect-tx operation \n followed by an arrive-on operation on the *mbarrier object*. Uses the default \n `.release.cta` semantics. This release pattern establishes memory ordering for \n operations occurring in program order before this arrive instruction by making \n operations from the current thread visible to subsequent operations in other \n threads within the CTA. When other threads perform corresponding acquire operations \n (like 'mbarrier.test.wait'), they synchronize with this release pattern.\n\n This operation first performs an expect-tx operation with the specified transaction\n count, then performs an arrive-on operation with an implicit count of 1. The\n expect-tx operation increases the expect-count of the *mbarrier object* by the\n specified value (i.e. `txcount`), setting the current phase to expect and track\n the completion of additional asynchronous transactions.\n\n The operation takes the following operands:\n - `addr`: A pointer to the memory location of the *mbarrier object*. Uses generic \n addressing, but the address must still be in the shared memory space.\n - `txcount`: An unsigned integer specifying the expected transaction count \n for the expect-tx operation. This represents the number of asynchronous transactions \n expected to complete before the barrier phase completes.\n - `scope`: This specifies the set of threads that directly observe the memory\n synchronizing effect of the `mbarrier.test.wait` operation.\n - `relaxed`: When set to true, the `arrive` operation has relaxed memory semantics\n and does not provide any ordering or visibility guarantees.\n - `predicate`: Optional predicate for conditional execution used only when lowering to\n inline-ptx.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-arrive-drop)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "txcount", "type": "I32" }, { "name": "predicate", "type": "Optional" } ], "results": [ { "name": "res", "type": "Optional" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" }, { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $txcount (`,` `predicate` `=` $predicate^)? attr-dict `:` type(operands) (`->` type($res)^)?" }, { "name": "nvvm.mbarrier.arrive.nocomplete", "summary": "MBarrier Arrive No-Complete Operation", "description": "The `nvvm.mbarrier.arrive.nocomplete` operation performs an arrive-on operation \n on the *mbarrier object* with the guarantee that it will not cause the barrier to \n complete its current phase. Uses the default `.release.cta` semantics. This release \n pattern establishes memory ordering for operations occurring in program order before \n this arrive instruction by making operations from the current thread visible to \n subsequent operations in other threads within the CTA. When other threads perform \n corresponding acquire operations (like 'mbarrier.test.wait'), they synchronize with \n this release pattern.\n\n This operation causes the executing thread to signal its arrival at the barrier \n with a specified count, but ensures that the barrier phase will not complete as \n a result of this operation. The operation returns an opaque value that \n captures the phase of the *mbarrier object* prior to the arrive-on operation.\n\n The operation takes the following operands:\n - `addr`: A pointer to the memory location of the *mbarrier object*. The `addr`\n must be a pointer to generic or shared::cta memory. When it is generic, the\n underlying address must be within the shared::cta memory space; otherwise\n the behavior is undefined.\n - `count`: Integer specifying the count argument to the arrive-on operation. \n Must be in the valid range as specified in the *mbarrier object* contents.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-arrive)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "count", "type": "I32" } ], "results": [ { "name": "res", "type": "I64" } ], "assemblyFormat": "$addr `,` $count attr-dict `:` type(operands) `->` type($res)" }, { "name": "nvvm.mbarrier.complete_tx", "summary": "MBarrier complete-tx Operation", "description": "The `nvvm.mbarrier.complete_tx` operation decrements the transaction\n count of the *mbarrier object* at `addr` by `txcount`. It also signals\n the completion of asynchronous transactions that were tracked by the\n current phase. The `scope` specifies the set of threads that can directly\n observe the memory synchronizing effect of the `mbarrier.complete_tx`\n operation. `CTA` and `CLUSTER` are the only allowed values for `scope`.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-complete-tx)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "txcount", "type": "I32" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $txcount attr-dict `:` type(operands)" }, { "name": "nvvm.mbarrier.expect_tx", "summary": "MBarrier expect-tx Operation", "description": "The `nvvm.mbarrier.expect_tx` operation increases the transaction count\n of the mbarrier located at `addr` by `txcount` amount. The `scope`\n specifies the set of threads that can directly observe the memory\n synchronizing effect of the `mbarrier.expect_tx` operation. `CTA`\n and `CLUSTER` are the only allowed values for `scope`.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-expect-tx)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerShared, LLVM_PointerSharedCluster]>" }, { "name": "txcount", "type": "I32" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $txcount attr-dict `:` type(operands)" }, { "name": "nvvm.mbarrier.init", "summary": "MBarrier Initialization Op", "description": "The `nvvm.mbarrier.init` operation initializes an *mbarrier object* at the specified \n memory location. \n\n This operation initializes the *mbarrier object* with the following state:\n - Current phase: 0\n - Expected arrival count: `count`\n - Pending arrival count: `count` \n - Transaction count (tx-count): 0\n\n The operation takes the following operands:\n - `addr`: A pointer to the memory location of the *mbarrier object*. The `addr`\n must be a pointer to generic or shared::cta memory. When it is generic, the\n underlying address must be within the shared::cta memory space; otherwise\n the behavior is undefined.\n - `count`: Integer specifying the number of threads that will participate in barrier\n synchronization. Must be in the range [1, 2²⁰ - 1].\n - `predicate`: Optional predicate for conditional execution.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-init)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "count", "type": "I32" }, { "name": "predicate", "type": "Optional" } ], "assemblyFormat": "$addr `,` $count (`,` `predicate` `=` $predicate^)? attr-dict `:` type(operands)" }, { "name": "nvvm.mbarrier.inval", "summary": "MBarrier Invalidation Operation", "description": "The `nvvm.mbarrier.inval` operation invalidates an *mbarrier object* at the \n specified memory location. \n\n This operation marks the *mbarrier object* as invalid, making it safe to repurpose \n the memory location for other uses or to reinitialize it as a new *mbarrier object*.\n It is undefined behavior if the *mbarrier object* is already invalid.\n \n The operation takes the following operand:\n - `addr`: A pointer to the memory location of the *mbarrier object*. The `addr`\n must be a pointer to generic or shared::cta memory. When it is generic, the\n underlying address must be within the shared::cta memory space; otherwise\n the behavior is undefined.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-inval)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" } ], "assemblyFormat": "$addr attr-dict `:` type(operands)" }, { "name": "nvvm.mbarrier.test.wait", "summary": "MBarrier Non-Blocking Test Wait Operation", "description": "The `nvvm.mbarrier.test.wait` operation performs a non-blocking test for the\n completion of a specific phase of an *mbarrier object*. It uses the default\n `.acquire.cta` semantics. This acquire pattern establishes memory ordering for\n operations occurring in program order after this wait instruction by making\n operations from other threads in the CTA visible to subsequent operations in the current\n thread. When this wait completes, it synchronizes with the corresponding release\n pattern from the `mbarrier.arrive` operation, establishing memory ordering within\n the CTA.\n\n This operation tests whether the mbarrier phase specified by the state operand\n has completed. It is a non-blocking instruction that immediately returns the\n completion status without suspending the executing thread.\n\n The operation takes the following operands:\n - `addr`: A pointer to the memory location of the *mbarrier object*. Uses generic\n addressing, but the address must still be in the shared memory space.\n - `stateOrPhase`: This argument represents a `state` when it is a 64-bit value\n and represents a `phase` when it is a 32-bit value. The `state` is an opaque\n value returned by a previous `mbarrier.arrive` operation on the same\n *mbarrier object* during the current or immediately preceding phase.\n The `phase` is an integer specifying the phase parity (0 or 1).\n Even phases have parity 0, odd phases have parity 1.\n - `scope`: This specifies the set of threads that directly observe the memory\n synchronizing effect of the `mbarrier.test.wait` operation.\n - `relaxed`: When set to true, the `arrive` operation has relaxed memory semantics\n and does not provide any ordering or visibility guarantees.\n\n The operation returns a boolean value indicating whether the specified phase \n has completed:\n - `true`: The immediately preceding phase has completed\n - `false`: The phase is still incomplete (current phase)\n\n **Memory ordering guarantees**: When this wait returns true, the following \n ordering guarantees hold:\n\n 1. All memory accesses (except async operations) requested prior to\n `mbarrier.arrive` having release semantics by participating CTA threads\n are visible to the executing thread.\n 2. All `cp.async` operations requested prior to `cp.async.mbarrier.arrive`\n by participating CTA threads are visible to the executing thread.\n 3. All `cp.async.bulk` operations using the same *mbarrier object* requested\n prior to `mbarrier.arrive` having release semantics by participating CTA\n threads are visible to the executing thread.\n 4. Memory accesses requested after this wait are not visible to memory\n accesses performed prior to `mbarrier.arrive` by other participating\n threads.\n 5. No ordering guarantee exists for memory accesses by the same thread\n between `mbarrier.arrive` and this wait.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-mbarrier-test-wait-try-wait)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "stateOrPhase", "type": "AnyTypeOf<[I64, I32]>" } ], "results": [ { "name": "res", "type": "I1" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" }, { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $stateOrPhase attr-dict `:` type(operands) `->` type($res)" }, { "name": "nvvm.mbarrier.try_wait", "summary": "MBarrier try wait on state or phase with an optional timelimit", "description": "The `nvvm.mbarrier.try_wait` operation checks whether the specified\n *mbarrier object* at `addr` has completed the given phase. Note that\n unlike the `nvvm.mbarrier.test.wait` operation, the try_wait operation\n is a potentially-blocking one. If the phase is not yet complete, the\n calling thread may be suspended. A suspended thread resumes execution\n once the phase completes or when a system-defined timeout occurs.\n Optionally, the `ticks` operand can be used to provide a custom timeout\n (in nanoseconds), overriding the system-defined one. The semantics of\n this operation and its operands are otherwise similar to those of the\n `nvvm.mbarrier.test.wait` Op.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-mbarrier-test-wait-try-wait)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "stateOrPhase", "type": "AnyTypeOf<[I64, I32]>" }, { "name": "ticks", "type": "Optional" } ], "results": [ { "name": "res", "type": "I1" } ], "attributes": [ { "name": "scope", "type": "DefaultValuedAttr" }, { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $stateOrPhase (`,` $ticks^)? attr-dict `:` type(operands) `->` type($res)" }, { "name": "nvvm.mbarrier.try_wait.parity", "summary": "MBarrier Potentially-Blocking Try Wait with Phase Parity", "description": "The `nvvm.mbarrier.try_wait.parity` operation performs a potentially-blocking \n test for the completion of a specific phase of an *mbarrier object* using phase \n parity. It uses the default `.acquire.cta` semantics. This acquire pattern \n establishes memory ordering for operations occurring in program order after this \n wait instruction by making operations from other threads in the CTA visible to subsequent \n operations in the current thread. When this wait completes, it synchronizes with \n the corresponding release pattern from the `mbarrier.arrive` operation, establishing \n memory ordering within the CTA.\n\n This operation waits for the completion of the mbarrier phase indicated by the \n phase parity. While it uses the underlying PTX `mbarrier.try_wait.parity` \n instruction, this MLIR operation generates a loop that enforces the test to \n complete before continuing execution, ensuring the barrier phase is actually \n completed rather than potentially timing out.\n\n The operation takes the following operands:\n - `addr`: A pointer to the memory location of the *mbarrier object*. Uses generic \n addressing, but the address must still be in the shared memory space.\n - `phase`: An integer specifying the phase parity (0 or 1). Even phases \n have parity 0, odd phases have parity 1.\n - `ticks`: An unsigned integer specifying the suspend time hint in \n nanoseconds. This may be used instead of the system-dependent time limit.\n\n **Memory ordering guarantees**: When this wait returns true, the following \n ordering guarantees hold:\n\n 1. All memory accesses (except async operations) requested prior to\n `mbarrier.arrive` having release semantics by participating CTA threads\n are visible to the executing thread.\n 2. All `cp.async` operations requested prior to `cp.async.mbarrier.arrive`\n by participating CTA threads are visible to the executing thread.\n 3. All `cp.async.bulk` operations using the same *mbarrier object* requested\n prior to `mbarrier.arrive` having release semantics by participating CTA\n threads are visible to the executing thread.\n 4. Memory accesses requested after this wait are not visible to memory\n accesses performed prior to `mbarrier.arrive` by other participating\n threads.\n 5. No ordering guarantee exists for memory accesses by the same thread\n between `mbarrier.arrive` and this wait.\n\n **Implementation behavior**:\n This operation generates a PTX loop that repeatedly calls the underlying \n `mbarrier.try_wait.parity` instruction until the barrier phase completes. \n Unlike the raw PTX instruction which may return without completion after a \n timeout, this MLIR operation guarantees completion by continuing to loop until \n the specified phase is reached.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-mbarrier-test-wait-try-wait)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "phase", "type": "I32" }, { "name": "ticks", "type": "I32" } ], "assemblyFormat": "$addr `,` $phase `,` $ticks attr-dict `:` type(operands)" }, { "name": "nvvm.memory.barrier", "summary": "Memory barrier operation", "description": "`membar` operation guarantees that prior memory accesses requested by this\n thread are performed at the specified `scope`, before later memory\n operations requested by this thread following the membar instruction.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-membar)", "attributes": [ { "name": "scope", "type": "MemScopeKindAttr{cta|cluster|gpu|sys}" } ], "assemblyFormat": "$scope attr-dict" }, { "name": "nvvm.mma.block_scale", "summary": "cooperative matrix-multiply and accumulate with block scaling", "description": "The `nvvm.mma.block_scale` operation collectively performs the operation\n `D = matmul(A * SF_A, B * SF_B) + C` using all threads in a warp.\n\n A, B, C and D are dense matrices and SF_A and SF_B are scaling factors.\n Dimensions of SF_A and SF_B are based on scale vector sizes (x1, x2, x4),\n and the data type must be either ue8m0 or ue4m3.\n\n All the threads in the warp must execute the same `mma.block_scale` operation.\n\n This operation follows the same design pattern as `nvvm.mma.sync`, with additional\n scaling operands for both A and B matrices.\n\n Example:\n ```mlir\n %d = nvvm.mma.block_scale A[%a0, %a1] B[%b0, %b1] C[%c0, %c1]\n scaleA[%scaleAData, %byteIdA, %threadIdA]\n scaleB[%scaleBData, %byteIdB, %threadIdB]\n {shape = #nvvm.shape,\n multiplicandAPtxType = #nvvm.mma_type,\n multiplicandBPtxType = #nvvm.mma_type,\n scaleVecSize = #nvvm.scale_vec_size,\n blockScaleFormat = #nvvm.block_scale_format,\n kind = #nvvm.block_scale_kind}\n : (vector<4xf16>, vector<2xf16>, vector<2xf32>) -> !llvm.struct<(f32, f32)>\n ```", "operands": [ { "name": "operandA", "type": "Variadic" }, { "name": "operandB", "type": "Variadic" }, { "name": "operandC", "type": "Variadic" }, { "name": "scaleAData", "type": "I32" }, { "name": "byteIdA", "type": "I16" }, { "name": "threadIdA", "type": "I16" }, { "name": "scaleBData", "type": "I32" }, { "name": "byteIdB", "type": "I16" }, { "name": "threadIdB", "type": "I16" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "shape", "type": "NVVM_MMAShapeAttr" }, { "name": "multiplicandAPtxType", "type": "OptionalAttr" }, { "name": "multiplicandBPtxType", "type": "OptionalAttr" }, { "name": "scaleVecSize", "type": "ScaleVecSizeAttr{x1|x2|x4}" }, { "name": "blockScaleFormat", "type": "BlockScaleFormatAttr{ue8m0|ue4m3}" }, { "name": "kind", "type": "MMABlockScaleKindAttr{mxf8f6f4|mxf4|mxf4nvf4}" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "nvvm.mma.sp.block_scale", "summary": "cooperative sparse matrix-multiply and accumulate with block scaling", "description": "The `nvvm.mma.sp.block_scale` operation collectively performs the operation\n `D = matmul(A_sparse * SF_A, B * SF_B) + C` using all threads in a warp.\n\n A is a sparse matrix, and B, C and D are dense matrices.\n SF_A and SF_B are scaling factors.\n Dimensions of SF_A and SF_B are based on scale vector sizes (x1, x2, x4),\n and the data type must be either ue8m0 or ue4m3.\n\n This operation is similar to `nvvm.mma.block_scale` but with structured sparsity\n in the A operand. The sparsity follows the 2:4 structured sparse pattern\n where 2 out of every 4 elements are non-zero.\n\n All the threads in the warp must execute the same `mma.sp.block_scale` operation.\n\n The `sparseMetadata` operand provides the sparsity indices that indicate\n which elements in the A operand are non-zero. The `sparsitySelector`\n controls how the indices are distributed among threads in the warp and\n should typically be 0 or 1.\n\n This operation follows the same design pattern as `nvvm.mma.sp.sync`, with additional\n scaling operands for both A and B matrices. Note that sparse block scale operations\n always use ordered metadata (sm_90+).\n\n Example:\n ```mlir\n %d = nvvm.mma.sp.block_scale A[%a0, %a1] B[%b0, %b1] C[%c0, %c1]\n sparseMetadata[%meta] selector[%sel]\n scaleA[%scaleAData, %byteIdA, %threadIdA]\n scaleB[%scaleBData, %byteIdB, %threadIdB]\n {shape = #nvvm.shape,\n multiplicandAPtxType = #nvvm.mma_type,\n multiplicandBPtxType = #nvvm.mma_type,\n scaleVecSize = #nvvm.scale_vec_size,\n blockScaleFormat = #nvvm.block_scale_format,\n kind = #nvvm.block_scale_kind}\n : (vector<2xf16>, vector<2xf16>, vector<2xf32>) -> !llvm.struct<(f32, f32)>\n ```", "operands": [ { "name": "operandA", "type": "Variadic" }, { "name": "operandB", "type": "Variadic" }, { "name": "operandC", "type": "Variadic" }, { "name": "sparseMetadata", "type": "I32" }, { "name": "sparsitySelector", "type": "I32" }, { "name": "scaleAData", "type": "I32" }, { "name": "byteIdA", "type": "I16" }, { "name": "threadIdA", "type": "I16" }, { "name": "scaleBData", "type": "I32" }, { "name": "byteIdB", "type": "I16" }, { "name": "threadIdB", "type": "I16" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "shape", "type": "NVVM_MMAShapeAttr" }, { "name": "multiplicandAPtxType", "type": "OptionalAttr" }, { "name": "multiplicandBPtxType", "type": "OptionalAttr" }, { "name": "scaleVecSize", "type": "ScaleVecSizeAttr{x1|x2|x4}" }, { "name": "blockScaleFormat", "type": "BlockScaleFormatAttr{ue8m0|ue4m3}" }, { "name": "kind", "type": "MMABlockScaleKindAttr{mxf8f6f4|mxf4|mxf4nvf4}" }, { "name": "orderedMetadata", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "nvvm.mma.sp.sync", "summary": "cooperative sparse matrix-multiply and accumulate", "description": "The `nvvm.mma.sp.sync` operation collectively performs the sparse operation\n `D = matmul(A_sparse, B) + C` using all threads in a warp.\n\n This operation is similar to `nvvm.mma.sync` but with structured sparsity\n in the A operand. The sparsity follows the 2:4 structured sparse pattern\n where 2 out of every 4 elements are non-zero.\n\n All the threads in the warp must execute the same `mma.sp.sync` operation.\n\n The `sparseMetadata` operand provides the sparsity indices that indicate\n which elements in the A operand are non-zero. The `sparsitySelector`\n controls how the indices are distributed among threads in the warp and\n should typically be 0 or 1.\n\n The optional `orderedMetadata` attribute specifies the metadata ordering:\n - Absence (default): Uses standard sparse metadata ordering\n - Presence: Uses ordered metadata (PTX ISA 8.5+, sm_90+)\n\n The optional `kind` attribute specifies mixed-precision modes for FP8 operations:\n - `f8f6f4`: Enables e3m2, e2m3, e2m1 FP8 types and f16 accumulator (PTX ISA 8.7+, sm_90+)\n - Only valid with ordered metadata and m16n8k64 shape\n\n The shapes, layouts, and data types follow the same constraints as the\n regular `nvvm.mma.sync` operation, but the A operand contains only the\n non-zero elements in compressed format.\n\n Example:\n ```mlir\n %d = nvvm.mma.sp.sync A[%a0, %a1] B[%b0, %b1] C[%c0, %c1]\n sparseMetadata[%meta] selector[%sel]\n {shape = {k = 32 : i32, m = 16 : i32, n = 8 : i32}}\n : (vector<2xf16>, vector<2xf16>, vector<2xf16>) -> !llvm.struct<(vector<2xf16>, vector<2xf16>)>\n\n // With ordered metadata:\n %d = nvvm.mma.sp.sync A[%a0, %a1] B[%b0, %b1] C[%c0, %c1]\n sparseMetadata[%meta] selector[%sel]\n {orderedMetadata, shape = {k = 32 : i32, m = 16 : i32, n = 8 : i32}}\n : (vector<2xf16>, vector<2xf16>, vector<2xf16>) -> !llvm.struct<(vector<2xf16>, vector<2xf16>)>\n ```", "operands": [ { "name": "operandA", "type": "Variadic" }, { "name": "operandB", "type": "Variadic" }, { "name": "operandC", "type": "Variadic" }, { "name": "sparseMetadata", "type": "I32" }, { "name": "sparsitySelector", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "shape", "type": "NVVM_MMAShapeAttr" }, { "name": "intOverflowBehavior", "type": "OptionalAttr" }, { "name": "multiplicandAPtxType", "type": "OptionalAttr" }, { "name": "multiplicandBPtxType", "type": "OptionalAttr" }, { "name": "orderedMetadata", "type": "UnitAttr" }, { "name": "kind", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "nvvm.mma.sync", "summary": "cooperative matrix-multiply and accumulate", "description": "The `nvvm.mma.sync` operation collectively performs the operation\n `D = matmul(A, B) + C` using all threads in a warp.\n\n All the threads in the warp must execute the same `mma.sync` operation.\n\n For each possible multiplicand PTX data type, there are one or more possible\n instruction shapes given as \"mMnNkK\". The below table describes the posssibilities\n as well as the types required for the operands. Note that the data type for\n C (the accumulator) and D (the result) can vary independently when there are\n multiple possibilities in the \"C/D Type\" column.\n\n When an optional attribute cannot be immediately inferred from the types of\n the operands and the result during parsing or validation, an error will be\n raised.\n\n `b1Op` is only relevant when the binary (b1) type is given to\n `multiplicandDataType`. It specifies how the multiply-and-acumulate is\n performed and is either `xor_popc` or `and_poc`. The default is `xor_popc`.\n\n `intOverflowBehavior` is only relevant when the `multiplicandType` attribute\n is one of `u8, s8, u4, s4`, this attribute describes how overflow is handled\n in the accumulator. When the attribute is `satfinite`, the accumulator values\n are clamped in the int32 range on overflow. Alternatively, accumulator\n behavior `wrapped` can be specified (this is the default), in which case\n overflow wraps from one end of the range to the other.\n\n `layoutA` and `layoutB` are required and should generally be set to\n `#nvvm.mma_layout` and `#nvvm.mma_layout` respectively, but other\n combinations are possible for certain layouts according to the table below.\n\n ```\n | A/B Type | Shape | ALayout | BLayout | A Type | B Type | C/D Type |\n |----------|-----------|---------|---------|----------|----------|-------------------|\n | f64 | .m8n8k4 | row | col | 1x f64 | 1x f64 | 2x f64 |\n | f16 | .m8n8k4 | row/col | row/col | 2x f16x2 | 2x f16x2 | 4x f16x2 or 8xf32 |\n | | .m16n8k8 | row | col | 2x f16x2 | 1x f16x2 | 2x f16x2 or 4 f32 |\n | | .m16n8k16 | row | col | 4x f16x2 | 2x f16x2 | 2x f16x2 or 4 f32 |\n | bf16 | .m16n8k8 | row | col | 2x i32 | 1x i32 | 4x f32 |\n | | .m16n8k16 | row | col | 4x i32 | 2x i32 | 4x f32 |\n | tf32 | .m16n8k4 | row | col | 2x i32 | 1x i32 | 4x f32 |\n | | .m16n8k8 | row | col | 4x i32 | 2x i32 | 2x f16x2 or 4 f32 |\n | u8/s8 | .m8n8k16 | row | col | 1x i32 | 1x i32 | 2x i32 |\n | | .m16n8k16 | row | col | 2x i32 | 1x i32 | 4x i32 |\n | | .m16n8k32 | row | col | 4x i32 | 2x i32 | 4x i32 |\n | u4/s4 | .m8n8k32 | row | col | 1x i32 | 1x i32 | 2x i32 |\n | | m16n8k32 | row | col | 2x i32 | 1x i32 | 4x i32 |\n | | m16n8k64 | row | col | 4x i32 | 2x i32 | 4x i32 |\n | b1 | m8n8k128 | row | col | 1x i32 | 1x i32 | 2x i32 |\n | | m16n8k128 | row | col | 2x i32 | 1x i32 | 4x i32 |\n ```\n\n\n Example:\n ```mlir\n\n %128 = nvvm.mma.sync A[%120, %121, %122, %123]\n B[%124, %125]\n C[%126, %127]\n {layoutA = #nvvm.mma_layout,\n layoutB = #nvvm.mma_layout,\n shape = {k = 16 : i32, m = 16 : i32, n = 8 : i32}}\n : (vector<2xf16>, vector<2xf16>, vector<2xf16>)\n -> !llvm.struct<(vector<2xf16>, vector<2xf16>)>\n ```", "operands": [ { "name": "operandA", "type": "Variadic" }, { "name": "operandB", "type": "Variadic" }, { "name": "operandC", "type": "Variadic" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "shape", "type": "NVVM_MMAShapeAttr" }, { "name": "b1Op", "type": "OptionalAttr" }, { "name": "intOverflowBehavior", "type": "OptionalAttr" }, { "name": "layoutA", "type": "MMALayoutAttr{row|col}" }, { "name": "layoutB", "type": "MMALayoutAttr{row|col}" }, { "name": "multiplicandAPtxType", "type": "OptionalAttr" }, { "name": "multiplicandBPtxType", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "nvvm.movmatrix", "summary": "Warp-level matrix transpose", "description": "Moves a row-major matrix across all threads in a warp, reading elements\n from source `$src`, and writing the transposed elements to destination\n `$dst`.\n\n The `shape` attribute indicates the dimensions of the matrix being\n transposed. Each matrix element holds 16-bit data as indicated by the\n `eltType` attribute.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#warp-level-matrix-movmatrix-instruction)\n\n Example:\n ```mlir\n %dst = nvvm.movmatrix %src {shape = #nvvm.ld_st_matrix_shape,\n eltType = #nvvm.ld_st_matrix_elt_type} : i32\n ```", "operands": [ { "name": "src", "type": "I32" } ], "results": [ { "name": "dst", "type": "I32" } ], "attributes": [ { "name": "shape", "type": "LdStMatrixShapeAttr" }, { "name": "layout", "type": "DefaultValuedAttr" }, { "name": "eltType", "type": "LdStMatrixEltTypeAttr{b16|b8|b8x16.b6x16_p32|b8x16.b4x16_p64}" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.nanosleep", "summary": "Suspends the thread for a specified duration.", "description": "The op suspends the thread for a sleep duration approximately close to the \n delay `$duration`, specified in nanoseconds. \n\n The sleep duration is approximated, but guaranteed to be in the \n interval [0, 2*t]. The maximum sleep duration is 1 millisecond. \n The implementation may reduce the sleep duration for individual threads \n within a warp such that all sleeping threads in the warp wake up together.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#miscellaneous-instructions-nanosleep)", "operands": [ { "name": "duration", "type": "I32" } ], "assemblyFormat": "attr-dict $duration" }, { "name": "nvvm.pmevent", "summary": "Trigger one or more Performance Monitor events.", "description": "Triggers one or more of a fixed number of performance monitor events, with\n event index or mask specified by immediate operand.\n\n Without `mask` it triggers a single performance monitor event indexed by\n immediate operand a, in the range 0..15.\n\n With `mask` it triggers one or more of the performance monitor events. Each\n bit in the 16-bit immediate operand controls an event.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#miscellaneous-instructions-pmevent)", "attributes": [ { "name": "maskedEventId", "type": "OptionalAttr" }, { "name": "eventId", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict (`id` `=` $eventId^)? (`mask` `=` $maskedEventId^)?" }, { "name": "nvvm.prefetch", "summary": "Brings the cache line containing an address into the specified cache level", "description": "Prefetches the cache line containing the address given by `addr`. The \n operand may be a global, local, or generic pointer. When `tensormap` is \n specified, the operand may instead be a constant or generic pointer. If the \n address maps to shared memory, the operation has no effect.\n\n At most one of `cacheLevel` or `tensormap` may be present. The `cacheLevel` \n attribute selects the target cache level. When combined with `uniform`, the \n prefetch is performed to the uniform cache, in which case `addr` must be a \n generic pointer.\n\n When `tensormap` is used, the line containing `addr` is brought from the \n constant or parameter state space for later use by `cp.async.bulk.tensor`. \n If `in_param_space` is specified, the generic pointer is interpreted as \n referring to the parameter state space.\n\n `uniform` can be specified after the `cacheLevel` to indicate that the \n prefetch is performed to the specified uniform cache level. If `uniform` is \n specified, `addr` must be a generic address pointer and no operation is \n performed if `addr` maps to a `const`, `local`, or `shared` memory location.\n\n The `evictPriority` attribute is optional and specifies the cache eviction\n priority when `cacheLevel` is L2.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-prefetch-prefetchu)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGlobal, LLVM_PointerLocal, LLVM_PointerGeneric, LLVM_PointerConst]>" }, { "name": "predicate", "type": "Optional" } ], "attributes": [ { "name": "cacheLevel", "type": "OptionalAttr" }, { "name": "evictPriority", "type": "OptionalAttr" }, { "name": "tensormap", "type": "UnitAttr" }, { "name": "uniform", "type": "UnitAttr" }, { "name": "in_param_space", "type": "UnitAttr" } ], "assemblyFormat": "(`level` `=` $cacheLevel^ (`uniform` $uniform^)? `,`)? (`tensormap` $tensormap^ (`in_param_space` $in_param_space^)? `,`)? (`evict_priority` `=` $evictPriority^ `,`)? $addr (`,` `predicate` `=` $predicate^)? attr-dict `:` type(operands)" }, { "name": "nvvm.prmt", "summary": "Permute bytes from two 32-bit registers", "description": "The `nvvm.prmt` operation constructs a permutation of the\n bytes of the first one or two operands, selecting based on \n the 2 least significant bits of the final operand.\n \n The bytes in the first one or two source operands are numbered. \n The first source operand (%lo) is numbered {b3, b2, b1, b0}, \n in the case of the '``default``', '``f4e``' and '``b4e``' variants, \n the second source operand (%hi) is numbered {b7, b6, b5, b4}.\n\n Modes:\n - `default`: Index mode - each nibble in `selector` selects a byte from the 8-byte pool\n - `f4e` : Forward 4 extract - extracts 4 contiguous bytes starting from position in `selector`\n - `b4e` : Backward 4 extract - extracts 4 contiguous bytes in reverse order\n - `rc8` : Replicate 8 - replicates the lower 8 bits across the 32-bit result\n - `ecl` : Edge clamp left - clamps out-of-range indices to the leftmost valid byte\n - `ecr` : Edge clamp right - clamps out-of-range indices to the rightmost valid byte \n - `rc16` : Replicate 16 - replicates the lower 16 bits across the 32-bit result\n\n Depending on the 2 least significant bits of the %selector operand, the result\n of the permutation is defined as follows:\n\n +------------+----------------+--------------+\n | Mode | %selector[1:0] | Output |\n +------------+----------------+--------------+\n | '``f4e``' | 0 | {3, 2, 1, 0} |\n | +----------------+--------------+\n | | 1 | {4, 3, 2, 1} |\n | +----------------+--------------+\n | | 2 | {5, 4, 3, 2} |\n | +----------------+--------------+\n | | 3 | {6, 5, 4, 3} |\n +------------+----------------+--------------+\n | '``b4e``' | 0 | {5, 6, 7, 0} |\n | +----------------+--------------+\n | | 1 | {6, 7, 0, 1} |\n | +----------------+--------------+\n | | 2 | {7, 0, 1, 2} |\n | +----------------+--------------+\n | | 3 | {0, 1, 2, 3} |\n +------------+----------------+--------------+\n | '``rc8``' | 0 | {0, 0, 0, 0} |\n | +----------------+--------------+\n | | 1 | {1, 1, 1, 1} |\n | +----------------+--------------+\n | | 2 | {2, 2, 2, 2} |\n | +----------------+--------------+\n | | 3 | {3, 3, 3, 3} |\n +------------+----------------+--------------+\n | '``ecl``' | 0 | {3, 2, 1, 0} |\n | +----------------+--------------+\n | | 1 | {3, 2, 1, 1} |\n | +----------------+--------------+\n | | 2 | {3, 2, 2, 2} |\n | +----------------+--------------+\n | | 3 | {3, 3, 3, 3} |\n +------------+----------------+--------------+\n | '``ecr``' | 0 | {0, 0, 0, 0} |\n | +----------------+--------------+\n | | 1 | {1, 1, 1, 0} |\n | +----------------+--------------+\n | | 2 | {2, 2, 1, 0} |\n | +----------------+--------------+\n | | 3 | {3, 2, 1, 0} |\n +------------+----------------+--------------+\n | '``rc16``' | 0 | {1, 0, 1, 0} |\n | +----------------+--------------+\n | | 1 | {3, 2, 3, 2} |\n | +----------------+--------------+\n | | 2 | {1, 0, 1, 0} |\n | +----------------+--------------+\n | | 3 | {3, 2, 3, 2} |\n +------------+----------------+--------------+\n \n [For more information, see PTX ISA]\n (https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-prmt)", "operands": [ { "name": "lo", "type": "I32" }, { "name": "hi", "type": "Optional" }, { "name": "selector", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "mode", "type": "PermuteModeAttr{default|f4e|b4e|rc8|ecl|ecr|rc16}" } ], "assemblyFormat": "$mode $selector `,` $lo (`,` $hi^)? attr-dict `:` type($res)" }, { "name": "nvvm.rcp.approx.ftz.f", "operands": [ { "name": "arg", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "assemblyFormat": "$arg attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.aggr.smem.size", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.clock", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.clock64", "results": [ { "name": "res", "type": "I64" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.ctaid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.ctaid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.ctaid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.ctarank", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.nctaid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.nctaid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.nctaid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.cluster.nctarank", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.clusterid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.clusterid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.clusterid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.ctaid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.ctaid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.ctaid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.dynamic.smem.size", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg0", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg1", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg10", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg11", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg12", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg13", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg14", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg15", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg16", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg17", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg18", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg19", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg2", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg20", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg21", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg22", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg23", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg24", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg25", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg26", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg27", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg28", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg29", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg3", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg30", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg31", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg4", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg5", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg6", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg7", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg8", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.envreg9", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.globaltimer", "results": [ { "name": "res", "type": "I64" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.globaltimer.lo", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.gridid", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.laneid", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.lanemask.eq", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.lanemask.ge", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.lanemask.gt", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.lanemask.le", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.lanemask.lt", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nclusterid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nclusterid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nclusterid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nctaid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nctaid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nctaid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nsmid", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.ntid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.ntid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.ntid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.nwarpid", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.smid", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.tid.x", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.tid.y", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.tid.z", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.total.smem.size", "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.warpid", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.read.ptx.sreg.warpsize", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "nvvm.redux.sync", "summary": "Redux Sync Op", "description": "`redux.sync` performs a reduction operation `kind` of the 32 bit source \n register across all non-exited threads in the membermask.\n\n The `abs` and `nan` attributes can be used in the case of f32 input type, \n where the `abs` attribute causes the absolute value of the input to be used \n in the reduction operation, and the `nan` attribute causes the reduction \n operation to return NaN if any of the inputs to participating threads are \n NaN.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-redux-sync)", "operands": [ { "name": "val", "type": "AnyTypeOf<[I32, F32]>" }, { "name": "mask_and_clamp", "type": "I32" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[I32, F32]>" } ], "attributes": [ { "name": "kind", "type": "ReductionKindAttr{add|and|max|min|or|umax|umin|xor|fmin|fmax}" }, { "name": "abs", "type": "DefaultValuedAttr" }, { "name": "nan", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'val']>" } ], "assemblyFormat": "$kind $val `,` $mask_and_clamp attr-dict `:` type($val) `->` type($res)" }, { "name": "nvvm.rsqrt", "summary": "Reciprocal square root (fast approximation)", "description": "Computes an approximation of the reciprocal of the square root of the\n input value: `d = 1 / sqrt(a)`. Supports both f32 and f64. The maximum\n relative error for the f32 form over the entire positive finite range\n is 2^-22.9.\n\n The `ftz` attribute, when set, flushes subnormal inputs and results to\n sign-preserving zero. For f64 inputs, `ftz=true` selects a coarser\n approximation that uses only the upper 32 bits of the input (the lower\n 32 bits of the result are zeroed).\n\n For more information, see PTX ISA:\n [rsqrt](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-rsqrt)", "operands": [ { "name": "src", "type": "AnyTypeOf<[F32, F64]>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[F32, F64]>" } ], "attributes": [ { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.setmaxregister", "attributes": [ { "name": "regCount", "type": "I32Attr" }, { "name": "action", "type": "SetMaxRegisterActionAttr{decrease|increase}" } ], "assemblyFormat": "$action $regCount attr-dict" }, { "name": "nvvm.shfl.sync", "summary": "NVVM Dialect Op for shfl.sync", "description": "The `shfl.sync` Op implements data shuffle within threads of a warp.\n The `thread_mask` denotes the threads participating in the Op where\n the bit position corresponds to a particular thread's laneid.\n The `offset` specifies a source lane or source lane offset\n (depending on `kind`). The `val` is the input value to be copied from\n the source. The `mask_and_clamp` contains two packed values specifying\n a mask for logically splitting warps into sub-segments and an upper bound\n for clamping the source lane index.\n \n The `return_value_and_is_valid` unit attribute can be specified to indicate \n that the return value is a two-element struct, where the first element is \n the result value and the second element is a predicate indicating if the \n computed source lane index is valid.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-shfl-sync)", "operands": [ { "name": "thread_mask", "type": "I32" }, { "name": "val", "type": "AnyTypeOf<[I32, F32]>" }, { "name": "offset", "type": "I32" }, { "name": "mask_and_clamp", "type": "I32" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[I32, F32, LLVMStructType]>" } ], "attributes": [ { "name": "kind", "type": "ShflKindAttr{bfly|up|down|idx}" }, { "name": "return_value_and_is_valid", "type": "OptionalAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$kind $thread_mask `,` $val `,` $offset `,` $mask_and_clamp attr-dict\n `:` type($val) `->` type($res)" }, { "name": "nvvm.sin", "summary": "Sine (fast approximation)", "description": "Computes a fast approximation of the sine of the input value (in radians).\n The `ftz` attribute, when set, flushes subnormal inputs and results to\n sign-preserving zero.\n\n For more information, see PTX ISA:\n [sin](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sin)", "operands": [ { "name": "src", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.sqrt", "summary": "Take the square root of a value", "description": "Compute sqrt(src) and store the result in res.\n\n For more information, see PTX ISA:\n [sqrt](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sqrt)", "operands": [ { "name": "src", "type": "AnyTypeOf<[F32, F64]>" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[F32, F64]>" } ], "attributes": [ { "name": "rnd", "type": "ConfinedAttr]>" }, { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.sqrt.approx", "summary": "Square root (fast approximation)", "description": "Computes a fast approximation of the square root of the input value\n (`res = sqrt(src)`). The maximum relative error over the entire positive\n finite range is 2^-23.\n\n The `ftz` attribute, when set, flushes subnormal inputs and results to\n sign-preserving zero.\n\n For more information, see PTX ISA:\n [sqrt](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sqrt)", "operands": [ { "name": "src", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "nvvm.st.bulk", "summary": "Bulk Store Op", "description": "Initializes a region of shared memory at the address given by `addr`.\n The `size` operand specifies the number of bytes to initialize and must be \n a multiple of 8.\n The `initVal` operand specifies the value to initialize the memory to. The \n only supported value is 0.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-st-bulk)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGeneric, LLVM_PointerShared]>" }, { "name": "size", "type": "I64" } ], "attributes": [ { "name": "initVal", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` `size` `=` $size (`,` `init` `=` $initVal^)? attr-dict `:` type($addr)" }, { "name": "nvvm.stmatrix", "summary": "cooperative matrix store", "description": "Collectively store one or more matrices across all threads in a warp to the\n location indicated by the address operand $ptr in shared memory.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-store-instruction-stmatrix)", "operands": [ { "name": "ptr", "type": "LLVM_PointerShared" }, { "name": "sources", "type": "Variadic" } ], "attributes": [ { "name": "layout", "type": "MMALayoutAttr{row|col}" }, { "name": "shape", "type": "LdStMatrixShapeAttr" }, { "name": "eltType", "type": "LdStMatrixEltTypeAttr{b16|b8|b8x16.b6x16_p32|b8x16.b4x16_p64}" } ], "assemblyFormat": "$ptr `,` $sources attr-dict `:` type(operands)" }, { "name": "nvvm.subf", "summary": "Performs floating point subtraction of the given arguments `lhs` and `rhs`", "description": "The `nvvm.subf` operation performs floating point subtraction of two \n operands.\n\n It supports the same type combinations and modifiers as `nvvm.addf`.\n This is equivalent to `nvvm.addf(lhs, -rhs)`.\n \n For more information, see PTX ISA:\n - [floating point subtraction](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sub) \n - [half-precision floating point subtraction](https://docs.nvidia.com/cuda/parallel-thread-execution/#half-precision-floating-point-instructions-sub)", "operands": [ { "name": "lhs", "type": "SIMTFloatType" }, { "name": "rhs", "type": "SIMTFloatType" } ], "results": [ { "name": "res", "type": "SIMTFloatType" } ], "attributes": [ { "name": "rnd", "type": "DefaultValuedAttr]>, FPRoundingMode::NONE>" }, { "name": "sat", "type": "DefaultValuedAttr]>, SaturationMode::NONE>" }, { "name": "ftz", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($res)" }, { "name": "nvvm.tcgen05.alloc", "summary": "Tcgen05 alloc operation", "description": "The `tcgen05.alloc` Op allocates tensor core memory for\n the amount specified by `nCols` and writes the destination\n address to the `addr` argument. The `nCols` operand specifies the\n number of columns to be allocated and it must be a power-of-two.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-memory-alloc-manage-instructions)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_AnyPointer, LLVM_PointerShared]>" }, { "name": "nCols", "type": "I32" } ], "attributes": [ { "name": "group", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr `,` $nCols attr-dict `:` type(operands)" }, { "name": "nvvm.tcgen05.commit", "summary": "Tcgen05 commit operations", "description": "The `tcgen05.commit` makes the *mbarrier object*, specified by\n the operand `addr`, track the completion of all the prior\n async-tcgen05 operations initiated by the executing thread.\n The multicast variants allow signaling on the *mbarrier objects*\n of multiple CTAs within the cluster. Operand `multicastMask`,\n when present, specifies the destination CTAs in the cluster such\n that each bit position in the 16-bit `multicastMask` operand\n corresponds to the `nvvm.read.ptx.sreg.ctaid` of the destination CTA.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen-async-sync-operations-commit)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_AnyPointer, LLVM_PointerShared]>" }, { "name": "multicastMask", "type": "Optional" } ], "attributes": [ { "name": "group", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$addr (`,` `multicast_mask` `=` $multicastMask^)?\n attr-dict `:` type(operands)" }, { "name": "nvvm.tcgen05.cp", "summary": "Tcgen05 copy operation", "description": "Instruction tcgen05.cp initiates an asynchronous copy operation from\n shared memory to the location specified by the address operand `taddr`\n in the Tensor Memory. The 64-bit register operand `smem_desc` specifies\n the matrix descriptor representing the source matrix in the shared memory\n that needs to be copied.\n\n Example:\n ```mlir\n nvvm.tcgen05.cp %taddr, %smem_desc {\n group = #nvvm.tcgen05_group,\n shape = #nvvm.tcgen05_cp_shape,\n multicast = #nvvm.tcgen05_cp_multicast,\n srcFormat = #nvvm.tcgen05_cp_src_fmt\n }\n ```\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tensorcore-5th-generation-instructions-tcgen05-cp)", "operands": [ { "name": "taddr", "type": "LLVM_PointerTensor" }, { "name": "smem_desc", "type": "I64" } ], "attributes": [ { "name": "shape", "type": "Tcgen05CpShapeAttr{shape_128x256b|shape_4x256b|shape_128x128b|shape_64x128b|shape_32x128b}" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "multicast", "type": "DefaultValuedAttr" }, { "name": "srcFormat", "type": "OptionalAttr" } ], "assemblyFormat": "$taddr`,` $smem_desc attr-dict" }, { "name": "nvvm.tcgen05.dealloc", "summary": "Tcgen05 dealloc operation", "description": "The `tcgen05.dealloc` Op de-allocates the tensor core memory\n specified by `tmemAddr`, which must be from a previous tensor\n memory allocation. The `nCols` operand specifies the number\n of columns to be de-allocated, and it must be a power-of-two.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-memory-alloc-manage-instructions)", "operands": [ { "name": "taddr", "type": "LLVM_PointerTensor" }, { "name": "nCols", "type": "I32" } ], "attributes": [ { "name": "group", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$taddr `,` $nCols attr-dict `:` type(operands)" }, { "name": "nvvm.tcgen05.fence", "summary": "Tcgen05 fence operations", "description": "The `tcgen05.fence` orders all prior async tcgen05 operations\n with respect to the subsequent tcgen05 and execution ordering operations.\n The `tcgen05.fence` orders all subsequent async tcgen05 operations\n with respect to the prior tcgen05 and execution ordering operations.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tensorcore-5th-generation-instructions-tcgen05-fence)", "attributes": [ { "name": "kind", "type": "Tcgen05FenceKindAttr{before|after}" } ], "assemblyFormat": "$kind attr-dict" }, { "name": "nvvm.tcgen05.ld", "summary": "tensor memory load instructions", "description": "Instruction `tcgen05.ld` asynchronously loads data from the Tensor Memory at\n the location specified by the 32-bit address operand `tmemAddr` into the\n destination register `res`, collectively across all threads of the warps.\n\n The `shape` and the `num` attribute together determines the total\n dimension of the data which is loaded from the Tensor Memory. The `shape`\n attribute indicates the base dimension of data to be accessed as described\n in the Data Movement Shape. The `num` attribute indicates the repeat\n factor on the base dimension resulting in the total dimension of the data\n that is accessed.\n\n The shape `16x32bx2` performs two accesses into Tensor Memory of the shape\n `16x32b`. The base address of the first access is specified by `tmemAddr`\n and the base address of the second access is specified by\n `tmemAddr + offset`, where `offset` is an immediate argument.\n\n The unit attribute `pack` can be used to pack two 16-bit\n elements from adjacent columns into a single 32-bit element during the load.\n\n The following table describes the size of the vector for various combinations\n of `num` and `shape` attributes:\n ```\n |=====================================================================|\n | num/shape | 16x32bx2/16x64b/32x32b | 16x128b | 16x256b |\n |=====================================================================|\n | x1 | 1 | 2 | 4 |\n | x2 | 2 | 4 | 8 |\n | x4 | 4 | 8 | 16 |\n | x8 | 8 | 16 | 32 |\n | x16 | 16 | 32 | 64 |\n | x32 | 32 | 64 | 128 |\n | x64 | 64 | 128 | NA |\n | x128 | 128 | NA | NA |\n |=====================================================================|\n ```\n\n Example:\n ```mlir\n nvvm.tcgen05.ld %tmemAddr, %offset pack {\n shape = #nvvm.tcgen05_ldst_shape,\n } : <2xi32>\n ```\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instructions-tcgen05-st)", "operands": [ { "name": "tmemAddr", "type": "LLVM_PointerTensor" }, { "name": "offset", "type": "Optional" } ], "results": [ { "name": "res", "type": "VectorOfLengthAndType<[1, 2, 4, 8, 16, 32, 64, 128], [I32]>" } ], "attributes": [ { "name": "pack", "type": "UnitAttr" }, { "name": "shape", "type": "Tcgen05LdStShapeAttr{shape_16x64b|shape_16x128b|shape_16x256b|shape_32x32b|shape_16x32bx2}" } ], "assemblyFormat": "$tmemAddr (`,` $offset^)? (`pack` $pack^)? attr-dict `:` type($res)" }, { "name": "nvvm.tcgen05.ld.red", "summary": "Tcgen05 tensor memory load and reduce instructions", "description": "Instruction `tcgen05.ld.red` asynchronously loads data from the Tensor\n Memory at the location specified by the 32-bit address operand `addr` into\n the destination register `data`, collectively across all threads of the\n warp. The operation also performs reduction operation specified by `op` on\n the loaded data across columns in each lane and stored into `redVal`\n\n The `shape` and the `num` attribute together determines the total\n dimension of the data which is loaded from the Tensor Memory. The `shape`\n attribute indicates the base dimension of data to be accessed as described\n in the Data Movement Shape. The `num` attribute indicates the repeat\n factor on the base dimension resulting in the total dimension of the data\n that is accessed.\n\n The shape `16x32bx2` performs two accesses into Tensor Memory of the shape\n `16x32b`. The base address of the first access is specified by `addr`\n and the base address of the second access is specified by\n `addr + offset`, where `offset` is an immediate argument.\n\n The following table describes the size of the vector for various combinations\n of `num` and `shape` attributes:\n ```\n |=============================================|\n | num/shape | 16x32bx2/32x32b |\n |=============================================|\n | x2 | 2 |\n | x4 | 4 |\n | x8 | 8 |\n | x16 | 16 |\n | x32 | 32 |\n | x64 | 64 |\n | x128 | 128 |\n |=============================================|\n ```\n\n Example:\n ```mlir\n %data, %redval = nvvm.tcgen05.ld.red %addr, %offset {\n shape = #nvvm.tcgen05_ldst_shape,\n } : <2xi32>, i32\n\n %data, %redval = nvvm.tcgen05.ld.red %addr {\n shape = #nvvm.tcgen05_ldst_shape,\n } : <2xf32>, f32\n ```\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instructions-tcgen05-ld)", "operands": [ { "name": "addr", "type": "LLVM_PointerTensor" }, { "name": "offset", "type": "Optional" } ], "results": [ { "name": "data", "type": "VectorOfLengthAndType<[2, 4, 8, 16, 32, 64, 128], [I32, F32]>" }, { "name": "redVal", "type": "AnyTypeOf<[I32, F32]>" } ], "attributes": [ { "name": "shape", "type": "Tcgen05LdStShapeAttr{shape_16x64b|shape_16x128b|shape_16x256b|shape_32x32b|shape_16x32bx2}" }, { "name": "op", "type": "ReductionKindAttr{add|and|max|min|or|umax|umin|xor|fmin|fmax}" }, { "name": "abs", "type": "UnitAttr" }, { "name": "nan", "type": "UnitAttr" } ], "assemblyFormat": "$op $addr (`,` $offset^)? attr-dict `:` type($data) `,` type($redVal)" }, { "name": "nvvm.tcgen05.mma", "summary": "Performs MMA operation on 5th-gen tensor cores", "description": "The `tcgen05.mma` operation is an asynchronous tensor core instruction that\n performs matrix multiplication, accumulation in a single fused operation. It\n targets 5th-generation tensor cores, providing developers with fine-grained\n control over execution and scheduling.\n\n ```\n D = A * B + (D * 2^ -scaleInputD) // if `scaleInputD` is provided\n D = A * B // if `enableInputD` is false\n D = A * B + D // otherwise\n ```\n\n where:\n - A is an `M x K` matrix in tensor memory or described using shared memory descriptor\n - B is a `K x N` matrix described using shared memory descriptor\n - D is an `M x N` accumulator matrix in tensor memory\n\n The `shared memory descriptor` can be generated using `tcgen05.mma_smem_desc` Op\n\n - idesc is a 32-bit value representing the [Instruction Descriptor](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instruction-descriptor)\n\n Optional Operands:\n - `scaleInputD` is an Immediate value operand used for scaling D matrix by 2 ^ (-scaleInputD). The valid range is [0, 15]\n\n - `disableOutputLane` is a vector mask for selective output\n * vector<4 x i32> when ctaGroup is CTA_1\n * vector<8 x i32> when ctaGroup is CTA_2\n\n Required Attributes:\n - `kind` is a Tcgen05MMAKind attribute\n\n - `ctaGroup` specifies CTA group configuration\n * cta_1: MMA will be performed on the current thread's CTA\n * cta_2: MMA will be performed on the current thread and it's peer CTA\n\n Default Attributes:\n - collectorOp is a Tcgen05MMACollectorOp attribute with matrix A as the collector buffer\n\n - `aShift` shifts the rows of the A matrix down by one row and can only be\n applied if A is in tensor memory\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-mma-instructions-mma)", "operands": [ { "name": "matrixD", "type": "LLVM_PointerTensor" }, { "name": "matrixA", "type": "AnyTypeOf<[LLVM_PointerTensor, I64]>" }, { "name": "matrixB", "type": "I64" }, { "name": "idesc", "type": "I32" }, { "name": "enableInputD", "type": "I1" }, { "name": "scaleInputD", "type": "Optional" }, { "name": "disableOutputLane", "type": "Optional>" } ], "attributes": [ { "name": "kind", "type": "Tcgen05MMANonBlockScaleKindAttr" }, { "name": "ctaGroup", "type": "CTAGroupKindAttr{cta_1|cta_2}" }, { "name": "collectorOp", "type": "DefaultValuedAttr" }, { "name": "aShift", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$matrixD `,` $matrixA `,` $matrixB `,` $idesc `,` $enableInputD (`scale` `=` $scaleInputD^)?\n (`mask` `=` $disableOutputLane^)? attr-dict `:` `(` type(operands) `)`" }, { "name": "nvvm.tcgen05.mma_smem_desc", "summary": "Constructs a Shared Memory descriptor for MMA Operands A or B", "description": "The `nvvm.tcgen05_mma_smem_desc` constructs a Shared Memory descriptor\n for tcgen05.mma. This descriptor is a 64-bit value which describes the\n properties of multiplicand matrix in shared memory including its location\n in the shared memory of the current CTA.\n\n ```\n +-----------+------+------------------------------------------------------+\n | Bit-field | Size | Description |\n +-----------+------+------------------------------------------------------+\n | 0-13 | 14 | Matrix start address |\n | 14-15 | 2 | Reserved |\n | 16-29 | 14 | Leading dim relative-offset (or) absolute-address |\n | 30-31 | 2 | Reserved |\n | 32-45 | 14 | Stride dimension byte offset |\n | 46-48 | 3 | Fixed constant value of 0b001 |\n | 49-51 | 3 | Matrix base offset |\n | 52 | 1 | Leading dimension stride mode: |\n | | | 0: byte offset relative |\n | | | 1: byte address absolute |\n | 53-60 | 8 | Fixed constant value of 0xb00000000 |\n | 61-63 | 3 | Swizzling mode: |\n | | | 0: No swizzling |\n | | | 1: 128-Byte with 32B atomic swizzling |\n | | | 2: 128-Byte swizzling |\n | | | 4: 64-Byte swizzling |\n | | | 6: 32-Byte swizzling |\n | | | (Values 3, 5 and 7 are invalid) |\n +-----------+------+------------------------------------------------------+ \n ```\n\n Example:\n ```mlir\n %desc = nvvm.tcgen05.mma_smem_desc (%startAddr, %leadingDimOffset, %strideDimOffset,\n %baseOffset, %leadingDimMode, %swizzleMode) : (i32, i32, i32, i8, i1, i8) -> i64\n ```\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-shared-memory-descriptor)", "operands": [ { "name": "startAddr", "type": "I32" }, { "name": "leadingDimOffset", "type": "I32" }, { "name": "strideDimOffset", "type": "I32" }, { "name": "baseOffset", "type": "I8" }, { "name": "leadingDimMode", "type": "I1" }, { "name": "swizzleMode", "type": "I8" } ], "results": [ { "name": "res", "type": "I64" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` `(` type(operands) `)` `->` type($res)" }, { "name": "nvvm.tcgen05.mma.block_scale", "summary": "Performs block scaled MMA operation on 5th-gen tensor cores", "description": "The `tcgen05.mma.block_scale` operation is an asynchronous tensor core instruction\n that performs matrix multiplication, accumulation with block scaling in a\n single fused operation. It targets 5th-generation tensor cores, providing\n developers with fine-grained control over execution and scheduling.\n\n ```\n D = (A * scale_a) * (B * scale_b)` // if `enableInputD` is false\n D = (A * scale_a) * (B * scale_b) + D`\n ```\n\n where:\n - A is an M x (K / 2) matrix in tensor memory or described using shared memory descriptor\n - B is a K x N matrix described using shared memory descriptor\n - D is an M x N accumulator matrix in tensor memory\n - `scale_a` and `scale_b` are matrices in tensor memory used to scale `A` and `B` respectively\n\n The `shared memory descriptor` can be generated using `tcgen05.mma_smem_desc` Op\n\n - `idesc` is a 32 bit value representing the [Instruction Descriptor](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instruction-descriptor)\n\n Required Attributes:\n - `kind` is a Tcgen05MMAKind attribute restricted to mxf8f6f4, mxf4, or mxf4nvf4\n\n - `ctaGroup` specifies CTA group configuration\n * cta_1: MMA will be performed on the current thread's CTA\n * cta_2: MMA will be performed on the current thread and it's peer CTA\n\n Default Attributes:\n - collectorOp is a Tcgen05MMACollectorOp attribute with matrix A as the collector buffer\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-mma-instructions-mma)", "operands": [ { "name": "matrixD", "type": "LLVM_PointerTensor" }, { "name": "matrixA", "type": "AnyTypeOf<[LLVM_PointerTensor, I64]>" }, { "name": "matrixB", "type": "I64" }, { "name": "idesc", "type": "I32" }, { "name": "enableInputD", "type": "I1" }, { "name": "scaleA", "type": "LLVM_PointerTensor" }, { "name": "scaleB", "type": "LLVM_PointerTensor" } ], "attributes": [ { "name": "kind", "type": "Tcgen05MMABlockScaleKindAttr" }, { "name": "ctaGroup", "type": "CTAGroupKindAttr{cta_1|cta_2}" }, { "name": "blockScale", "type": "DefaultValuedAttr" }, { "name": "collectorOp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$matrixD `,` $matrixA `,` $matrixB `,` $idesc `,` $enableInputD `,`\n $scaleA `,` $scaleB attr-dict `:` `(` type(operands) `)`" }, { "name": "nvvm.tcgen05.mma.sp", "summary": "Performs MMA operation with sparse A matrix on 5th-gen tensor cores", "description": "The `tcgen05.mma.sp` operation is an asynchronous tensor core instruction\n that performs matrix multiplication, accumulation with sparse `A` matrix in\n a single fused operation. It targets 5th-generation tensor cores, providing\n developers with fine-grained control over execution and scheduling.\n\n ```\n D = A * B + (D * 2^ -scaleInputD) // if `scaleInputD` is provided\n D = A * B // if `enableInputD` is false\n D = A * B + D // otherwise\n ```\n\n where:\n - A is an `M x (K / 2)` matrix in tensor memory or described using shared memory descriptor\n - B is a `K x N` matrix described using shared memory descriptor\n - D is an `M x N` accumulator matrix in tensor memory\n - sparseMetadata located in tensor memory specifies the mapping of the `K / 2`\n non-zero elements to the K elements before performing the MMA operation\n\n Other attributes and operands are similar to that of tcgen05.mma Op\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-mma-instructions-mma-sp)", "operands": [ { "name": "matrixD", "type": "LLVM_PointerTensor" }, { "name": "matrixA", "type": "AnyTypeOf<[LLVM_PointerTensor, I64]>" }, { "name": "matrixB", "type": "I64" }, { "name": "idesc", "type": "I32" }, { "name": "enableInputD", "type": "I1" }, { "name": "sparseMetadata", "type": "LLVM_PointerTensor" }, { "name": "scaleInputD", "type": "Optional" }, { "name": "disableOutputLane", "type": "Optional>" } ], "attributes": [ { "name": "kind", "type": "Tcgen05MMANonBlockScaleKindAttr" }, { "name": "ctaGroup", "type": "CTAGroupKindAttr{cta_1|cta_2}" }, { "name": "collectorOp", "type": "DefaultValuedAttr" }, { "name": "aShift", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$matrixD `,` $matrixA `,` $matrixB `,` $idesc `,` $enableInputD `,` $sparseMetadata (`scale` `=` $scaleInputD^)? (`mask` `=` $disableOutputLane^)? attr-dict `:` `(` type(operands) `)`" }, { "name": "nvvm.tcgen05.mma.sp.block_scale", "summary": "Performs block scaled MMA operation with sparse A matrix on 5th-gen tensor cores", "description": "The `tcgen05.mma.sp.block_scale` operation is an asynchronous tensor core\n instruction that performs matrix multiplication, accumulation with block\n scaling, and sparse `A` matrix in a single fused operation. It targets\n 5th-generation tensor cores, providing developers with fine-grained control\n over execution, and scheduling.\n\n ```\n D = (A * scale_a) * (B * scale_b) // if `enableInputD` is specified\n D = (A * scale_a) * (B * scale_b) + D // otherwise\n ```\n\n where:\n - A is an M x (K / 2) matrix in tensor memory or described using shared memory descriptor\n - B is a K x N matrix described using shared memory descriptor\n - D is an M x N accumulator matrix in tensor memory\n - `scale_a` and `scale_b` are matrices in tensor memory used to scale `A` and `B` respectively\n\n Other attributes and operands are similar to that of tcgen05.mma.block_scale Op\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-mma-instructions-mma-sp)", "operands": [ { "name": "matrixD", "type": "LLVM_PointerTensor" }, { "name": "matrixA", "type": "AnyTypeOf<[LLVM_PointerTensor, I64]>" }, { "name": "matrixB", "type": "I64" }, { "name": "idesc", "type": "I32" }, { "name": "enableInputD", "type": "I1" }, { "name": "sparseMetadata", "type": "LLVM_PointerTensor" }, { "name": "scaleA", "type": "LLVM_PointerTensor" }, { "name": "scaleB", "type": "LLVM_PointerTensor" } ], "attributes": [ { "name": "kind", "type": "Tcgen05MMABlockScaleKindAttr" }, { "name": "ctaGroup", "type": "CTAGroupKindAttr{cta_1|cta_2}" }, { "name": "blockScale", "type": "DefaultValuedAttr" }, { "name": "collectorOp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$matrixD `,` $matrixA `,` $matrixB `,` $idesc `,` $enableInputD `,`\n $sparseMetadata `,` $scaleA `,` $scaleB attr-dict `:` `(` type(operands) `)`" }, { "name": "nvvm.tcgen05.mma.ws", "summary": "Performs weight stationary convolution MMA operation on 5th-gen tensor cores", "description": "The `tcgen05.mma.ws` operation is an asynchronous tensor core instruction\n that performs weight stationary convolution matrix multiplication, accumulation\n in a single fused operation. It targets 5th-generation tensor cores, providing\n developers with fine-grained control over execution, and scheduling.\n\n ```\n D = A * B` // if `enableInputD` is false\n D = A * B + D` // otherwise\n ```\n\n where:\n - A is an `M x K` matrix in tensor memory or described using shared memory descriptor\n - B is a `K x N` matrix described using shared memory descriptor\n - D is an `M x N` accumulator matrix in tensor memory\n\n The `shared memory descriptor` can be generated using `tcgen05.mma_smem_desc` Op\n\n - idesc is a 32-bit value representing the [Instruction Descriptor](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instruction-descriptor)\n\n Optional Operands:\n - zeroColMask is a 64 bit value representing the [Zero-column mask descriptor](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-zero-column-mask-descriptor)\n\n Required Attributes:\n - `kind` is a Tcgen05MMAKind attribute\n\n Default Valued Attributes:\n - collectorBBuffer specifies collector buffer for matrix B: b0 (default), b1, b2, b3\n\n - collectorOp is a Tcgen05MMACollectorOp attribute with matrix B as the collector buffer\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-mma-instructions-mma-ws)", "operands": [ { "name": "matrixD", "type": "LLVM_PointerTensor" }, { "name": "matrixA", "type": "AnyTypeOf<[LLVM_PointerTensor, I64]>" }, { "name": "matrixB", "type": "I64" }, { "name": "idesc", "type": "I32" }, { "name": "enableInputD", "type": "I1" }, { "name": "zeroColMask", "type": "Optional" } ], "attributes": [ { "name": "kind", "type": "Tcgen05MMANonBlockScaleKindAttr" }, { "name": "collectorBBuffer", "type": "DefaultValuedAttr" }, { "name": "collectorOp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$matrixD `,` $matrixA `,` $matrixB `,` $idesc `,` $enableInputD (`,` $zeroColMask^)?\n attr-dict `:` `(` type(operands) `)`" }, { "name": "nvvm.tcgen05.mma.ws.sp", "summary": "Performs weight stationary convolution MMA with sparse A matrix on 5th-gen tensor cores", "description": "The `tcgen05.mma.ws.sp` operation is an asynchronous tensor core instruction\n that performs weight stationary convolution matrix multiplication, accumulation\n with sparse `A` matrix in a single fused operation. It targets 5th-generation\n tensor cores, providing developers with fine-grained control over execution,\n and scheduling.\n\n ```\n D = A * B` // if `enableInputD` is false\n D = A * B + D` // otherwise\n ```\n\n where:\n - A is an M x (K / 2) matrix in memory or descriptor format\n - B is a K x N matrix\n - D is an M x N accumulator matrix\n - sparseMetadata located in tensor memory specifies the mapping of the `K / 2`\n non-zero elements to the K elements before performing the MMA operation\n\n Other attributes and operands are similar to that of tcgen05.mma.ws Op\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-mma-instructions-mma-ws-sp)", "operands": [ { "name": "matrixD", "type": "LLVM_PointerTensor" }, { "name": "matrixA", "type": "AnyTypeOf<[LLVM_PointerTensor, I64]>" }, { "name": "matrixB", "type": "I64" }, { "name": "idesc", "type": "I32" }, { "name": "enableInputD", "type": "I1" }, { "name": "sparseMetadata", "type": "LLVM_PointerTensor" }, { "name": "zeroColMask", "type": "Optional" } ], "attributes": [ { "name": "kind", "type": "Tcgen05MMANonBlockScaleKindAttr" }, { "name": "collectorBBuffer", "type": "DefaultValuedAttr" }, { "name": "collectorOp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$matrixD `,` $matrixA `,` $matrixB `,` $idesc `,` $enableInputD `,` $sparseMetadata (`,` $zeroColMask^)? attr-dict `:` `(` type(operands) `)`" }, { "name": "nvvm.tcgen05.relinquish_alloc_permit", "summary": "Tcgen05 Op to relinquish the right to allocate", "description": "The `tcgen05.relinquish_alloc_permit` Op specifies that the CTA\n of the executing thread is relinquishing the right to allocate\n Tensor Memory. So, it is illegal for a CTA to perform `tcgen05.alloc`\n after any of its constituent threads execute `tcgen05.relinquish_alloc_permit`.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-memory-alloc-manage-instructions)", "attributes": [ { "name": "group", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "nvvm.tcgen05.shift", "summary": "Tcgen05 shift operation", "description": "The `tcgen05.shift` is an asynchronous instruction which initiates\n the shifting of 32-byte elements downwards across all the rows,\n except the last, by one row. The operand `taddr` specifies the base\n address of the matrix in Tensor Memory whose rows must be down shifted.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instructions-tcgen05-shift)", "operands": [ { "name": "taddr", "type": "LLVM_PointerTensor" } ], "attributes": [ { "name": "group", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$taddr attr-dict `:` type(operands)" }, { "name": "nvvm.tcgen05.st", "summary": "tensor memory store instructions", "description": "Instruction `tcgen05.st` asynchronously stores data from the source register `r`\n into the Tensor Memory at the location specified by the 32-bit address operand\n `tmemAddr`, collectively across all threads of the warps.\n\n The `shape` and the `num` attribute together determines the total dimension of\n the data which is stored to the Tensor Memory. The `shape` indicates the base\n dimension of data to be accessed. The `num` attribute indicates the repeat\n factor on the base dimension resulting in the total dimension of the data that\n is accessed.\n\n The shape `16x32bx2` performs two accesses into Tensor Memory of the shape\n `16x32b`. The base address of the first access is specified by `tmemAddr`\n and the base address of the second access is specified by\n `tmemAddr + offset`, where `offset` is an immediate argument.\n\n The unit attribute `unpack` can be used to unpack a 32-bit element\n in the register into two 16-bit elements and store them in adjacent columns.\n\n The following table describes the size of the vector for various combinations\n of `num` and `shape` attributes:\n ```\n |=====================================================================|\n | num/shape | 16x32bx2/16x64b/32x32b | 16x128b | 16x256b |\n |=====================================================================|\n | x1 | 1 | 2 | 4 |\n | x2 | 2 | 4 | 8 |\n | x4 | 4 | 8 | 16 |\n | x8 | 8 | 16 | 32 |\n | x16 | 16 | 32 | 64 |\n | x32 | 32 | 64 | 128 |\n | x64 | 64 | 128 | NA |\n | x128 | 128 | NA | NA |\n |=====================================================================|\n ```\n\n Example:\n ```mlir\n nvvm.tcgen05.st %tmemAddr, %val, %offset unpack {\n shape = #nvvm.tcgen05_ldst_shape,\n } : <2xi32>\n ```\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instructions-tcgen05-st)", "operands": [ { "name": "tmemAddr", "type": "LLVM_PointerTensor" }, { "name": "val", "type": "VectorOfLengthAndType<[1, 2, 4, 8, 16, 32, 64, 128], [I32]>" }, { "name": "offset", "type": "Optional" } ], "attributes": [ { "name": "unpack", "type": "UnitAttr" }, { "name": "shape", "type": "Tcgen05LdStShapeAttr{shape_16x64b|shape_16x128b|shape_16x256b|shape_32x32b|shape_16x32bx2}" } ], "assemblyFormat": "$tmemAddr `,` $val (`,` $offset^)? (`unpack` $unpack^)? attr-dict `:` type($val)" }, { "name": "nvvm.tcgen05.wait", "summary": "Tcgen05 wait operations", "description": "The `tcgen05.wait` causes the executing thread to block until\n all prior `tcgen05.ld` operations issued by the executing thread\n have completed. Similarly, the `tcgen05.wait` causes the executing\n thread to block until all prior `tcgen05.st` operations issued by the\n executing thread have completed.\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-instructions-tcgen05-wait)", "attributes": [ { "name": "kind", "type": "Tcgen05WaitKindAttr{load|store}" } ], "assemblyFormat": "$kind attr-dict" }, { "name": "nvvm.tensormap.replace", "summary": "Modifies a field of the tensor-map object", "description": "The `nvvm.tensormap.replace` replaces the specified field of the tensor-map \n object at the location specified by `addr` with a new value (specified by \n `new_value` or `new_value_attr`).\n\n The `field` argument specifies the field of the tensor-map object to \n replace.\n\n `new_value` is an `i32`/`i64` argument that specifies the new value to \n replace the `field` with for the `global_address`, `rank`, `box_dim`, \n `global_dim`, `global_stride`, and `element_stride` fields. It must be an \n `i64` for the `global_address` and `global_stride` fields and `i32` for the \n remaining fields.\n \n For `rank`, `new_value` must be one less than the desired tensor rank as \n this field uses zero-based numbering.\n\n `new_value_attr` is an attribute that specifies the new value to replace \n the `field` with for the `elemtype`, `interleave_layout`, `swizzle_mode`, \n `swizzle_atomicity`, and `fill_mode` fields. It takes the place of \n `new_value` for these fields. It must be a valid attribute corresponding to \n the `field` type.\n\n The ordinal `ord` is an immediate integer argument that specifies the \n ordinal of the `field` across the tensor which needs to be replaced and is \n required only for the `box_dim`, `global_dim`, `global_stride`, and \n `element_stride` fields.\n\n [For more information, see PTX ISA.](https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-tensormap-replace)", "operands": [ { "name": "addr", "type": "AnyTypeOf<[LLVM_PointerGlobal, LLVM_PointerShared]>" }, { "name": "new_value", "type": "Optional>" } ], "attributes": [ { "name": "field", "type": "TensormapFieldAttr{global_address|rank|box_dim|global_dim|global_stride|element_stride|elemtype|interleave_layout|swizzle_mode|swizzle_atomicity|fill_mode}" }, { "name": "ord", "type": "OptionalAttr, IntMaxValue < 4 > ]>>" }, { "name": "new_value_attr", "type": "OptionalAttr" } ], "assemblyFormat": "`field` `=` $field (`[` $ord^ `]`)? `,` `new_value` `=` ($new_value_attr^):($new_value)? `in` $addr attr-dict `:` type(operands)" }, { "name": "nvvm.vote.sync", "summary": "Vote across thread group", "description": "The `vote.sync` op will cause executing thread to wait until all non-exited\n threads corresponding to membermask have executed `vote.sync` with the same\n qualifiers and same membermask value before resuming execution.\n\n The vote operation kinds are:\n - `any`: True if source predicate is True for some thread in membermask.\n - `all`: True if source predicate is True for all non-exited threads in\n membermask. \n - `uni`: True if source predicate has the same value in all non-exited\n threads in membermask.\n - `ballot`: In the ballot form, the destination result is a 32 bit integer.\n In this form, the predicate from each thread in membermask are copied into\n the corresponding bit position of the result, where the bit position\n corresponds to the thread's lane id.\n\n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/#parallel-synchronization-and-communication-instructions-vote-sync)", "operands": [ { "name": "mask", "type": "I32" }, { "name": "pred", "type": "I1" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I1]>" } ], "attributes": [ { "name": "kind", "type": "VoteSyncKindAttr{any|all|ballot|uni}" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$kind $mask `,` $pred attr-dict `->` type($res)" }, { "name": "nvvm.wgmma.commit.group.sync.aligned", "description": "Commits all prior uncommitted warpgroup level matrix multiplication operations.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#asynchronous-warpgroup-level-matrix-instructions-wgmma-commit-group)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.wgmma.fence.aligned", "description": "Enforce an ordering of register accesses between warpgroup level matrix \n multiplication and other operations. \n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#asynchronous-warpgroup-level-matrix-instructions-wgmma-fence)", "assemblyFormat": "attr-dict" }, { "name": "nvvm.wgmma.mma_async", "description": "The warpgroup (128 threads) level matrix multiply and accumulate operation \n has either of the following forms, where matrix D is called accumulator:\n D = A * B + D\n D = A * B, where the input from accumulator D is disabled.\n\n Supported shapes: \n ```\n |--------------|--------------|------------|--------------|---------------|\n | | | | |f16+=e4m3*e4m3 |\n | | | | |f16+=e5m2*e5m2 |\n |f32+=tf32*tf32|f16+=f16 *f16 | s32+=s8*s8 |s32 += b1 * b1|f16+=e5m2*e4m3 |\n | |f32+=f16 *f16 | s32+=u8*u8 | |f16+=e4m3*e5m2 |\n | |f32+=bf16*bf16| s32+=u8*u8 | |f16+=e4m3*e5m2 |\n | |f32+=bf16*bf16| s32+=s8*u8 | |f32+=e4m3*e4m3 |\n | | | s32+=u8*s8 | |f32+=e5m2*e5m2 |\n | | | | |f32+=e4m3*e5m2 |\n | | | | |f32+=e4m3*e5m2 |\n |--------------|--------------|------------|--------------|---------------|\n | .m64n8k8 | .m64n8k16 | .m64n8k32 | .m64n8k256 | .m64n8k32 |\n | .m64n16k8 | .m64n16k16 | .m64n16k32 | .m64n16k256 | .m64n16k32 |\n | .m64n24k8 | .m64n24k16 | .m64n24k32 | .m64n24k256 | .m64n24k32 |\n | .m64n32k8 | .m64n32k16 | .m64n32k32 | .m64n32k256 | .m64n32k32 |\n | .m64n40k8 | .m64n40k16 | .m64n48k32 | .m64n48k256 | .m64n40k32 |\n | .m64n48k8 | .m64n48k16 | .m64n64k32 | .m64n64k256 | .m64n48k32 |\n | .m64n56k8 | .m64n56k16 | .m64n80k32 | .m64n80k256 | .m64n56k32 |\n | .m64n64k8 | .m64n64k16 | .m64n96k32 | .m64n96k256 | .m64n64k32 |\n | .m64n72k8 | .m64n72k16 | .m64n112k32| .m64n112k256 | .m64n72k32 |\n | .m64n80k8 | .m64n80k16 | .m64n128k32| .m64n128k256 | .m64n80k32 |\n | .m64n88k8 | .m64n88k16 | .m64n144k32| .m64n144k256 | .m64n88k32 |\n | .m64n96k8 | .m64n96k16 | .m64n160k32| .m64n160k256 | .m64n96k32 |\n | .m64n104k8 | .m64n104k16 | .m64n176k32| .m64n176k256 | .m64n104k32 |\n | .m64n112k8 | .m64n112k16 | .m64n192k32| .m64n192k256 | .m64n112k32 |\n | .m64n120k8 | .m64n120k16 | .m64n208k32| .m64n208k256 | .m64n120k32 |\n | .m64n128k8 | .m64n128k16 | .m64n224k32| .m64n224k256 | .m64n128k32 |\n | .m64n136k8 | .m64n136k16 | .m64n240k32| .m64n240k256 | .m64n136k32 |\n | .m64n144k8 | .m64n144k16 | .m64n256k32| .m64n256k256 | .m64n144k32 |\n | .m64n152k8 | .m64n152k16 | | | .m64n152k32 |\n | .m64n160k8 | .m64n160k16 | | | .m64n160k32 |\n | .m64n168k8 | .m64n168k16 | | | .m64n168k32 |\n | .m64n176k8 | .m64n176k16 | | | .m64n176k32 |\n | .m64n184k8 | .m64n184k16 | | | .m64n184k32 |\n | .m64n192k8 | .m64n192k16 | | | .m64n192k32 |\n | .m64n200k8 | .m64n200k16 | | | .m64n200k32 |\n | .m64n208k8 | .m64n208k16 | | | .m64n208k32 |\n | .m64n216k8 | .m64n216k16 | | | .m64n216k32 |\n | .m64n224k8 | .m64n224k16 | | | .m64n224k32 |\n | .m64n232k8 | .m64n232k16 | | | .m64n232k32 |\n | .m64n240k8 | .m64n240k16 | | | .m64n240k32 |\n | .m64n248k8 | .m64n248k16 | | | .m64n248k32 |\n | .m64n256k8 | .m64n256k16 | | | .m64n256k32 |\n |--------------|--------------|------------|--------------|---------------|\n ```\n\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#asynchronous-warpgroup-level-matrix-instructions)", "operands": [ { "name": "inouts", "type": "LLVM_AnyStruct" }, { "name": "descriptorA", "type": "I64" }, { "name": "descriptorB", "type": "I64" } ], "results": [ { "name": "results", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "shape", "type": "NVVM_MMAShapeAttr" }, { "name": "typeA", "type": "WGMMATypesAttr{f16|tf32|u8|s8|b1|bf16|e4m3|e5m2|f32|s32}" }, { "name": "typeB", "type": "WGMMATypesAttr{f16|tf32|u8|s8|b1|bf16|e4m3|e5m2|f32|s32}" }, { "name": "typeD", "type": "WGMMATypesAttr{f16|tf32|u8|s8|b1|bf16|e4m3|e5m2|f32|s32}" }, { "name": "scaleD", "type": "WGMMAScaleOutAttr{zero|one}" }, { "name": "scaleA", "type": "WGMMAScaleInAttr{one|neg}" }, { "name": "scaleB", "type": "WGMMAScaleInAttr{one|neg}" }, { "name": "layoutA", "type": "MMALayoutAttr{row|col}" }, { "name": "layoutB", "type": "MMALayoutAttr{row|col}" }, { "name": "satfinite", "type": "OptionalAttr" } ], "assemblyFormat": "$descriptorA `,` $descriptorB `,` $inouts `,` $shape `,`\n `D` `[` $typeD `,` $scaleD (`,` $satfinite^)? `]` `,`\n `A` `[` $typeA `,` $scaleA `,` $layoutA `]` `,` \n `B` `[` $typeB `,` $scaleB `,` $layoutB `]`\n attr-dict `:` \n type($inouts) `->` type($results)" }, { "name": "nvvm.wgmma.wait.group.sync.aligned", "description": "Signal the completion of a preceding warpgroup operation.\n \n [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#asynchronous-warpgroup-level-matrix-instructions-wgmma-wait-group)", "attributes": [ { "name": "group", "type": "I64Attr" } ], "assemblyFormat": "attr-dict $group" }, { "name": "nvvm.wmma.load", "summary": "Warp synchronous matrix load", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "stride", "type": "I32" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[LLVM_AnyStruct, F64]>" } ], "attributes": [ { "name": "m", "type": "I32Attr" }, { "name": "n", "type": "I32Attr" }, { "name": "k", "type": "I32Attr" }, { "name": "layout", "type": "MMALayoutAttr{row|col}" }, { "name": "eltype", "type": "MMATypesAttr{f16|f32|tf32|bf16|s8|u8|s32|s4|u4|b1|f64|e4m3|e5m2|e3m2|e2m3|e2m1}" }, { "name": "frag", "type": "MMAFragAttr{a|b|c}" } ], "assemblyFormat": "$ptr `,` $stride attr-dict `:` functional-type($ptr, $res)" }, { "name": "nvvm.wmma.mma", "summary": "Warp synchronous matrix-multiply accumulate using tensor cores.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "res", "type": "LLVM_AnyStruct" } ], "attributes": [ { "name": "m", "type": "I32Attr" }, { "name": "n", "type": "I32Attr" }, { "name": "k", "type": "I32Attr" }, { "name": "layoutA", "type": "MMALayoutAttr{row|col}" }, { "name": "layoutB", "type": "MMALayoutAttr{row|col}" }, { "name": "eltypeA", "type": "MMATypesAttr{f16|f32|tf32|bf16|s8|u8|s32|s4|u4|b1|f64|e4m3|e5m2|e3m2|e2m3|e2m1}" }, { "name": "eltypeB", "type": "MMATypesAttr{f16|f32|tf32|bf16|s8|u8|s32|s4|u4|b1|f64|e4m3|e5m2|e3m2|e2m3|e2m1}" } ], "assemblyFormat": "$args attr-dict `:` functional-type($args, $res)" }, { "name": "nvvm.wmma.store", "summary": "Warp synchronous matrix store", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "args", "type": "Variadic" }, { "name": "stride", "type": "I32" } ], "attributes": [ { "name": "m", "type": "I32Attr" }, { "name": "n", "type": "I32Attr" }, { "name": "k", "type": "I32Attr" }, { "name": "layout", "type": "MMALayoutAttr{row|col}" }, { "name": "eltype", "type": "MMATypesAttr{f16|f32|tf32|bf16|s8|u8|s32|s4|u4|b1|f64|e4m3|e5m2|e3m2|e2m3|e2m1}" } ], "assemblyFormat": "$ptr `,` $stride `,` $args attr-dict `:` qualified(type($ptr)) `,`\n type($args)" }, { "name": "nvws.aref.buffer", "summary": "Get buffer from aref", "operands": [ { "name": "aref", "type": "NVWS_ArefType" }, { "name": "token", "type": "TTG_AsyncToken" }, { "name": "stage", "type": "Optional" } ], "results": [ { "name": "buffers", "type": "Variadic" } ], "assemblyFormat": "$aref (`[` $stage^ `]`)? `,` $token attr-dict\n `:` type($aref) `,` type($token) `->` type(results)" }, { "name": "nvws.aref.create", "summary": "Create an asynchronous reference.", "description": "Create an asynchronous reference.\n\n Takes as inputs a variadic number of buffers, and returns an ARef.\n The inputs are expected to be array-like (i.e., Tensor, MemDesc, etc)\n and the first axis of the shape should match between all inputs, representing\n multi-buffering of the values.", "operands": [ { "name": "buffers", "type": "Variadic" } ], "results": [ { "name": "result", "type": "NVWS_ArefType" } ], "traits": [ { "type": "TypesMatchWith<'result', 'buffers', '::llvm::cast($_self).getBaseType()'>" } ], "assemblyFormat": "$buffers attr-dict `:` type($result)" }, { "name": "nvws.aref.get.enter", "summary": "Enter ArefGet region where the buffer can be used to read data", "description": "Enter a \"region\" where you can freely read from the buffer)\n These ArefGet \"regions\" can span multiple iterations.", "operands": [ { "name": "aref", "type": "NVWS_ArefType" }, { "name": "stage", "type": "Optional" }, { "name": "phase", "type": "Optional" } ], "results": [ { "name": "buffers", "type": "Variadic" }, { "name": "token", "type": "TTG_AsyncToken" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$aref ( `[` $stage^ `,` $phase `]`)? attr-dict\n `:` type($aref) `->` type(results)" }, { "name": "nvws.aref.get.exit", "summary": "Exit ArefGet region, where the buffer should no longer be used", "description": "Leave the region where you can freely read from the buffer).\n These ArefGet \"regions\" can span multiple iterations.", "operands": [ { "name": "aref", "type": "NVWS_ArefType" }, { "name": "token", "type": "TTG_AsyncToken" }, { "name": "stage", "type": "Optional" } ], "attributes": [ { "name": "async_ops", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$aref (`[` $stage^ `]`)? `,` $token $async_ops attr-dict\n `:` type($aref) `,` type($token)" }, { "name": "nvws.aref.put.enter", "summary": "Enter ArefPut region where the buffer can be used to read data", "description": "Enter a \"region\" where you can freely write to the buffer)\n These ArefPut \"regions\" can span multiple iterations.", "operands": [ { "name": "aref", "type": "NVWS_ArefType" }, { "name": "stage", "type": "Optional" }, { "name": "phase", "type": "Optional" } ], "results": [ { "name": "buffers", "type": "Variadic" }, { "name": "token", "type": "TTG_AsyncToken" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$aref ( `[` $stage^ `,` $phase `]`)? attr-dict\n `:` type($aref) `->` type(results)" }, { "name": "nvws.aref.put.exit", "summary": "Exit ArefPut region, where the buffer should no longer be used", "description": "Leave the region where you can freely write to the buffer).\n These ArefPut \"regions\" can span multiple iterations.", "operands": [ { "name": "aref", "type": "NVWS_ArefType" }, { "name": "token", "type": "TTG_AsyncToken" }, { "name": "stage", "type": "Optional" } ], "attributes": [ { "name": "async_ops", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$aref (`[` $stage^ `]`)? `,` $token $async_ops attr-dict\n `:` type($aref) `,` type($token)" }, { "name": "nvws.consumer_release", "summary": "Consumer releases the token", "description": "The consumer will release the token and signal the producer\n that the buffers are ready to be filled.", "operands": [ { "name": "token", "type": "TensorOf<[NVWS_TokenType]>" }, { "name": "idx", "type": "I32" } ], "assemblyFormat": "$token `,` $idx attr-dict `:` type(operands)" }, { "name": "nvws.consumer_wait", "summary": "Consumer awaits buffer readiness", "description": "The consumer will wait for the buffer to be ready\n to be consumed. If the buffers are not ready, the consumer will wait to be\n signalled by the producer which finishes filling the buffers and\n releases the token.", "operands": [ { "name": "token", "type": "TensorOf<[NVWS_TokenType]>" }, { "name": "idx", "type": "I32" }, { "name": "phase", "type": "I1" } ], "assemblyFormat": "$token `,` $idx `,` $phase attr-dict `:` type(operands)" }, { "name": "nvws.create_token", "summary": "Create a token to be used for synchronizations in communication channels", "description": "A token will be used by the producer and consumer to synchronize.\n The producer will acquire and hold the token, until it has filled the buffers,\n and signal the waiting consumer.\n The consumer will hold the token until it has consumed the buffers,\n and will signal the waiting producer trying to acquire the token.", "results": [ { "name": "result", "type": "TensorOf<[NVWS_TokenType]>" } ], "attributes": [ { "name": "numBuffers", "type": "I32Attr" }, { "name": "loadType", "type": "NVWS_TokenLoadTypeAttr{none|asyncLoadOp|tmaLoadOp|localStoreOp|TmemLoadOp}" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "nvws.descriptor_gather", "summary": "gather multiple rows from a descriptor into shared memory", "description": "This op behaves exactly like the op with the same name in Triton Dialect, but the result of the load is stored into shared memory.\n The execution is still synchronous.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "x_offsets", "type": "RankedTensorOf<[I32]>" }, { "name": "y_offset", "type": "I32" }, { "name": "result", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "txCount", "type": "I32Attr" } ], "assemblyFormat": "$desc `[` $x_offsets `,` $y_offset `]` $txCount $result\n attr-dict `:` type(operands)" }, { "name": "nvws.descriptor_load", "summary": "Load from descriptor and store into shared memory", "description": "This op behaves exactly like the op with the same name in Triton Dialect, but the result of the load is stored into shared memory.\n The execution is still synchronous.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "indices", "type": "Variadic" }, { "name": "result", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "txCount", "type": "I32Attr" }, { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$desc `[` $indices `]` $txCount $result\n oilist(\n `cacheModifier` `=` $cache |\n `evictionPolicy` `=` $evict\n )\n attr-dict `:` type(operands)" }, { "name": "nvws.producer_acquire", "summary": "Producer acquires a token to fill buffers", "description": "The producer will try to acquire the token prior to filling\n the buffers. If the buffers are not ready to be filled, the producer will wait to be\n signalled by the consumer which finishes consuming the buffers and\n releases the token.", "operands": [ { "name": "token", "type": "TensorOf<[NVWS_TokenType]>" }, { "name": "idx", "type": "I32" }, { "name": "phase", "type": "I1" } ], "assemblyFormat": "$token `,` $idx `,` $phase attr-dict `:` type(operands)" }, { "name": "nvws.producer_commit", "summary": "Producer commits the buffer changes", "description": "The producer will release the token and signal the consumer\n that the buffers are ready to be consumed.", "operands": [ { "name": "token", "type": "TensorOf<[NVWS_TokenType]>" }, { "name": "idx", "type": "I32" } ], "assemblyFormat": "$token `,` $idx attr-dict `:` type(operands)" }, { "name": "nvws.warp_group", "summary": "Container Op for Warp Specialization", "description": "Higher level container for Warp Specialization Analysis.\n\n Contains a variadic number warp groups, with\n the number of warps in each group, plus a region to hold the\n computation for that warp group.\n\n The results of this op, if any, are those of the first region, as returned by\n nvws.warp_group.yield op.\n\n nvws.warp_group should be lowered to ttg.warp_specialize\n before execution.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "numWarps", "type": "DenseI32ArrayAttr" } ], "regions": [ { "name": "partitionRegions", "type": "VariadicRegion>" } ], "hasCustomAssemblyFormat": true }, { "name": "nvws.warp_group.return", "summary": "Terminator for a warp group region", "description": "Warp groups are expected to return values via referential modification\n of their inputs. Thus, the warp_group.return op takes no values to\n return from the warp group.", "assemblyFormat": "attr-dict" }, { "name": "nvws.warp_group.yield", "summary": "yield from the first region of `nvws.warp_group`", "description": "This op is equivalent to ttg.warp_yield op for ttg.warp_specialize op.\n\n TODO: Decide if we should move nvws.warp_group to TritonGPU, or continue to\n have TritonGPU depend on NVWS. In the former case, this op can be removed.\n The latter one involves a circular dependency between TritonGPU and NVWS.", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "($values^)? attr-dict (`:` type($values)^)?" }, { "name": "omp.affinity_entry", "summary": "OpenMP affinity clause entry value", "operands": [ { "name": "addr", "type": "OpenMP_PointerLikeType" }, { "name": "len", "type": "IntLikeType" } ], "results": [ { "name": "entry", "type": "OpenMP_AffinityEntryType" } ], "assemblyFormat": "$addr `,` $len `:` `(` type($addr) `,` type($len) `)` `->`\n qualified(type($entry)) attr-dict" }, { "name": "omp.alloc_shared_mem", "summary": "allocate storage on shared memory for objects of a given type", "description": "Allocates memory shared across threads of a team for an object of the given\n type. Returns a pointer representing the allocated memory. The memory is\n uninitialized after allocation. Operations must be paired with\n `omp.free_shared` to avoid memory leaks.\n\n ```mlir\n // Allocate an i32 vector with %size elements and aligned to 8 bytes.\n %ptr_shared = omp.alloc_shared_mem %size x i32 : (i64) align(8) -> !llvm.ptr\n // ...\n omp.free_shared_mem [%size x i32 : (i64) align(8)] %ptr_shared : !llvm.ptr\n ```The `mem_elem_type` is the type of the object the memory allocation refers\n to. It is used to calculate the size of the allocation.\n\n The `mem_array_size` is the number of objects.\n\n The optional `mem_alignment` is used to specify the alignment for each\n element. If not set, the `DataLayout` defaults will be used instead.", "operands": [ { "name": "mem_array_size", "type": "AnySignlessInteger" } ], "results": [ { "name": "result", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "mem_elem_type", "type": "TypeAttr" }, { "name": "mem_alignment", "type": "ConfinedAttr, [IntPositive]>" } ], "assemblyFormat": "$mem_array_size `x` $mem_elem_type `:` `(` type($mem_array_size) `)` oilist(`align` `(` $mem_alignment `)`) `->` type(results) attr-dict" }, { "name": "omp.allocate_dir", "summary": "allocate directive", "description": "The storage for each list item that appears in the allocate directive is\n provided an allocation through the memory allocator.The `align` clause is used to specify the byte alignment to use for\n allocations associated with the construct on which the clause appears.`allocator` specifies the memory allocator to be used for allocations\n associated with the construct on which the clause appears.", "operands": [ { "name": "varList", "type": "Variadic" }, { "name": "allocator", "type": "Optional" } ], "attributes": [ { "name": "align", "type": "ConfinedAttr, [IntPositive]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $varList `:` type($varList) `)` oilist(`align` `(` $align `)`|`allocator` `(` $allocator `:` type($allocator) `)`) attr-dict" }, { "name": "omp.allocate_free", "summary": "free-op paired with allocate directive", "description": "At the end of the scope each list item allocated using allocate directive\n should be deallocated(using this free operation).`allocator` specifies the memory allocator to be used for allocations\n associated with the construct on which the clause appears.", "operands": [ { "name": "varList", "type": "Variadic" }, { "name": "allocator", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $varList `:` type($varList) `)` oilist(`allocator` `(` $allocator `:` type($allocator) `)`) attr-dict" }, { "name": "omp.atomic.capture", "summary": "performs an atomic capture", "description": "This operation performs an atomic capture.\n\n The region has the following allowed forms:\n ```\n omp.atomic.capture {\n omp.atomic.update ...\n omp.atomic.read ...\n omp.terminator\n }\n\n omp.atomic.capture {\n omp.atomic.read ...\n omp.atomic.update ...\n omp.terminator\n }\n\n omp.atomic.capture {\n omp.atomic.read ...\n omp.atomic.write ...\n omp.terminator\n }\n ````hint` is the value of hint (as specified in the hint clause). It is a\n compile time constant. As the name suggests, this is just a hint for\n optimization.`memory_order` indicates the memory ordering behavior of the construct. It\n can be one of `seq_cst`, `acq_rel`, `release`, `acquire` or `relaxed`.", "attributes": [ { "name": "hint", "type": "DefaultValuedOptionalAttr" }, { "name": "memory_order", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "oilist(`hint` `(` custom($hint) `)`|`memory_order` `(` custom($memory_order) `)`) $region attr-dict" }, { "name": "omp.atomic.compare", "summary": "performs an atomic compare", "description": "This operation performs an atomic compare-and-swap.\n\n The `atomic compare` construct implements atomic conditional update\n semantics. The operand `x` is the address of the variable that is being\n compared and potentially updated. The region describes the comparison\n and update logic.\n\n The region has the following structure:\n ```\n omp.atomic.compare {\n if (x == d) x = e\n omp.yield\n }\n ````hint` is the value of hint (as specified in the hint clause). It is a\n compile time constant. As the name suggests, this is just a hint for\n optimization.`memory_order` indicates the memory ordering behavior of the construct. It\n can be one of `seq_cst`, `acq_rel`, `release`, `acquire` or `relaxed`.", "operands": [ { "name": "x", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "weak", "type": "UnitAttr" }, { "name": "hint", "type": "DefaultValuedOptionalAttr" }, { "name": "memory_order", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "oilist(`hint` `(` custom($hint) `)`|`memory_order` `(` custom($memory_order) `)`)$x `:` type($x) $region attr-dict" }, { "name": "omp.atomic.read", "summary": "performs an atomic read", "description": "This operation performs an atomic read.\n\n The operand `x` is the address from where the value is atomically read.\n The operand `v` is the address where the value is stored after reading.`hint` is the value of hint (as specified in the hint clause). It is a\n compile time constant. As the name suggests, this is just a hint for\n optimization.`memory_order` indicates the memory ordering behavior of the construct. It\n can be one of `seq_cst`, `acq_rel`, `release`, `acquire` or `relaxed`.", "operands": [ { "name": "x", "type": "OpenMP_PointerLikeType" }, { "name": "v", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "element_type", "type": "TypeAttr" }, { "name": "hint", "type": "DefaultValuedOptionalAttr" }, { "name": "memory_order", "type": "OptionalAttr" } ], "assemblyFormat": "$v `=` $x oilist(`hint` `(` custom($hint) `)`|`memory_order` `(` custom($memory_order) `)`) `:` type($v) `,` type($x) `,` $element_type attr-dict" }, { "name": "omp.atomic.update", "summary": "performs an atomic update", "description": "This operation performs an atomic update.\n\n The operand `x` is exactly the same as the operand `x` in the OpenMP\n Standard (OpenMP 5.0, section 2.17.7). It is the address of the variable\n that is being updated. `x` is atomically read/written.\n\n The region describes how to update the value of `x`. It takes the value at\n `x` as an input and must yield the updated value. Only the update to `x` is\n atomic. Generally the region must have only one instruction, but can\n potentially have more than one instructions too. The update is sematically\n similar to a compare-exchange loop based atomic update.\n\n The syntax of atomic update operation is different from atomic read and\n atomic write operations. This is because only the host dialect knows how to\n appropriately update a value. For example, while generating LLVM IR, if\n there are no special `atomicrmw` instructions for the operation-type\n combination in atomic update, a compare-exchange loop is generated, where\n the core update operation is directly translated like regular operations by\n the host dialect. The front-end must handle semantic checks for allowed\n operations.`hint` is the value of hint (as specified in the hint clause). It is a\n compile time constant. As the name suggests, this is just a hint for\n optimization.`memory_order` indicates the memory ordering behavior of the construct. It\n can be one of `seq_cst`, `acq_rel`, `release`, `acquire` or `relaxed`.", "operands": [ { "name": "x", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "atomic_control", "type": "OptionalAttr" }, { "name": "hint", "type": "DefaultValuedOptionalAttr" }, { "name": "memory_order", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "oilist(`hint` `(` custom($hint) `)`|`memory_order` `(` custom($memory_order) `)`)$x `:` type($x) $region attr-dict" }, { "name": "omp.atomic.write", "summary": "performs an atomic write", "description": "This operation performs an atomic write.\n\n The operand `x` is the address to where the `expr` is atomically\n written w.r.t. multiple threads. The evaluation of `expr` need not be\n atomic w.r.t. the write to address. In general, the type(x) must\n dereference to type(expr).`hint` is the value of hint (as specified in the hint clause). It is a\n compile time constant. As the name suggests, this is just a hint for\n optimization.`memory_order` indicates the memory ordering behavior of the construct. It\n can be one of `seq_cst`, `acq_rel`, `release`, `acquire` or `relaxed`.", "operands": [ { "name": "x", "type": "OpenMP_PointerLikeType" }, { "name": "expr", "type": "AnyType" } ], "attributes": [ { "name": "hint", "type": "DefaultValuedOptionalAttr" }, { "name": "memory_order", "type": "OptionalAttr" } ], "assemblyFormat": "$x `=` $expr oilist(`hint` `(` custom($hint) `)`|`memory_order` `(` custom($memory_order) `)`) `:` type($x) `,` type($expr) attr-dict" }, { "name": "omp.barrier", "summary": "barrier construct", "description": "The barrier construct specifies an explicit barrier at the point at which\n the construct appears.", "assemblyFormat": "attr-dict" }, { "name": "omp.cancel", "summary": "cancel directive", "description": "The cancel construct activates cancellation of the innermost enclosing\n region of the type specified.", "operands": [ { "name": "if_expr", "type": "Optional" } ], "attributes": [ { "name": "cancel_directive", "type": "CancellationConstructTypeAttr" } ], "assemblyFormat": "`cancellation_construct_type` `(`\n custom($cancel_directive) `)` oilist(`if` `(` $if_expr `)`) attr-dict" }, { "name": "omp.cancellation_point", "summary": "cancellation point directive", "description": "The cancellation point construct introduces a user-defined cancellation\n point at which implicit or explicit tasks check if cancellation of the\n innermost enclosing region of the type specified has been activated.", "attributes": [ { "name": "cancel_directive", "type": "CancellationConstructTypeAttr" } ], "assemblyFormat": "`cancellation_construct_type` `(`\n custom($cancel_directive) `)` attr-dict" }, { "name": "omp.canonical_loop", "summary": "OpenMP Canonical Loop Operation", "description": "All loops that conform to OpenMP's definition of a canonical loop can be\n simplified to a CanonicalLoopOp. In particular, there are no loop-carried\n variables and the number of iterations it will execute is known before the\n operation. This allows e.g. to determine the number of threads and chunks\n the iterations space is split into before executing any iteration. More\n restrictions may apply in cases such as (collapsed) loop nests, doacross\n loops, etc.\n\n In contrast to other loop operations such as `scf.for`, the number of\n iterations is determined by only a single variable, the trip-count. The\n induction variable value is the logical iteration number of that iteration,\n which OpenMP defines to be between 0 and the trip-count (exclusive).\n Loop representation having lower-bound, upper-bound, and step-size operands,\n require passes to do more work than necessary, including handling special\n cases such as upper-bound smaller than lower-bound, upper-bound equal to\n the integer type's maximal value, negative step size, etc. This complexity\n is better only handled once by the front-end and can apply its semantics\n for such cases while still being able to represent any kind of loop, which\n kind of the point of a mid-end intermediate representation. User-defined\n types such as random-access iterators in C++ could not directly be\n represented anyway.\n\n The induction variable is always of the same type as the tripcount argument.\n Since it can never be negative, tripcount is always interpreted as an\n unsigned integer. It is the caller's responsibility to ensure the tripcount\n is not negative when its interpretation is signed, i.e.\n `%tripcount = max(0,%tripcount)`.\n\n An optional argument to a omp.canonical_loop that can be passed in\n is a CanonicalLoopInfo value that can be used to refer to the canonical\n loop to apply transformations -- such as tiling, unrolling, or\n work-sharing -- to the loop, similar to the transform dialect but\n with OpenMP-specific semantics. Because it is optional, it has to be the\n last of the operands, but appears first in the pretty format printing.\n\n The pretty assembly format is inspired by python syntax, where `range(n)`\n returns an iterator that runs from $0$ to $n-1$. The pretty assembly syntax\n is one of:\n\n omp.canonical_loop(%cli) %iv : !type in range(%tripcount)\n omp.canonical_loop %iv : !type in range(%tripcount)\n\n A CanonicalLoopOp is lowered to LLVM-IR using\n `OpenMPIRBuilder::createCanonicalLoop`.\n\n #### Examples\n\n Translation from lower-bound, upper-bound, step-size to trip-count.\n ```c\n for (int i = 3; i < 42; i+=2) {\n B[i] = A[i];\n }\n ```\n\n ```mlir\n %lb = arith.constant 3 : i32\n %ub = arith.constant 42 : i32\n %step = arith.constant 2 : i32\n %range = arith.sub %ub, %lb : i32\n %tripcount = arith.div %range, %step : i32\n omp.canonical_loop %iv : i32 in range(%tripcount) {\n %offset = arith.mul %iv, %step : i32\n %i = arith.add %offset, %lb : i32\n %a = load %arrA[%i] : memref\n store %a, %arrB[%i] : memref\n }\n ```\n\n Nested canonical loop with transformation of the inner loop.\n ```mlir\n %outer = omp.new_cli : !omp.cli\n %inner = omp.new_cli : !omp.cli\n omp.canonical_loop(%outer) %iv1 : i32 in range(%tc1) {\n omp.canonical_loop(%inner) %iv2 : i32 in range(%tc2) {\n %a = load %arrA[%iv1, %iv2] : memref\n store %a, %arrB[%iv1, %iv2] : memref\n }\n }\n omp.unroll_full(%inner)\n ```", "operands": [ { "name": "tripCount", "type": "IntLikeType" }, { "name": "cli", "type": "Optional" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "omp.critical", "summary": "critical construct", "description": "The critical construct imposes a restriction on the associated structured\n block (region) to be executed by only a single thread at a time.\n\n The optional `name` argument of critical constructs is used to identify\n them. Unnamed critical constructs behave as though an identical name was\n specified.", "attributes": [ { "name": "name", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "(`(` $name^ `)`)? $region attr-dict" }, { "name": "omp.critical.declare", "summary": "declares a named critical section.", "description": "Declares a named critical section.The `sym_name` can be used in `omp.critical` constructs in the dialect.`hint` is the value of hint (as specified in the hint clause). It is a\n compile time constant. As the name suggests, this is just a hint for\n optimization.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "hint", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$sym_name oilist(`hint` `(` custom($hint) `)`) attr-dict" }, { "name": "omp.declare_mapper", "summary": "declare mapper directive", "description": "The declare mapper directive declares a user-defined mapper for a given\n type, and defines a mapper-identifier that can be used in a map clause.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name `:` $type $body attr-dict" }, { "name": "omp.declare_mapper.info", "summary": "declare mapper info", "description": "This Op is used to capture the map information related to it's\n parent DeclareMapperOp.The optional `map_vars` maps data from the current task's data environment\n to the device data environment.\n\n The optional `map_iterated` holds iterator-produced handles (from\n `omp.iterator`) whose bodies create `omp.map.info` ops, specifying\n map entries expanded at runtime via an iterator modifier.", "operands": [ { "name": "map_vars", "type": "Variadic" }, { "name": "map_iterated", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(`map_entries` `(` $map_vars `:` type($map_vars) `)` |\n `map_iterated` `(` $map_iterated `:` type($map_iterated) `)`) attr-dict" }, { "name": "omp.declare_reduction", "summary": "declares a reduction kind", "description": "Declares an OpenMP reduction kind. This requires two mandatory and four\n optional regions.\n\n 1. The optional alloc region specifies how to allocate the thread-local\n reduction value. This region should not contain control flow and all\n IR should be suitable for inlining straight into an entry block. In\n the common case this is expected to contain only allocas. It is\n expected to `omp.yield` the allocated value on all control paths.\n If allocation is conditional (e.g. only allocate if the mold is\n allocated), this should be done in the initilizer region and this\n region not included. The alloc region is not used for by-value\n reductions (where allocation is implicit).\n 2. The initializer region specifies how to initialize the thread-local\n reduction value. This is usually the neutral element of the reduction.\n For convenience, the region has an argument that contains the value\n of the reduction accumulator at the start of the reduction. If an alloc\n region is specified, there is a second block argument containing the\n address of the allocated memory. The initializer region is expected to\n `omp.yield` the new value on all control flow paths.\n 3. The reduction region specifies how to combine two values into one, i.e.\n the reduction operator. It accepts the two values as arguments and is\n expected to `omp.yield` the combined value on all control flow paths.\n 4. The atomic reduction region is optional and specifies how two values\n can be combined atomically given local accumulator variables. It is\n expected to store the combined value in the first accumulator variable.\n 5. The cleanup region is optional and specifies how to clean up any memory\n allocated by the initializer region. The region has an argument that\n contains the value of the thread-local reduction accumulator. This will\n be executed after the reduction has completed.\n 6. The DataPtrPtr region specifies how to access the base address of a\n descriptor. This is used, in particular, for GPU reductions in order\n know where partial reduction results are stored in remote lanes.\n\n Note that the MLIR type system does not allow for type-polymorphic\n reductions. Separate reduction declarations should be created for different\n element and accumulator types.\n\n For initializer and reduction regions, the operand to `omp.yield` must\n match the parent operation's results.\n\n * `$byref_element_type`: For by-ref reductions, we want to keep track of the\n boxed/allocated type. For example, for a `real, allocatable` variable, \n `real` should be stored in this attribute.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "byref_element_type", "type": "OptionalAttr" } ], "regions": [ { "name": "allocRegion", "type": "MaxSizedRegion<1>" }, { "name": "initializerRegion", "type": "AnyRegion" }, { "name": "reductionRegion", "type": "AnyRegion" }, { "name": "atomicReductionRegion", "type": "AnyRegion" }, { "name": "cleanupRegion", "type": "AnyRegion" }, { "name": "dataPtrPtrRegion", "type": "MaxSizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name `:` $type attr-dict-with-keyword ( `alloc` $allocRegion^ )? `init` $initializerRegion `combiner` $reductionRegion ( `atomic` $atomicReductionRegion^ )? ( `cleanup` $cleanupRegion^ )? ( `data_ptr_ptr` $dataPtrPtrRegion^ )?" }, { "name": "omp.declare_simd", "summary": "declare simd directive", "description": "\"omp.declare_simd\" models the OpenMP `declare simd` directive.\n\n This is a declarative operation (no region) intended to appear inside\n a function body. It attaches clauses of declare simd to the enclosing\n function.\n\n Example:\n ```mlir\n func.func @add(%a: memref<16xi32>) {\n omp.declare_simd simdlen(8) aligned(%a : memref<16xi32> -> 64 : i64)\n ...\n }\n ```The `alignments` attribute additionally specifies alignment of each\n corresponding aligned operand. Note that `aligned_vars` and `alignments`\n must contain the same number of elements.The `inbranch` clause indicates that the generated SIMD function variant\n is intended for use in conditional branches.The `linear_step_vars` operand additionally specifies the step for each\n associated linear operand. Note that the `linear_vars` and\n `linear_step_vars` variadic lists should contain the same number of\n elements.\n\n The `linear_modifiers` attribute optionally specifies a per-variable\n linear-modifier: `val`, `ref`, or `uval`. When omitted, the default\n modifier is determined by the language semantics.The `notinbranch` clause indicates that the generated SIMD function variant\n is intended for use when not in conditional branches.When a `simdlen` clause is present, the preferred number of iterations to be\n executed concurrently is the value provided to the `simdlen` clause.The `uniform` clause declares one or more arguments to have an invariant\n value for all concurrent invocations of the function in the execution of\n a single SIMD loop.", "operands": [ { "name": "aligned_vars", "type": "Variadic" }, { "name": "linear_vars", "type": "Variadic" }, { "name": "linear_step_vars", "type": "Variadic" }, { "name": "uniform_vars", "type": "Variadic" } ], "attributes": [ { "name": "alignments", "type": "OptionalAttr>" }, { "name": "inbranch", "type": "UnitAttr" }, { "name": "linear_var_types", "type": "OptionalAttr" }, { "name": "linear_modifiers", "type": "OptionalAttr" }, { "name": "notinbranch", "type": "UnitAttr" }, { "name": "simdlen", "type": "ConfinedAttr, [IntPositive]>" } ], "assemblyFormat": "oilist(`aligned` `(` custom($aligned_vars, type($aligned_vars),\n $alignments) `)`|`inbranch` $inbranch|`linear` `(`\n custom($linear_vars, type($linear_vars),\n $linear_step_vars, type($linear_step_vars),\n $linear_modifiers) `)`|`notinbranch` $notinbranch|`simdlen` `(` $simdlen `)`|`uniform` `(` custom($uniform_vars, type($uniform_vars)) `)`) attr-dict" }, { "name": "omp.distribute", "summary": "distribute construct", "description": "The distribute construct specifies that the iterations of one or more loops\n (optionally specified using collapse clause) will be executed by the\n initial teams in the context of their implicit tasks. The loops that the\n distribute op is associated with starts with the outermost loop enclosed by\n the distribute op region and going down the loop nest toward the innermost\n loop. The iterations are distributed across the initial threads of all\n initial teams that execute the teams region to which the distribute region\n binds.\n\n The distribute loop construct specifies that the iterations of the loop(s)\n will be executed in parallel by threads in the current context. These\n iterations are spread across threads that already exist in the enclosing\n region.\n\n The body region can only contain a single block which must contain a single\n operation. This operation must be another compatible loop wrapper or an\n `omp.loop_nest`.\n\n ```mlir\n omp.distribute {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n ```The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `dist_schedule_static` attribute specifies the schedule for this loop,\n determining how the loop is distributed across the various teams. The\n optional `dist_schedule_chunk_size` associated with this determines further\n controls this distribution.The optional `order` attribute specifies which order the iterations of the\n associated loops are executed in. Currently the only option for this\n attribute is \"concurrent\".", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "dist_schedule_chunk_size", "type": "Optional" }, { "name": "private_vars", "type": "Variadic" } ], "attributes": [ { "name": "dist_schedule_static", "type": "UnitAttr" }, { "name": "order", "type": "OptionalAttr" }, { "name": "order_mod", "type": "OptionalAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`dist_schedule_static` $dist_schedule_static\n | `dist_schedule_chunk_size` `(` $dist_schedule_chunk_size `:`\n type($dist_schedule_chunk_size) `)`|`order` `(` custom($order, $order_mod) `)`)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier) attr-dict" }, { "name": "omp.flush", "summary": "flush construct", "description": "The flush construct executes the OpenMP flush operation. This operation\n makes a thread's temporary view of memory consistent with memory and\n enforces an order on the memory operations of the variables explicitly\n specified or implied.", "operands": [ { "name": "varList", "type": "Variadic" } ], "assemblyFormat": "( `(` $varList^ `:` type($varList) `)` )? attr-dict" }, { "name": "omp.free_shared_mem", "summary": "free shared memory", "description": "Deallocates shared memory that was previously allocated by an\n `omp.alloc_shared_mem` operation. After this operation, the deallocated\n memory is in an undefined state and should not be accessed.\n\n ```mlir\n // Example of allocating and freeing shared memory.\n %ptr_shared = omp.alloc_shared_mem %size x i32 : (i64) -> !llvm.ptr\n // ...\n omp.free_shared_mem [%size x i32 : (i64)] %ptr_shared : !llvm.ptr\n ```\n\n The `heapref` operand represents the pointer to shared memory to be\n deallocated, previously returned by `omp.alloc_shared_mem`.The `mem_elem_type` is the type of the object the memory allocation refers\n to. It is used to calculate the size of the allocation.\n\n The `mem_array_size` is the number of objects.\n\n The optional `mem_alignment` is used to specify the alignment for each\n element. If not set, the `DataLayout` defaults will be used instead.", "operands": [ { "name": "mem_array_size", "type": "AnySignlessInteger" }, { "name": "heapref", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "mem_elem_type", "type": "TypeAttr" }, { "name": "mem_alignment", "type": "ConfinedAttr, [IntPositive]>" } ], "assemblyFormat": "` ` `[`$mem_array_size `x` $mem_elem_type `:` `(` type($mem_array_size) `)` oilist(`align` `(` $mem_alignment `)`) `]` $heapref `:` type($heapref) attr-dict" }, { "name": "omp.fuse", "summary": "OpenMP fuse operation", "description": "Represents the OpenMP fuse directive introduced in OpenMP 6.0.\n \n The construct takes a loop sequence and merges the loops specifed by the\n `looprange` clause and generates a loop sequence with the loops before the\n `first` attribute untouched, the generated fused loop, and the loops after\n the the `first` + `count` attributes untouched mantaining the orignal\n order. If the `looprange` clause is not present all the loops in the\n sequence are fused generating a single loop.\n Each logical iteration of the fused loop executes a logical iteration of\n each affected loop. The fused loop has the number of logical iterations \n equal to the affected loop with most logical iterations.\n\n The `first` and `count` attributes of the `looprange` clause are constant\n and known beforehand if present.The `looprange` clause contains a range that represent the loops affected\n by a loop fusion. The `first` attribute is the first loop of the sequence\n that will be affected and the `count` attribute is the number of loops that\n are affected by the loop fusion.", "operands": [ { "name": "generatees", "type": "Variadic" }, { "name": "applyees", "type": "Variadic" } ], "attributes": [ { "name": "first", "type": "OptionalAttr" }, { "name": "count", "type": "OptionalAttr" } ], "assemblyFormat": "custom($generatees, $applyees)oilist(`looprange` `(` `first` `=` $first `,` `count` `=` $count `)`)attr-dict" }, { "name": "omp.groupprivate", "summary": "groupprivate directive", "description": "The groupprivate directive specifies that variables are replicated, with\n each group having its own copy.\n\n This operation takes a symbol reference to a global variable and returns\n the address of its groupprivate copy. The referenced symbol must exist and\n must not be a function.\n\n The optional `device_type` attribute specifies where the groupprivate\n storage should be allocated (host, nohost, or any).", "results": [ { "name": "gp_addr", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "sym_name", "type": "FlatSymbolRefAttr" }, { "name": "device_type", "type": "OptionalAttr" } ], "assemblyFormat": "$sym_name (`device_type` $device_type^)? `:` type($gp_addr) attr-dict" }, { "name": "omp.iterator", "summary": "OpenMP iterator modifier", "description": "The result of `omp.iterator` is an abstract handle of type\n `!omp.iterated`, representing the list of yielded values. This handle\n can be directly consumed by OpenMP clauses that accept iterator modifiers,\n such as `affinity`, `map`, `to`, `from`, or `depend`.\n\n Example:\n %it = omp.iterator(%i, %j) =\n (%lb_i to %ub_i step %st_i, %lb_j to %ub_j step %st_j) {\n %addr = ...\n omp.yield(%addr)\n } -> !omp.iterated", "operands": [ { "name": "loop_lower_bounds", "type": "Variadic" }, { "name": "loop_upper_bounds", "type": "Variadic" }, { "name": "loop_steps", "type": "Variadic" } ], "results": [ { "name": "iterated", "type": "OpenMP_IteratedType" } ], "attributes": [ { "name": "loop_inclusive", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` custom($region,\n $loop_lower_bounds, $loop_upper_bounds, $loop_steps,\n type($loop_lower_bounds), type($loop_upper_bounds), type($loop_steps))\n `->` qualified(type($iterated)) attr-dict" }, { "name": "omp.loop", "summary": "loop construct", "description": "A loop construct specifies that the logical iterations of the associated loops\n may execute concurrently and permits the encountering threads to execute the\n loop accordingly. A loop construct can have 3 different types of binding:\n 1. teams: in which case the binding region is the innermost enclosing `teams`\n region.\n 2. parallel: in which case the binding region is the innermost enclosing `parallel`\n region.\n 3. thread: in which case the binding region is not defined.\n\n The body region can only contain a single block which must contain a single\n operation, this operation must be an `omp.loop_nest`.\n\n ```\n omp.loop {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n ```The `bind` clause specifies the binding region of the construct on which it\n appears.The optional `order` attribute specifies which order the iterations of the\n associated loops are executed in. Currently the only option for this\n attribute is \"concurrent\".Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.", "operands": [ { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "bind_kind", "type": "OptionalAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "order", "type": "OptionalAttr" }, { "name": "order_mod", "type": "OptionalAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`bind` `(` custom($bind_kind) `)`|`order` `(` custom($order, $order_mod) `)`)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.loop_nest", "summary": "rectangular loop nest", "description": "This operation represents a rectangular loop nest which may be collapsed\n and/or tiled. For each rectangular loop of the nest represented by an\n instance of this operation, lower and upper bounds, as well as a step\n variable, must be defined. The collapse clause specifies how many loops\n that should be collapsed (1 if no collapse is done) after any tiling is\n performed. The tiling sizes is represented by the tile sizes clause.\n\n The lower and upper bounds specify a half-open range: the range includes the\n lower bound but does not include the upper bound. If the `loop_inclusive`\n attribute is specified then the upper bound is also included.\n\n The body region can contain any number of blocks. The region is terminated\n by an `omp.yield` instruction without operands. The induction variables,\n represented as entry block arguments to the loop nest operation's single\n region, match the types of the `loop_lower_bounds`, `loop_upper_bounds` and\n `loop_steps` arguments.\n\n ```mlir\n omp.loop_nest (%i1, %i2) : i32 = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) collapse(2) tiles(5,5) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n ```\n\n This is a temporary simplified definition of a loop based on existing OpenMP\n loop operations intended to serve as a stopgap solution until the long-term\n representation of canonical loops is defined. Specifically, this operation\n is intended to serve as a unique source for loop information during the\n transition to making `omp.distribute`, `omp.simd`, `omp.taskloop.wrapper` and\n `omp.wsloop` wrapper operations. It is not intended to help with the\n addition of support for loop transformations, non-rectangular loops and\n non-perfectly nested loops.", "operands": [ { "name": "loop_lower_bounds", "type": "Variadic" }, { "name": "loop_upper_bounds", "type": "Variadic" }, { "name": "loop_steps", "type": "Variadic" } ], "attributes": [ { "name": "collapse_num_loops", "type": "ConfinedAttr, [IntMinValue<1>]>" }, { "name": "loop_inclusive", "type": "UnitAttr" }, { "name": "tile_sizes", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "omp.map.bounds", "summary": "Represents normalized bounds information for map clauses.", "description": "This operation is a variation on the OpenACC dialects DataBoundsOp. Within\n the OpenMP dialect it stores the bounds/range of data to be mapped to a\n device specified by map clauses on target directives. Within\n the OpenMP dialect, the MapBoundsOp is associated with MapInfoOp,\n helping to store bounds information for the mapped variable.\n\n It is used to support OpenMP array sectioning, Fortran pointer and\n allocatable mapping and pointer/allocatable member of derived types.\n In all cases the MapBoundsOp holds information on the section of\n data to be mapped. Such as the upper bound and lower bound of the\n section of data to be mapped. This information is currently\n utilised by the LLVM-IR lowering to help generate instructions to\n copy data to and from the device when processing target operations.\n\n The example below copys a section of a 10-element array; all except the\n first element, utilising OpenMP array sectioning syntax where array\n subscripts are provided to specify the bounds to be mapped to device.\n To simplify the examples, the constants are used directly, in reality\n they will be MLIR SSA values.\n\n C++:\n ```\n int array[10];\n #pragma target map(array[1:9])\n ```\n =>\n ```mlir\n omp.map.bounds lower_bound(1) upper_bound(9) extent(9) start_idx(0)\n ```\n\n Fortran:\n ```\n integer :: array(1:10)\n !$target map(array(2:10))\n ```\n =>\n ```mlir\n omp.map.bounds lower_bound(1) upper_bound(9) extent(9) start_idx(1)\n ```\n\n For Fortran pointers and allocatables (as well as those that are\n members of derived types) the bounds information is provided by\n the Fortran compiler and runtime through descriptor information.\n\n A basic pointer example can be found below (constants again\n provided for simplicity, where in reality SSA values will be\n used, in this case that point to data yielded by Fortran's\n descriptors):\n\n Fortran:\n ```\n integer, pointer :: ptr(:)\n allocate(ptr(10))\n !$target map(ptr)\n ```\n =>\n ```mlir\n omp.map.bounds lower_bound(0) upper_bound(9) extent(10) start_idx(1)\n ```\n\n This operation records the bounds information in a normalized fashion\n (zero-based). This works well with the `PointerLikeType`\n requirement in data clauses - since a `lower_bound` of 0 means looking\n at data at the zero offset from pointer.\n\n This operation must have an `upper_bound` or `extent` (or both are allowed -\n but not checked for consistency). When the source language's arrays are\n not zero-based, the `start_idx` must specify the zero-position index.", "operands": [ { "name": "lower_bound", "type": "Optional" }, { "name": "upper_bound", "type": "Optional" }, { "name": "extent", "type": "Optional" }, { "name": "stride", "type": "Optional" }, { "name": "start_idx", "type": "Optional" } ], "results": [ { "name": "result", "type": "OpenMP_MapBoundsType" } ], "attributes": [ { "name": "stride_in_bytes", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(\n `lower_bound` `(` $lower_bound `:` type($lower_bound) `)`\n | `upper_bound` `(` $upper_bound `:` type($upper_bound) `)`\n | `extent` `(` $extent `:` type($extent) `)`\n | `stride` `(` $stride `:` type($stride) `)`\n | `start_idx` `(` $start_idx `:` type($start_idx) `)`\n ) attr-dict" }, { "name": "omp.map.info", "description": "The MapInfoOp captures information relating to individual OpenMP map clauses\n that are applied to certain OpenMP directives such as Target and Target Data.\n\n For example, the map type modifier; such as from, tofrom and to, the variable\n being captured or the bounds of an array section being mapped.\n\n It can be used to capture both implicit and explicit map information, where\n explicit is an argument directly specified to an OpenMP map clause or implicit\n where a variable is utilised in a target region but is defined externally to\n the target region.\n\n This map information is later used to aid the lowering of the target operations\n they are attached to providing argument input and output context for kernels\n generated or the target data mapping environment.\n\n Example (Fortran):\n\n ```\n integer :: index\n !$target map(to: index)\n ```\n =>\n ```mlir\n omp.map.info var_ptr(%index_ssa : ref, i32) map_type(to) map_capture_type(ByRef)\n name(index)\n ```\n\n Description of arguments:\n - `var_ptr`: The address of variable to copy.\n - `var_ptr_type`: The type of the variable (`var_ptr`) to copy.\n - 'map_type': OpenMP map type for this map capture, for example: from, to and\n always. It's a bitfield composed of the OpenMP runtime flags stored in\n OpenMPOffloadMappingFlags.\n - 'map_capture_type': Capture type for the variable e.g. this, byref, byvalue, byvla\n this can affect how the variable is lowered.\n - `var_ptr_ptr`: Used when the variable being copied is a fortran, C or C++ pointer,\n with this field referring to the base address of the pointer. If the `var_ptr_ptr`\n field is present, a corresponding `var_ptr_ptr_type` must also be present.\n - `var_ptr_ptr_type`: Used when the variable being copied is a fortran, C or\n C++ pointer, with this field referring to the underlying type of the pointed\n to data. If the `var_ptr_ptr_type` field is present, a corresponding `var_ptr_ptr`\n must also be present.\n - `members`: Used to indicate mapped child members for the current MapInfoOp,\n represented as other MapInfoOp's, utilised in cases where a parent structure\n type and members of the structure type are being mapped at the same time.\n For example: map(to: parent, parent->member, parent->member2[:10])\n - `members_index`: Used to indicate the ordering of members within the containing\n parent (generally a record type such as a structure, class or derived type),\n e.g. struct {int x, float y, double z}, x would be 0, y would be 1, and z\n would be 2. This aids the mapping.\n - `bounds`: Used when copying slices of array's, pointers or pointer members of\n objects (e.g. derived types or classes), indicates the bounds to be copied\n of the variable. When it's an array slice it is in rank order where rank 0\n is the inner-most dimension.\n - 'mapper_id': OpenMP mapper map type modifier for this map capture. It's used to\n specify a user defined mapper to be used for mapping.\n - `name`: Holds the name of variable as specified in user clause (including bounds).\n - `partial_map`: The record type being mapped will not be mapped in its entirety,\n it may be used however, in a mapping to bind it's mapped components together.", "operands": [ { "name": "var_ptr", "type": "OpenMP_PointerLikeType" }, { "name": "var_ptr_ptr", "type": "Optional" }, { "name": "members", "type": "Variadic" }, { "name": "bounds", "type": "Variadic" } ], "results": [ { "name": "omp_ptr", "type": "OpenMP_PointerLikeType" } ], "attributes": [ { "name": "var_ptr_type", "type": "TypeAttr" }, { "name": "map_type", "type": "ClauseMapFlagsAttr{none|storage|to|from|always|del|return_param|priv|literal|implicit|close|present|ompx_hold|attach|attach_always|attach_never|attach_auto|ref_ptr|ref_ptee|is_device_ptr}" }, { "name": "map_capture_type", "type": "VariableCaptureKindAttr{This|ByRef|ByCopy|VLAType}" }, { "name": "var_ptr_ptr_type", "type": "OptionalAttr" }, { "name": "members_index", "type": "OptionalAttr>>" }, { "name": "mapper_id", "type": "OptionalAttr" }, { "name": "name", "type": "OptionalAttr" }, { "name": "partial_map", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`var_ptr` `(` $var_ptr `:` type($var_ptr) `,` $var_ptr_type `)`\n `map_clauses` `(` custom($map_type) `)`\n `capture` `(` custom($map_capture_type) `)`\n oilist(\n `var_ptr_ptr` `(` $var_ptr_ptr `:` type($var_ptr_ptr) `,` $var_ptr_ptr_type`)`\n | `mapper` `(` $mapper_id `)`\n | `members` `(` $members `:` custom($members_index) `:` type($members) `)`\n | `bounds` `(` $bounds `)`\n ) `->` type($omp_ptr) attr-dict" }, { "name": "omp.masked", "summary": "masked construct", "description": "Masked construct allows to specify a structured block to be executed by a subset of\n threads of the current team.If `filter` is specified, the masked construct masks the execution of\n the region to only the thread id filtered. Other threads executing the\n parallel region are not expected to execute the region specified within\n the `masked` directive. If `filter` is not specified, master thread is\n expected to execute the region enclosed within `masked` directive.", "operands": [ { "name": "filtered_thread_id", "type": "Optional" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`filter` `(` $filtered_thread_id `:` type($filtered_thread_id) `)`) $region attr-dict" }, { "name": "omp.master", "summary": "master construct", "description": "The master construct specifies a structured block that is executed by\n the master thread of the team.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "omp.new_cli", "summary": "Create a new Canonical Loop Info value.", "description": "Create a new CLI that can be passed as an argument to a CanonicalLoopOp\n and to loop transformation operations to handle dependencies between\n loop transformation operations.", "results": [ { "name": "result", "type": "CanonicalLoopInfoType" } ], "assemblyFormat": "attr-dict" }, { "name": "omp.ordered", "summary": "ordered construct without region", "description": "The ordered construct without region is a stand-alone directive that\n specifies cross-iteration dependencies in a doacross loop nest.The `doacross_depend_type` attribute refers to either the DEPEND(SOURCE)\n clause or the DEPEND(SINK: vec) clause.\n\n The `doacross_num_loops` attribute specifies the number of loops in the\n doacross nest.\n\n The `doacross_depend_vars` is a variadic list of operands that specifies the\n index of the loop iterator in the doacross nest for the DEPEND(SOURCE)\n clause or the index of the element of \"vec\" for the DEPEND(SINK: vec)\n clause. It contains the operands in multiple \"vec\" when multiple\n DEPEND(SINK: vec) clauses exist in one ORDERED directive.", "operands": [ { "name": "doacross_depend_vars", "type": "Variadic" } ], "attributes": [ { "name": "doacross_depend_type", "type": "OptionalAttr" }, { "name": "doacross_num_loops", "type": "ConfinedAttr, [IntMinValue<0>]>" } ], "assemblyFormat": "( `depend_type` `` $doacross_depend_type^ )?\n ( `depend_vec` `(` $doacross_depend_vars^ `:` type($doacross_depend_vars)\n `)` )? attr-dict" }, { "name": "omp.ordered.region", "summary": "ordered construct with region", "description": "The ordered construct with region specifies a structured block in a\n worksharing-loop, SIMD, or worksharing-loop SIMD region that is executed in\n the order of the loop iterations.The `par_level_simd` attribute corresponds to the simd clause specified. If\n it is not present, it behaves as if the threads clause is specified or no\n clause is specified.", "attributes": [ { "name": "par_level_simd", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`par_level_simd` $par_level_simd) $region attr-dict" }, { "name": "omp.parallel", "summary": "parallel construct", "description": "The parallel construct includes a region of code which is to be executed\n by a team of threads.\n\n The optional `if_expr` parameter specifies a boolean result of a conditional\n check. If this value is 1 or is not provided then the parallel region runs\n as normal, if it is 0 then the parallel region is executed with one thread.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `num_threads` clause specifies the number of threads.\n\n Multi-dimensional format (dims modifier):\n - Multiple values can be specified for multi-dimensional thread counts.\n - The number of dimensions is derived from the number of values.\n - Values can have different integer types.\n - Format: `num_threads(%v1, %v2, ... : type1, type2, ...)`\n - Example: `num_threads(%n, %m : i32, i64)`\n\n Single value format:\n - A single value specifies the number of threads.\n - Format: `num_threads(%value : type)`\n - Example: `num_threads(%n : i32)`The optional `proc_bind_kind` attribute controls the thread affinity for the\n execution of the parallel region.Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "if_expr", "type": "Optional" }, { "name": "num_threads_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "proc_bind_kind", "type": "OptionalAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`if` `(` $if_expr `)`|`num_threads` `(` $num_threads_vars `:` type($num_threads_vars) `)`|`proc_bind` `(` custom($proc_bind_kind) `)`)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.private", "summary": "Provides declaration of [first]private logic.", "description": "This operation provides a declaration of how to implement the\n [first]privatization of a variable. The dialect users should provide\n which type should be allocated for this variable. The allocated (usually by\n alloca) variable is passed to the initialization region which does everything\n else (e.g. initialization of Fortran runtime descriptors). Information about\n how to initialize the copy from the original item should be given in the\n copy region, and if needed, how to deallocate memory (allocated by the\n initialization region) in the dealloc region.\n\n Examples:\n\n * `private(x)` would not need any regions because no initialization is\n required by the standard for i32 variables and this is not firstprivate.\n ```mlir\n omp.private {type = private} @x.privatizer : i32\n ```\n\n * `firstprivate(x)` would be emitted as:\n ```mlir\n omp.private {type = firstprivate} @x.privatizer : i32 copy {\n ^bb0(%arg0: !fir.ref, %arg1: !fir.ref):\n // %arg0 is the original host variable.\n // %arg1 represents the memory allocated for this private variable.\n ... copy from host to the privatized clone ....\n omp.yield(%arg1 : !fir.ref)\n }\n ```\n\n * `private(x)` for \"allocatables\" would be emitted as:\n ```mlir\n omp.private {type = private} @x.privatizer : !some.type init {\n ^bb0(%arg0: !some.pointer, %arg1: !some.pointer):\n // initialize %arg1, using %arg0 as a mold for allocations.\n // For example if %arg0 is a heap allocated array with a runtime determined\n // length and !some.type is a runtime type descriptor, the init region\n // will read the array length from %arg0, and heap allocate an array of the\n // right length and initialize %arg1 to contain the array allocation and\n // length.\n omp.yield(%arg1 : !some.pointer)\n } dealloc {\n ^bb0(%arg0: !some.pointer):\n // ... deallocate memory allocated by the init region...\n // In the example above, this will free the heap allocated array data.\n omp.yield\n }\n ```\n\n There are no restrictions on the body except for:\n - The `dealloc` regions has a single argument.\n - The `init` & `copy` regions have 2 arguments.\n - All three regions are terminated by `omp.yield` ops.\n The above restrictions and other obvious restrictions (e.g. verifying the\n type of yielded values) are verified by the custom op verifier. The actual\n contents of the blocks inside all regions are not verified.\n\n Instances of this op would then be used by ops that model directives that\n accept data-sharing attribute clauses.\n\n The `sym_name` attribute provides a symbol by which the privatizer op can be\n referenced by other dialect ops.\n\n The `type` attribute is the type of the value being privatized. This type\n will be implicitly allocated in MLIR->LLVMIR conversion and passed as the\n second argument to the init region. Therefore the type of arguments to\n the regions should be a type which represents a pointer to `type`.\n\n The `data_sharing_type` attribute specifies whether privatizer corresponds\n to a `private` or a `firstprivate` clause.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttrOf" }, { "name": "data_sharing_type", "type": "DataSharingClauseTypeAttr{private|firstprivate}" } ], "regions": [ { "name": "init_region", "type": "AnyRegion" }, { "name": "copy_region", "type": "AnyRegion" }, { "name": "dealloc_region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$data_sharing_type $sym_name `:` $type\n (`init` $init_region^)?\n (`copy` $copy_region^)?\n (`dealloc` $dealloc_region^)?\n attr-dict" }, { "name": "omp.scan", "summary": "scan directive", "description": "The scan directive allows to specify scan reductions. It should be\n enclosed within a parent directive along with which a reduction clause\n with `inscan` modifier must be specified. The scan directive allows to\n split code blocks into input phase and scan phase in the region\n enclosed by the parent.The inclusive clause is used on a separating directive that separates a\n structured block into two structured block sequences. If it is specified,\n the input phase includes the preceding structured block sequence and the\n scan phase includes the following structured block sequence.\n\n The `inclusive_vars` is a variadic list of operands that specifies the\n scan-reduction accumulator symbols.The exclusive clause is used on a separating directive that separates a\n structured block into two structured block sequences. If it\n is specified, the input phase excludes the preceding structured block \n sequence and instead includes the following structured block sequence, \n while the scan phase includes the preceding structured block sequence.\n\n The `exclusive_vars` is a variadic list of operands that specifies the\n scan-reduction accumulator symbols.", "operands": [ { "name": "inclusive_vars", "type": "Variadic" }, { "name": "exclusive_vars", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist(`inclusive` `(` $inclusive_vars `:` type($inclusive_vars) `)`|`exclusive` `(` $exclusive_vars `:` type($exclusive_vars) `)`) attr-dict" }, { "name": "omp.scope", "summary": "scope directive", "description": "The scope construct defines a structured block that is executed by all\n threads in the current team, providing a lexical scope for\n privatization. An implicit barrier occurs at the end of the region\n unless the `nowait` clause is present.\n\n Introduced in OpenMP 5.1.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "nowait", "type": "UnitAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`nowait` $nowait)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.section", "summary": "section directive", "description": "A section operation encloses a region which represents one section in a\n sections construct. A section op should always be surrounded by an\n `omp.sections` operation. The section operation may have block args\n which corespond to the block arguments of the surrounding `omp.sections`\n operation. This is done to reflect situations where these block arguments\n represent variables private to each section.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "omp.sections", "summary": "sections construct", "description": "The sections construct is a non-iterative worksharing construct that\n contains `omp.section` operations. The `omp.section` operations are to be\n distributed among and executed by the threads in a team. Each `omp.section`\n is executed once by one of the threads in the team in the context of its\n implicit task.\n Block arguments for reduction variables should be mirrored in enclosed\n `omp.section` operations.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "nowait", "type": "UnitAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`nowait` $nowait)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.simd", "summary": "simd construct", "description": "The simd construct can be applied to a loop to indicate that the loop can be\n transformed into a SIMD loop (that is, multiple iterations of the loop can\n be executed concurrently using SIMD instructions).\n\n The body region can only contain a single block which must contain a single\n operation. This operation must be another compatible loop wrapper or an\n `omp.loop_nest`.\n\n ```\n omp.simd {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n ```\n\n When an if clause is present and evaluates to false, the preferred number of\n iterations to be executed concurrently is one, regardless of whether\n a simdlen clause is specified.The `alignments` attribute additionally specifies alignment of each\n corresponding aligned operand. Note that `aligned_vars` and `alignments`\n must contain the same number of elements.The `linear_step_vars` operand additionally specifies the step for each\n associated linear operand. Note that the `linear_vars` and\n `linear_step_vars` variadic lists should contain the same number of\n elements.\n\n The `linear_modifiers` attribute optionally specifies a per-variable\n linear-modifier: `val`, `ref`, or `uval`. When omitted, the default\n modifier is determined by the language semantics.The optional `nontemporal` attribute specifies variables which have low\n temporal locality across the iterations where they are accessed.The optional `order` attribute specifies which order the iterations of the\n associated loops are executed in. Currently the only option for this\n attribute is \"concurrent\".Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.The `safelen` clause specifies that no two concurrent iterations within a\n SIMD chunk can have a distance in the logical iteration space that is\n greater than or equal to the value given in the clause.When a `simdlen` clause is present, the preferred number of iterations to be\n executed concurrently is the value provided to the `simdlen` clause.", "operands": [ { "name": "aligned_vars", "type": "Variadic" }, { "name": "if_expr", "type": "Optional" }, { "name": "linear_vars", "type": "Variadic" }, { "name": "linear_step_vars", "type": "Variadic" }, { "name": "nontemporal_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "alignments", "type": "OptionalAttr>" }, { "name": "linear_var_types", "type": "OptionalAttr" }, { "name": "linear_modifiers", "type": "OptionalAttr" }, { "name": "order", "type": "OptionalAttr" }, { "name": "order_mod", "type": "OptionalAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" }, { "name": "safelen", "type": "ConfinedAttr, [IntPositive]>" }, { "name": "simdlen", "type": "ConfinedAttr, [IntPositive]>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`aligned` `(` custom($aligned_vars, type($aligned_vars),\n $alignments) `)`|`if` `(` $if_expr `)`|`linear` `(`\n custom($linear_vars, type($linear_vars),\n $linear_step_vars, type($linear_step_vars),\n $linear_modifiers) `)`|`nontemporal` `(` $nontemporal_vars `:` type($nontemporal_vars) `)`|`order` `(` custom($order, $order_mod) `)`|`safelen` `(` $safelen `)`|`simdlen` `(` $simdlen `)`)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.single", "summary": "single directive", "description": "The single construct specifies that the associated structured block is\n executed by only one of the threads in the team (not necessarily the\n master thread), in the context of its implicit task. The other threads\n in the team, which do not execute the block, wait at an implicit barrier\n at the end of the single construct.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.If `copyprivate` variables and functions are specified, then each thread\n variable is updated with the variable value of the thread that executed\n the single region, using the specified copy functions.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "copyprivate_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" } ], "attributes": [ { "name": "copyprivate_syms", "type": "OptionalAttr>" }, { "name": "nowait", "type": "UnitAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`copyprivate` `(`\n custom($copyprivate_vars, type($copyprivate_vars),\n $copyprivate_syms) `)`|`nowait` $nowait)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier) attr-dict" }, { "name": "omp.target", "summary": "target construct", "description": "The target construct includes a region of code which is to be executed\n on a device.\n\n The optional `if_expr` parameter specifies a boolean result of a conditional\n check. If this value is 1 or is not provided then the target region runs on\n a device, if it is 0 then the target region is executed on the host device.\n\n The `private_maps` attribute connects `private` operands to their corresponding\n `map` operands. For `private` operands that require a map, the value of the\n corresponding element in the attribute is the index of the `map` operand\n (relative to other `map` operands not the whole operands of the operation). For\n `private` opernads that do not require a map, this value is -1 (which is omitted\n from the assembly foramt printing).\n\n The `kernel_type` required attribute reflects how the target region must be\n executed, according to the OpenMP construct that it represents. Most\n commonly, `spmd` is used to represent `target teams distribute parallel\n do/for` or semantically equivalent constructs and `generic` is used for\n everything else. `spmd_no_loop` is an optimization of `spmd` mode use for\n the same kinds of constructs, and `bare` is used to implement the\n `ompx_bare` extension to `target teams` constructs.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `depend_kinds` and `depend_vars` arguments are variadic lists of values\n that specify the dependencies of this particular task in relation to other\n tasks.\n\n The `depend_iterated_kinds` and `depend_iterated` arguments are variadic\n lists of iterator-produced handles (from `omp.iterator`) that specify\n dependencies expanded at runtime via an iterator modifier.The optional `device` parameter specifies the device number for the target\n region.The `dyn_groupprivate_access_group` attribute specifies the access group\n modifier for the dynamically allocated group-private memory. The\n `dyn_groupprivate_fallback` attribute specifies the fallback behavior when\n allocation fails. The `dyn_groupprivate_size` operand specifies the size in\n bytes to allocate.The optional `has_device_addr_vars` indicates that list items already have\n device addresses, so they may be directly accessed from the target device.\n This includes array sections.The optional `host_eval_vars` holds values defined outside of the region of\n the `IsolatedFromAbove` operation for which a corresponding entry block\n argument is defined. The only legal uses for these captured values are the\n following:\n - `num_teams` or `thread_limit` clause of an immediately nested\n `omp.teams` operation.\n - If the operation is the top-level `omp.target` of a target SPMD kernel:\n - `num_threads` clause of the nested `omp.parallel` operation.\n - Bounds and steps of the nested `omp.loop_nest` operation.The optional `is_device_ptr_vars` indicates list items are device pointers.The optional `map_vars` maps data from the current task's data environment\n to the device data environment.\n\n The optional `map_iterated` holds iterator-produced handles (from\n `omp.iterator`) whose bodies create `omp.map.info` ops, specifying\n map entries expanded at runtime via an iterator modifier.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.The `thread_limit` clause specifies the limit on the number of threads.\n\n Multi-dimensional format (dims modifier):\n - Multiple values can be specified for multi-dimensional thread limits.\n - The number of dimensions is derived from the number of values.\n - Values can have different integer types.\n - Format: `thread_limit(%v1, %v2, ... : type1, type2, ...)`\n - Example: `thread_limit(%n, %m : i32, i64)`\n\n Single value format:\n - A single value specifies the thread limit.\n - Format: `thread_limit(%value : type)`\n - Example: `thread_limit(%n : i32)`", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "depend_vars", "type": "Variadic" }, { "name": "depend_iterated", "type": "Variadic" }, { "name": "device", "type": "Optional" }, { "name": "dyn_groupprivate_size", "type": "Optional" }, { "name": "has_device_addr_vars", "type": "Variadic" }, { "name": "host_eval_vars", "type": "Variadic" }, { "name": "if_expr", "type": "Optional" }, { "name": "in_reduction_vars", "type": "Variadic" }, { "name": "is_device_ptr_vars", "type": "Variadic" }, { "name": "map_vars", "type": "Variadic" }, { "name": "map_iterated", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "thread_limit_vars", "type": "Variadic" } ], "attributes": [ { "name": "depend_kinds", "type": "OptionalAttr>" }, { "name": "depend_iterated_kinds", "type": "OptionalAttr>" }, { "name": "dyn_groupprivate_access_group", "type": "OptionalAttr" }, { "name": "dyn_groupprivate_fallback", "type": "OptionalAttr" }, { "name": "in_reduction_byref", "type": "OptionalAttr" }, { "name": "in_reduction_syms", "type": "OptionalAttr>" }, { "name": "nowait", "type": "UnitAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "private_maps", "type": "OptionalAttr" }, { "name": "kernel_type", "type": "TargetExecModeAttr{bare|generic|spmd|spmd_no_loop}" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`kernel_type` `` $kernel_type oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`depend` `(`\n custom($depend_vars, type($depend_vars), $depend_kinds,\n $depend_iterated, type($depend_iterated),\n $depend_iterated_kinds) `)`|`device` `(` $device `:` type($device) `)`|`dyn_groupprivate` `(`\n custom($dyn_groupprivate_access_group,\n $dyn_groupprivate_fallback,\n $dyn_groupprivate_size, type($dyn_groupprivate_size))\n `)`|`if` `(` $if_expr `)`|`is_device_ptr` `(` $is_device_ptr_vars `:` type($is_device_ptr_vars) `)`|`nowait` $nowait|`thread_limit` `(` $thread_limit_vars `:` type($thread_limit_vars) `)` | `map_iterated` `(` $map_iterated `:` type($map_iterated) `)`)custom(\n $region, $has_device_addr_vars, type($has_device_addr_vars),\n $host_eval_vars, type($host_eval_vars), $in_reduction_vars,\n type($in_reduction_vars), $in_reduction_byref, $in_reduction_syms,\n $map_vars, type($map_vars), $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $private_maps) attr-dict" }, { "name": "omp.target_allocmem", "summary": "allocate storage on an openmp device for an object of a given type", "description": "Allocates memory on the specified OpenMP device for an object of the given\n type. Returns an integer value representing the device pointer to the\n allocated memory. The memory is uninitialized after allocation. Operations\n must be paired with `omp.target_freemem` to avoid memory leaks.\n\n ```mlir\n // Allocate a static 3x3 integer vector on device 0\n %device_0 = arith.constant 0 : i32\n %ptr_static = omp.target_allocmem %device_0 : i32, vector<3x3xi32>\n // ... use %ptr_static ...\n omp.target_freemem %device_0, %ptr_static : i32, i64\n\n // Allocate a dynamic 2D Fortran array (fir.array) on device 1\n %device_1 = arith.constant 1 : i32\n %rows = arith.constant 10 : index\n %cols = arith.constant 20 : index\n %ptr_dynamic = omp.target_allocmem %device_1 : i32, !fir.array, %rows, %cols : index, index\n // ... use %ptr_dynamic ...\n omp.target_freemem %device_1, %ptr_dynamic : i32, i64\n ```\n\n The `device` is an integer ID of the OpenMP device where the memory will be\n allocated.The `in_type` is the type of the object for which memory is being allocated.\n For arrays, this can be a static or dynamic array type.\n\n The optional `uniq_name` is a unique name for the allocated memory.\n\n The optional `bindc_name` is a name used for C interoperability.\n\n The `typeparams` are runtime type parameters for polymorphic or\n parameterized types. These are typically integer values that define aspects\n of a type not fixed at compile time.\n\n The `shape` holds runtime shape operands for dynamic arrays. Each operand is\n an integer value representing the extent of a specific dimension.", "operands": [ { "name": "device", "type": "AnyInteger" }, { "name": "typeparams", "type": "Variadic" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I64" } ], "attributes": [ { "name": "in_type", "type": "TypeAttr" }, { "name": "uniq_name", "type": "OptionalAttr" }, { "name": "bindc_name", "type": "OptionalAttr" } ], "assemblyFormat": "$device `:` type($device) `,` custom($in_type, $typeparams, type($typeparams), $shape,\n type($shape)) attr-dict" }, { "name": "omp.target_data", "summary": "target data construct", "description": "Map variables to a device data environment for the extent of the region.\n\n The omp target data directive maps variables to a device data\n environment, and defines the lexical scope of the data environment\n that is created. The omp target data directive can reduce data copies\n to and from the offloading device when multiple target regions are using\n the same data.\n\n The optional `if_expr` parameter specifies a boolean result of a conditional\n check. If this value is 1 or is not provided then the target region runs on\n a device, if it is 0 then the target region is executed on the host device.The optional `device` parameter specifies the device number for the target\n region.The optional `map_vars` maps data from the current task's data environment\n to the device data environment.\n\n The optional `map_iterated` holds iterator-produced handles (from\n `omp.iterator`) whose bodies create `omp.map.info` ops, specifying\n map entries expanded at runtime via an iterator modifier.The optional `use_device_addr_vars` specifies the address of the objects in\n the device data environment.The optional `use_device_ptr_vars` specifies the device pointers to the\n corresponding list items in the device data environment.", "operands": [ { "name": "device", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "map_vars", "type": "Variadic" }, { "name": "map_iterated", "type": "Variadic" }, { "name": "use_device_addr_vars", "type": "Variadic" }, { "name": "use_device_ptr_vars", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`device` `(` $device `:` type($device) `)`|`if` `(` $if_expr `)`|`map_entries` `(` $map_vars `:` type($map_vars) `)` |\n `map_iterated` `(` $map_iterated `:` type($map_iterated) `)`)custom(\n $region, $use_device_addr_vars, type($use_device_addr_vars),\n $use_device_ptr_vars, type($use_device_ptr_vars)) attr-dict" }, { "name": "omp.target_enter_data", "summary": "target enter data construct", "description": "The target enter data directive specifies that variables are mapped to\n a device data environment. The target enter data directive is a\n stand-alone directive.\n\n The optional `if_expr` parameter specifies a boolean result of a conditional\n check. If this value is 1 or is not provided then the target region runs on\n a device, if it is 0 then the target region is executed on the host device.The `depend_kinds` and `depend_vars` arguments are variadic lists of values\n that specify the dependencies of this particular task in relation to other\n tasks.\n\n The `depend_iterated_kinds` and `depend_iterated` arguments are variadic\n lists of iterator-produced handles (from `omp.iterator`) that specify\n dependencies expanded at runtime via an iterator modifier.The optional `device` parameter specifies the device number for the target\n region.The optional `map_vars` maps data from the current task's data environment\n to the device data environment.\n\n The optional `map_iterated` holds iterator-produced handles (from\n `omp.iterator`) whose bodies create `omp.map.info` ops, specifying\n map entries expanded at runtime via an iterator modifier.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.", "operands": [ { "name": "depend_vars", "type": "Variadic" }, { "name": "depend_iterated", "type": "Variadic" }, { "name": "device", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "map_vars", "type": "Variadic" }, { "name": "map_iterated", "type": "Variadic" } ], "attributes": [ { "name": "depend_kinds", "type": "OptionalAttr>" }, { "name": "depend_iterated_kinds", "type": "OptionalAttr>" }, { "name": "nowait", "type": "UnitAttr" } ], "assemblyFormat": "oilist(`depend` `(`\n custom($depend_vars, type($depend_vars), $depend_kinds,\n $depend_iterated, type($depend_iterated),\n $depend_iterated_kinds) `)`|`device` `(` $device `:` type($device) `)`|`if` `(` $if_expr `)`|`map_entries` `(` $map_vars `:` type($map_vars) `)` |\n `map_iterated` `(` $map_iterated `:` type($map_iterated) `)`|`nowait` $nowait) attr-dict" }, { "name": "omp.target_exit_data", "summary": "target exit data construct", "description": "The target exit data directive specifies that variables are mapped to a\n device data environment. The target exit data directive is\n a stand-alone directive.\n\n The optional `if_expr` parameter specifies a boolean result of a conditional\n check. If this value is 1 or is not provided then the target region runs on\n a device, if it is 0 then the target region is executed on the host device.The `depend_kinds` and `depend_vars` arguments are variadic lists of values\n that specify the dependencies of this particular task in relation to other\n tasks.\n\n The `depend_iterated_kinds` and `depend_iterated` arguments are variadic\n lists of iterator-produced handles (from `omp.iterator`) that specify\n dependencies expanded at runtime via an iterator modifier.The optional `device` parameter specifies the device number for the target\n region.The optional `map_vars` maps data from the current task's data environment\n to the device data environment.\n\n The optional `map_iterated` holds iterator-produced handles (from\n `omp.iterator`) whose bodies create `omp.map.info` ops, specifying\n map entries expanded at runtime via an iterator modifier.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.", "operands": [ { "name": "depend_vars", "type": "Variadic" }, { "name": "depend_iterated", "type": "Variadic" }, { "name": "device", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "map_vars", "type": "Variadic" }, { "name": "map_iterated", "type": "Variadic" } ], "attributes": [ { "name": "depend_kinds", "type": "OptionalAttr>" }, { "name": "depend_iterated_kinds", "type": "OptionalAttr>" }, { "name": "nowait", "type": "UnitAttr" } ], "assemblyFormat": "oilist(`depend` `(`\n custom($depend_vars, type($depend_vars), $depend_kinds,\n $depend_iterated, type($depend_iterated),\n $depend_iterated_kinds) `)`|`device` `(` $device `:` type($device) `)`|`if` `(` $if_expr `)`|`map_entries` `(` $map_vars `:` type($map_vars) `)` |\n `map_iterated` `(` $map_iterated `:` type($map_iterated) `)`|`nowait` $nowait) attr-dict" }, { "name": "omp.target_freemem", "summary": "free memory on an openmp device", "description": "Deallocates memory on the specified OpenMP device that was previously\n allocated by an `omp.target_allocmem` operation. After this operation, the\n deallocated memory is in an undefined state and should not be accessed.\n It is crucial to ensure that all accesses to the memory region are completed\n before `omp.target_freemem` is called to avoid undefined behavior.\n\n * `$device`: The integer ID of the OpenMP device from which the memory will be freed.\n * `$heapref`: The integer value representing the device pointer to the memory\n to be deallocated, which was previously returned by `omp.target_allocmem`.\n\n ```mlir\n // Example of allocating and freeing memory on an OpenMP device\n %device_id = arith.constant 0 : i32\n %allocated_ptr = omp.target_allocmem %device_id : i32, vector<3x3xi32>\n // ... operations using %allocated_ptr on the device ...\n omp.target_freemem %device_id, %allocated_ptr : i32, i64\n ```", "operands": [ { "name": "device", "type": "AnyInteger" }, { "name": "heapref", "type": "I64" } ], "assemblyFormat": "$device `,` $heapref attr-dict `:` type($device) `,` qualified(type($heapref))" }, { "name": "omp.target_update", "summary": "target update construct", "description": "The target update directive makes the corresponding list items in the device\n data environment consistent with their original list items, according to the\n specified motion clauses. The target update construct is a stand-alone\n directive.\n\n The optional `if_expr` parameter specifies a boolean result of a conditional\n check. If this value is 1 or is not provided then the target region runs on\n a device, if it is 0 then the target region is executed on the host device.\n\n We use `MapInfoOp` to model the motion clauses and their modifiers. Even\n though the spec differentiates between map-types & map-type-modifiers vs.\n motion-clauses & motion-modifiers, the motion clauses and their modifiers\n are a subset of map types and their modifiers. The subset relation is\n handled in during verification to make sure the restrictions for target\n update are respected.The `depend_kinds` and `depend_vars` arguments are variadic lists of values\n that specify the dependencies of this particular task in relation to other\n tasks.\n\n The `depend_iterated_kinds` and `depend_iterated` arguments are variadic\n lists of iterator-produced handles (from `omp.iterator`) that specify\n dependencies expanded at runtime via an iterator modifier.The optional `device` parameter specifies the device number for the target\n region.The optional `map_vars` maps data from the current task's data environment\n to the device data environment.\n\n The optional `map_iterated` holds iterator-produced handles (from\n `omp.iterator`) whose bodies create `omp.map.info` ops, specifying\n map entries expanded at runtime via an iterator modifier.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.", "operands": [ { "name": "depend_vars", "type": "Variadic" }, { "name": "depend_iterated", "type": "Variadic" }, { "name": "device", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "map_vars", "type": "Variadic" }, { "name": "map_iterated", "type": "Variadic" } ], "attributes": [ { "name": "depend_kinds", "type": "OptionalAttr>" }, { "name": "depend_iterated_kinds", "type": "OptionalAttr>" }, { "name": "nowait", "type": "UnitAttr" } ], "assemblyFormat": "oilist(`depend` `(`\n custom($depend_vars, type($depend_vars), $depend_kinds,\n $depend_iterated, type($depend_iterated),\n $depend_iterated_kinds) `)`|`device` `(` $device `:` type($device) `)`|`if` `(` $if_expr `)`|`map_entries` `(` $map_vars `:` type($map_vars) `)` |\n `map_iterated` `(` $map_iterated `:` type($map_iterated) `)`|`nowait` $nowait) attr-dict" }, { "name": "omp.task", "summary": "task construct", "description": "The task construct defines an explicit task.\n\n For definitions of \"undeferred task\", \"included task\", \"final task\" and\n \"mergeable task\", please check OpenMP Specification.\n\n When an `if` clause is present on a task construct, and the value of\n `if_expr` evaluates to `false`, an \"undeferred task\" is generated, and the\n encountering thread must suspend the current task region, for which\n execution cannot be resumed until execution of the structured block that is\n associated with the generated task is completed.\n\n The `in_reduction` clause specifies that this particular task (among all the\n tasks in current taskgroup, if any) participates in a reduction.\n `in_reduction_byref` indicates whether each reduction variable should\n be passed by value or by reference.The `affinity` clause specifies a locator list used as a hint for task\n placement / scheduling affinity.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `depend_kinds` and `depend_vars` arguments are variadic lists of values\n that specify the dependencies of this particular task in relation to other\n tasks.\n\n The `depend_iterated_kinds` and `depend_iterated` arguments are variadic\n lists of iterator-produced handles (from `omp.iterator`) that specify\n dependencies expanded at runtime via an iterator modifier.When a `final` clause is present and the `final` clause expression evaluates\n to `true`, the generated tasks will be final tasks. All task constructs\n encountered during execution of a final task will generate final and\n included tasks. The use of a variable in a `final` clause expression causes\n an implicit reference to the variable in all enclosing constructs.When the `mergeable` clause is present, the tasks generated by the construct\n are \"mergeable tasks\".The `priority` clause is a hint for the priority of the generated tasks.\n The `priority` is a non-negative integer expression that provides a hint for\n task execution order. Among all tasks ready to be executed, higher priority\n tasks (those with a higher numerical value in the priority clause\n expression) are recommended to execute before lower priority ones. The\n default priority-value when no priority clause is specified should be\n assumed to be zero (the lowest priority).If the `untied` clause is present on a task construct, any thread in the\n team can resume the task region after a suspension. The `untied` clause is\n ignored if a `final` clause is present on the same task construct and the\n `final` expression evaluates to `true`, or if a task is an included task.The detach clause specifies that the task generated by the construct on which it appears is a\n\tdetachable task. A new allow-completion event is created and connected to the completion of the\n\tassociated task region. The original event-handle is updated to represent that allow-completion\n\tevent before the task data environment is created.", "operands": [ { "name": "iterated", "type": "Variadic" }, { "name": "affinity_vars", "type": "Variadic" }, { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "depend_vars", "type": "Variadic" }, { "name": "depend_iterated", "type": "Variadic" }, { "name": "final", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "in_reduction_vars", "type": "Variadic" }, { "name": "priority", "type": "Optional" }, { "name": "private_vars", "type": "Variadic" }, { "name": "event_handle", "type": "Optional" } ], "attributes": [ { "name": "depend_kinds", "type": "OptionalAttr>" }, { "name": "depend_iterated_kinds", "type": "OptionalAttr>" }, { "name": "in_reduction_byref", "type": "OptionalAttr" }, { "name": "in_reduction_syms", "type": "OptionalAttr>" }, { "name": "mergeable", "type": "UnitAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "untied", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`affinity` `(` custom($iterated, $affinity_vars,\n type($iterated), type($affinity_vars)) `)`|`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`depend` `(`\n custom($depend_vars, type($depend_vars), $depend_kinds,\n $depend_iterated, type($depend_iterated),\n $depend_iterated_kinds) `)`|`final` `(` $final `)`|`if` `(` $if_expr `)`|`mergeable` $mergeable|`priority` `(` $priority `:` type($priority) `)`|`untied` $untied|`detach` `(` $event_handle `:` type($event_handle) `)`)custom(\n $region, $in_reduction_vars, type($in_reduction_vars),\n $in_reduction_byref, $in_reduction_syms, $private_vars,\n type($private_vars), $private_syms, $private_needs_barrier) attr-dict" }, { "name": "omp.taskgroup", "summary": "taskgroup construct", "description": "The taskgroup construct specifies a wait on completion of child tasks of the\n current task and their descendent tasks.\n\n When a thread encounters a taskgroup construct, it starts executing the\n region. All child tasks generated in the taskgroup region and all of their\n descendants that bind to the same parallel region as the taskgroup region\n are part of the taskgroup set associated with the taskgroup region. There is\n an implicit task scheduling point at the end of the taskgroup region. The\n current task is suspended at the task scheduling point until all tasks in\n the taskgroup set complete execution.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `task_reduction` clause specifies a reduction among tasks. For each list\n item, the number of copies is unspecified. Any copies associated with the\n reduction are initialized before they are accessed by the tasks\n participating in the reduction. After the end of the region, the original\n list item contains the result of the reduction. Similarly to the `reduction`\n clause, accumulator variables must be passed in `task_reduction_vars`,\n symbols referring to reduction declarations in the `task_reduction_syms`\n attribute, and whether the reduction variable should be passed into the\n reduction region by value or by reference in `task_reduction_byref`.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "task_reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "task_reduction_byref", "type": "OptionalAttr" }, { "name": "task_reduction_syms", "type": "OptionalAttr>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`)custom(\n $region, $task_reduction_vars, type($task_reduction_vars),\n $task_reduction_byref, $task_reduction_syms) attr-dict" }, { "name": "omp.taskloop", "summary": "taskloop construct", "description": "The taskloop construct specifies that the iterations of one or more\n associated loops will be executed in parallel using explicit tasks. The\n iterations are distributed across tasks generated by the construct and\n scheduled to be executed.\n\n The body region can only contain a single block which must contain a single\n operation. This operation must be another compatible loop wrapper or an\n `omp.loop_nest`.\n\n ```\n omp.taskloop {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n ```\n\n For definitions of \"undeferred task\", \"included task\", \"final task\" and\n \"mergeable task\", please check OpenMP Specification.\n\n When an `if` clause is present on a taskloop construct, and if the `if`\n clause expression evaluates to `false`, undeferred tasks are generated. The\n use of a variable in an `if` clause expression of a taskloop construct\n causes an implicit reference to the variable in all enclosing constructs.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.When a `final` clause is present and the `final` clause expression evaluates\n to `true`, the generated tasks will be final tasks. All task constructs\n encountered during execution of a final task will generate final and\n included tasks. The use of a variable in a `final` clause expression causes\n an implicit reference to the variable in all enclosing constructs.If a `grainsize` clause is present, the number of logical loop iterations\n assigned to each generated task is greater than or equal to the minimum of\n the value of the grain-size expression and the number of logical loop\n iterations, but less than two times the value of the grain-size expression.When the `mergeable` clause is present, the tasks generated by the construct\n are \"mergeable tasks\".By default, the taskloop construct executes as if it was enclosed in a\n taskgroup construct with no statements or directives outside of the taskloop\n construct. Thus, the taskloop construct creates an implicit taskgroup\n region. If the `nogroup` clause is present, no implicit taskgroup region is\n created.If `num_tasks` is specified, the taskloop construct creates as many tasks as\n the minimum of the num-tasks expression and the number of logical loop\n iterations. Each task must have at least one logical loop iteration.The `priority` clause is a hint for the priority of the generated tasks.\n The `priority` is a non-negative integer expression that provides a hint for\n task execution order. Among all tasks ready to be executed, higher priority\n tasks (those with a higher numerical value in the priority clause\n expression) are recommended to execute before lower priority ones. The\n default priority-value when no priority clause is specified should be\n assumed to be zero (the lowest priority).Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.If the `untied` clause is present on a task construct, any thread in the\n team can resume the task region after a suspension. The `untied` clause is\n ignored if a `final` clause is present on the same task construct and the\n `final` expression evaluates to `true`, or if a task is an included task.If an `in_reduction` clause is present on the taskloop construct, the\n behavior is as if each generated task was defined by a task construct on\n which an `in_reduction` clause with the same reduction operator and list\n items is present. Thus, the generated tasks are participants of a reduction\n previously defined by a reduction scoping clause. In this case, accumulator\n variables are specified in `in_reduction_vars`, symbols referring to\n reduction declarations in `in_reduction_syms` and `in_reduction_byref`\n indicate for each reduction variable whether it should be passed by value or\n by reference.\n\n If a `reduction` clause is present on the taskloop construct, the behavior\n is as if a `task_reduction` clause with the same reduction operator and list\n items was applied to the implicit taskgroup construct enclosing the taskloop\n construct. The taskloop construct executes as if each generated task was\n defined by a task construct on which an `in_reduction` clause with the same\n reduction operator and list items is present. Thus, the generated tasks are\n participants of the reduction defined by the `task_reduction` clause that\n was applied to the implicit taskgroup construct.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "final", "type": "Optional" }, { "name": "grainsize", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "in_reduction_vars", "type": "Variadic" }, { "name": "num_tasks", "type": "Optional" }, { "name": "priority", "type": "Optional" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "grainsize_mod", "type": "OptionalAttr" }, { "name": "in_reduction_byref", "type": "OptionalAttr" }, { "name": "in_reduction_syms", "type": "OptionalAttr>" }, { "name": "mergeable", "type": "UnitAttr" }, { "name": "nogroup", "type": "UnitAttr" }, { "name": "num_tasks_mod", "type": "OptionalAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" }, { "name": "untied", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`final` `(` $final `)`|`grainsize` `(` custom($grainsize_mod , $grainsize, type($grainsize)) `)`|`if` `(` $if_expr `)`|`mergeable` $mergeable|`nogroup` $nogroup|`num_tasks` `(` custom($num_tasks_mod , $num_tasks, type($num_tasks)) `)`|`priority` `(` $priority `:` type($priority) `)`|`untied` $untied)custom(\n $region, $in_reduction_vars, type($in_reduction_vars),\n $in_reduction_byref, $in_reduction_syms, $private_vars,\n type($private_vars), $private_syms, $private_needs_barrier,\n $reduction_mod, $reduction_vars, type($reduction_vars),\n $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.taskloop.context", "summary": "OutlinableOpenMPOpInterface wrapper for taskloop construct", "description": "The taskloop construct specifies that the iterations of one or more\n associated loops will be executed in parallel using explicit tasks. The\n iterations are distributed across tasks generated by the construct and\n scheduled to be executed. The representation of this construct is split\n between omp.taskloop.context and omp.taskloop.wrapper.\n\n The taskloop construct must be a loop wrapper to support composite\n constructs such as taskloop simd. Loop wrappers do not allow intervening\n operations between the wrapper and wrapped loop(wrapper). But unlike other\n loop wrappers, the body of taskloop is also outlined. This outlining means\n that we need a way to represent the correct location of allocas for\n temporaries created inside of the loop body. In order to achieve this,\n the outlining part is represented in this operation: `omp.taskloop.context`,\n and the loop wrapping is represented in `omp.taskloop.wrapper`. For example:\n ```\n omp.taskloop.context {\n // task-local stack allocations can go here\n omp.taskloop.wrapper {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n omp.terminator\n }\n ```\n\n The wrapped `omp.loop_nest` lower bounds, upper bounds and steps must be\n either defined outside of the `omp.taskloop.context` region or produced by\n pure, regionless operations inside the region that do not depend on block\n arguments.\n\n For definitions of \"undeferred task\", \"included task\", \"final task\" and\n \"mergeable task\", please check OpenMP Specification.\n\n When an `if` clause is present on a taskloop construct, and if the `if`\n clause expression evaluates to `false`, undeferred tasks are generated. The\n use of a variable in an `if` clause expression of a taskloop construct\n causes an implicit reference to the variable in all enclosing constructs.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.When a `final` clause is present and the `final` clause expression evaluates\n to `true`, the generated tasks will be final tasks. All task constructs\n encountered during execution of a final task will generate final and\n included tasks. The use of a variable in a `final` clause expression causes\n an implicit reference to the variable in all enclosing constructs.If a `grainsize` clause is present, the number of logical loop iterations\n assigned to each generated task is greater than or equal to the minimum of\n the value of the grain-size expression and the number of logical loop\n iterations, but less than two times the value of the grain-size expression.When the `mergeable` clause is present, the tasks generated by the construct\n are \"mergeable tasks\".By default, the taskloop construct executes as if it was enclosed in a\n taskgroup construct with no statements or directives outside of the taskloop\n construct. Thus, the taskloop construct creates an implicit taskgroup\n region. If the `nogroup` clause is present, no implicit taskgroup region is\n created.If `num_tasks` is specified, the taskloop construct creates as many tasks as\n the minimum of the num-tasks expression and the number of logical loop\n iterations. Each task must have at least one logical loop iteration.The `priority` clause is a hint for the priority of the generated tasks.\n The `priority` is a non-negative integer expression that provides a hint for\n task execution order. Among all tasks ready to be executed, higher priority\n tasks (those with a higher numerical value in the priority clause\n expression) are recommended to execute before lower priority ones. The\n default priority-value when no priority clause is specified should be\n assumed to be zero (the lowest priority).Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.If the `untied` clause is present on a task construct, any thread in the\n team can resume the task region after a suspension. The `untied` clause is\n ignored if a `final` clause is present on the same task construct and the\n `final` expression evaluates to `true`, or if a task is an included task.If an `in_reduction` clause is present on the taskloop construct, the\n behavior is as if each generated task was defined by a task construct on\n which an `in_reduction` clause with the same reduction operator and list\n items is present. Thus, the generated tasks are participants of a reduction\n previously defined by a reduction scoping clause. In this case, accumulator\n variables are specified in `in_reduction_vars`, symbols referring to\n reduction declarations in `in_reduction_syms` and `in_reduction_byref`\n indicate for each reduction variable whether it should be passed by value or\n by reference.\n\n If a `reduction` clause is present on the taskloop construct, the behavior\n is as if a `task_reduction` clause with the same reduction operator and list\n items was applied to the implicit taskgroup construct enclosing the taskloop\n construct. The taskloop construct executes as if each generated task was\n defined by a task construct on which an `in_reduction` clause with the same\n reduction operator and list items is present. Thus, the generated tasks are\n participants of the reduction defined by the `task_reduction` clause that\n was applied to the implicit taskgroup construct.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "final", "type": "Optional" }, { "name": "grainsize", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "in_reduction_vars", "type": "Variadic" }, { "name": "num_tasks", "type": "Optional" }, { "name": "priority", "type": "Optional" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" } ], "attributes": [ { "name": "grainsize_mod", "type": "OptionalAttr" }, { "name": "in_reduction_byref", "type": "OptionalAttr" }, { "name": "in_reduction_syms", "type": "OptionalAttr>" }, { "name": "mergeable", "type": "UnitAttr" }, { "name": "nogroup", "type": "UnitAttr" }, { "name": "num_tasks_mod", "type": "OptionalAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" }, { "name": "untied", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`final` `(` $final `)`|`grainsize` `(` custom($grainsize_mod , $grainsize, type($grainsize)) `)`|`if` `(` $if_expr `)`|`mergeable` $mergeable|`nogroup` $nogroup|`num_tasks` `(` custom($num_tasks_mod , $num_tasks, type($num_tasks)) `)`|`priority` `(` $priority `:` type($priority) `)`|`untied` $untied)custom(\n $region, $in_reduction_vars, type($in_reduction_vars),\n $in_reduction_byref, $in_reduction_syms, $private_vars,\n type($private_vars), $private_syms, $private_needs_barrier,\n $reduction_mod, $reduction_vars, type($reduction_vars),\n $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.taskloop.wrapper", "summary": "taskloop construct", "description": "The taskloop construct specifies that the iterations of one or more\n associated loops will be executed in parallel using explicit tasks. The\n iterations are distributed across tasks generated by the construct and\n scheduled to be executed. The representation of this construct is split\n between omp.taskloop.context and omp.taskloop.wrapper.\n\n This operation is intended to act as the loop wrapper portion of the\n taskloop op definition. See the description of omp.taskloop.context for more\n details.\n\n The body region can only contain a single block which must contain a single\n operation. This operation must be another compatible loop wrapper or an\n `omp.loop_nest`.\n\n ```\n omp.taskloop.context {\n omp.taskloop.wrapper {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n omp.terminator\n }\n ```", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "omp.taskwait", "summary": "taskwait construct", "description": "The taskwait construct specifies a wait on the completion of child tasks\n of the current task.The `depend_kinds` and `depend_vars` arguments are variadic lists of values\n that specify the dependencies of this particular task in relation to other\n tasks.\n\n The `depend_iterated_kinds` and `depend_iterated` arguments are variadic\n lists of iterator-produced handles (from `omp.iterator`) that specify\n dependencies expanded at runtime via an iterator modifier.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.", "operands": [ { "name": "depend_vars", "type": "Variadic" }, { "name": "depend_iterated", "type": "Variadic" } ], "attributes": [ { "name": "depend_kinds", "type": "OptionalAttr>" }, { "name": "depend_iterated_kinds", "type": "OptionalAttr>" }, { "name": "nowait", "type": "UnitAttr" } ], "assemblyFormat": "oilist(`depend` `(`\n custom($depend_vars, type($depend_vars), $depend_kinds,\n $depend_iterated, type($depend_iterated),\n $depend_iterated_kinds) `)`|`nowait` $nowait) attr-dict" }, { "name": "omp.taskyield", "summary": "taskyield construct", "description": "The taskyield construct specifies that the current task can be suspended\n in favor of execution of a different task.", "assemblyFormat": "attr-dict" }, { "name": "omp.teams", "summary": "teams construct", "description": "The teams construct defines a region of code that triggers the creation of a\n league of teams. Once created, the number of teams remains constant for the\n duration of its code region.\n\n If the `if_expr` is present and it evaluates to `false`, the number of teams\n created is one.The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `dyn_groupprivate_access_group` attribute specifies the access group\n modifier for the dynamically allocated group-private memory. The\n `dyn_groupprivate_fallback` attribute specifies the fallback behavior when\n allocation fails. The `dyn_groupprivate_size` operand specifies the size in\n bytes to allocate.The `num_teams` clause specifies the bounds on the league space formed by the\n construct on which it appears.\n\n Multi-dimensional (OpenMP 6.1 dims modifier):\n - Uses `num_teams_upper_vars` with multiple values (one per dimension)\n - Values may have different types; they will be cast at LLVM IR translation\n - Format: `num_teams(to %v0, %v1, ... : type0, type1, ...)`\n - Example: `num_teams(to %ub0, %ub1, %ub2 : i32, i64, i32)`\n - The number of dimensions is implicitly `num_teams_upper_vars.size()`\n\n Uni-dimensional (legacy format):\n - Uses `num_teams_upper_vars` with one value and optional `num_teams_lower`\n - If lower bound not specified, it defaults to upper bound value\n - Format: `num_teams(%lb : type to %ub : type)` or `num_teams(to %ub : type)`\n - Example: `num_teams(%lb : i32 to %ub : i32)` or `num_teams(to %ub : i32)`Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.The `thread_limit` clause specifies the limit on the number of threads.\n\n Multi-dimensional format (dims modifier):\n - Multiple values can be specified for multi-dimensional thread limits.\n - The number of dimensions is derived from the number of values.\n - Values can have different integer types.\n - Format: `thread_limit(%v1, %v2, ... : type1, type2, ...)`\n - Example: `thread_limit(%n, %m : i32, i64)`\n\n Single value format:\n - A single value specifies the thread limit.\n - Format: `thread_limit(%value : type)`\n - Example: `thread_limit(%n : i32)`", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "dyn_groupprivate_size", "type": "Optional" }, { "name": "if_expr", "type": "Optional" }, { "name": "num_teams_lower", "type": "Optional" }, { "name": "num_teams_upper_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" }, { "name": "thread_limit_vars", "type": "Variadic" } ], "attributes": [ { "name": "dyn_groupprivate_access_group", "type": "OptionalAttr" }, { "name": "dyn_groupprivate_fallback", "type": "OptionalAttr" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`dyn_groupprivate` `(`\n custom($dyn_groupprivate_access_group,\n $dyn_groupprivate_fallback,\n $dyn_groupprivate_size, type($dyn_groupprivate_size))\n `)`|`if` `(` $if_expr `)`|`num_teams` `(` ( $num_teams_lower^ `:` type($num_teams_lower) )? `to`\n $num_teams_upper_vars `:` type($num_teams_upper_vars) `)`|`thread_limit` `(` $thread_limit_vars `:` type($thread_limit_vars) `)`)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.terminator", "summary": "terminator for OpenMP regions", "description": "A terminator operation for regions that appear in the body of OpenMP\n operation. These regions are not expected to return any value so the\n terminator takes no operands. The terminator op returns control to the\n enclosing op.", "assemblyFormat": "attr-dict" }, { "name": "omp.threadprivate", "summary": "threadprivate directive", "description": "The threadprivate directive specifies that variables are replicated, with\n each thread having its own copy.\n\n The current implementation uses the OpenMP runtime to provide thread-local\n storage (TLS). Using the TLS feature of the LLVM IR will be supported in\n future.\n\n This operation takes in the address of a symbol that represents the original\n variable and returns the address of its TLS. All occurrences of\n threadprivate variables in a parallel region should use the TLS returned by\n this operation.\n\n The `sym_addr` refers to the address of the symbol, which is a pointer to\n the original variable.", "operands": [ { "name": "sym_addr", "type": "OpenMP_PointerLikeType" } ], "results": [ { "name": "tls_addr", "type": "OpenMP_PointerLikeType" } ], "traits": [ { "type": "AllTypesMatch<['sym_addr', 'tls_addr']>" } ], "assemblyFormat": "$sym_addr `:` type($sym_addr) `->` type($tls_addr) attr-dict" }, { "name": "omp.tile", "summary": "OpenMP tile operation", "description": "Represents the OpenMP tile directive introduced in OpenMP 5.1.\n\n The construct partitions the logical iteration space of the affected loops\n into equally-sized tiles, then creates two sets of nested loops. The outer\n loops, called the grid loops, iterate over all tiles. The inner loops,\n called the intratile loops, iterate over the logical iterations of a tile.\n The sizes clause determines the size of a tile.\n\n Currently, the affected loops must be rectangular (the tripcount of the\n inner loop must not depend on any iv of an surrounding affected loop) and\n perfectly nested (except for the innermost affected loop, no operations\n other than the nested loop and the terminator in the loop body).The `sizes` clauses defines the size of a grid over a multi-dimensional\n logical iteration space. This grid is used for loop transformations such as\n `tile` and `strip`. The size per dimension can be a variable, but only\n values that are not at least 2 make sense. It is not specified what happens\n when smaller values are used, but should still result in a loop nest that\n executes each logical iteration once.", "operands": [ { "name": "generatees", "type": "Variadic" }, { "name": "applyees", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" } ], "assemblyFormat": "custom($generatees, $applyees)oilist(`sizes` `(` $sizes `:` type($sizes) `)`)attr-dict" }, { "name": "omp.unroll_heuristic", "summary": "OpenMP heuristic unroll operation", "description": "Represents a `#pragma omp unroll` construct introduced in OpenMP 5.1.\n\n The operation has one applyee and no generatees. The applyee is unrolled\n according to implementation-defined heuristics. Implementations may choose\n to not unroll the loop, partially unroll by a chosen factor, or fully\n unroll it. Even if the implementation chooses to partially unroll the\n applyee, the resulting unrolled loop is not accessible as a generatee. Use\n omp.unroll_partial if a generatee is required.\n\n The lowering is implemented using `OpenMPIRBuilder::unrollLoopHeuristic`,\n which just attaches `llvm.loop.unroll.enable` metadata to the loop so the\n unrolling is carried-out by LLVM's LoopUnroll pass. That is, unrolling only\n actually performed in optimized builds.\n\n Assembly formats:\n omp.unroll_heuristic(%cli)\n omp.unroll_heuristic(%cli) -> ()", "operands": [ { "name": "applyee", "type": "CanonicalLoopInfoType" } ], "hasCustomAssemblyFormat": true }, { "name": "omp.workdistribute", "summary": "workdistribute directive", "description": "workdistribute divides execution of the enclosed structured block into\n separate units of work, each executed only once by each\n initial thread in the league.\n ```\n !$omp target teams\n !$omp workdistribute\n y = a * x + y \n !$omp end workdistribute\n !$omp end target teams\n ```", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "omp.workshare", "summary": "workshare directive", "description": "The workshare construct divides the execution of the enclosed structured\n block into separate units of work, and causes the threads of the team to\n share the work such that each unit is executed only once by one thread, in\n the context of its implicit task\n\n This operation is used for the intermediate representation of the workshare\n block before the work gets divided between the threads. See the flang\n LowerWorkshare pass for details.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.", "attributes": [ { "name": "nowait", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`nowait` $nowait) $region attr-dict" }, { "name": "omp.workshare.loop_wrapper", "summary": "contains loop nests to be parallelized by workshare", "description": "This operation wraps a loop nest that is marked for dividing into units of\n work by an encompassing omp.workshare operation.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "omp.wsloop", "summary": "worksharing-loop construct", "description": "The worksharing-loop construct specifies that the iterations of the loop(s)\n will be executed in parallel by threads in the current context. These\n iterations are spread across threads that already exist in the enclosing\n parallel region.\n\n The body region can only contain a single block which must contain a single\n operation. This operation must be another compatible loop wrapper or an\n `omp.loop_nest`.\n\n ```\n omp.wsloop {\n omp.loop_nest (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) {\n %a = load %arrA[%i1, %i2] : memref\n %b = load %arrB[%i1, %i2] : memref\n %sum = arith.addf %a, %b : f32\n store %sum, %arrC[%i1, %i2] : memref\n omp.yield\n }\n }\n ```The `allocator_vars` and `allocate_vars` parameters are a variadic list of\n values that specify the memory allocator to be used to obtain storage for\n private values.The `linear_step_vars` operand additionally specifies the step for each\n associated linear operand. Note that the `linear_vars` and\n `linear_step_vars` variadic lists should contain the same number of\n elements.\n\n The `linear_modifiers` attribute optionally specifies a per-variable\n linear-modifier: `val`, `ref`, or `uval`. When omitted, the default\n modifier is determined by the language semantics.The optional `nowait` attribute, when present, eliminates the implicit\n barrier at the end of the construct, so the parent operation can make\n progress even if the child operation has not completed yet.The optional `order` attribute specifies which order the iterations of the\n associated loops are executed in. Currently the only option for this\n attribute is \"concurrent\".The optional `ordered` attribute specifies how many loops are associated\n with the worksharing-loop construct. The value of zero refers to the ordered\n clause specified without parameter.Reductions can be performed by specifying the reduction modifer\n (`default`, `inscan` or `task`) in `reduction_mod`, reduction accumulator\n variables in `reduction_vars`, symbols referring to reduction declarations\n in the `reduction_syms` attribute, and whether the reduction variable\n should be passed into the reduction region by value or by reference in\n `reduction_byref`. Each reduction is identified by the accumulator it uses\n and accumulators must not be repeated in the same reduction. A private\n variable corresponding to the accumulator is used in place of the\n accumulator inside the body of the operation. The reduction declaration\n specifies how to combine the values from each iteration, section, team,\n thread or simd lane defined by the operation's region into the final value,\n which is available in the accumulator after they all complete.The optional `schedule_kind` attribute specifies the loop schedule for this\n loop, determining how the loop is distributed across the parallel threads.\n The optional `schedule_chunk` associated with this determines further\n controls this distribution.", "operands": [ { "name": "allocate_vars", "type": "Variadic" }, { "name": "allocator_vars", "type": "Variadic" }, { "name": "linear_vars", "type": "Variadic" }, { "name": "linear_step_vars", "type": "Variadic" }, { "name": "private_vars", "type": "Variadic" }, { "name": "reduction_vars", "type": "Variadic" }, { "name": "schedule_chunk", "type": "Optional" } ], "attributes": [ { "name": "linear_var_types", "type": "OptionalAttr" }, { "name": "linear_modifiers", "type": "OptionalAttr" }, { "name": "nowait", "type": "UnitAttr" }, { "name": "order", "type": "OptionalAttr" }, { "name": "order_mod", "type": "OptionalAttr" }, { "name": "ordered", "type": "ConfinedAttr, [IntMinValue<0>]>" }, { "name": "private_syms", "type": "OptionalAttr>" }, { "name": "private_needs_barrier", "type": "UnitAttr" }, { "name": "reduction_mod", "type": "OptionalAttr" }, { "name": "reduction_byref", "type": "OptionalAttr" }, { "name": "reduction_syms", "type": "OptionalAttr>" }, { "name": "schedule_kind", "type": "OptionalAttr" }, { "name": "schedule_mod", "type": "OptionalAttr" }, { "name": "schedule_simd", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "oilist(`allocate` `(`\n custom($allocate_vars, type($allocate_vars),\n $allocator_vars, type($allocator_vars)) `)`|`linear` `(`\n custom($linear_vars, type($linear_vars),\n $linear_step_vars, type($linear_step_vars),\n $linear_modifiers) `)`|`nowait` $nowait|`order` `(` custom($order, $order_mod) `)`|`ordered` `(` $ordered `)`|`schedule` `(`\n custom($schedule_kind, $schedule_mod, $schedule_simd,\n $schedule_chunk, type($schedule_chunk)) `)`)custom($region, $private_vars, type($private_vars),\n $private_syms, $private_needs_barrier, $reduction_mod, $reduction_vars,\n type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict" }, { "name": "omp.yield", "summary": "loop yield and termination operation", "description": "\"omp.yield\" yields SSA values from the OpenMP dialect op region and\n terminates the region. The semantics of how the values are yielded is\n defined by the parent operation.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "( `(` $results^ `:` type($results) `)` )? attr-dict" }, { "name": "onnx.Abs", "summary": "ONNX Abs operation", "description": "Absolute takes one input data (Tensor) and produces one output data\n (Tensor) where absolute value, y = abs(x), is applied to\n the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Acos", "summary": "ONNX Acos operation", "description": "Calculates the arccosine (inverse of cosine) of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Acosh", "summary": "ONNX Acosh operation", "description": "Calculates the hyperbolic arccosine of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Adagrad", "summary": "ONNX Adagrad operation", "description": "Compute one iteration of ADAGRAD, a stochastic gradient based optimization\n algorithm. This operator can conduct the optimization of multiple tensor variables.\n \n Let's define the behavior of this operator. As you can imagine, ADAGRAD requires\n some parameters:\n \n - The initial learning-rate \\\"R\\\".\n - The update count \\\"T\\\". That is, the number of training iterations conducted.\n - A L2-norm regularization coefficient \\\"norm_coefficient\\\".\n - A learning-rate decay factor \\\"decay_factor\\\".\n - A small constant \\\"epsilon\\\" to avoid dividing-by-zero.\n \n At each ADAGRAD iteration, the optimized tensors are moved along a direction\n computed based on their estimated gradient and accumulated squared gradient. Assume\n that only a single tensor \\\"X\\\" is updated by this operator. We need the value of \\\"X\\\",\n its gradient \\\"G\\\", and its accumulated squared gradient \\\"H\\\". Therefore, variables in\n this operator's input list are sequentially \\\"R\\\", \\\"T\\\", \\\"X\\\", \\\"G\\\", and \\\"H\\\". Other\n parameters are given as attributes because they are usually constants. Also, the\n corresponding output tensors are the new value of \\\"X\\\" (called \\\"X_new\\\"), and then\n the new accumulated squared gradient (called \\\"H_new\\\"). Those outputs are computed\n from the given inputs following the pseudo code below.\n \n Let \\\"+\\\", \\\"-\\\", \\\"*\\\", and \\\"/\\\" are all element-wise arithmetic operations with\n numpy-style broadcasting support. The pseudo code to compute those outputs is:\n \n // Compute a scalar learning-rate factor. At the first update of X, T is generally\n // 0 (0-based update index) or 1 (1-based update index).\n r = R / (1 + T * decay_factor);\n \n // Add gradient of 0.5 * norm_coefficient * ||X||_2^2, where ||X||_2 is the 2-norm.\n G_regularized = norm_coefficient * X + G;\n \n // Compute new accumulated squared gradient.\n H_new = H + G_regularized * G_regularized;\n \n // Compute the adaptive part of per-coordinate learning rate. Note that Sqrt(...)\n // computes element-wise square-root.\n H_adaptive = Sqrt(H_new) + epsilon\n \n // Compute the new value of \\\"X\\\".\n X_new = X - r * G_regularized / H_adaptive;\n \n If one assign this operators to optimize multiple inputs, for example, \\\"X_1\\\" and \\\"X_2\\\", the same\n pseudo code may be extended to handle all tensors jointly. More specifically, we can view \\\"X\\\" as a\n concatenation of \\\"X_1\\\" and \\\"X_2\\\" (of course, their gradient and accumulate gradient should\n be concatenated too) and then just reuse the entire pseudo code.\n \n Note that ADAGRAD was first proposed in http://jmlr.org/papers/volume12/duchi11a/duchi11a.pdf.\n In that reference paper, this operator is a special case of the Figure 1's composite mirror\n descent update.", "operands": [ { "name": "R", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "T", "type": "TensorOf<[I64]>" }, { "name": "inputs", "type": "Variadic, TensorOf < [ F64 ] > ]>>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ F64 ] > ]>>" } ], "attributes": [ { "name": "decay_factor", "type": "DefaultValuedAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "norm_coefficient", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Adam", "summary": "ONNX Adam operation", "description": "Compute one iteration of Adam, a stochastic gradient based optimization\n algorithm. This operator can conduct the optimization of multiple tensor variables.\n \n Let's define the behavior of this operator. First of all, Adam requires\n some parameters:\n \n - The learning-rate \\\"R\\\".\n - The update count \\\"T\\\". That is, the number of training iterations conducted.\n - A L2-norm regularization coefficient \\\"norm_coefficient\\\".\n - A small constant \\\"epsilon\\\" to avoid dividing-by-zero.\n - Two coefficients, \\\"alpha\\\" and \\\"beta\\\".\n \n At each Adam iteration, the optimized tensors are moved along a direction\n computed based on their exponentially-averaged historical gradient and\n exponentially-averaged historical squared gradient. Assume that only a tensor\n \\\"X\\\" is being optimized. The rest of required information is\n \n - the value of \\\"X\\\",\n - \\\"X\\\"'s gradient (denoted by \\\"G\\\"),\n - \\\"X\\\"'s exponentially-averaged historical gradient (denoted by \\\"V\\\"), and\n - \\\"X\\\"'s exponentially-averaged historical squared gradient (denoted by \\\"H\\\").\n \n Some of those parameters are passed into this operator as input tensors and others\n are stored as this operator's attributes. Specifically, this operator's input tensor\n list is [\\\"R\\\", \\\"T\\\", \\\"X\\\", \\\"G\\\", \\\"V\\\", \\\"H\\\"]. That is, \\\"R\\\" is the first input, \\\"T\\\" is\n the second input, and so on. Other parameters are given as attributes because they\n are constants. Moreover, the corresponding output tensors are\n \n - the new value of \\\"X\\\" (called \\\"X_new\\\"),\n - the new exponentially-averaged historical gradient (denoted by \\\"V_new\\\"), and\n - the new exponentially-averaged historical squared gradient (denoted by \\\"H_new\\\").\n \n Those outputs are computed following the pseudo code below.\n \n Let \\\"+\\\", \\\"-\\\", \\\"*\\\", and \\\"/\\\" are all element-wise arithmetic operations with\n numpy-style broadcasting support. The pseudo code to compute those outputs is:\n \n // Add gradient of 0.5 * norm_coefficient * ||X||_2^2, where ||X||_2 is the 2-norm.\n G_regularized = norm_coefficient * X + G\n \n // Update exponentially-averaged historical gradient.\n V_new = alpha * V + (1 - alpha) * G_regularized\n \n // Update exponentially-averaged historical squared gradient.\n H_new = beta * H + (1 - beta) * G_regularized * G_regularized\n \n // Compute the element-wise square-root of H_new. V_new will be element-wisely\n // divided by H_sqrt for a better update direction.\n H_sqrt = Sqrt(H_new) + epsilon\n \n // Compute learning-rate. Note that \\\"alpha**T\\\"/\\\"beta**T\\\" is alpha's/beta's T-th power.\n R_adjusted = T > 0 ? R * Sqrt(1 - beta**T) / (1 - alpha**T) : R\n \n // Compute new value of \\\"X\\\".\n X_new = X - R_adjusted * V_new / H_sqrt\n \n // Post-update regularization.\n X_final = (1 - norm_coefficient_post) * X_new\n \n If there are multiple inputs to be optimized, the pseudo code will be applied\n independently to each of them.", "operands": [ { "name": "R", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "T", "type": "TensorOf<[I64]>" }, { "name": "inputs", "type": "Variadic, TensorOf < [ F64 ] > ]>>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ F64 ] > ]>>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "norm_coefficient", "type": "DefaultValuedAttr" }, { "name": "norm_coefficient_post", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Add", "summary": "ONNX Add operation", "description": "Performs element-wise binary addition (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).\n \n (Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.And", "summary": "ONNX And operation", "description": "Returns the tensor resulted from performing the `and` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "TensorOf<[I1]>" }, { "name": "B", "type": "TensorOf<[I1]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.ArgMax", "summary": "ONNX ArgMax operation", "description": "Computes the indices of the max elements of the input tensor's element along the\n provided axis. The resulting tensor has the same rank as the input if keepdims equals 1.\n If keepdims equals 0, then the resulting tensor has the reduced dimension pruned.\n If select_last_index is True (default False), the index of the last occurrence of the max\n is selected if the max appears more than once in the input. Otherwise the index of the\n first occurrence is selected.\n The type of the output tensor is integer.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "TensorOf<[I64]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "select_last_index", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ArgMin", "summary": "ONNX ArgMin operation", "description": "Computes the indices of the min elements of the input tensor's element along the\n provided axis. The resulting tensor has the same rank as the input if keepdims equals 1.\n If keepdims equals 0, then the resulting tensor has the reduced dimension pruned.\n If select_last_index is True (default False), the index of the last occurrence of the min\n is selected if the min appears more than once in the input. Otherwise the index of the\n first occurrence is selected.\n The type of the output tensor is integer.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "TensorOf<[I64]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "select_last_index", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ArrayFeatureExtractor", "summary": "ONNX ArrayFeatureExtractor operation", "description": "Select elements of the input tensor based on the indices passed.
\n The indices are applied to the last axes of the tensor.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>, TensorOf<[StringType]>]>" }, { "name": "Y", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "Z", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>, TensorOf<[StringType]>]>" } ] }, { "name": "onnx.Asin", "summary": "ONNX Asin operation", "description": "Calculates the arcsine (inverse of sine) of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Asinh", "summary": "ONNX Asinh operation", "description": "Calculates the hyperbolic arcsine of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Atan", "summary": "ONNX Atan operation", "description": "Calculates the arctangent (inverse of tangent) of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Atanh", "summary": "ONNX Atanh operation", "description": "Calculates the hyperbolic arctangent of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Attention", "summary": "ONNX Attention operation", "description": "Computes scaled dot product attention on query, key and value tensors, using an optional attention mask if passed.\n \n This operator covers self and cross variants of the attention operation based on sequence lengths of K, Q and V.\n \n For self attention, `kv_sequence_length` equals to `q_sequence_length`.\n \n For cross attention, query and key might have different lengths.\n \n This operator also covers the 3 following variants based on the number of heads:\n 1) Multi-headed Attention (MHA): Described in the paper https://arxiv.org/pdf/1706.03762, `q_num_heads = kv_num_heads`.\n 2) Group-query Attention (GQA): Described in the paper https://arxiv.org/pdf/2305.13245, `q_num_heads > kv_num_heads`, `q_num_heads % kv_num_heads == 0`.\n 3) Multi-query Attention (MQA): Described in the paper https://arxiv.org/pdf/1911.02150, `q_num_heads > kv_num_heads`, `kv_num_heads=1`.\n \n Attention bias to be added is calculated based on `attn_mask` input and `is_causal` attribute:\n 1) `attn_mask`: A boolean mask where a value of `True` indicates that the element should take part in attention or a float mask of the same type as query, key, value that is added to the attention score.\n 2) If `is_causal` is set to `1`, attention scores above the diagonal are masked out, regardless of the `attn_mask` input.\n \n With respect to KV cache update, this operator allows the following two use cases:\n \n 1) Cache update happens inside the Attention operator. In this case, the `K` and `V` inputs contain only the incoming\n tokens for the current autoregressive step, and the four optional inputs/outputs past and present key and value are\n all needed. The Attention op performs a Concat operation on the past and incoming key and value to form the present\n key and value, respectively. Note that this only works correctly for the special case where the past key and value\n do not contain padded tokens.\n 2) Cache update happens outside the Attention operator (for example, through the `TensorScatter` operator). In this\n case, the `K` and `V` inputs correspond to the entire cache tensor, so the four optional inputs/outputs past and\n present key and value should not be used. An additional input `nonpad_kv_seqlen` of shape (batch_size,) may be\n provided to indicate the number of non-padding tokens in each sample of the batch to save unnecessary computation.\n Here, the kv_sequence dimension of `attn_mask` can be shorter than `K` and `V`, but still needs to be at least as long\n as the maximum value of `nonpad_kv_seqlen`.\n \n Both past and present state key/values are optional. They shall be used together, and not allowed to use only one of them.\n The following pattern is applied to the Q, K and V inputs after appropriate reshaping of K and V inputs based on sequence lengths and num heads provided:\n \n ```\n The following pattern is applied by this operator:\n Q K V\n | | |\n Q*sqrt(scale) K*sqrt(scale) |\n | | |\n | Transpose |\n | | |\n ---MatMul--- |\n | |\n at_mask---Add |\n | |\n softcap (if provided) |\n | |\n Softmax |\n | |\n -----MatMul------\n |\n Y\n ```", "operands": [ { "name": "Q", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "K", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "V", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "attn_mask", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I1]>, NoneType]>" }, { "name": "past_key", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "past_value", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "nonpad_kv_seqlen", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "present_key", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "present_value", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "qk_matmul_output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "kv_num_heads", "type": "OptionalAttr" }, { "name": "q_num_heads", "type": "OptionalAttr" }, { "name": "qk_matmul_output_mode", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "softcap", "type": "DefaultValuedAttr" }, { "name": "softmax_precision", "type": "OptionalAttr" } ] }, { "name": "onnx.AveragePool", "summary": "ONNX AveragePool operation", "description": "AveragePool consumes an input tensor X and applies average pooling across\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n average pooling consisting of computing the average on all values of a\n subset of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing. The output spatial shape is calculated differently\n depending on whether explicit padding is used, where pads is employed, or auto padding is used, where auto_pad is utilized.\n With explicit padding (https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html?highlight=maxpool#torch.nn.MaxPool2d):\n ```\n output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)\n ```\n or\n ```\n output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)\n ```\n if ceil_mode is enabled. `pad_shape[i]` is the sum of pads along axis `i`. Sliding windows that would start in the right padded region are ignored.\n \n `auto_pad` is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following when ceil_mode is enabled:\n ```\n VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) + 1) / strides_spatial_shape[i])\n SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])\n ```\n or when ceil_mode is disabled (https://www.tensorflow.org/api_docs/python/tf/keras/layers/AveragePooling2D):\n ```\n VALID: output_spatial_shape[i] = floor((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1)) / strides_spatial_shape[i]) + 1\n SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = floor((input_spatial_shape[i] - 1) / strides_spatial_shape[i]) + 1\n ```\n And pad shape will be following if `SAME_UPPER` or `SAME_LOWER`:\n ```\n pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) - input_spatial_shape[i]\n ```\n The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "ceil_mode", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.BatchNormalization", "summary": "ONNX BatchNormalization operation", "description": "Carries out batch normalization as described in the paper\n https://arxiv.org/abs/1502.03167. Depending on the mode it is being run,\n There are five required inputs 'X', 'scale', 'B', 'input_mean' and\n 'input_var'.\n Note that 'input_mean' and 'input_var' are expected to be the estimated\n statistics in inference mode (training_mode=False, default),\n and the running statistics in training mode (training_mode=True).\n There are multiple cases for the number of outputs, which we list below:\n \n * Output case #1: Y, running_mean, running_var (training_mode=True)\n * Output case #2: Y (training_mode=False)\n \n When training_mode=False, extra outputs are invalid.\n The outputs are updated as follows when training_mode=True:\n ```\n running_mean = input_mean * momentum + current_mean * (1 - momentum)\n running_var = input_var * momentum + current_var * (1 - momentum)\n \n Y = (X - current_mean) / sqrt(current_var + epsilon) * scale + B\n ```\n where:\n ```\n current_mean = ReduceMean(X, axis=all_except_channel_index)\n current_var = ReduceVar(X, axis=all_except_channel_index)\n ```\n Notice that `ReduceVar` refers to the population variance, and it equals to\n `sum(sqrd(x_i - x_avg)) / N`\n where `N` is the population size (this formula does not use sample size `N - 1`).\n \n The computation of ReduceMean and ReduceVar uses float to avoid overflow for float16 inputs.\n \n When training_mode=False:\n ```\n Y = (X - input_mean) / sqrt(input_var + epsilon) * scale + B\n ```\n \n For previous (depreciated) non-spatial cases, implementors are suggested\n to flatten the input shape to (N x C * D1 * D2 * ... * Dn) before a BatchNormalization Op.\n This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "scale", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "input_mean", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "input_var", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "running_mean", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" }, { "name": "running_var", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "momentum", "type": "DefaultValuedAttr" }, { "name": "training_mode", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.BatchNormalizationInferenceMode", "summary": "ONNX BatchNormalization operation in test mode", "description": "Carries out batch normalization as described in the paper\n https://arxiv.org/abs/1502.03167. Depending on the mode it is being run,\n there are multiple cases for the number of outputs, which we list below:\n\n Output case #1: Y, mean, var, saved_mean, saved_var (training mode)\n Output case #2: Y (test mode)\"\n\n For previous (depreciated) non-spatial cases, implementors are suggested\n to flatten the input shape to (N x C*D1*D2 ..*Dn) before a BatchNormalization Op.\n This operator has **optional** inputs/outputs. See [the doc](IR.md)\n for more details about the representation of optional arguments.\n An empty string may be used in the place of an actual argument's name to\n indicate a missing argument. Trailing optional arguments (those not followed\n by an argument that is present) may also be simply omitted.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "X", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" }, { "name": "scale", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" }, { "name": "B", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" }, { "name": "mean", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" }, { "name": "var", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" } ], "results": [ { "name": "o_Y", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "momentum", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Bernoulli", "summary": "ONNX Bernoulli operation", "description": "Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor\n containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number,\n where an output of 1 is produced with probability p and an output of 0 is produced with probability (1-p).\n \n This operator is non-deterministic and may not produce the same values in different\n implementations (even if a seed is specified).", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I1]>]>" } ], "attributes": [ { "name": "dtype", "type": "OptionalAttr" }, { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "onnx.Binarizer", "summary": "ONNX Binarizer operation", "description": "Maps the values of the input tensor to either 0 or 1, element-wise, based on the outcome of a comparison against a threshold value.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "attributes": [ { "name": "threshold", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.BitShift", "summary": "ONNX BitShift operation", "description": "Bitwise shift operator performs element-wise operation. For each input element, if the\n attribute \\\"direction\\\" is \\\"RIGHT\\\", this operator moves its binary representation toward\n the right side so that the input value is effectively decreased. If the attribute \\\"direction\\\"\n is \\\"LEFT\\\", bits of binary representation moves toward the left side, which results the\n increase of its actual value. The input X is the tensor to be shifted and another input\n Y specifies the amounts of shifting. For example, if \\\"direction\\\" is \\\"Right\\\", X is [1, 4],\n and S is [1, 1], the corresponding output Z would be [0, 2]. If \\\"direction\\\" is \\\"LEFT\\\" with\n X=[1, 2] and S=[1, 2], the corresponding output Y would be [2, 8].\n \n Because this operator supports Numpy-style broadcasting, X's and Y's shapes are\n not necessarily identical.\n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>]>" }, { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>]>" } ], "results": [ { "name": "Z", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>]>" } ], "attributes": [ { "name": "direction", "type": "StrAttr" } ] }, { "name": "onnx.BitwiseAnd", "summary": "ONNX BitwiseAnd operation", "description": "Returns the tensor resulting from performing the bitwise `and` operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ] }, { "name": "onnx.BitwiseNot", "summary": "ONNX BitwiseNot operation", "description": "Returns the bitwise not of the input tensor element-wise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ] }, { "name": "onnx.BitwiseOr", "summary": "ONNX BitwiseOr operation", "description": "Returns the tensor resulting from performing the bitwise `or` operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ] }, { "name": "onnx.BitwiseXor", "summary": "ONNX BitwiseXor operation", "description": "Returns the tensor resulting from performing the bitwise `xor` operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ] }, { "name": "onnx.BlackmanWindow", "summary": "ONNX BlackmanWindow operation", "description": "Generates a Blackman window as described in the paper https://ieeexplore.ieee.org/document/1455106.", "operands": [ { "name": "size", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "output_datatype", "type": "DefaultValuedAttr" }, { "name": "periodic", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Cast", "summary": "ONNX Cast operation", "description": "The operator casts the elements of a given input tensor to a data type\n specified by the 'to' argument and returns an output tensor of the same size in\n the converted type. The 'to' argument must be one of the data types specified\n in the 'DataType' enum field in the TensorProto message.\n \n Casting from string tensor in plain (e.g., \\\"3.14\\\" and \\\"1000\\\") and scientific numeric representations\n (e.g., \\\"1e-5\\\" and \\\"1E8\\\") to float types is supported. For example, converting string \\\"100.5\\\" to an integer may\n yield result 100. There are some string literals reserved for special floating-point values;\n \\\"+INF\\\" (and \\\"INF\\\"), \\\"-INF\\\", and \\\"NaN\\\" are positive infinity, negative infinity, and not-a-number, respectively.\n Any string which can exactly match \\\"+INF\\\" in a case-insensitive way would be mapped to positive infinite. Similarly,\n this case-insensitive rule is applied to \\\"INF\\\" and \\\"NaN\\\". When casting from numeric tensors\n to string tensors, plain floating-point representation (such as \\\"314.15926\\\") would be used.\n Converting non-numerical-literal string such as \\\"Hello World!\\\" is an undefined behavior. Cases\n of converting string representing floating-point arithmetic value, such as \\\"2.718\\\", to INT is an undefined behavior.\n \n Conversion from a numerical type to any numerical type is always allowed.\n User must be aware of precision loss and value change caused by range difference between two types.\n For example, a 64-bit float 3.1415926459 may be round to a 32-bit float 3.141592. Similarly, converting\n an integer 36 to Boolean may produce 1 because we truncate bits which can't be stored in the targeted type.\n \n In more detail, the conversion among numerical types should follow these rules\n if the destination type is not a float 8 type.\n \n * Casting from floating point to:\n * floating point: +/- infinity if OOR (out of range).\n * fixed point: undefined if OOR.\n * bool: +/- 0.0 to False; all else to True.\n * Casting from fixed point to:\n * floating point: +/- infinity if OOR. (+ infinity in the case of uint)\n * fixed point: when OOR, discard higher bits and reinterpret (with respect to two's complement representation for\n signed types). For example, 200 (int16) -> -56 (int8).\n * bool: zero to False; nonzero to True.\n * Casting from bool to:\n * floating point: `{1.0, 0.0}`.\n * fixed point: `{1, 0}`.\n * bool: no change.\n \n Float 8 type were introduced to speed up the training of\n deep models. By default the conversion of a float *x* obeys\n to the following rules. `[x]` means the value rounded to\n the target mantissa width.\n \n | x | E4M3FN | E4M3FNUZ | E5M2 | E5M2FNUZ |\n | ----------------- | -------- | -------- | -------- | -------- |\n | 0 | 0 | 0 | 0 | 0 |\n | -0 | -0 | 0 | -0 | 0 |\n | NaN | NaN | NaN | NaN | NaN |\n | Inf | FLT_MAX | NaN | FLT_MAX | NaN |\n | -Inf | -FLT_MAX | NaN | -FLT_MAX | NaN |\n | \\[x\\] > FLT_MAX | FLT_MAX | FLT_MAX | FLT_MAX | FLT_MAX |\n | \\[x\\] \\< -FLT_MAX | -FLT_MAX | -FLT_MAX | -FLT_MAX | -FLT_MAX |\n | else | RNE | RNE | RNE | RNE |\n \n The behavior changes if the parameter 'saturate' is set to False.\n The rules then become:\n \n | x | E4M3FN | E4M3FNUZ | E5M2 | E5M2FNUZ |\n | ----------------- | ------ | -------- | ---- | -------- |\n | 0 | 0 | 0 | 0 | 0 |\n | -0 | -0 | 0 | -0 | 0 |\n | NaN | NaN | NaN | NaN | NaN |\n | -NaN | -NaN | NaN | -NaN | NaN |\n | Inf | NaN | NaN | Inf | NaN |\n | -Inf | -NaN | NaN | -Inf | NaN |\n | \\[x\\] > FLT_MAX | NaN | NaN | Inf | NaN |\n | \\[x\\] \\< -FLT_MAX | NaN | NaN | -Inf | NaN |\n | else | RNE | RNE | RNE | RNE |", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I1]>, TensorOf<[StringType]>, TensorOf<[BF16]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I1]>, TensorOf<[StringType]>, TensorOf<[BF16]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "attributes": [ { "name": "saturate", "type": "DefaultValuedAttr" }, { "name": "to", "type": "TypeAttr" } ] }, { "name": "onnx.CastLike", "summary": "ONNX CastLike operation", "description": "The operator casts the elements of a given input tensor (the first input) to\n the same data type as the elements of the second input tensor.\n See documentation of the Cast operator for further details.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I1]>, TensorOf<[StringType]>, TensorOf<[BF16]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" }, { "name": "target_type", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I1]>, TensorOf<[StringType]>, TensorOf<[BF16]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I1]>, TensorOf<[StringType]>, TensorOf<[BF16]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "attributes": [ { "name": "saturate", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.CastMap", "summary": "ONNX CastMap operation", "description": "Converts a map to a tensor.
The map key must be an int64 and the values will be ordered\n in ascending order based on this key.
The operator supports dense packing or sparse packing.\n If using sparse packing, the key cannot exceed the max_map-1 value.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TupleOf<[I64, StringType]>, TupleOf<[I64, F32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[F32]>, TensorOf<[I64]>]>" } ], "attributes": [ { "name": "cast_to", "type": "DefaultValuedStrAttr" }, { "name": "map_form", "type": "DefaultValuedStrAttr" }, { "name": "max_map", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.CategoryMapper", "summary": "ONNX CategoryMapper operation", "description": "Converts strings to integers and vice versa.
\n Two sequences of equal length are used to map between integers and strings,\n with strings and integers at the same index detailing the mapping.
\n Each operator converts either integers to strings or strings to integers, depending\n on which default value attribute is provided. Only one default value attribute\n should be defined.
\n If the string default value is set, it will convert integers to strings.\n If the int default value is set, it will convert strings to integers.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>]>" } ], "attributes": [ { "name": "cats_int64s", "type": "OptionalAttr>" }, { "name": "cats_strings", "type": "OptionalAttr>" }, { "name": "default_int64", "type": "DefaultValuedAttr" }, { "name": "default_string", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.Ceil", "summary": "ONNX Ceil operation", "description": "Ceil takes one input data (Tensor) and produces one output data\n (Tensor) where the ceil is, y = ceil(x), is applied to\n the tensor elementwise. If x is integral, +0, -0, NaN, or infinite, x itself is returned.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Celu", "summary": "ONNX Celu operation", "description": "Continuously Differentiable Exponential Linear Units:\n Perform the linear unit element-wise on the input tensor X\n using formula:\n \n ```\n max(0,x) + min(0,alpha*(exp(x/alpha)-1))\n ```", "operands": [ { "name": "X", "type": "TensorOf<[F32]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.CenterCropPad", "summary": "ONNX CenterCropPad operation", "description": "Center crop or pad an input to given dimensions.\n \n The crop/pad dimensions can be specified for a subset of the `axes`; unspecified dimensions will remain unchanged.\n \n If the input dimensions are larger than the target crop dimensions, a centered cropping window will be extracted\n from the input. The starting value for the cropping window is rounded down, which means that if the difference\n between the input shape and the crop shape is odd, the cropping window will be shifted half a pixel to the left\n of the input center.\n \n If the input dimensions are smaller than the target crop dimensions, the input will be padded equally on both sides\n to center it in the output. In cases where the total number of padding pixels is odd, an additional pixel will be\n added to the right side.\n \n The padding value used is zero.", "operands": [ { "name": "input_data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "shape", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output_data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" } ] }, { "name": "onnx.Clip", "summary": "ONNX Clip operation", "description": "Clip operator limits the given input within an interval. The interval is\n specified by the inputs 'min' and 'max'. They default to\n numeric_limits::lowest() and numeric_limits::max(), respectively.\n When 'min' is greater than 'max', the clip operator sets all the 'input' values to\n the value of 'max'. Thus, this is equivalent to 'Min(max, Max(input, min))'.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "min", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" }, { "name": "max", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.ClipV11", "summary": "ONNX Clip operation", "description": "Clip operator limits the given input within an interval. The interval is\n specified by the inputs 'min' and 'max'. They default to\n numeric_limits::lowest() and numeric_limits::max(), respectively.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "min", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "max", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.ClipV12", "summary": "ONNX Clip operation", "description": "Clip operator limits the given input within an interval. The interval is\n specified by the inputs 'min' and 'max'. They default to\n numeric_limits::lowest() and numeric_limits::max(), respectively.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "min", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "max", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.ClipV6", "summary": "ONNX Clip operation", "description": "Clip operator limits the given input within an interval. The interval is\n specified with arguments 'min' and 'max'. They default to\n numeric_limits::lowest() and numeric_limits::max() respectively.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "max", "type": "DefaultValuedAttr" }, { "name": "min", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Col2Im", "summary": "ONNX Col2Im operation", "description": "The operator rearranges column blocks back into a multidimensional image\n \n Col2Im behaves similarly to PyTorch's fold https://pytorch.org/docs/stable/generated/torch.nn.Fold.html,\n but it only supports *batched* multi-dimensional image tensors.\n Another implementation in Python with N-dimension support can be found at https://github.com/f-dangel/unfoldNd/.\n \n NOTE:\n Although specifying image_shape looks redundant because it could be calculated from\n convolution formulas, it is required as input for more advanced scenarios as explained\n at PyTorch's implementation (https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/Col2Im.cpp#L10)", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "image_shape", "type": "TensorOf<[I64]>" }, { "name": "block_shape", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "dilations", "type": "OptionalAttr>" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.Compress", "summary": "ONNX Compress operation", "description": "Selects slices from an input tensor along a given axis where condition evaluates to True for each axis index.\n In case axis is not provided, input is flattened before elements are selected.\n Compress behaves like numpy.compress: https://docs.scipy.org/doc/numpy/reference/generated/numpy.compress.html", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "condition", "type": "TensorOf<[I1]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ] }, { "name": "onnx.Concat", "summary": "ONNX Concat operation", "description": "Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.", "operands": [ { "name": "inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "results": [ { "name": "concat_result", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "SI64Attr" } ] }, { "name": "onnx.ConcatFromSequence", "summary": "ONNX ConcatFromSequence operation", "description": "Concatenate a sequence of tensors into a single tensor.\n All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.\n By default 'new_axis' is 0, the behavior is similar to numpy.concatenate.\n When 'new_axis' is 1, the behavior is similar to numpy.stack.", "operands": [ { "name": "input_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ], "results": [ { "name": "concat_result", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "SI64Attr" }, { "name": "new_axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ConcatShapeTranspose", "summary": "ONNX merged operation", "description": "Merge the following sequence of ops into one op\n v1 = onnx.concat\n v2 = onnx.shape(v1)\n v3 = onnx.transpose(v1)\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "results": [ { "name": "shape", "type": "TensorOf<[I64]>" }, { "name": "transposed", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "SI64Attr" }, { "name": "end", "type": "OptionalAttr" }, { "name": "start", "type": "DefaultValuedAttr" }, { "name": "perm", "type": "OptionalAttr>" } ] }, { "name": "onnx.Constant", "summary": "ONNX Constant operation", "description": "This operator produces a constant tensor. Exactly one of the provided attributes, either value, sparse_value,\n or value_* must be specified.", "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "attributes": [ { "name": "sparse_value", "type": "OptionalAttr" }, { "name": "value", "type": "OptionalAttr" }, { "name": "value_float", "type": "OptionalAttr" }, { "name": "value_floats", "type": "OptionalAttr>" }, { "name": "value_int", "type": "OptionalAttr" }, { "name": "value_ints", "type": "OptionalAttr>" }, { "name": "value_string", "type": "OptionalAttr" }, { "name": "value_strings", "type": "OptionalAttr>" } ], "hasCustomAssemblyFormat": true }, { "name": "onnx.ConstantOfShape", "category": "Shape", "summary": "ONNX ConstantOfShape operation", "description": "Generate a tensor with given value and shape.", "operands": [ { "name": "input", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I1]>, TensorOf<[BF16]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "attributes": [ { "name": "value", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "onnx.Conv", "category": "Layer", "summary": "ONNX Conv operation", "description": "The convolution operator consumes an input tensor and a filter, and\n computes the output.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "W", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "kernel_shape", "type": "OptionalAttr>" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.ConvInteger", "summary": "ONNX ConvInteger operation", "description": "The integer convolution operator consumes an input tensor, its zero-point, a filter, and its zero-point,\n and computes the output. The production MUST never overflow. The accumulation may overflow if and only if in 32 bits.", "operands": [ { "name": "x", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "w", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "x_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, NoneType]>" }, { "name": "w_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, NoneType]>" } ], "results": [ { "name": "y", "type": "TensorOf<[I32]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "kernel_shape", "type": "OptionalAttr>" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.ConvTranspose", "summary": "ONNX ConvTranspose operation", "description": "The convolution transpose operator consumes an input tensor and a filter,\n and computes the output.\n \n If the pads parameter is provided the shape of the output is calculated via the following equation:\n \n output_shape[i] = stride[i] * (input_size[i] - 1) + output_padding[i] + ((kernel_shape[i] - 1) * dilations[i] + 1) - pads[start_i] - pads[end_i]\n \n output_shape can also be explicitly specified in which case pads values are auto generated using these equations:\n \n total_padding[i] = stride[i] * (input_size[i] - 1) + output_padding[i] + ((kernel_shape[i] - 1) * dilations[i] + 1) - output_shape[i]\n If (auto_pads == SAME_UPPER): pads[start_i] = total_padding[i]/2; pads[end_i] = total_padding[i] - (total_padding[i]/2)\n Else: pads[start_i] = total_padding[i] - (total_padding[i]/2); pads[end_i] = (total_padding[i]/2).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "W", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "kernel_shape", "type": "OptionalAttr>" }, { "name": "output_padding", "type": "OptionalAttr>" }, { "name": "output_shape", "type": "OptionalAttr>" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.Cos", "summary": "ONNX Cos operation", "description": "Calculates the cosine of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Cosh", "summary": "ONNX Cosh operation", "description": "Calculates the hyperbolic cosine of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.CumSum", "summary": "ONNX CumSum operation", "description": "Performs cumulative sum of the input elements along the given axis.\n By default, it will do the sum inclusively meaning the first element is copied as is.\n Through an `exclusive` attribute, this behavior can change to exclude the first element.\n It can also perform summation in the opposite direction of the axis. For that, set `reverse` attribute to 1.\n \n Example:\n ```\n input_x = [1, 2, 3]\n axis=0\n output = [1, 3, 6]\n exclusive=1\n output = [0, 1, 3]\n exclusive=0\n reverse=1\n output = [6, 5, 3]\n exclusive=1\n reverse=1\n output = [5, 3, 0]\n ```", "operands": [ { "name": "x", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axis", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "y", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "exclusive", "type": "DefaultValuedAttr" }, { "name": "reverse", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Custom", "summary": "ONNX Custom operation", "description": "CustomOp is not an Op defined in onnx standard and was added to support\n extention of Op that can be transformed or finally call a user-defined\n external function.\"\n\n It allows for calling a user-defined operation, with a single required\n attribute being a string that names the operation. Other inputs are passed\n to the user operation.\n\n The number of inputs and outputs can vary.\n\n NoneType is allowed for both input and output, as the CustomOp may require\n a fixed number of inputs/outputs for the external function call.\n\n In addition to the values passed to the user-defined operation, certain\n attributes are introduced to facilitate the analysis and transformation of\n CustomOp.\n\n Since the compiler does not define the semantics of CustomOp, onnx-mlir\n cannot infer the shape of its output. Consequently, specific attributes are\n introduced to specify how shape inference should be performed on a CustomOp.\n These attributes are:\n 'inputs_for_infer':\n Optional. The index of inputs used for shape inference.\n The value of index should be [0, the number of inputs).\n If not specified, all the inputs of the CustomOp will be used for\n shape inference.\n 'shape_infer_pattern':\n Optional. Specify how to propagate the shape info from the inputs\n (may be limited by inputs_for_infer) to output. Current supported\n patterns are `SameAs`, `MDBroadcast`.\n 'output_element_type':\n Optional. The element type for the output tensor. If not specified,\n follow the shape infer pattern behavior. Usually the element type of\n the first input is used.\n Each instance of CustomOp can have its own attributes for shape inference,\n allowing for customization. However, CustomOps with the same function_name\n typically behave similarly in terms of shape inference, and therefore have\n the same attributes.\n\n The existing shape inference patterns for ONNX ops are reused for CustomOp,\n with the polymorphism in shape inference based on its attribute values.\n Due to the current implementation for ONNX Ops, a CustomOp with specified\n shape inference attributes supports only a single output, rather than\n variadic outputs.\n\n When attributes for shape inference are not provided, the shape inference\n for CustomOp will simply pass through.\n\n All of these additional attributes are optional, designed to be less\n intrusive. The .mlir file can remain the same when a new attribute is\n added.", "operands": [ { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "outputs", "type": "Variadic>" } ], "attributes": [ { "name": "function_name", "type": "StrAttr" }, { "name": "output_element_type", "type": "OptionalAttr" }, { "name": "shape_infer_pattern", "type": "OptionalAttr" }, { "name": "inputs_for_infer", "type": "OptionalAttr>" } ] }, { "name": "onnx.DeformConv", "summary": "ONNX DeformConv operation", "description": "Performs deformable convolution as described in https://arxiv.org/abs/1703.06211 and https://arxiv.org/abs/1811.11168.\n This operator specification supports the general N-D case. Note that most common use cases have 2D or 3D data.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "W", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "offset", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "mask", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "dilations", "type": "OptionalAttr>" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "kernel_shape", "type": "OptionalAttr>" }, { "name": "offset_group", "type": "DefaultValuedAttr" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.DepthToSpace", "summary": "ONNX DepthToSpace operation", "description": "DepthToSpace rearranges (permutes) data from depth into blocks of spatial data.\n This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of\n the input tensor where values from the depth dimension are moved in spatial blocks to the height\n and width dimensions. By default, `mode` = `DCR`.\n In the DCR mode, elements along the depth dimension from the input tensor are rearranged in the\n following order: depth, column, and then row. The output y is computed from the input x as below:\n \n ```\n b, c, h, w = x.shape\n tmp = np.reshape(x, [b, blocksize, blocksize, c // (blocksize**2), h, w])\n tmp = np.transpose(tmp, [0, 3, 4, 1, 5, 2])\n y = np.reshape(tmp, [b, c // (blocksize**2), h * blocksize, w * blocksize])\n ```\n \n In the CRD mode, elements along the depth dimension from the input tensor are rearranged in the\n following order: column, row, and the depth. The output y is computed from the input x as below:\n \n ```\n b, c, h, w = x.shape\n tmp = np.reshape(x, [b, c // (blocksize ** 2), blocksize, blocksize, h, w])\n tmp = np.transpose(tmp, [0, 1, 4, 2, 5, 3])\n y = np.reshape(tmp, [b, c // (blocksize ** 2), h * blocksize, w * blocksize])\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "blocksize", "type": "SI64Attr" }, { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.DequantizeLinear", "summary": "ONNX DequantizeLinear operation", "description": "The linear dequantization operator. It consumes a quantized tensor, a scale, and a zero point to compute the full precision tensor.\n The dequantization formula is `y = (x - x_zero_point) * x_scale`. `x_scale` and `x_zero_point` must have same shape, and can be either a scalar\n for per-tensor / per layer quantization, or a 1-D tensor for per-axis quantization.\n `x_zero_point` and `x` must have same type. `x` and `y` must have same shape. In the case of dequantizing int32,\n there's no zero point (zero point is supposed to be 0).\n `zero-point` is usually not used in the case of float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz quantization,\n but the dequantization formula remains the same for consistency and 'x_scale' still determines the output type.", "operands": [ { "name": "x", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, TensorOf<[I32]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" }, { "name": "x_scale", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[BF16]>]>" }, { "name": "x_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, TensorOf<[I32]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, NoneType]>" } ], "results": [ { "name": "y", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Det", "summary": "ONNX Det operation", "description": "Det calculates determinant of a square matrix or batches of square matrices.\n Det takes one input tensor of shape `[*, M, M]`, where `*` is zero or more batch dimensions,\n and the inner-most 2 dimensions form square matrices.\n The output is a tensor of shape `[*]`, containing the determinants of all input submatrices.\n e.g., When the input is 2-D, the output is a scalar(shape is empty: `[]`).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.DFT", "summary": "ONNX DFT operation", "description": "Computes the discrete Fourier Transform (DFT) of the input.\n \n Assuming the input has shape `[M, N]`, where `N` is the dimension over which the\n DFT is computed and `M` denotes the conceptual \\\"all other dimensions,\\\"\n the DFT `y[m, k]` of shape `[M, N]` is defined as\n \n $$y[m, k] = \\sum_{n=0}^{N-1} e^{-2 \\pi j \\frac{k n}{N} } x[m, n] ,$$\n \n and the inverse transform is defined as\n \n $$x[m, n] = \\frac{1}{N} \\sum_{k=0}^{N-1} e^{2 \\pi j \\frac{k n}{N} } y[m, k] ,$$\n \n where $j$ is the imaginary unit.\n \n The actual shape of the output is specified in the \\\"output\\\" section.\n \n Reference: https://docs.scipy.org/doc/scipy/tutorial/fft.html", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "dft_length", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" }, { "name": "axis", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "inverse", "type": "DefaultValuedAttr" }, { "name": "onesided", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.DFTV17", "summary": "ONNX DFT operation", "description": "Computes the discrete Fourier transform of input.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "dft_length", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "inverse", "type": "DefaultValuedAttr" }, { "name": "onesided", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.DictVectorizer", "summary": "ONNX DictVectorizer operation", "description": "Uses an index mapping to convert a dictionary to an array.
\n Given a dictionary, each key is looked up in the vocabulary attribute corresponding to\n the key type. The index into the vocabulary array at which the key is found is then\n used to index the output 1-D tensor 'Y' and insert into it the value found in the dictionary 'X'.
\n The key type of the input map must correspond to the element type of the defined vocabulary attribute.\n Therefore, the output array will be equal in length to the index mapping vector parameter.\n All keys in the input dictionary must be present in the index mapping vector.\n For each item in the input dictionary, insert its value in the output array.\n Any keys not present in the input dictionary, will be zero in the output array.
\n For example: if the ``string_vocabulary`` parameter is set to ``[\\\"a\\\", \\\"c\\\", \\\"b\\\", \\\"z\\\"]``,\n then an input of ``{\\\"a\\\": 4, \\\"c\\\": 8}`` will produce an output of ``[4, 8, 0, 0]``.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TupleOf<[StringType, I64]>, TupleOf<[I64, StringType]>, TupleOf<[I64, F32]>, TupleOf<[I64, F64]>, TupleOf<[StringType, F32]>, TupleOf<[StringType, F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[I64]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>]>" } ], "attributes": [ { "name": "int64_vocabulary", "type": "OptionalAttr>" }, { "name": "string_vocabulary", "type": "OptionalAttr>" } ] }, { "name": "onnx.Dim", "summary": "ONNX dimensions operation.", "description": "This operation is to obtain the dimension of a Tensor;\n\n ```\n \"onnx.Dim\"(%tensor) {axis = 0 : si64} : (tensor) -> tensor<1xi64>\n ```\n\n The axis identifies the dimension within the shape which is going to be obtained.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "dim", "type": "TensorOf<[I64]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.DimGroup", "summary": "ONNX dimension group operation.", "description": "This operation is to link a compile-time unknown dimension of a Tensor\n to a group id. Two dimensions that have the same group id are expected\n to be equal at runtime.\n\n ```\n \"onnx.DimGroup\"(%tensor) {axis = 0 : si64, group_id = 1: si64} : (tensor) -> ()\n ```\n\n `axis` identifies the dimension position in the tensor.\n\n `group_id` identifies the group id of the dimension. It is non-negative.\n Value -1 for `group_id` means the dimension does not belong to any group.\n\n This operation is currently used in the pass `--onnx-dim-analysis`\n for testing the unknown dimension analysis class.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "group_id", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Div", "summary": "ONNX Div operation", "description": "Performs element-wise binary division (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).\n \n For integer inputs, the result is computed using truncating division (rounding toward zero).\n (Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Dropout", "summary": "ONNX Dropout operation", "description": "Dropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional input training_mode (boolean scalar). It produces two tensor outputs,\n output (floating-point tensor) and mask (optional `Tensor`). If `training_mode` is true then the output Y will be a random dropout;\n Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode,\n the user can simply not pass `training_mode` input or set it to false.\n ```\n output = scale * data * mask,\n ```\n where\n ```\n scale = 1. / (1. - ratio).\n ```\n This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" }, { "name": "ratio", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, NoneType]>" }, { "name": "training_mode", "type": "AnyTypeOf<[TensorOf<[I1]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" }, { "name": "mask", "type": "AnyTypeOf<[TensorOf<[I1]>, NoneType]>" } ], "attributes": [ { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "onnx.DynamicQuantizeLinear", "summary": "ONNX DynamicQuantizeLinear operation", "description": "A Function to fuse calculation for Scale, Zero Point and FP32->8Bit conversion of FP32 Input data.\n Outputs Scale, ZeroPoint and Quantized Input for a given FP32 Input.\n Scale is calculated as:\n ```\n y_scale = (maximum(0, max(x)) - minimum(0, min(x))) / (qmax - qmin)\n ```\n \n * where qmax and qmin are max and min values for quantization range i.e. [0, 255] in case of uint8\n * data range is adjusted to include 0.\n \n Zero point is calculated as:\n ```\n intermediate_zero_point = qmin - min(x)/y_scale\n y_zero_point = cast(round(saturate(intermediate_zero_point)))\n ```\n \n * where qmax and qmin are max and min values for quantization range .i.e [0, 255] in case of uint8\n * for saturation, it saturates to [0, 255] if it's uint8, or [-127, 127] if it's int8. Right now only uint8 is supported.\n * rounding to nearest ties to even.\n \n Data quantization formula is:\n ```\n y = saturate (round (x / y_scale) + y_zero_point)\n ```\n \n * for saturation, it saturates to [0, 255] if it's uint8, or [-127, 127] if it's int8. Right now only uint8 is supported.\n * rounding to nearest ties to even.", "operands": [ { "name": "x", "type": "TensorOf<[F32]>" } ], "results": [ { "name": "y", "type": "TensorOf<[UI8]>" }, { "name": "y_scale", "type": "TensorOf<[F32]>" }, { "name": "y_zero_point", "type": "TensorOf<[UI8]>" } ] }, { "name": "onnx.Einsum", "summary": "ONNX Einsum operation", "description": "An einsum of the form `term1, term2 -> output-term` produces an output tensor using the following equation\n \n ```\n output[output-term] = reduce-sum( input1[term1] * input2[term2] )\n ```\n \n where the reduce-sum performs a summation over all the indices occurring in the input terms (term1, term2)\n that do not occur in the output-term.\n \n The Einsum operator evaluates algebraic tensor operations on a sequence of tensors, using the Einstein summation\n convention. The equation string contains a comma-separated sequence of lower case letters. Each term corresponds to\n an operand tensor, and the characters within the terms correspond to operands dimensions.\n \n This sequence may be followed by \\\"->\\\" to separate the left and right hand side of the equation.\n If the equation contains \\\"->\\\" followed by the right-hand side, the explicit (not classical) form of the Einstein\n summation is performed, and the right-hand side indices indicate output tensor dimensions. In other cases,\n output indices are (implicitly) set to the alphabetically sorted sequence of indices appearing exactly once in the\n equation.\n \n When a dimension character is repeated in the left-hand side, it represents summation along the dimension.\n \n The equation may contain ellipsis (\\\"...\\\") to enable broadcasting. Ellipsis must indicate a fixed number of dimensions.\n Specifically, every occurrence of ellipsis in the equation must represent the same number of dimensions.\n The right-hand side may contain exactly one ellipsis. In implicit mode, the ellipsis dimensions are set to the\n beginning of the output. The equation string may contain space (U+0020) character.", "operands": [ { "name": "Inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] > ]>>" } ], "results": [ { "name": "Output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "equation", "type": "StrAttr" } ] }, { "name": "onnx.Elu", "summary": "ONNX Elu operation", "description": "Elu takes one input data (Tensor) and produces one output data\n (Tensor) where the function `f(x) = alpha * (exp(x) - 1.) for x <\n 0`, `f(x) = x for x >= 0`., is applied to the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.EntryPoint", "summary": "Indicate ONNX entry point", "description": "The \"onnx.EntryPoint\" function indicates the main entry point of ONNX model.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "attributes": [ { "name": "func", "type": "SymbolRefAttr" } ] }, { "name": "onnx.Equal", "summary": "ONNX Equal operation", "description": "Returns the tensor resulted from performing the `equal` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[I1]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[StringType]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[I1]>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[StringType]>]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.Erf", "summary": "ONNX Erf operation", "description": "Computes the error function of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Exp", "summary": "ONNX Exp operation", "description": "Calculates the exponential of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Expand", "summary": "ONNX Expand operation", "description": "Broadcast the input tensor following the given shape and the broadcast rule.\n The broadcast rule is similar to numpy.array(input) * numpy.ones(shape):\n Dimensions are right alignment;\n Two corresponding dimensions must have the same value, or one of them is equal to 1.\n Also, this operator is similar to numpy.broadcast_to(input, shape),\n but the major difference is numpy.broadcast_to() does not allow shape to be smaller than input.size().\n It is possible that the output.shape is not equal to shape, when some dimensions in shape is equal to 1,\n or the shape.ndim < input.shape.ndim.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "shape", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ] }, { "name": "onnx.EyeLike", "summary": "ONNX EyeLike operation", "description": "Generate a 2D tensor (matrix) with ones on the diagonal and zeros everywhere else. Only 2D\n tensors are supported, i.e. input T1 must be of rank 2. The shape of the output tensor is the\n same as the input tensor. The data type can be specified by the 'dtype' argument. If\n 'dtype' is not specified, then the type of input tensor is used. By default, the main diagonal\n is populated with ones, but attribute 'k' can be used to populate upper or lower diagonals.\n The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the\n TensorProto message and be valid as an output type.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I1]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I1]>]>" } ], "attributes": [ { "name": "dtype", "type": "OptionalAttr" }, { "name": "k", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.FeatureVectorizer", "summary": "ONNX FeatureVectorizer operation", "description": "Concatenates input tensors into one continuous output.
\n All input shapes are 2-D and are concatenated along the second dimension. 1-D tensors are treated as [1,C].\n Inputs are copied to the output maintaining the order of the input arguments.
\n All inputs must be integers or floats, while the output will be all floating point values.", "operands": [ { "name": "X", "type": "Variadic, TensorOf < [ I64 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] > ]>>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "inputdimensions", "type": "OptionalAttr>" } ] }, { "name": "onnx.Flatten", "summary": "ONNX Flatten operation", "description": "Flattens the input tensor into a 2D matrix. If input tensor has shape\n (d_0, d_1, ... d_n) then the output will have shape\n (d_0 X d_1 ... d_(axis-1), d_axis X d_(axis+1) ... X dn).", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Floor", "summary": "ONNX Floor operation", "description": "Floor takes one input data (Tensor) and produces one output data\n (Tensor) where the floor is, y = floor(x), is applied to\n the tensor elementwise. If x is integral, +0, -0, NaN, or infinite, x itself is returned.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Fused", "summary": "Fused ONNX operation container", "description": "A container for a sequence of ONNX operations to be lowered jointly in one\n custom code-generation step. The `kind` attribute identifies the specific\n fusion pattern so the lowering pass can dispatch to the right generator.\n\n The body region is IsolatedFromAbove: all external tensor values must be\n listed as `inputs` and are available inside as block arguments in the same\n order. Optional (NoneType) values are NOT threaded through `inputs`;\n instead an ONNXNoneOp is created inside the body for each None operand.\n\n Shape inference delegates to the contained operations: the greedy rewriter\n visits every inner op and infers its output types; the YieldOp terminator\n then drives re-inference of the FusedOp's own result types.\n\n This operation is not part of the ONNX standard and was added to assist\n onnx-mlir.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "kind", "type": "StrAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "onnx.Gather", "category": "Tensor", "summary": "ONNX Gather operation", "description": "Given `data` tensor of rank r >= 1, and `indices` tensor of rank q, gather\n entries of the axis dimension of `data` (by default outer-most one as axis=0) indexed by `indices`, and concatenates\n them in an output tensor of rank q + (r - 1).\n \n It is an indexing operation that indexes into the input `data` along a single (specified) axis.\n Each entry in `indices` produces a `r-1` dimensional slice of the input tensor.\n The entire operation produces, conceptually, a `q`-dimensional tensor of `r-1` dimensional slices,\n which is arranged into a `q + (r-1)`-dimensional tensor, with the `q` dimensions taking the\n place of the original `axis` that is being indexed into.\n \n The following few examples illustrate how `Gather` works for specific shapes of `data`,\n `indices`, and given value of `axis`:\n | data shape | indices shape | axis | output shape | output equation |\n | --- | --- | --- | --- | --- |\n | (P, Q) | ( ) (a scalar) | 0 | (Q) | output[q] = data[indices, q] |\n | (P, Q, R) | ( ) (a scalar) | 1 | (P, R) | output[p, r] = data[p, indices, r] |\n | (P, Q) | (R, S) | 0 | (R, S, Q) | output[r, s, q] = data[ [indices[r, s], q] |\n | (P, Q) | (R, S) | 1 | (P, R, S) | output[p, r, s] = data[ p, indices[r, s]] |\n \n More generally, if `axis = 0`, let `k = indices[i_{0}, ..., i_{q-1\\}\\]`\n then `output[i_{0}, ..., i_{q-1}, j_{0}, ..., j_{r-2\\}\\] = input[k , j_{0}, ..., j_{r-2\\}\\]`:\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n indices = [\n [0, 1],\n [1, 2],\n ]\n output = [\n [\n [1.0, 1.2],\n [2.3, 3.4],\n ],\n [\n [2.3, 3.4],\n [4.5, 5.7],\n ],\n ]\n ```\n \n If `axis = 1`, let `k = indices[i_{0}, ..., i_{q-1\\}\\]`\n then `output[j_{0}, i_{0}, ..., i_{q-1}, j_{1}, ..., j_{r-2\\}\\] = input[j_{0}, k, j_{1}, ..., j_{r-2\\}\\]`:\n \n ```\n data = [\n [1.0, 1.2, 1.9],\n [2.3, 3.4, 3.9],\n [4.5, 5.7, 5.9],\n ]\n indices = [\n [0, 2],\n ]\n axis = 1,\n output = [\n [[1.0, 1.9]],\n [[2.3, 3.9]],\n [[4.5, 5.9]],\n ]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.GatherElements", "summary": "ONNX GatherElements operation", "description": "GatherElements takes two inputs `data` and `indices` of the same rank r >= 1\n and an optional attribute `axis` that identifies an axis of `data`\n (by default, the outer-most axis, that is axis 0). It is an indexing operation\n that produces its output by indexing into the input data tensor at index\n positions determined by elements of the `indices` tensor.\n Its output shape is the same as the shape of `indices` and consists of one value\n (gathered from the `data`) for each element in `indices`.\n \n For instance, in the 3-D case (r = 3), the output produced is determined\n by the following equations:\n ```\n out[i][j][k] = input[index[i][j][k]][j][k] if axis = 0,\n out[i][j][k] = input[i][index[i][j][k]][k] if axis = 1,\n out[i][j][k] = input[i][j][index[i][j][k]] if axis = 2,\n ```\n \n This operator is also the inverse of ScatterElements. It is similar to Torch's gather operation.\n \n Example 1:\n ```\n data = [\n [1, 2],\n [3, 4],\n ]\n indices = [\n [0, 0],\n [1, 0],\n ]\n axis = 1\n output = [\n [1, 1],\n [4, 3],\n ]\n ```\n Example 2:\n ```\n data = [\n [1, 2, 3],\n [4, 5, 6],\n [7, 8, 9],\n ]\n indices = [\n [1, 2, 0],\n [2, 0, 0],\n ]\n axis = 0\n output = [\n [4, 8, 3],\n [7, 2, 3],\n ]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.GatherND", "summary": "ONNX GatherND operation", "description": "Given `data` tensor of rank `r` >= 1, `indices` tensor of rank `q` >= 1, and `batch_dims` integer `b`, this operator gathers\n slices of `data` into an output tensor of rank `q + r - indices_shape[-1] - 1 - b`.\n \n `indices` is an q-dimensional integer tensor, best thought of as a `(q-1)`-dimensional tensor of index-tuples into `data`,\n where each element defines a slice of `data`\n \n `batch_dims` (denoted as `b`) is an integer indicating the number of batch dimensions, i.e the leading `b` number of dimensions of\n `data` tensor and `indices` are representing the batches, and the gather starts from the `b+1` dimension.\n \n Some salient points about the inputs' rank and shape:\n \n 1) r >= 1 and q >= 1 are to be honored. There is no dependency condition to be met between ranks `r` and `q`\n \n 2) The first `b` dimensions of the shape of `indices` tensor and `data` tensor must be equal.\n \n 3) b < min(q, r) is to be honored.\n \n 4) The `indices_shape[-1]` should have a value between 1 (inclusive) and rank `r-b` (inclusive)\n \n 5) All values in `indices` are expected to be within bounds [-s, s-1] along axis of size `s` (i.e.) `-data_shape[i] <= indices[...,i] <= data_shape[i] - 1`.\n It is an error if any of the index values are out of bounds.\n \n The output is computed as follows:\n \n The output tensor is obtained by mapping each index-tuple in the `indices` tensor to the corresponding slice of the input `data`.\n \n 1) If `indices_shape[-1] > r-b` => error condition\n \n 2) If `indices_shape[-1] == r-b`, since the rank of `indices` is `q`, `indices` can be thought of as `N` `(q-b-1)`-dimensional tensors\n containing 1-D tensors of dimension `r-b`, where `N` is an integer equals to the product of 1 and all the elements in the batch dimensions\n of the indices_shape. Let us think of each such `r-b` ranked tensor as `indices_slice`. Each *scalar value* corresponding to `data[0:b-1,indices_slice]`\n is filled into the corresponding location of the `(q-b-1)`-dimensional tensor to form the `output` tensor (Example 1 below)\n \n 3) If `indices_shape[-1] < r-b`, since the rank of `indices` is `q`, `indices` can be thought of as `N` `(q-b-1)`-dimensional tensor\n containing 1-D tensors of dimension `< r-b`. Let us think of each such tensors as `indices_slice`. Each *tensor slice* corresponding\n to `data[0:b-1, indices_slice , :]` is filled into the corresponding location of the `(q-b-1)`-dimensional tensor\n to form the `output` tensor (Examples 2, 3, 4 and 5 below)\n \n This operator is the inverse of `ScatterND`.\n \n **Example 1**\n \n ```\n batch_dims = 0\n data = [[0,1],[2,3]] # data_shape = [2, 2]\n indices = [[0,0],[1,1]] # indices_shape = [2, 2]\n output = [0,3] # output_shape = [2]\n ```\n \n **Example 2**\n \n ```\n batch_dims = 0\n data = [[0,1],[2,3]] # data_shape = [2, 2]\n indices = [[1],[0]] # indices_shape = [2, 1]\n output = [[2,3],[0,1]] # output_shape = [2, 2]\n ```\n \n **Example 3**\n \n ```\n batch_dims = 0\n data = [[[0,1],[2,3]],[[4,5],[6,7]]] # data_shape = [2, 2, 2]\n indices = [[0,1],[1,0]] # indices_shape = [2, 2]\n output = [[2,3],[4,5]] # output_shape = [2, 2]\n ```\n \n **Example 4**\n \n ```\n batch_dims = 0\n data = [[[0,1],[2,3]],[[4,5],[6,7]]] # data_shape = [2, 2, 2]\n indices = [[[0,1]],[[1,0]]] # indices_shape = [2, 1, 2]\n output = [[[2,3]],[[4,5]]] # output_shape = [2, 1, 2]\n ```\n \n **Example 5**\n \n ```\n batch_dims = 1\n data = [[[0,1],[2,3]],[[4,5],[6,7]]] # data_shape = [2, 2, 2]\n indices = [[1],[0]] # indices_shape = [2, 1]\n output = [[2,3],[4,5]] # output_shape = [2, 2]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "batch_dims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Gelu", "summary": "ONNX Gelu operation", "description": "Gelu takes one input data (Tensor) and produces one\n output data (Tensor) where the gaussian error linear units function,\n $y = 0.5 * x * (1 + erf(x/sqrt(2)))$ is applied to the tensor elementwise.\n If the attribute \\\"approximate\\\" is set to \\\"tanh\\\", the function estimation,\n $y = 0.5 * x * (1 + Tanh(sqrt(2/\\pi) * (x + 0.044715 * x^3)))$ is used and applied\n to the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "approximate", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.Gemm", "summary": "ONNX Gemm operation", "description": "General Matrix multiplication:\n https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3\n \n * A' = transpose(A) if transA else A\n * B' = transpose(B) if transB else B\n \n Compute Y = alpha * A' * B' + beta * C, where input tensor A has shape (M, K) or (K, M),\n input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N),\n and output tensor Y has shape (M, N). A will be transposed before doing the\n computation if attribute transA is non-zero, same for B and transB.\n This operator supports **unidirectional broadcasting** (tensor C should be unidirectional broadcastable to tensor A * B); for more details please check [the doc](Broadcasting.md).\n This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>]>" }, { "name": "C", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "transA", "type": "DefaultValuedAttr" }, { "name": "transB", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.GlobalAveragePool", "summary": "ONNX GlobalAveragePool operation", "description": "GlobalAveragePool consumes an input tensor X and applies average pooling across\n the values in the same channel. This is equivalent to AveragePool with kernel size\n equal to the spatial dimension of input tensor.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.GlobalLpPool", "summary": "ONNX GlobalLpPool operation", "description": "GlobalLpPool consumes an input tensor X and applies lp pool pooling across\n the values in the same channel. This is equivalent to LpPool with kernel size\n equal to the spatial dimension of input tensor.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "p", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.GlobalMaxPool", "summary": "ONNX GlobalMaxPool operation", "description": "GlobalMaxPool consumes an input tensor X and applies max pooling across\n the values in the same channel. This is equivalent to MaxPool with kernel size\n equal to the spatial dimension of input tensor.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Gradient", "summary": "ONNX Gradient operation", "description": "Gradient operator computes the partial derivatives of a specific tensor w.r.t.\n some other tensors. This operator is widely used in gradient-based training\n algorithms. To illustrate its use, let's consider a computation graph,\n \n ```\n X -----.\n |\n v\n W --> Conv --> H --> Gemm --> Y\n ^\n |\n Z\n ```\n \n , where W and Z are trainable tensors. Note that operators' attributes are\n omitted for the sake of simplicity. Let dY/dW (dY/dZ) be the gradient of\n Y with respect to W (Z). The user can compute gradient by inserting Gradient\n operator to form another graph shown below.\n \n ```\n W --> Conv --> H --> Gemm --> Y\n | ^ ^\n | | |\n | X Z\n | | |\n | | .----------'\n | | | (W/Z/X is the 1st/2nd/3rd input of Gradient as shown in\n | | | \\\"xs\\\" followed by \\\"zs\\\")\n | v v\n '---> Gradient(xs=[\\\"W\\\", \\\"Z\\\"], zs=[\\\"X\\\"], y=\\\"Y\\\")\n | |\n | '-----------------------------------> dY/dW (1st output of Gradient)\n |\n '---------------------------------------> dY/dZ (2nd output of Gradient)\n ```\n \n By definition, the tensor \\\"y\\\" is a function of independent variables in \\\"xs\\\"\n and \\\"zs\\\". Since we only compute the gradient of \\\"y\\\" w.r.t. the differentiable\n variables in \\\"xs\\\", this Gradient only outputs dY/dW and dY/dZ. Note that \\\"H\\\"\n cannot appear in \\\"xs\\\" and \\\"zs\\\". The reason is that \\\"H\\\" can be determined by\n tensors \\\"W\\\" and \\\"X\\\" and therefore \\\"H\\\" is not an independent variable.\n \n All outputs are optional. If needed, for example, user can assign an empty\n string to the 1st output name of that Gradient to skip the generation of dY/dW.\n Note that the concept of optional outputs can also be found in ONNX's RNN, GRU,\n and LSTM.\n \n Gradient operator can compute derivative against intermediate tensors. For\n example, the gradient of Y with respect to H can be done via\n \n ```\n W --> Conv --> H --> Gemm --> Y\n ^ | ^\n | | |\n X | Z\n .-------' |\n | .----------'\n | | (H/Z is the 1st/2nd input of Gradient as shown in \\\"xs\\\")\n v v\n Gradient(xs=[\\\"H\\\", \\\"Z\\\"], y=\\\"Y\\\")\n | |\n | '-----------------------------------> dY/dH (1st output of Gradient)\n |\n '---------------------------------------> dY/dZ (2nd output of Gradient)\n ```\n \n It is possible to represent high-order differentiation using Gradient operators.\n For example, given the following linear model:\n \n ```\n W --> Gemm --> Y --> Loss --> O\n ^ ^\n | |\n X L\n ```\n \n To compute the 2nd order derivative of O with respect to W (denoted by\n d^2O/dW^2), one can do\n \n ```\n W --> Gemm --> Y --> Loss --> O\n | ^ ^\n | | |\n | X .------------L\n | | | |\n | | | v\n +------+-+> Gradient(xs=[\\\"X\\\", \\\"W\\\"], zs=[\\\"L\\\"], y=\\\"O\\\") ---> dO/dX (1st output of Gradient)\n | | | |\n | | | '---> dO/dW (2nd output of Gradient)\n | v v\n '---> Gradient(xs=[\\\"X\\\", \\\"W\\\"], zs=[\\\"L\\\"], y=\\\"dO/dW\\\") ---> d(dO/dW)dX (1st output of\n | Gradient)\n |\n |\n '---> d^2O/dW^2 (2nd output of Gradient)\n ```\n \n The tensors named in attributes \\\"xs\\\", \\\"zs\\\", and \\\"y\\\" define the differentiated\n computation graph, and the inputs to Gradient node define the values at\n which the gradient is computed. We can feed different tensors to the identified\n graph. For example, one can compute the gradient of Y with respect to H at\n a specific value of H, H_1, by providing that value as an input to the Gradient\n node.\n \n ```\n W --> Conv --> H --> Gemm --> Y\n ^ ^\n | |\n X Z\n \n Z_1 (2nd input of Gradient)\n |\n v\n H_1 --> Gradient(xs=[\\\"H\\\", \\\"Z\\\"], y=\\\"Y\\\") ---> dY/dH when H = H_1 and Y = Y_1.\n |\n '------------------------------> dY/dZ (2nd output of Gradient)\n ```\n \n When the inputs of Gradient are the tensors named in \\\"xs\\\" and \\\"zs\\\", the\n computation can be optimized. More specifically, intermediate variables in\n forward pass can be reused if the gradient is computed via reverse-mode\n auto-differentiation.", "operands": [ { "name": "Inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "results": [ { "name": "Outputs", "type": "Variadic, TensorOf < [ F32 ] >, TensorOf < [ F64 ] > ]>>" } ], "attributes": [ { "name": "xs", "type": "TypedArrayAttrBase" }, { "name": "y", "type": "StrAttr" }, { "name": "zs", "type": "OptionalAttr>" } ] }, { "name": "onnx.Greater", "summary": "ONNX Greater operation", "description": "Returns the tensor resulted from performing the `greater` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.GreaterOrEqual", "summary": "ONNX GreaterOrEqual operation", "description": "Returns the tensor resulted from performing the `greater_equal` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.GridSample", "summary": "ONNX GridSample operation", "description": "Given an input `X` and a flow-field `grid`, computes the output `Y` using `X` values and pixel locations from the `grid`.\n For spatial input `X` with shape (N, C, H, W), the `grid` will have shape (N, H_out, W_out, 2),\n the output `Y` will have shape (N, C, H_out, W_out). For volumetric input `X` with shape (N, C, D, H, W),\n the `grid` will have shape (N, D_out, H_out, W_out, 3), the output `Y` will have shape (N, C, D_out, H_out, W_out).\n More generally, for an input `X` of rank r+2 with shape (N, C, d1, d2, ..., dr),\n the `grid` will have shape (N, D1_out, D2_out, ..., Dr_out, r), the output `Y` will have shape (N, C, D1_out, D2_out, ..., Dr_out).\n \n The tensor `X` contains values at centers of square pixels (voxels, etc) locations such as (n, c, d1_in, d2_in, ..., dr_in).\n The (n, d1_out, d2_out, ..., dr_out, :) values from the tensor `grid` are the normalized positions for interpolating the values\n at the (n, c, d1_out, d2_out, ..., dr_out) locations from the output tensor `Y` using a specified interpolation method (the mode)\n and a padding mode (for `grid` positions falling outside the 2-dimensional image).\n \n For example, the values in `grid[n, h_out, w_out, :]` are size-2 vectors specifying normalized positions in the 2-dimensional space of `X`.\n They are used to interpolate output values of `Y[n, c, h_out, w_out]`.\n \n The GridSample operator is often used in doing grid generator and sampler in the\n [Spatial Transformer Networks](https://arxiv.org/abs/1506.02025).\n See also in [torch.nn.functional.grid_sample](https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "grid", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "align_corners", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "padding_mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.GridSampleV16", "summary": "ONNX GridSample operation", "description": "Given an input `X` and a flow-field `grid`, computes the output `Y` using `X` values and pixel locations from `grid`.\n Currently, only spatial (4-D) inputs are supported. For input `X` with shape (N, C, H, W) and `grid` with shape (N, H_out, W_out, 2),\n the output `Y` will have shape (N, C, H_out, W_out).\n \n The tensor `X` contains values at centers of square pixels in a H by W 2-dimensional image.\n The tensor `grid` describes normalized positions where the output `Y` is to be computed\n using a specified interpolation method (the mode) and a padding mode (for grid positions falling outside the 2-dimensional image).\n \n Elements in `grid[N, H_out, W_out]` are size-2 vectors specifying positions in the 2-dimensional space of `X`.\n They are used to interpolate output values of `Y[N, C, H_out, W_out]`.\n \n The GridSample operator is often used in doing grid generator and sampler in the [Spatial Transformer Networks](https://arxiv.org/abs/1506.02025).\n See also in [torch.nn.functional.grid_sample](https://pytorch.org/docs/master/generated/torch.nn.functional.grid_sample.html#torch-nn-functional-grid-sample).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "grid", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "align_corners", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "padding_mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.GroupNormalization", "summary": "ONNX GroupNormalization operation", "description": "A GroupNormalization function. Carries out group normalization as described in\n the paper https://arxiv.org/abs/1803.08494\n \n This operator transforms input according to\n ```\n y = scale * (x - mean) / sqrt(variance + epsilon) + bias,\n ```\n where the mean and variance are computed per instance per group of channels, and\n `scale` and `bias` should be specified for each channel. The number of\n groups `num_groups` should be divisible by the number of channels so that there are\n an equal number of channels per group.\n \n The overall computation has two stages: the first stage normalizes the elements to\n have zero mean and unit variance for each instance in each group, and the second\n stage scales and shifts the results of the first stage. The floating-point precision\n used in the first stage is determined by the `stash_type` attribute. For example,\n if `stash_type` is 1, the operator casts all input variables to 32-bit float,\n performs the computation, and finally casts the normalized results back to the\n original type of `X`. The second stage does not depend on `stash_type`.\n \n When the number of groups is the same as the number of channels, this operator is\n equivalent to InstanceNormalization. When there is only one group, this operator\n is equivalent to LayerNormalization.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "scale", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "bias", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "num_groups", "type": "SI64Attr" }, { "name": "stash_type", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.GroupNormalizationV18", "summary": "ONNX GroupNormalization operation", "description": "A GroupNormalization function. Carries out group normalization as described in\n the paper https://arxiv.org/abs/1803.08494\n \n This operator transforms input according to\n ```\n y = scale * (x - mean) / sqrt(variance + epsilon) + bias,\n ```\n where the mean and variance are computed per instance per group of channels, and\n `scale` and `bias` should be specified for each group of channels. The number of\n groups `num_groups` should be divisible by the number of channels so that there are\n an equal number of channels per group.\n \n When the number of groups is the same as the number of channels, this operator is\n equivalent to InstanceNormalization. When there is only one group, this operator\n is equivalent to LayerNormalization.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "scale", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "bias", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "num_groups", "type": "SI64Attr" } ] }, { "name": "onnx.GRU", "summary": "ONNX GRU operation", "description": "Computes an one-layer GRU. This operator is usually supported via some custom\n implementation such as CuDNN.\n \n Notations:\n \n * `X` - input tensor\n * `z` - update gate\n * `r` - reset gate\n * `h` - hidden gate\n * `t` - time step (t-1 means previous time step)\n * `W[zrh]` - W parameter weight matrix for update, reset, and hidden gates\n * `R[zrh]` - R recurrence weight matrix for update, reset, and hidden gates\n * `Wb[zrh]` - W bias vectors for update, reset, and hidden gates\n * `Rb[zrh]` - R bias vectors for update, reset, and hidden gates\n * `WB[zrh]` - W parameter weight matrix for backward update, reset, and hidden gates\n * `RB[zrh]` - R recurrence weight matrix for backward update, reset, and hidden gates\n * `WBb[zrh]` - W bias vectors for backward update, reset, and hidden gates\n * `RBb[zrh]` - R bias vectors for backward update, reset, and hidden gates\n * `H` - Hidden state\n * `num_directions` - 2 if direction == bidirectional else 1\n \n Activation functions:\n \n * Relu(x) - max(0, x)\n * Tanh(x) - (1 - e^{-2x})/(1 + e^{-2x})\n * Sigmoid(x) - 1/(1 + e^{-x})\n \n NOTE:\n Below are optional\n \n * Affine(x) - alpha * x + beta\n * LeakyRelu(x) - x if x >= 0 else alpha * x\n * ThresholdedRelu(x) - x if x >= alpha else 0\n * ScaledTanh(x) - alpha * Tanh(beta * x)\n * HardSigmoid(x) - min(max(alpha * x + beta, 0), 1)\n * Elu(x) - x if x >= 0 else alpha * (e^x - 1)\n * Softsign(x) - x/(1 + |x|)\n * Softplus(x) - log(1 + e^x)\n \n Equations (Default: f=Sigmoid, g=Tanh):\n \n * zt = f(Xt*(Wz^T) + Ht-1*(Rz^T) + Wbz + Rbz)\n * rt = f(Xt*(Wr^T) + Ht-1*(Rr^T) + Wbr + Rbr)\n * ht = g(Xt*(Wh^T) + (rt (.) Ht-1)*(Rh^T) + Rbh + Wbh) # default, when linear_before_reset = 0\n * ht = g(Xt*(Wh^T) + (rt (.) (Ht-1*(Rh^T) + Rbh)) + Wbh) # when linear_before_reset != 0\n * Ht = (1 - zt) (.) ht + zt (.) Ht-1\n This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "W", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "R", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "sequence_lens", "type": "AnyTypeOf<[TensorOf<[I32]>, NoneType]>" }, { "name": "initial_h", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "Y_h", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "attributes": [ { "name": "activation_alpha", "type": "OptionalAttr>" }, { "name": "activation_beta", "type": "OptionalAttr>" }, { "name": "activations", "type": "OptionalAttr>" }, { "name": "clip", "type": "OptionalAttr" }, { "name": "direction", "type": "DefaultValuedStrAttr" }, { "name": "hidden_size", "type": "OptionalAttr" }, { "name": "layout", "type": "DefaultValuedAttr" }, { "name": "linear_before_reset", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.HammingWindow", "summary": "ONNX HammingWindow operation", "description": "Generates a Hamming window as described in the paper https://ieeexplore.ieee.org/document/1455106.", "operands": [ { "name": "size", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "output_datatype", "type": "DefaultValuedAttr" }, { "name": "periodic", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.HannWindow", "summary": "ONNX HannWindow operation", "description": "Generates a Hann window as described in the paper https://ieeexplore.ieee.org/document/1455106.", "operands": [ { "name": "size", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "output_datatype", "type": "DefaultValuedAttr" }, { "name": "periodic", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Hardmax", "summary": "ONNX Hardmax operation", "description": "The operator computes the hardmax values for the given input:\n \n Hardmax(element in input, axis) = 1 if the element is the first maximum value along the specified axis, 0 otherwise\n \n The \\\"axis\\\" attribute indicates the dimension along which Hardmax\n will be performed. The output tensor has the same shape\n and contains the Hardmax values of the corresponding input.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.HardSigmoid", "summary": "ONNX HardSigmoid operation", "description": "HardSigmoid takes one input data (Tensor) and produces one output data\n (Tensor) where the HardSigmoid function, y = max(0, min(1, alpha * x + beta)),\n is applied to the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.HardSwish", "summary": "ONNX HardSwish operation", "description": "HardSwish takes one input data (Tensor) and produces one output data (Tensor) where\n the HardSwish function, y = x * max(0, min(1, alpha * x + beta)) = x * HardSigmoid(x),\n where alpha = 1/6 and beta = 0.5, is applied to the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Identity", "summary": "ONNX Identity operation", "description": "Identity operator", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>, SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ] > ]>>, OptOf ] > ]>>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf ]>>, OptOf ]>>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>, SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ] > ]>>, OptOf ] > ]>>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf ]>>, OptOf ]>>]>" } ] }, { "name": "onnx.If", "summary": "ONNX If operation", "description": "If conditional", "operands": [ { "name": "cond", "type": "TensorOf<[I1]>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] >, TensorOf < [ F8E4M3FN ] >, TensorOf < [ F8E4M3FNUZ ] >, TensorOf < [ F8E5M2 ] >, TensorOf < [ F8E5M2FNUZ ] >, TensorOf < [ UI < 4 > ] >, TensorOf < [ I < 4 > ] >, SeqOf < [ TensorOf < [ UI8 ] > ] >, SeqOf < [ TensorOf < [ UI16 ] > ] >, SeqOf < [ TensorOf < [ UI32 ] > ] >, SeqOf < [ TensorOf < [ UI64 ] > ] >, SeqOf < [ TensorOf < [ I8 ] > ] >, SeqOf < [ TensorOf < [ I16 ] > ] >, SeqOf < [ TensorOf < [ I32 ] > ] >, SeqOf < [ TensorOf < [ I64 ] > ] >, SeqOf < [ TensorOf < [ BF16 ] > ] >, SeqOf < [ TensorOf < [ F16 ] > ] >, SeqOf < [ TensorOf < [ F32 ] > ] >, SeqOf < [ TensorOf < [ F64 ] > ] >, SeqOf < [ TensorOf < [ StringType ] > ] >, SeqOf < [ TensorOf < [ I1 ] > ] >, SeqOf < [ TensorOf < [ Complex < F32 > ] > ] >, SeqOf < [ TensorOf < [ Complex < F64 > ] > ] >, SeqOf < [ TensorOf < [ F8E4M3FN ] > ] >, SeqOf < [ TensorOf < [ F8E4M3FNUZ ] > ] >, SeqOf < [ TensorOf < [ F8E5M2 ] > ] >, SeqOf < [ TensorOf < [ F8E5M2FNUZ ] > ] >, SeqOf < [ TensorOf < [ UI < 4 > ] > ] >, SeqOf < [ TensorOf < [ I < 4 > ] > ] >, OptOf < SeqOf < [ TensorOf < [ UI8 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I8 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ BF16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ StringType ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I1 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ Complex < F32 > ] > ] > >, OptOf < SeqOf < [ TensorOf < [ Complex < F64 > ] > ] > >, OptOf < TensorOf < [ UI8 ] > >, OptOf < TensorOf < [ UI16 ] > >, OptOf < TensorOf < [ UI32 ] > >, OptOf < TensorOf < [ UI64 ] > >, OptOf < TensorOf < [ I8 ] > >, OptOf < TensorOf < [ I16 ] > >, OptOf < TensorOf < [ I32 ] > >, OptOf < TensorOf < [ I64 ] > >, OptOf < TensorOf < [ BF16 ] > >, OptOf < TensorOf < [ F16 ] > >, OptOf < TensorOf < [ F32 ] > >, OptOf < TensorOf < [ F64 ] > >, OptOf < TensorOf < [ StringType ] > >, OptOf < TensorOf < [ I1 ] > >, OptOf < TensorOf < [ Complex < F32 > ] > >, OptOf < TensorOf < [ Complex < F64 > ] > >, OptOf < TensorOf < [ F8E4M3FN ] > >, OptOf < TensorOf < [ F8E4M3FNUZ ] > >, OptOf < TensorOf < [ F8E5M2 ] > >, OptOf < TensorOf < [ F8E5M2FNUZ ] > >, OptOf < TensorOf < [ UI < 4 > ] > >, OptOf < TensorOf < [ I < 4 > ] > > ]>>" } ], "regions": [ { "name": "then_branch", "type": "SizedRegion<1>" }, { "name": "else_branch", "type": "SizedRegion<1>" } ] }, { "name": "onnx.Im2Col", "summary": "ONNX Im2Col operation for convolution via matrix multiplication", "description": "Transforms N-dimensional convolution input into column format to enable\n convolution via matrix multiplication.\n \n For input X: [N, CI, D1, D2, ..., DN]\n With kernel: [K1, K2, ..., KN]\n And output spatial dims: [O1, O2, ..., ON]\n \n Output shape: [N, CI * K1 * K2 * ... * KN, O1 * O2 * ... * ON]\n ↑ ↑ ↑\n batch flattened receptive field flattened output positions\n \n For each batch n and output position q, output[n, :, q] contains the\n flattened receptive field ordered as:\n [c0_k0...kN, c1_k0...kN, ..., cCI_k0...kN]\n where c is the channel index and k0...kN are kernel spatial indices.\n \n This layout matches the common lowering pattern where weights are reshaped\n to [CO, CI * K1 * ... * KN], Im2Col(X)[n] is viewed as\n [CI * K1 * ... * KN, O1 * ... * ON], and convolution is computed as a\n matrix multiplication for each batch.\n \n Parameters match ONNX Conv operation (excluding group):\n - auto_pad: Padding strategy (NOTSET, SAME_UPPER, SAME_LOWER, VALID).\n Default is NOTSET.\n - dilations: Dilation values for each spatial dimension.\n Default is 1 for each spatial dimension.\n - kernel_shape: Size of convolution kernel (required).\n - pads: Padding for each spatial dimension. Format is [x1_begin, x2_begin, ..., x1_end, x2_end, ...]\n where n is the number of spatial dimensions. Total length is 2*n.\n Default is 0 for all dimensions.\n - strides: Stride values for each spatial dimension.\n Default is 1 for each spatial dimension.\n \n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.Imputer", "summary": "ONNX Imputer operation", "description": "Replaces inputs that equal one value with another, leaving all other elements alone.
\n This operator is typically used to replace missing values in situations where they have a canonical\n representation, such as -1, 0, NaN, or some extreme value.
\n One and only one of imputed_value_floats or imputed_value_int64s should be defined -- floats if the input tensor\n holds floats, integers if the input tensor holds integers. The imputed values must all fit within the\n width of the tensor element type. One and only one of the replaced_value_float or replaced_value_int64 should be defined,\n which one depends on whether floats or integers are being processed.
\n The imputed_value attribute length can be 1 element, or it can have one element per input feature.
In other words, if the input tensor has the shape [*,F], then the length of the attribute array may be 1 or F. If it is 1, then it is broadcast along the last dimension and applied to each feature.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "attributes": [ { "name": "imputed_value_floats", "type": "OptionalAttr>" }, { "name": "imputed_value_int64s", "type": "OptionalAttr>" }, { "name": "replaced_value_float", "type": "DefaultValuedAttr" }, { "name": "replaced_value_int64", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.InstanceNormalization", "summary": "ONNX InstanceNormalization operation", "description": "Carries out instance normalization as described in the paper\n https://arxiv.org/abs/1607.08022.\n \n y = scale * (x - mean) / sqrt(variance + epsilon) + B,\n where mean and variance are computed per instance per channel.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "scale", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.IsInf", "summary": "ONNX IsInf operation", "description": "Map infinity to true and other values to false.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[I1]>" } ], "attributes": [ { "name": "detect_negative", "type": "DefaultValuedAttr" }, { "name": "detect_positive", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.IsNaN", "summary": "ONNX IsNaN operation", "description": "Returns which elements of the input are NaN.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.LabelEncoder", "summary": "ONNX LabelEncoder operation", "description": "Maps each element in the input tensor to another value.
\n The mapping is determined by the two parallel attributes, 'keys_*' and\n 'values_*' attribute. The i-th value in the specified 'keys_*' attribute\n would be mapped to the i-th value in the specified 'values_*' attribute. It\n implies that input's element type and the element type of the specified\n 'keys_*' should be identical while the output type is identical to the\n specified 'values_*' attribute. If an input element can not be found in the\n specified 'keys_*' attribute, the 'default_*' that matches the specified\n 'values_*' attribute may be used as its output value.
\n Let's consider an example which maps a string tensor to an integer tensor.\n Assume and 'keys_strings' is [\\\"Amy\\\", \\\"Sally\\\"], 'values_int64s' is [5, 6],\n and 'default_int64' is '-1'. The input [\\\"Dori\\\", \\\"Amy\\\", \\\"Amy\\\", \\\"Sally\\\",\n \\\"Sally\\\"] would be mapped to [-1, 5, 5, 6, 6].
\n Since this operator is an one-to-one mapping, its input and output shapes\n are the same. Notice that only one of 'keys_*'/'values_*' can be set.
\n For key look-up, bit-wise comparison is used so even a float NaN can be\n mapped to a value in 'values_*' attribute.
", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>, TensorOf<[F32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>, TensorOf<[F32]>]>" } ], "attributes": [ { "name": "default_float", "type": "DefaultValuedAttr" }, { "name": "default_int64", "type": "DefaultValuedAttr" }, { "name": "default_string", "type": "DefaultValuedStrAttr" }, { "name": "keys_floats", "type": "OptionalAttr>" }, { "name": "keys_int64s", "type": "OptionalAttr>" }, { "name": "keys_strings", "type": "OptionalAttr>" }, { "name": "values_floats", "type": "OptionalAttr>" }, { "name": "values_int64s", "type": "OptionalAttr>" }, { "name": "values_strings", "type": "OptionalAttr>" } ] }, { "name": "onnx.LayerNormalization", "summary": "ONNX LayerNormalization operation", "description": "This is layer normalization defined in ONNX as function.\n The overall computation can be split into two stages.\n The first stage is standardization, which makes the\n normalized elements have zero mean and unit variances.\n The computation required by standardization can be\n described by the following equations.\n ```\n Mean = ReduceMean(X)\n D = Sub(X, Mean)\n DD = Mul(D, D)\n Var = ReduceMean(DD)\n VarEps = Add(Var, epsilon)\n StdDev = Sqrt(VarEps)\n InvStdDev = Reciprocal(StdDev)\n Normalized = Mul(D, InvStdDev)\n ```\n where `normalized_axes` is `[axis, ..., rank of X - 1]`.\n The variables `Var` and `StdDev` stand for variance and\n standard deviation, respectively. The second output is\n `Mean` and the last one is `InvStdDev`.\n Depending on `stash_type` attribute, the actual computation\n must happen in different floating-point precision.\n For example, if `stash_type` is 1, this operator casts\n all input variables to 32-bit float, perform the computation, and\n finally cast `Normalized` back to the original type of `X`.\n The second stage then scales and shifts the outcome of the\n first stage using\n ```\n NormalizedScaled = Mul(Normalized, Scale)\n Y = Add(NormalizedScaled, B)\n ```\n The second stage doesn't depends on `stash_type`.\n All equations are in [this syntax](https://github.com/onnx/onnx/blob/main/docs/Syntax.md).\n The same variable (i.e., input, output, and attribute) uses\n the same name in the equations above and this operator's definition.\n Let `d[i]` indicate the i-th dimension of `X`.\n If `X`'s shape is `[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]`,\n the shape of `Mean` and `InvStdDev` is `[d[0], ..., d[axis-1], 1, ..., 1]`.\n `Y` and `X` have the same shape. This operator supports unidirectional broadcasting\n (tensors `Scale` and `B` should be unidirectional broadcastable to tensor `X`);\n for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "Scale", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "Mean", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[BF16]>, NoneType]>" }, { "name": "InvStdDev", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[BF16]>, NoneType]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "stash_type", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.LayoutTransform", "summary": "An operation that transforms data between different layout formats", "description": "An operation that transforms a tensor from a layout to another layout. \n A layout is defined by an attribute, i.e. `target_layout`, which allows this\n operation work with an arbitrary layout (e.g. a layout used for accelerators).\n\n `target_layout` is optional. If it is not given, the input tensor will be\n transformed to a normal tensor that does not have layout.\n\n If `target_layout` is the same as the input's layout, this operation will\n become an no-op by canonicalization. \n\n The input and output tensors must have the same shape.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[F16, F32]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16, F32]>]>" } ], "attributes": [ { "name": "target_layout", "type": "OptionalAttr>" } ] }, { "name": "onnx.LeakyRelu", "summary": "ONNX LeakyRelu operation", "description": "LeakyRelu takes input data (Tensor) and an argument alpha, and produces one\n output data (Tensor) where the function `f(x) = alpha * x for x < 0`,\n `f(x) = x for x >= 0`, is applied to the data tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Less", "summary": "ONNX Less operation", "description": "Returns the tensor resulted from performing the `less` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.LessOrEqual", "summary": "ONNX LessOrEqual operation", "description": "Returns the tensor resulted from performing the `less_equal` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.LinearClassifier", "summary": "ONNX LinearClassifier operation", "description": "Linear classifier", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>]>" }, { "name": "Z", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "classlabels_ints", "type": "OptionalAttr>" }, { "name": "classlabels_strings", "type": "OptionalAttr>" }, { "name": "coefficients", "type": "TypedArrayAttrBase" }, { "name": "intercepts", "type": "OptionalAttr>" }, { "name": "multi_class", "type": "DefaultValuedAttr" }, { "name": "post_transform", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.LinearRegressor", "summary": "ONNX LinearRegressor operation", "description": "Generalized linear regression evaluation.
\n If targets is set to 1 (default) then univariate regression is performed.
\n If targets is set to M then M sets of coefficients must be passed in as a sequence\n and M results will be output for each input n in N.
\n The coefficients array is of length n, and the coefficients for each target are contiguous.\n Intercepts are optional but if provided must match the number of targets.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "coefficients", "type": "OptionalAttr>" }, { "name": "intercepts", "type": "OptionalAttr>" }, { "name": "post_transform", "type": "DefaultValuedStrAttr" }, { "name": "targets", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Log", "summary": "ONNX Log operation", "description": "Calculates the natural log of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.LogSoftmax", "summary": "ONNX LogSoftmax operation", "description": "The operator computes the log of softmax values for the given input:\n \n LogSoftmax(input, axis) = Log(Softmax(input, axis=axis))\n \n The \\\"axis\\\" attribute indicates the dimension along which LogSoftmax\n will be performed. The output tensor has the same shape\n and contains the LogSoftmax values of the corresponding input.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Loop", "summary": "ONNX Loop operation", "description": "Generic Looping construct. This loop has multiple termination conditions:\n \n 1) Trip count. Iteration count specified at runtime. Set by\n specifying the input M. Optional. Set to empty string to omit.\n Note that a static trip count (specified at graph construction time) can be\n specified by passing in a constant node for input M.\n 2) Loop termination condition. This is an input to the op that determines\n whether to run the first iteration and also a loop-carried dependency for\n the body graph. The body graph must yield a value for the condition variable,\n whether this input is provided or not.\n \n This table summarizes the operating modes of this operator with equivalent\n C-style code:\n \n Operator inputs defined as (max_trip_count, condition_var).\n \n * input (\\\"\\\", \\\"\\\"):\n for (int i=0; ; ++i) {\n cond = ... // Note this value is ignored, but is required in the body\n }\n \n * input (\\\"\\\", cond) // Note this is analogous to a while loop\n bool cond = ...;\n for (int i=0; cond; ++i) {\n cond = ...;\n }\n \n * input (\\\"\\\", 1) // Note this is analogous to a do-while loop\n bool cond = true\n for (int i=0; cond; ++i) {\n cond = ...;\n }\n \n * input (trip_count, \\\"\\\") // Note this is analogous to a for loop\n int trip_count = ...\n for (int i=0; i < trip_count; ++i) {\n cond = ...; // ignored\n }\n \n * input (trip_count, cond)\n int trip_count = ...;\n bool cond = ...;\n for (int i=0; i < trip_count && cond; ++i) {\n cond = ...;\n }\n \n \n *Sample usage - cond as well as trip count*\n \n graph predict-net {\n %a = Constant[value = ]()\n %b = Constant[value = ]()\n %keepgoing = Constant[value = ]()\n %max_trip_count = Constant[value = ]()\n %keepgoing_out, %b_out, %user_defined_vals = Loop[body = ](%max_trip_count, %keepgoing, %b)\n return\n }\n \n graph body-net (\n %i[INT32, scalar] // iteration number\n %keepgoing_in[BOOL, scalar] // incoming loop-termination-condition; not used\n %b_in[INT32, scalar] // incoming value of loop-carried-dependency b\n ) {\n %my_local = Add(%a, %b_in)\n %b_out = Sub(%a, %b_in) // outgoing value of loop-carried-dependency b\n %keepgoing_out = Greater(%my_local, %b_out) // outgoing loop-termination-condition\n %user_defined_val = Add(%b_in, %b_in) // scan-output value to be accumulated\n return %keepgoing_out, %b_out, %user_defined_val\n }\n \n *Sample equivalent C code*\n \n {\n /* User-defined code (enclosing scope) */\n int a = 3, b = 6;\n bool keepgoing = true; // Analogous to input cond\n /* End user-defined code */\n \n /* Implicitly-defined code */\n const int max_trip_count = 10; // Analogous to input M\n int user_defined_vals[]; // Imagine this is resizable\n /* End implicitly-defined code */\n /* initialize loop-carried variables and scan-output variables */\n bool keepgoing_out = keepgoing\n int b_out = b\n \n for (int i=0; i < max_trip_count && keepgoing_out; ++i) {\n /* Implicitly-defined code: bind actual parameter values\n to formal parameter variables of loop-body */\n bool keepgoing_in = keepgoing_out;\n bool b_in = b_out;\n \n /* User-defined code (loop body) */\n int my_local = a + b_in; // Reading value \\\"a\\\" from the enclosing scope is fine\n b_out = a - b_in;\n keepgoing_out = my_local > b_out;\n user_defined_val = b_in + b_in; // b_in and b_out are different variables\n /* End user-defined code */\n \n /* Implicitly defined-code */\n user_defined_vals[i] = user_defined_val // accumulate scan-output values\n }\n // int t = my_local; // Can't do this. my_local is not accessible here.\n \n // The values below are bound to the output variables of the loop and therefore accessible\n // b_out; user_defined_vals; keepgoing_out;\n }\n \n There are several things of note in this code snippet:\n \n 1) Values from the enclosing scope (i.e. variable \\\"a\\\" here) are in scope and can\n be referenced in the inputs of the loop.\n 2) Any values computed in the loop body that needs to be used in a subsequent\n iteration or after the loop are modeled using a pair of variables in the loop-body,\n consisting of an input variable (eg., b_in) and an output variable (eg., b_out).\n These are referred to as loop-carried dependences. The loop operation node\n supplies the input value of the input variable for the first iteration, and\n returns the output value of the output variable produced by the final\n iteration.\n 3) Scan_output variables are used to implicitly concatenate values computed across\n all the iterations. In the above example, the value of user_defined_val computed\n over all iterations are concatenated and returned as the value of user_defined_vals\n after the loop.\n 4) Values created in the body cannot be accessed in the enclosing scope,\n except using the mechanism described above.\n \n Note that the semantics of this op support \\\"diagonal\\\" or \\\"wavefront\\\" execution.\n (See Step 3 here for an example:\n https://devblogs.nvidia.com/optimizing-recurrent-neural-networks-cudnn-5/).\n Frontends should emit multi-layer RNNs as a series of While operators (with\n time being the inner looping dimension), with each successive layer consuming\n the scan_outputs from the previous layer, possibly going through several\n point-wise operators (e.g. dropout, residual connections, linear layer).\n \n The input/output of subgraph (produced by loop node) matching is based on order instead of name. The implementation will figure out the names based on this order.", "operands": [ { "name": "M", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" }, { "name": "cond", "type": "AnyTypeOf<[TensorOf<[I1]>, NoneType]>" }, { "name": "v_initial", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] >, TensorOf < [ F8E4M3FN ] >, TensorOf < [ F8E4M3FNUZ ] >, TensorOf < [ F8E5M2 ] >, TensorOf < [ F8E5M2FNUZ ] >, TensorOf < [ UI < 4 > ] >, TensorOf < [ I < 4 > ] >, SeqOf < [ TensorOf < [ UI8 ] > ] >, SeqOf < [ TensorOf < [ UI16 ] > ] >, SeqOf < [ TensorOf < [ UI32 ] > ] >, SeqOf < [ TensorOf < [ UI64 ] > ] >, SeqOf < [ TensorOf < [ I8 ] > ] >, SeqOf < [ TensorOf < [ I16 ] > ] >, SeqOf < [ TensorOf < [ I32 ] > ] >, SeqOf < [ TensorOf < [ I64 ] > ] >, SeqOf < [ TensorOf < [ BF16 ] > ] >, SeqOf < [ TensorOf < [ F16 ] > ] >, SeqOf < [ TensorOf < [ F32 ] > ] >, SeqOf < [ TensorOf < [ F64 ] > ] >, SeqOf < [ TensorOf < [ StringType ] > ] >, SeqOf < [ TensorOf < [ I1 ] > ] >, SeqOf < [ TensorOf < [ Complex < F32 > ] > ] >, SeqOf < [ TensorOf < [ Complex < F64 > ] > ] >, SeqOf < [ TensorOf < [ F8E4M3FN ] > ] >, SeqOf < [ TensorOf < [ F8E4M3FNUZ ] > ] >, SeqOf < [ TensorOf < [ F8E5M2 ] > ] >, SeqOf < [ TensorOf < [ F8E5M2FNUZ ] > ] >, SeqOf < [ TensorOf < [ UI < 4 > ] > ] >, SeqOf < [ TensorOf < [ I < 4 > ] > ] >, OptOf < SeqOf < [ TensorOf < [ UI8 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I8 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ BF16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ StringType ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I1 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ Complex < F32 > ] > ] > >, OptOf < SeqOf < [ TensorOf < [ Complex < F64 > ] > ] > >, OptOf < TensorOf < [ UI8 ] > >, OptOf < TensorOf < [ UI16 ] > >, OptOf < TensorOf < [ UI32 ] > >, OptOf < TensorOf < [ UI64 ] > >, OptOf < TensorOf < [ I8 ] > >, OptOf < TensorOf < [ I16 ] > >, OptOf < TensorOf < [ I32 ] > >, OptOf < TensorOf < [ I64 ] > >, OptOf < TensorOf < [ BF16 ] > >, OptOf < TensorOf < [ F16 ] > >, OptOf < TensorOf < [ F32 ] > >, OptOf < TensorOf < [ F64 ] > >, OptOf < TensorOf < [ StringType ] > >, OptOf < TensorOf < [ I1 ] > >, OptOf < TensorOf < [ Complex < F32 > ] > >, OptOf < TensorOf < [ Complex < F64 > ] > >, OptOf < TensorOf < [ F8E4M3FN ] > >, OptOf < TensorOf < [ F8E4M3FNUZ ] > >, OptOf < TensorOf < [ F8E5M2 ] > >, OptOf < TensorOf < [ F8E5M2FNUZ ] > >, OptOf < TensorOf < [ UI < 4 > ] > >, OptOf < TensorOf < [ I < 4 > ] > > ]>>" } ], "results": [ { "name": "v_final_and_scan_outputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] >, TensorOf < [ F8E4M3FN ] >, TensorOf < [ F8E4M3FNUZ ] >, TensorOf < [ F8E5M2 ] >, TensorOf < [ F8E5M2FNUZ ] >, TensorOf < [ UI < 4 > ] >, TensorOf < [ I < 4 > ] >, SeqOf < [ TensorOf < [ UI8 ] > ] >, SeqOf < [ TensorOf < [ UI16 ] > ] >, SeqOf < [ TensorOf < [ UI32 ] > ] >, SeqOf < [ TensorOf < [ UI64 ] > ] >, SeqOf < [ TensorOf < [ I8 ] > ] >, SeqOf < [ TensorOf < [ I16 ] > ] >, SeqOf < [ TensorOf < [ I32 ] > ] >, SeqOf < [ TensorOf < [ I64 ] > ] >, SeqOf < [ TensorOf < [ BF16 ] > ] >, SeqOf < [ TensorOf < [ F16 ] > ] >, SeqOf < [ TensorOf < [ F32 ] > ] >, SeqOf < [ TensorOf < [ F64 ] > ] >, SeqOf < [ TensorOf < [ StringType ] > ] >, SeqOf < [ TensorOf < [ I1 ] > ] >, SeqOf < [ TensorOf < [ Complex < F32 > ] > ] >, SeqOf < [ TensorOf < [ Complex < F64 > ] > ] >, SeqOf < [ TensorOf < [ F8E4M3FN ] > ] >, SeqOf < [ TensorOf < [ F8E4M3FNUZ ] > ] >, SeqOf < [ TensorOf < [ F8E5M2 ] > ] >, SeqOf < [ TensorOf < [ F8E5M2FNUZ ] > ] >, SeqOf < [ TensorOf < [ UI < 4 > ] > ] >, SeqOf < [ TensorOf < [ I < 4 > ] > ] >, OptOf < SeqOf < [ TensorOf < [ UI8 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ UI64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I8 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ BF16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F16 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F32 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ F64 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ StringType ] > ] > >, OptOf < SeqOf < [ TensorOf < [ I1 ] > ] > >, OptOf < SeqOf < [ TensorOf < [ Complex < F32 > ] > ] > >, OptOf < SeqOf < [ TensorOf < [ Complex < F64 > ] > ] > >, OptOf < TensorOf < [ UI8 ] > >, OptOf < TensorOf < [ UI16 ] > >, OptOf < TensorOf < [ UI32 ] > >, OptOf < TensorOf < [ UI64 ] > >, OptOf < TensorOf < [ I8 ] > >, OptOf < TensorOf < [ I16 ] > >, OptOf < TensorOf < [ I32 ] > >, OptOf < TensorOf < [ I64 ] > >, OptOf < TensorOf < [ BF16 ] > >, OptOf < TensorOf < [ F16 ] > >, OptOf < TensorOf < [ F32 ] > >, OptOf < TensorOf < [ F64 ] > >, OptOf < TensorOf < [ StringType ] > >, OptOf < TensorOf < [ I1 ] > >, OptOf < TensorOf < [ Complex < F32 > ] > >, OptOf < TensorOf < [ Complex < F64 > ] > >, OptOf < TensorOf < [ F8E4M3FN ] > >, OptOf < TensorOf < [ F8E4M3FNUZ ] > >, OptOf < TensorOf < [ F8E5M2 ] > >, OptOf < TensorOf < [ F8E5M2FNUZ ] > >, OptOf < TensorOf < [ UI < 4 > ] > >, OptOf < TensorOf < [ I < 4 > ] > > ]>>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "onnx.LpNormalization", "summary": "ONNX LpNormalization operation", "description": "Given a matrix, apply Lp-normalization along the provided axis.\n The output is computed as: `output = input / Lp_norm(input, axis)`.\n When the Lp norm is zero (i.e., all elements along the axis are zero),\n the output is defined to be zero to avoid division by zero.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "p", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.LpPool", "summary": "ONNX LpPool operation", "description": "LpPool consumes an input tensor X and applies Lp pooling across\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n Lp pooling consisting of computing the Lp norm on all values of a subset\n of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing. The output spatial shape will be following:\n ```\n output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - {kernelSpatialShape}) / strides_spatial_shape[i] + 1)\n ```\n or\n ```\n output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - {kernelSpatialShape}) / strides_spatial_shape[i] + 1)\n ```\n if ceil_mode is enabled `pad_shape[i]` is the sum of pads along axis `i`.\n \n `auto_pad` is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:\n ```\n VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - {kernelSpatialShape} + 1) / strides_spatial_shape[i])\n SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])\n ```\n And pad shape will be following if `SAME_UPPER` or `SAME_LOWER`:\n ```\n pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + {kernelSpatialShape} - input_spatial_shape[i]\n ```", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "ceil_mode", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "p", "type": "DefaultValuedAttr" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.LRN", "summary": "ONNX LRN operation", "description": "Local Response Normalization proposed in the [AlexNet paper](https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf).\n It normalizes over local input regions.\n The local region is defined across the channels. For an element `X[n, c, d1, ..., dk]` in a tensor\n of shape `(N x C x D1 x D2, ..., Dk)`, its region is\n `{X[n, i, d1, ..., dk] | max(0, c - floor((size - 1) / 2)) <= i <= min(C - 1, c + ceil((size - 1) / 2))}`.\n \n `square_sum[n, c, d1, ..., dk] = sum(X[n, i, d1, ..., dk] ^ 2)`,\n where `max(0, c - floor((size - 1) / 2)) <= i <= min(C - 1, c + ceil((size - 1) / 2))`.\n \n `Y[n, c, d1, ..., dk] = X[n, c, d1, ..., dk] / (bias + alpha / size * square_sum[n, c, d1, ..., dk] ) ^ beta`", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "bias", "type": "DefaultValuedAttr" }, { "name": "size", "type": "SI64Attr" } ] }, { "name": "onnx.LSTM", "summary": "ONNX LSTM operation", "description": "Computes an one-layer LSTM. This operator is usually supported via some\n custom implementation such as CuDNN.\n \n Notations:\n \n * `X` - input tensor\n * `i` - input gate\n * `o` - output gate\n * `f` - forget gate\n * `c` - cell gate\n * `t` - time step (t-1 means previous time step)\n * `W[iofc]` - W parameter weight matrix for input, output, forget, and cell gates\n * `R[iofc]` - R recurrence weight matrix for input, output, forget, and cell gates\n * `Wb[iofc]` - W bias vectors for input, output, forget, and cell gates\n * `Rb[iofc]` - R bias vectors for input, output, forget, and cell gates\n * `P[iof]` - P peephole weight vector for input, output, and forget gates\n * `WB[iofc]` - W parameter weight matrix for backward input, output, forget, and cell gates\n * `RB[iofc]` - R recurrence weight matrix for backward input, output, forget, and cell gates\n * `WBb[iofc]` - W bias vectors for backward input, output, forget, and cell gates\n * `RBb[iofc]` - R bias vectors for backward input, output, forget, and cell gates\n * `PB[iof]` - P peephole weight vector for backward input, output, and forget gates\n * `H` - Hidden state\n * `num_directions` - 2 if direction == bidirectional else 1\n \n Activation functions:\n \n * Relu(x) - max(0, x)\n * Tanh(x) - (1 - e^{-2x})/(1 + e^{-2x})\n * Sigmoid(x) - 1/(1 + e^{-x})\n \n NOTE: Below are optional\n \n * Affine(x) - alpha*x + beta\n * LeakyRelu(x) - x if x >= 0 else alpha * x\n * ThresholdedRelu(x) - x if x >= alpha else 0\n * ScaledTanh(x) - alpha*Tanh(beta*x)\n * HardSigmoid(x) - min(max(alpha*x + beta, 0), 1)\n * Elu(x) - x if x >= 0 else alpha*(e^x - 1)\n * Softsign(x) - x/(1 + |x|)\n * Softplus(x) - log(1 + e^x)\n \n Equations (Default: f=Sigmoid, g=Tanh, h=Tanh):\n \n * it = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Pi (.) Ct-1 + Wbi + Rbi)\n * ft = f(Xt*(Wf^T) + Ht-1*(Rf^T) + Pf (.) Ct-1 + Wbf + Rbf)\n * ct = g(Xt*(Wc^T) + Ht-1*(Rc^T) + Wbc + Rbc)\n * Ct = ft (.) Ct-1 + it (.) ct\n * ot = f(Xt*(Wo^T) + Ht-1*(Ro^T) + Po (.) Ct + Wbo + Rbo)\n * Ht = ot (.) h(Ct)\n This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "W", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "R", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "sequence_lens", "type": "AnyTypeOf<[TensorOf<[I32]>, NoneType]>" }, { "name": "initial_h", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "initial_c", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "P", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "Y_h", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "Y_c", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "attributes": [ { "name": "activation_alpha", "type": "OptionalAttr>" }, { "name": "activation_beta", "type": "OptionalAttr>" }, { "name": "activations", "type": "OptionalAttr>" }, { "name": "clip", "type": "OptionalAttr" }, { "name": "direction", "type": "DefaultValuedStrAttr" }, { "name": "hidden_size", "type": "OptionalAttr" }, { "name": "input_forget", "type": "DefaultValuedAttr" }, { "name": "layout", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.MatMul", "summary": "ONNX MatMul operation", "description": "Matrix product that behaves like [numpy.matmul](https://numpy.org/doc/stable/reference/generated/numpy.matmul.html).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.MatMulInteger", "summary": "ONNX MatMulInteger operation", "description": "Matrix product that behaves like [numpy.matmul](https://numpy.org/doc/stable/reference/generated/numpy.matmul.html).\n The production MUST never overflow. The accumulation may overflow if and only if in 32 bits.", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "a_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, NoneType]>" }, { "name": "b_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[I32]>" } ] }, { "name": "onnx.Max", "summary": "ONNX Max operation", "description": "Element-wise max of each of the input tensors (with Numpy-style broadcasting support).\n All inputs and outputs must have the same data type.\n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "data_0", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ BF16 ] > ]>>" } ], "results": [ { "name": "max", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.MaxPool", "summary": "ONNX MaxPool operation", "description": "MaxPool consumes an input tensor X and applies max pooling across\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n max pooling consisting of computing the max on all values of a\n subset of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing. The output spatial shape is calculated differently\n depending on whether explicit padding is used, where pads is employed, or auto padding is used, where auto_pad is utilized.\n With explicit padding (https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html?highlight=maxpool#torch.nn.MaxPool2d):\n ```\n output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)\n ```\n or\n ```\n output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)\n ```\n if ceil_mode is enabled. `pad_shape[i]` is the sum of pads along axis `i`. Sliding windows that would start in the right padded region are ignored.\n \n `auto_pad` is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following when ceil_mode is enabled:\n ```\n VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) + 1) / strides_spatial_shape[i])\n SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])\n ```\n or when ceil_mode is disabled (https://www.tensorflow.org/api_docs/python/tf/keras/layers/AveragePooling2D):\n ```\n VALID: output_spatial_shape[i] = floor((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1)) / strides_spatial_shape[i]) + 1\n SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = floor((input_spatial_shape[i] - 1) / strides_spatial_shape[i]) + 1\n ```\n And pad shape will be following if `SAME_UPPER` or `SAME_LOWER`:\n ```\n pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) - input_spatial_shape[i]\n ```\n The output of each pooling window is maximum number of elements exclude pad.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[UI8]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "Indices", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "ceil_mode", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "storage_order", "type": "DefaultValuedAttr" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.MaxPoolSingleOut", "category": "Pool", "summary": "ONNX MaxPool operation with a single output.", "description": "ONNX MaxPool operation with a single output.\n See ONNXMaxPoolOp for a full description of the MaxPool semantics.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "X", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" } ], "results": [ { "name": "o_Y", "type": "AnyTypeOf<[AnyMemRef, AnyTensor]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "ceil_mode", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "kernel_shape", "type": "DefaultValuedAttr, {}>" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "storage_order", "type": "DefaultValuedAttr" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.MaxRoiPool", "summary": "ONNX MaxRoiPool operation", "description": "ROI max pool consumes an input tensor X and region of interests (RoIs) to\n apply max pooling across each RoI, to produce output 4-D tensor of shape\n (num_rois, channels, pooled_shape[0], pooled_shape[1]).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "rois", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "pooled_shape", "type": "TypedArrayAttrBase" }, { "name": "spatial_scale", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.MaxUnpool", "summary": "ONNX MaxUnpool operation", "description": "MaxUnpool essentially computes the partial inverse of the MaxPool op.\n The input information to this op is typically the output information from a MaxPool op. The first\n input tensor X is the tensor that needs to be unpooled, which is typically the pooled tensor (first output)\n from MaxPool. The second input tensor, I, contains the indices to the (locally maximal) elements corresponding\n to the elements in the first input tensor X. Input tensor I is typically the second output of the MaxPool op.\n The third (optional) input is a tensor that specifies the output size of the unpooling operation.\n \n MaxUnpool is intended to do 'partial' inverse of the MaxPool op. 'Partial' because all the non-maximal\n values from the original input to MaxPool are set to zero in the output of the MaxUnpool op. Pooling\n the result of an unpooling operation should give back the original input to the unpooling op.\n \n MaxUnpool can produce the same output size for several input sizes, which makes unpooling op ambiguous.\n The third input argument, output_size, is meant to disambiguate the op and produce output tensor of\n known/predictable size.\n \n In addition to the inputs, MaxUnpool takes three attributes, namely kernel_shape, strides, and pads,\n which define the exact unpooling op. The attributes typically have the same values as the corresponding\n pooling op that the unpooling op is trying to invert.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "I", "type": "TensorOf<[I64]>" }, { "name": "output_shape", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.Mean", "summary": "ONNX Mean operation", "description": "Element-wise mean of each of the input tensors (with Numpy-style broadcasting support).\n All inputs and outputs must have the same data type.\n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "data_0", "type": "Variadic, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ BF16 ] > ]>>" } ], "results": [ { "name": "mean", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.MeanVarianceNormalization", "summary": "ONNX MeanVarianceNormalization operation", "description": "A MeanVarianceNormalization Function: Perform mean variance normalization\n on the input tensor X using formula: `(X-EX)/sqrt(E(X-EX)^2)`", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "DefaultValuedAttr, {0, 2, 3}>" } ] }, { "name": "onnx.MelWeightMatrix", "summary": "ONNX MelWeightMatrix operation", "description": "Generate a MelWeightMatrix that can be used to re-weight a Tensor containing a linearly sampled frequency spectra (from DFT or STFT) into num_mel_bins frequency information based on the [lower_edge_hertz, upper_edge_hertz] range on the mel scale.\n This function defines the mel scale in terms of a frequency in hertz according to the following formula:\n \n mel(f) = 2595 * log10(1 + f/700)\n \n In the returned matrix, all the triangles (filterbanks) have a peak value of 1.0.\n \n The returned MelWeightMatrix can be used to right-multiply a spectrogram S of shape [frames, num_spectrogram_bins] of linear scale spectrum values (e.g. STFT magnitudes) to generate a \\\"mel spectrogram\\\" M of shape [frames, num_mel_bins].", "operands": [ { "name": "num_mel_bins", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "dft_length", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "sample_rate", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "lower_edge_hertz", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "upper_edge_hertz", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "output_datatype", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Min", "summary": "ONNX Min operation", "description": "Element-wise min of each of the input tensors (with Numpy-style broadcasting support).\n All inputs and outputs must have the same data type.\n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "data_0", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ BF16 ] > ]>>" } ], "results": [ { "name": "min", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Mish", "summary": "ONNX Mish operation", "description": "Mish: A Self Regularized Non-Monotonic Neural Activation Function.\n \n Perform the linear unit element-wise on the input tensor X using formula:\n \n ```\n mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + e^{x}))\n ```", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Mod", "summary": "ONNX Mod operation", "description": "Performs an element-wise binary modulo operation.\n The semantics and supported data types depend on the value of the `fmod` attribute which must be `0` (default), or `1`.\n \n If the `fmod` attribute is set to `0`, `T` is constrained to integer data types and the semantics follow that of the Python `%`-operator.\n The sign of the result is that of the divisor.\n \n If `fmod` is set to `1`, the behavior of this operator follows that of the `fmod` function in C and `T` is constrained to floating point data types.\n The result of this operator is the remainder of the division operation `x / y` where `x` and `y` are respective elements of `A` and `B`. The result is exactly the value `x - n * y`, where `n` is `x / y` with its fractional part truncated.\n The returned value has the same sign as `x` (except if `x` is `-0`) and is less or equal to `|y|` in magnitude.\n The following special cases apply when `fmod` is set to `1`:\n - If `x` is `-0` and `y` is greater than zero, either `+0` or `-0` may be returned.\n - If `x` is `±∞` and `y` is not `NaN`, `NaN` is returned.\n - If `y` is `±0` and `x` is not `NaN`, `NaN` should be returned.\n - If `y` is `±∞` and `x` is finite, `x` is returned.\n - If either argument is `NaN`, `NaN` is returned.\n \n This operator supports **multidirectional (i.e., NumPy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "fmod", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Momentum", "summary": "ONNX Momentum operation", "description": "Compute one iteration of stochastic gradient update with momentum.\n This operator can conduct the optimization of multiple tensor variables.\n \n Let's define the behavior of this operator. As you can imagine, SG with momentum requires\n several parameters:\n \n - The learning-rate \\\"R\\\".\n - The update count \\\"T\\\". That is, the number of conducted training iterations. It should\n be zero in the first training iteration.\n - A L2-norm regularization coefficient \\\"norm_coefficient\\\".\n - A decay coefficient of previous accumulated gradient (i.e., momentum) \\\"alpha\\\".\n - The scaling coefficient of current gradient \\\"beta\\\".\n - An attribute to choose either standard momentum or Nesterov's momentum \\\"mode\\\" should\n be used.\n \n For the sake of simplicity, assume that there is only one tensor (called \\\"X\\\") to be optimized.\n Other necessary inputs are \\\"X\\\"'s gradient (called \\\"G\\\") and \\\"X\\\"'s momentum (called \\\"V\\\"). This\n Momentum operator maps all these inputs to the new value of \\\"X\\\" (called \\\"X_new\\\") and its new\n momentum (called \\\"V_new\\\").\n \n This operator supports two different momentum algorithms. Set the attribute \\\"mode\\\" to\n \\\"nesterov\\\" if Nesterov's momentum is desired. Otherwise, set the attribute \\\"model\\\" to\n \\\"standard\\\" to use standard momentum. Computation details are described subsequently.\n \n Let \\\"+\\\", \\\"-\\\", \\\"*\\\", and \\\"/\\\" are all element-wise operations with numpy-style broadcasting.\n \n Pseudo code for SG with standard momentum:\n \n // Add gradient of 0.5 * norm_coefficient * ||X||^2, where ||X|| is the sum of squared\n // values of all elements in X.\n G_regularized = norm_coefficient * X + G\n \n // In the first training iteration, beta should always be 1.\n beta_adjusted = T > 0 ? beta : 1\n \n // Compute the current momentum based on previous momentum and the current gradient.\n V_new = alpha * V + beta_adjusted * G_regularized\n \n // Update X.\n X_new = X - R * V_new\n \n Pseudo code for SG with Nesterov's momentum:\n \n // Add gradient of 0.5 * norm_coefficient * ||X||^2, where ||X|| is the sum of squared\n // values of all elements in X.\n G_regularized = norm_coefficient * X + G;\n \n // In the first training iteration, beta should always be 1.\n beta_adjusted = T > 0 ? beta : 1\n \n // Compute the current momentum based on previous momentum and the current gradient.\n V_new = alpha * V + beta_adjusted * G_regularized;\n \n // Compute final update direction and then update X.\n X_new = X - R * (G_regularized + alpha * V_new)\n \n If one assign this operators to optimize multiple inputs, for example, \\\"X_1\\\" and \\\"X_2\\\". The same\n pseudo code would be extended to handle all tensors jointly. More specifically, we can view \\\"X\\\" as a\n concatenation of \\\"X_1\\\" and \\\"X_2\\\" (of course, their gradient and accumulate gradient should\n be concatenated too) and then our pseudo code becomes applicable.", "operands": [ { "name": "R", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "T", "type": "TensorOf<[I64]>" }, { "name": "inputs", "type": "Variadic, TensorOf < [ F64 ] > ]>>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ F64 ] > ]>>" } ], "attributes": [ { "name": "alpha", "type": "F32Attr" }, { "name": "beta", "type": "F32Attr" }, { "name": "mode", "type": "StrAttr" }, { "name": "norm_coefficient", "type": "F32Attr" } ] }, { "name": "onnx.Mul", "summary": "ONNX Mul operation", "description": "Performs element-wise binary multiplication (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).\n \n (Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Multinomial", "summary": "ONNX Multinomial operation", "description": "Generate a tensor of samples from a multinomial distribution according to the probabilities\n of each of the possible outcomes.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "attributes": [ { "name": "dtype", "type": "DefaultValuedAttr" }, { "name": "sample_size", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "onnx.Neg", "summary": "ONNX Neg operation", "description": "Neg takes one input data (Tensor) and produces one output data\n (Tensor) where each element flipped sign, y = -x, is applied to\n the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[I32]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[I32]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.NegativeLogLikelihoodLoss", "summary": "ONNX NegativeLogLikelihoodLoss operation", "description": "A NegativeLogLikelihoodLoss operator computes (weighted) negative log likelihood loss.\n Its \\\"input\\\" tensor has the shape of (N, C, d1, d2, ..., dk) where k >= 0.\n The \\\"input\\\" tensor contains log-probabilities for input[n, :, d_1, d_2,..., d_k] being in a class of [0, C).\n The operator's \\\"target\\\" input tensor has the shape of (N, d1, d2, ..., dk). It encodes class labels (one of C classes)\n or it may contain a special value (indicated by an attribute ignore_index) for N x d1 x d2 x ... x dk samples.\n The loss value for input[n, :, d_1, d_2,...d_k] being classified as class c = target[n][d_1][d_2]...[d_k] is computed as:\n \n ```\n loss[n][d_1][d_2]...[d_k] = -input[n][c][d_1][d_2]...[d_k].\n ```\n \n When an optional \\\"weight\\\" is provided, the sample loss is calculated as:\n \n ```\n loss[n][d_1][d_2]...[d_k] = -input[n][c][d_1][d_2]...[d_k] * weight[c].\n ```\n \n loss is zero for the case when target-value equals ignore_index.\n \n ```\n loss[n][d_1][d_2]...[d_k] = 0, when target[n][d_1][d_2]...[d_k] = ignore_index\n ```\n \n If \\\"reduction\\\" attribute is set to \\\"none\\\", the operator's output will be the above loss with shape (N, d1, d2, ..., dk).\n If \\\"reduction\\\" attribute is set to \\\"mean\\\" (the default attribute value), the output loss is (weight) averaged:\n \n ```\n mean(loss), if \\\"weight\\\" is not provided,\n ```\n \n or if weight is provided,\n \n ```\n sum(loss) / sum(weight[target[n][d_1][d_2]...[d_k]]]), for all samples.\n ```\n \n If \\\"reduction\\\" attribute is set to \\\"sum\\\", the output is a scalar: `sum(loss)`.\n \n See also https://pytorch.org/docs/stable/nn.html#torch.nn.NLLLoss.\n \n Example 1:\n \n ```\n // negative log likelihood loss, \\\"none\\\" reduction\n N, C, d1 = 2, 3, 2\n input = [[[1.0, 2.0], [2.0, 2.0], [3.0, 2.0]],\n [[0.0, 1.0], [2.0, 2.0], [1.0, 2]]]\n target = [[2, 1], [0, 2]]\n \n loss = np.zeros((N, d1))\n for n in range(N):\n for d_1 in range(d1):\n c = target[n][d_1]\n loss[n][d_1] = -input[n][c][d_1]\n \n // print(loss)\n // [[-3. -2.]\n // [-0. -2.]]\n ```\n \n Example 2:\n \n ```\n // weighted negative log likelihood loss, sum reduction\n N, C, d1 = 2, 3, 2\n input = [[[1.0, 2.0], [2.0, 2.0], [3.0, 2.0]],\n [[0.0, 1.0], [2.0, 2.0], [1.0, 2]]]\n target = [[2, 1], [0, 2]]\n weight = [0.2, 0.3, 0.1]\n loss = np.zeros((N, d1))\n for n in range(N):\n for d_1 in range(d1):\n c = target[n][d_1]\n loss[n][d_1] = -input[n][c][d_1] * weight[c]\n \n loss = np.sum(loss)\n // print(loss)\n // -1.1\n ```\n \n Example 3:\n \n ```\n // weighted negative log likelihood loss, mean reduction\n N, C, d1 = 2, 3, 2\n input = [[[1.0, 2.0], [2.0, 2.0], [3.0, 2.0]],\n [[0.0, 1.0], [2.0, 2.0], [1.0, 2]]]\n target = [[2, 1], [0, 2]]\n weight = [0.2, 0.3, 0.1]\n loss = np.zeros((N, d1))\n weight_total = 0\n for n in range(N):\n for d_1 in range(d1):\n c = target[n][d_1]\n loss[n][d_1] = -input[n][c][d_1] * weight[c]\n weight_total = weight_total + weight[c]\n \n loss = np.sum(loss) / weight_total\n // print(loss)\n // -1.57\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "target", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "weight", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "loss", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "ignore_index", "type": "OptionalAttr" }, { "name": "reduction", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.NonMaxSuppression", "summary": "ONNX NonMaxSuppression operation", "description": "Filter out boxes that have high intersection-over-union (IOU) overlap with previously selected boxes.\n Bounding boxes with score less than score_threshold are removed. Bounding box format is indicated by attribute center_point_box.\n Boxes are suppressed if their IOU with a previously selected box is strictly greater than iou_threshold (i.e., boxes with IOU exactly equal to the threshold are kept).\n Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to\n orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system\n result in the same boxes being selected by the algorithm.\n The selected_indices output is a set of integers indexing into the input collection of bounding boxes representing the selected boxes.\n The bounding box coordinates corresponding to the selected indices can then be obtained using the Gather or GatherND operation.", "operands": [ { "name": "boxes", "type": "TensorOf<[F32]>" }, { "name": "scores", "type": "TensorOf<[F32]>" }, { "name": "max_output_boxes_per_class", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" }, { "name": "iou_threshold", "type": "AnyTypeOf<[TensorOf<[F32]>, NoneType]>" }, { "name": "score_threshold", "type": "AnyTypeOf<[TensorOf<[F32]>, NoneType]>" } ], "results": [ { "name": "selected_indices", "type": "TensorOf<[I64]>" } ], "attributes": [ { "name": "center_point_box", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.NonZero", "summary": "ONNX NonZero operation", "description": "Returns the indices of the elements that are non-zero\n (in row-major order - by dimension).\n NonZero behaves similar to numpy.nonzero:\n https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html,\n but for scalar input, NonZero produces output shape (0, N) instead of (1, N), which is different from Numpy's behavior.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[I64]>" } ] }, { "name": "onnx.Normalizer", "summary": "ONNX Normalizer operation", "description": "Normalize the input. There are three normalization modes, which have the corresponding formulas,\n defined using element-wise infix operators '/' and '^' and tensor-wide functions 'max' and 'sum':
\n
\n Max: Y = X / max(X)
\n L1: Y = X / sum(X)
\n L2: Y = sqrt(X^2 / sum(X^2)}
\n In all modes, if the divisor is zero, Y == X.\n
\n For batches, that is, [N,C] tensors, normalization is done along the C axis. In other words, each row\n of the batch is normalized independently.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "norm", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.Not", "summary": "ONNX Not operation", "description": "Returns the negation of the input tensor element-wise.", "operands": [ { "name": "X", "type": "TensorOf<[I1]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.NoValue", "summary": "An operation representing the absence of a value.", "description": "This operation can be used to represent the absence of a value. It is typically\n used as an argument to operators that have optional parameters.\n\n Example:\n ```MLIR\n %cst = \"onnx.NoValue\"() {value} : () -> none\n %0, %1 = \"onnx.Split\"(%arg0, %cst) { axis=1 : si64 } : (tensor, none) -> (tensor<*xf32>, tensor<*xf32>)\n ```\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "results": [ { "name": "none_val", "type": "NoneType" } ], "attributes": [ { "name": "value", "type": "UnitAttr" } ] }, { "name": "onnx.OneHot", "summary": "ONNX OneHot operation", "description": "Produces a one-hot tensor based on inputs.\n The locations represented by the index values in the 'indices' input tensor will have 'on_value'\n and the other locations will have 'off_value' in the output tensor, where 'on_value' and 'off_value'\n are specified as part of required input argument 'values', which is a two-element tensor of format\n [off_value, on_value]. The rank of the output tensor will be one greater than the rank of the\n input tensor. The additional dimension is for one-hot representation. The additional dimension will\n be inserted at the position specified by 'axis'. If 'axis' is not specified then then additional\n dimension will be inserted as the innermost dimension, i.e. axis=-1. The size of the additional\n dimension is specified by required scalar input 'depth'. The type of the output tensor is the same\n as the type of the 'values' input. Any entries in the 'indices' input tensor with values outside\n the range [-depth, depth-1] will result in one-hot representation with all 'off_value' values in the\n output tensor.\n \n when axis = 0:\n output[input[i, j, k], i, j, k] = 1 for all i, j, k and 0 otherwise.\n \n when axis = -1:\n output[i, j, k, input[i, j, k]] = 1 for all i, j, k and 0 otherwise.", "operands": [ { "name": "indices", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "depth", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "values", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.OneHotEncoder", "summary": "ONNX OneHotEncoder operation", "description": "Replace each input element with an array of ones and zeros, where a single\n one is placed at the index of the category that was passed in. The total category count\n will determine the size of the extra dimension of the output array Y.
\n For example, if we pass a tensor with a single value of 4, and a category count of 8,\n the output will be a tensor with ``[0,0,0,0,1,0,0,0]``.
\n This operator assumes every input feature is from the same set of categories.
\n If the input is a tensor of float, int32, or double, the data will be cast\n to integers and the cats_int64s category list will be used for the lookups.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>, TensorOf<[I32]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "cats_int64s", "type": "OptionalAttr>" }, { "name": "cats_strings", "type": "OptionalAttr>" }, { "name": "zeros", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Optional", "summary": "ONNX Optional operation", "description": "Constructs an optional-type value containing either an empty optional of a certain type specified by the attribute,\n or a non-empty value containing the input element.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ] > ]>>, OptOf ] > ]>>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf ]>>, OptOf ]>>]>" } ], "attributes": [ { "name": "type", "type": "OptionalAttr" } ] }, { "name": "onnx.OptionalGetElement", "summary": "ONNX OptionalGetElement operation", "description": "If the input is a tensor or sequence type, it returns the input.\n If the input is an optional type, it outputs the element in the input.\n It is an error if the input is an empty optional-type (i.e. does not have an element) and the behavior is undefined in this case.", "operands": [ { "name": "input", "type": "AnyTypeOf<[OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ] > ]>>, OptOf ] > ]>>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf ]>>, OptOf ]>>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ] }, { "name": "onnx.OptionalHasElement", "summary": "ONNX OptionalHasElement operation", "description": "Returns true if (1) the input is an optional-type and contains an element,\n or, (2) the input is a tensor or sequence type.\n If the input is not provided or is an empty optional-type, this op returns false.", "operands": [ { "name": "input", "type": "AnyTypeOf<[OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ]>>, OptOf ] > ]>>, OptOf ] > ]>>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf>, OptOf ]>>, OptOf ]>>, TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>, NoneType]>" } ], "results": [ { "name": "output", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.Or", "summary": "ONNX Or operation", "description": "Returns the tensor resulted from performing the `or` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "TensorOf<[I1]>" }, { "name": "B", "type": "TensorOf<[I1]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.Pad", "category": "Transform", "summary": "ONNX Pad operation", "description": "Given a tensor containing the data to be padded (`data`), a tensor containing the number of start and end pad values for axis (`pads`), (optionally) a `mode`, and (optionally) `constant_value`,\n a padded tensor (`output`) is generated.\n \n The three supported `modes` are (similar to corresponding modes supported by `numpy.pad`):\n \n 1) `constant`(default) - pads with a given constant value as specified by `constant_value` (which defaults to 0, empty string, or False)\n \n 2) `reflect` - pads with the reflection of the vector mirrored on the first and last values of the vector along each axis\n \n 3) `edge` - pads with the edge values of array\n \n 4) `wrap` - wrap-around padding as if the data tensor forms a torus\n \n \n Example 1 (`constant` mode):\n \n Insert 0 pads to the beginning of the second dimension.\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'constant'\n \n constant_value = 0.0\n \n output = [\n [0.0, 0.0, 1.0, 1.2],\n [0.0, 0.0, 2.3, 3.4],\n [0.0, 0.0, 4.5, 5.7],\n ]\n ```\n \n Example 2 (`reflect` mode):\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'reflect'\n \n output = [\n [1.0, 1.2, 1.0, 1.2],\n [2.3, 3.4, 2.3, 3.4],\n [4.5, 5.7, 4.5, 5.7],\n ]\n ```\n \n Example 3 (`edge` mode):\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'edge'\n \n output = [\n [1.0, 1.0, 1.0, 1.2],\n [2.3, 2.3, 2.3, 3.4],\n [4.5, 4.5, 4.5, 5.7],\n ]\n ```\n \n Example 4 (`wrap` mode):\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [2, 1, 1, 1]\n \n mode = 'wrap'\n \n output = [\n [3.4, 2.3, 3.4, 2.3],\n [5.7, 4.5, 5.7, 4.5],\n [1.2, 1.0, 1.2, 1.0],\n [3.4, 2.3, 3.4, 2.3],\n [5.7, 4.5, 5.7, 4.5],\n [1.2, 1.0, 1.2, 1.0],\n ]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" }, { "name": "pads", "type": "TensorOf<[I64]>" }, { "name": "constant_value", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>, NoneType]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.PadV11", "summary": "ONNX Pad operation", "description": "Given a tensor containing the data to be padded (`data`), a tensor containing the number of start and end pad values for axis (`pads`), (optionally) a `mode`, and (optionally) `constant_value`,\n a padded tensor (`output`) is generated.\n \n The three supported `modes` are (similar to corresponding modes supported by `numpy.pad`):\n \n 1) `constant`(default) - pads with a given constant value as specified by `constant_value` (which defaults to 0)\n \n 2) `reflect` - pads with the reflection of the vector mirrored on the first and last values of the vector along each axis\n \n 3) `edge` - pads with the edge values of array\n \n \n Example 1 (`constant` mode):\n Insert 0 pads to the beginning of the second dimension.\n \n data =\n [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'constant'\n \n constant_value = 0.0\n \n output =\n [\n [0.0, 0.0, 1.0, 1.2],\n [0.0, 0.0, 2.3, 3.4],\n [0.0, 0.0, 4.5, 5.7],\n ]\n \n \n Example 2 (`reflect` mode):\n data =\n [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'reflect'\n \n output =\n [\n [1.0, 1.2, 1.0, 1.2],\n [2.3, 3.4, 2.3, 3.4],\n [4.5, 5.7, 4.5, 5.7],\n ]\n \n \n Example 3 (`edge` mode):\n data =\n [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'edge'\n \n output =\n [\n [1.0, 1.0, 1.0, 1.2],\n [2.3, 2.3, 2.3, 3.4],\n [4.5, 4.5, 4.5, 5.7],\n ]", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "pads", "type": "TensorOf<[I64]>" }, { "name": "constant_value", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.PadV13", "summary": "ONNX Pad operation", "description": "Given a tensor containing the data to be padded (`data`), a tensor containing the number of start and end pad values for axis (`pads`), (optionally) a `mode`, and (optionally) `constant_value`,\n a padded tensor (`output`) is generated.\n \n The three supported `modes` are (similar to corresponding modes supported by `numpy.pad`):\n \n 1) `constant`(default) - pads with a given constant value as specified by `constant_value` (which defaults to 0, empty string, or False)\n \n 2) `reflect` - pads with the reflection of the vector mirrored on the first and last values of the vector along each axis\n \n 3) `edge` - pads with the edge values of array\n \n \n Example 1 (`constant` mode):\n Insert 0 pads to the beginning of the second dimension.\n \n data =\n [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'constant'\n \n constant_value = 0.0\n \n output =\n [\n [0.0, 0.0, 1.0, 1.2],\n [0.0, 0.0, 2.3, 3.4],\n [0.0, 0.0, 4.5, 5.7],\n ]\n \n \n Example 2 (`reflect` mode):\n data =\n [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'reflect'\n \n output =\n [\n [1.0, 1.2, 1.0, 1.2],\n [2.3, 3.4, 2.3, 3.4],\n [4.5, 5.7, 4.5, 5.7],\n ]\n \n \n Example 3 (`edge` mode):\n data =\n [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'edge'\n \n output =\n [\n [1.0, 1.0, 1.0, 1.2],\n [2.3, 2.3, 2.3, 3.4],\n [4.5, 4.5, 4.5, 5.7],\n ]", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "pads", "type": "TensorOf<[I64]>" }, { "name": "constant_value", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.PadV18", "summary": "ONNX Pad operation", "description": "Given a tensor containing the data to be padded (`data`), a tensor containing the number of start and end pad values for axis (`pads`), (optionally) a `mode`, and (optionally) `constant_value`,\n a padded tensor (`output`) is generated.\n \n The three supported `modes` are (similar to corresponding modes supported by `numpy.pad`):\n \n 1) `constant`(default) - pads with a given constant value as specified by `constant_value` (which defaults to 0, empty string, or False)\n \n 2) `reflect` - pads with the reflection of the vector mirrored on the first and last values of the vector along each axis\n \n 3) `edge` - pads with the edge values of array\n \n \n Example 1 (`constant` mode):\n \n Insert 0 pads to the beginning of the second dimension.\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'constant'\n \n constant_value = 0.0\n \n output = [\n [0.0, 0.0, 1.0, 1.2],\n [0.0, 0.0, 2.3, 3.4],\n [0.0, 0.0, 4.5, 5.7],\n ]\n ```\n \n Example 2 (`reflect` mode):\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'reflect'\n \n output = [\n [1.0, 1.2, 1.0, 1.2],\n [2.3, 3.4, 2.3, 3.4],\n [4.5, 5.7, 4.5, 5.7],\n ]\n ```\n \n Example 3 (`edge` mode):\n \n ```\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n \n pads = [0, 2, 0, 0]\n \n mode = 'edge'\n \n output = [\n [1.0, 1.0, 1.0, 1.2],\n [2.3, 2.3, 2.3, 3.4],\n [4.5, 4.5, 4.5, 5.7],\n ]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "pads", "type": "TensorOf<[I64]>" }, { "name": "constant_value", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, NoneType]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.PadV2", "summary": "ONNX Pad operation", "description": "Given `data` tensor, pads, mode, and value.\n Example:\n Insert 0 pads to the beginning of the second dimension.\n data = [\n [1.0, 1.2],\n [2.3, 3.4],\n [4.5, 5.7],\n ]\n pads = [0, 2, 0, 0]\n output = [\n [\n [0.0, 0.0, 1.0, 1.2],\n [0.0, 0.0, 2.3, 3.4],\n [0.0, 0.0, 4.5, 5.7],\n ],\n ]", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Pow", "summary": "ONNX Pow operation", "description": "Pow takes input data (Tensor) and exponent Tensor, and\n produces one output data (Tensor) where the function `f(x) = x^exponent`,\n is applied to the data tensor elementwise.\n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Z", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.PRelu", "summary": "ONNX PRelu operation", "description": "PRelu takes input data (Tensor) and slope tensor as input, and produces one\n output data (Tensor) where the function `f(x) = slope * x for x < 0`,\n `f(x) = x for x >= 0`., is applied to the data tensor elementwise.\n This operator supports **unidirectional broadcasting** (tensor slope should be unidirectional broadcastable to input tensor X); for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "slope", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ] }, { "name": "onnx.PrintSignature", "summary": "ONNX Op to print type signature or data of its input operands", "description": "Print type signature or data of the input operands of this op.\n The parameter op_name specifies a string to be printed before the tensors.\n and usually the op_name and onnx_node_name are used.\n This operation is introduced early so as to preserve the name of the original ONNX op.\n The argument print_data control whether the data of the tensors to be printed.\n When print_data == 1, the data of the tensor will be printed. Otherwise, just shape.\n The argument input specifies the tensor to be printed. They could be a list\n of the inputs and outputs of an ONNX op.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "input", "type": "Variadic>" } ], "attributes": [ { "name": "op_name", "type": "StrAttr" }, { "name": "print_data", "type": "SI64Attr" } ] }, { "name": "onnx.QLinearConv", "summary": "ONNX QLinearConv operation", "description": "The convolution operator consumes a quantized input tensor, its scale and zero point,\n a quantized filter, its scale and zero point, and output's scale and zero point,\n and computes the quantized output. Each scale and zero-point pair must have same shape.\n It means they must be either scalars (per tensor) or 1-D tensors (per output channel).\n Each input or output and its related zero point must have same type.\n When bias is present it must be quantized using scale = input scale * weight scale and\n zero point as 0.", "operands": [ { "name": "x", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "x_scale", "type": "TensorOf<[F32]>" }, { "name": "x_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "w", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "w_scale", "type": "TensorOf<[F32]>" }, { "name": "w_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "y_scale", "type": "TensorOf<[F32]>" }, { "name": "y_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[I32]>, NoneType]>" } ], "results": [ { "name": "y", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" } ], "attributes": [ { "name": "auto_pad", "type": "DefaultValuedStrAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "kernel_shape", "type": "OptionalAttr>" }, { "name": "pads", "type": "OptionalAttr>" }, { "name": "strides", "type": "OptionalAttr>" } ] }, { "name": "onnx.QLinearMatMul", "summary": "ONNX QLinearMatMul operation", "description": "Matrix product that behaves like [numpy.matmul](https://numpy.org/doc/stable/reference/generated/numpy.matmul.html).\n It consumes two quantized input tensors, their scales and zero points, scale and zero point of output,\n and computes the quantized output. The quantization formula is y = saturate((x / y_scale) + y_zero_point).\n For (x / y_scale), it is rounding to nearest ties to even. Refer to https://en.wikipedia.org/wiki/Rounding for details.\n Scale and zero point must have same shape. They must be either scalar (per tensor) or N-D tensor\n (per row for 'a' and per column for 'b'). Scalar refers to per tensor quantization whereas N-D refers to per row\n or per column quantization. If the input is 2D of shape [M, K] then zero point and scale tensor may be\n an M element vector [v_1, v_2, ..., v_M] for per row quantization and K element vector of shape [v_1, v_2, ..., v_K]\n for per column quantization. If the input is N-D tensor with shape [D1, D2, M, K] then zero point and scale tensor may\n have shape [D1, D2, M, 1] for per row quantization and shape [D1, D2, 1, K] for per column quantization.\n Production must never overflow, and accumulation may overflow if and only if in 32 bits.", "operands": [ { "name": "a", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "a_scale", "type": "TensorOf<[F32]>" }, { "name": "a_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "b", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "b_scale", "type": "TensorOf<[F32]>" }, { "name": "b_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" }, { "name": "y_scale", "type": "TensorOf<[F32]>" }, { "name": "y_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" } ], "results": [ { "name": "y", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>]>" } ] }, { "name": "onnx.QuantizeLinear", "summary": "ONNX QuantizeLinear operation", "description": "The linear quantization operator. It consumes a high precision tensor, a scale, and a zero point to compute the low precision / quantized tensor.\n The scale factor and zero point must have same shape, and can be either a scalar for per-tensor / per layer quantization, or a 1-D tensor for per-axis quantization.\n The quantization formula is `y = saturate ((x / y_scale) + y_zero_point)`.\n For saturation, it saturates to [0, 255] if it's uint8, or [-128, 127] if it's int8.\n For (x / y_scale), it's rounding to the nearest even. Refer to https://en.wikipedia.org/wiki/Rounding for details.\n 'y_zero_point' and 'y' must have same type.\n 'y_zero_point' is usually not used for quantization to float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz,\n but the quantization formula remains the same for consistency and\n the type of the attribute 'y_zero_point' still determines the quantization type.", "operands": [ { "name": "x", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[BF16]>, TensorOf<[I32]>]>" }, { "name": "y_scale", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[BF16]>, TensorOf<[I32]>]>" }, { "name": "y_zero_point", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, NoneType]>" } ], "results": [ { "name": "y", "type": "AnyTypeOf<[TensorOf<[I8]>, TensorOf<[UI8]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "saturate", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.RandomNormal", "summary": "ONNX RandomNormal operation", "description": "Generate a tensor with random values drawn from a normal distribution. The shape\n of the tensor is specified by the `shape` argument and the parameter of the normal distribution\n specified by `mean` and `scale`.\n \n The data type is specified by the 'dtype' argument. The 'dtype' argument must\n be one of the data types specified in the 'DataType' enum field in the\n TensorProto message.", "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "dtype", "type": "DefaultValuedAttr" }, { "name": "mean", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "OptionalAttr" }, { "name": "shape", "type": "TypedArrayAttrBase" } ] }, { "name": "onnx.RandomNormalLike", "summary": "ONNX RandomNormalLike operation", "description": "Generate a tensor with random values drawn from a normal distribution.\n The shape of the output tensor is copied from the shape of the input tensor,\n and the parameters of the normal distribution are specified by `mean` and `scale`.\n \n The data type is specified by the 'dtype' argument, or copied from the input tensor if not provided.\n The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the\n TensorProto message, and be valid as an output type.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "dtype", "type": "OptionalAttr" }, { "name": "mean", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "onnx.RandomUniform", "summary": "ONNX RandomUniform operation", "description": "Generate a tensor with random values drawn from a uniform distribution. The shape\n of the tensor is specified by the `shape` argument and the range by `low` and `high`.\n \n The data type is specified by the 'dtype' argument. The 'dtype' argument must\n be one of the data types specified in the 'DataType' enum field in the\n TensorProto message.", "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "dtype", "type": "DefaultValuedAttr" }, { "name": "high", "type": "DefaultValuedAttr" }, { "name": "low", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "OptionalAttr" }, { "name": "shape", "type": "TypedArrayAttrBase" } ] }, { "name": "onnx.RandomUniformLike", "summary": "ONNX RandomUniformLike operation", "description": "Generate a tensor with random values drawn from a uniform distribution.\n The shape of the output tensor is copied from the shape of the input tensor,\n and the parameters of the uniform distribution are specified by `low` and `high`.\n \n The data type is specified by the 'dtype' argument, or copied from the input tensor if not provided.\n The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the\n TensorProto message and be valid as an output type.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "dtype", "type": "OptionalAttr" }, { "name": "high", "type": "DefaultValuedAttr" }, { "name": "low", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "onnx.Range", "summary": "ONNX Range operation", "description": "Generate a tensor containing a sequence of numbers that begin at `start` and extends by increments of `delta`\n up to `limit` (exclusive).\n \n The number of elements in the output of range is computed as below:\n \n ```\n number_of_elements = max( ceil( (limit - start) / delta ) , 0 )\n ```\n \n The pseudocode determining the contents of the output is shown below:\n \n ```\n for(int i=0; i, TensorOf<[F64]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "limit", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "delta", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ] }, { "name": "onnx.Reciprocal", "summary": "ONNX Reciprocal operation", "description": "Reciprocal takes one input data (Tensor) and produces one output data\n (Tensor) where the reciprocal is, y = 1/x, is applied to\n the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.ReduceL1", "summary": "ONNX ReduceL1 operation", "description": "Computes the L1 norm of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceL1V13", "summary": "ONNX ReduceL1 operation", "description": "Computes the L1 norm of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceL2", "summary": "ONNX ReduceL2 operation", "description": "Computes the L2 norm of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceL2V13", "summary": "ONNX ReduceL2 operation", "description": "Computes the L2 norm of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceLogSum", "summary": "ONNX ReduceLogSum operation", "description": "Computes the log sum of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceLogSumExp", "summary": "ONNX ReduceLogSumExp operation", "description": "Computes the log sum exponent of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceLogSumExpV13", "summary": "ONNX ReduceLogSumExp operation", "description": "Computes the log sum exponent of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceLogSumV13", "summary": "ONNX ReduceLogSum operation", "description": "Computes the log sum of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMax", "summary": "ONNX ReduceMax operation", "description": "Computes the max of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or the minimum value of the data type otherwise.\n \n \n If the input data type is Boolean, the comparison should consider `False < True`.\n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>, TensorOf<[I1]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>, TensorOf<[I1]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMaxV13", "summary": "ONNX ReduceMax operation", "description": "Computes the max of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or the minimum value of the data type otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMaxV18", "summary": "ONNX ReduceMax operation", "description": "Computes the max of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or the minimum value of the data type otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMean", "summary": "ONNX ReduceMean operation", "description": "Computes the mean of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields undefined.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMeanV13", "summary": "ONNX ReduceMean operation", "description": "Computes the mean of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields undefined.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMin", "summary": "ONNX ReduceMin operation", "description": "Computes the min of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields plus infinity (if supported by the datatype) or the maximum value of the data type otherwise.\n \n \n If the input data type is Boolean, the comparison should consider `False < True`.\n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>, TensorOf<[I1]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>, TensorOf<[I1]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMinV13", "summary": "ONNX ReduceMin operation", "description": "Computes the min of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields plus infinity (if supported by the datatype) or the maximum value of the data type otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceMinV18", "summary": "ONNX ReduceMin operation", "description": "Computes the min of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields plus infinity (if supported by the datatype) or the maximum value of the data type otherwise.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, TensorOf<[UI8]>, TensorOf<[I8]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceProd", "summary": "ONNX ReduceProd operation", "description": "Computes the product of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 1.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceProdV13", "summary": "ONNX ReduceProd operation", "description": "Computes the product of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 1.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceSum", "summary": "ONNX ReduceSum operation", "description": "Computes the sum of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceSumSquare", "summary": "ONNX ReduceSumSquare operation", "description": "Computes the sum square of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "noop_with_empty_axes", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceSumSquareV13", "summary": "ONNX ReduceSumSquare operation", "description": "Computes the sum square of the input tensor's elements along the provided axes. The resulting\n tensor has the same rank as the input if `keepdims` equals 1. If `keepdims` equals 0, then\n the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are\n valid. Reduction over an empty set of values yields 0.\n \n \n The above behavior is similar to numpy, with the exception that numpy defaults `keepdims`\n to `False` instead of `True`.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ReduceSumV11", "summary": "ONNX ReduceSum operation", "description": "Computes the sum of the input tensor's element along the provided axes. The resulting\n tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then\n the resulted tensor have the reduced dimension pruned.\n \n The above behavior is similar to numpy, with the exception that numpy defaults keepdims to\n False instead of True.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "reduced", "type": "AnyTypeOf<[TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Relu", "category": "Activation", "summary": "ONNX Relu operation", "description": "Relu takes one input data (Tensor) and produces one output data\n (Tensor) where the rectified linear function, y = max(0, x), is applied to\n the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[I32]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[I32]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Reshape", "category": "Shape", "summary": "ONNX Reshape operation", "description": "Reshape the input tensor similar to numpy.reshape.\n First input is the data tensor, second input is a shape tensor which specifies the output shape. It outputs the reshaped tensor.\n At most one dimension of the new shape can be -1. In this case, the value is\n inferred from the size of the tensor and the remaining dimensions. A dimension\n could also be 0, in which case the actual dimension value is unchanged (i.e. taken\n from the input tensor). If 'allowzero' is set, and the new shape includes 0, the\n dimension will be set explicitly to zero (i.e. not taken from input tensor).\n Shape (second input) could be an empty shape, which means converting to a scalar.\n The input tensor's shape and the output tensor's shape are required to have the same number of elements.\n \n If the attribute 'allowzero' is set, it is invalid for the specified shape to\n contain both a zero value and -1, as the value of the dimension corresponding\n to -1 cannot be determined uniquely.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" }, { "name": "shape", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "reshaped", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "attributes": [ { "name": "allowzero", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Resize", "summary": "ONNX Resize operation", "description": "Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor.\n Each dimension value of the output tensor is:\n ```\n output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)\n ```\n if input \\\\\"sizes\\\\\" is not specified.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "roi", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "scales", "type": "AnyTypeOf<[TensorOf<[F32]>, NoneType]>" }, { "name": "sizes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "antialias", "type": "DefaultValuedAttr" }, { "name": "axes", "type": "OptionalAttr>" }, { "name": "coordinate_transformation_mode", "type": "DefaultValuedStrAttr" }, { "name": "cubic_coeff_a", "type": "DefaultValuedAttr" }, { "name": "exclude_outside", "type": "DefaultValuedAttr" }, { "name": "extrapolation_value", "type": "DefaultValuedAttr" }, { "name": "keep_aspect_ratio_policy", "type": "DefaultValuedStrAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "nearest_mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.ResizeV10", "summary": "ONNX Resize operation", "description": "Resize the input tensor.\n Each dimension value of the output tensor is:\n output_dimension = floor(input_dimension * scale).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "scales", "type": "TensorOf<[F32]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.ResizeV11", "summary": "ONNX Resize operation", "description": "Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor.\n Each dimension value of the output tensor is:\n output_dimension = floor(input_dimension * (roi_end - roi_start) * scale) if input \\\\\"sizes\\\\\" is not specified.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "roi", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "scales", "type": "TensorOf<[F32]>" }, { "name": "sizes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "coordinate_transformation_mode", "type": "DefaultValuedStrAttr" }, { "name": "cubic_coeff_a", "type": "DefaultValuedAttr" }, { "name": "exclude_outside", "type": "DefaultValuedAttr" }, { "name": "extrapolation_value", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "nearest_mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.ResizeV13", "summary": "ONNX Resize operation", "description": "Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor.\n Each dimension value of the output tensor is:\n output_dimension = floor(input_dimension * (roi_end - roi_start) * scale) if input \\\\\"sizes\\\\\" is not specified.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "roi", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "scales", "type": "AnyTypeOf<[TensorOf<[F32]>, NoneType]>" }, { "name": "sizes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "coordinate_transformation_mode", "type": "DefaultValuedStrAttr" }, { "name": "cubic_coeff_a", "type": "DefaultValuedAttr" }, { "name": "exclude_outside", "type": "DefaultValuedAttr" }, { "name": "extrapolation_value", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "nearest_mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.ResizeV18", "summary": "ONNX Resize operation", "description": "Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor.\n Each dimension value of the output tensor is:
\n `output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)`
\n if input \\\\\"sizes\\\\\" is not specified.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "roi", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "scales", "type": "AnyTypeOf<[TensorOf<[F32]>, NoneType]>" }, { "name": "sizes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "antialias", "type": "DefaultValuedAttr" }, { "name": "axes", "type": "OptionalAttr>" }, { "name": "coordinate_transformation_mode", "type": "DefaultValuedStrAttr" }, { "name": "cubic_coeff_a", "type": "DefaultValuedAttr" }, { "name": "exclude_outside", "type": "DefaultValuedAttr" }, { "name": "extrapolation_value", "type": "DefaultValuedAttr" }, { "name": "keep_aspect_ratio_policy", "type": "DefaultValuedStrAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "nearest_mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.Return", "summary": "Function return operation", "description": "The `onnx.Return` operation represents a return operation within a function.\n The operation takes variable number of operands and produces no results.\n The operand number and types must match the signature of the function\n that contains the operation, with the exception that shaped types may have\n more specific shapes than the function signature result types, which allows\n rewrites of defining ops of operands to make their result shapes more specific.\n This operation terminates a func::FuncOp in the ONNX dialect and is replaced\n by func::ReturnOp in StandardFuncReturnPass before lowering to Krnl or other\n dialects.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "onnx.ReverseSequence", "summary": "ONNX ReverseSequence operation", "description": "Reverse batch of sequences having different lengths specified by `sequence_lens`.\n \n For each slice i iterating on batch axis, the operator reverses the first sequence_lens[i] elements on time axis,\n and copies elements whose index's beyond sequence_lens[i] to the output. So the output slice i contains reversed\n sequences on the first sequence_lens[i] elements, then have original values copied for the other elements.\n \n Example 1:\n input = [[0.0, 4.0, 8.0, 12.0],\n [1.0, 5.0, 9.0, 13.0],\n [2.0, 6.0, 10.0, 14.0],\n [3.0, 7.0, 11.0, 15.0]]\n sequence_lens = [4, 3, 2, 1]\n time_axis = 0\n batch_axis = 1\n \n output = [[3.0, 6.0, 9.0, 12.0],\n [2.0, 5.0, 8.0, 13.0],\n [1.0, 4.0, 10.0, 14.0],\n [0.0, 7.0, 11.0, 15.0]]\n \n Example 2:\n input = [[0.0, 1.0, 2.0, 3.0 ],\n [4.0, 5.0, 6.0, 7.0 ],\n [8.0, 9.0, 10.0, 11.0],\n [12.0, 13.0, 14.0, 15.0]]\n sequence_lens = [1, 2, 3, 4]\n time_axis = 1\n batch_axis = 0\n \n output = [[0.0, 1.0, 2.0, 3.0 ],\n [5.0, 4.0, 6.0, 7.0 ],\n [10.0, 9.0, 8.0, 11.0],\n [15.0, 14.0, 13.0, 12.0]]", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "sequence_lens", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "batch_axis", "type": "DefaultValuedAttr" }, { "name": "time_axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.RMSLayerNormalization", "summary": "ONNX RMSLayerNormalization operation", "description": "This is RMS layer normalization defined in ONNX as function.\n The overall computation can be split into two stages.\n The first stage is an approximate standardization, which makes the\n normalized elements have zero mean and unit variances.\n See Equation (4) in [this paper](https://arxiv.org/pdf/1910.07467.pdf).\n The computation required by standardization can be\n described by the following equations.\n ```\n DD = Mul(X, X)\n Var = ReduceMean(DD)\n VarEps = Add(Var, epsilon)\n StdDev = Sqrt(VarEps)\n InvStdDev = Reciprocal(StdDev)\n Normalized = Mul(X, InvStdDev)\n ```\n where `normalized_axes` is `[axis, ..., rank of X - 1]`.\n The variables `Var` and `StdDev` stand for approximate variance and\n standard deviation, respectively.\n Depending on `stash_type` attribute, the actual computation\n must happen in different floating-point precision.\n For example, if `stash_type` is 1, this operator casts\n all input variables to 32-bit float, perform the computation, and\n finally cast `Normalized` back to the original type of `X`.\n The second stage then scales and shifts the outcome of the\n first stage using\n ```\n NormalizedScaled = Mul(Normalized, Scale)\n Y = Add(NormalizedScaled, B)\n ```\n The second stage doesn't depends on `stash_type`.\n All equations are in [this syntax](https://github.com/onnx/onnx/blob/main/docs/Syntax.md).\n The same variable (i.e., input, output, and attribute) uses\n the same name in the equations above and this operator's definition.\n Let `d[i]` indicate the i-th dimension of `X`.\n If `X`'s shape is `[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]`,\n the shape of `Mean` and `InvStdDev` is `[d[0], ..., d[axis-1], 1, ..., 1]`.\n `Y` and `X` have the same shape.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "Scale", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "InvStdDev", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[BF16]>, NoneType]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "stash_type", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.RNN", "summary": "ONNX RNN operation", "description": "Computes an one-layer simple RNN. This operator is usually supported\n via some custom implementation such as CuDNN.\n \n Notations:\n \n * `X` - input tensor\n * `i` - input gate\n * `t` - time step (t-1 means previous time step)\n * `Wi` - W parameter weight matrix for input gate\n * `Ri` - R recurrence weight matrix for input gate\n * `Wbi` - W parameter bias vector for input gate\n * `Rbi` - R parameter bias vector for input gate\n * `WBi` - W parameter weight matrix for backward input gate\n * `RBi` - R recurrence weight matrix for backward input gate\n * `WBbi` - WR bias vectors for backward input gate\n * `RBbi` - RR bias vectors for backward input gate\n * `H` - Hidden state\n * `num_directions` - 2 if direction == bidirectional else 1\n \n Activation functions:\n \n * Relu(x) - max(0, x)\n * Tanh(x) - (1 - e^{-2x})/(1 + e^{-2x})\n * Sigmoid(x) - 1/(1 + e^{-x})\n \n NOTE: Below are optional\n \n * Affine(x) - alpha*x + beta\n * LeakyRelu(x) - x if x >= 0 else alpha * x\n * ThresholdedRelu(x) - x if x >= alpha else 0\n * ScaledTanh(x) - alpha*Tanh(beta*x)\n * HardSigmoid(x) - min(max(alpha*x + beta, 0), 1)\n * Elu(x) - x if x >= 0 else alpha*(e^x - 1)\n * Softsign(x) - x/(1 + |x|)\n * Softplus(x) - log(1 + e^x)\n \n Equations (Default: f=Tanh):\n \n * Ht = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi)\n This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "W", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "R", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "sequence_lens", "type": "AnyTypeOf<[TensorOf<[I32]>, NoneType]>" }, { "name": "initial_h", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" }, { "name": "Y_h", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, NoneType]>" } ], "attributes": [ { "name": "activation_alpha", "type": "OptionalAttr>" }, { "name": "activation_beta", "type": "OptionalAttr>" }, { "name": "activations", "type": "DefaultValuedAttr, {\"Tanh\", \"Tanh\"}>" }, { "name": "clip", "type": "OptionalAttr" }, { "name": "direction", "type": "DefaultValuedStrAttr" }, { "name": "hidden_size", "type": "OptionalAttr" }, { "name": "layout", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.RoiAlign", "summary": "ONNX RoiAlign operation", "description": "Region of Interest (RoI) align operation described in the\n [Mask R-CNN paper](https://arxiv.org/abs/1703.06870).\n RoiAlign consumes an input tensor X and region of interests (rois)\n to apply pooling across each RoI; it produces a 4-D tensor of shape\n (num_rois, C, output_height, output_width).\n \n RoiAlign is proposed to avoid the misalignment by removing\n quantizations while converting from original image into feature\n map and from feature map into RoI feature; in each ROI bin,\n the value of the sampled locations are computed directly\n through bilinear interpolation.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "rois", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "batch_indices", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "coordinate_transformation_mode", "type": "DefaultValuedStrAttr" }, { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "output_height", "type": "DefaultValuedAttr" }, { "name": "output_width", "type": "DefaultValuedAttr" }, { "name": "sampling_ratio", "type": "DefaultValuedAttr" }, { "name": "spatial_scale", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Round", "summary": "ONNX Round operation", "description": "Round takes one input Tensor and rounds the values, element-wise, meaning\n it finds the nearest integer for each value.\n In case of halves, the rule is to round them to the nearest even integer.\n If input x is integral, +0, -0, NaN, or infinite, x itself is returned.\n The output tensor has the same shape and type as the input.\n \n Examples:\n ```\n round([0.9]) = [1.0]\n round([2.5]) = [2.0]\n round([2.3]) = [2.0]\n round([1.5]) = [2.0]\n round([-4.5]) = [-4.0]\n ```", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Scaler", "summary": "ONNX Scaler operation", "description": "Rescale input data, for example to standardize features by removing the mean and scaling to unit variance.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "offset", "type": "OptionalAttr>" }, { "name": "scale", "type": "OptionalAttr>" } ] }, { "name": "onnx.Scan", "summary": "ONNX Scan operation", "description": "Scan can be used to iterate over one or more scan_input tensors,\n constructing zero or more scan_output tensors. It combines ideas from general recurrences,\n functional programming constructs such as scan, fold, map, and zip, and is intended to enable\n generalizations of RNN-like constructs for sequence-to-sequence processing.\n Other tensors (referred to as state_variables here) can be used to carry a state\n when iterating from one element to another (similar to hidden-state in RNNs, also referred\n to as loop-carried dependences in the context of loops).\n Many common usages involve a single scan_input tensor (where functionality\n similar to scan, fold and map can be obtained). When more than one scan_input is used,\n a behavior similar to zip is obtained.\n \n The attribute body must be a graph, specifying the computation to be performed in\n every iteration. It takes as input the current values of the state_variables and\n the current iterated element of the scan_inputs. It must return the (updated) values\n of the state_variables and zero or more scan_output_element tensors. The values of the\n scan_output_element tensors are concatenated over all the iterations to produce the\n scan_output values of the scan construct (similar to the concatenated intermediate\n hidden-state values of RNN-like constructs). All the output tensors (state_variables as\n well as scan_output_element tensors) are required to have the same shape in each iteration\n of the loop (a restriction imposed to enable efficient memory allocation).\n \n Note that the iterated element passed to the body subgraph does not have a sequence\n axis. It will have a rank one less than the rank of the corresponding scan_input.\n \n The scan operation returns the final values of the state_variables as well as the\n scan_outputs.\n \n The optional attribute scan_input_directions specifies the direction (forward or backward)\n for each scan input. If this attribute is omitted, all sequences are scanned in the forward\n direction. A bidirectional scan may be performed by specifying the same tensor input twice\n in the scan_inputs, once with a forward direction, and once with a backward direction.\n \n The scan_output of the operation is produced by concatenating the scan_output_element\n values produced by the body in each iteration. The optional attribute scan_output_directions\n specifies the direction in which scan_output is constructed (by appending or prepending the\n scan_output_element to scan_output in each iteration) for each scan_output. If this attribute\n is omitted, the scan_output_element is appended to the scan_output in each iteration.\n \n The optional attribute scan_input_axes specifies the axis to be scanned for each scan_input.\n If omitted, every scan_input will be scanned in axis 0. For example, if axis 0 is the\n batch axis and axis 1 is the time axis (to be scanned), specify an axis value of 1.\n Note that scanning a non-zero axis may be less efficient than scanning axis zero.\n \n The optional attribute scan_output_axes specifies the axis along which the scan_outputs\n are accumulated for each scan_output. For example, if axis 1 is the time axis (to be\n scanned) for both inputs and outputs, specify a scan_input axis and scan_output axis\n value of 1.\n \n Note that because of the ONNX restriction that only the last parameter of an operator can\n be variadic, the initial-states and scan-inputs are listed together as one input parameter.\n Similarly, the final-states and scan-outputs are listed together as one output parameter.\n The attribute num_scan_inputs indicates the number M of scan-inputs.\n \n The behavior of\n \n Scan <\n num_scan_inputs = m,\n body = loop-body,\n scan_input_axes = [axis_1, ..., axis_m]\n > (init_1, ..., init_n, scan_1, ..., scan_m)\n \n is equivalent to the following pseudo-code:\n \n // scan_i.shape[axis_i] denotes the (max) sequence-length of scan_i\n // scan_i.shape[axis_i] is required to be equal to scan_j.shape[axis_j] for all i,j.\n sequence_length = scan_1.shape[axis_1];\n \n // initialize state-variables\n st_1 = init_1; ... st_n = init_n;\n // initialize scan-output variables: [] denotes an empty tensor\n scan_out_1 = []; ...; scan_out_k = [];\n // identify number of iterations:\n \n // execute loop\n for (int t = 0; t < sequence_length; ++t) {\n // generate the scan-input elements: the notation T[t] indicates the sub-tensor\n // of rank one less than T obtained by indexing T at position t along axis k.\n si_1 = scan_1[t];\n ... ;\n si_m = scan_m[t];\n // execute loop-body\n st_1, ..., st_n, so_1, ..., so_k = loop-body(st_1, ..., st_n, si_1, ..., si_m)\n // accumulate the scan-output elements\n scan_out_1 = Concat(scan_out_1, so_1); ... ; scan_out_k = Concat(scan_out_k, so_k);\n }\n \n return st_1, ..., st_n, scan_out_1, ..., scan_out_k;\n \n *Sample usage: Encoding RNN using a Scan*\n \n The following example shows how a simple RNN over an input tensor %X, with weight tensor %Wi,\n recurrence weight tensor %Ri, bias tensors %Wbi and %Rbi, and initial hidden-state %H_0 can\n be encoded as a ScanLoop. Note that the loop-body is a nested graph, and it directly computes\n %Wi, %Ri, %Wbi, and %Rbi (typically constants or initializers in the body graph). If these\n values are computed in the outer graph, they need to be passed in as extra state_variables.\n \n graph rnn-encoding {\n %H_0 = ...\n %X = ...\n %Y_h, %Y = Scan[body = , num_scan_inputs=1](%H_0, %X)\n return %Y, %Y_h\n }\n \n graph rnn-cell-1 (\n %H_tminus1[FLOAT, tensor]\n %X_t[FLOAT, tensor]\n ) {\n %Wi = ...\n %Ri = ...\n %Wbi = ...\n %Rbi = ...\n %t1 = X_t * (Wi^T)\n %t2 = H_tminus1*(Ri^T)\n %t3 = Add(%t1, %t2)\n %t4 = Add(%t3, %Wbi)\n %t5 = Add(%t4, %Rbi)\n %Ht = Tanh(%t5)\n %Accumulate = Identity(%Ht)\n return %Ht, %Accumulate\n }", "operands": [ { "name": "initial_state_and_scan_inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] >, TensorOf < [ F8E4M3FN ] >, TensorOf < [ F8E4M3FNUZ ] >, TensorOf < [ F8E5M2 ] >, TensorOf < [ F8E5M2FNUZ ] >, TensorOf < [ UI < 4 > ] >, TensorOf < [ I < 4 > ] > ]>>" } ], "results": [ { "name": "final_state_and_scan_outputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] >, TensorOf < [ F8E4M3FN ] >, TensorOf < [ F8E4M3FNUZ ] >, TensorOf < [ F8E5M2 ] >, TensorOf < [ F8E5M2FNUZ ] >, TensorOf < [ UI < 4 > ] >, TensorOf < [ I < 4 > ] > ]>>" } ], "attributes": [ { "name": "num_scan_inputs", "type": "SI64Attr" }, { "name": "scan_input_axes", "type": "OptionalAttr>" }, { "name": "scan_input_directions", "type": "OptionalAttr>" }, { "name": "scan_output_axes", "type": "OptionalAttr>" }, { "name": "scan_output_directions", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "onnx.Scatter", "category": "Tensor", "summary": "ONNX Scatter operation", "description": "This operator is deprecated. Please use ScatterElements, which provides the same functionality.\n \n Scatter takes three inputs `data`, `updates`, and `indices` of the same\n rank r >= 1 and an optional attribute axis that identifies an axis of `data`\n (by default, the outer-most axis, that is axis 0). The output of the operation\n is produced by creating a copy of the input `data`, and then updating its value\n to values specified by `updates` at specific index positions specified by\n `indices`. Its output shape is the same as the shape of `data`.\n \n For each entry in `updates`, the target index in `data` is obtained by combining\n the corresponding entry in `indices` with the index of the entry itself: the\n index-value for dimension = axis is obtained from the value of the corresponding\n entry in `indices` and the index-value for dimension != axis is obtained from the\n index of the entry itself.\n \n For instance, in a 2-D tensor case, the update corresponding to the [i][j] entry\n is performed as below:\n ```\n output[indices[i][j]][j] = updates[i][j] if axis = 0,\n output[i][indices[i][j]] = updates[i][j] if axis = 1,\n ```\n \n This operator is the inverse of GatherElements. It is similar to Torch's Scatter operation.\n \n Example 1:\n ```\n data = [\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n ]\n indices = [\n [1, 0, 2],\n [0, 2, 1],\n ]\n updates = [\n [1.0, 1.1, 1.2],\n [2.0, 2.1, 2.2],\n ]\n output = [\n [2.0, 1.1, 0.0]\n [1.0, 0.0, 2.2]\n [0.0, 2.1, 1.2]\n ]\n ```\n Example 2:\n ```\n data = [[1.0, 2.0, 3.0, 4.0, 5.0]]\n indices = [[1, 3]]\n updates = [[1.1, 2.1]]\n axis = 1\n output = [[1.0, 1.1, 3.0, 2.1, 5.0]]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "updates", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ScatterElements", "summary": "ONNX ScatterElements operation", "description": "ScatterElements takes three inputs `data`, `updates`, and `indices` of the same\n rank r >= 1 and an optional attribute axis that identifies an axis of `data`\n (by default, the outer-most axis, that is axis 0). The output of the operation\n is produced by creating a copy of the input `data`, and then updating its value\n to values specified by `updates` at specific index positions specified by\n `indices`. Its output shape is the same as the shape of `data`.\n \n For each entry in `updates`, the target index in `data` is obtained by combining\n the corresponding entry in `indices` with the index of the entry itself: the\n index-value for dimension = axis is obtained from the value of the corresponding\n entry in `indices` and the index-value for dimension != axis is obtained from the\n index of the entry itself.\n \n `reduction` allows specification of an optional reduction operation, which is applied to all values in `updates`\n tensor into `output` at the specified `indices`.\n In cases where `reduction` is set to \\\"none\\\", indices should not have duplicate entries: that is, if idx1 != idx2,\n then indices[idx1] != indices[idx2]. For instance, in a 2-D tensor case, the update\n corresponding to the [i][j] entry is performed as below:\n ```\n output[indices[i][j]][j] = updates[i][j] if axis = 0,\n output[i][indices[i][j]] = updates[i][j] if axis = 1,\n ```\n When `reduction` is set to some reduction function `f`, the update corresponding to the [i][j] entry is performed as below:\n ```\n output[indices[i][j]][j] = f(output[indices[i][j]][j], updates[i][j]) if axis = 0,\n output[i][indices[i][j]] = f(output[i][indices[i][j]], updates[i][j]) if axis = 1,\n ```\n where the `f` is `+`, `*`, `max` or `min` as specified.\n \n This operator is the inverse of GatherElements. It is similar to Torch's Scatter operation.\n \n (Opset 18 change): Adds max/min to the set of allowed reduction ops.\n \n Example 1:\n ```\n data = [\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n ]\n indices = [\n [1, 0, 2],\n [0, 2, 1],\n ]\n updates = [\n [1.0, 1.1, 1.2],\n [2.0, 2.1, 2.2],\n ]\n output = [\n [2.0, 1.1, 0.0]\n [1.0, 0.0, 2.2]\n [0.0, 2.1, 1.2]\n ]\n ```\n Example 2:\n ```\n data = [[1.0, 2.0, 3.0, 4.0, 5.0]]\n indices = [[1, 3]]\n updates = [[1.1, 2.1]]\n axis = 1\n output = [[1.0, 1.1, 3.0, 2.1, 5.0]]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "updates", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "reduction", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.ScatterND", "summary": "ONNX ScatterND operation", "description": "ScatterND takes three inputs `data` tensor of rank r >= 1, `indices` tensor of rank q >= 1,\n and `updates` tensor of rank q + r - indices.shape[-1] - 1. The output of the operation\n is produced by creating a copy of the input `data`, and then updating its value to values\n specified by `updates` at specific index positions specified by `indices`. Its output shape\n is the same as the shape of `data`.\n \n `indices` is an integer tensor. Let k denote indices.shape[-1], the last dimension in the shape of `indices`.\n `indices` is treated as a (q-1)-dimensional tensor of k-tuples, where each k-tuple is a partial-index into `data`.\n Hence, k can be a value at most the rank of `data`. When k equals rank(data), each update entry specifies an\n update to a single element of the tensor. When k is less than rank(data) each update entry specifies an\n update to a slice of the tensor. Index values are allowed to be negative, as per the usual\n convention for counting backwards from the end, but are expected in the valid range.\n \n `updates` is treated as a (q-1)-dimensional tensor of replacement-slice-values. Thus, the\n first (q-1) dimensions of updates.shape must match the first (q-1) dimensions of indices.shape.\n The remaining dimensions of `updates` correspond to the dimensions of the\n replacement-slice-values. Each replacement-slice-value is a (r-k) dimensional tensor,\n corresponding to the trailing (r-k) dimensions of `data`. Thus, the shape of `updates`\n must equal indices.shape[0:q-1] ++ data.shape[k:r-1], where ++ denotes the concatenation\n of shapes.\n \n The `output` is calculated via the following equation:\n \n ```\n output = np.copy(data)\n update_indices = indices.shape[:-1]\n for idx in np.ndindex(update_indices):\n output[tuple(indices[idx])] = updates[idx]\n ```\n \n The order of iteration in the above loop is not specified.\n In particular, indices should not have duplicate entries: that is, if idx1 != idx2, then indices[idx1] != indices[idx2].\n This ensures that the output value does not depend on the iteration order.\n \n `reduction` allows specification of an optional reduction operation, which is applied to all values in `updates`\n tensor into `output` at the specified `indices`.\n In cases where `reduction` is set to \\\"none\\\", indices should not have duplicate entries: that is, if idx1 != idx2,\n then indices[idx1] != indices[idx2]. This ensures that the output value does not depend on the iteration order.\n When `reduction` is set to some reduction function `f`, `output` is calculated as follows:\n \n ```\n output = np.copy(data)\n update_indices = indices.shape[:-1]\n for idx in np.ndindex(update_indices):\n output[tuple(indices[idx])] = f(output[tuple(indices[idx])], updates[idx])\n ```\n \n where the `f` is `+`, `*`, `max` or `min` as specified.\n \n This operator is the inverse of GatherND.\n \n (Opset 18 change): Adds max/min to the set of allowed reduction ops.\n \n Example 1:\n ```\n data = [1, 2, 3, 4, 5, 6, 7, 8]\n indices = [[4], [3], [1], [7]]\n updates = [9, 10, 11, 12]\n output = [1, 11, 3, 10, 9, 6, 7, 12]\n ```\n \n Example 2:\n ```\n data = [[[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]],\n [[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]],\n [[8, 7, 6, 5], [4, 3, 2, 1], [1, 2, 3, 4], [5, 6, 7, 8]],\n [[8, 7, 6, 5], [4, 3, 2, 1], [1, 2, 3, 4], [5, 6, 7, 8]]]\n indices = [[0], [2]]\n updates = [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],\n [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4]]]\n output = [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],\n [[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]],\n [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4]],\n [[8, 7, 6, 5], [4, 3, 2, 1], [1, 2, 3, 4], [5, 6, 7, 8]]]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "TensorOf<[I64]>" }, { "name": "updates", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "reduction", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.Selu", "summary": "ONNX Selu operation", "description": "Selu takes one input data (Tensor) and produces one output data\n (Tensor) where the scaled exponential linear unit function,\n `y = gamma * (alpha * e^x - alpha) for x <= 0`, `y = gamma * x for x > 0`,\n is applied to the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "gamma", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.SequenceAt", "summary": "ONNX SequenceAt operation", "description": "Outputs a tensor copy from the tensor at 'position' in 'input_sequence'.\n Accepted range for 'position' is in `[-n, n - 1]`, where `n` is the number of tensors in 'input_sequence'.\n Negative value means counting positions from the back.", "operands": [ { "name": "input_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" }, { "name": "position", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "tensor", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ] }, { "name": "onnx.SequenceConstruct", "summary": "ONNX SequenceConstruct operation", "description": "Construct a tensor sequence containing 'inputs' tensors.\n All tensors in 'inputs' must have the same data type.", "operands": [ { "name": "inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "results": [ { "name": "output_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ] }, { "name": "onnx.SequenceEmpty", "summary": "ONNX SequenceEmpty operation", "description": "Construct an empty tensor sequence, with given data type.", "results": [ { "name": "output", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ], "attributes": [ { "name": "dtype", "type": "OptionalAttr" } ] }, { "name": "onnx.SequenceErase", "summary": "ONNX SequenceErase operation", "description": "Outputs a tensor sequence that removes the tensor at 'position' from 'input_sequence'.\n Accepted range for 'position' is in `[-n, n - 1]`, where `n` is the number of tensors in 'input_sequence'.\n Negative value means counting positions from the back.\n 'position' is optional, by default it erases the last tensor from 'input_sequence'.", "operands": [ { "name": "input_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" }, { "name": "position", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ] }, { "name": "onnx.SequenceInsert", "summary": "ONNX SequenceInsert operation", "description": "Outputs a tensor sequence that inserts 'tensor' into 'input_sequence' at 'position'.\n 'tensor' must have the same data type as 'input_sequence'.\n Accepted range for 'position' is in `[-n, n]`, where `n` is the number of tensors in 'input_sequence'.\n Negative value means counting positions from the back.\n 'position' is optional, by default it inserts 'tensor' to the back of 'input_sequence'.", "operands": [ { "name": "input_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" }, { "name": "tensor", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "position", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ] }, { "name": "onnx.SequenceLength", "summary": "ONNX SequenceLength operation", "description": "Produces a scalar(tensor of empty shape) containing the number of tensors in 'input_sequence'.", "operands": [ { "name": "input_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ], "results": [ { "name": "length", "type": "TensorOf<[I64]>" } ] }, { "name": "onnx.SequenceMap", "summary": "ONNX SequenceMap operation", "description": "Applies a sub-graph to each sample in the input sequence(s).\n \n Inputs can be either tensors or sequences, with the exception of the first input which must\n be a sequence. The length of the first input sequence will determine the number of samples in the\n outputs. Any other sequence inputs should have the same number of samples. The number of inputs\n and outputs, should match the one of the subgraph.\n \n For each i-th element in the output, a sample will be extracted from the input sequence(s) at\n the i-th position and the sub-graph will be applied to it.\n The outputs will contain the outputs of the sub-graph for each sample, in the same order as in\n the input.\n \n This operator assumes that processing each sample is independent and could executed in parallel\n or in any order. Users cannot expect any specific ordering in which each subgraph is computed.", "operands": [ { "name": "input_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" }, { "name": "additional_inputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] >, SeqOf < [ TensorOf < [ UI8 ] > ] >, SeqOf < [ TensorOf < [ UI16 ] > ] >, SeqOf < [ TensorOf < [ UI32 ] > ] >, SeqOf < [ TensorOf < [ UI64 ] > ] >, SeqOf < [ TensorOf < [ I8 ] > ] >, SeqOf < [ TensorOf < [ I16 ] > ] >, SeqOf < [ TensorOf < [ I32 ] > ] >, SeqOf < [ TensorOf < [ I64 ] > ] >, SeqOf < [ TensorOf < [ F16 ] > ] >, SeqOf < [ TensorOf < [ F32 ] > ] >, SeqOf < [ TensorOf < [ F64 ] > ] >, SeqOf < [ TensorOf < [ StringType ] > ] >, SeqOf < [ TensorOf < [ I1 ] > ] >, SeqOf < [ TensorOf < [ Complex < F32 > ] > ] >, SeqOf < [ TensorOf < [ Complex < F64 > ] > ] > ]>>" } ], "results": [ { "name": "out_sequence", "type": "Variadic ] >, SeqOf < [ TensorOf < [ UI16 ] > ] >, SeqOf < [ TensorOf < [ UI32 ] > ] >, SeqOf < [ TensorOf < [ UI64 ] > ] >, SeqOf < [ TensorOf < [ I8 ] > ] >, SeqOf < [ TensorOf < [ I16 ] > ] >, SeqOf < [ TensorOf < [ I32 ] > ] >, SeqOf < [ TensorOf < [ I64 ] > ] >, SeqOf < [ TensorOf < [ F16 ] > ] >, SeqOf < [ TensorOf < [ F32 ] > ] >, SeqOf < [ TensorOf < [ F64 ] > ] >, SeqOf < [ TensorOf < [ StringType ] > ] >, SeqOf < [ TensorOf < [ I1 ] > ] >, SeqOf < [ TensorOf < [ Complex < F32 > ] > ] >, SeqOf < [ TensorOf < [ Complex < F64 > ] > ] > ]>>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "onnx.Shape", "category": "Shape", "summary": "ONNX Shape operation", "description": "Takes a tensor as input and outputs an 1D int64 tensor containing the shape of the input tensor.\n Optional attributes start and end can be used to compute a slice of the input tensor's shape.\n If start axis is omitted, the slice starts from axis 0.\n The end axis, if specified, is exclusive (and the returned value will not include the size of that axis).\n If the end axis is omitted, the axes upto the last one will be included.\n Negative axes indicate counting back from the last axis.\n Note that axes will be clamped to the range [0, r], where r is the\n rank of the input tensor if they are out-of-range (after adding r in the case of\n negative axis). Thus, specifying any end value > r is equivalent to specifying an end\n value of r, and specifying any start value < -r is equivalent to specifying a start\n value of 0. If start > end, the result will be an empty shape.\n \n Examples:\n \n ```\n Input tensor with shape: [2, 3, 4]\n No attributes specified.\n Output: [2, 3, 4]\n ```\n \n ```\n Input tensor with shape: [2, 3, 4]\n start: -1\n Output: [4]\n ```\n \n ```\n Input tensor with shape: [2, 3, 4]\n end: -1\n Output: [2, 3]\n ```\n \n ```\n Input tensor with shape: [2, 3, 4]\n start: 1\n end: 2\n Output: [3]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "results": [ { "name": "shape", "type": "TensorOf<[I64]>" } ], "attributes": [ { "name": "end", "type": "OptionalAttr" }, { "name": "start", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.ShapeTransform", "summary": "ONNX Element-wise shape transformation operation", "description": "This operator transforms a tensor into another tensor whose shape is changed\n by a given affine map. This is elemement-wise transformation, so each element\n in the input will be copied to an element in the output via the affine map.\n The affine map must be bijective.\n\n For example, the following code is using `onnx.ShapeTransform` to reshape\n a tensor from 2D to 4D.\n ```mlir\n #reshape = affine_map(d0, d1) -> (d0/32, d0%32, d1/64, d1%64)\n %Y = onnx.ShapeTransform(%arg0) {index_map = #reshape} : (tensor<128x128xf32>) -> tensor<4x32x2x64xf32>\n ```\n\n `onnx.ShapeTransform` will be finally materialized into an `affine.for` via\n lowering to `krnl` dialect, e.g.\n ```mlir\n %alloc = memref.alloc() {alignment = 16 : i64} : memref<4x32x2x64xf32>\n affine.for %arg1 = 0 to 128 {\n affine.for %arg2 = 0 to 128 {\n %0 = affine.load %arg0[%arg1, %arg2] : memref< 128x128xf32 >\n affine.store %0, %alloc[%arg1 / 32, %arg1 % 32, %arg2 / 64, %arg2 % 64] : memref<4x32x2x64xf32>\n }\n }\n ```\n\n When being canonicalized, ShapeTransform operations are composed into\n a new ShapeTransform operation by composing their affine maps.\n\n At this moment, this operation only supports static dimensions.\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F32]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F32]>]>" } ], "attributes": [ { "name": "index_map", "type": "AffineMapAttr" } ] }, { "name": "onnx.Shrink", "summary": "ONNX Shrink operation", "description": "Shrink takes one input data (Tensor) and produces one Tensor output,\n having same datatype and shape with input. It has two attributes, lambd and\n bias. The formula of this operator is: If x < -lambd, y = x + bias;\n If x > lambd, y = x - bias; Otherwise, y = 0.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "bias", "type": "DefaultValuedAttr" }, { "name": "lambd", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Sigmoid", "category": "Activation", "summary": "ONNX Sigmoid operation", "description": "Sigmoid takes one input data (Tensor) and produces one output data\n (Tensor) where the sigmoid function, y = 1 / (1 + exp(-x)), is applied to the\n tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Sign", "summary": "ONNX Sign operation", "description": "Calculate the sign of the given input tensor element-wise.\n If input > 0, output 1. if input < 0, output -1. if input == 0, output 0.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Sin", "summary": "ONNX Sin operation", "description": "Calculates the sine of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Sinh", "summary": "ONNX Sinh operation", "description": "Calculates the hyperbolic sine of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Size", "category": "Shape", "summary": "ONNX Size operation", "description": "Takes a tensor as input and outputs a int64 scalar that equals to the total number of elements of the input tensor.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "results": [ { "name": "size", "type": "TensorOf<[I64]>" } ] }, { "name": "onnx.Slice", "category": "Tensor", "summary": "ONNX Slice operation", "description": "Produces a slice of the input tensor along multiple axes. Similar to numpy:\n https://numpy.org/doc/stable/user/basics.indexing.html?highlight=slice#slicing-and-striding\n \n Slice uses the `starts`, `ends`, `axes` and `steps` inputs to select a sub-tensor\n of its input `data` tensor.\n \n An effective `starts[i]`, `ends[i]`, and `steps[i]` must be computed for each `i`\n in `[0, ... r-1]` where `r = rank(input)` as follows:\n \n If `axes` are omitted, they are set to `[0, ..., r-1]`.\n If `steps` are omitted, they are set to `[1, ..., 1]` of length `len(starts)`\n \n The effective values are initialized as `start[i] = 0`, `ends[i] = dims[i]` where\n `dims` are the dimensions of `input` and `steps[i] = 1`.\n \n All negative elements of `axes` are made non-negative by adding `r` to them, where\n `r =rank(input)`.\n \n All negative values in `starts[i]` and `ends[i]` have `dims[axes[i]]` added to them,\n where `dims` are the dimensions of `input`. Then `start[axes[i]]` is the adjusted\n `starts[i]` is clamped into the range `[0, dims[axes[i]]]` for positive stepping\n and `[0, dims[axes[i]]-1]` for negative stepping.\n \n The clamping for the adjusted `ends[i]` depends on the sign of `steps[i]` and must\n accommodate copying 0 through `dims[axes[i]]` elements, so for positive stepping\n `ends[axes[i]]` is clamped to `[0, dims[axes[i]]]`, while for negative stepping it\n is clamped to `[-1, dims[axes[i]]-1]`.\n \n Finally, `steps[axes[i]] = steps[i]`.\n \n For slicing to the end of a dimension with unknown size, it is recommended to pass\n in `INT_MAX` when slicing forward and 'INT_MIN' when slicing backward.\n \n Example 1:\n \n ```\n data = [\n [1, 2, 3, 4],\n [5, 6, 7, 8],\n ]\n axes = [0, 1]\n starts = [1, 0]\n ends = [2, 3]\n steps = [1, 2]\n result = [\n [5, 7],\n ]\n ```\n \n Example 2:\n \n ```\n data = [\n [1, 2, 3, 4],\n [5, 6, 7, 8],\n ]\n starts = [0, 1]\n ends = [-1, 1000]\n result = [\n [2, 3, 4],\n ]\n ```", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "starts", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "ends", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" }, { "name": "steps", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ] }, { "name": "onnx.Softmax", "category": "Activation", "summary": "ONNX Softmax operation", "description": "The operator computes the normalized exponential values for the given input:\n \n Softmax(input, axis) = Exp(input) / ReduceSum(Exp(input), axis=axis, keepdims=1) \n \n The \\\"axis\\\" attribute indicates the dimension along which Softmax\n will be performed. The output tensor has the same shape\n and contains the Softmax values of the corresponding input.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.SoftmaxCrossEntropyLoss", "summary": "ONNX SoftmaxCrossEntropyLoss operation", "description": "Loss function that measures the softmax cross entropy\n between 'scores' and 'labels'.\n This operator first computes a loss tensor whose shape is identical to the labels input.\n If the input is 2-D with shape (N, C), the loss tensor may be a N-element vector L = (l_1, l_2, ..., l_N).\n If the input is N-D tensor with shape (N, C, D1, D2, ..., Dk),\n the loss tensor L may have (N, D1, D2, ..., Dk) as its shape and L[i,][j_1][j_2]...[j_k] denotes a scalar element in L.\n After L is available, this operator can optionally do a reduction operator.\n \n * shape(scores): (N, C) where C is the number of classes, or (N, C, D1, D2,..., Dk),\n with K >= 1 in case of K-dimensional loss.\n * shape(labels): (N) where each value is 0 <= labels[i] <= C-1, or (N, D1, D2,..., Dk),\n with K >= 1 in case of K-dimensional loss.\n \n The loss for one sample, l_i, can calculated as follows:\n ```\n l[i][d1][d2]...[dk] = -y[i][c][d1][d2]..[dk], where i is the index of classes.\n ```\n or\n ```\n l[i][d1][d2]...[dk] = -y[i][c][d1][d2]..[dk] * weights[c], if 'weights' is provided.\n ```\n \n loss is zero for the case when label-value equals ignore_index.\n ```\n l[i][d1][d2]...[dk] = 0, when labels[n][d1][d2]...[dk] = ignore_index\n ```\n \n where:\n ```\n p = Softmax(scores)\n y = Log(p)\n c = labels[i][d1][d2]...[dk]\n ```\n \n Finally, L is optionally reduced:\n \n * If reduction = 'none', the output is L with shape (N, D1, D2, ..., Dk).\n * If reduction = 'sum', the output is scalar: Sum(L).\n * If reduction = 'mean', the output is scalar: ReduceMean(L), or if weight is provided: `ReduceSum(L) / ReduceSum(W)`,\n where tensor W is of shape `(N, D1, D2, ..., Dk)` and `W[n][d1][d2]...[dk] = weights[labels[i][d1][d2]...[dk]]`.", "operands": [ { "name": "scores", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "labels", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "weights", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "log_prob", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" } ], "attributes": [ { "name": "ignore_index", "type": "OptionalAttr" }, { "name": "reduction", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.SoftmaxV11", "summary": "ONNX Softmax operation", "description": "The operator computes the softmax (normalized exponential) values for each layer in the batch\n of the given input.\n \n The input does not need to explicitly be a 2D vector; rather, it will be\n coerced into one. For an arbitrary n-dimensional tensor\n input \\in [a_0, a_1, ..., a_{k-1}, a_k, ..., a_{n-1\\}\\] and k is\n the axis provided, then input will be coerced into a 2-dimensional tensor with\n dimensions [a_0 * ... * a_{k-1}, a_k * ... * a_{n-1\\}\\]. For the default\n case where axis=1, this means the input tensor will be coerced into a 2D tensor\n of dimensions [a_0, a_1 * ... * a_{n-1\\}\\], where a_0 is often the batch size.\n In this situation, we must have a_0 = N and a_1 * ... * a_{n-1} = D.\n Each of these dimensions must be matched correctly, or else the operator\n will throw errors. The output tensor has the same shape\n and contains the softmax values of the corresponding input.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Softplus", "summary": "ONNX Softplus operation", "description": "Softplus takes one input data (Tensor) and produces one output data\n (Tensor) where the softplus function, y = ln(exp(x) + 1), is applied to\n the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Softsign", "summary": "ONNX Softsign operation", "description": "Calculates the softsign (x/(1+|x|)) of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.SpaceToDepth", "summary": "ONNX SpaceToDepth operation", "description": "SpaceToDepth rearranges blocks of spatial data into depth. More specifically,\n this op outputs a copy of the input tensor where values from the height and width dimensions\n are moved to the depth dimension.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "blocksize", "type": "SI64Attr" } ] }, { "name": "onnx.Split", "summary": "ONNX Split operation", "description": "Split a tensor into a list of tensors, along the specified 'axis'.\n Either input 'split' or the attribute 'num_outputs' should be specified, but not both.\n If the attribute 'num_outputs' is specified, then the tensor is split into equal sized parts.\n If the tensor is not evenly splittable into `num_outputs`, the last chunk will be smaller.\n If the input 'split' is specified, it indicates the sizes of each output in the split.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "split", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "num_outputs", "type": "OptionalAttr" } ] }, { "name": "onnx.SplitToSequence", "summary": "ONNX SplitToSequence operation", "description": "Split a tensor into a sequence of tensors, along the specified 'axis'.\n Lengths of the parts can be specified using the optional argument 'split'.\n If the argument `split' is not specified, a default scalar value of 1\n is used as the value of `split'.\n 'split' must contain only positive numbers.\n 'split' is either a scalar (tensor of empty shape), or a 1-D tensor.\n If 'split' is a scalar, then 'input' will be split into chunks all of size 'split'\n if possible. The last chunk alone may be smaller than 'split' if the 'input' size\n along the given axis 'axis' is not divisible by 'split'.\n If 'split' is a 1-dimensional tensor, the input tensor is split into 'size(split)' chunks,\n with lengths of the parts on 'axis' specified in 'split'. In this scenario, the sum of entries\n in 'split' must be equal to the dimension size of input tensor on 'axis'.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "split", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output_sequence", "type": "AnyTypeOf<[SeqOf<[TensorOf<[UI8]>]>, SeqOf<[TensorOf<[UI16]>]>, SeqOf<[TensorOf<[UI32]>]>, SeqOf<[TensorOf<[UI64]>]>, SeqOf<[TensorOf<[I8]>]>, SeqOf<[TensorOf<[I16]>]>, SeqOf<[TensorOf<[I32]>]>, SeqOf<[TensorOf<[I64]>]>, SeqOf<[TensorOf<[F16]>]>, SeqOf<[TensorOf<[F32]>]>, SeqOf<[TensorOf<[F64]>]>, SeqOf<[TensorOf<[StringType]>]>, SeqOf<[TensorOf<[I1]>]>, SeqOf<[TensorOf<[Complex]>]>, SeqOf<[TensorOf<[Complex]>]>]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.SplitV11", "summary": "ONNX Split operation", "description": "Split a tensor into a list of tensors, along the specified\n 'axis'. Lengths of the parts can be specified using argument 'split'.\n Otherwise, the tensor is split to equal sized parts.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "split", "type": "OptionalAttr>" } ] }, { "name": "onnx.SplitV13", "summary": "ONNX Split operation", "description": "Split a tensor into a list of tensors, along the specified\n 'axis'. Lengths of the parts can be specified using input 'split'.\n Otherwise, the tensor is split to equal sized parts.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "split", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "outputs", "type": "Variadic, TensorOf < [ UI16 ] >, TensorOf < [ UI32 ] >, TensorOf < [ UI64 ] >, TensorOf < [ I8 ] >, TensorOf < [ I16 ] >, TensorOf < [ I32 ] >, TensorOf < [ I64 ] >, TensorOf < [ BF16 ] >, TensorOf < [ F16 ] >, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ StringType ] >, TensorOf < [ I1 ] >, TensorOf < [ Complex < F32 > ] >, TensorOf < [ Complex < F64 > ] > ]>>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Sqrt", "summary": "ONNX Sqrt operation", "description": "Square root takes one input data (Tensor) and produces one output data\n (Tensor) where the square root is, y = x^0.5, is applied to\n the tensor elementwise. If x is negative, then it will return NaN.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Squeeze", "summary": "ONNX Squeeze operation", "description": "Remove single-dimensional entries from the shape of a tensor.\n Takes an input `axes` with a list of axes to squeeze.\n If `axes` is not provided, all the single dimensions will be removed from\n the shape. If an axis is selected with shape entry not equal to one, an error is raised.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" }, { "name": "axes", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "squeezed", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ] }, { "name": "onnx.SqueezeV11", "summary": "ONNX Squeeze operation", "description": "Remove single-dimensional entries from the shape of a tensor.\n Takes a parameter `axes` with a list of axes to squeeze.\n If `axes` is not provided, all the single dimensions will be removed from\n the shape. If an axis is selected with shape entry not equal to one, an error is raised.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "squeezed", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axes", "type": "OptionalAttr>" } ] }, { "name": "onnx.STFT", "summary": "ONNX STFT operation", "description": "Computes the Short-time Fourier Transform of the signal.", "operands": [ { "name": "signal", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "frame_step", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>]>" }, { "name": "window", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>, NoneType]>" }, { "name": "frame_length", "type": "AnyTypeOf<[TensorOf<[I32]>, TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F16]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "attributes": [ { "name": "onesided", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.StringNormalizer", "summary": "ONNX StringNormalizer operation", "description": "StringNormalization performs string operations for basic cleaning.\n This operator has only one input (denoted by X) and only one output\n (denoted by Y). This operator first examines the elements in the X,\n and removes elements specified in \\\"stopwords\\\" attribute.\n After removing stop words, the intermediate result can be further lowercased,\n uppercased, or just returned depending the \\\"case_change_action\\\" attribute.\n This operator only accepts [C]- and [1, C]-tensor.\n If all elements in X are dropped, the output will be the empty value of string tensor with shape [1]\n if input shape is [C] and shape [1, 1] if input shape is [1, C].", "operands": [ { "name": "X", "type": "TensorOf<[StringType]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[StringType]>" } ], "attributes": [ { "name": "case_change_action", "type": "DefaultValuedStrAttr" }, { "name": "is_case_sensitive", "type": "DefaultValuedAttr" }, { "name": "locale", "type": "OptionalAttr" }, { "name": "stopwords", "type": "OptionalAttr>" } ] }, { "name": "onnx.Sub", "summary": "ONNX Sub operation", "description": "Performs element-wise binary subtraction (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).\n \n (Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.", "operands": [ { "name": "A", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" }, { "name": "B", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ], "results": [ { "name": "C", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.Sum", "summary": "ONNX Sum operation", "description": "Element-wise sum of each of the input tensors (with Numpy-style broadcasting support).\n All inputs and outputs must have the same data type.\n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "data_0", "type": "Variadic, TensorOf < [ F32 ] >, TensorOf < [ F64 ] >, TensorOf < [ BF16 ] > ]>>" } ], "results": [ { "name": "sum", "type": "AnyTypeOf<[TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[BF16]>]>" } ] }, { "name": "onnx.SVMClassifier", "summary": "ONNX SVMClassifier operation", "description": "Support Vector Machine classifier", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>]>" }, { "name": "Z", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "classlabels_ints", "type": "OptionalAttr>" }, { "name": "classlabels_strings", "type": "OptionalAttr>" }, { "name": "coefficients", "type": "OptionalAttr>" }, { "name": "kernel_params", "type": "OptionalAttr>" }, { "name": "kernel_type", "type": "DefaultValuedStrAttr" }, { "name": "post_transform", "type": "DefaultValuedStrAttr" }, { "name": "prob_a", "type": "OptionalAttr>" }, { "name": "prob_b", "type": "OptionalAttr>" }, { "name": "rho", "type": "OptionalAttr>" }, { "name": "support_vectors", "type": "OptionalAttr>" }, { "name": "vectors_per_class", "type": "OptionalAttr>" } ] }, { "name": "onnx.SVMRegressor", "summary": "ONNX SVMRegressor operation", "description": "Support Vector Machine regression prediction and one-class SVM anomaly detection.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "coefficients", "type": "OptionalAttr>" }, { "name": "kernel_params", "type": "OptionalAttr>" }, { "name": "kernel_type", "type": "DefaultValuedStrAttr" }, { "name": "n_supports", "type": "DefaultValuedAttr" }, { "name": "one_class", "type": "DefaultValuedAttr" }, { "name": "post_transform", "type": "DefaultValuedStrAttr" }, { "name": "rho", "type": "OptionalAttr>" }, { "name": "support_vectors", "type": "OptionalAttr>" } ] }, { "name": "onnx.Tan", "summary": "ONNX Tan operation", "description": "Calculates the tangent of the given input tensor, element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.Tanh", "category": "Activation", "summary": "ONNX Tanh operation", "description": "Calculates the hyperbolic tangent of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ] }, { "name": "onnx.TfIdfVectorizer", "summary": "ONNX TfIdfVectorizer operation", "description": "This transform extracts n-grams from the input sequence and save them as a vector. Input can\n be either a 1-D or 2-D tensor. For 1-D input, output is the n-gram representation of that input.\n For 2-D input, the output is also a 2-D tensor whose i-th row is the n-gram representation of the i-th input row.\n More specifically, if input shape is [C], the corresponding output shape would be [max(ngram_indexes) + 1].\n If input shape is [N, C], this operator produces a [N, max(ngram_indexes) + 1]-tensor.\n \n In contrast to standard n-gram extraction, here, the indexes of extracting an n-gram from the original\n sequence are not necessarily consecutive numbers. The discontinuity between indexes are controlled by the number of skips.\n If the number of skips is 2, we should skip two tokens when scanning through the original sequence.\n Let's consider an example. Assume that input sequence is [94, 17, 36, 12, 28] and the number of skips is 2.\n The associated 2-grams are [94, 12] and [17, 28] respectively indexed by [0, 3] and [1, 4].\n If the number of skips becomes 0, the 2-grams generated are [94, 17], [17, 36], [36, 12], [12, 28]\n indexed by [0, 1], [1, 2], [2, 3], [3, 4], respectively.\n \n The output vector (denoted by Y) stores the count of each n-gram;\n Y[ngram_indexes[i]] indicates the times that the i-th n-gram is found. The attribute ngram_indexes is used to determine the mapping\n between index i and the corresponding n-gram's output coordinate. If pool_int64s is [94, 17, 17, 36], ngram_indexes is [1, 0],\n ngram_counts=[0, 0], then the Y[0] (first element in Y) and Y[1] (second element in Y) are the counts of [17, 36] and [94, 17],\n respectively. An n-gram which cannot be found in pool_strings/pool_int64s should be ignored and has no effect on the output.\n Note that we may consider all skips up to S when generating the n-grams.\n \n The examples used above are true if mode is \\\"TF\\\". If mode is \\\"IDF\\\", all the counts larger than 1 would be truncated to 1 and\n the i-th element in weights would be used to scale (by multiplication) the count of the i-th n-gram in pool. If mode is \\\"TFIDF\\\",\n this operator first computes the counts of all n-grams and then scale them by the associated values in the weights attribute.\n \n Only one of pool_strings and pool_int64s can be set. If pool_int64s is set, the input should be an integer tensor.\n If pool_strings is set, the input must be a string tensor.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I32]>, TensorOf<[I64]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "max_gram_length", "type": "SI64Attr" }, { "name": "max_skip_count", "type": "SI64Attr" }, { "name": "min_gram_length", "type": "SI64Attr" }, { "name": "mode", "type": "StrAttr" }, { "name": "ngram_counts", "type": "TypedArrayAttrBase" }, { "name": "ngram_indexes", "type": "TypedArrayAttrBase" }, { "name": "pool_int64s", "type": "OptionalAttr>" }, { "name": "pool_strings", "type": "OptionalAttr>" }, { "name": "weights", "type": "OptionalAttr>" } ] }, { "name": "onnx.ThresholdedRelu", "summary": "ONNX ThresholdedRelu operation", "description": "ThresholdedRelu takes one input data (Tensor) and produces one output data\n (Tensor) where the rectified linear function, y = x for x > alpha, y = 0 otherwise,\n is applied to the tensor elementwise.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Tile", "summary": "ONNX Tile operation", "description": "Constructs a tensor by tiling a given tensor.\n This is the same as function `tile` in Numpy, but no broadcast.\n For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]]", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "repeats", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ] }, { "name": "onnx.TopK", "summary": "ONNX TopK operation", "description": "Retrieve the top-K largest or smallest elements along a specified axis. Given an input tensor of\n shape [a_0, a_1, ..., a_{n-1\\}\\] and integer argument k, return two outputs:\n \n * Value tensor of shape [a_0, a_1, ..., a_{axis-1}, k, a_{axis+1}, ... a_{n-1\\}\\]\n which contains the values of the top k elements along the specified axis\n * Index tensor of shape [a_0, a_1, ..., a_{axis-1}, k, a_{axis+1}, ... a_{n-1\\}\\] which\n contains the indices of the top k elements (original indices from the input\n tensor).\n \n * If \\\"largest\\\" is 1 (the default value) then the k largest elements are returned.\n * If \\\"sorted\\\" is 1 (the default value) then the resulting k elements will be sorted.\n * If \\\"sorted\\\" is 0, order of returned 'Values' and 'Indices' are undefined.\n \n Given two equivalent values, this operator uses the indices along the axis as\n a tiebreaker. That is, the element with the lower index will appear first.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "K", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "Values", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" }, { "name": "Indices", "type": "TensorOf<[I64]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "largest", "type": "DefaultValuedAttr" }, { "name": "sorted", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Transpose", "category": "Transform", "summary": "ONNX Transpose operation", "description": "Returns a transpose of the input tensor. (Similar to `numpy.transpose`).\n The optional attribute `perm` must be a permutation of the dimensions of\n the input tensor. Axis `i` of the output tensor corresponds to the axis\n `perm[i]` of the input tensor.\n For example, when perm=(1, 0, 2), given an input tensor of shape (1, 2, 3),\n the output shape will be (2, 1, 3).\n When perm=(1, 2, 0), given an input tensor of shape (1, 2, 3),\n the output shape will be (2, 3, 1).\n If the attribute `perm` is omitted, its default value is `(n-1, ..., 0)`,\n where `n` is the rank of the input tensor.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "results": [ { "name": "transposed", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ], "attributes": [ { "name": "perm", "type": "OptionalAttr>" } ] }, { "name": "onnx.TreeEnsembleClassifier", "summary": "ONNX TreeEnsembleClassifier operation", "description": "Tree Ensemble classifier. Returns the top class for each of N inputs.
\n The attributes named 'nodes_X' form a sequence of tuples, associated by\n index into the sequences, which must all be of equal length. These tuples\n define the nodes.
\n Similarly, all fields prefixed with 'class_' are tuples of votes at the leaves.\n A leaf may have multiple votes, where each vote is weighted by\n the associated class_weights index.
\n One and only one of classlabels_strings or classlabels_int64s\n will be defined. The class_ids are indices into this list.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[StringType]>, TensorOf<[I64]>]>" }, { "name": "Z", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "base_values", "type": "OptionalAttr>" }, { "name": "class_ids", "type": "OptionalAttr>" }, { "name": "class_nodeids", "type": "OptionalAttr>" }, { "name": "class_treeids", "type": "OptionalAttr>" }, { "name": "class_weights", "type": "OptionalAttr>" }, { "name": "classlabels_int64s", "type": "OptionalAttr>" }, { "name": "classlabels_strings", "type": "OptionalAttr>" }, { "name": "nodes_falsenodeids", "type": "OptionalAttr>" }, { "name": "nodes_featureids", "type": "OptionalAttr>" }, { "name": "nodes_hitrates", "type": "OptionalAttr>" }, { "name": "nodes_missing_value_tracks_true", "type": "OptionalAttr>" }, { "name": "nodes_modes", "type": "OptionalAttr>" }, { "name": "nodes_nodeids", "type": "OptionalAttr>" }, { "name": "nodes_treeids", "type": "OptionalAttr>" }, { "name": "nodes_truenodeids", "type": "OptionalAttr>" }, { "name": "nodes_values", "type": "OptionalAttr>" }, { "name": "post_transform", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.TreeEnsembleRegressor", "summary": "ONNX TreeEnsembleRegressor operation", "description": "Tree Ensemble regressor. Returns the regressed values for each input in N.
\n All args with nodes_ are fields of a tuple of tree nodes, and\n it is assumed they are the same length, and an index i will decode the\n tuple across these inputs. Each node id can appear only once\n for each tree id.
\n All fields prefixed with target_ are tuples of votes at the leaves.
\n A leaf may have multiple votes, where each vote is weighted by\n the associated target_weights index.
\n All trees must have their node ids start at 0 and increment by 1.
\n Mode enum is BRANCH_LEQ, BRANCH_LT, BRANCH_GTE, BRANCH_GT, BRANCH_EQ, BRANCH_NEQ, LEAF", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[I64]>, TensorOf<[I32]>]>" } ], "results": [ { "name": "Y", "type": "TensorOf<[F32]>" } ], "attributes": [ { "name": "aggregate_function", "type": "DefaultValuedStrAttr" }, { "name": "base_values", "type": "OptionalAttr>" }, { "name": "n_targets", "type": "OptionalAttr" }, { "name": "nodes_falsenodeids", "type": "OptionalAttr>" }, { "name": "nodes_featureids", "type": "OptionalAttr>" }, { "name": "nodes_hitrates", "type": "OptionalAttr>" }, { "name": "nodes_missing_value_tracks_true", "type": "OptionalAttr>" }, { "name": "nodes_modes", "type": "OptionalAttr>" }, { "name": "nodes_nodeids", "type": "OptionalAttr>" }, { "name": "nodes_treeids", "type": "OptionalAttr>" }, { "name": "nodes_truenodeids", "type": "OptionalAttr>" }, { "name": "nodes_values", "type": "OptionalAttr>" }, { "name": "post_transform", "type": "DefaultValuedStrAttr" }, { "name": "target_ids", "type": "OptionalAttr>" }, { "name": "target_nodeids", "type": "OptionalAttr>" }, { "name": "target_treeids", "type": "OptionalAttr>" }, { "name": "target_weights", "type": "OptionalAttr>" } ] }, { "name": "onnx.Trilu", "summary": "ONNX Trilu operation", "description": "Given a 2-D matrix or batches of 2-D matrices, returns the upper or lower triangular part of the tensor(s).\n The attribute \\\"upper\\\" determines whether the upper or lower part is retained. If set to true,\n the upper triangular matrix is retained. Lower triangular matrix is retained otherwise.\n Default value for the \\\"upper\\\" attribute is true.\n Trilu takes one input tensor of shape [*, N, M], where * is zero or more batch dimensions. The upper triangular part consists\n of the elements on and above the given diagonal (k). The lower triangular part consists of elements on and below the diagonal.\n All other elements in the matrix are set to zero.\n If k = 0, the triangular part on and above/below the main diagonal is retained.\n If upper is set to true, a positive k retains the upper triangular matrix excluding the main diagonal and (k-1) diagonals above it.\n A negative k value retains the main diagonal and |k| diagonals below it.\n If upper is set to false, a positive k retains the lower triangular matrix including the main diagonal and k diagonals above it.\n A negative k value excludes the main diagonal and (|k|-1) diagonals below it.", "operands": [ { "name": "input", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "k", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "upper", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Unique", "summary": "ONNX Unique operation", "description": "Find the unique elements of a tensor. When an optional attribute 'axis' is provided, unique subtensors sliced along the 'axis' are returned.\n Otherwise the input tensor is flattened and unique values of the flattened tensor are returned.\n \n This operator returns the unique values or sliced unique subtensors of the input tensor and three optional outputs.\n The first output tensor 'Y' contains all unique values or subtensors of the input.\n The second optional output tensor 'indices' contains indices of 'Y' elements' first occurrence in 'X'.\n The third optional output tensor 'inverse_indices' contains, for elements of 'X', its corresponding indices in 'Y'.\n The fourth optional output tensor 'counts' contains the count of each element of 'Y' in the input.\n \n Outputs are either sorted in ascending order or optionally in the order of the first occurrence of the values in the input.\n \n https://docs.scipy.org/doc/numpy/reference/generated/numpy.unique.html\n \n Example 1:\n ```\n input_X = [2, 1, 1, 3, 4, 3]\n attribute_sorted = 0\n attribute_axis = None\n output_Y = [2, 1, 3, 4]\n output_indices = [0, 1, 3, 4]\n output_inverse_indices = [0, 1, 1, 2, 3, 2]\n output_counts = [1, 2, 2, 1]\n ```\n \n Example 2:\n ```\n input_X = [[1, 3], [2, 3]]\n attribute_sorted = 1\n attribute_axis = None\n output_Y = [1, 2, 3]\n output_indices = [0, 2, 1]\n output_inverse_indices = [0, 2, 1, 2]\n output_counts = [1, 1, 2]\n ```\n \n Example 3:\n ```\n input_X = [[1, 0, 0], [1, 0, 0], [2, 3, 4]]\n attribute_sorted = 1\n attribute_axis = 0\n output_Y = [[1, 0, 0], [2, 3, 4]]\n output_indices = [0, 2]\n output_inverse_indices = [0, 0, 1]\n output_counts = [2, 1]\n ```\n \n Example 4:\n ```\n input_x = [[[1., 1.], [0., 1.], [2., 1.], [0., 1.]],\n [[1., 1.], [0., 1.], [2., 1.], [0., 1.]]]\n attribute_sorted = 1\n attribute_axis = 1\n ```\n \n intermediate data are presented below for better understanding:\n there are 4 subtensors sliced along axis 1 of input_x (shape = (2, 4, 2)):\n ```\n A: [[1, 1], [1, 1]],\n [[0, 1], [0, 1]],\n [[2, 1], [2, 1]],\n [[0, 1], [0, 1]].\n ```\n \n there are 3 unique subtensors:\n ```\n [[1, 1], [1, 1]],\n [[0, 1], [0, 1]],\n [[2, 1], [2, 1]].\n ```\n \n sorted unique subtensors:\n ```\n B: [[0, 1], [0, 1]],\n [[1, 1], [1, 1]],\n [[2, 1], [2, 1]].\n ```\n \n output_Y is constructed from B:\n ```\n [[[0. 1.], [1. 1.], [2. 1.]],\n [[0. 1.], [1. 1.], [2. 1.]]]\n ```\n \n output_indices is to map from B to A:\n ```\n [1, 0, 2]\n ```\n \n output_inverse_indices is to map from A to B:\n ```\n [1, 0, 2, 0]\n ```\n \n output_counts:\n ```\n [2, 1, 1]\n ```", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "indices", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" }, { "name": "inverse_indices", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" }, { "name": "counts", "type": "AnyTypeOf<[TensorOf<[I64]>, NoneType]>" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" }, { "name": "sorted", "type": "DefaultValuedAttr" } ] }, { "name": "onnx.Unsqueeze", "summary": "ONNX Unsqueeze operation", "description": "Insert single-dimensional entries to the shape of an input tensor (`data`).\n Takes one required input `axes` - which contains a list of dimension indices and this operator will insert a dimension of value `1` into the corresponding index of the output tensor (`expanded`).\n \n For example, given an input tensor (`data`) of shape [3, 4, 5], then\n Unsqueeze(data, axes=[0, 4]) outputs a tensor (`expanded`) containing same data as `data` but with shape [1, 3, 4, 5, 1].\n \n The input `axes` should not contain any duplicate entries. It is an error if it contains duplicates.\n The rank of the output tensor (`output_rank`) is the rank of the input tensor (`data`) plus the number of values in `axes`.\n Each value in `axes` should be within the (inclusive) range [-output_rank , output_rank - 1].\n The order of values in `axes` does not matter and can come in any order.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" }, { "name": "axes", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "expanded", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>, TensorOf<[F8E4M3FN]>, TensorOf<[F8E4M3FNUZ]>, TensorOf<[F8E5M2]>, TensorOf<[F8E5M2FNUZ]>, TensorOf<[UI<4>]>, TensorOf<[I<4>]>]>" } ] }, { "name": "onnx.UnsqueezeV11", "summary": "ONNX Unsqueeze operation", "description": "Insert single-dimensional entries to the shape of an input tensor (`data`).\n Takes one required argument `axes` - which contains a list of dimension indices and this operator will insert a dimension of value `1` into the corresponding index of the output tensor (`expanded`).\n \n For example:\n Given an input tensor (`data`) of shape [3, 4, 5], then\n Unsqueeze(data, axes=[0, 4]) outputs a tensor (`expanded`) containing same data as `data` but with shape [1, 3, 4, 5, 1].\n \n The attribute `axes` should not contain any duplicate entries. It is an error if it contains duplicates.\n The rank of the output tensor (`output_rank`) is the rank of the input tensor (`data`) plus the number of values in `axes`.\n Each value in `axes` should be within the (inclusive) range [-output_rank , output_rank - 1].\n The order of values in `axes` does not matter and can come in any order.", "operands": [ { "name": "data", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "expanded", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ] }, { "name": "onnx.Upsample", "summary": "ONNX Upsample operation", "description": "Upsample the input tensor.\n Each dimension value of the output tensor is:\n output_dimension = floor(input_dimension * scale).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "scales", "type": "TensorOf<[F32]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" } ] }, { "name": "onnx.UpsampleAndPad", "summary": "ONNX UpsampleAndPad operation", "description": "This operation performs upsampling followed by padding on an n-dimensional tensor.\n\n Given an input tensor X of rank n, strides of size k, and pads of size 2*k,\n the operation proceeds in two steps:\n\n 1. Upsampling: For each of the innermost k dimensions, insert zeros between\n elements according to the stride values. The upsampled size for dimension i is:\n upsampled_size[i] = (input_size[i] - 1) * strides[i] + 1\n\n 2. Padding: Apply constant padding (value=0) to the upsampled result.\n The first k elements of pads specify the beginning padding, and the last k\n elements specify the ending padding for each of the innermost k dimensions.\n\n Example for 2D case with X=(N,C,H,W) and strides=(sH,sW):\n H_up = (H - 1) * sH + 1\n W_up = (W - 1) * sW + 1\n x_up[:, :, ::sH, ::sW] = x (with zeros elsewhere)\n output = pad(x_up, pads)\n Optional attributes:\n - strides: If not specified, defaults to all 1s (no upsampling).\n - pads: If not specified, defaults to all 0s (no padding).\n\n Constraints:\n - k <= n (number of stride dimensions must not exceed input rank)\n - pads must have size 2*k\n - All stride values must be positive\n\n This operation is not part of the standard and was added to assist onnx-mlir.", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>]>" } ], "attributes": [ { "name": "strides", "type": "OptionalAttr>" }, { "name": "pads", "type": "OptionalAttr>" } ] }, { "name": "onnx.UpsampleV7", "summary": "ONNX Upsample operation", "description": "Upsample the input tensor.\n Each dimension value of the output tensor is:\n output_dimension = floor(input_dimension * scale).", "operands": [ { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedStrAttr" }, { "name": "scales", "type": "TypedArrayAttrBase" } ] }, { "name": "onnx.Where", "summary": "ONNX Where operation", "description": "Return elements, either from X or Y, depending on condition.\n Where behaves like\n [numpy.where](https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html)\n with three parameters.\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "condition", "type": "TensorOf<[I1]>" }, { "name": "X", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" }, { "name": "Y", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ], "results": [ { "name": "output", "type": "AnyTypeOf<[TensorOf<[UI8]>, TensorOf<[UI16]>, TensorOf<[UI32]>, TensorOf<[UI64]>, TensorOf<[I8]>, TensorOf<[I16]>, TensorOf<[I32]>, TensorOf<[I64]>, TensorOf<[BF16]>, TensorOf<[F16]>, TensorOf<[F32]>, TensorOf<[F64]>, TensorOf<[StringType]>, TensorOf<[I1]>, TensorOf<[Complex]>, TensorOf<[Complex]>]>" } ] }, { "name": "onnx.Xor", "summary": "ONNX Xor operation", "description": "Returns the tensor resulted from performing the `xor` logical operation\n elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).\n \n This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).", "operands": [ { "name": "A", "type": "TensorOf<[I1]>" }, { "name": "B", "type": "TensorOf<[I1]>" } ], "results": [ { "name": "C", "type": "TensorOf<[I1]>" } ] }, { "name": "onnx.Yield", "summary": "ONNX yield operation", "description": "The `onnx.Yield` operation represents a yield operation within an ONNX subgraph.\n The operation takes variable number of operands and produces no results.\n\n This operation is not part of the standard and was added to assist onnx-mlir.\n It terminates a ONNXLoop/Scan/IfOp region.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "onnx.ZipMap", "summary": "ONNX ZipMap operation", "description": "Creates a map from the input and the attributes.
\n The values are provided by the input tensor, while the keys are specified by the attributes.\n Must provide keys in either classlabels_strings or classlabels_int64s (but not both).
\n The columns of the tensor correspond one-by-one to the keys specified by the attributes. There must be as many columns as keys.
", "operands": [ { "name": "X", "type": "TensorOf<[F32]>" } ], "results": [ { "name": "Z", "type": "AnyTypeOf<[SeqOf<[TupleOf<[StringType, F32]>]>, SeqOf<[TupleOf<[I64, F32]>]>]>" } ], "attributes": [ { "name": "classlabels_int64s", "type": "OptionalAttr>" }, { "name": "classlabels_strings", "type": "OptionalAttr>" } ] }, { "name": "pcf.alloc", "summary": "Shaped ref allocation operation", "description": "Allocates a `pcf.sref` with the given element type and shape. Dynamic\n dimensions in the result type must have corresponding dynamic size\n operands. The allocation scope is determined by the scope attribute of\n the result type.\n\n Example:\n ```mlir\n %sref = pcf.alloc() : !pcf.sref<4x8xf32, #foo.scope>\n %sref_dyn = pcf.alloc(%d0, %d1) : !pcf.sref\n ```", "operands": [ { "name": "dynamicSizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "PCF_AnyShapedRef" } ], "assemblyFormat": "`(`$dynamicSizes`)` attr-dict `:` type($result)" }, { "name": "pcf.br.cond_return", "summary": "Branch operation with conditional return", "description": "The `pcf.br.cond_return` operation represents a conditional branch operation\n to a given block, or return from the parent.\n\n Example:\n\n ```mlir\n pcf. #foo.scope {\n ^bb0(%0: !foo.type)\n %1 = ... %0 : !foo.type\n pcf.br.cond_return %cond ^bb0(%0: !foo.type)\n }\n ```", "operands": [ { "name": "condition", "type": "I1" }, { "name": "dest_operands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$condition $dest (`(` $dest_operands^ `:` type($dest_operands) `)`)? attr-dict" }, { "name": "pcf.generic", "summary": "Execute a set of workers in parallel on a region.", "description": "Executes a region across a set of workers at a specified scope. When\n control flow reaches this op, `nproc` workers of the specified scope are\n spawned and begin executing the region. The scope is given by an attribute\n implementing the `ScopeAttrInterface` interface and is responsible for the semantics\n of all pcf primitives at the same scope. Further details about scopes are\n included in the docs for the interface.\n\n The optional `initialize` region is executed once when control flow first\n reaches the op. Values yielded from the initializer become block arguments\n available to the execute region. This is useful for setting up per-op\n state that persists across all worker invocations.\n\n Results are produced by snapshotting the value of each result's tied sref\n once all workers have returned. Results can either be:\n 1. Tied to initial values (tensor or memref) - the init value provides the\n initial contents and the result captures the final state.\n 2. Allocated by the op itself - dynamic sizes must be provided for\n untied results with dynamic dimensions.\n\n Basic example with tied results:\n ```mlir\n %0 = ... : tensor<4x8xf32>\n %1 = pcf.generic scope(#foo.scope)\n execute(%ref = %0)[%id: index, %num_workers: index]\n : (!pcf.sref<4x8xf32, #foo.scope>) -> (tensor<4x8xf32>) {\n // Each worker can read/write %ref.\n pcf.return\n }\n ```\n\n Example with initializer:\n ```mlir\n %result = pcf.generic scope(#foo.scope)\n initialize {\n %scratch = pcf.alloc() : !pcf.sref<16xf32, #foo.scope>\n pcf.yield %scratch : !pcf.sref<16xf32, #foo.scope>\n } -> (%scratch_arg: !pcf.sref<16xf32, #foo.scope>)\n execute(%ref = %init)[%id: index, %num_workers: index]\n : (!pcf.sref<4x8xf32, #foo.scope>) -> (tensor<4x8xf32>) {\n // %scratch_arg is available here, initialized once.\n pcf.return\n }\n ```\n\n Example with untied (allocated) results:\n ```mlir\n %d0, %d1 = ... : index\n %result = pcf.generic scope(#foo.scope)\n execute[%id: index, %num_workers: index]\n : () -> (tensor{%d0, %d1}) {\n // Result sref is allocated by the op, not tied to any init.\n pcf.return\n }\n ```", "operands": [ { "name": "inits", "type": "Variadic" }, { "name": "dynamic_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "scope", "type": "PCF_ScopeAttrInterface" }, { "name": "is_tied", "type": "ArrayProp" }, { "name": "sync_on_return", "type": "DefaultValuedProp" }, { "name": "num_index_args", "type": "IntProp" }, { "name": "num_leading_args", "type": "IntProp" } ], "regions": [ { "name": "initializer", "type": "MaxSizedRegion<1>" }, { "name": "region", "type": "MinSizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`sync` $sync_on_return^)?\n `scope` `(` $scope `)`\n (`initialize` $initializer^)?\n custom($inits,\n type($inits),\n $dynamic_sizes,\n type($results),\n $is_tied,\n $region,\n $num_leading_args,\n \"true\")\n custom(ref($region), ref($num_leading_args), $num_index_args)\n prop-dict attr-dict" }, { "name": "pcf.get_memref", "summary": "Extract a memref view from a slice of a `pcf.sref`.", "description": "The `pcf.get_memref` operation extracts a memref view from a slice of a\n sref, breaking the synchronization guarantees of the source.\n\n The returned memref must have a maximally dynamic layout (all strides and\n offset dynamic) and no memory space. Layout and memory space information\n is determined by the ConvertSRefToMemRef analysis pass.\n\n The operation supports the following arguments:\n * source: the sref from which to extract a view.\n * offsets: shaped-rank number of offsets into the `source` from which\n the slice begins.\n * sizes: shaped-rank number of sizes which specify the sizes of the result\n memref type.\n * strides: shaped-rank number of strides that specify subsampling in each\n dimension.", "operands": [ { "name": "source", "type": "PCF_AnyShapedRef" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `to` type($result)" }, { "name": "pcf.loop", "summary": "Execute a set of workers in parallel on a region.", "description": "Executes a region for each point in the iteration space defined by the\n `count` operands. Unlike `pcf.generic` which spawns workers equal to the\n native parallelism of the scope, `pcf.loop` explicitly specifies the\n iteration count and maps iterations to workers according to the scope's\n scheduling policy.\n\n When control flow reaches this op, the scope determines how to distribute\n the iterations across available workers. The scope is given by an attribute\n implementing the `ScopeAttrInterface` interface. Further details about scopes are\n included in the docs for the interface.\n\n The execute region receives one index block argument per count operand,\n representing the current iteration's coordinates in the iteration space.\n\n Results are produced by snapshotting the value of each result's tied sref\n once all iterations have completed. Results can either be:\n 1. Tied to initial values (tensor or memref) - the init value provides the\n initial contents and the result captures the final state.\n 2. Allocated by the op itself - dynamic sizes must be provided for\n untied results with dynamic dimensions.\n\n Basic example with 1D iteration:\n ```mlir\n %n = ... : index\n %0 = ... : tensor<4x8xf32>\n %1 = pcf.loop scope(#foo.scope) count(%n)\n execute(%ref = %0)[%id: index]\n : (!pcf.sref<4x8xf32, #foo.scope>) -> (tensor<4x8xf32>) {\n // %id ranges from 0 to %n-1.\n pcf.return\n }\n ```\n\n Example with multi-dimensional iteration:\n ```mlir\n %m, %n = ... : index\n %result = pcf.loop scope(#foo.scope) count(%m, %n)\n execute(%ref = %init)[%i: index, %j: index]\n : (!pcf.sref) -> (tensor) {\n // %i ranges from 0 to %m-1, %j ranges from 0 to %n-1.\n pcf.return\n }\n ```", "operands": [ { "name": "count", "type": "Variadic" }, { "name": "inits", "type": "Variadic" }, { "name": "dynamic_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "scope", "type": "PCF_ScopeAttrInterface" }, { "name": "is_tied", "type": "ArrayProp" }, { "name": "sync_on_return", "type": "DefaultValuedProp" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`sync` $sync_on_return^)?\n `scope` `(` $scope `)`\n `count` `(` $count `)`\n custom($inits,\n type($inits),\n $dynamic_sizes,\n type($results),\n $is_tied,\n $region)\n prop-dict attr-dict" }, { "name": "pcf.read_slice", "summary": "Read a tensor or vector from a `pcf.sref` based on the provided slice\n parameters.", "description": "Read a slice from a `pcf.sref`. If this is reading a vector, the sizes\n may be smaller than the return vector type. In this case out of bounds\n elements have undefined value.\n\n The `pcf.read_slice` operation supports the following arguments:\n * source: the shaped value that is written.\n * dest: the sref into which the source is written.\n * offsets: shaped-rank number of offsets into the `dest` into which\n the slice is inserted.\n * sizes: shaped-rank number of sizes which specify the sizes of the source\n tensor type.\n * strides: shaped-rank number of strides that specify subsampling in each\n dimension.", "operands": [ { "name": "source", "type": "PCF_AnyShapedRef" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyRankedTensor, AnyVectorOfAnyRank]>" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `to` type($result)" }, { "name": "pcf.return", "summary": "Returns from a thread.", "description": "Returns control flow to the parent without fencing memory. If the parent\n carries an implicit fence one may still occur after the parent has finished.", "assemblyFormat": "attr-dict" }, { "name": "pcf.write_slice", "summary": "Submit a write of a tensor, vector, or memref to a slice of a `pcf.sref`.", "description": "The `pcf.write_slice` operation supports the following arguments:\n\n * source: the shaped value that is written.\n * dest: the sref into which the source is written.\n * offsets: shaped-rank number of offsets into the `dest` into which\n the slice is inserted.\n * sizes: shaped-rank number of sizes which specify the sizes of the source\n tensor type.\n * strides: shaped-rank number of strides that specify subsampling in each\n dimension.", "operands": [ { "name": "source", "type": "AnyRankedTensorVectorOrMemRef" }, { "name": "dest", "type": "PCF_AnyShapedRef" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `into` $dest ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `into` type($dest)" }, { "name": "pcf.yield", "summary": "Yields results from a region.", "description": "The values returned are copied by-value.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict\n $operands `:` type($operands)" }, { "name": "pdl_interp.apply_constraint", "summary": "Apply a constraint to a set of positional values", "description": "`pdl_interp.apply_constraint` operations apply a generic constraint, that\n has been registered with the interpreter, with a given set of positional\n values.\n The constraint function may return any number of results.\n On success, this operation branches to the true destination,\n otherwise the false destination is taken. This behavior can be reversed\n by setting the attribute `isNegated` to true.\n\n Example:\n\n ```mlir\n // Apply `myConstraint` to the entities defined by `input`, `attr`, and\n // `op`.\n pdl_interp.apply_constraint \"myConstraint\"(%input, %attr, %op : !pdl.value, !pdl.attribute, !pdl.operation) -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "isNegated", "type": "DefaultValuedAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "$name `(` $args `:` type($args) `)` (`:` type($results)^)? attr-dict \n `->` successors" }, { "name": "pdl_interp.apply_rewrite", "summary": "Invoke and apply an externally registered rewrite method", "description": "`pdl_interp.apply_rewrite` operations invoke an external rewriter that has\n been registered with the interpreter to perform the rewrite after a\n successful match. The rewrite is passed a set of positional arguments. The\n rewrite function may return any number of results.\n\n Example:\n\n ```mlir\n // Rewriter operating solely on the root operation.\n pdl_interp.apply_rewrite \"rewriter\"(%root : !pdl.operation)\n\n // Rewriter operating solely on the root operation and return an attribute.\n %attr = pdl_interp.apply_rewrite \"rewriter\"(%root : !pdl.operation) : !pdl.attribute\n\n // Rewriter operating on the root operation along with additional arguments\n // from the matcher.\n pdl_interp.apply_rewrite \"rewriter\"(%root : !pdl.operation, %value : !pdl.value)\n ```", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name (`(` $args^ `:` type($args) `)`)? (`:` type($results)^)? attr-dict" }, { "name": "pdl_interp.are_equal", "summary": "Check if two positional values or ranges are equivalent", "description": "`pdl_interp.are_equal` operations compare two positional values for\n equality. On success, this operation branches to the true destination,\n otherwise the false destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.are_equal %result1, %result2 : !pdl.value -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "lhs", "type": "PDL_AnyType" }, { "name": "rhs", "type": "PDL_AnyType" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "operands `:` type($lhs) attr-dict `->` successors" }, { "name": "pdl_interp.branch", "summary": "General branch operation", "description": "`pdl_interp.branch` operations expose general branch functionality to the\n interpreter, and are generally used to branch from one pattern match\n sequence to another.\n\n Example:\n\n ```mlir\n pdl_interp.branch ^dest\n ```", "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest attr-dict" }, { "name": "pdl_interp.check_attribute", "summary": "Check the value of an `Attribute`", "description": "`pdl_interp.check_attribute` operations compare the value of a given\n attribute with a constant value. On success, this operation branches to the\n true destination, otherwise the false destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.check_attribute %attr is 10 -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "attribute", "type": "PDL_Attribute" } ], "attributes": [ { "name": "constantValue", "type": "AnyAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "$attribute `is` $constantValue attr-dict `->` successors" }, { "name": "pdl_interp.check_operand_count", "summary": "Check the number of operands of an `Operation`", "description": "`pdl_interp.check_operand_count` operations compare the number of operands\n of a given operation value with a constant. The comparison is either exact\n or at_least, with the latter used to compare against a minimum number of\n expected operands. On success, this operation branches to the true\n destination, otherwise the false destination is taken.\n\n Example:\n\n ```mlir\n // Check for exact equality.\n pdl_interp.check_operand_count of %op is 2 -> ^matchDest, ^failureDest\n\n // Check for at least N operands.\n pdl_interp.check_operand_count of %op is at_least 2 -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "count", "type": "ConfinedAttr" }, { "name": "compareAtLeast", "type": "UnitAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "`of` $inputOp `is` (`at_least` $compareAtLeast^)? $count attr-dict\n `->` successors" }, { "name": "pdl_interp.check_operation_name", "summary": "Check the OperationName of an `Operation`", "description": "`pdl_interp.check_operation_name` operations compare the name of a given\n operation with a known name. On success, this operation branches to the true\n destination, otherwise the false destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.check_operation_name of %op is \"foo.op\" -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "`of` $inputOp `is` $name attr-dict `->` successors" }, { "name": "pdl_interp.check_result_count", "summary": "Check the number of results of an `Operation`", "description": "`pdl_interp.check_result_count` operations compare the number of results\n of a given operation value with a constant. The comparison is either exact\n or at_least, with the latter used to compare against a minimum number of\n expected results. On success, this operation branches to the true\n destination, otherwise the false destination is taken.\n\n Example:\n\n ```mlir\n // Check for exact equality.\n pdl_interp.check_result_count of %op is 2 -> ^matchDest, ^failureDest\n\n // Check for at least N results.\n pdl_interp.check_result_count of %op is at_least 2 -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "count", "type": "ConfinedAttr" }, { "name": "compareAtLeast", "type": "UnitAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "`of` $inputOp `is` (`at_least` $compareAtLeast^)? $count attr-dict\n `->` successors" }, { "name": "pdl_interp.check_type", "summary": "Compare a type to a known value", "description": "`pdl_interp.check_type` operations compare a type with a statically known\n type. On success, this operation branches to the true destination, otherwise\n the false destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.check_type %type is i32 -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "value", "type": "PDL_Type" } ], "attributes": [ { "name": "type", "type": "TypeAttr" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "$value `is` $type attr-dict `->` successors" }, { "name": "pdl_interp.check_types", "summary": "Compare a range of types to a range of known values", "description": "`pdl_interp.check_types` operations compare a range of types with a\n statically known range of types. On success, this operation branches\n to the true destination, otherwise the false destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.check_types %type are [i32, i64] -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "value", "type": "PDL_RangeOf" } ], "attributes": [ { "name": "types", "type": "TypedArrayAttrBase" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "$value `are` $types attr-dict `->` successors" }, { "name": "pdl_interp.continue", "summary": "Breaks the current iteration", "description": "`pdl_interp.continue` operation breaks the current iteration within the\n `pdl_interp.foreach` region and continues with the next iteration from\n the beginning of the region.\n\n Example:\n\n ```mlir\n pdl_interp.continue\n ```", "assemblyFormat": "attr-dict" }, { "name": "pdl_interp.create_attribute", "summary": "Create an interpreter handle to a constant `Attribute`", "description": "`pdl_interp.create_attribute` operations generate a handle within the\n interpreter for a specific constant attribute value.\n\n Example:\n\n ```mlir\n %attr = pdl_interp.create_attribute 10 : i64\n ```", "results": [ { "name": "attribute", "type": "PDL_Attribute" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "$value attr-dict-with-keyword" }, { "name": "pdl_interp.create_operation", "summary": "Create an instance of a specific `Operation`", "description": "`pdl_interp.create_operation` operations create an `Operation` instance with\n the specified attributes, operands, and result types. See `pdl.operation`\n for a more detailed description on the general interpretation of the arguments\n to this operation.\n\n Example:\n\n ```mlir\n // Create an instance of a `foo.op` operation.\n %op = pdl_interp.create_operation \"foo.op\"(%arg0 : !pdl.value) {\"attrA\" = %attr0} -> (%type : !pdl.type)\n\n // Create an instance of a `foo.op` operation that has inferred result types\n // (using the InferTypeOpInterface).\n %op = pdl_interp.create_operation \"foo.op\"(%arg0 : !pdl.value) {\"attrA\" = %attr0} -> \n ```", "operands": [ { "name": "inputOperands", "type": "Variadic>" }, { "name": "inputAttributes", "type": "Variadic" }, { "name": "inputResultTypes", "type": "Variadic>" } ], "results": [ { "name": "resultOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "inputAttributeNames", "type": "TypedArrayAttrBase" }, { "name": "inferredResultTypes", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$name (`(` $inputOperands^ `:` type($inputOperands) `)`)? ``\n custom($inputAttributes, $inputAttributeNames)\n custom($inputResultTypes, type($inputResultTypes),\n $inferredResultTypes)\n attr-dict" }, { "name": "pdl_interp.create_range", "summary": "Construct a range of PDL entities", "description": "`pdl_interp.create_range` operations construct a range from a given set of PDL\n entities, which all share the same underlying element type. For example, a\n `!pdl.range` may be constructed from a list of `!pdl.value`\n or `!pdl.range` entities.\n\n Example:\n\n ```mlir\n // Construct a range of values.\n %valueRange = pdl_interp.create_range %inputValue, %inputRange : !pdl.value, !pdl.range\n\n // Construct a range of types.\n %typeRange = pdl_interp.create_range %inputType, %inputRange : !pdl.type, !pdl.range\n\n // Construct an empty range of types.\n %valueRange = pdl_interp.create_range : !pdl.range\n ```", "operands": [ { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "PDL_RangeOf>" } ], "assemblyFormat": "($arguments^ `:` type($arguments))?\n custom(ref(type($arguments)), type($result))\n attr-dict" }, { "name": "pdl_interp.create_type", "summary": "Create an interpreter handle to a constant `Type`", "description": "`pdl_interp.create_type` operations generate a handle within the interpreter\n for a specific constant type value.\n\n Example:\n\n ```mlir\n pdl_interp.create_type i64\n ```", "results": [ { "name": "result", "type": "PDL_Type" } ], "attributes": [ { "name": "value", "type": "TypeAttr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "pdl_interp.create_types", "summary": "Create an interpreter handle to a range of constant `Type`s", "description": "`pdl_interp.create_types` operations generate a handle within the\n interpreter for a specific range of constant type values.\n\n Example:\n\n ```mlir\n pdl_interp.create_types [i64, i64]\n ```", "results": [ { "name": "result", "type": "PDL_RangeOf" } ], "attributes": [ { "name": "value", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$value attr-dict" }, { "name": "pdl_interp.erase", "summary": "Mark an operation as `erased`", "description": "`pdl.erase` operations are used to specify that an operation should be\n marked as erased. The semantics of this operation correspond with the\n `eraseOp` method on a `PatternRewriter`.\n\n Example:\n\n ```mlir\n pdl_interp.erase %root\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "assemblyFormat": "$inputOp attr-dict" }, { "name": "pdl_interp.extract", "summary": "Extract the item at the specified index in a range", "description": "`pdl_interp.extract` operations are used to extract an item from a range\n at the specified index. If the index is out of range, returns null.\n\n Example:\n\n ```mlir\n // Extract the value at index 1 from a range of values.\n %ops = pdl_interp.extract 1 of %values : !pdl.value\n ```", "operands": [ { "name": "range", "type": "PDL_RangeOf" } ], "results": [ { "name": "result", "type": "PDL_AnyType" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr" } ], "traits": [ { "type": "TypesMatchWith<'result', 'range', 'pdl::RangeType::get($_self)'>" } ], "assemblyFormat": "$index `of` $range `:` type($result) attr-dict" }, { "name": "pdl_interp.finalize", "summary": "Finalize a pattern match or rewrite sequence", "description": "`pdl_interp.finalize` is used to denote the termination of a match or\n rewrite sequence.\n\n Example:\n\n ```mlir\n pdl_interp.finalize\n ```", "assemblyFormat": "attr-dict" }, { "name": "pdl_interp.foreach", "summary": "Iterates over a range of values or ranges", "description": "`pdl_interp.foreach` iteratively selects an element from a range of values\n and executes the region until pdl.continue is reached.\n\n In the bytecode interpreter, this operation is implemented by looping over\n the values and, for each selection, running the bytecode until we reach\n pdl.continue. This may result in multiple matches being reported. Note\n that the input range is mutated (popped from).\n\n Example:\n\n ```mlir\n pdl_interp.foreach %op : !pdl.operation in %ops {\n pdl_interp.continue\n } -> ^next\n ```", "operands": [ { "name": "values", "type": "PDL_RangeOf" } ], "successors": [ { "name": "successor", "type": "AnySuccessor" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "pdl_interp.func", "summary": "PDL Interpreter Function Operation", "description": "`pdl_interp.func` operations act as interpreter functions. These are\n callable SSA-region operations that contain other interpreter operations.\n Interpreter functions are used for both the matching and the rewriting\n portion of the interpreter.\n\n Example:\n\n ```mlir\n pdl_interp.func @rewriter(%root: !pdl.operation) {\n %op = pdl_interp.create_operation \"foo.new_operation\"\n pdl_interp.erase %root\n pdl_interp.finalize\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "MinSizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "pdl_interp.get_attribute", "summary": "Get a specified attribute value from an `Operation`", "description": "`pdl_interp.get_attribute` operations try to get a specific attribute from\n an operation. If the operation does not have that attribute, a null value is\n returned.\n\n Example:\n\n ```mlir\n %attr = pdl_interp.get_attribute \"attr\" of %op\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "results": [ { "name": "attribute", "type": "PDL_Attribute" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name `of` $inputOp attr-dict" }, { "name": "pdl_interp.get_attribute_type", "summary": "Get the result type of a specified `Attribute`", "description": "`pdl_interp.get_attribute_type` operations get the resulting type of a\n specific attribute.\n\n Example:\n\n ```mlir\n %type = pdl_interp.get_attribute_type of %attr\n ```", "operands": [ { "name": "value", "type": "PDL_Attribute" } ], "results": [ { "name": "result", "type": "PDL_Type" } ], "assemblyFormat": "`of` $value attr-dict" }, { "name": "pdl_interp.get_defining_op", "summary": "Get the defining operation of a `Value`", "description": "`pdl_interp.get_defining_op` operations try to get the defining operation\n of a specific value or range of values. In the case of range, the defining\n op of the first value is returned. If the value is not an operation result\n or range of operand results, null is returned.\n\n Example:\n\n ```mlir\n %op = pdl_interp.get_defining_op of %value : !pdl.value\n ```", "operands": [ { "name": "value", "type": "PDL_InstOrRangeOf" } ], "results": [ { "name": "inputOp", "type": "PDL_Operation" } ], "assemblyFormat": "`of` $value `:` type($value) attr-dict" }, { "name": "pdl_interp.get_operand", "summary": "Get a specified operand from an `Operation`", "description": "`pdl_interp.get_operand` operations try to get a specific operand from an\n operation If the operation does not have an operand for the given index, a\n null value is returned.\n\n Example:\n\n ```mlir\n %operand = pdl_interp.get_operand 1 of %op\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "results": [ { "name": "value", "type": "PDL_Value" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr" } ], "assemblyFormat": "$index `of` $inputOp attr-dict" }, { "name": "pdl_interp.get_operands", "summary": "Get a specified operand group from an `Operation`", "description": "`pdl_interp.get_operands` operations try to get a specific operand\n group from an operation. If the expected result is a single Value, null is\n returned if the operand group is not of size 1. If a range is expected,\n null is returned if the operand group is invalid. If no index is provided,\n the returned operand group corresponds to all operands of the operation.\n\n Example:\n\n ```mlir\n // Get the first group of operands from an operation, and expect a single\n // element.\n %operand = pdl_interp.get_operands 0 of %op : !pdl.value\n\n // Get the first group of operands from an operation.\n %operands = pdl_interp.get_operands 0 of %op : !pdl.range\n\n // Get all of the operands from an operation.\n %operands = pdl_interp.get_operands of %op : !pdl.range\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "results": [ { "name": "value", "type": "PDL_InstOrRangeOf" } ], "attributes": [ { "name": "index", "type": "OptionalAttr>" } ], "assemblyFormat": "($index^)? `of` $inputOp `:` type($value) attr-dict" }, { "name": "pdl_interp.get_result", "summary": "Get a specified result from an `Operation`", "description": "`pdl_interp.get_result` operations try to get a specific result from an\n operation. If the operation does not have a result for the given index, a\n null value is returned.\n\n Example:\n\n ```mlir\n %result = pdl_interp.get_result 1 of %op\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "results": [ { "name": "value", "type": "PDL_Value" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr" } ], "assemblyFormat": "$index `of` $inputOp attr-dict" }, { "name": "pdl_interp.get_results", "summary": "Get a specified result group from an `Operation`", "description": "`pdl_interp.get_results` operations try to get a specific result group\n from an operation. If the expected result is a single Value, null is\n returned if the result group is not of size 1. If a range is expected,\n null is returned if the result group is invalid. If no index is provided,\n the returned operand group corresponds to all results of the operation.\n\n Example:\n\n ```mlir\n // Get the first group of results from an operation, and expect a single\n // element.\n %result = pdl_interp.get_results 0 of %op : !pdl.value\n\n // Get the first group of results from an operation.\n %results = pdl_interp.get_results 0 of %op : !pdl.range\n\n // Get all of the results from an operation.\n %results = pdl_interp.get_results of %op : !pdl.range\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "results": [ { "name": "value", "type": "PDL_InstOrRangeOf" } ], "attributes": [ { "name": "index", "type": "OptionalAttr>" } ], "assemblyFormat": "($index^)? `of` $inputOp `:` type($value) attr-dict" }, { "name": "pdl_interp.get_users", "summary": "Get the users of a `Value`", "description": "`pdl_interp.get_users` extracts the users that accept this value. In the\n case of a range, the union of users of the all the values are returned,\n similarly to ResultRange::getUsers.\n\n Example:\n\n ```mlir\n // Get all the users of a single value.\n %ops = pdl_interp.get_users of %value : !pdl.value\n\n // Get all the users of the first value in a range.\n %ops = pdl_interp.get_users of %values : !pdl.range\n ```", "operands": [ { "name": "value", "type": "PDL_InstOrRangeOf" } ], "results": [ { "name": "operations", "type": "PDL_RangeOf" } ], "assemblyFormat": "`of` $value `:` type($value) attr-dict" }, { "name": "pdl_interp.get_value_type", "summary": "Get the result type of a specified `Value`", "description": "`pdl_interp.get_value_type` operations get the resulting type of a specific\n value or range thereof.\n\n Example:\n\n ```mlir\n // Get the type of a single value.\n %type = pdl_interp.get_value_type of %value : !pdl.type\n\n // Get the types of a value range.\n %type = pdl_interp.get_value_type of %values : !pdl.range\n ```", "operands": [ { "name": "value", "type": "PDL_InstOrRangeOf" } ], "results": [ { "name": "result", "type": "PDL_InstOrRangeOf" } ], "traits": [ { "type": "TypesMatchWith<'result', 'value', 'getGetValueTypeOpValueType($_self)'>" } ], "assemblyFormat": "`of` $value `:` type($result) attr-dict" }, { "name": "pdl_interp.is_not_null", "summary": "Check if a positional value is non-null", "description": "`pdl_interp.is_not_null` operations check that a positional value or range\n exists. For ranges, this does not mean that the range was simply empty. On\n success, this operation branches to the true destination. Otherwise, the\n false destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.is_not_null %value : !pdl.value -> ^matchDest, ^failureDest\n ```", "operands": [ { "name": "value", "type": "PDL_AnyType" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "assemblyFormat": "$value `:` type($value) attr-dict `->` successors" }, { "name": "pdl_interp.record_match", "summary": "Record the metadata for a successful pattern match", "description": "`pdl_interp.record_match` operations record a successful pattern match with\n the interpreter and branch to the next part of the matcher. The metadata\n recorded by these operations correspond to a specific `pdl.pattern`, as well\n as what values were used during that match that should be propagated to the\n rewriter.\n\n Example:\n\n ```mlir\n pdl_interp.record_match @rewriters::myRewriter(%root : !pdl.operation) : benefit(1), loc([%root, %op1]), root(\"foo.op\") -> ^nextDest\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "matchedOps", "type": "Variadic" } ], "attributes": [ { "name": "rewriter", "type": "SymbolRefAttr" }, { "name": "rootKind", "type": "OptionalAttr" }, { "name": "generatedOps", "type": "OptionalAttr>" }, { "name": "benefit", "type": "ConfinedAttr" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$rewriter (`(` $inputs^ `:` type($inputs) `)`)? `:`\n `benefit` `(` $benefit `)` `,`\n (`generatedOps` `(` $generatedOps^ `)` `,`)?\n `loc` `(` `[` $matchedOps `]` `)`\n (`,` `root` `(` $rootKind^ `)`)? attr-dict `->` $dest" }, { "name": "pdl_interp.replace", "summary": "Mark an operation as `replace`d", "description": "`pdl_interp.replaced` operations are used to specify that an operation\n should be marked as replaced. The semantics of this operation correspond\n with the `replaceOp` method on a `PatternRewriter`. The set of replacement\n values must match the number of results specified by the operation.\n\n Example:\n\n ```mlir\n // Replace root node with 2 values:\n pdl_interp.replace %root with (%val0, %val1 : !pdl.type, !pdl.type)\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" }, { "name": "replValues", "type": "Variadic>" } ], "assemblyFormat": "$inputOp `with` ` ` `(` ($replValues^ `:` type($replValues))? `)`\n attr-dict" }, { "name": "pdl_interp.switch_attribute", "summary": "Switch on the value of an `Attribute`", "description": "`pdl_interp.switch_attribute` operations compare the value of a given\n attribute with a set of constant attributes. If the value matches one of the\n provided case values the destination for that case value is taken, otherwise\n the default destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.switch_attribute %attr to [10, true](^10Dest, ^trueDest) -> ^defaultDest\n ```", "operands": [ { "name": "attribute", "type": "PDL_Attribute" } ], "attributes": [ { "name": "caseValues", "type": "ArrayAttr" } ], "successors": [ { "name": "defaultDest", "type": "AnySuccessor" }, { "name": "cases", "type": "VariadicSuccessor" } ], "assemblyFormat": "$attribute `to` $caseValues `(` $cases `)` attr-dict `->` $defaultDest" }, { "name": "pdl_interp.switch_operand_count", "summary": "Switch on the operand count of an `Operation`", "description": "`pdl_interp.switch_operand_count` operations compare the operand count of a\n given operation with a set of potential counts. If the value matches one of\n the provided case values the destination for that case value is taken,\n otherwise the default destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.switch_operand_count of %op to [10, 2] -> ^10Dest, ^2Dest, ^defaultDest\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "caseValues", "type": "I32ElementsAttr" } ], "successors": [ { "name": "defaultDest", "type": "AnySuccessor" }, { "name": "cases", "type": "VariadicSuccessor" } ], "assemblyFormat": "`of` $inputOp `to` $caseValues `(` $cases `)` attr-dict `->` $defaultDest" }, { "name": "pdl_interp.switch_operation_name", "summary": "Switch on the OperationName of an `Operation`", "description": "`pdl_interp.switch_operation_name` operations compare the name of a given\n operation with a set of known names. If the value matches one of the\n provided case values the destination for that case value is taken, otherwise\n the default destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.switch_operation_name of %op to [\"foo.op\", \"bar.op\"](^fooDest, ^barDest) -> ^defaultDest\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "caseValues", "type": "TypedArrayAttrBase" } ], "successors": [ { "name": "defaultDest", "type": "AnySuccessor" }, { "name": "cases", "type": "VariadicSuccessor" } ], "assemblyFormat": "`of` $inputOp `to` $caseValues `(` $cases `)` attr-dict `->` $defaultDest" }, { "name": "pdl_interp.switch_result_count", "summary": "Switch on the result count of an `Operation`", "description": "`pdl_interp.switch_result_count` operations compare the result count of a\n given operation with a set of potential counts. If the value matches one of\n the provided case values the destination for that case value is taken,\n otherwise the default destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.switch_result_count of %op to [0, 2](^0Dest, ^2Dest) -> ^defaultDest\n ```", "operands": [ { "name": "inputOp", "type": "PDL_Operation" } ], "attributes": [ { "name": "caseValues", "type": "I32ElementsAttr" } ], "successors": [ { "name": "defaultDest", "type": "AnySuccessor" }, { "name": "cases", "type": "VariadicSuccessor" } ], "assemblyFormat": "`of` $inputOp `to` $caseValues `(` $cases `)` attr-dict `->` $defaultDest" }, { "name": "pdl_interp.switch_type", "summary": "Switch on a `Type` value", "description": "`pdl_interp.switch_type` operations compare a type with a set of statically\n known types. If the value matches one of the provided case values the\n destination for that case value is taken, otherwise the default destination\n is taken.\n\n Example:\n\n ```mlir\n pdl_interp.switch_type %type to [i32, i64] -> ^i32Dest, ^i64Dest, ^defaultDest\n ```", "operands": [ { "name": "value", "type": "PDL_Type" } ], "attributes": [ { "name": "caseValues", "type": "TypedArrayAttrBase" } ], "successors": [ { "name": "defaultDest", "type": "AnySuccessor" }, { "name": "cases", "type": "VariadicSuccessor" } ], "assemblyFormat": "$value `to` $caseValues `(` $cases `)` attr-dict `->` $defaultDest" }, { "name": "pdl_interp.switch_types", "summary": "Switch on a range of `Type` values", "description": "`pdl_interp.switch_types` operations compare a range of types with a set of\n statically known ranges. If the value matches one of the provided case\n values the destination for that case value is taken, otherwise the default\n destination is taken.\n\n Example:\n\n ```mlir\n pdl_interp.switch_types %type is [[i32], [i64, i64]] -> ^i32Dest, ^i64Dest, ^defaultDest\n ```", "operands": [ { "name": "value", "type": "PDL_RangeOf" } ], "attributes": [ { "name": "caseValues", "type": "TypedArrayAttrBase, type-array array attribute>" } ], "successors": [ { "name": "defaultDest", "type": "AnySuccessor" }, { "name": "cases", "type": "VariadicSuccessor" } ], "assemblyFormat": "$value `to` $caseValues `(` $cases `)` attr-dict `->` $defaultDest" }, { "name": "pdl.apply_native_constraint", "summary": "Apply a native constraint to a set of provided entities", "description": "`pdl.apply_native_constraint` operations apply a native C++ constraint, that\n has been registered externally with the consumer of PDL, to a given set of\n entities and optionally return a number of values.\n\n Example:\n\n ```mlir\n // Apply `myConstraint` to the entities defined by `input`, `attr`, and `op`.\n pdl.apply_native_constraint \"myConstraint\"(%input, %attr, %op : !pdl.value, !pdl.attribute, !pdl.operation)\n // Apply constraint `with_result` to `root`. This constraint returns an attribute.\n %attr = pdl.apply_native_constraint \"with_result\"(%root : !pdl.operation) : !pdl.attribute\n ```", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "isNegated", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$name `(` $args `:` type($args) `)` (`:` type($results)^ )? attr-dict" }, { "name": "pdl.apply_native_rewrite", "summary": "Apply a native rewrite method inside of pdl.rewrite region", "description": "`pdl.apply_native_rewrite` operations apply a native C++ function, that has\n been registered externally with the consumer of PDL, to perform a rewrite\n and optionally return a number of values. The native function may accept any\n number of arguments. This operation is used within a pdl.rewrite region to enable\n the interleaving of native rewrite methods with other pdl constructs.\n\n Example:\n\n ```mlir\n // Apply a native rewrite method that returns an attribute.\n %ret = pdl.apply_native_rewrite \"myNativeFunc\"(%arg0, %attr1) : !pdl.attribute\n ```\n\n ```c++\n // The native rewrite as defined in C++:\n static Attribute myNativeFunc(PatternRewriter &rewriter, Value arg0, Attribute arg1) {\n // Just return the second arg.\n return arg1;\n }\n\n void registerNativeRewrite(PDLPatternModule &pdlModule) {\n pdlModule.registerRewriteFunction(\"myNativeFunc\", myNativeFunc);\n }\n ```", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name (`(` $args^ `:` type($args) `)`)? (`:` type($results)^)? attr-dict" }, { "name": "pdl.attribute", "summary": "Define an input attribute in a pattern", "description": "`pdl.attribute` operations capture named attribute edges into an operation.\n Instances of this operation define, and partially constrain, attributes of a\n given operation. A `pdl.attribute` may partially constrain the input by\n specifying an expected attribute value type (via a `pdl.type` operation), or\n a constant value for the attribute (via `val`). Only one of these may be set\n for a given input, as the type of the constant value provides the type. When\n defined within a `pdl.rewrite` region, the constant value must be specified.\n\n Example:\n\n ```mlir\n // Define an attribute:\n %attr = pdl.attribute\n\n // Define an attribute with an expected type:\n %type = pdl.type : i32\n %attr = pdl.attribute : %type\n\n // Define an attribute with a constant value:\n %attr = pdl.attribute = \"hello\"\n ```", "operands": [ { "name": "valueType", "type": "Optional" } ], "results": [ { "name": "attr", "type": "PDL_Attribute" } ], "attributes": [ { "name": "value", "type": "OptionalAttr" } ], "assemblyFormat": "(`:` $valueType^)? (`=` $value^)? attr-dict-with-keyword" }, { "name": "pdl.erase", "summary": "Mark an input operation as `erased`", "description": "`pdl.erase` operations are used within `pdl.rewrite` regions to specify that\n an input operation should be marked as erased. The semantics of this\n operation correspond with the `eraseOp` method on a `PatternRewriter`.\n\n Example:\n\n ```mlir\n pdl.erase %root\n ```", "operands": [ { "name": "opValue", "type": "PDL_Operation" } ], "assemblyFormat": "$opValue attr-dict" }, { "name": "pdl.operand", "summary": "Define an external input operand in a pattern", "description": "`pdl.operand` operations capture external operand edges into an operation\n node that originate from operations or block arguments not otherwise\n specified within the pattern (i.e. via `pdl.result` or `pdl.results`). These\n operations define individual operands of a given operation. A `pdl.operand`\n may partially constrain an operand by specifying an expected value type\n (via a `pdl.type` operation).\n\n Example:\n\n ```mlir\n // Define an external operand:\n %operand = pdl.operand\n\n // Define an external operand with an expected type:\n %type = pdl.type : i32\n %operand = pdl.operand : %type\n ```", "operands": [ { "name": "valueType", "type": "Optional" } ], "results": [ { "name": "value", "type": "PDL_Value" } ], "assemblyFormat": "(`:` $valueType^)? attr-dict" }, { "name": "pdl.operands", "summary": "Define a range of input operands in a pattern", "description": "`pdl.operands` operations capture external operand range edges into an\n operation node that originate from operations or block arguments not\n otherwise specified within the pattern (i.e. via `pdl.result` or\n `pdl.results`). These operations define groups of input operands into a\n given operation. A `pdl.operands` may partially constrain a set of input\n operands by specifying expected value types (via `pdl.types` operations).\n\n Example:\n\n ```mlir\n // Define a range of input operands:\n %operands = pdl.operands\n\n // Define a range of input operands with expected types:\n %types = pdl.types : [i32, i64, i32]\n %typed_operands = pdl.operands : %types\n ```", "operands": [ { "name": "valueType", "type": "Optional>" } ], "results": [ { "name": "value", "type": "PDL_RangeOf" } ], "assemblyFormat": "(`:` $valueType^)? attr-dict" }, { "name": "pdl.operation", "summary": "Define an operation within a pattern", "description": "`pdl.operation` operations define operation nodes within a pattern. Within\n a match sequence, i.e. when directly nested within a `pdl.pattern`, these\n operations correspond to input operations, or those that already existing\n within the MLIR module. Inside of a `pdl.rewrite`, these operations\n correspond to operations that should be created as part of the replacement\n sequence.\n\n `pdl.operation`s are composed of a name, and a set of attribute, operand,\n and result type values, that map to what those that would be on a\n constructed instance of that operation. The results of a `pdl.operation` are\n a handle to the operation itself. Handles to the results of the operation\n can be extracted via `pdl.result`.\n\n Example:\n\n ```mlir\n // Define an instance of a `foo.op` operation.\n %op = pdl.operation \"foo.op\"(%arg0, %arg1 : !pdl.value, !pdl.value)\n {\"attrA\" = %attr0} -> (%type, %type : !pdl.type, !pdl.type)\n ```\n\n When used within a matching context, the name of the operation may be\n omitted.\n\n When used within a rewriting context, i.e. when defined within a\n `pdl.rewrite`, all of the result types must be \"inferable\". This means that\n the type must be attributable to either a constant type value or the result\n type of another entity, such as an attribute, the result of a\n `apply_native_rewrite`, or the result type of another operation. If the\n result type value does not meet any of these criteria, the operation must\n override the `InferTypeOpInterface` to ensure that the result types can be\n inferred.\n\n The operands of the operation are interpreted in the following ways:\n\n 1) A single !pdl.range:\n\n In this case, the single range is treated as all of the operands of the\n operation.\n\n ```mlir\n // Define an instance with single range of operands.\n %op = pdl.operation \"func.return\"(%allArgs : !pdl.range)\n ```\n\n 2) A variadic number of either !pdl.value or !pdl.range:\n\n In this case, the inputs are expected to correspond with the operand groups\n defined on the operation in ODS.\n\n ```tablgen\n // Given the following operation definition in ODS:\n def MyIndirectCallOp {\n let results = (outs FunctionType:$call, Variadic:$args);\n }\n ```\n\n ```mlir\n // We can match the operands as so:\n %op = pdl.operation \"my.indirect_call\"(%call, %args : !pdl.value, !pdl.range)\n ```\n\n The results of the operation are interpreted in the following ways:\n\n 1) A single !pdl.range:\n\n In this case, the single range is treated as all of the result types of the\n operation.\n\n ```mlir\n // Define an instance with single range of types.\n %allResultTypes = pdl.types\n %op = pdl.operation \"builtin.unrealized_conversion_cast\" -> (%allResultTypes : !pdl.types)\n ```\n\n 2) A variadic number of either !pdl.type or !pdl.range:\n\n In this case, the inputs are expected to correspond with the result groups\n defined on the operation in ODS.\n\n ```tablgen\n // Given the following operation definition in ODS:\n def MyOp {\n let results = (outs SomeType:$result, Variadic:$otherResults);\n }\n ```\n\n ```mlir\n // We can match the results as so:\n %result = pdl.type\n %otherResults = pdl.types\n %op = pdl.operation \"foo.op\" -> (%result, %otherResults : !pdl.type, !pdl.range)\n ```", "operands": [ { "name": "operandValues", "type": "Variadic>" }, { "name": "attributeValues", "type": "Variadic" }, { "name": "typeValues", "type": "Variadic>" } ], "results": [ { "name": "op", "type": "PDL_Operation" } ], "attributes": [ { "name": "opName", "type": "OptionalAttr" }, { "name": "attributeValueNames", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "($opName^)? (`(` $operandValues^ `:` type($operandValues) `)`)?\n custom($attributeValues, $attributeValueNames)\n (`->` `(` $typeValues^ `:` type($typeValues) `)`)? attr-dict" }, { "name": "pdl.pattern", "summary": "Define a rewrite pattern", "description": "`pdl.pattern` operations provide a transformable representation for a\n `RewritePattern`. The attributes on this operation correspond to the various\n metadata on a `RewritePattern`, such as the benefit. The match section of\n the pattern is specified within the region body, with the rewrite provided\n by a terminating `pdl.rewrite`.\n\n Example:\n\n ```mlir\n // Provide a pattern matching \"foo.op\" that replaces the root with its\n // operand.\n pdl.pattern : benefit(1) {\n %resultType = pdl.type\n %inputOperand = pdl.operand\n %root = pdl.operation \"foo.op\"(%inputOperand) -> (%resultType)\n pdl.rewrite %root {\n pdl.replace %root with (%inputOperand)\n }\n }\n ```", "attributes": [ { "name": "benefit", "type": "ConfinedAttr" }, { "name": "sym_name", "type": "OptionalAttr" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "defaultDialect": "pdl", "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "($sym_name^)? `:` `benefit` `(` $benefit `)` attr-dict-with-keyword $bodyRegion" }, { "name": "pdl.range", "summary": "Construct a range of pdl entities", "description": "`pdl.range` operations construct a range from a given set of PDL entities,\n which all share the same underlying element type. For example, a\n `!pdl.range` may be constructed from a list of `!pdl.value`\n or `!pdl.range` entities.\n\n Example:\n\n ```mlir\n // Construct a range of values.\n %valueRange = pdl.range %inputValue, %inputRange : !pdl.value, !pdl.range\n\n // Construct a range of types.\n %typeRange = pdl.range %inputType, %inputRange : !pdl.type, !pdl.range\n\n // Construct an empty range of types.\n %valueRange = pdl.range : !pdl.range\n ```\n\n TODO: Range construction is currently limited to rewrites, but it could\n be extended to constraints under certain circustances; i.e., if we can\n determine how to extract the underlying elements. If we can't, e.g. if\n there are multiple sub ranges used for construction, we won't be able\n to determine their sizes during constraint time.", "operands": [ { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "PDL_RangeOf>" } ], "assemblyFormat": "($arguments^ `:` type($arguments))?\n custom(ref(type($arguments)), type($result))\n attr-dict" }, { "name": "pdl.replace", "summary": "Mark an input operation as `replaced`", "description": "`pdl.replace` operations are used within `pdl.rewrite` regions to specify\n that an input operation should be marked as replaced. The semantics of this\n operation correspond with the `replaceOp` method on a `PatternRewriter`. The\n set of replacement values can be either:\n * a single `Operation` (`replOperation` should be populated)\n - The operation will be replaced with the results of this operation.\n * a set of `Value`s (`replValues` should be populated)\n - The operation will be replaced with these values.\n\n Example:\n\n ```mlir\n // Replace root node with 2 values:\n pdl.replace %root with (%val0, %val1 : !pdl.value, !pdl.value)\n\n // Replace root node with a range of values:\n pdl.replace %root with (%vals : !pdl.range)\n\n // Replace root with another operation:\n pdl.replace %root with %otherOp\n ```", "operands": [ { "name": "opValue", "type": "PDL_Operation" }, { "name": "replOperation", "type": "Optional" }, { "name": "replValues", "type": "Variadic>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$opValue `with` (`(` $replValues^ `:` type($replValues) `)`)?\n ($replOperation^)? attr-dict" }, { "name": "pdl.result", "summary": "Extract a result from an operation", "description": "`pdl.result` operations extract result edges from an operation node within\n a pattern or rewrite region. The provided index is zero-based, and\n represents the concrete result to extract, i.e. this is not the result index\n as defined by the ODS definition of the operation.\n\n Example:\n\n ```mlir\n // Extract a result:\n %operation = pdl.operation ...\n %pdl_result = pdl.result 1 of %operation\n\n // Imagine the following IR being matched:\n %result_0, %result_1 = foo.op ...\n\n // If the example pattern snippet above were matching against `foo.op` in\n // the IR snippet, `%pdl_result` would correspond to `%result_1`.\n ```", "operands": [ { "name": "parent", "type": "PDL_Operation" } ], "results": [ { "name": "val", "type": "PDL_Value" } ], "attributes": [ { "name": "index", "type": "I32Attr" } ], "assemblyFormat": "$index `of` $parent attr-dict" }, { "name": "pdl.results", "summary": "Extract a result group from an operation", "description": "`pdl.results` operations extract a result group from an operation within a\n pattern or rewrite region. If an index is provided, this operation extracts\n a result group as defined by the ODS definition of the operation. In this\n case the result of this operation may be either a single `pdl.value` or\n a `pdl.range`, depending on the constraint of the result in ODS. If\n no index is provided, this operation extracts the full result range of the\n operation.\n\n Example:\n\n ```mlir\n // Extract all of the results of an operation:\n %operation = pdl.operation ...\n %results = pdl.results of %operation\n\n // Extract the results in the first result group of an operation, which is\n // variadic:\n %operation = pdl.operation ...\n %results = pdl.results 0 of %operation -> !pdl.range\n\n // Extract the results in the second result group of an operation, which is\n // not variadic:\n %operation = pdl.operation ...\n %results = pdl.results 1 of %operation -> !pdl.value\n ```", "operands": [ { "name": "parent", "type": "PDL_Operation" } ], "results": [ { "name": "val", "type": "PDL_InstOrRangeOf" } ], "attributes": [ { "name": "index", "type": "OptionalAttr" } ], "assemblyFormat": "($index^)? `of` $parent custom(ref($index), type($val))\n attr-dict" }, { "name": "pdl.rewrite", "summary": "Specify the rewrite of a matched pattern", "description": "`pdl.rewrite` operations terminate the region of a `pdl.pattern` and specify\n the main rewrite of a `pdl.pattern`, on the optional root operation. The\n rewrite is specified either via a string name (`name`) to a native\n rewrite function, or via the region body. The rewrite region, if specified,\n must contain a single block. If the rewrite is external it functions\n similarly to `pdl.apply_native_rewrite`, and takes a set of additional\n positional values defined within the matcher as arguments. If the rewrite is\n external, the root operation is passed to the native function as the leading\n arguments. The root operation, if provided, specifies the starting point in\n the pattern for the subgraph isomorphism search. Pattern matching will proceed\n from this node downward (towards the defining operation) or upward\n (towards the users) until all the operations in the pattern have been matched.\n If the root is omitted, the pdl_interp lowering will automatically select\n the best root of the pdl.rewrite among all the operations in the pattern.\n\n Example:\n\n ```mlir\n // Specify an external rewrite function:\n pdl.rewrite %root with \"myExternalRewriter\"(%value : !pdl.value)\n\n // Specify a rewrite inline using PDL with the given root:\n pdl.rewrite %root {\n %op = pdl.operation \"foo.op\"(%arg0, %arg1)\n pdl.replace %root with %op\n }\n\n // Specify a rewrite inline using PDL, automatically selecting root:\n pdl.rewrite {\n %op1 = pdl.operation \"foo.op\"(%arg0, %arg1)\n %op2 = pdl.operation \"bar.op\"(%arg0, %arg1)\n pdl.replace %root1 with %op1\n pdl.replace %root2 with %op2\n }\n ```", "operands": [ { "name": "root", "type": "Optional" }, { "name": "externalArgs", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "OptionalAttr" } ], "regions": [ { "name": "bodyRegion", "type": "AnyRegion" } ], "defaultDialect": "pdl", "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "($root^)? (`with` $name^ (`(` $externalArgs^ `:` type($externalArgs) `)`)?)?\n ($bodyRegion^)?\n attr-dict-with-keyword" }, { "name": "pdl.type", "summary": "Define a type handle within a pattern", "description": "`pdl.type` operations capture result type constraints of `Attributes`,\n `Values`, and `Operations`. Instances of this operation define, and\n partially constrain, results types of a given entity. A `pdl.type` may\n partially constrain the result by specifying a constant `Type`.\n\n Example:\n\n ```mlir\n // Define a type:\n %type = pdl.type\n\n // Define a type with a constant value:\n %type = pdl.type : i32\n ```", "results": [ { "name": "result", "type": "PDL_Type" } ], "attributes": [ { "name": "constantType", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict (`:` $constantType^)?" }, { "name": "pdl.types", "summary": "Define a range of type handles within a pattern", "description": "`pdl.types` operations capture result type constraints of `Value`s, and\n `Operation`s. Instances of this operation define results types of a given\n entity. A `pdl.types` may partially constrain the results by specifying\n an array of `Type`s.\n\n Example:\n\n ```mlir\n // Define a range of types:\n %types = pdl.types\n\n // Define a range of types with a range of constant values:\n %types = pdl.types : [i32, i64, i32]\n ```", "results": [ { "name": "result", "type": "PDL_RangeOf" } ], "attributes": [ { "name": "constantTypes", "type": "OptionalAttr>" } ], "assemblyFormat": "attr-dict (`:` $constantTypes^)?" }, { "name": "plan.alloc_cluster", "description": "The `plan.alloc_cluster` operation is a variant of the\n `plan.dps_cluster` operation that does not use destination-passing style\n (DPS). It is isolated from above and explicitly captures input operands, but unlike\n its DPS counterpart, it does not capture destination operands because its results must\n be lowered to allocation(s). The allocations may or may not be of a size that can only\n be computed inside of the region.\n This operation takes input operands and their corresponding bounds attributes,\n and produces results. The `input_attrs` hold bounds attribute information for\n the input operands. The absence of bounds information is allowed (`none` bounds).\n\n The `target` attribute specifies the execution target for the group.\n\n #### Example\n\n Consider the following simple program containing operations with dynamically shaped operands:\n\n ```mlir\n %0 = ... : tensor // A dynamically shaped operand\n %1 = ... : index // A dynamic calculation of %0's extent\n\n %2 = plan.alloc_cluster target(#plan.cluster_target)\n inputs(%0, %1 : tensor, index)\n in_attrs [#plan.bounds, #plan.bounds]-> tensor {\n %3 = plan.with_shape %0 (%1) : (tensor, index) -> tensor\n %4 = stablehlo.exponential %3 : tensor\n yield %4 : tensor\n }", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "input_attrs", "type": "TypedArrayAttrBase" }, { "name": "target", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "defaultDialect": "plan", "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "(`target` `(` $target^ `)` `\\n`)?\n `inputs` `(` ( $inputs^ `:` type($inputs) `)` ) : ( `)` ) ? `\\n`\n `in_attrs` $input_attrs `\\n`\n attr-dict-with-keyword `->` type($results)\n $body" }, { "name": "plan.cluster", "description": "The `plan.cluster` operation encapsulates a group of operations within\n its single-block region. The purpose of this operation is materialize\n in the IR the result of a clustering analysis.\n\n Each `plan.cluster` operation must be assigned a `target` attribute\n that indicates how the cluster should be compiled / what \"backend\" will\n be targeted. Examples of \"backends\" could include entire sub-compiler\n stacks like TensorRT or an external library like CUBlas or CUDNN.\n\n The `plan.cluster` operation is meant to be gradually lowered into a\n more specialized operation(s) and/or have the body outlined to a\n function-like operation such that the reuslts are replaced with a\n call-like operation.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "target", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "defaultDialect": "plan", "assemblyFormat": "( `target` `(` $target^ `)` )?\n attr-dict-with-keyword (`->` type($results)^)? $body" }, { "name": "plan.constraint", "summary": "Used for applying constraints to its memref operand using attributes.", "description": "This op is used to apply constraints to its memref operand using the\n attributes associated for dimension analysis passes.", "operands": [ { "name": "memrefToConstrain", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "`(` $memrefToConstrain `)` attr-dict `:` type($memrefToConstrain)" }, { "name": "plan.dps_cluster", "description": "The `plan.dps_cluster` operation is similar to `plan.cluster`\n except that it is isolated from above and explicitly captures destination\n operands. The `in_attrs` and `res_attrs` hold bounds attribute information\n for the input and result operands. The abcense of bounds information\n is allowed (`none` bounds).\n\n #### Example\n\n Consider the following simple program containing operations with\n dynamically shaped operands:\n\n ```mlir\n\n %0 = ... : tensor // A dynamically shaped operand\n %1 = .... : index // A dynamic calculation of %0's extent\n\n %2 = plan.cluster target(#plan.cluster_target) {\n %2 = plan.with_shape %0 (%1) : (tensor, index) -> tensor\n %3 = stablehlo.exponential %2 : tensor\n yield %3 : tensor\n }\n\n ```\n\n It can be transformed into the below IR which explicitly captures all\n operands, operand shape bounds, and the allocation of a destination tensor\n based on the upper bound of the yielded values:\n\n\n ```mlir\n\n // Destination operand calculated from the upper bound of the\n // output.\n %empty = tensor.empty() : tensor<128xf32>\n\n //Slice %empty to actual linear size.\n %out = tensor.extract_slice %empty[0][%ub][1] : tensor<128xf32> to tensor\n\n %2 = plan.dps_cluster target(#plan.cluster_target)\n inputs( %0, %1 : tensor, index)\n outs( %out : tensor )\n in_attrs [#plan.bounds, #plan.bounds]\n res_attrs [#plan.bounds, #plan.bounds] -> tensor {\n ^bb0(%in0: tensor, %in1: index, %out0: tensor):\n %2 = plan.with_shape %in0 (%in1) : (tensor, index) -> tensor\n %res = stablehlo.exponential %2 : tensor\n yield %res : tensor\n }\n\n ```", "operands": [ { "name": "inputs", "type": "Variadic>" }, { "name": "outs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "input_attrs", "type": "TypedArrayAttrBase" }, { "name": "res_attrs", "type": "TypedArrayAttrBase" }, { "name": "target", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "defaultDialect": "plan", "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "IsolatedFromAbove" } ], "assemblyFormat": "(`target` `(` $target^ `)` `\\n`)?\n `inputs` `(` ( $inputs^ `:` type($inputs) `)` ) : ( `)` ) ? `\\n`\n `outs` `(` $outs `:` type($outs) `)` `\\n`\n `in_attrs` $input_attrs `\\n`\n `res_attrs` $res_attrs attr-dict-with-keyword `->` type($results)\n $body" }, { "name": "plan.inline_closed_alloc_group", "description": "The `plan.inline_closed_alloc_group` operation is a variant of the\n `plan.inline_closed_group` operation that does not use destination-passing style\n (DPS). It is isolated from above and explicitly captures input operands, but unlike\n its DPS counterpart, it does not capture destination operands because its results must\n be lowered to allocation(s). The allocations may or may not be of a size that can only\n be computed inside of the region.\n This operation takes input operands and their corresponding bounds attributes,\n and produces results. The `input_attrs` hold bounds attribute information for\n the input operands. The absence of bounds information is allowed (`none` bounds).\n\n The `target` attribute specifies the execution target for the group.\n\n #### Example\n\n Consider the following simple program containing operations with dynamically shaped operands:\n\n ```mlir\n %0 = ... : tensor // A dynamically shaped operand\n %1 = ... : index // A dynamic calculation of %0's extent\n\n %2 = plan.inline_closed_alloc_group target(#plan.cluster_target)\n inputs(%0, %1 : tensor, index)\n in_attrs [#plan.bounds, #plan.bounds]-> tensor {\n %3 = plan.with_shape %0 (%1) : (tensor, index) -> tensor\n %4 = stablehlo.exponential %3 : tensor\n yield %4 : tensor\n }", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "input_attrs", "type": "TypedArrayAttrBase" }, { "name": "target", "type": "AnyAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`target` `(` $target `)` `\\n`\n `inputs` `(` ( $inputs^ `:` type($inputs) `)` ) : ( `)` ) ? `\\n`\n `in_attrs` $input_attrs `\\n`\n attr-dict-with-keyword `->` type($results)\n $body", "defaultDialect": "plan" }, { "name": "plan.inline_closed_group", "description": "The `plan.inline_closed_group` operation is similar to `dps.inline_group`\n except that it is isolated from above and explicitly captures destination\n operands. The `in_attrs` and `res_attrs` hold bounds attribute information\n for the input and result operands. The abcense of bounds information\n is allowed (`none` bounds).\n\n #### Example\n\n Consider the following simple program containing operations with\n dynamically shaped operands:\n\n ```mlir\n\n %0 = ... : tensor // A dynamically shaped operand\n %1 = .... : index // A dynamic calculation of %0's extent\n\n %2 = plan.inline_group target(#plan.cluster_target) {\n %2 = plan.with_shape %0 (%1) : (tensor, index) -> tensor\n %3 = stablehlo.exponential %2 : tensor\n yield %3 : tensor\n }\n\n ```\n\n It can be transformed into the below IR which explicitly captures all\n operands, operand shape bounds, and the allocation of a destination tensor\n based on the upper bound of the yielded values:\n\n\n ```mlir\n\n // Destination operand calculated from the upper bound of the\n // output.\n %empty = tensor.empty() : tensor<128xf32>\n\n //Slice %empty to actual linear size.\n %out = tensor.extract_slice %empty[0][%ub][1] : tensor<128xf32> to tensor\n\n %2 = plan.inline_closed_group target(#plan.cluster_target)\n inputs( %0, %1 : tensor, index)\n outs( %out : tensor )\n in_attrs [#plan.bounds, #plan.bounds]\n res_attrs [#plan.bounds, #plan.bounds] -> tensor {\n ^bb0(%in0: tensor, %in1: index, %out0: tensor):\n %2 = plan.with_shape %in0 (%in1) : (tensor, index) -> tensor\n %res = stablehlo.exponential %2 : tensor\n yield %res : tensor\n }\n\n ```", "operands": [ { "name": "inputs", "type": "Variadic>" }, { "name": "outs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "input_attrs", "type": "TypedArrayAttrBase" }, { "name": "res_attrs", "type": "TypedArrayAttrBase" }, { "name": "target", "type": "AnyAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`target` `(` $target `)` `\\n`\n `inputs` `(` ( $inputs^ `:` type($inputs) `)` ) : ( `)` ) ? `\\n`\n `outs` `(` $outs `:` type($outs) `)` `\\n`\n `in_attrs` $input_attrs `\\n`\n `res_attrs` $res_attrs attr-dict-with-keyword `->` type($results)\n $body", "defaultDialect": "plan" }, { "name": "plan.inline_group", "description": "The `plan.inline_group` operation encapsulates a group of operations within\n its single-block region. The purpose of this operation is materialize\n in the IR the result of a clustering analysis.\n\n Each `plan.inline_group` operation must be assigned a `target` attribute\n that indicates how the cluster should be compiled / what \"backend\" will\n be targeted. Examples of \"backends\" could include entire sub-compiler\n stacks like TensorRT or an external library like CUBlas or CUDNN.\n\n The `plan.inline_group` operation is meant to be gradually lowered into a\n more specialized operation(s) and/or have the body outlined to a\n function-like operation such that the reuslts are replaced with a\n call-like operation.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "target", "type": "CompilerBackendAttrInterface" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`target` `(` $target `)` attr-dict-with-keyword (`->` type($results)^)? $body", "defaultDialect": "plan" }, { "name": "plan.nvtx_pop", "summary": "End an NVTX range using a correlation ID", "description": "The `plan.nvtx_pop` operation ends an NVTX process range via\n `nvtxDomainRangeEnd` using the `range_id` from a corresponding\n `plan.nvtx_push`.\n\n Semantically, the tensor inputs are identity -- they are tied to\n the corresponding results. The `range_id` operand is consumed (passed to\n the NVTX runtime) and does not appear in the results.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "range_id", "type": "I64" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "TypesMatchWith<'inputs', 'results', 'llvm::make_range($_self.begin(), $_self.end())'>" } ], "assemblyFormat": "attr-dict operands `:` functional-type(operands, results)" }, { "name": "plan.nvtx_push", "summary": "Start an NVTX range and return a correlation ID", "description": "The `plan.nvtx_push` operation starts an NVTX process and returns\n a correlation ID (`range_id`) along with identity-forwarded operands.\n The `range_id` must be passed to a corresponding `plan.nvtx_pop` to end the range.\n\n Semantically, the tensor operands are identity -- they are tied to\n the corresponding results. The `range_id` result is a new i64 value\n returned that represents the correlation ID of the NVTX range.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" }, { "name": "range_id", "type": "I64" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "color", "type": "I32Attr" } ], "traits": [ { "type": "TypesMatchWith<'inputs', 'results', 'llvm::make_range($_self.begin(), $_self.end())'>" } ], "assemblyFormat": "attr-dict operands `:` functional-type(operands, results)" }, { "name": "plan.optimization_barrier", "summary": "identity operation that prevents optimizations", "description": "The `plan.optimization_barrier` is a utility operation that is used to\n prevent some optimizations which match patterns in the input IR (e.g.\n constant folding) from being applied. Semantically, the operation\n is an identity -- the operands are tied to the results -- but it\n disrupts potential pattern matching.\n\n Note that the operation is still functionally pure, so it does not\n prevent optimizations like loop-invariant code motion or CSE.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "TypesMatchWith<'operands', 'results', 'llvm::make_range($_self.begin(), $_self.end())'>" } ], "assemblyFormat": "$operands attr-dict `:` type($operands)" }, { "name": "plan.transfer", "summary": "Transfer a tensor from one memory space to another", "description": "The `plan.transfer` operation is a utility operation that is used to\n transfer a tensor from one memory space to another. It is converted\n into a `linalg.copy` prior to running one-shot-bufferization.", "operands": [ { "name": "operand", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)" }, { "name": "plan.with_shape", "summary": "Ties a tensor value with index SSA values representing its shape", "description": "The `plan.with_shape` operation is a utility operation that links a tensor\n SSA value with individual scalar Index-typed values representing the\n dimension sizes. The number of `shape` dimension values should be equal to\n the rank of `operand`.\n\n The operation returns a single result which is exactly equivalent to the\n operand. The purpose of the operation is therefore purely to link the SSA\n value to the dimension sizes.\n\n This operation is only really useful when `operand` has dynamic dimensions\n type, so if `operand` is statically shaped then this operation will be\n folded away.", "operands": [ { "name": "operand", "type": "AnyRankedTensor" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "attr-dict $operand `(` $shape `)` `:` functional-type(operands, results)" }, { "name": "plan.with_values", "summary": "Ties a tensor value with index SSA values representing its element values", "description": "The `plan.with_values` operation is a utility operation that links a tensor\n SSA value with individual scalar values representing the values of individual\n elements. The number of `elements` should be equal to the volume of the\n `operand`, which must have a static shape.\n\n The operation returns a single result which is exactly equivalent to the\n operand. The purpose of the operation is therefore purely to link the SSA\n value to the element values.", "operands": [ { "name": "operand", "type": "StaticShapeTensorOf<[AnySignlessIntegerOrIndex]>" }, { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "attr-dict $operand `(` $elements `)` `:` custom(\n ref($elements), type($result), type($elements))" }, { "name": "plan.yield", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "plugin.magic", "summary": "Illustrates how to define a custom operation.", "description": "The `plugin.magic` operation illustrates how to define a new\n operation in a dialect. It uses an operation trait to declare that it\n has no side effects.\n\n This operation takes an integer argument and returns an integer.\n\n Example:\n\n ```mlir\n %0 = arith.constant 2 : i32\n // Apply the magic operation to %0\n %1 = plugin.magic %0 : i32\n ```", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input attr-dict `:` type($input)" }, { "name": "poly.add", "summary": "Addition operation between polynomials.", "operands": [ { "name": "lhs", "type": "PolyOrContainer" }, { "name": "rhs", "type": "PolyOrContainer" } ], "results": [ { "name": "output", "type": "PolyOrContainer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($output))" }, { "name": "poly.constant", "summary": "Define a constant polynomial via an attribute.", "results": [ { "name": "output", "type": "Polynomial" } ], "attributes": [ { "name": "coefficients", "type": "AnyIntElementsAttr" } ], "assemblyFormat": "$coefficients attr-dict `:` qualified(type($output))" }, { "name": "poly.eval", "summary": "Evaluates a Polynomial at a given input value.", "operands": [ { "name": "polynomial", "type": "Polynomial" }, { "name": "point", "type": "IntOrComplex" } ], "results": [ { "name": "output", "type": "IntOrComplex" } ], "traits": [ { "type": "AllTypesMatch<['point', 'output']>" } ], "assemblyFormat": "$polynomial `,` $point attr-dict `:` `(` qualified(type($polynomial)) `,` type($point) `)` `->` type($output)" }, { "name": "poly.from_tensor", "summary": "Creates a Polynomial from integer coefficients stored in a tensor.", "operands": [ { "name": "input", "type": "TensorOf<[AnyInteger]>" } ], "results": [ { "name": "output", "type": "Polynomial" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` qualified(type($output))" }, { "name": "poly.mul", "summary": "Multiplication operation between polynomials.", "operands": [ { "name": "lhs", "type": "PolyOrContainer" }, { "name": "rhs", "type": "PolyOrContainer" } ], "results": [ { "name": "output", "type": "PolyOrContainer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($output))" }, { "name": "poly.sub", "summary": "Subtraction operation between polynomials.", "operands": [ { "name": "lhs", "type": "PolyOrContainer" }, { "name": "rhs", "type": "PolyOrContainer" } ], "results": [ { "name": "output", "type": "PolyOrContainer" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($output))" }, { "name": "poly.to_tensor", "summary": "Converts a polynomial to a tensor of its integer coefficients.", "operands": [ { "name": "input", "type": "Polynomial" } ], "results": [ { "name": "output", "type": "TensorOf<[AnyInteger]>" } ], "assemblyFormat": "$input attr-dict `:` qualified(type($input)) `->` type($output)" }, { "name": "proton_gpu.circular_store", "summary": "Store the value into a circular buffer", "description": "Store a metric `counter` into a circular buffer backed by the internal memory `segment`.\n automatically updated. Older metric counters are dropped if the `segment` buffer is full.", "operands": [ { "name": "segment", "type": "PTG_SegmentType" }, { "name": "counter", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "isStart", "type": "UnitAttr" }, { "name": "scopeId", "type": "I32Attr" } ], "assemblyFormat": "(`start` $isStart^):(`end`)? $segment `,` $counter attr-dict `:`\n qualified(type($segment)) `,` type($counter)" }, { "name": "proton_gpu.finalize", "summary": "Finalize the intra kernel profiler", "description": "Write back the metadata and profile to global memory.\n `segment` is the segment of the internal profiling buffer that contains the profiling data.\n `scratchPtr` is the address of the profiling scratch buffer.", "operands": [ { "name": "segment", "type": "PTG_SegmentType" }, { "name": "scratchPtr", "type": "TT_Ptr" } ], "assemblyFormat": "$segment `,` $scratchPtr attr-dict `:` qualified(type($segment)) `,` qualified(type($scratchPtr))" }, { "name": "proton_gpu.global_scratch_alloc", "summary": "Allocate a global memory profile buffer", "description": "This operation allocates a profile buffer in global memory.\n Each Triton program being profiled will hold a pointer to the buffer until profiling is finalized.", "results": [ { "name": "result", "type": "TT_Ptr" } ], "attributes": [ { "name": "nbytes", "type": "I32Attr" }, { "name": "alignment", "type": "I32Attr" } ], "assemblyFormat": "attr-dict `:` qualified(type($result))" }, { "name": "proton_gpu.init_ctx", "summary": "Initialize the intra kernel profiler warp-level contexts", "description": "Initialize the intra kernel profiler warp-level contexts for all warps in\n `scratchPtr` (base address of the profiling scratch buffer). It can't be\n called inside `ttg.warp_specialize`.", "operands": [ { "name": "scratchPtr", "type": "TT_Ptr" } ], "assemblyFormat": "$scratchPtr attr-dict `:` qualified(type($scratchPtr))" }, { "name": "proton_gpu.initialize", "summary": "Initialize the intra kernel profiler", "description": "Initialize the intra kernel profiler by filling the auxiliary metadata to the header.\n `scratchPtr` is the base address of the profiling scratch buffer where the header is stored.", "operands": [ { "name": "scratchPtr", "type": "TT_Ptr" } ], "assemblyFormat": "$scratchPtr attr-dict `:` qualified(type($scratchPtr))" }, { "name": "proton_gpu.read_counter", "summary": "Read a GPU metric counter into a scalar register", "description": "Read a GPU metric counter into a scalar register.", "results": [ { "name": "counter", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "metric", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict `:` type($counter)" }, { "name": "proton_gpu.restore_ctx", "summary": "Restore the current warp-level context", "description": "Restore the current warp context in `$segment` from\n `scratchPtr` (base address of the profiling scratch buffer).", "operands": [ { "name": "segment", "type": "PTG_SegmentType" }, { "name": "scratchPtr", "type": "TT_Ptr" } ], "assemblyFormat": "$segment `,` $scratchPtr attr-dict `:` qualified(type($segment)) `,` qualified(type($scratchPtr))" }, { "name": "proton_gpu.save_ctx", "summary": "Save the current warp-level context", "description": "Save the current warp context from `$segment` to\n `scratchPtr` (base address of the profiling scratch buffer).", "operands": [ { "name": "segment", "type": "PTG_SegmentType" }, { "name": "scratchPtr", "type": "TT_Ptr" } ], "assemblyFormat": "$segment `,` $scratchPtr attr-dict `:` qualified(type($segment)) `,` qualified(type($scratchPtr))" }, { "name": "proton_gpu.segment_alloc", "summary": "Get the base offset of the segment of the internal buffer", "description": "The internal buffer is partitioned into segments for each profiling \"unit\".\n This operation gets the location of the memory segment in the internal buffer.", "operands": [ { "name": "buffer", "type": "AnyTypeOf<[TTG_MemDescType, TT_Ptr]>" } ], "results": [ { "name": "segment", "type": "PTG_SegmentType" } ], "assemblyFormat": "$buffer attr-dict `:` qualified(type($buffer)) `->` type($segment)" }, { "name": "proton.record", "summary": "Record an event", "description": "This operation annotates a region of IR where events are recorded.\n Events can be classified as hardware or software events.\n Hardware events are provided by the hardware performance counters obtained in later passes that convert Triton to target-specific IR.\n Software events are provided by the user or the compiler.\n\n Example:\n\n ```mlir\n proton.record start \"name0\"\n ...\n proton.record end \"name0\"\n ```\n\n Scope names cannot be reused within the same function.", "attributes": [ { "name": "isStart", "type": "UnitAttr" }, { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "(`start` $isStart^):(`end`)? $name attr-dict" }, { "name": "ptr.constant", "summary": "Pointer constant operation", "description": "The `constant` operation produces a pointer constant. The attribute must be\n a typed attribute of pointer type.\n\n Example:\n\n ```mlir\n // Create a null pointer\n %null = ptr.constant #ptr.null : !ptr.ptr<#ptr.generic_space>\n ```", "results": [ { "name": "result", "type": "Ptr_PtrType" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "attr-dict $value" }, { "name": "ptr.from_ptr", "summary": "Casts a `!ptr.ptr` value to a ptr-like value.", "description": "The `from_ptr` operation casts a `ptr` value to a ptr-like object. It's\n important to note that:\n - The ptr-like object cannot be a `!ptr.ptr`.\n - The memory-space of both the `ptr` and ptr-like object must match.\n - The cast is Pure (no UB and side-effect free).\n\n The optional `metadata` operand exists to provide any ptr-like metadata\n that might be required to perform the cast.\n\n Example:\n\n ```mlir\n %typed_ptr = ptr.from_ptr %ptr : !ptr.ptr<#ptr.generic_space> -> !my.ptr\n %memref = ptr.from_ptr %ptr metadata %md : !ptr.ptr<#ptr.generic_space> -> memref\n\n // Cast the `%ptr` to a memref without utilizing metadata.\n %memref = ptr.from_ptr %ptr : !ptr.ptr<#ptr.generic_space> -> memref\n ```", "operands": [ { "name": "ptr", "type": "Ptr_PtrType" }, { "name": "metadata", "type": "Optional" } ], "results": [ { "name": "result", "type": "PtrLikeTypeInterface" } ], "traits": [ { "type": "TypesMatchWith<'result', 'metadata', 'PtrMetadataType::get(cast($_self))'>" } ], "assemblyFormat": "$ptr (`metadata` $metadata^)? attr-dict `:` type($ptr) `->` type($result)" }, { "name": "ptr.gather", "summary": "Gather operation", "description": "The `gather` operation performs conditional loads from multiple memory\n locations specified by `ptrs` based on a mask `mask`. Elements of the\n result corresponding to masked-off lanes are taken from the passthrough\n operand.\n\n The mask operand is a shaped type of `i1` elements that must have the same\n shape as the result type.\n\n Examples:\n ```mlir\n // Gather values from multiple memory locations\n %result = ptr.gather %ptrs, %mask, %passthrough :\n vector<4x!ptr.ptr<#ptr.generic_space>> -> vector<4xf32>\n\n // Gather with alignment\n %result = ptr.gather %ptrs, %mask, %passthrough alignment = 8 :\n vector<4x!ptr.ptr<#ptr.generic_space>> -> vector<4xf32>\n ```", "operands": [ { "name": "ptrs", "type": "Ptr_Ptr1DType" }, { "name": "mask", "type": "Ptr_Mask1DType" }, { "name": "passthrough", "type": "Ptr_Any1DType" } ], "results": [ { "name": "result", "type": "Ptr_Any1DType" } ], "attributes": [ { "name": "alignment", "type": "AlignmentProp" } ], "traits": [ { "type": "TypesMatchWith<'result', 'mask', '::llvm::cast($_self).clone(\n IntegerType::get($_self.getContext(), 1))'>" }, { "type": "AllTypesMatch<['result', 'passthrough']>" } ], "assemblyFormat": "$ptrs `,` $mask `,` $passthrough (`alignment` `=` $alignment^)?\n attr-dict `:` type($ptrs) `->` type($result)" }, { "name": "ptr.get_metadata", "summary": "SSA value representing pointer metadata.", "description": "The `get_metadata` operation produces an opaque value that encodes the\n metadata of the ptr-like type.\n\n Example:\n\n ```mlir\n %metadata = ptr.get_metadata %memref : memref\n ```", "operands": [ { "name": "ptr", "type": "PtrLikeTypeInterface" } ], "results": [ { "name": "result", "type": "Ptr_PtrMetadata" } ], "traits": [ { "type": "TypesMatchWith<'ptr', 'result', 'PtrMetadataType::get(cast($_self))'>" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr)" }, { "name": "ptr.load", "description": "The `load` operation is used to read from memory. A load may be marked as\n atomic, volatile, and/or nontemporal.\n\n An atomic load only supports a limited set of value types, and requires\n an explicit alignment.\n\n Examples:\n ```mlir\n // A volatile load of a float variable.\n %0 = ptr.load volatile %ptr : !ptr.ptr -> f32\n\n // A nontemporal load of a float variable.\n %0 = ptr.load %ptr nontemporal : !ptr.ptr -> f32\n\n // An atomic load of an integer variable.\n %0 = ptr.load %ptr atomic monotonic alignment = 8 : !ptr.ptr -> i64\n ```\n\n See the following link for more details on the meaning of `alignment`,\n `volatile_`, `nontemporal`, `invariant`, `invariant_group`, `ordering`,\n and `syncscope`:\n https://llvm.org/docs/LangRef.html#load-instruction", "operands": [ { "name": "ptr", "type": "Ptr_PtrType" } ], "results": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "alignment", "type": "AlignmentProp" }, { "name": "volatile_", "type": "UnitProp" }, { "name": "nontemporal", "type": "UnitProp" }, { "name": "invariant", "type": "UnitProp" }, { "name": "invariantGroup", "type": "UnitProp" }, { "name": "ordering", "type": "DefaultValuedProp" }, { "name": "syncscope", "type": "OptionalAttr" } ], "assemblyFormat": "(`volatile` $volatile_^)? $ptr\n (`atomic` (`syncscope` `(` $syncscope^ `)`)? $ordering^)?\n oilist(\n `nontemporal` $nontemporal |\n `invariant` $invariant |\n `invariant_group` $invariantGroup |\n `alignment` `=` $alignment\n )\n attr-dict `:` qualified(type($ptr)) `->` type($value)" }, { "name": "ptr.masked_load", "summary": "Masked load operation", "description": "The `masked_load` operation performs a conditional load from memory based\n on a mask. Elements of the result corresponding to masked-off lanes are\n taken from the passthrough operand.\n\n The mask operand is a shaped type of `i1` elements that must have the same\n shape as the result type.\n\n Examples:\n ```mlir\n // Masked load with passthrough on vectors\n %result = ptr.masked_load %ptr, %mask, %passthrough :\n !ptr.ptr<#ptr.generic_space> -> vector<4xf32>\n\n // Masked load with passthrough on tensors\n %result = ptr.masked_load %ptr, %mask, %passthrough :\n !ptr.ptr<#ptr.generic_space> -> tensor<4xf32>\n ```", "operands": [ { "name": "ptr", "type": "Ptr_PtrType" }, { "name": "mask", "type": "Ptr_Mask1DType" }, { "name": "passthrough", "type": "Ptr_Any1DType" } ], "results": [ { "name": "result", "type": "Ptr_Any1DType" } ], "attributes": [ { "name": "alignment", "type": "AlignmentProp" } ], "traits": [ { "type": "TypesMatchWith<'result', 'mask', '::llvm::cast($_self).clone(\n IntegerType::get($_self.getContext(), 1))'>" }, { "type": "AllTypesMatch<['result', 'passthrough']>" } ], "assemblyFormat": "$ptr `,` $mask `,` $passthrough (`alignment` `=` $alignment^)?\n attr-dict `:` qualified(type($ptr)) `->` type($result)" }, { "name": "ptr.masked_store", "summary": "Masked store operation", "description": "The `masked_store` operation performs a conditional store to memory based\n on a mask. Only elements corresponding to set bits in the mask are written\n to memory.\n\n The mask operand is a shaped type of `i1` elements that must have the same\n shape as the value being stored.\n\n Examples:\n ```mlir\n // Masked store\n ptr.masked_store %value, %ptr, %mask :\n vector<4xf32>, !ptr.ptr<#ptr.generic_space>\n\n // Masked store with alignment\n ptr.masked_store %value, %ptr, %mask alignment = 8 :\n vector<4xf32>, !ptr.ptr<#ptr.generic_space>\n ```", "operands": [ { "name": "value", "type": "Ptr_Any1DType" }, { "name": "ptr", "type": "Ptr_PtrType" }, { "name": "mask", "type": "Ptr_Mask1DType" } ], "attributes": [ { "name": "alignment", "type": "AlignmentProp" } ], "traits": [ { "type": "TypesMatchWith<'value', 'mask', '::llvm::cast($_self).clone(\n IntegerType::get($_self.getContext(), 1))'>" } ], "assemblyFormat": "$value `,` $ptr `,` $mask (`alignment` `=` $alignment^)? attr-dict `:`\n type($value) `,` qualified(type($ptr))" }, { "name": "ptr.ptr_add", "summary": "Pointer add operation", "description": "The `ptr_add` operation adds an int-like offset to one or more pointers to produce one or more new pointers.\n\n The operation supports both scalar and shaped types with value semantics:\n - When both base and offset are scalar: produces a single new pointer\n - When base is shaped and offset is scalar: adds the same offset to each\n pointer in the base\n - When base is scalar and offset is shaped: adds the single pointer to each\n offset in the shaped value\n - When both are shaped: performs element-wise addition (shapes must be\n compatible)\n\n Example:\n\n ```mlir\n // Scalar base and offset\n %x_off = ptr.ptr_add %x, %off : !ptr.ptr<#ptr.generic_space>, i32\n %x_off0 = ptr.ptr_add nusw %x, %off : !ptr.ptr<#ptr.generic_space>, i32\n\n // Shaped base with scalar offset\n %ptrs_off = ptr.ptr_add %ptrs, %off : vector<4x!ptr.ptr<#ptr.generic_space>>, i32\n\n // Scalar base with shaped offset\n %x_offs = ptr.ptr_add %x, %offs : !ptr.ptr<#ptr.generic_space>, vector<4xi32>\n\n // Both base and offset are shaped\n %ptrs_offs = ptr.ptr_add %ptrs, %offs : vector<4x!ptr.ptr<#ptr.generic_space>>, vector<4xi32>\n ```", "operands": [ { "name": "base", "type": "Ptr_PtrLikeType" }, { "name": "offset", "type": "Ptr_IntLikeType" } ], "results": [ { "name": "result", "type": "Ptr_PtrLikeType" } ], "attributes": [ { "name": "flags", "type": "DefaultValuedProp, PtrAddFlags::none>" } ], "assemblyFormat": "($flags^)? $base `,` $offset attr-dict `:` type($base) `,` type($offset)" }, { "name": "ptr.ptr_diff", "summary": "Pointer difference operation", "description": "The `ptr_diff` operation computes the difference between two pointers,\n returning an integer or index value representing the number of bytes\n between them.\n\n The operation supports both scalar and shaped types with value semantics:\n - When both operands are scalar: produces a single difference value\n - When both are shaped: performs element-wise subtraction,\n shapes must be the same\n\n The operation also supports the following flags:\n - `none`: No flags are set.\n - `nuw`: No Unsigned Wrap, if the subtraction causes an unsigned overflow\n (that is: the result would be negative), the result is a poison value.\n - `nsw`: No Signed Wrap, if the subtraction causes a signed overflow, the\n result is a poison value.\n\n NOTE: The pointer difference is calculated using an integer type specified\n by the data layout. The final result will be sign-extended or truncated to\n fit the result type as necessary.\n\n Example:\n\n ```mlir\n // Scalar pointers\n %diff = ptr.ptr_diff %p1, %p2 : !ptr.ptr<#ptr.generic_space> -> i64\n\n // Shaped pointers\n %diffs = ptr.ptr_diff nsw %ptrs1, %ptrs2 :\n vector<4x!ptr.ptr<#ptr.generic_space>> -> vector<4xi64>\n ```", "operands": [ { "name": "lhs", "type": "Ptr_PtrLikeType" }, { "name": "rhs", "type": "Ptr_PtrLikeType" } ], "results": [ { "name": "result", "type": "Ptr_IntLikeType" } ], "attributes": [ { "name": "flags", "type": "DefaultValuedProp, PtrDiffFlags::none>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "($flags^)? $lhs `,` $rhs attr-dict `:` type($lhs) `->` type($result)" }, { "name": "ptr.scatter", "summary": "Scatter operation", "description": "The `scatter` operation performs a conditional store of a value `value` to\n multiple memory locations specified by `ptrs` based on a mask `mask`.\n\n Only elements corresponding to set bits in the mask are written to memory.\n The mask operand is a shaped type of `i1` elements that must have the same\n shape as the value being stored.\n\n Examples:\n ```mlir\n // Scatter values to multiple memory locations\n ptr.scatter %value, %ptrs, %mask :\n vector<4xf32>, vector<4x!ptr.ptr<#ptr.generic_space>>\n\n // Scatter with alignment\n ptr.scatter %value, %ptrs, %mask alignment = 8 :\n vector<4xf32>, vector<4x!ptr.ptr<#ptr.generic_space>>\n ```", "operands": [ { "name": "value", "type": "Ptr_Any1DType" }, { "name": "ptrs", "type": "Ptr_Ptr1DType" }, { "name": "mask", "type": "Ptr_Mask1DType" } ], "attributes": [ { "name": "alignment", "type": "AlignmentProp" } ], "traits": [ { "type": "TypesMatchWith<'value', 'mask', '::llvm::cast($_self).clone(\n IntegerType::get($_self.getContext(), 1))'>" } ], "assemblyFormat": "$value `,` $ptrs `,` $mask (`alignment` `=` $alignment^)?\n attr-dict `:` type($value) `,` type($ptrs)" }, { "name": "ptr.store", "description": "The `store` operation is used to write to memory. A store may be marked as\n atomic, volatile, and/or nontemporal.\n\n An atomic store only supports a limited set of value types, and requires\n an explicit alignment.\n\n Examples:\n ```mlir\n // A volatile store of a float variable.\n ptr.store volatile %val, %ptr : f32, !ptr.ptr\n\n // A nontemporal store of a float variable.\n ptr.store %val, %ptr nontemporal : f32, !ptr.ptr\n\n // An atomic store of an integer variable.\n ptr.store %val, %ptr atomic monotonic alignment = 8: i64, !ptr.ptr\n ```\n\n See the following link for more details on the meaning of `alignment`,\n `volatile_`, `nontemporal`, `invariant_group`, `ordering`, and `syncscope`:\n https://llvm.org/docs/LangRef.html#store-instruction", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "ptr", "type": "Ptr_PtrType" } ], "attributes": [ { "name": "alignment", "type": "AlignmentProp" }, { "name": "volatile_", "type": "UnitProp" }, { "name": "nontemporal", "type": "UnitProp" }, { "name": "invariantGroup", "type": "UnitProp" }, { "name": "ordering", "type": "DefaultValuedProp" }, { "name": "syncscope", "type": "OptionalAttr" } ], "assemblyFormat": "(`volatile` $volatile_^)? $value `,` $ptr\n (`atomic` (`syncscope` `(` $syncscope^ `)`)? $ordering^)?\n oilist(\n `nontemporal` $nontemporal |\n `invariant_group` $invariantGroup |\n `alignment` `=` $alignment\n )\n attr-dict `:` type($value) `,` qualified(type($ptr))" }, { "name": "ptr.to_ptr", "summary": "Casts a ptr-like value to a `!ptr.ptr` value.", "description": "The `to_ptr` operation casts a ptr-like object to a `!ptr.ptr`. It's\n important to note that:\n - The ptr-like object cannot be a `!ptr.ptr`.\n - The memory-space of both the `ptr` and ptr-like object must match.\n - The cast is side-effect free.\n\n Example:\n\n ```mlir\n %ptr0 = ptr.to_ptr %my_ptr : !my.ptr -> !ptr.ptr<#ptr.generic_space>\n %ptr1 = ptr.to_ptr %memref : memref -> !ptr.ptr<#ptr.generic_space>\n ```", "operands": [ { "name": "ptr", "type": "PtrLikeTypeInterface" } ], "results": [ { "name": "result", "type": "Ptr_PtrType" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr) `->` type($result)" }, { "name": "ptr.type_offset", "summary": "Type offset operation", "description": "The `type_offset` operation produces an int or index-typed SSA value\n equal to a target-specific constant representing the offset of a single\n element of the given type.\n\n Example:\n\n ```mlir\n // Return the offset between two f32 stored in memory\n %0 = ptr.type_offset f32 : index\n // Return the offset between two memref descriptors stored in memory\n %1 = ptr.type_offset memref<12 x f64> : i32\n ```", "results": [ { "name": "result", "type": "AnySignlessIntegerOrIndex" } ], "attributes": [ { "name": "elementType", "type": "TypeAttr" } ], "assemblyFormat": "$elementType attr-dict `:` type($result)" }, { "name": "pxa.generic", "summary": "PXA generic operation", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" }, { "name": "inputIndices", "type": "Variadic" }, { "name": "outputIndices", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "inputAccessMaps", "type": "TypedArrayAttrBase" }, { "name": "inputTileMaps", "type": "TypedArrayAttrBase" }, { "name": "outputAccessMaps", "type": "TypedArrayAttrBase" }, { "name": "outputTileMaps", "type": "TypedArrayAttrBase" }, { "name": "kernel", "type": "StrAttr" }, { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "reductions", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "pxa.load", "summary": "affine load operation", "description": "The \"affine.load\" op reads an element from a memref, where the index\n for each memref dimension is an affine expression of loop induction\n variables and symbols. The output of 'affine.load' is a new value with the\n same type as the elements of the memref. An affine expression of loop IVs\n and symbols must be specified for each dimension of the memref. The keyword\n 'symbol' can be used to indicate SSA identifiers which are symbolic.\n\n Example 1:\n\n ```mlir\n %1 = affine.load %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>\n ```\n\n Example 2: Uses 'symbol' keyword for symbols '%n' and '%m'.\n\n ```mlir\n %1 = affine.load %0[%i0 + symbol(%n), %i1 + symbol(%m)] : memref<100x100xf32>\n ```", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "idxs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "pxa.prng", "summary": "pseudorandom number generator operation", "operands": [ { "name": "state", "type": "AnyMemRef" }, { "name": "tensor", "type": "AnyMemRef" }, { "name": "new_state", "type": "AnyMemRef" } ], "results": [ { "name": "result_tensor", "type": "AnyMemRef" }, { "name": "result_state", "type": "AnyMemRef" } ] }, { "name": "pxa.reduce", "summary": "affine reduction operation", "operands": [ { "name": "val", "type": "AnyType" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "idxs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "agg", "type": "AtomicRMWKindAttr{addf|addi|andi|assign|maximumf|maxnumf|maxs|maxu|minimumf|minnumf|mins|minu|mulf|muli|ori|xori}" }, { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "pxa.store", "summary": "PXA non-affine store operation", "operands": [ { "name": "value", "type": "AnyTypeOf<[AnySignlessInteger, AnyFloat, AnyVector]>" }, { "name": "memref", "type": "MemRefOf<[AnySignlessInteger, AnyFloat]>" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "MemRefOf<[AnySignlessInteger, AnyFloat]>" } ], "attributes": [ { "name": "agg", "type": "AtomicRMWKindAttr{addf|addi|andi|assign|maximumf|maxnumf|maxs|maxu|minimumf|minnumf|mins|minu|mulf|muli|ori|xori}" } ], "assemblyFormat": "$agg $value `,` $memref `[` $indices `]` attr-dict `:` `(` type($value) `,`\n type($memref) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "pxa.vector_load", "summary": "affine vector load operation", "description": "The \"affine.vector_load\" is the vector counterpart of\n [affine.load](#affineload-operation). It reads a slice from a\n [MemRef](../LangRef.md#memref-type), supplied as its first operand,\n into a [vector](../LangRef.md#vector-type) of the same base elemental type.\n The index for each memref dimension is an affine expression of loop induction\n variables and symbols. These indices determine the start position of the read\n within the memref. The shape of the return vector type determines the shape of\n the slice read from the memref. This slice is contiguous along the respective\n dimensions of the shape. Strided vector loads will be supported in the future.\n An affine expression of loop IVs and symbols must be specified for each\n dimension of the memref. The keyword 'symbol' can be used to indicate SSA\n identifiers which are symbolic.\n\n Example 1: 8-wide f32 vector load.\n\n ```mlir\n %1 = affine.vector_load %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>, vector<8xf32>\n ```\n\n Example 2: 4-wide f32 vector load. Uses 'symbol' keyword for symbols '%n' and '%m'.\n\n ```mlir\n %1 = affine.vector_load %0[%i0 + symbol(%n), %i1 + symbol(%m)] : memref<100x100xf32>, vector<4xf32>\n ```\n\n Example 3: 2-dim f32 vector load.\n\n ```mlir\n %1 = affine.vector_load %0[%i0, %i1] : memref<100x100xf32>, vector<2x8xf32>\n ```\n\n TODOs:\n * Add support for strided vector loads.\n * Consider adding a permutation map to permute the slice that is read from memory\n (see [vector.transfer_read](../Vector/#vectortransfer_read-vectortransferreadop)).", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "idxs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyVector" } ], "attributes": [ { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "pxa.vector_reduce", "summary": "affine vector reduction operation", "operands": [ { "name": "val", "type": "AnyVector" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "idxs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "agg", "type": "AtomicRMWKindAttr{addf|addi|andi|assign|maximumf|maxnumf|maxs|maxu|minimumf|minnumf|mins|minu|mulf|muli|ori|xori}" }, { "name": "map", "type": "AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "quant.dcast", "summary": "Dequantize cast operation", "description": "Convert an input quantized value into its expressed floating-point value.\n The dequantization process consists of the following steps:\n\n ```\n def dequantize(quantizedValue: quantizedType) -> expressedType:\n storedValue = reinterpretCast(quantizedValue, storageType)\n storedValueFloat = convertIntToFloat(storedValue, expressedType)\n zeroPointFloat = convertIntToFloat(zeroPoint, expressedType)\n expressedValue = (storedValueFloat - zeroPointFloat) * scale\n return expressedValue\n ```\n\n Here, `storageType`, `expressedType`, `scale`, and `zeroPoint` are obtained\n from the corresponding parameters encoded in `quantizedType`. For\n per-channel quantization, the appropriate `scale` and `zeroPoint` values\n are used for each tensor element computation according to the channel the\n element belongs to.\n \n The numerical results produced by the algorithm above may vary depending on\n the rounding methods used by `convertIntToFloat()`, subtraction (`-`), and\n multiplication (`*`). This operation does not define specific rounding\n methods; instead, it is the responsibility of a transform pipeline to\n determine which rounding method to apply when this operation is broken down\n into lower-level dialects.\n\n The operation must satisfy the following syntactic constraints:\n\n - Operand `input` must be a scalar or tensor of type `!quant.uniform`.\n\n - The result type must be a floating-point scalar or tensor.\n\n - The `expressedType` parameter of the `!quant.uniform` type of the input\n must match the floating-point type of the result.\n\n - The operand and result types must be both scalars or both tensors. If\n tensors, they must be both ranked or both unranked. If ranked, both must\n have the same shape, including matching static and dynamic dimensions.\n\n - If the operand uses per-channel quantization, its `!quant.uniform` type\n must adhere to the [Per-axis quantization\n integrity](#per-axis-quantization-integrity) guidelines.\n\n Examples:\n\n ```\n // Dequantize a scalar quantized value\n %result = quant.dcast %input : !quant.uniform to f32\n\n // Dequantize a dynamically shaped tensor of quantized values\n %result = quant.dcast %input : tensor> to tensor\n\n // Dequantize an unranked tensor using per-axis quantization information\n %result = quant.dcast %input : tensor<*x!quant.uniform> to tensor<*xf32>\n ```", "operands": [ { "name": "input", "type": "quant_QuantizedScalarOrTensor" } ], "results": [ { "name": "result", "type": "quant_FloatScalarOrTensor" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($result)" }, { "name": "quant.qcast", "summary": "Quantize cast operation", "description": "Convert a floating-point value to a quantized type. The quantization\n process consists of the following steps:\n\n ```\n def quantize(expressedValue: expressedType) -> quantizedType:\n zeroPointFloat = convertIntToFloat(zeroPoint, expressedType)\n scaledValue = expressedValue / scale\n storedValueFloat = scaledValue + zeroPointFloat\n storedValue = convertFloatToInt(storedValueFloat, storageType)\n storedValueClamped = clamp(storedValue, storageMin, storageMax)\n quantizedValue = reinterpretCast(storedValueClamped, quantizedType)\n return quantizedValue\n ```\n\n Here, `storageType`, `storageMin`, `storageMax`, `expressedType`, `scale`,\n and `zeroPoint` are obtained from the corresponding parameters encoded in\n `quantizedType`. For per-channel quantization, the appropriate `scale` and\n `zeroPoint` values are used for each tensor element computation according\n to the channel the element belongs to.\n\n The numerical results produced by the algorithm above may vary depending on\n the rounding methods used by `convertIntToFloat()`, `convertFloatToInt()`,\n `clamp()`, division (`/`), and addition (`+`). This operation does not\n define specific rounding methods; instead, it is the responsibility of a\n transform pipeline to determine which rounding method to apply when this\n operation is broken down into lower-level dialects.\n\n The operation must satisfy the following syntactic constraints:\n\n - Operand `input` must be a floating-point scalar or tensor.\n\n - The result type must be a scalar or tensor of type `!quant.uniform`.\n\n - The `expressedType` parameter in the `!quant.uniform` type of the result\n must match the floating-point type of the input.\n\n - The operand and result types must be both scalars or both tensors. If\n tensors, they must be both ranked or both unranked. If ranked, both must\n have the same shape, including matching static and dynamic dimensions.\n\n - If the result uses per-channel quantization, its `!quant.uniform` type\n must adhere to the [Per-axis quantization\n integrity](#per-axis-quantization-integrity) guidelines.\n\n Examples:\n\n ```\n // Quantize a scalar floating-point value\n %result = quant.qcast %input : f32 to !quant.uniform\n\n // Quantize a dynamically shaped tensor of quantized values\n %result = quant.qcast %input : tensor to tensor>\n\n // Quantize an unranked tensor using per-axis quantization information\n %result = quant.qcast %input : tensor<*xf32> to tensor<*x!quant.uniform>\n ```", "operands": [ { "name": "input", "type": "quant_FloatScalarOrTensor" } ], "results": [ { "name": "result", "type": "quant_QuantizedScalarOrTensor" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($result)" }, { "name": "quant.scast", "summary": "Storage cast operation", "description": "Convert a value from a quantized type to the corresponding signless integer\n storage type, or vice versa. This conversion simply involves a\n reinterpretation of the input bits and does not involve any data\n manipulation.\n\n The following syntactic restrictions must be met:\n\n - Operand `input` must be a scalar or tensor of a signless integer or\n `!quant.uniform` type.\n\n - The result must be a scalar or tensor of a signless integer or\n `!quant.uniform` type.\n\n - If the operand is a scalar or tensor of type integer, the result must be\n a scalar or tensor of type `!quant.uniform`, and vice versa.\n\n - The operand and result must be both scalars or both tensors. If tensors,\n they must be both ranked or both unranked. If ranked, both must have the\n same shape, including matching static and dynamic dimensions.\n\n - The width of the `storageType` parameter of the quantized type of the\n operand or result must match the width of the signless integer type of\n the operand or result.\n\n - If the operand or result uses per-channel quantization, its\n `!quant.uniform` type must adhere to the [Per-axis quantization\n integrity](#per-axis-quantization-integrity) guidelines.\n\n Examples:\n\n ```\n // Cast a scalar quantized value into its storage type\n %result = quant.scast %input : !quant.uniform to i8\n\n // Cast a dynamically shaped tensor of quantized values into their storage type\n %result = quant.scast %input : tensor> to tensor\n\n // Cast an unranked tensor of signless integers into a quantized type using\n // per-channel quantization\n %result = quant.scast %input : tensor<*xi8> to tensor<*x!quant.uniform>\n ```", "operands": [ { "name": "input", "type": "quant_IntegerOrQuantizedScalarOrTensor" } ], "results": [ { "name": "result", "type": "quant_IntegerOrQuantizedScalarOrTensor" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($result)" }, { "name": "rocdl.asyncmark", "summary": "Mark the end of a group of asynchronous operations", "description": "This operation, in conjunction with `rocdl.wait.asyncmark`, forms the\n compiler-provided framework for tracking explicitly asynchronous\n memory operations, such as copies to LDS that use async intrinsics\n and gfx1250's tensor loads.\n\n Details of its behavior can be found in\n [the LLVM documentation on async tracking](/llvm/docs/AMDGPUAsyncOperations.rst).\n\n See `rocdl.wait.asyncmark`'s documentation for a usage example.\n\n Example:\n ```mlir\n // Mark the end of an async operation group.\n rocdl.asyncmark\n ```\n\n Available on gfx9 and later.", "assemblyFormat": "attr-dict" }, { "name": "rocdl.ballot", "summary": "Vote across thread group", "description": "Ballot provides a bit mask containing the 1-bit predicate value from each lane.\n The nth bit of the result contains the 1 bit contributed by the nth warp lane.\n\n Example:\n ```mlir\n // Ballot across thread group.\n %0 = rocdl.ballot %pred : i64\n ```", "operands": [ { "name": "pred", "type": "I1" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "$pred attr-dict `:` type($res)" }, { "name": "rocdl.barrier", "description": "An operation with the same expansion as HIP's __synchthreads();\n\n **DEPRECATION NOTICE**: Use `gpu.barrier`, which will expand to these\n operations, instead.\n\n Example:\n ```mlir\n // Workgroup barrier with acquire/release fences.\n rocdl.barrier\n ```", "assemblyFormat": "attr-dict" }, { "name": "rocdl.cluster.id.x", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.cluster.id.y", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.cluster.id.z", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.cluster.load.async.to.lds.b128", "description": "Broadcasts memory load ofbits of data for a cluster of workgroups.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Cluster broadcastbitsVal-bit load to LDS.\n rocdl.cluster.load.async.to.lds.b128%src, %dst, 0, 0, %mask : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" }, { "name": "mask", "type": "I32" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "cpol", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($cpol) `,` $mask\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.cluster.load.async.to.lds.b32", "description": "Broadcasts memory load ofbits of data for a cluster of workgroups.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Cluster broadcastbitsVal-bit load to LDS.\n rocdl.cluster.load.async.to.lds.b32%src, %dst, 0, 0, %mask : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" }, { "name": "mask", "type": "I32" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "cpol", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($cpol) `,` $mask\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.cluster.load.async.to.lds.b64", "description": "Broadcasts memory load ofbits of data for a cluster of workgroups.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Cluster broadcastbitsVal-bit load to LDS.\n rocdl.cluster.load.async.to.lds.b64%src, %dst, 0, 0, %mask : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" }, { "name": "mask", "type": "I32" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "cpol", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($cpol) `,` $mask\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.cluster.load.async.to.lds.b8", "description": "Broadcasts memory load ofbits of data for a cluster of workgroups.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Cluster broadcastbitsVal-bit load to LDS.\n rocdl.cluster.load.async.to.lds.b8%src, %dst, 0, 0, %mask : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" }, { "name": "mask", "type": "I32" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "cpol", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($cpol) `,` $mask\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.cluster.workgroup.id.x", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.cluster.workgroup.id.y", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.cluster.workgroup.id.z", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.cos", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.cos%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.cvt.f32.bf8", "summary": "Convert bf8 to f32", "description": "Convert 8-bit bf8 value from the `byteSel`th bit of `srcA` to fp32.\n\n Example:\n ```mlir\n // Convert bf8 byte 0 to f32.\n %0 = rocdl.cvt.f32.bf8 %src[0] : f32\n ```", "operands": [ { "name": "srcA", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "byteSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $srcA `[` $byteSel `]` `:` type($res)" }, { "name": "rocdl.cvt.f32.fp8", "summary": "Convert fp8 to f32", "description": "Convert 8-bit fp8 value from the `byteSel`th bit of `srcA` to fp32.\n\n Example:\n ```mlir\n // Convert fp8 byte 0 to f32.\n %0 = rocdl.cvt.f32.fp8 %src[0] : f32\n ```", "operands": [ { "name": "srcA", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "byteSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $srcA `[` $byteSel `]` `:` type($res)" }, { "name": "rocdl.cvt.pk.bf8.f32", "summary": "Convert two f32's to bf8", "description": "Convert `srcA` and `srcB` to bf8 and store into the low/high word of\n `old`, preserving the other word.\n\n Example:\n ```mlir\n // Pack two f32 values into bf8 in the low word of old.\n %0 = rocdl.cvt.pk.bf8.f32 %a, %b -> %old[false] : i32\n ```", "operands": [ { "name": "srcA", "type": "F32" }, { "name": "srcB", "type": "F32" }, { "name": "old", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "wordSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $srcA `,` $srcB `->` $old `[` $wordSel `]` `:` type($res)" }, { "name": "rocdl.cvt.pk.f32.bf8", "summary": "Convert packed bf8 to packed f32", "description": "Convert `src` based on $wordSel to packed fp32.\n\n Example:\n ```mlir\n // Unpack bf8 word to packed f32.\n %0 = rocdl.cvt.pk.f32.bf8 %src[false] : vector<2xf32>\n ```", "operands": [ { "name": "src", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "wordSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $wordSel `]` `:` type($res)" }, { "name": "rocdl.cvt.pk.f32.fp8", "summary": "Convert packed fp8 to packed f32", "description": "Convert `src` based on $wordSel to packed fp32.\n\n Example:\n ```mlir\n // Unpack fp8 word to packed f32.\n %0 = rocdl.cvt.pk.f32.fp8 %src[false] : vector<2xf32>\n ```", "operands": [ { "name": "src", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "wordSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $wordSel `]` `:` type($res)" }, { "name": "rocdl.cvt.pk.fp8.f32", "summary": "Convert two f32's to fp8", "description": "Convert `srcA` and `srcB` to fp8 and store into the low/high word of\n `old`, preserving the other word.\n\n Example:\n ```mlir\n // Pack two f32 values into fp8 in the low word of old.\n %0 = rocdl.cvt.pk.fp8.f32 %a, %b -> %old[false] : i32\n ```", "operands": [ { "name": "srcA", "type": "F32" }, { "name": "srcB", "type": "F32" }, { "name": "old", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "wordSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $srcA `,` $srcB `->` $old `[` $wordSel `]` `:` type($res)" }, { "name": "rocdl.cvt.pkrtz", "summary": "Convert two f32 input into a vector<2xf16>", "description": "Convert two f32 values into a packed vector<2xf16>.\n\n Example:\n ```mlir\n // Pack two f32 values into a vector<2xf16> with round-to-zero.\n %0 = rocdl.cvt.pkrtz %a, %b : vector<2xf16>\n ```", "operands": [ { "name": "srcA", "type": "F32" }, { "name": "srcB", "type": "F32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "assemblyFormat": "attr-dict $srcA `,` $srcB `:` type($res)" }, { "name": "rocdl.cvt.scale.pk16.bf16.bf6", "summary": "Scales 16 bf6 and converts them to 16 bf16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V3I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V16BF16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk16.bf16.fp6", "summary": "Scales 16 fp6 and converts them to 16 bf16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V3I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V16BF16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk16.f16.bf6", "summary": "Scales 16 bf6 and converts them to 16 f16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V3I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V16F16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk16.f16.fp6", "summary": "Scales 16 fp6 and converts them to 16 f16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V3I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V16F16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk16.f32.bf6", "summary": "Scales 16 bf6 and converts them to 16 f32.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V3I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V16F32Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk16.f32.fp6", "summary": "Scales 16 fp6 and converts them to 16 f32.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V3I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V16F32Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.bf16.bf8", "summary": "Scales 8 bf8 and converts them to 8 bf16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V2I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8BF16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.bf16.fp4", "summary": "Scales 8 fp4 and converts them to 8 bf16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8BF16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.bf16.fp8", "summary": "Scales 8 fp8 and converts them to 8 bf16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V2I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8BF16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.f16.bf8", "summary": "Scales 8 bf8 and converts them to 8 f16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V2I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8F16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.f16.fp4", "summary": "Scales 8 fp4 and converts them to 8 f16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8F16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.f16.fp8", "summary": "Scales 8 fp8 and converts them to 8 f16.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V2I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8F16Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.f32.bf8", "summary": "Scales 8 bf8 and converts them to 8 f32.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V2I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8F32Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.f32.fp4", "summary": "Scales 8 fp4 and converts them to 8 f32.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8F32Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scale.pk8.f32.fp8", "summary": "Scales 8 fp8 and converts them to 8 f32.", "description": "Available on gfx1250+.", "operands": [ { "name": "src", "type": "ROCDL_V2I32Type" }, { "name": "scale", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_V8F32Type" } ], "attributes": [ { "name": "scaleSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `[` $scaleSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.2xpk16.bf6.f32", "summary": "Scale and convert two vector<16xf32> to 32 packed bf6", "description": "Convert 32 single-precision float values, packed into two length-16\n vectors that will be logically concanenated, to packedbf6, dividing by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src0", "type": "ROCDL_V16F32Type" }, { "name": "src1", "type": "ROCDL_V16F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src0 `,` $src1 `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.2xpk16.fp6.f32", "summary": "Scale and convert two vector<16xf32> to 32 packed fp6", "description": "Convert 32 single-precision float values, packed into two length-16\n vectors that will be logically concanenated, to packedfp6, dividing by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src0", "type": "ROCDL_V16F32Type" }, { "name": "src1", "type": "ROCDL_V16F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src0 `,` $src1 `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.f16.bf8", "summary": "Scaled convert bf8 from packed vector to f16, updating tied result", "description": "Convert abf8byte from `src`, selected by\n `srcSelIndex`, to f16 while multiplying it by the expontent of `scale`,\n and place it into the `dstLoHiSel`th bit\n of `oldVdst` preserving the other element of that vector in\n the return value.\n\n The bytes are stored as an `i32` and not a `<4 x i8>`.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2F16Type" }, { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F16Type" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" }, { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.f16.fp8", "summary": "Scaled convert fp8 from packed vector to f16, updating tied result", "description": "Convert afp8byte from `src`, selected by\n `srcSelIndex`, to f16 while multiplying it by the expontent of `scale`,\n and place it into the `dstLoHiSel`th bit\n of `oldVdst` preserving the other element of that vector in\n the return value.\n\n The bytes are stored as an `i32` and not a `<4 x i8>`.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2F16Type" }, { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F16Type" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" }, { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.f32.bf8", "summary": "Scaled convert bf8 from packed vector to f32", "description": "Convert abf8byte from `src`, selected by\n `srcSelIndex`, to f32, multiplying it by the exponent of `scale`.\n\n The bytes are stored in an `i32`, not a `<4 x i8>`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.f32.fp8", "summary": "Scaled convert fp8 from packed vector to f32", "description": "Convert afp8byte from `src`, selected by\n `srcSelIndex`, to f32, multiplying it by the exponent of `scale`.\n\n The bytes are stored in an `i32`, not a `<4 x i8>`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "F32" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.bf16.bf8", "summary": "Scaled convert two bf8to two bf16", "description": "Convert two packedbf8values in `src0` to twobf16values, multiplying by the exponent in `scale`.\n The two values to be converted are selected from the low or high half\n of `src` (a packed vector represented as an `i32`)\n on the basis of `srcLoHiSel`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2BF16Type" } ], "attributes": [ { "name": "srcLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcLoHiSel `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.bf16.fp4", "summary": "Scale and convert two packed fp4 to packed bf16", "description": "Convert two packed fp4 (f4E2M1) values stored as one byte of a 32-bit integer\n to packedbf16, multiplying by the exponent part of `scale`\n before doing so.\n\n The byte to convert is chosen by `srcSelIndex`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2BF16Type" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.bf16.fp8", "summary": "Scaled convert two fp8to two bf16", "description": "Convert two packedfp8values in `src0` to twobf16values, multiplying by the exponent in `scale`.\n The two values to be converted are selected from the low or high half\n of `src` (a packed vector represented as an `i32`)\n on the basis of `srcLoHiSel`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2BF16Type" } ], "attributes": [ { "name": "srcLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcLoHiSel `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.bf8.bf16", "summary": "Scaled convert two bf16to two bf8, updating packed vector", "description": "Convert twobf16values in `src0` to twobf8bytes, dividing by the exponent in `scale`. The bytes are\n packed into a 16-bit value which is inserted into `oldVdst` at the\n `dstLoHiSel` position, with the entire updated vector being returned.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2I16Type" }, { "name": "src0", "type": "ROCDL_V2BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I16Type" } ], "attributes": [ { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.bf8.f16", "summary": "Scaled convert two f16to two bf8, updating packed vector", "description": "Convert twof16values in `src0` to twobf8bytes, dividing by the exponent in `scale`. The bytes are\n packed into a 16-bit value which is inserted into `oldVdst` at the\n `dstLoHiSel` position, with the entire updated vector being returned.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2I16Type" }, { "name": "src0", "type": "ROCDL_V2F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I16Type" } ], "attributes": [ { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.bf8.f32", "summary": "Scaled convert two f32 to two bf8, updating packed vector", "description": "Convert two f32 values in `src0` and `src1` to twobf8bytes,\n dividing by the exponent in `scale`. The bytes are packed into\n a 16-bit value which is inserted into `oldVdst` at the `dstLoHiSel`\n position, with the entire updated vector being returned.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2I16Type" }, { "name": "src0", "type": "F32" }, { "name": "src1", "type": "F32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I16Type" } ], "attributes": [ { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $src1 `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.f16.bf8", "summary": "Scaled convert two bf8to two f16", "description": "Convert two packedbf8values in `src0` to twof16values, multiplying by the exponent in `scale`.\n The two values to be converted are selected from the low or high half\n of `src` (a packed vector represented as an `i32`)\n on the basis of `srcLoHiSel`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F16Type" } ], "attributes": [ { "name": "srcLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcLoHiSel `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.f16.fp4", "summary": "Scale and convert two packed fp4 to packed f16", "description": "Convert two packed fp4 (f4E2M1) values stored as one byte of a 32-bit integer\n to packedf16, multiplying by the exponent part of `scale`\n before doing so.\n\n The byte to convert is chosen by `srcSelIndex`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F16Type" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.f16.fp8", "summary": "Scaled convert two fp8to two f16", "description": "Convert two packedfp8values in `src0` to twof16values, multiplying by the exponent in `scale`.\n The two values to be converted are selected from the low or high half\n of `src` (a packed vector represented as an `i32`)\n on the basis of `srcLoHiSel`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F16Type" } ], "attributes": [ { "name": "srcLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcLoHiSel `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.f32.bf8", "summary": "Scaled convert two bf8to two f32", "description": "Convert two packedbf8values in `src0` to twof32values, multiplying by the exponent in `scale`.\n The two values to be converted are selected from the low or high half\n of `src` (a packed vector represented as an `i32`)\n on the basis of `srcLoHiSel`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F32Type" } ], "attributes": [ { "name": "srcLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcLoHiSel `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.f32.fp4", "summary": "Scale and convert two packed fp4 to packed f32", "description": "Convert two packed fp4 (f4E2M1) values stored as one byte of a 32-bit integer\n to packedf32, multiplying by the exponent part of `scale`\n before doing so.\n\n The byte to convert is chosen by `srcSelIndex`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F32Type" } ], "attributes": [ { "name": "srcSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcSelIndex `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.f32.fp8", "summary": "Scaled convert two fp8to two f32", "description": "Convert two packedfp8values in `src0` to twof32values, multiplying by the exponent in `scale`.\n The two values to be converted are selected from the low or high half\n of `src` (a packed vector represented as an `i32`)\n on the basis of `srcLoHiSel`.", "operands": [ { "name": "src", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2F32Type" } ], "attributes": [ { "name": "srcLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src `[` $srcLoHiSel `]` `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.fp4.bf16", "summary": "Scale and convert two bf16 to packed fp4, updating tied vector", "description": "Convert two packedbf16values to packed\n fp4, dividing by the exponent part of `scale`\n before doing so.\n\n The two scaled values are packed into a byte.\n That byte is used to update the `dstSelIndex`th\n byte of `oldVdst`, which is returned in its entirity.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src", "type": "ROCDL_V2BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.fp4.f16", "summary": "Scale and convert two f16 to packed fp4, updating tied vector", "description": "Convert two packedf16values to packed\n fp4, dividing by the exponent part of `scale`\n before doing so.\n\n The two scaled values are packed into a byte.\n That byte is used to update the `dstSelIndex`th\n byte of `oldVdst`, which is returned in its entirity.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src", "type": "ROCDL_V2F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.fp4.f32", "summary": "Scale and convert two f32 values to two packed fp4, updating tied vector", "description": "Convert two single-precision float values, passed in `src0` and `src1`\n into two fp4 values, dividing them by the expontent part of `scale`\n before doing so.\n\n The two scaled values are packed into a byte.\n That byte is used to update the `dstSelIndex`th\n byte of `oldVdst`, which is returned in its entirity.\n\n Example:\n ```mlir\n // Scaled convert two f32 values to packed fp4 in byte 0 of old.\n %0 = rocdl.cvt.scalef32.pk.fp4.f32 %a, %b, %scale -> %old[0] : i32\n ```", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "F32" }, { "name": "src1", "type": "F32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $src1 `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.fp8.bf16", "summary": "Scaled convert two bf16to two fp8, updating packed vector", "description": "Convert twobf16values in `src0` to twofp8bytes, dividing by the exponent in `scale`. The bytes are\n packed into a 16-bit value which is inserted into `oldVdst` at the\n `dstLoHiSel` position, with the entire updated vector being returned.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2I16Type" }, { "name": "src0", "type": "ROCDL_V2BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I16Type" } ], "attributes": [ { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.fp8.f16", "summary": "Scaled convert two f16to two fp8, updating packed vector", "description": "Convert twof16values in `src0` to twofp8bytes, dividing by the exponent in `scale`. The bytes are\n packed into a 16-bit value which is inserted into `oldVdst` at the\n `dstLoHiSel` position, with the entire updated vector being returned.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2I16Type" }, { "name": "src0", "type": "ROCDL_V2F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I16Type" } ], "attributes": [ { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk.fp8.f32", "summary": "Scaled convert two f32 to two fp8, updating packed vector", "description": "Convert two f32 values in `src0` and `src1` to twofp8bytes,\n dividing by the exponent in `scale`. The bytes are packed into\n a 16-bit value which is inserted into `oldVdst` at the `dstLoHiSel`\n position, with the entire updated vector being returned.", "operands": [ { "name": "oldVdst", "type": "ROCDL_V2I16Type" }, { "name": "src0", "type": "F32" }, { "name": "src1", "type": "F32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I16Type" } ], "attributes": [ { "name": "dstLoHiSel", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $src1 `,` $scale `->` $oldVdst `[` $dstLoHiSel `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk16.bf6.bf16", "summary": "Scale and convert packed bf16 to packed bf6", "description": "Convert 8 packedbf16values to packedbf6, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk16.bf6.f16", "summary": "Scale and convert packed f16 to packed bf6", "description": "Convert 8 packedf16values to packedbf6, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk16.bf6.f32", "summary": "Scale and convert packed f32 to packed bf6", "description": "Convert 8 packedf32values to packedbf6, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk16.fp6.bf16", "summary": "Scale and convert packed bf16 to packed fp6", "description": "Convert 8 packedbf16values to packedfp6, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk16.fp6.f16", "summary": "Scale and convert packed f16 to packed fp6", "description": "Convert 8 packedf16values to packedfp6, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk16.fp6.f32", "summary": "Scale and convert packed f32 to packed fp6", "description": "Convert 8 packedf32values to packedfp6, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.bf16.bf6", "summary": "Scale and convert packed bf6 to packed bf16", "description": "Convert 32 packedbf6values to packedbf16, multiplying by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V6I32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V32BF16Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.bf16.fp6", "summary": "Scale and convert packed fp6 to packed bf16", "description": "Convert 32 packedfp6values to packedbf16, multiplying by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V6I32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V32BF16Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.bf6.bf16", "summary": "Scale and convert packed bf16 to packed bf6", "description": "Convert 32 packedbf16values to packedbf6, dividing by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V32BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.bf6.f16", "summary": "Scale and convert packed f16 to packed bf6", "description": "Convert 32 packedf16values to packedbf6, dividing by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V32F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.f16.bf6", "summary": "Scale and convert packed bf6 to packed f16", "description": "Convert 32 packedbf6values to packedf16, multiplying by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V6I32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V32F16Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.f16.fp6", "summary": "Scale and convert packed fp6 to packed f16", "description": "Convert 32 packedfp6values to packedf16, multiplying by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V6I32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V32F16Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.f32.bf6", "summary": "Scale and convert packed bf6 to packed f32", "description": "Convert 32 packedbf6values to packedf32, multiplying by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V6I32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V32F32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.f32.fp6", "summary": "Scale and convert packed fp6 to packed f32", "description": "Convert 32 packedfp6values to packedf32, multiplying by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V6I32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V32F32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.fp6.bf16", "summary": "Scale and convert packed bf16 to packed fp6", "description": "Convert 32 packedbf16values to packedfp6, dividing by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V32BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk32.fp6.f16", "summary": "Scale and convert packed f16 to packed fp6", "description": "Convert 32 packedf16values to packedfp6, dividing by the exponent part of `scale`\n before doing so.", "operands": [ { "name": "src", "type": "ROCDL_V32F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.bf8.bf16", "summary": "Scale and convert packed bf16 to packed bf8", "description": "Convert 8 packedbf16values to packedbf8, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.bf8.f16", "summary": "Scale and convert packed f16 to packed bf8", "description": "Convert 8 packedf16values to packedbf8, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.bf8.f32", "summary": "Scale and convert packed f32 to packed bf8", "description": "Convert 8 packedf32values to packedbf8, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.fp4.bf16", "summary": "Scale and convert packed bf16 to packed fp4", "description": "Convert 8 packedbf16values to packedfp4, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.fp4.f16", "summary": "Scale and convert packed f16 to packed fp4", "description": "Convert 8 packedf16values to packedfp4, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.fp4.f32", "summary": "Scale and convert packed f32 to packed fp4", "description": "Convert 8 packedf32values to packedfp4, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.fp8.bf16", "summary": "Scale and convert packed bf16 to packed fp8", "description": "Convert 8 packedbf16values to packedfp8, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8BF16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.fp8.f16", "summary": "Scale and convert packed f16 to packed fp8", "description": "Convert 8 packedf16values to packedfp8, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F16Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.pk8.fp8.f32", "summary": "Scale and convert packed f32 to packed fp8", "description": "Convert 8 packedf32values to packedfp8, multiplying by the exponent part of `scale`\n before doing so. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F32Type" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.bf8.bf16", "summary": "Scaled convert bf16to bf8 with stochiastic rounding, updating packed vector", "description": "Convert abf16value in `src0` to abf8bytes, dividing by the exponent in `scale` and using `seed`\n for stochiastic rounding. Place the resulting byte in the\n `dstSelIndex`th bit of `oldVdst` and return the entire packed vector,\n which is stored as an `i32`.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "BF16" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.bf8.f16", "summary": "Scaled convert f16to bf8 with stochiastic rounding, updating packed vector", "description": "Convert af16value in `src0` to abf8bytes, dividing by the exponent in `scale` and using `seed`\n for stochiastic rounding. Place the resulting byte in the\n `dstSelIndex`th bit of `oldVdst` and return the entire packed vector,\n which is stored as an `i32`.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "F16" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.bf8.f32", "summary": "Scaled convert f32to bf8 with stochiastic rounding, updating packed vector", "description": "Convert af32value in `src0` to abf8bytes, dividing by the exponent in `scale` and using `seed`\n for stochiastic rounding. Place the resulting byte in the\n `dstSelIndex`th bit of `oldVdst` and return the entire packed vector,\n which is stored as an `i32`.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "F32" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.fp8.bf16", "summary": "Scaled convert bf16to fp8 with stochiastic rounding, updating packed vector", "description": "Convert abf16value in `src0` to afp8bytes, dividing by the exponent in `scale` and using `seed`\n for stochiastic rounding. Place the resulting byte in the\n `dstSelIndex`th bit of `oldVdst` and return the entire packed vector,\n which is stored as an `i32`.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "BF16" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.fp8.f16", "summary": "Scaled convert f16to fp8 with stochiastic rounding, updating packed vector", "description": "Convert af16value in `src0` to afp8bytes, dividing by the exponent in `scale` and using `seed`\n for stochiastic rounding. Place the resulting byte in the\n `dstSelIndex`th bit of `oldVdst` and return the entire packed vector,\n which is stored as an `i32`.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "F16" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.fp8.f32", "summary": "Scaled convert f32to fp8 with stochiastic rounding, updating packed vector", "description": "Convert af32value in `src0` to afp8bytes, dividing by the exponent in `scale` and using `seed`\n for stochiastic rounding. Place the resulting byte in the\n `dstSelIndex`th bit of `oldVdst` and return the entire packed vector,\n which is stored as an `i32`.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src0", "type": "F32" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src0 `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk.fp4.bf16", "summary": "Scale and convert two bf16 to packed fp4 with stochiastic rounding, updating tied vector", "description": "Convert two packedbf16values to packed\n fp4, dividing by the exponent part of `scale`\n before doing so and using `seed` as the random seed for\n stochiastic rounding.\n\n The two scaled values are packed (little-endian)\n into a byte. That byte is used to update the `dstSelIndex`th\n byte of `oldVdst`, which is returned in its entirity.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src", "type": "ROCDL_V2BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk.fp4.f16", "summary": "Scale and convert two f16 to packed fp4 with stochiastic rounding, updating tied vector", "description": "Convert two packedf16values to packed\n fp4, dividing by the exponent part of `scale`\n before doing so and using `seed` as the random seed for\n stochiastic rounding.\n\n The two scaled values are packed (little-endian)\n into a byte. That byte is used to update the `dstSelIndex`th\n byte of `oldVdst`, which is returned in its entirity.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src", "type": "ROCDL_V2F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk.fp4.f32", "summary": "Scale and convert two f32 to packed fp4 with stochiastic rounding, updating tied vector", "description": "Convert two packedf32values to packed\n fp4, dividing by the exponent part of `scale`\n before doing so and using `seed` as the random seed for\n stochiastic rounding.\n\n The two scaled values are packed (little-endian)\n into a byte. That byte is used to update the `dstSelIndex`th\n byte of `oldVdst`, which is returned in its entirity.", "operands": [ { "name": "oldVdst", "type": "I32" }, { "name": "src", "type": "ROCDL_V2F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "dstSelIndex", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `->` $oldVdst `[` $dstSelIndex `]` `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk16.bf6.bf16", "summary": "Scale and convert packed bf16 to packed bf6 with stochastic rounding", "description": "Convert 8 packedbf16values to packedbf6, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk16.bf6.f16", "summary": "Scale and convert packed f16 to packed bf6 with stochastic rounding", "description": "Convert 8 packedf16values to packedbf6, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk16.bf6.f32", "summary": "Scale and convert packed f32 to packed bf6 with stochastic rounding", "description": "Convert 8 packedf32values to packedbf6, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk16.fp6.bf16", "summary": "Scale and convert packed bf16 to packed fp6 with stochastic rounding", "description": "Convert 8 packedbf16values to packedfp6, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk16.fp6.f16", "summary": "Scale and convert packed f16 to packed fp6 with stochastic rounding", "description": "Convert 8 packedf16values to packedfp6, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk16.fp6.f32", "summary": "Scale and convert packed f32 to packed fp6 with stochastic rounding", "description": "Convert 8 packedf32values to packedfp6, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V16F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V3I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk32.bf6.bf16", "summary": "Scale and convert packed bf16 to packed bf6 with stochiastic rounding", "description": "Convert 32 packedbf16values to packedbf6, dividing by the exponent part of `scale`\n before doing so and applying random rounding derived from\n `seed`.", "operands": [ { "name": "src", "type": "ROCDL_V32BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk32.bf6.f16", "summary": "Scale and convert packed f16 to packed bf6 with stochiastic rounding", "description": "Convert 32 packedf16values to packedbf6, dividing by the exponent part of `scale`\n before doing so and applying random rounding derived from\n `seed`.", "operands": [ { "name": "src", "type": "ROCDL_V32F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk32.bf6.f32", "summary": "Scale and convert packed f32 to packed bf6 with stochiastic rounding", "description": "Convert 32 packedf32values to packedbf6, dividing by the exponent part of `scale`\n before doing so and applying random rounding derived from\n `seed`.", "operands": [ { "name": "src", "type": "ROCDL_V32F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk32.fp6.bf16", "summary": "Scale and convert packed bf16 to packed fp6 with stochiastic rounding", "description": "Convert 32 packedbf16values to packedfp6, dividing by the exponent part of `scale`\n before doing so and applying random rounding derived from\n `seed`.", "operands": [ { "name": "src", "type": "ROCDL_V32BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk32.fp6.f16", "summary": "Scale and convert packed f16 to packed fp6 with stochiastic rounding", "description": "Convert 32 packedf16values to packedfp6, dividing by the exponent part of `scale`\n before doing so and applying random rounding derived from\n `seed`.", "operands": [ { "name": "src", "type": "ROCDL_V32F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk32.fp6.f32", "summary": "Scale and convert packed f32 to packed fp6 with stochiastic rounding", "description": "Convert 32 packedf32values to packedfp6, dividing by the exponent part of `scale`\n before doing so and applying random rounding derived from\n `seed`.", "operands": [ { "name": "src", "type": "ROCDL_V32F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V6I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.bf8.bf16", "summary": "Scale and convert packed bf16 to packed bf8 with stochastic rounding", "description": "Convert 8 packedbf16values to packedbf8, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.bf8.f16", "summary": "Scale and convert packed f16 to packed bf8 with stochastic rounding", "description": "Convert 8 packedf16values to packedbf8, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.bf8.f32", "summary": "Scale and convert packed f32 to packed bf8 with stochastic rounding", "description": "Convert 8 packedf32values to packedbf8, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.fp4.bf16", "summary": "Scale and convert packed bf16 to packed fp4 with stochastic rounding", "description": "Convert 8 packedbf16values to packedfp4, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.fp4.f16", "summary": "Scale and convert packed f16 to packed fp4 with stochastic rounding", "description": "Convert 8 packedf16values to packedfp4, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.fp4.f32", "summary": "Scale and convert packed f32 to packed fp4 with stochastic rounding", "description": "Convert 8 packedf32values to packedfp4, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.fp8.bf16", "summary": "Scale and convert packed bf16 to packed fp8 with stochastic rounding", "description": "Convert 8 packedbf16values to packedfp8, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8BF16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.fp8.f16", "summary": "Scale and convert packed f16 to packed fp8 with stochastic rounding", "description": "Convert 8 packedf16values to packedfp8, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F16Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.scalef32.sr.pk8.fp8.f32", "summary": "Scale and convert packed f32 to packed fp8 with stochastic rounding", "description": "Convert 8 packedf32values to packedfp8, multiplying by the exponent part of `scale`\n before doing so and apply stochastic rounding. This op is for gfx1250+ arch.", "operands": [ { "name": "src", "type": "ROCDL_V8F32Type" }, { "name": "seed", "type": "I32" }, { "name": "scale", "type": "F32" } ], "results": [ { "name": "res", "type": "ROCDL_V2I32Type" } ], "assemblyFormat": "attr-dict $src `,` $seed `,` $scale `:` type($res)" }, { "name": "rocdl.cvt.sr.bf8.f32", "summary": "Convert f32 to bf8, stochiastic rounding", "description": "Convert `srcA` to bf8, adding the rounding factor from `srcB`,\n and store into the `byteSel`th byte of `old`, preserving the others.\n\n Example:\n ```mlir\n // Stochastic rounding convert f32 to bf8 in byte 2 of old.\n %0 = rocdl.cvt.sr.bf8.f32 %val, %stoch -> %old[2] : i32\n ```", "operands": [ { "name": "srcA", "type": "F32" }, { "name": "srcB", "type": "I32" }, { "name": "old", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "byteSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $srcA `,` $srcB `->` $old `[` $byteSel `]` `:` type($res)" }, { "name": "rocdl.cvt.sr.fp8.f32", "summary": "Convert f32 to fp8, stochiastic rounding", "description": "Convert `srcA` to fp8, adding the rounding factor from `srcB`,\n and store into the `byteSel`th byte of `old`, preserving the others.\n\n Example:\n ```mlir\n // Stochastic rounding convert f32 to fp8 in byte 3 of old.\n %0 = rocdl.cvt.sr.fp8.f32 %val, %stoch -> %old[3] : i32\n ```", "operands": [ { "name": "srcA", "type": "F32" }, { "name": "srcB", "type": "I32" }, { "name": "old", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "byteSel", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $srcA `,` $srcB `->` $old `[` $byteSel `]` `:` type($res)" }, { "name": "rocdl.dot4.f32.bf8.bf8", "description": "Packed intra-lane dot-product with no clamp control.\n Computes `res = sum_i a[i]*b[i] + c`. Covers the full-f16/bf16\n accumulator forms (`fdot2.f16.f16`, `fdot2.bf16.bf16`) and the\n FP8/BF8 `dot4.f32.*` variants, whose hardware instructions have no\n CLAMP bit in their modifier word.\n\n Example:\n ```mlir\n %r = rocdl.dot4.f32.bf8.bf8%a, %b, %c : (i32,i32,f32) ->f32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.dot4.f32.bf8.fp8", "description": "Packed intra-lane dot-product with no clamp control.\n Computes `res = sum_i a[i]*b[i] + c`. Covers the full-f16/bf16\n accumulator forms (`fdot2.f16.f16`, `fdot2.bf16.bf16`) and the\n FP8/BF8 `dot4.f32.*` variants, whose hardware instructions have no\n CLAMP bit in their modifier word.\n\n Example:\n ```mlir\n %r = rocdl.dot4.f32.bf8.fp8%a, %b, %c : (i32,i32,f32) ->f32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.dot4.f32.fp8.bf8", "description": "Packed intra-lane dot-product with no clamp control.\n Computes `res = sum_i a[i]*b[i] + c`. Covers the full-f16/bf16\n accumulator forms (`fdot2.f16.f16`, `fdot2.bf16.bf16`) and the\n FP8/BF8 `dot4.f32.*` variants, whose hardware instructions have no\n CLAMP bit in their modifier word.\n\n Example:\n ```mlir\n %r = rocdl.dot4.f32.fp8.bf8%a, %b, %c : (i32,i32,f32) ->f32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.dot4.f32.fp8.fp8", "description": "Packed intra-lane dot-product with no clamp control.\n Computes `res = sum_i a[i]*b[i] + c`. Covers the full-f16/bf16\n accumulator forms (`fdot2.f16.f16`, `fdot2.bf16.bf16`) and the\n FP8/BF8 `dot4.f32.*` variants, whose hardware instructions have no\n CLAMP bit in their modifier word.\n\n Example:\n ```mlir\n %r = rocdl.dot4.f32.fp8.fp8%a, %b, %c : (i32,i32,f32) ->f32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.ds_bpermute", "description": "Perform a backward permute (pull) operation across lanes using DS/LDS permute hardware.\n\n Each lane reads the value of `src` from the lane whose byte address is\n given by `index` (i.e. lane id = `index / 4`).\n\n This is “backward” (pull) in contrast to `ds_permute_b32`, which is\n “forward” (push/scatter).\n\n Example:\n ```mlir\n // Backward permute across lanes (pull from selected lane).\n %0 = rocdl.ds_bpermute %index, %src : (i32, i32) -> i32\n ```", "operands": [ { "name": "index", "type": "I32" }, { "name": "src", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "$index `,` $src attr-dict `:` `(` type($index) `,` type($src) `)` `->` type($res)" }, { "name": "rocdl.ds_swizzle", "description": "Perform a data-sharing swizzle operation within a wavefront.\n\n The `offset` operand encodes the *swizzle pattern* that will be placed in the\n instruction's `offset` field (i.e., the pattern used by `ds_swizzle_b32`).\n See https://llvm.org/docs/AMDGPUModifierSyntax.html#swizzle-pattern for\n how this 16-bit pattern is constructed.\n\n Example:\n ```mlir\n // Swizzle data within a wavefront.\n %0 = rocdl.ds_swizzle %src, %offset : (i32, i32) -> i32\n ```", "operands": [ { "name": "src", "type": "I32" }, { "name": "offset", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "$src `,` $offset attr-dict `:` `(` type($src) `,` type($offset) `)` `->` type($res)" }, { "name": "rocdl.ds.atomic.async.barrier.arrive.b64", "description": "Waits on a given DS barrier and decrements pending count by -1.\n Stays in order with ASYNC loads to LDS, and uses ASYNCcnt to track its completion.\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Async atomic barrier arrive (fire-and-forget).\n rocdl.ds.atomic.async.barrier.arrive.b64 %ptr : !llvm.ptr<3>\n ```", "operands": [ { "name": "barrierPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$barrierPtr attr-dict `:` qualified(type($barrierPtr))" }, { "name": "rocdl.ds.atomic.barrier.arrive.rtn.b64", "description": "Waits on a given DS barrier and decrements its pending count by a given value. Note, the barrier state\n is given as a 64-bit structure containing pending count, phase and init count. The op returns the old\n barrier state. The op is executed as an ordinary LDS operations and it is ordered with other LDS operations.\n Thus, check DSCNT to determine when this instruction has executed.\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Atomic barrier arrive with return of old barrier state.\n %res = rocdl.ds.atomic.barrier.arrive.rtn.b64 %ptr, %val : !llvm.ptr<3>, i64 -> i64\n ```", "operands": [ { "name": "barrierPtr", "type": "ROCDLBufferLDS" }, { "name": "val", "type": "I64" } ], "results": [ { "name": "res", "type": "I64" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$barrierPtr `,` $val attr-dict `:` qualified(type($barrierPtr)) `,` type($val) `->` type($res)" }, { "name": "rocdl.ds.load.tr16.b128", "summary": "Loads and transposes a matrix from ds memory to registers (available in gfx1250+).", "description": "Load a matrix of16-bit data from thedsmemory,\n transpose data between row-major and column-major order,\n and store the result into a128-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<3>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.ds.load.tr4.b64", "summary": "Loads and transposes a matrix from ds memory to registers (available in gfx1250+).", "description": "Load a matrix of4-bit data from thedsmemory,\n transpose data between row-major and column-major order,\n and store the result into a64-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<3>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.ds.load.tr6.b96", "summary": "Loads and transposes a matrix from ds memory to registers (available in gfx1250+).", "description": "Load a matrix of6-bit data from thedsmemory,\n transpose data between row-major and column-major order,\n and store the result into a96-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<3>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.ds.load.tr8.b64", "summary": "Loads and transposes a matrix from ds memory to registers (available in gfx1250+).", "description": "Load a matrix of8-bit data from thedsmemory,\n transpose data between row-major and column-major order,\n and store the result into a64-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<3>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.ds.read.tr16.b64", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr) `->` type($res)" }, { "name": "rocdl.ds.read.tr4.b64", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr) `->` type($res)" }, { "name": "rocdl.ds.read.tr6.b96", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr) `->` type($res)" }, { "name": "rocdl.ds.read.tr8.b64", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr) `->` type($res)" }, { "name": "rocdl.exp", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.exp%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.exp2", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.exp2%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.fdot2", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.fdot2%a, %b, %c {clamp = true} :\n (vector<2xf16>,vector<2xf16>,f32) ->f32```", "operands": [ { "name": "a", "type": "ROCDL_V2F16Type" }, { "name": "b", "type": "ROCDL_V2F16Type" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.fdot2.bf16.bf16", "description": "Packed intra-lane dot-product with no clamp control.\n Computes `res = sum_i a[i]*b[i] + c`. Covers the full-f16/bf16\n accumulator forms (`fdot2.f16.f16`, `fdot2.bf16.bf16`) and the\n FP8/BF8 `dot4.f32.*` variants, whose hardware instructions have no\n CLAMP bit in their modifier word.\n\n Example:\n ```mlir\n %r = rocdl.fdot2.bf16.bf16%a, %b, %c : (vector<2xbf16>,vector<2xbf16>,bf16) ->bf16```", "operands": [ { "name": "a", "type": "ROCDL_V2BF16Type" }, { "name": "b", "type": "ROCDL_V2BF16Type" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.fdot2.f16.f16", "description": "Packed intra-lane dot-product with no clamp control.\n Computes `res = sum_i a[i]*b[i] + c`. Covers the full-f16/bf16\n accumulator forms (`fdot2.f16.f16`, `fdot2.bf16.bf16`) and the\n FP8/BF8 `dot4.f32.*` variants, whose hardware instructions have no\n CLAMP bit in their modifier word.\n\n Example:\n ```mlir\n %r = rocdl.fdot2.f16.f16%a, %b, %c : (vector<2xf16>,vector<2xf16>,f16) ->f16```", "operands": [ { "name": "a", "type": "ROCDL_V2F16Type" }, { "name": "b", "type": "ROCDL_V2F16Type" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.fdot2.f32.bf16", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.fdot2.f32.bf16%a, %b, %c {clamp = true} :\n (vector<2xbf16>,vector<2xbf16>,f32) ->f32```", "operands": [ { "name": "a", "type": "ROCDL_V2BF16Type" }, { "name": "b", "type": "ROCDL_V2BF16Type" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.flat.prefetch", "description": "Prefetches 1 byte of data per lane using flat-memory addresses into the WGP-cache or L2-cache.\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Prefetch from flat memory into cache.\n rocdl.flat.prefetch %ptr, 0 : !llvm.ptr\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<0>" } ], "attributes": [ { "name": "cachePolicy", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr `,` custom($cachePolicy) attr-dict `:` qualified(type($ptr))" }, { "name": "rocdl.fmed3", "summary": "Median of three float/half values", "description": "Computes the median of three floating-point values using the AMDGPU fmed3 intrinsic.\n This operation is equivalent to `max(min(a, b), min(max(a, b), c))` but uses the\n hardware-accelerated V_MED3_F16/V_MED3_F32 instruction for better performance.\n\n The operation supports both scalar and vector floating-point types (f16, f32).\n\n Example:\n ```mlir\n // Scalar f32 median\n %result = rocdl.fmed3 %a, %b, %c : f32\n\n // Vector f16 median\n %result = rocdl.fmed3 %va, %vb, %vc : vector<4xf16>\n ```", "operands": [ { "name": "src0", "type": "LLVM_ScalarOrVectorOf" }, { "name": "src1", "type": "LLVM_ScalarOrVectorOf" }, { "name": "src2", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['res', 'src0', 'src1', 'src2']>" } ], "assemblyFormat": "$src0 `,` $src1 `,` $src2 attr-dict `:` type($res)" }, { "name": "rocdl.global.load.async.lds", "summary": "Version of rocdl.load.async.to.lds specialized to global pointers", "description": "This operation works identically to `rocdl.load.async.to.lds` except that the\n global pointer argument is limited to pointers in address space 1 (pure global\n pointers) instead of also allowing fat buffer pointers.\n\n Available on gfx9 and gfx10.\n\n For the operation introduced in gfx1250, see `rocdl.global.load.async.to.lds.bN`.\n\n Example:\n ```mlir\n // Async load from global pointer to LDS (address space 1 only).\n rocdl.load.async.to.lds %global, %shared, 4, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "size", "type": "I32Attr" }, { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $size `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.load.async.to.lds.b128", "description": "Asynchronously loadsbits of data from a global memory pointer\n to a Local Data Share (LDS) pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit load from global to LDS.\n rocdl.global.load.async.to.lds.b128%src, %dst, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.load.async.to.lds.b32", "description": "Asynchronously loadsbits of data from a global memory pointer\n to a Local Data Share (LDS) pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit load from global to LDS.\n rocdl.global.load.async.to.lds.b32%src, %dst, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.load.async.to.lds.b64", "description": "Asynchronously loadsbits of data from a global memory pointer\n to a Local Data Share (LDS) pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit load from global to LDS.\n rocdl.global.load.async.to.lds.b64%src, %dst, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.load.async.to.lds.b8", "description": "Asynchronously loadsbits of data from a global memory pointer\n to a Local Data Share (LDS) pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit load from global to LDS.\n rocdl.global.load.async.to.lds.b8%src, %dst, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.load.lds", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "size", "type": "I32Attr" }, { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $size `,` $offset `,`\n custom($aux)\n attr-dict" }, { "name": "rocdl.global.load.tr.b128", "summary": "Loads and transposes a matrix from global memory to registers (available in gfx1250+).", "description": "Load a matrix of16-bit data from theglobalmemory,\n transpose data between row-major and column-major order,\n and store the result into a128-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<1>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.global.load.tr.b64", "summary": "Loads and transposes a matrix from global memory to registers (available in gfx1250+).", "description": "Load a matrix of8-bit data from theglobalmemory,\n transpose data between row-major and column-major order,\n and store the result into a64-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<1>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.global.load.tr4.b64", "summary": "Loads and transposes a matrix from global memory to registers (available in gfx1250+).", "description": "Load a matrix of4-bit data from theglobalmemory,\n transpose data between row-major and column-major order,\n and store the result into a64-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<1>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.global.load.tr6.b96", "summary": "Loads and transposes a matrix from global memory to registers (available in gfx1250+).", "description": "Load a matrix of6-bit data from theglobalmemory,\n transpose data between row-major and column-major order,\n and store the result into a96-bit vector register.\n\n Available in gfx1250+.\n\n Example (concrete mnemonics depend on address space and element size):\n ```mlir\n // 64-bit transpose load from global memory.\n %0 = rocdl.global.load.tr4.b64 %ptr : !llvm.ptr<1> -> vector<2xi32>\n\n // 128-bit transpose load from global memory with f16 result.\n %1 = rocdl.global.load.tr.b128 %ptr : !llvm.ptr<1> -> vector<8xf16>\n\n // 64-bit transpose load from LDS.\n %2 = rocdl.ds.load.tr4.b64 %ptr : !llvm.ptr<3> -> vector<2xi32>\n\n // 128-bit transpose load from LDS with bf16 result.\n %3 = rocdl.ds.load.tr16.b128 %ptr : !llvm.ptr<3> -> vector<8xbf16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<1>" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.global.prefetch", "description": "Prefetches 1 byte of data per lane from global memory into the WGP-cache or L2-cache.\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Prefetch from global memory into cache.\n rocdl.global.prefetch %ptr, 0 : !llvm.ptr<1>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_PointerInAddressSpace<1>" } ], "attributes": [ { "name": "cachePolicy", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$ptr `,` custom($cachePolicy) attr-dict `:` qualified(type($ptr))" }, { "name": "rocdl.global.store.async.from.lds.b128", "description": "Asynchronously storesbits of data from a Local Data Share (LDS)\n pointer to a global memory pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit store from LDS to global.\n rocdl.global.store.async.from.lds.b128%dst, %src, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.store.async.from.lds.b32", "description": "Asynchronously storesbits of data from a Local Data Share (LDS)\n pointer to a global memory pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit store from LDS to global.\n rocdl.global.store.async.from.lds.b32%dst, %src, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.store.async.from.lds.b64", "description": "Asynchronously storesbits of data from a Local Data Share (LDS)\n pointer to a global memory pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit store from LDS to global.\n rocdl.global.store.async.from.lds.b64%dst, %src, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.global.store.async.from.lds.b8", "description": "Asynchronously storesbits of data from a Local Data Share (LDS)\n pointer to a global memory pointer.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // AsyncbitsVal-bit store from LDS to global.\n rocdl.global.store.async.from.lds.b8%dst, %src, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "ROCDLGlobalBuffer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.grid.dim.x", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.grid.dim.y", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.grid.dim.z", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.iglp.opt", "description": "Instruction-group-level parallelism optimization hint.\n\n Example:\n ```mlir\n // IGLP optimization hint variant 0.\n rocdl.iglp.opt 0\n ```", "attributes": [ { "name": "variant", "type": "I32Attr" } ], "assemblyFormat": "$variant attr-dict" }, { "name": "rocdl.load.async.to.lds", "summary": "Gathering load to LDS that requires explicit async memory tracking", "description": "Load `size` bytes (the valid sizes vary by architecture) from the global memory\n pointed to by `globalPtr` and put them at `ldsPtr`, concantenating (and applying\n padding for sizes less than 4 bytes, along with padding out 12-byte reads\n to 16-byte writes). The value of `globalPtr` can vary between lanes, while\n `sharedPtr` must be subgroup-uniform (the values from each lane are concatentated\n before being written to LDS with appropriate padding applied.)\n\n `offset` is a constant offset applied to **both** pointers, and `aux` sets the cache\n policy. Unlike `rocdl.load.to.lds`, the compiler will not automatically inserts waits\n for this load to complete at the point it thinks you're using a region of LDS you've\n stored values to - you need to use the `rocdl.asyncmark` and `rocdl.wait.asyncmark`\n operations to explicitly group these operations and wait for their completion.\n\n Available on gfx10 and earlier with varying suppported values of `size`.\n\n Example:\n ```mlir\n // Async load 4 bytes from global pointer to LDS.\n rocdl.load.async.to.lds %global, %shared, 4, 0, 0 : !llvm.ptr<1>, !llvm.ptr<3>\n\n // Async load 4 bytes from fat buffer pointer to LDS.\n rocdl.load.async.to.lds %fatBuffer, %shared, 4, 0, 0 : !llvm.ptr<7>, !llvm.ptr<3>\n ```", "operands": [ { "name": "globalPtr", "type": "LLVM_AnyPointer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "size", "type": "I32Attr" }, { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $size `,` $offset `,`\n custom($aux)\n attr-dict `:` qualified(type($globalPtr)) `,` qualified(type($ldsPtr))" }, { "name": "rocdl.load.to.lds", "operands": [ { "name": "globalPtr", "type": "LLVM_AnyPointer" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "size", "type": "I32Attr" }, { "name": "offset", "type": "I32Attr" }, { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$globalPtr `,` $ldsPtr `,` $size `,` $offset `,`\n custom($aux)\n attr-dict `:` type($globalPtr)" }, { "name": "rocdl.load.tr.b", "summary": "Loads and transposes a matrix from memory to registers (available in gfx1250+).", "description": "Load a matrix of-bit data from thememory,\n transpose data between row-major and column-major order,\n and store the result into a-bit vector register.\n\n Available in gfx1250+.", "operands": [ { "name": "ptr", "type": "Arg" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.log", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.log%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.make.buffer.rsrc", "operands": [ { "name": "base", "type": "LLVM_AnyPointer" }, { "name": "stride", "type": "I16" }, { "name": "numRecords", "type": "I64" }, { "name": "flags", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_AnyPointer" } ], "assemblyFormat": "operands attr-dict `:` type($base) `to` type($res)" }, { "name": "rocdl.mbcnt.hi", "description": "Masked bit count of threads below the current lane in a wavefront.\n\n `in0` is a 32-bit mask that is AND-ed with the relevant half of the\n execution mask and the bits below the current lane; `in1` is added\n to the resulting popcount:\n\n - **lo**: `in1 + popcount(in0 & exec_lo & ((1 << min(lane_id, 32)) - 1))`\n - **hi**: `in1 + popcount(in0 & exec_hi & ((1 << saturating_usub(lane_id, 32)) - 1))`\n\n To obtain a unique thread index within a wave64, chain the two ops\n with `in0 = -1` (all bits set):\n\n Example:\n ```mlir\n %all_ones = arith.constant -1 : i32\n %zero = arith.constant 0 : i32\n\n // Count active threads below this lane in the low 32 lanes.\n %lo = rocdl.mbcnt.lo %all_ones, %zero : (i32, i32) -> i32\n\n // Add the count from the high 32 lanes to get the full lane index.\n %hi = rocdl.mbcnt.hi %all_ones, %lo : (i32, i32) -> i32\n ```", "operands": [ { "name": "in0", "type": "I32" }, { "name": "in1", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$in0 `,` $in1 attr-dict `:` `(` type($in0) `,` type($in1) `)` `->` type($res)" }, { "name": "rocdl.mbcnt.lo", "description": "Masked bit count of threads below the current lane in a wavefront.\n\n `in0` is a 32-bit mask that is AND-ed with the relevant half of the\n execution mask and the bits below the current lane; `in1` is added\n to the resulting popcount:\n\n - **lo**: `in1 + popcount(in0 & exec_lo & ((1 << min(lane_id, 32)) - 1))`\n - **hi**: `in1 + popcount(in0 & exec_hi & ((1 << saturating_usub(lane_id, 32)) - 1))`\n\n To obtain a unique thread index within a wave64, chain the two ops\n with `in0 = -1` (all bits set):\n\n Example:\n ```mlir\n %all_ones = arith.constant -1 : i32\n %zero = arith.constant 0 : i32\n\n // Count active threads below this lane in the low 32 lanes.\n %lo = rocdl.mbcnt.lo %all_ones, %zero : (i32, i32) -> i32\n\n // Add the count from the high 32 lanes to get the full lane index.\n %hi = rocdl.mbcnt.hi %all_ones, %lo : (i32, i32) -> i32\n ```", "operands": [ { "name": "in0", "type": "I32" }, { "name": "in1", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$in0 `,` $in1 attr-dict `:` `(` type($in0) `,` type($in1) `)` `->` type($res)" }, { "name": "rocdl.mfma.f32.16x16x16bf16.1k", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x16bf16.1k%a0, %b0, %c0, 0, 0, none : (vector<4xi16>,vector<4xi16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x16f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x16f16%a0, %b0, %c0, 0, 0, none : (vector<4xf16>,vector<4xf16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x1f32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x1f32%a0, %b0, %c0, 0, 0, none : (f32,f32,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x2bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x2bf16%a0, %b0, %c0, 0, 0, none : (vector<2xi16>,vector<2xi16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x32.bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x32.bf16%a0, %b0, %c0, 0, 0, none : (vector<8xbf16>,vector<8xbf16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x32.bf8.bf8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x32.bf8.bf8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x32.bf8.fp8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x32.bf8.fp8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x32.f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x32.f16%a0, %b0, %c0, 0, 0, none : (vector<8xf16>,vector<8xf16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x32.fp8.bf8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x32.fp8.bf8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x32.fp8.fp8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x32.fp8.fp8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x4bf16.1k", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x4bf16.1k%a0, %b0, %c0, 0, 0, none : (vector<4xi16>,vector<4xi16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x4f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x4f16%a0, %b0, %c0, 0, 0, none : (vector<4xf16>,vector<4xf16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x4f32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x4f32%a0, %b0, %c0, 0, 0, none : (f32,f32,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x8.xf32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x8.xf32%a0, %b0, %c0, 0, 0, none : (vector<2xf32>,vector<2xf32>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.16x16x8bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.16x16x8bf16%a0, %b0, %c0, 0, 0, none : (vector<2xi16>,vector<2xi16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x16.bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x16.bf16%a0, %b0, %c0, 0, 0, none : (vector<8xbf16>,vector<8xbf16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x16.bf8.bf8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x16.bf8.bf8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x16.bf8.fp8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x16.bf8.fp8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x16.f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x16.f16%a0, %b0, %c0, 0, 0, none : (vector<8xf16>,vector<8xf16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x16.fp8.bf8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x16.fp8.bf8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x16.fp8.fp8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x16.fp8.fp8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x1f32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x1f32%a0, %b0, %c0, 0, 0, none : (f32,f32,vector<32xf32>) ->vector<32xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x2bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x2bf16%a0, %b0, %c0, 0, 0, none : (vector<2xi16>,vector<2xi16>,vector<32xf32>) ->vector<32xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x2f32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x2f32%a0, %b0, %c0, 0, 0, none : (f32,f32,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x4.xf32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x4.xf32%a0, %b0, %c0, 0, 0, none : (vector<2xf32>,vector<2xf32>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x4bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x4bf16%a0, %b0, %c0, 0, 0, none : (vector<2xi16>,vector<2xi16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x4bf16.1k", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x4bf16.1k%a0, %b0, %c0, 0, 0, none : (vector<4xi16>,vector<4xi16>,vector<32xf32>) ->vector<32xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x4f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x4f16%a0, %b0, %c0, 0, 0, none : (vector<4xf16>,vector<4xf16>,vector<32xf32>) ->vector<32xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x8bf16.1k", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x8bf16.1k%a0, %b0, %c0, 0, 0, none : (vector<4xi16>,vector<4xi16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.32x32x8f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.32x32x8f16%a0, %b0, %c0, 0, 0, none : (vector<4xf16>,vector<4xf16>,vector<16xf32>) ->vector<16xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.4x4x1f32", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.4x4x1f32%a0, %b0, %c0, 0, 0, none : (f32,f32,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.4x4x2bf16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.4x4x2bf16%a0, %b0, %c0, 0, 0, none : (vector<2xi16>,vector<2xi16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.4x4x4bf16.1k", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.4x4x4bf16.1k%a0, %b0, %c0, 0, 0, none : (vector<4xi16>,vector<4xi16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f32.4x4x4f16", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.f32.4x4x4f16%a0, %b0, %c0, 0, 0, none : (vector<4xf16>,vector<4xf16>,vector<4xf32>) ->vector<4xf32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f64.16x16x4f64", "description": "Double-precision matrix fused multiply-add (MFMA) intrinsic. On gfx94x,\n the `blgp` immarg is a NEG bitfield rather than a B-lane permutation.\n\n Example:\n ```mlir\n %r0 =mfma.f64.16x16x4f64%a0, %b0, %c0, 0, 0, neg_a|neg_b : (f64,f64,vector<4xf64>) ->vector<4xf64>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMANegModifierAttr{none|neg_a|neg_b|neg_c}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.f64.4x4x4f64", "description": "Double-precision matrix fused multiply-add (MFMA) intrinsic. On gfx94x,\n the `blgp` immarg is a NEG bitfield rather than a B-lane permutation.\n\n Example:\n ```mlir\n %r0 =mfma.f64.4x4x4f64%a0, %b0, %c0, 0, 0, neg_a|neg_b : (f64,f64,f64) ->f64```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMANegModifierAttr{none|neg_a|neg_b|neg_c}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.16x16x16i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.16x16x16i8%a0, %b0, %c0, 0, 0, none : (i32,i32,vector<4xi32>) ->vector<4xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.16x16x32.i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.16x16x32.i8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<4xi32>) ->vector<4xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.16x16x4i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.16x16x4i8%a0, %b0, %c0, 0, 0, none : (i32,i32,vector<16xi32>) ->vector<16xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.16x16x64.i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.16x16x64.i8%a0, %b0, %c0, 0, 0, none : (vector<4xi32>,vector<4xi32>,vector<4xi32>) ->vector<4xi32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.32x32x16.i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.32x32x16.i8%a0, %b0, %c0, 0, 0, none : (i64,i64,vector<16xi32>) ->vector<16xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.32x32x32.i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.32x32x32.i8%a0, %b0, %c0, 0, 0, none : (vector<4xi32>,vector<4xi32>,vector<16xi32>) ->vector<16xi32>```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.32x32x4i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.32x32x4i8%a0, %b0, %c0, 0, 0, none : (i32,i32,vector<32xi32>) ->vector<32xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.32x32x8i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.32x32x8i8%a0, %b0, %c0, 0, 0, none : (i32,i32,vector<16xi32>) ->vector<16xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.i32.4x4x4i8", "description": "Matrix fused multiply-add (MFMA) intrinsic. Computes `D = A * B + C`\n with matrix operands. The `cbsz`, `abid`, and `blgp` attributes control\n broadcast and block layout modes.\n\n Example:\n ```mlir\n %r0 =mfma.i32.4x4x4i8%a0, %b0, %c0, 0, 0, none : (i32,i32,vector<4xi32>) ->vector<4xi32>```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_ConcreteVector" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" }, { "name": "blgp", "type": "ROCDL_MFMAPermBAttr{none|bcast_first_32|bcast_second_32|rotate_16_right|bcast_first_16|bcast_second_16|bcast_third_16|bcast_fourth_16}" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $abid `,` $blgp attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.scale.f32.16x16x128.f8f6f4", "description": "Scaled matrix fused multiply-add (MFMA) intrinsic with per-operand scaling.\n The `opselA`/`opselB` and `scaleA`/`scaleB` arguments control the scaling\n of input operands.\n\n Example:\n ```mlir\n // Scaled MFMA with fp8 * fp8 inputs.\n %r0 = rocdl.mfma.scale.f32.32x32x64.f8f6f4 %a, %a, %c, fp8_e4m3, fp8_e4m3, 0, %scaleA, 0, %scaleB :\n (vector<8xi32>, vector<8xi32>, vector<16xf32>, i32, i32) -> vector<16xf32>\n\n // Scaled MFMA with fp8 * bf8 inputs.\n %r1 = rocdl.mfma.scale.f32.32x32x64.f8f6f4 %a, %a, %c, fp8_e4m3, fp8_e5m2, 0, %scaleA, 0, %scaleB :\n (vector<8xi32>, vector<8xi32>, vector<16xf32>, i32, i32) -> vector<16xf32>\n\n // Scaled MFMA with fp8 * fp6 inputs (6xi32 operand B).\n %r2 = rocdl.mfma.scale.f32.32x32x64.f8f6f4 %a, %b6, %c, fp8_e4m3, fp6_e2m3, 0, %scaleA, 0, %scaleB :\n (vector<8xi32>, vector<6xi32>, vector<16xf32>, i32, i32) -> vector<16xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_VectorOf" }, { "name": "b", "type": "LLVM_VectorOf" }, { "name": "c", "type": "LLVM_VectorOf" }, { "name": "scaleA", "type": "I32" }, { "name": "scaleB", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "cbsz", "type": "ROCDL_MatrixFormatAttr{fp8_e4m3|fp8_e5m2|fp6_e2m3|fp6_e3m2|fp4_e2m1}" }, { "name": "blgp", "type": "ROCDL_MatrixFormatAttr{fp8_e4m3|fp8_e5m2|fp6_e2m3|fp6_e3m2|fp4_e2m1}" }, { "name": "opselA", "type": "I32Attr" }, { "name": "opselB", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $blgp `,` $opselA `,` $scaleA `,` $opselB `,` $scaleB attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.mfma.scale.f32.32x32x64.f8f6f4", "description": "Scaled matrix fused multiply-add (MFMA) intrinsic with per-operand scaling.\n The `opselA`/`opselB` and `scaleA`/`scaleB` arguments control the scaling\n of input operands.\n\n Example:\n ```mlir\n // Scaled MFMA with fp8 * fp8 inputs.\n %r0 = rocdl.mfma.scale.f32.32x32x64.f8f6f4 %a, %a, %c, fp8_e4m3, fp8_e4m3, 0, %scaleA, 0, %scaleB :\n (vector<8xi32>, vector<8xi32>, vector<16xf32>, i32, i32) -> vector<16xf32>\n\n // Scaled MFMA with fp8 * bf8 inputs.\n %r1 = rocdl.mfma.scale.f32.32x32x64.f8f6f4 %a, %a, %c, fp8_e4m3, fp8_e5m2, 0, %scaleA, 0, %scaleB :\n (vector<8xi32>, vector<8xi32>, vector<16xf32>, i32, i32) -> vector<16xf32>\n\n // Scaled MFMA with fp8 * fp6 inputs (6xi32 operand B).\n %r2 = rocdl.mfma.scale.f32.32x32x64.f8f6f4 %a, %b6, %c, fp8_e4m3, fp6_e2m3, 0, %scaleA, 0, %scaleB :\n (vector<8xi32>, vector<6xi32>, vector<16xf32>, i32, i32) -> vector<16xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_VectorOf" }, { "name": "b", "type": "LLVM_VectorOf" }, { "name": "c", "type": "LLVM_VectorOf" }, { "name": "scaleA", "type": "I32" }, { "name": "scaleB", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "cbsz", "type": "ROCDL_MatrixFormatAttr{fp8_e4m3|fp8_e5m2|fp6_e2m3|fp6_e3m2|fp4_e2m1}" }, { "name": "blgp", "type": "ROCDL_MatrixFormatAttr{fp8_e4m3|fp8_e5m2|fp6_e2m3|fp6_e3m2|fp4_e2m1}" }, { "name": "opselA", "type": "I32Attr" }, { "name": "opselB", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $cbsz `,` $blgp `,` $opselA `,` $scaleA `,` $opselB `,` $scaleB attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.permlane16.swap", "description": "Performs a `permlane16.swap` operation with the given operands, applying the\n permutation specified by $fi to the provided inputs.\n\n Example:\n ```mlir\n // Swap lanes between groups of 16 threads.\n %res = rocdl.permlane16.swap %src, %src, 0, -1 : (i32, i32) -> !llvm.struct<(i32, i32)>\n ```", "operands": [ { "name": "old", "type": "I32" }, { "name": "src", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcretePair" } ], "attributes": [ { "name": "fi", "type": "I1Attr" }, { "name": "boundControl", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $old `,` $src `,` $fi `,` $boundControl `:` `(` type($old) `,` type($src) `)` `->` type($res)" }, { "name": "rocdl.permlane16.var", "description": "Performs a `permlane16.var` operation: a per-lane variable-selector\n intra-row permutation (within each 16-lane row). Maps to\n `llvm.amdgcn.permlane16.var`.\n\n Each destination lane within a 16-lane row reads its value from the\n source lane whose index is given by the corresponding per-lane entry\n in `$src1` (a VGPR). `$fi` and `$boundControl` are immediate i1 attrs\n matching the underlying intrinsic's modifiers.\n\n Example:\n ```mlir\n %res = rocdl.permlane16.var %old, %src, %selector, false, true : (i32, i32, i32) -> i32\n ```", "operands": [ { "name": "old", "type": "I32" }, { "name": "src0", "type": "I32" }, { "name": "src1", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "fi", "type": "I1Attr" }, { "name": "boundControl", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $old `,` $src0 `,` $src1 `,` $fi `,` $boundControl `:` functional-type(operands, $res)" }, { "name": "rocdl.permlane32.swap", "description": "Performs a `permlane32.swap` operation with the given operands, applying the\n permutation specified by $fi to the provided inputs.\n\n Example:\n ```mlir\n // Swap lanes between groups of 32 threads.\n %res = rocdl.permlane32.swap %src, %src, 0, -1 : (i32, i32) -> !llvm.struct<(i32, i32)>\n ```", "operands": [ { "name": "old", "type": "I32" }, { "name": "src", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcretePair" } ], "attributes": [ { "name": "fi", "type": "I1Attr" }, { "name": "boundControl", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $old `,` $src `,` $fi `,` $boundControl `:` `(` type($old) `,` type($src) `)` `->` type($res)" }, { "name": "rocdl.permlanex16", "description": "Performs a `permlanex16` operation with the given operands, applying the\n permutation specified by $fi to the provided inputs.\n\n Example:\n ```mlir\n // Scalar permlanex16.\n %ret0 = rocdl.permlanex16 %src0, %src0, %sel, %sel, 0, -1 : f32, i32\n\n // Vector permlanex16.\n %ret1 = rocdl.permlanex16 %src1, %src1, %sel, %sel, 0, -1 : vector<2xf32>, i32\n ```", "operands": [ { "name": "old", "type": "LLVM_Type" }, { "name": "src0", "type": "LLVM_Type" }, { "name": "src1", "type": "LLVM_Type" }, { "name": "src2", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "fi", "type": "I1Attr" }, { "name": "boundControl", "type": "I1Attr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'old', 'src0']>" }, { "type": "AllTypesMatch<['src1', 'src2']>" } ], "assemblyFormat": "attr-dict $old `,` $src0 `,` $src1 `,` $src2 `,` $fi `,` $boundControl `:` type($src0) `,` type($src1)" }, { "name": "rocdl.permlanex16.var", "description": "Performs a `permlanex16.var` operation: a per-lane variable-selector\n cross-row permutation (each lane in one 16-lane row reads from a\n per-lane-chosen source lane in the opposite row). Maps to\n `llvm.amdgcn.permlanex16.var`.\n\n With per-lane \"identity\" selectors this realises an XOR-16 swap pattern\n in pure VALU; with arbitrary selectors it enables general per-lane\n cross-half-wave permutations. `$fi` and `$boundControl` are immediate\n i1 attrs matching the underlying intrinsic's modifiers.\n\n Example:\n ```mlir\n %res = rocdl.permlanex16.var %old, %src, %selector, false, true : (i32, i32, i32) -> i32\n ```", "operands": [ { "name": "old", "type": "I32" }, { "name": "src0", "type": "I32" }, { "name": "src1", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "fi", "type": "I1Attr" }, { "name": "boundControl", "type": "I1Attr" } ], "assemblyFormat": "attr-dict $old `,` $src0 `,` $src1 `,` $fi `,` $boundControl `:` functional-type(operands, $res)" }, { "name": "rocdl.raw.buffer.atomic.cmpswap", "operands": [ { "name": "src", "type": "LLVM_Type" }, { "name": "cmp", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'src', 'cmp']>" } ], "assemblyFormat": "attr-dict `(` $src `,` $cmp `,` $rsrc `,` $offset `,` $soffset `,`\n custom($aux) `)` `:` type($res) `,` type($rsrc)" }, { "name": "rocdl.raw.buffer.atomic.fadd", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.buffer.atomic.fmax", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.buffer.atomic.smax", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.buffer.atomic.umin", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.buffer.load", "operands": [ { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "assemblyFormat": "$rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($res)" }, { "name": "rocdl.raw.buffer.store", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDL_V4I32Type" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.ptr.buffer.atomic.cmpswap", "operands": [ { "name": "src", "type": "LLVM_Type" }, { "name": "cmp", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['res', 'src', 'cmp']>" } ], "assemblyFormat": "$src `,` $cmp `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($res)" }, { "name": "rocdl.raw.ptr.buffer.atomic.fadd", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.ptr.buffer.atomic.fmax", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.ptr.buffer.atomic.smax", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.ptr.buffer.atomic.umin", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['res', 'vdata']>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.raw.ptr.buffer.load", "operands": [ { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($res)" }, { "name": "rocdl.raw.ptr.buffer.load.async.lds", "summary": "Async variant of raw.ptr.buffer.load.lds", "description": "Load from a buffer resource `rsrc` to `ldsPtr`, which must be uniform.\n\n See `rocdl.load.async.to.lds` for overall semantics of such loads, noting that\n here `voffset` can be lane-varying and that `rsrc` (which holds the base addres)\n must, as always, be uniform.\n\n Available on gfx9 and gfx10.\n\n Example:\n ```mlir\n // Async buffer load to LDS via buffer resource pointer.\n rocdl.raw.ptr.buffer.load.async.lds %rsrc, %ldsPtr, %size, %voffset, %soffset, %offset, 0\n ```", "operands": [ { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" }, { "name": "size", "type": "I32" }, { "name": "voffset", "type": "I32" }, { "name": "soffset", "type": "I32" }, { "name": "offset", "type": "I32" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$rsrc `,` $ldsPtr `,` $size `,` $voffset `,` $soffset `,` $offset `,` custom($aux) attr-dict" }, { "name": "rocdl.raw.ptr.buffer.load.lds", "operands": [ { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "ldsPtr", "type": "ROCDLBufferLDS" }, { "name": "size", "type": "I32" }, { "name": "voffset", "type": "I32" }, { "name": "soffset", "type": "I32" }, { "name": "offset", "type": "I32" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$rsrc `,` $ldsPtr `,` $size `,` $voffset `,` $soffset `,` $offset `,` custom($aux) attr-dict" }, { "name": "rocdl.raw.ptr.buffer.store", "operands": [ { "name": "vdata", "type": "LLVM_Type" }, { "name": "rsrc", "type": "ROCDLBufferRsrc" }, { "name": "offset", "type": "I32" }, { "name": "soffset", "type": "I32" } ], "attributes": [ { "name": "aux", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom($aux) attr-dict `:` type($vdata)" }, { "name": "rocdl.rcp", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.rcp%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.readfirstlane", "summary": "Get the value in first active lane.", "description": "Returns the value in the lowest active lane of the input operand.\n\n Example:\n ```mlir\n // Scalar readfirstlane.\n %0 = rocdl.readfirstlane %src0 : f32\n\n // Vector readfirstlane.\n %1 = rocdl.readfirstlane %src1 : vector<2xf32>\n ```", "operands": [ { "name": "src", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "AllTypesMatch<['res', 'src']>" } ], "assemblyFormat": "$src attr-dict `:` type($res)" }, { "name": "rocdl.readlane", "summary": "Get the value in the specific lane.", "description": "Get the value in lane `src1` from input `src0`.\n\n Example:\n ```mlir\n // Scalar readlane.\n %0 = rocdl.readlane %src0, %idx : (f32, i32) -> f32\n\n // Vector readlane.\n %1 = rocdl.readlane %src1, %idx : (vector<2xf32>, i32) -> vector<2xf32>\n ```", "operands": [ { "name": "src0", "type": "LLVM_Type" }, { "name": "src1", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "traits": [ { "type": "AllTypesMatch<['res', 'src0']>" } ], "assemblyFormat": "$src0 `,` $src1 attr-dict `:` `(` type($src0) `,` type($src1) `)` `->` type($res)" }, { "name": "rocdl.rsq", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.rsq%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.s.barrier", "description": "Insert a workgroup barrier without memory fences.\n\n Available on gfx9 and later but deprecated on gfx12+; see\n `rocdl.s.barrier.signal` and `rocdl.s.barrier.wait` instead.\n\n Example:\n ```mlir\n // Synchronize threads within a workgroup.\n rocdl.s.barrier\n ```", "assemblyFormat": "attr-dict" }, { "name": "rocdl.s.barrier.init", "description": "Available on gfx1250+.\n\n Example:\n ```mlir\n // Initialize a named barrier with member count.\n rocdl.s.barrier.init %ptr member_cnt = 1 : !llvm.ptr<3>\n ```", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "memberCnt", "type": "I32Attr" } ], "assemblyFormat": "$ptr `member_cnt` `=` $memberCnt attr-dict `:` qualified(type($ptr))" }, { "name": "rocdl.s.barrier.join", "description": "Available on gfx1250+.\n\n Example:\n ```mlir\n // Join a named barrier.\n rocdl.s.barrier.join %ptr : !llvm.ptr<3>\n ```", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "rocdl.s.barrier.leave", "description": "Available on gfx1250+.\n\n Example:\n ```mlir\n // Leave a named barrier by id.\n rocdl.s.barrier.leave id = 1\n ```", "attributes": [ { "name": "id", "type": "I16Attr" } ], "assemblyFormat": "`id` `=` $id attr-dict" }, { "name": "rocdl.s.barrier.signal", "description": "Signal a barrier by id. Available on gfx1250+.\n\n Example:\n ```mlir\n // Signal barrier with id -1 (all barriers).\n rocdl.s.barrier.signal id = -1\n ```", "attributes": [ { "name": "id", "type": "I32Attr" } ], "assemblyFormat": "`id` `=` $id attr-dict" }, { "name": "rocdl.s.barrier.signal.isfirst", "description": "Available on gfx1200+.\n\n Example:\n ```mlir\n // Signal barrier and check if this wave is first to arrive.\n %0 = rocdl.s.barrier.signal.isfirst id = 1 -> i1\n ```", "results": [ { "name": "res", "type": "I1" } ], "attributes": [ { "name": "id", "type": "I32Attr" } ], "assemblyFormat": "`id` `=` $id attr-dict `->` type($res)" }, { "name": "rocdl.s.barrier.signal.var", "description": "Available on gfx1250+.\n\n If `memberCnt` is 0, the member count is retained from a previous initialization.\n\n Example:\n ```mlir\n // Signal a named barrier with variable ID.\n rocdl.s.barrier.signal.var %ptr member_cnt = 1 : !llvm.ptr<3>\n ```", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "attributes": [ { "name": "memberCnt", "type": "I32Attr" } ], "assemblyFormat": "$ptr `member_cnt` `=` $memberCnt attr-dict `:` qualified(type($ptr))" }, { "name": "rocdl.s.barrier.wait", "description": "Wait on a barrier by id. Available on gfx1200+.\n\n Example:\n ```mlir\n // Wait on barrier with id -1 (all barriers).\n rocdl.s.barrier.wait id = -1\n ```", "attributes": [ { "name": "id", "type": "I16Attr" } ], "assemblyFormat": "`id` `=` $id attr-dict" }, { "name": "rocdl.s.get.barrier.state", "description": "Available on gfx1200+.\n\n Example:\n ```mlir\n // Query barrier state by id.\n %0 = rocdl.s.get.barrier.state id = 1 -> i32\n ```", "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "id", "type": "I32Attr" } ], "assemblyFormat": "`id` `=` $id attr-dict `->` type($res)" }, { "name": "rocdl.s.get.named.barrier.state", "description": "Available on gfx1250+.\n\n Example:\n ```mlir\n // Query named barrier state by pointer.\n %0 = rocdl.s.get.named.barrier.state %ptr : !llvm.ptr<3> -> i32\n ```", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "results": [ { "name": "res", "type": "I32" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr)) `->` type($res)" }, { "name": "rocdl.s.nop", "description": "Insert a number of NOP cycles.\n\n Example:\n ```mlir\n // Insert a no-op.\n rocdl.s.nop 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "attr-dict $count" }, { "name": "rocdl.s.setprio", "description": "Set the wavefront scheduling priority.\n\n Example:\n ```mlir\n // Set priority to 0.\n rocdl.s.setprio 0\n ```", "attributes": [ { "name": "priority", "type": "I16Attr" } ], "assemblyFormat": "$priority attr-dict" }, { "name": "rocdl.s.sleep", "description": "Sleep for a number of clock cycles.\n\n Example:\n ```mlir\n // Sleep for a minimum duration.\n rocdl.s.sleep 0\n ```", "attributes": [ { "name": "count", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $count" }, { "name": "rocdl.s.wait.asynccnt", "summary": "Wait until ASYNCCNT is less than or equal to `count`", "description": "Wait for the counter specified to be less-than or equal-to the `count`\n before continuing.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Wait for async counter to drain.\n rocdl.s.wait.asynccnt 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.s.wait.dscnt", "summary": "Wait until DSCNT is less than or equal to `count`", "description": "Wait for the counter specified to be less-than or equal-to the `count`\n before continuing.\n\n Available on gfx12+.\n\n Example:\n ```mlir\n // Wait for data-sharing counter to drain.\n rocdl.s.wait.dscnt 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.s.wait.expcnt", "summary": "Wait until EXPCNT is less than or equal to `count`", "description": "Wait for the counter specified to be less-than or equal-to the `count`\n before continuing.\n\n Available on gfx12+.\n\n Example:\n ```mlir\n // Wait for export counter to drain.\n rocdl.s.wait.expcnt 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.s.wait.loadcnt", "summary": "Wait until LOADCNT is less than or equal to `count`", "description": "Wait for the counter specified to be less-than or equal-to the `count`\n before continuing.\n\n Available on gfx12+.\n\n Example:\n ```mlir\n // Wait for load counter to drain.\n rocdl.s.wait.loadcnt 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.s.wait.storecnt", "summary": "Wait until STORECNT is less than or equal to `count`", "description": "Wait for the counter specified to be less-than or equal-to the `count`\n before continuing.\n\n Available on gfx12+.\n\n Example:\n ```mlir\n // Wait for store counter to drain.\n rocdl.s.wait.storecnt 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.s.wait.tensorcnt", "summary": "Wait until TENSORCNT is less than or equal to `count`", "description": "Wait for the counter specified to be less-than or equal-to the `count`\n before continuing.\n\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Wait for tensor counter to drain.\n rocdl.s.wait.tensorcnt 0\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.s.waitcnt", "description": "Wait for outstanding memory operations to complete, as specified by a\n bitfield whose semantics depend on the target chipset.\n\n Example:\n ```mlir\n // Wait for all counters to reach zero.\n rocdl.s.waitcnt 0\n ```", "attributes": [ { "name": "bitfield", "type": "I32Attr" } ], "assemblyFormat": "attr-dict $bitfield" }, { "name": "rocdl.s.wakeup.barrier", "description": "Wakes up waves associated with a given named barrier. Note, This op does not release waves waiting\n at the barrier. It just signal other waves in the same work-group waiting on the indicated named barrier\n to wake up.\n Available on gfx1250+.\n\n Example:\n ```mlir\n // Wake up waves waiting on a named barrier.\n rocdl.s.wakeup.barrier %ptr : !llvm.ptr<3>\n ```", "operands": [ { "name": "ptr", "type": "ROCDLBufferLDS" } ], "assemblyFormat": "$ptr attr-dict `:` qualified(type($ptr))" }, { "name": "rocdl.sched.barrier", "description": "Insert a scheduling barrier with the given mask. The mask is a\n bitfield that controls which instruction types may be scheduled\n across the barrier. The mask values mirror the `llvm.amdgcn.sched.barrier`\n intrinsic's documented mask values and the AMDGPU backend's\n `SchedGroupMask` enum.\n\n Example:\n ```mlir\n // Scheduling barrier with no instructions allowed to cross.\n rocdl.sched.barrier none\n\n // Allow VALU and all VMEM instructions to cross.\n rocdl.sched.barrier valu|all_vmem\n ```", "attributes": [ { "name": "mask", "type": "ROCDL_SchedGroupMaskAttr{none|non_mem_non_sideeffect|valu|salu|mfma_wmma|all_vmem|vmem_read|vmem_write|all_ds|ds_read|ds_write|transcendental|ldsdma|all}" } ], "assemblyFormat": "$mask attr-dict" }, { "name": "rocdl.sched.group.barrier", "description": "Insert a scheduling group barrier. The first parameter uses the same\n scheduling group mask values as `rocdl.sched.barrier`.\n\n Example:\n ```mlir\n // Schedule group barrier with mask, size, and group id.\n rocdl.sched.group.barrier mfma_wmma, 1, 0\n ```", "attributes": [ { "name": "mask", "type": "ROCDL_SchedGroupMaskAttr{none|non_mem_non_sideeffect|valu|salu|mfma_wmma|all_vmem|vmem_read|vmem_write|all_ds|ds_read|ds_write|transcendental|ldsdma|all}" }, { "name": "size", "type": "I32Attr" }, { "name": "groupId", "type": "I32Attr" } ], "assemblyFormat": "$mask `,` $size `,` $groupId attr-dict" }, { "name": "rocdl.sdot2", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.sdot2%a, %b, %c {clamp = true} :\n (vector<2xi16>,vector<2xi16>,i32) ->i32```", "operands": [ { "name": "a", "type": "ROCDL_V2I16Type" }, { "name": "b", "type": "ROCDL_V2I16Type" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.sdot4", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.sdot4%a, %b, %c {clamp = true} :\n (i32,i32,i32) ->i32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.sdot8", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.sdot8%a, %b, %c {clamp = true} :\n (i32,i32,i32) ->i32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.sin", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.sin%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.smfmac.f32.16x16x128.bf8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x128.bf8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x128.fp8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x128.fp8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x32.bf16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x32.f16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x64.bf16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x64.bf8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x64.bf8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x64.f16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x64.fp8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.16x16x64.fp8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x16.bf16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x16.f16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x32.bf16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x32.bf8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x32.bf8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x32.f16", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x32.fp8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x32.fp8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x64.bf8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x64.bf8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x64.fp8.bf8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.f32.32x32x64.fp8.fp8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.i32.16x16x128.i8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.i32.16x16x64.i8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.i32.32x32x32.i8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.smfmac.i32.32x32x64.i8", "description": "Sparse matrix fused multiply-accumulate (SMFMAC) intrinsic with 2:4\n structured sparsity. The `index` operand provides the sparsity metadata,\n and `cbsz`/`abid` control broadcast modes.\n\n Example:\n ```mlir\n // SMFMAC with f16 inputs.\n %r0 = rocdl.smfmac.f32.16x16x32.f16 %a0, %b0, %c0, %idx, 0, 0 :\n (vector<4xf16>, vector<8xf16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with bf16 inputs.\n %r1 = rocdl.smfmac.f32.16x16x32.bf16 %a1, %b1, %c0, %idx, 0, 0 :\n (vector<4xi16>, vector<8xi16>, vector<4xf32>, i32) -> vector<4xf32>\n\n // SMFMAC with i8 inputs and i32 accumulator.\n %r2 = rocdl.smfmac.i32.16x16x64.i8 %a2, %b2, %c2, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xi32>, i32) -> vector<4xi32>\n\n // SMFMAC with fp8 inputs.\n %r3 = rocdl.smfmac.f32.16x16x64.fp8.fp8 %a2, %b2, %c0, %idx, 0, 0 :\n (vector<2xi32>, vector<4xi32>, vector<4xf32>, i32) -> vector<4xf32>\n ```", "operands": [ { "name": "a", "type": "ROCDL_ConcreteVector" }, { "name": "b", "type": "ROCDL_ConcreteVector" }, { "name": "c", "type": "ROCDL_ConcreteVector" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "ROCDL_ConcreteVector" } ], "attributes": [ { "name": "cbsz", "type": "I32Attr" }, { "name": "abid", "type": "I32Attr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index `,` $cbsz `,` $abid attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.sqrt", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.sqrt%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.sudot4", "description": "Mixed-signedness packed dot-product with per-operand sign controls.\n Computes `res = sum_i a[i]*b[i] + c`. Each lane of `a` is treated as\n signed when `signA = true`; when `signA = false`, the unsigned lane\n value is zero-extended into a wider signed integer. `signB` controls\n the same for `b`. `clamp` controls result clamping.\n\n These ops correspond to RDNA's unified mixed-sign `v_dot4_i32_iu8`\n and `v_dot8_i32_iu4` instructions (gfx11+).\n\n Example:\n ```mlir\n %r = rocdl.sudot4%a, %b, %c\n {signA = true, signB = false, clamp = true} :\n (i32, i32, i32) -> i32\n ```", "operands": [ { "name": "a", "type": "I32" }, { "name": "b", "type": "I32" }, { "name": "c", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.sudot8", "description": "Mixed-signedness packed dot-product with per-operand sign controls.\n Computes `res = sum_i a[i]*b[i] + c`. Each lane of `a` is treated as\n signed when `signA = true`; when `signA = false`, the unsigned lane\n value is zero-extended into a wider signed integer. `signB` controls\n the same for `b`. `clamp` controls result clamping.\n\n These ops correspond to RDNA's unified mixed-sign `v_dot4_i32_iu8`\n and `v_dot8_i32_iu4` instructions (gfx11+).\n\n Example:\n ```mlir\n %r = rocdl.sudot8%a, %b, %c\n {signA = true, signB = false, clamp = true} :\n (i32, i32, i32) -> i32\n ```", "operands": [ { "name": "a", "type": "I32" }, { "name": "b", "type": "I32" }, { "name": "c", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.bf16.16x16x32.bf16", "operands": [ { "name": "a", "type": "LLVM_VectorOf" }, { "name": "b", "type": "LLVM_VectorOf" }, { "name": "c", "type": "LLVM_VectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_VectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.bf16.16x16x64.bf16", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.bf16f32.16x16x64.bf16", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f16.16x16x128.bf8.bf8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f16.16x16x128.bf8.fp8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f16.16x16x128.fp8.bf8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f16.16x16x128.fp8.fp8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f16.16x16x32.f16", "operands": [ { "name": "a", "type": "LLVM_VectorOf" }, { "name": "b", "type": "LLVM_VectorOf" }, { "name": "c", "type": "LLVM_VectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_VectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f16.16x16x64.f16", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x128.bf8.bf8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x128.bf8.fp8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x128.fp8.bf8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x128.fp8.fp8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x32.bf16", "operands": [ { "name": "a", "type": "LLVM_VectorOf" }, { "name": "b", "type": "LLVM_VectorOf" }, { "name": "c", "type": "LLVM_VectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_VectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x32.bf8.bf8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x32.bf8.fp8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x32.f16", "operands": [ { "name": "a", "type": "LLVM_VectorOf" }, { "name": "b", "type": "LLVM_VectorOf" }, { "name": "c", "type": "LLVM_VectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_VectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x32.fp8.bf8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x32.fp8.fp8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x64.bf16", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.f32.16x16x64.f16", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.i32.16x16x128.iu8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.i32.16x16x32.iu4", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.i32.16x16x32.iu8", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.swmmac.i32.16x16x64.iu4", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $index attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.tanh", "description": "Note: In the general case, prefer the conventional `arith`, `math`, or `llvm` ops over this.\n Use this ROCDL-specific operation only when you fully understand its implication and\n when it is strictly necessary. This op is usually chosen when a small loss in precision is\n acceptable in exchange for higher execution speed.\n\n Example:\n ```mlir\n %0 = rocdl.tanh%a f32 -> f32\n ```", "operands": [ { "name": "arg", "type": "LLVM_AnyFloat" } ], "results": [ { "name": "res", "type": "LLVM_AnyFloat" } ], "assemblyFormat": "$arg qualified(type($arg)) attr-dict `->` qualified(type($res))" }, { "name": "rocdl.tensor.load.to.lds", "summary": "Base class for ROCDL tensor load/store to/from LDS.", "description": "Moves tiles of tensor data between global memory and LDS. The tile is\n described by the $dgroup descriptors. 5 $dgroup descriptors allows for\n movement of up to 5D tensors. $cachePolicy describes the memory scope and an\n indicator of expected data re-use.\n\n This op is for gfx1250+ architectures.\n\n Example:\n ```mlir\n // Tensor load from global memory to LDS using 4 descriptor groups.\n rocdl.tensor.load.to.lds %dg0, %dg1, %dg2, %dg3, %dg4, 0 : vector<4xi32>, vector<8xi32>\n\n // Tensor store from LDS to global memory using 4 descriptor groups.\n rocdl.tensor.store.from.lds %dg0, %dg1, %dg2, %dg3, %dg4, 0 : vector<4xi32>, vector<8xi32>\n ```", "operands": [ { "name": "dgroup0", "type": "ROCDL_V4I32Type" }, { "name": "dgroup1", "type": "ROCDL_V8I32Type" }, { "name": "dgroup2", "type": "ROCDL_V4I32Type" }, { "name": "dgroup3", "type": "ROCDL_V4I32Type" }, { "name": "dgroup4", "type": "ROCDL_V8I32Type" } ], "attributes": [ { "name": "cachePolicy", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$dgroup0 `,` $dgroup1 `,` $dgroup2 `,` $dgroup3 `,` $dgroup4 `,`\n custom($cachePolicy) attr-dict\n `:` type($dgroup0) `,` type($dgroup1)" }, { "name": "rocdl.tensor.load.to.lds.d2", "summary": "Base class for ROCDL tensor load/store to/from LDS (D2 variant).", "description": "Moves tiles of tensor data between global memory and LDS. The tile is\n described by the $dgroup descriptors. 2 $dgroup descriptors allows for\n movement of up to 2D tensors. $cachePolicy describes the memory scope and an\n indicator of expected data re-use.\n\n This op is for gfx1250+ architectures.", "operands": [ { "name": "dgroup0", "type": "ROCDL_V4I32Type" }, { "name": "dgroup1", "type": "ROCDL_V8I32Type" } ], "attributes": [ { "name": "cachePolicy", "type": "I32Attr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "attr-dict operands `cachepolicy` $cachePolicy `:` type($dgroup0) `,` type($dgroup1)" }, { "name": "rocdl.tensor.store.from.lds", "summary": "Base class for ROCDL tensor load/store to/from LDS.", "description": "Moves tiles of tensor data between global memory and LDS. The tile is\n described by the $dgroup descriptors. 5 $dgroup descriptors allows for\n movement of up to 5D tensors. $cachePolicy describes the memory scope and an\n indicator of expected data re-use.\n\n This op is for gfx1250+ architectures.\n\n Example:\n ```mlir\n // Tensor load from global memory to LDS using 4 descriptor groups.\n rocdl.tensor.load.to.lds %dg0, %dg1, %dg2, %dg3, %dg4, 0 : vector<4xi32>, vector<8xi32>\n\n // Tensor store from LDS to global memory using 4 descriptor groups.\n rocdl.tensor.store.from.lds %dg0, %dg1, %dg2, %dg3, %dg4, 0 : vector<4xi32>, vector<8xi32>\n ```", "operands": [ { "name": "dgroup0", "type": "ROCDL_V4I32Type" }, { "name": "dgroup1", "type": "ROCDL_V8I32Type" }, { "name": "dgroup2", "type": "ROCDL_V4I32Type" }, { "name": "dgroup3", "type": "ROCDL_V4I32Type" }, { "name": "dgroup4", "type": "ROCDL_V8I32Type" } ], "attributes": [ { "name": "cachePolicy", "type": "ROCDL_DefaultCachePolicyAttr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "$dgroup0 `,` $dgroup1 `,` $dgroup2 `,` $dgroup3 `,` $dgroup4 `,`\n custom($cachePolicy) attr-dict\n `:` type($dgroup0) `,` type($dgroup1)" }, { "name": "rocdl.tensor.store.from.lds.d2", "summary": "Base class for ROCDL tensor load/store to/from LDS (D2 variant).", "description": "Moves tiles of tensor data between global memory and LDS. The tile is\n described by the $dgroup descriptors. 2 $dgroup descriptors allows for\n movement of up to 2D tensors. $cachePolicy describes the memory scope and an\n indicator of expected data re-use.\n\n This op is for gfx1250+ architectures.", "operands": [ { "name": "dgroup0", "type": "ROCDL_V4I32Type" }, { "name": "dgroup1", "type": "ROCDL_V8I32Type" } ], "attributes": [ { "name": "cachePolicy", "type": "I32Attr" }, { "name": "alias_scopes", "type": "OptionalAttr>" }, { "name": "noalias_scopes", "type": "OptionalAttr>" }, { "name": "tbaa", "type": "OptionalAttr>" } ], "assemblyFormat": "attr-dict operands `cachepolicy` $cachePolicy `:` type($dgroup0) `,` type($dgroup1)" }, { "name": "rocdl.udot2", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.udot2%a, %b, %c {clamp = true} :\n (vector<2xi16>,vector<2xi16>,i32) ->i32```", "operands": [ { "name": "a", "type": "ROCDL_V2I16Type" }, { "name": "b", "type": "ROCDL_V2I16Type" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.udot4", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.udot4%a, %b, %c {clamp = true} :\n (i32,i32,i32) ->i32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.udot8", "description": "Packed intra-lane dot-product with optional result clamping (`clamp`).\n Computes `res = sum_i a[i]*b[i] + c`, where `a` and `b` hold packed\n 4/8/16-bit data (for `dot2`,`dot4`,`dot8`).\n\n Example:\n ```mlir\n %r = rocdl.udot8%a, %b, %c {clamp = true} :\n (i32,i32,i32) ->i32```", "operands": [ { "name": "a", "type": "ROCDL_Scalar" }, { "name": "b", "type": "ROCDL_Scalar" }, { "name": "c", "type": "ROCDL_Scalar" } ], "results": [ { "name": "res", "type": "ROCDL_Scalar" } ], "attributes": [ { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.update.dpp", "operands": [ { "name": "old", "type": "LLVM_Type" }, { "name": "src", "type": "LLVM_Type" } ], "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "dppCtrl", "type": "I32Attr" }, { "name": "rowMask", "type": "I32Attr" }, { "name": "bankMask", "type": "I32Attr" }, { "name": "boundCtrl", "type": "I1Attr" } ], "traits": [ { "type": "AllTypesMatch<['res', 'src', 'old']>" } ], "assemblyFormat": "attr-dict $old `,` $src `with` $dppCtrl `,` $rowMask `,` $bankMask `,` $boundCtrl `:` type($src)" }, { "name": "rocdl.wait.asyncmark", "summary": "Wait until N or fewer async operation groups are unexecuted", "description": "This operation, along with `rocdl.asyncmark`, forms the compiler-provided\n framework for explicitly tracking asynchronous operations.\n\n At the point where a wait.asyncmark operation is executed, all async operations\n that were parts of any async group (established by asyncmark in program order)\n other than the `count` previously-added ones will have finished executing.\n\n For more detail, including on how this mechanism composes with function calls,\n see [the LLVM documentation on async tracking](/llvm/docs/AMDGPUAsyncOperations.rst).\n\n Available on gfx9 and later.\n\n Example:\n ```mlir\n // Wait until at most N async groups remain outstanding.\n rocdl.wait.asyncmark 1\n ```\n\n Usage example:\n ```mlir\n rocdl.tensor.load.to.lds ...\n rocdl.global.async.load.to.lds ...\n\n rocdl.asyncmark\n\n rocdl.tensor.load.to.lds ...\n rocdl.global.async.load.to.lds ...\n\n rocdl.asyncmark\n\n rocdl.wait.asyncmark 1 // First group of loads completes after this\n ```", "attributes": [ { "name": "count", "type": "I16Attr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "rocdl.wave.barrier", "description": "Insert a wave-level (subgroup) barrier. Synchronizes lanes within a\n single wave/wavefront without any memory ordering guarantees.\n\n Example:\n ```mlir\n rocdl.wave.barrier\n ```", "assemblyFormat": "attr-dict" }, { "name": "rocdl.wave.id", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.wavefrontsize", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.wmma.bf16.16x16x16.bf16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with output operand selection.\n\n Example:\n ```mlir\n // WMMA f16 with opsel control.\n %r = rocdl.wmma.f16.16x16x16.f16 %a, %b, %c {opsel = false} :\n (vector<16xf16>, vector<16xf16>, vector<16xf16>) -> vector<16xf16>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "opsel", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.bf16.16x16x32.bf16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.bf16f32.16x16x32.bf16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with different C and D types.\n\n Example:\n ```mlir\n // WMMA bf16 output from f32 accumulator with bf16 inputs.\n %r = rocdl.wmma.bf16f32.16x16x32.bf16 %a, %b, %c, modC = none :\n (vector<16xbf16>, vector<16xbf16>, vector<8xf32>) -> vector<16xbf16>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x128.bf8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x128.bf8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x128.fp8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x128.fp8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x16.f16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with output operand selection.\n\n Example:\n ```mlir\n // WMMA f16 with opsel control.\n %r = rocdl.wmma.f16.16x16x16.f16 %a, %b, %c {opsel = false} :\n (vector<16xf16>, vector<16xf16>, vector<16xf16>) -> vector<16xf16>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "opsel", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x32.f16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x64.bf8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x64.bf8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x64.fp8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f16.16x16x64.fp8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x128.bf8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x128.bf8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x128.fp8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x128.fp8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x16.bf16", "description": "Wave Matrix Multiply-Accumulate (WMMA) intrinsic.\n\n Example:\n ```mlir\n // WMMA with f16 inputs and f32 accumulator.\n %r = rocdl.wmma.f32.16x16x16.f16 %a, %b, %c :\n (vector<16xf16>, vector<16xf16>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x16.bf8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) intrinsic.\n\n Example:\n ```mlir\n // WMMA with f16 inputs and f32 accumulator.\n %r = rocdl.wmma.f32.16x16x16.f16 %a, %b, %c :\n (vector<16xf16>, vector<16xf16>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x16.bf8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) intrinsic.\n\n Example:\n ```mlir\n // WMMA with f16 inputs and f32 accumulator.\n %r = rocdl.wmma.f32.16x16x16.f16 %a, %b, %c :\n (vector<16xf16>, vector<16xf16>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x16.f16", "description": "Wave Matrix Multiply-Accumulate (WMMA) intrinsic.\n\n Example:\n ```mlir\n // WMMA with f16 inputs and f32 accumulator.\n %r = rocdl.wmma.f32.16x16x16.f16 %a, %b, %c :\n (vector<16xf16>, vector<16xf16>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x16.fp8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) intrinsic.\n\n Example:\n ```mlir\n // WMMA with f16 inputs and f32 accumulator.\n %r = rocdl.wmma.f32.16x16x16.f16 %a, %b, %c :\n (vector<16xf16>, vector<16xf16>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x16.fp8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) intrinsic.\n\n Example:\n ```mlir\n // WMMA with f16 inputs and f32 accumulator.\n %r = rocdl.wmma.f32.16x16x16.f16 %a, %b, %c :\n (vector<16xf16>, vector<16xf16>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x32.bf16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x32.f16", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x4.f32", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x64.bf8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x64.bf8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x64.fp8_bf8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.f32.16x16x64.fp8_fp8", "description": "Wave Matrix Multiply-Accumulate (WMMA) with modC and reuse controls.\n\n Example:\n ```mlir\n // WMMA f32 with fp8 inputs and modC/reuse controls.\n %r = rocdl.wmma.f32.16x16x64.fp8_fp8 %a, %b, %c, modC = none :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `modC` `=` $modC attr-dict `:`\n functional-type(operands, $res)" }, { "name": "rocdl.wmma.i32.16x16x16.iu4", "description": "Wave Matrix Multiply-Accumulate (WMMA) for integer types with\n sign and clamp control.\n\n Example:\n ```mlir\n // WMMA i32 with unsigned i8 inputs.\n %r = rocdl.wmma.i32.16x16x16.iu8 %a, %b, %c\n {signA = false, signB = false, clamp = false} :\n (vector<4xi32>, vector<4xi32>, vector<8xi32>) -> vector<8xi32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.i32.16x16x16.iu8", "description": "Wave Matrix Multiply-Accumulate (WMMA) for integer types with\n sign and clamp control.\n\n Example:\n ```mlir\n // WMMA i32 with unsigned i8 inputs.\n %r = rocdl.wmma.i32.16x16x16.iu8 %a, %b, %c\n {signA = false, signB = false, clamp = false} :\n (vector<4xi32>, vector<4xi32>, vector<8xi32>) -> vector<8xi32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.i32.16x16x32.iu4", "description": "Wave Matrix Multiply-Accumulate (WMMA) for integer types with\n sign and clamp control.\n\n Example:\n ```mlir\n // WMMA i32 with unsigned i8 inputs.\n %r = rocdl.wmma.i32.16x16x16.iu8 %a, %b, %c\n {signA = false, signB = false, clamp = false} :\n (vector<4xi32>, vector<4xi32>, vector<8xi32>) -> vector<8xi32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.i32.16x16x64.iu8", "description": "Wave Matrix Multiply-Accumulate (WMMA) for integer types with\n sign, reuse, and clamp controls.\n\n Example:\n ```mlir\n // WMMA i32 with unsigned i8 inputs and reuse controls.\n %r = rocdl.wmma.i32.16x16x64.iu8 %a, %b, %c\n {signA = false, signB = false, reuseA = false, reuseB = false, clamp = false} :\n (vector<8xi32>, vector<8xi32>, vector<8xi32>) -> vector<8xi32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "signA", "type": "DefaultValuedAttr" }, { "name": "signB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" }, { "name": "clamp", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.scale.f32.16x16x128.f8f6f4", "description": "Scaled Wave Matrix Multiply-Accumulate (WMMA) with per-operand scaling.\n\n Example:\n ```mlir\n // Scaled WMMA with f8f6f4 format inputs.\n %r = rocdl.wmma.scale.f32.16x16x128.f8f6f4 %a, %b, %c, %scaleA, %scaleB\n fmtA = fp8_e4m3, fmtB = fp8_e4m3, modC = none,\n scaleAType = row0, fmtScaleA = e8, scaleBType = row0, fmtScaleB = e8 :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>, i32, i32) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "scaleA", "type": "I32" }, { "name": "scaleB", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fmtA", "type": "DefaultValuedAttr" }, { "name": "fmtB", "type": "DefaultValuedAttr" }, { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "scaleAType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleA", "type": "DefaultValuedAttr" }, { "name": "scaleBType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $scaleA `,` $scaleB `,`\n `fmtA` `=` $fmtA `,` `fmtB` `=` $fmtB `,`\n `modC` `=` $modC `,`\n `scaleAType` `=` $scaleAType `,` `fmtScaleA` `=` $fmtScaleA `,`\n `scaleBType` `=` $scaleBType `,` `fmtScaleB` `=` $fmtScaleB\n attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.scale.f32.32x16x128.f4", "description": "Scaled Wave Matrix Multiply-Accumulate (WMMA) for F4 format inputs.\n\n Example:\n ```mlir\n // Scaled WMMA with f4 format inputs.\n %r = rocdl.wmma.scale.f32.16x16x128.f4 %a, %b, %c, %scaleA, %scaleB\n modC = none, scaleAType = row0, fmtScaleA = e8,\n scaleBType = row0, fmtScaleB = e8 :\n (vector<8xi32>, vector<8xi32>, vector<8xf32>, i32, i32) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "scaleA", "type": "I32" }, { "name": "scaleB", "type": "I32" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "scaleAType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleA", "type": "DefaultValuedAttr" }, { "name": "scaleBType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $scaleA `,` $scaleB `,`\n `modC` `=` $modC `,`\n `scaleAType` `=` $scaleAType `,` `fmtScaleA` `=` $fmtScaleA `,`\n `scaleBType` `=` $scaleBType `,` `fmtScaleB` `=` $fmtScaleB\n attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.scale16.f32.16x16x128.f8f6f4", "description": "Scaled Wave Matrix Multiply-Accumulate (WMMA) with per-operand scaling.\n\n Example:\n ```mlir\n // Scaled WMMA with f8f6f4 format inputs.\n %r = rocdl.wmma.scale.f32.16x16x128.f8f6f4 %a, %b, %c, %scaleA, %scaleB\n fmtA = fp8_e4m3, fmtB = fp8_e4m3, modC = none,\n scaleAType = row0, fmtScaleA = e8, scaleBType = row0, fmtScaleB = e8 :\n (vector<16xi32>, vector<16xi32>, vector<8xf32>, i32, i32) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "scaleA", "type": "I64" }, { "name": "scaleB", "type": "I64" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "fmtA", "type": "DefaultValuedAttr" }, { "name": "fmtB", "type": "DefaultValuedAttr" }, { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "scaleAType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleA", "type": "DefaultValuedAttr" }, { "name": "scaleBType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $scaleA `,` $scaleB `,`\n `fmtA` `=` $fmtA `,` `fmtB` `=` $fmtB `,`\n `modC` `=` $modC `,`\n `scaleAType` `=` $scaleAType `,` `fmtScaleA` `=` $fmtScaleA `,`\n `scaleBType` `=` $scaleBType `,` `fmtScaleB` `=` $fmtScaleB\n attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.wmma.scale16.f32.32x16x128.f4", "description": "Scaled Wave Matrix Multiply-Accumulate (WMMA) for F4 format inputs.\n\n Example:\n ```mlir\n // Scaled WMMA with f4 format inputs.\n %r = rocdl.wmma.scale.f32.16x16x128.f4 %a, %b, %c, %scaleA, %scaleB\n modC = none, scaleAType = row0, fmtScaleA = e8,\n scaleBType = row0, fmtScaleB = e8 :\n (vector<8xi32>, vector<8xi32>, vector<8xf32>, i32, i32) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "LLVM_ScalarOrVectorOf" }, { "name": "b", "type": "LLVM_ScalarOrVectorOf" }, { "name": "c", "type": "LLVM_ScalarOrVectorOf" }, { "name": "scaleA", "type": "I64" }, { "name": "scaleB", "type": "I64" } ], "results": [ { "name": "res", "type": "LLVM_ScalarOrVectorOf" } ], "attributes": [ { "name": "modC", "type": "DefaultValuedAttr" }, { "name": "scaleAType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleA", "type": "DefaultValuedAttr" }, { "name": "scaleBType", "type": "DefaultValuedAttr" }, { "name": "fmtScaleB", "type": "DefaultValuedAttr" }, { "name": "reuseA", "type": "DefaultValuedAttr" }, { "name": "reuseB", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$a `,` $b `,` $c `,` $scaleA `,` $scaleB `,`\n `modC` `=` $modC `,`\n `scaleAType` `=` $scaleAType `,` `fmtScaleA` `=` $fmtScaleA `,`\n `scaleBType` `=` $scaleBType `,` `fmtScaleB` `=` $fmtScaleB\n attr-dict `:` functional-type(operands, $res)" }, { "name": "rocdl.workgroup.dim.x", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workgroup.dim.y", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workgroup.dim.z", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workgroup.id.x", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workgroup.id.y", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workgroup.id.z", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workitem.id.x", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workitem.id.y", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "rocdl.workitem.id.z", "description": "Read a hardware register for thread/workgroup/cluster identification.\n An optional `range` attribute can constrain the returned value.\n\n Example:\n ```mlir\n // Read the workitem id in the x dimension.\n %0 = rocdl.workitem.id.x : i32\n\n // Read with a known range constraint.\n %1 = rocdl.workitem.id.x range : i32\n ```", "results": [ { "name": "res", "type": "LLVM_Type" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "scf.condition", "summary": "loop continuation condition", "description": "This operation accepts the continuation (i.e., inverse of exit) condition\n of the `scf.while` construct. If its first argument is true, the \"after\"\n region of `scf.while` is executed, with the remaining arguments forwarded\n to the entry block of the region. Otherwise, the loop terminates.", "operands": [ { "name": "condition", "type": "I1" }, { "name": "args", "type": "Variadic" } ], "assemblyFormat": "`(` $condition `)` attr-dict ($args^ `:` type($args))?" }, { "name": "scf.execute_region", "summary": "operation that executes its region exactly once", "description": "The `scf.execute_region` operation is used to allow multiple blocks within SCF\n and other operations which can hold only one block. The `scf.execute_region`\n operation executes the region held exactly once and cannot have any operands.\n As such, its region has no arguments. All SSA values that dominate the op can\n be accessed inside the op. The op's region can have multiple blocks and the\n blocks can have multiple distinct terminators. Values returned from this op's\n region define the op's results.\n The optional 'no_inline' flag can be set to request the ExecuteRegionOp to be\n preserved as much as possible and not being inlined in the parent block until\n an explicit lowering step.\n\n Example:\n\n ```mlir\n scf.for %i = 0 to 128 step %c1 {\n %y = scf.execute_region -> i32 {\n %x = load %A[%i] : memref<128xi32>\n scf.yield %x : i32\n }\n }\n\n // the same as above but with no_inline attribute\n scf.for %i = 0 to 128 step %c1 {\n %y = scf.execute_region -> i32 no_inline {\n %x = load %A[%i] : memref<128xi32>\n scf.yield %x : i32\n }\n }\n\n affine.for %i = 0 to 100 {\n \"foo\"() : () -> ()\n %v = scf.execute_region -> i64 {\n cf.cond_br %cond, ^bb1, ^bb2\n\n ^bb1:\n %c1 = arith.constant 1 : i64\n cf.br ^bb3(%c1 : i64)\n\n ^bb2:\n %c2 = arith.constant 2 : i64\n cf.br ^bb3(%c2 : i64)\n\n ^bb3(%x : i64):\n scf.yield %x : i64\n }\n \"bar\"(%v) : (i64) -> ()\n }\n ```", "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "no_inline", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.for", "summary": "for operation", "description": "The `scf.for` operation represents a loop whose first three operands are the\n lower bound, upper bound and step respectively. The operation has one region\n capturing the loop body. The induction variable is represented as an\n argument of this region.\n\n Lower bound, upper bound, and step are interpreted as signed integers by\n default, or as unsigned integers if the `unsignedCmp` unit attribute is\n present. The step is required to be strictly positive.\n\n The lower and upper bounds specify a half-open range, including the lower\n bound but excluding the upper bound. More precisely, the semantics is\n governed by the following two rules, where arithmetic is performed with\n arbitrary precision:\n\n 1. The trip count `n` is `max(0, ceil((UB - LB) / Step))` and the induction\n variable takes the values `LB + j*Step` for `j = 0, ..., n - 1` in that\n order.\n 2. No-overflow condition: `LB + n*Step` must be representable in the type of\n the induction variable. Otherwise the behavior is undefined. Leaving this\n case undefined lets the loop be lowered to a plain increment-and-compare\n on a single induction register without having to account for wraparound.\n\n The body region must contain exactly one block that terminates with\n `scf.yield`. Calling ForOp::build will create such a region and insert\n the terminator implicitly if none is defined, so will the parsing even in\n cases when it is absent from the custom format. For example:\n\n ```mlir\n // Index case.\n scf.for %iv = %lb to %ub step %step {\n ... // body\n }\n ...\n // Unsigned integer case.\n scf.for unsigned %iv_32 = %lb_32 to %ub_32 step %step_32 : i32 {\n ... // body\n }\n ```\n\n `scf.for` can also operate on loop-carried variables and returns the final\n values after loop termination. The initial values of the variables are\n passed as additional SSA operands to the `scf.for` following the 3 loop\n control SSA values mentioned above (lower bound, upper bound and step). The\n operation region has an argument for the induction variable, followed by\n one argument for each loop-carried variable, representing the value of the\n variable at the current iteration.\n\n The region must terminate with a `scf.yield` that passes the current\n values of all loop-carried variables to the next iteration, or to the\n `scf.for` result, if at the last iteration. The static type of a\n loop-carried variable may not change with iterations; its runtime type is\n allowed to change. Note, that when the loop-carried variables are present,\n calling ForOp::build will not insert the terminator implicitly. The caller\n must insert `scf.yield` in that case.\n\n `scf.for` results hold the final values after the last iteration.\n For example, to sum-reduce a memref:\n\n ```mlir\n func.func @reduce(%buffer: memref<1024xf32>, %lb: index,\n %ub: index, %step: index) -> (f32) {\n // Initial sum set to 0.\n %sum_0 = arith.constant 0.0 : f32\n // iter_args binds initial values to the loop's region arguments.\n %sum = scf.for %iv = %lb to %ub step %step\n iter_args(%sum_iter = %sum_0) -> (f32) {\n %t = load %buffer[%iv] : memref<1024xf32>\n %sum_next = arith.addf %sum_iter, %t : f32\n // Yield current iteration sum to next iteration %sum_iter or to %sum\n // if final iteration.\n scf.yield %sum_next : f32\n }\n return %sum : f32\n }\n ```\n\n If the `scf.for` defines any values, a yield must be explicitly present.\n The number and types of the `scf.for` results must match the initial\n values in the `iter_args` binding and the yield operands.\n\n Another example with a nested `scf.if` (see `scf.if` for details) to\n perform conditional reduction:\n\n ```mlir\n func.func @conditional_reduce(%buffer: memref<1024xf32>, %lb: index,\n %ub: index, %step: index) -> (f32) {\n %sum_0 = arith.constant 0.0 : f32\n %c0 = arith.constant 0.0 : f32\n %sum = scf.for %iv = %lb to %ub step %step\n iter_args(%sum_iter = %sum_0) -> (f32) {\n %t = load %buffer[%iv] : memref<1024xf32>\n %cond = arith.cmpf \"ugt\", %t, %c0 : f32\n %sum_next = scf.if %cond -> (f32) {\n %new_sum = arith.addf %sum_iter, %t : f32\n scf.yield %new_sum : f32\n } else {\n scf.yield %sum_iter : f32\n }\n scf.yield %sum_next : f32\n }\n return %sum : f32\n }\n ```", "operands": [ { "name": "lowerBound", "type": "AnySignlessIntegerOrIndex" }, { "name": "upperBound", "type": "AnySignlessIntegerOrIndex" }, { "name": "step", "type": "AnySignlessIntegerOrIndex" }, { "name": "initArgs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "unsignedCmp", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AllTypesMatch<['lowerBound', 'upperBound', 'step']>" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.forall", "summary": "evaluate a block multiple times in parallel", "description": "`scf.forall` is a target-independent multi-dimensional parallel\n region application operation. It has exactly one block that represents the\n parallel body and it takes index operands that specify lower bounds, upper\n bounds and steps.\n\n The op also takes a variadic number of tensor operands (`shared_outs`).\n The future buffers corresponding to these tensors are shared among all\n threads. Shared tensors should be accessed via their corresponding block\n arguments. If multiple threads write to a shared buffer in a racy\n fashion, these writes will execute in some unspecified order. Tensors that\n are not shared can be used inside the body (i.e., the op is not isolated\n from above); however, if a use of such a tensor bufferizes to a memory\n write, the tensor is privatized, i.e., a thread-local copy of the tensor is\n used. This ensures that memory side effects of a thread are not visible to\n other threads (or in the parent body), apart from explicitly shared tensors.\n\n The name \"thread\" conveys the fact that the parallel execution is mapped\n (i.e. distributed) to a set of virtual threads of execution, one function\n application per thread. Further lowerings are responsible for specifying\n how this is materialized on concrete hardware resources.\n\n An optional `mapping` is an attribute array that specifies processing units\n with their dimension, how it remaps 1-1 to a set of concrete processing\n element resources (e.g. a CUDA grid dimension or a level of concrete nested\n async parallelism). It is expressed via any attribute that implements the\n device mapping interface. It is the reponsibility of the lowering mechanism\n to interpret the `mapping` attributes in the context of the concrete target\n the op is lowered to, or to ignore it when the specification is ill-formed\n or unsupported for a particular target.\n\n The only allowed terminator is `scf.forall.in_parallel`.\n `scf.forall` returns one value per `shared_out` operand. The\n actions of the `scf.forall.in_parallel` terminators specify how to combine the\n partial results of all parallel invocations into a full value, in some\n unspecified order. The \"destination\" of each such op must be a `shared_out`\n block argument of the `scf.forall` op.\n\n The actions involved in constructing the return values are further described\n by `tensor.parallel_insert_slice`.\n\n `scf.forall` acts as an implicit synchronization point.\n\n When the parallel function body has side effects, their order is unspecified\n across threads.\n\n `scf.forall` can be printed in two different ways depending on\n whether the loop is normalized or not. The loop is 'normalized' when all\n lower bounds are equal to zero and steps are equal to one. In that case,\n `lowerBound` and `step` operands will be omitted during printing.\n\n Normalized loop example:\n\n ```mlir\n //\n // Sequential context.\n //\n %matmul_and_pointwise:2 = scf.forall (%thread_id_1, %thread_id_2) in\n (%num_threads_1, %numthread_id_2) shared_outs(%o1 = %C, %o2 = %pointwise)\n -> (tensor, tensor) {\n //\n // Parallel context, each thread with id = (%thread_id_1, %thread_id_2)\n // runs its version of the code.\n //\n %sA = tensor.extract_slice %A[f((%thread_id_1, %thread_id_2))]:\n tensor to tensor\n %sB = tensor.extract_slice %B[g((%thread_id_1, %thread_id_2))]:\n tensor to tensor\n %sC = tensor.extract_slice %o1[h((%thread_id_1, %thread_id_2))]:\n tensor to tensor\n %sD = linalg.matmul\n ins(%sA, %sB : tensor, tensor)\n outs(%sC : tensor)\n\n %spointwise = subtensor %o2[i((%thread_id_1, %thread_id_2))]:\n tensor to tensor\n %sE = linalg.add ins(%spointwise : tensor) outs(%sD : tensor)\n\n scf.forall.in_parallel {\n tensor.parallel_insert_slice %sD into %o1[h((%thread_id_1, %thread_id_2))]:\n tensor into tensor\n\n tensor.parallel_insert_slice %spointwise into %o2[i((%thread_id_1, %thread_id_2))]:\n tensor into tensor\n }\n }\n // Implicit synchronization point.\n // Sequential context.\n //\n ```\n\n Loop with loop bounds example:\n\n ```mlir\n //\n // Sequential context.\n //\n %pointwise = scf.forall (%i, %j) = (0, 0) to (%dim1, %dim2)\n step (%tileSize1, %tileSize2) shared_outs(%o1 = %out)\n -> (tensor, tensor) {\n //\n // Parallel context.\n //\n %sA = tensor.extract_slice %A[%i, %j][%tileSize1, %tileSize2][1, 1]\n : tensor to tensor\n %sB = tensor.extract_slice %B[%i, %j][%tileSize1, %tileSize2][1, 1]\n : tensor to tensor\n %sC = tensor.extract_slice %o[%i, %j][%tileSize1, %tileSize2][1, 1]\n : tensor to tensor\n\n %add = linalg.map {\"arith.addf\"}\n ins(%sA, %sB : tensor, tensor)\n outs(%sC : tensor)\n\n scf.forall.in_parallel {\n tensor.parallel_insert_slice %add into\n %o[%i, %j][%tileSize1, %tileSize2][1, 1]\n : tensor into tensor\n }\n }\n // Implicit synchronization point.\n // Sequential context.\n //\n ```\n\n Example with mapping attribute:\n\n ```mlir\n //\n // Sequential context. Here `mapping` is expressed as GPU thread mapping\n // attributes\n //\n %matmul_and_pointwise:2 = scf.forall (%thread_id_1, %thread_id_2) in\n (%num_threads_1, %numthread_id_2) shared_outs(...)\n -> (tensor, tensor) {\n //\n // Parallel context, each thread with id = **(%thread_id_2, %thread_id_1)**\n // runs its version of the code.\n //\n scf.forall.in_parallel {\n ...\n }\n } { mapping = [#gpu.thread, #gpu.thread] }\n // Implicit synchronization point.\n // Sequential context.\n //\n ```\n\n Example with privatized tensors:\n\n ```mlir\n %t0 = ...\n %t1 = ...\n %r = scf.forall ... shared_outs(%o = t0) -> tensor {\n // %t0 and %t1 are privatized. %t0 is definitely copied for each thread\n // because the scf.forall op's %t0 use bufferizes to a memory\n // write. In the absence of other conflicts, %t1 is copied only if there\n // are uses of %t1 in the body that bufferize to a memory read and to a\n // memory write.\n \"some_use\"(%t0)\n \"some_use\"(%t1)\n }\n ```", "operands": [ { "name": "dynamicLowerBound", "type": "Variadic" }, { "name": "dynamicUpperBound", "type": "Variadic" }, { "name": "dynamicStep", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "staticLowerBound", "type": "DenseI64ArrayAttr" }, { "name": "staticUpperBound", "type": "DenseI64ArrayAttr" }, { "name": "staticStep", "type": "DenseI64ArrayAttr" }, { "name": "mapping", "type": "OptionalAttr>>" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.forall.in_parallel", "summary": "terminates a `forall` block", "description": "The `scf.forall.in_parallel` is a designated terminator for\n the `scf.forall` operation.\n\n It has a single region with a single block that contains a flat list of ops.\n Each such op participates in the aggregate formation of a single result of\n the enclosing `scf.forall`.\n The result number corresponds to the position of the op in the terminator.", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.if", "summary": "if-then-else operation", "description": "The `scf.if` operation represents an if-then-else construct for\n conditionally executing two regions of code. The operand to an if operation\n is a boolean value. For example:\n\n ```mlir\n scf.if %b {\n ...\n } else {\n ...\n }\n ```\n\n `scf.if` may also produce results. Which values are returned depends on\n which execution path is taken.\n\n Example:\n\n ```mlir\n %x, %y = scf.if %b -> (f32, f32) {\n %x_true = ...\n %y_true = ...\n scf.yield %x_true, %y_true : f32, f32\n } else {\n %x_false = ...\n %y_false = ...\n scf.yield %x_false, %y_false : f32, f32\n }\n ```\n\n The \"then\" region has exactly 1 block. The \"else\" region may have 0 or 1\n block. In case the `scf.if` produces results, the \"else\" region must also\n have exactly 1 block.\n\n The blocks are always terminated with `scf.yield`. If `scf.if` defines no\n values, the `scf.yield` can be left out, and will be inserted implicitly.\n Otherwise, it must be explicit.\n\n Example:\n\n ```mlir\n scf.if %b {\n ...\n }\n ```\n\n The types of the yielded values must match the result types of the\n `scf.if`.", "operands": [ { "name": "condition", "type": "I1" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "thenRegion", "type": "SizedRegion<1>" }, { "name": "elseRegion", "type": "MaxSizedRegion<1>" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.index_switch", "summary": "switch-case operation on an index argument", "description": "The `scf.index_switch` is a control-flow operation that branches to one of\n the given regions based on the values of the argument and the cases. The\n argument is always of type `index`.\n\n The operation always has a \"default\" region and any number of case regions\n denoted by integer constants. Control-flow transfers to the case region\n whose constant value equals the value of the argument. If the argument does\n not equal any of the case values, control-flow transfer to the \"default\"\n region.\n\n Example:\n\n ```mlir\n %0 = scf.index_switch %arg0 : index -> i32\n case 2 {\n %1 = arith.constant 10 : i32\n scf.yield %1 : i32\n }\n case 5 {\n %2 = arith.constant 20 : i32\n scf.yield %2 : i32\n }\n default {\n %3 = arith.constant 30 : i32\n scf.yield %3 : i32\n }\n ```", "operands": [ { "name": "arg", "type": "Index" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "cases", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "defaultRegion", "type": "SizedRegion<1>" }, { "name": "caseRegions", "type": "VariadicRegion>" } ], "assemblyFormat": "$arg attr-dict (`->` type($results)^)?\n custom($cases, $caseRegions) `\\n`\n `` `default` $defaultRegion" }, { "name": "scf.parallel", "summary": "parallel for operation", "description": "The `scf.parallel` operation represents a loop nest taking 4 groups of SSA\n values as operands that represent the lower bounds, upper bounds, steps and\n initial values, respectively. The operation defines a variadic number of\n SSA values for its induction variables. It has one region capturing the\n loop body. The induction variables are represented as an argument of this\n region. These SSA values always have type index, which is the size of the\n machine word. The steps are values of type index, required to be positive.\n The lower and upper bounds specify a half-open range: the range includes\n the lower bound but does not include the upper bound. The initial values\n have the same types as results of `scf.parallel`. If there are no results,\n the keyword `init` can be omitted.\n\n Semantically we require that the iteration space can be iterated in any\n order, and the loop body can be executed in parallel. If there are data\n races, the behavior is undefined.\n\n The parallel loop operation supports reduction of values produced by\n individual iterations into a single result. This is modeled using the\n `scf.reduce` terminator operation (see `scf.reduce` for details). The i-th\n result of an `scf.parallel` operation is associated with the i-th initial\n value operand, the i-th operand of the `scf.reduce` operation (the value to\n be reduced) and the i-th region of the `scf.reduce` operation (the reduction\n function). Consequently, we require that the number of results of an\n `scf.parallel` op matches the number of initial values and the the number of\n reductions in the `scf.reduce` terminator.\n\n The body region must contain exactly one block that terminates with a\n `scf.reduce` operation. If an `scf.parallel` op has no reductions, the\n terminator has no operands and no regions. The `scf.parallel` parser will\n automatically insert the terminator for ops that have no reductions if it is\n absent.\n\n Example:\n\n ```mlir\n %init = arith.constant 0.0 : f32\n %r:2 = scf.parallel (%iv) = (%lb) to (%ub) step (%step) init (%init, %init)\n -> f32, f32 {\n %elem_to_reduce1 = load %buffer1[%iv] : memref<100xf32>\n %elem_to_reduce2 = load %buffer2[%iv] : memref<100xf32>\n scf.reduce(%elem_to_reduce1, %elem_to_reduce2 : f32, f32) {\n ^bb0(%lhs : f32, %rhs: f32):\n %res = arith.addf %lhs, %rhs : f32\n scf.reduce.return %res : f32\n }, {\n ^bb0(%lhs : f32, %rhs: f32):\n %res = arith.mulf %lhs, %rhs : f32\n scf.reduce.return %res : f32\n }\n }\n ```", "operands": [ { "name": "lowerBound", "type": "Variadic" }, { "name": "upperBound", "type": "Variadic" }, { "name": "step", "type": "Variadic" }, { "name": "initVals", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.reduce", "summary": "reduce operation for scf.parallel", "description": "The `scf.reduce` operation is the terminator for `scf.parallel` operations. It can model\n an arbitrary number of reductions. It has one region per reduction. Each\n region has one block with two arguments which have the same type as the\n corresponding operand of `scf.reduce`. The operands of the op are the values\n that should be reduce; one value per reduction.\n\n The i-th reduction (i.e., the i-th region and the i-th operand) corresponds\n the i-th initial value and the i-th result of the enclosing `scf.parallel`\n op.\n\n The `scf.reduce` operation contains regions whose entry blocks expect two\n arguments of the same type as the corresponding operand. As the iteration\n order of the enclosing parallel loop and hence reduction order is\n unspecified, the results of the reductions may be non-deterministic unless\n the reductions are associative and commutative.\n\n The result of a reduction region (`scf.reduce.return` operand) must have the\n same type as the corresponding `scf.reduce` operand and the corresponding\n `scf.parallel` initial value.\n\n Example:\n\n ```mlir\n %operand = arith.constant 1.0 : f32\n scf.reduce(%operand : f32) {\n ^bb0(%lhs : f32, %rhs: f32):\n %res = arith.addf %lhs, %rhs : f32\n scf.reduce.return %res : f32\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "regions": [ { "name": "reductions", "type": "VariadicRegion>" } ], "assemblyFormat": "(`(` $operands^ `:` type($operands) `)`)? $reductions attr-dict" }, { "name": "scf.reduce.return", "summary": "terminator for reduce operation", "description": "The `scf.reduce.return` operation is a special terminator operation for the block inside\n `scf.reduce` regions. It terminates the region. It should have the same\n operand type as the corresponding operand of the enclosing `scf.reduce` op.\n\n Example:\n\n ```mlir\n scf.reduce.return %res : f32\n ```", "operands": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "scf.while", "summary": "a generic 'while' loop", "description": "This operation represents a generic \"while\"/\"do-while\" loop that keeps\n iterating as long as a condition is satisfied. There is no restriction on\n the complexity of the condition. It consists of two regions (with single\n block each): \"before\" region and \"after\" region. The names of regions\n indicates whether they execute before or after the condition check.\n Therefore, if the main loop payload is located in the \"before\" region, the\n operation is a \"do-while\" loop. Otherwise, it is a \"while\" loop.\n\n The \"before\" region terminates with a special operation, `scf.condition`,\n that accepts as its first operand an `i1` value indicating whether to\n proceed to the \"after\" region (value is `true`) or not. The two regions\n communicate by means of region arguments. Initially, the \"before\" region\n accepts as arguments the operands of the `scf.while` operation and uses them\n to evaluate the condition. It forwards the trailing, non-condition operands\n of the `scf.condition` terminator either to the \"after\" region if the\n control flow is transferred there or to results of the `scf.while` operation\n otherwise. The \"after\" region takes as arguments the values produced by the\n \"before\" region and uses `scf.yield` to supply new arguments for the\n \"before\" region, into which it transfers the control flow unconditionally.\n\n A simple \"while\" loop can be represented as follows.\n\n ```mlir\n %res = scf.while (%arg1 = %init1) : (f32) -> f32 {\n // \"Before\" region.\n // In a \"while\" loop, this region computes the condition.\n %condition = call @evaluate_condition(%arg1) : (f32) -> i1\n\n // Forward the argument (as result or \"after\" region argument).\n scf.condition(%condition) %arg1 : f32\n\n } do {\n ^bb0(%arg2: f32):\n // \"After\" region.\n // In a \"while\" loop, this region is the loop body.\n %next = call @payload(%arg2) : (f32) -> f32\n\n // Forward the new value to the \"before\" region.\n // The operand types must match the types of the `scf.while` operands.\n scf.yield %next : f32\n }\n ```\n\n A simple \"do-while\" loop can be represented by reducing the \"after\" block\n to a simple forwarder.\n\n ```mlir\n %res = scf.while (%arg1 = %init1) : (f32) -> f32 {\n // \"Before\" region.\n // In a \"do-while\" loop, this region contains the loop body.\n %next = call @payload(%arg1) : (f32) -> f32\n\n // And also evaluates the condition.\n %condition = call @evaluate_condition(%arg1) : (f32) -> i1\n\n // Loop through the \"after\" region.\n scf.condition(%condition) %next : f32\n\n } do {\n ^bb0(%arg2: f32):\n // \"After\" region.\n // Forwards the values back to \"before\" region unmodified.\n scf.yield %arg2 : f32\n }\n ```\n\n Note that the types of region arguments need not to match with each other.\n The op expects the operand types to match with argument types of the\n \"before\" region; the result types to match with the trailing operand types\n of the terminator of the \"before\" region, and with the argument types of the\n \"after\" region. The following scheme can be used to share the results of\n some operations executed in the \"before\" region with the \"after\" region,\n avoiding the need to recompute them.\n\n ```mlir\n %res = scf.while (%arg1 = %init1) : (f32) -> i64 {\n // One can perform some computations, e.g., necessary to evaluate the\n // condition, in the \"before\" region and forward their results to the\n // \"after\" region.\n %shared = call @shared_compute(%arg1) : (f32) -> i64\n\n // Evaluate the condition.\n %condition = call @evaluate_condition(%arg1, %shared) : (f32, i64) -> i1\n\n // Forward the result of the shared computation to the \"after\" region.\n // The types must match the arguments of the \"after\" region as well as\n // those of the `scf.while` results.\n scf.condition(%condition) %shared : i64\n\n } do {\n ^bb0(%arg2: i64) {\n // Use the partial result to compute the rest of the payload in the\n // \"after\" region.\n %res = call @payload(%arg2) : (i64) -> f32\n\n // Forward the new value to the \"before\" region.\n // The operand types must match the types of the `scf.while` operands.\n scf.yield %res : f32\n }\n ```\n\n The custom syntax for this operation is as follows.\n\n ```\n op ::= `scf.while` assignments `:` function-type region `do` region\n `attributes` attribute-dict\n initializer ::= /* empty */ | `(` assignment-list `)`\n assignment-list ::= assignment | assignment `,` assignment-list\n assignment ::= ssa-value `=` ssa-value\n ```", "operands": [ { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "before", "type": "SizedRegion<1>" }, { "name": "after", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "scf.yield", "summary": "loop yield and termination operation", "description": "The `scf.yield` operation yields an SSA value from the SCF dialect op region and\n terminates the regions. The semantics of how the values are yielded is\n defined by the parent operation.\n If `scf.yield` has any operands, the operands must match the parent\n operation's results.\n If the parent operation defines no values, then the `scf.yield` may be\n left out in the custom syntax and the builders will insert one implicitly.\n Otherwise, it has to be present in the syntax to indicate which values are\n yielded.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "sdfg.alloc", "summary": "Array allocation operation", "description": "Alloc operation to create arrays and reserve the specified space.\n For example:\n\n ```mlir\n %A = sdfg.alloc() : !sdfg.array\n ```", "operands": [ { "name": "params", "type": "Variadic" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[SDFG_ArrayType, SDFG_StreamType]>" } ], "attributes": [ { "name": "name", "type": "OptionalAttr" }, { "name": "transient", "type": "UnitAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.alloc_symbol", "summary": "symbol creation operation", "description": "Alloc operation to create a new symbol.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n sdfg.alloc_symbol(\"N\")\n ...\n }\n ```", "attributes": [ { "name": "sym", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.call" }, { "name": "sdfg.consume", "summary": "Consume scope", "description": "Describes a consume scope where the region has access to the popped \n element as well as the processing element.\n For example:\n\n ```mlir\n sdfg.consume{num_pes=5} (%a : !sdfg.stream) -> (pe: %p, elem: %e) {\n %c = sdfg.call @add_one(%a) : i32 -> i32\n ...\n } \n ```", "operands": [ { "name": "stream", "type": "SDFG_StreamType" } ], "attributes": [ { "name": "entryID", "type": "I32Attr" }, { "name": "exitID", "type": "I32Attr" }, { "name": "num_pes", "type": "OptionalAttr" }, { "name": "condition", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.copy", "summary": "Memlet copy operation", "description": "Allows a state to copy the contents from one memlet to another.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n sdfg.copy %a -> %c : !sdfg.memlet\n ...\n }\n ```", "operands": [ { "name": "src", "type": "SDFG_ArrayType" }, { "name": "dest", "type": "SDFG_ArrayType" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.edge", "summary": "edge operation", "description": "Represents an edge from one state to another with assignment and \n condition attributes.\n For example:\n\n ```mlir\n sdfg.sdfg {\n ...\n sdfg.edge{assign=[\"i = 1\"]} @state_0 -> @state_1\n ...\n }\n ```", "operands": [ { "name": "ref", "type": "Optional" } ], "attributes": [ { "name": "src", "type": "FlatSymbolRefAttr" }, { "name": "dest", "type": "FlatSymbolRefAttr" }, { "name": "assign", "type": "DefaultValuedAttr, {}>" }, { "name": "condition", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.get_access", "hasCustomAssemblyFormat": 1 }, { "name": "sdfg.libcall", "summary": "library call operation", "description": "The `libcall` operation represents a direct call to a library function. \n For example:\n\n ```mlir\n %2 = sdfg.libcall \"dace.libraries.blas.nodes.Dot\" (%0, %1) : (f32, f32) -> f32\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.load", "summary": "Memlet load operation", "description": "Allows a state to load a value from a memlet.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n %a = sdfg.get_access %A : !sdfg.memlet\n %a_1 = sdfg.load %a[0] : !sdfg.memlet -> i32\n ...\n }\n ```", "operands": [ { "name": "indices", "type": "Variadic" }, { "name": "arr", "type": "SDFG_ArrayType" } ], "results": [ { "name": "res", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'arr', 'res', '$_self.cast().getDimensions().getElementType()'>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.map", "summary": "Map scope", "description": "Describes a map where the region has access to the map symbol variables.\n For example:\n\n ```mlir\n sdfg.map (%i, %j) = (0, 0) to (2, 2) step (1, 1) {\n ...\n %a = sdfg.load %A[%i, %j] : !sdfg.array<12x34xi32>\n ...\n } \n ```", "operands": [ { "name": "ranges", "type": "Variadic" } ], "attributes": [ { "name": "entryID", "type": "I32Attr" }, { "name": "exitID", "type": "I32Attr" }, { "name": "lowerBounds", "type": "ArrayAttr" }, { "name": "upperBounds", "type": "ArrayAttr" }, { "name": "steps", "type": "ArrayAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.nested_sdfg", "summary": "Nested SDFG region", "description": "Describes a nested SDFG where the states are placed in the region. \n For example:\n\n ```mlir\n sdfg.nested_sdfg{entry=@state_0} {\n sdfg.edge{assign=[\"i = 1\"]} @state_0 -> @state_1\n ...\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "ID", "type": "I32Attr" }, { "name": "entry", "type": "OptionalAttr" }, { "name": "num_args", "type": "I32Attr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.return", "summary": "return operation", "description": "The \"return\" operation represents a return operation within a function.\n The operation takes an optional operand and produces no results.\n The operand type must match the signature of the function that contains\n the operation. \n For example:\n\n ```mlir\n func @foo() -> tensor<2xf64> {\n ...\n sdfg.return %0 : tensor<2xf64>\n }\n ```", "operands": [ { "name": "input", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.sdfg", "summary": "SDFG region", "description": "Describes an SDFG where the states are placed in the region. \n For example:\n\n ```mlir\n sdfg.sdfg{entry=@state_0} {\n sdfg.edge{assign=[\"i = 1\"]} @state_0 -> @state_1\n ...\n }\n ```", "attributes": [ { "name": "ID", "type": "I32Attr" }, { "name": "entry", "type": "OptionalAttr" }, { "name": "num_args", "type": "I32Attr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.state", "summary": "State region", "description": "Describes a state where the subgraphs are placed in the region. \n For example:\n\n ```mlir\n sdfg.state @state_0{\n ...\n } \n ```", "attributes": [ { "name": "ID", "type": "I32Attr" }, { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.store", "summary": "Memlet store operation", "description": "Allows a state to store a value in a memlet.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n %1 = arith.constant 1 : i32\n %a = sdfg.get_access %A : !sdfg.memlet\n sdfg.store %1, %a[0] : !sdfg.memlet\n ...\n }\n ```", "operands": [ { "name": "indices", "type": "Variadic" }, { "name": "val", "type": "AnyType" }, { "name": "arr", "type": "SDFG_ArrayType" } ], "traits": [ { "type": "TypesMatchWith<'arr', 'val', '$_self.cast().getDimensions().getElementType()'>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.stream_length", "summary": "Stream length operation", "description": "Returns the length of the stream.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n %l = sdfg.stream_length %A : !sdfg.stream -> i32\n ...\n }\n ```", "operands": [ { "name": "str", "type": "SDFG_StreamType" } ], "results": [ { "name": "result", "type": "I32" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.stream_pop", "summary": "Stream pop operation", "description": "Allows a state to pop a value from a stream.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n %a = sdfg.stream_pop %A : !sdfg.stream -> i32\n ...\n }\n ```", "operands": [ { "name": "str", "type": "SDFG_StreamType" } ], "results": [ { "name": "res", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'str', 'res', '$_self.cast().getDimensions().getElementType()'>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.stream_push", "summary": "Stream push operation", "description": "Allows a state to push a value into a stream.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n %1 = arith.constant 1 : i32\n sdfg.stream_push %1, %A : i32 -> !sdfg.stream\n ...\n }\n ```", "operands": [ { "name": "val", "type": "AnyType" }, { "name": "str", "type": "SDFG_StreamType" } ], "traits": [ { "type": "TypesMatchWith<'str', 'val', '$_self.cast().getDimensions().getElementType()'>" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.subview", "summary": "Subview operation", "description": "Return a subview of a memlet with the provided offsets, sizes and \n strides.\n For example:\n\n ```mlir\n sdfg.state {\n ...\n %B = sdfg.subview %A[3, 4, 2][1, 6, 3][1, 1, 1] : !sdfg.array<8x16x4xi32> -> !sdfg.array<6x3xi32>\n ...\n }\n ```", "operands": [ { "name": "src", "type": "SDFG_ArrayType" } ], "results": [ { "name": "res", "type": "SDFG_ArrayType" } ], "attributes": [ { "name": "offsets", "type": "ArrayAttr" }, { "name": "sizes", "type": "ArrayAttr" }, { "name": "strides", "type": "ArrayAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.sym", "summary": "symbolic expression operation", "description": "Describes an arithmetic symbolic expression.\n For example:\n\n ```mlir\n sdfg.state @state_0 {\n ...\n %res = sdfg.sym(\"3*N+2\") : i32\n ...\n }\n ```", "results": [ { "name": "res", "type": "AnyTypeOf<[AnyInteger, Index]>" } ], "attributes": [ { "name": "expr", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.tasklet", "summary": "Tasklet", "description": "Describes a tasklet as a pure function. For example:\n\n ```mlir\n sdfg.tasklet @add(%a: i32, %b: i32) -> i32{\n %c = arith.addi %a, %b, : i32\n sdfg.return %c\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "ID", "type": "I32Attr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "sdfg.view_cast", "summary": "view node operation", "description": "Represents a view node to cast a memlet from one view to another.\n For example:\n\n ```mlir\n sdfg.state {\n ...\n %B = sdfg.view_cast %A : !sdfg.memlet<2x16xi32> -> !sdfg.memlet<32xi32>\n ...\n }\n ```", "operands": [ { "name": "src", "type": "SDFG_ArrayType" } ], "results": [ { "name": "res", "type": "SDFG_ArrayType" } ], "hasCustomAssemblyFormat": true }, { "name": "sdy.all_gather", "summary": "Performs an all-gather communication along axes", "description": "Gathers chunks of a tensor along axes specified in `gathering_axes`.\n\n The `gathering_axes` is a list of lists of axes. The outer list is over the\n dimensions of the tensor. Each inner list specifies the axes along which a\n separate gather should be performed on the respective dimension. It will be\n applied to the sharding of the operand (`tensor`) to obtain the sharding of\n the result (`out_sharding`).\n\n Note that `out_sharding` is not used to determine the sharding of the\n result. Instead, the sharding of the result is determined by the sharding of\n the operand and the `gathering_axes`, and `out_sharding` must match this\n inferred sharding.\n\n Example:\n ```mlir\n %1 = stablehlo.tanh(%0) {sdy.sharding = #sdy.sharding_per_value<[<@mesh, [{\"a\", \"b\", \"c\"}, {}, {\"d\"}\\]>]>} : tensor<8x8x8xf32>\n %2 = sdy.all_gather [{\"b\", \"c\"}, {}, {\"d\"}\\] %1 out_sharding=<@mesh, [{\"a\"}, {}, {}\\]> : tensor<8x8x8xf32>\n ```\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - Elements in `gathering_axes` must satisfy the constraints listed in\n `AxisRefListAttr`.\n - Applying `gathering_axes` to the operand sharding gets `out_sharding`.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "gathering_axes", "type": "Sdy_ListOfAxisRefLists" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$gathering_axes $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.all_reduce", "summary": "Perform an all-reduce comunication along axes", "description": "Reduces chunks of a tensor along axes specified in `reduction_axes`.\n The order of `reduction_axes` is not important for the result, but can\n affect the order of the corresponding replica groups.\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - `reduction_axes` must satisfy the constraints listed in `AxisRefListAttr`.\n - `reduction_axes` must be sorted w.r.t. the mesh.\n - The operand sharding and `out_sharding` must have equivalent dimension\n shardings.\n - `reduction_axes` must not overlap with the operand dimension sharding and\n replicated axes (it can overlap with unreduced axes).\n - `reduction_axes` must not overlap with the unreduced axes of\n `out_sharding`. In other words, `out_sharding` must be be replicated along\n `reduction_axes` (implicitly or explicitly).", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "reduction_axes", "type": "Sdy_AxisRefList" }, { "name": "reduction_op", "type": "DefaultValuedAttr" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "($reduction_op^)? $reduction_axes $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.all_slice", "summary": "Performs a dynamic-slice operation along axes", "description": "Slices chunks of a tensor along axes specified in `slicing_axes`. There is\n an algebric duality between `sdy.all_slice` and `sdy.all_gather`.\n\n The `slicing_axes` is a list of lists of axes. The outer list is over the\n dimensions of the tensor. Each inner list specifies the axes along which a\n slice should be performed on the respective dimension. It will be applied to\n the sharding of the operand (`tensor`) to obtain the sharding of the result\n (`out_sharding`).\n\n Note that `out_sharding` is not used to determine the sharding of the\n result. Instead, the sharding of the result is determined by the sharding of\n the operand and the `slicing_axes`, and `out_sharding` must match this\n inferred sharding.\n\n Example:\n ```mlir\n %1 = stablehlo.tanh(%0) {sdy.sharding = #sdy.sharding_per_value<[<@mesh, [{\"a\"}, {}, {}\\]>]>} : tensor<8x8x8xf32>\n %2 = sdy.all_slice [{\"b\", \"c\"}, {}, {\"d\"}\\] %1 out_sharding=<@mesh, [{\"a\", \"b\", \"c\"}, {}, {\"d\"}\\]> : tensor<8x8x8xf32>\n ```\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - Elements in `slicing_axes` must satisfy the constraints listed in\n `AxisRefListAttr`.\n - Applying `slicing_axes` to the operand sharding gets `out_sharding`.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "slicing_axes", "type": "Sdy_ListOfAxisRefLists" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$slicing_axes $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.all_to_all", "summary": "Performs an all-to-all communication along axes", "description": "For each (axes, src_dim, tgt_dim) tuple in the parameter list, this\n operation slices chunks of a tensor along dimension `tgt_dim` and axes\n specified in `axes`, scatteres those chunks along the axes, and concatenates\n them along dimension `src_dim`.\n\n This operation is essentially a combination of an all-gather along `src_dim`\n and `axes`, followed by an all-slice along `tgt_dim` and `axes`, i.e., a\n suffix of the axes sharding dimension `src_dim` on the input tensor is\n appended to the axes sharding dimension `tgt_dim` on the output tensor.\n\n The all-to-all will be applied to the sharding of the operand (`tensor`) to\n obtain the sharding of the result (`out_sharding`).\n\n Note that `out_sharding` is not used to determine the sharding of the\n result. Instead, the sharding of the result is determined by the sharding of\n the operand, `src_dim`, `tgt_dim`, and `axes`, and `out_sharding` must match\n this inferred sharding.\n\n Example:\n ```mlir\n %1 = stablehlo.tanh(%0) {sdy.sharding = #sdy.sharding_per_value<[<@mesh, [{\"a\", \"b\"}, {\"c\"}, {}, {}\\]>]>} : tensor<8x8x4x4x32>\n %2 = sdy.all_to_all [{\"b\"}: 0->2, {\"c\"}: 1->3] %1 out_sharding=<@mesh, [{\"a\"}, {}, {\"b\"}, {\"c\"}\\]> : tensor<8x8x4x4x32>\n ```\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - The parameter list must not be empty.\n - For each parameter in `params`:\n - Elements in `axes` must satisfy the constraints of `AxisRefAttr`.\n - `src_dim` and `tgt_dim` must be valid dimensions (non-negative and less\n than rank of tensor).\n - Any `src_dim` or `tgt_dim` must be unique across all parameters.\n - `src_dim` must be sorted in ascending order across all parameters.\n - Moving `axes` from `src_dim` to `tgt_dim` in the operand sharding gets\n `out_sharding`.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "params", "type": "Sdy_AllToAllParamList" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$params $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.collective_permute", "summary": "Performs a collective-permute communication to replace axes", "description": "Sends a chunk of the input tensor from each device to another to\n reorder/replace the axes that shard the tensor.\n\n A collective permute can transform the input sharding such that each\n dimension must be as sharded as it was before, i.e., it must be sharded\n along axes whose product of sizes matches that of the axes that previously\n sharded the tensor.\n\n This is useful for reordering axes in a single dimension or across different\n dimensions, and swapping sharded axes with replicated ones.\n\n In the below example, the sharded tensor size is `tensor<1x4x2xf32>`, and\n that is preserved by the collective permute.\n\n Example:\n ```mlir\n sdy.mesh @mesh = <[\"a\"=2, \"b\"=2, \"c\"=4, \"d\"=2, \"e\"=2, \"f\"=2]>\n %1 = stablehlo.tanh(%0) {sdy.sharding = #sdy.sharding_per_value<[<@mesh, [{\"a\", \"c\"}, {\"f\"}, {\"d\", \"e\"}\\]>]>} : tensor<8x8x8xf32>\n %2 = sdy.collective_permute %1 out_sharding=<@mesh, [{\"c\":(1)2, \"b\", \"f\"}, {\"a\"}, {\"e\", \"d\"}\\]> : tensor<8x8x8xf32>\n ```\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - If input and output sharding have different meshes, then those meshes must\n have exactly the same axes and different order of device ids.\n - For each dimension, the product of sharding axis sizes in `out_sharding`\n must match that of the corresponding operand dimension sharding.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.constant", "summary": "Constant operation", "description": "Produces an `output` tensor from a constant `value`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#constant\n\n NOTE: SDY defines its own constant op that isn't ConstantLike and doesn't\n have a folder, so that we'll be able to duplicate constants without any\n greedy pattern rewriter folding them back into a single constant. In this\n way, constants can be sharded differently for every use, and no propagation\n is done between constants (or constant expressions).\n\n Example:\n ```mlir\n %output = sdy.constant dense<[[0.0, 1.0], [2.0, 3.0]]> : tensor<2x2xf32>\n ```", "results": [ { "name": "output", "type": "AnyStaticShapeTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "sdy.data_flow_edge", "summary": "data flow edge op.", "description": "A data flow edge of some op X defines a bridge between a set of sources\n (each is either an operand of X or an operand of X's block terminator) and\n a set of targets (each is either a result of X or a block argument of X),\n such that all sources and targets should be sharded in the same way.\n\n An op can have multiple data flow edges that are orthogonal to one another.\n\n For example:\n\n ```mlir\n y_0, ..., y_n = while (x_0, ..., x_n)\n ((pred_arg_0,... , pred_arg_n) { ... })\n ((body_arg_0,..., body_arg_n) {\n ...\n return return_value_0, ..., return_value_n\n })\n ```\n\n This while op has n data flow edges, the i-th data flow edges is between\n sources `x_i`, `return_value_i` and targets `y_i`, `pred_arg_i`,\n `body_arg_i`.\n\n An `sdy.data_flow_edge` takes as input the owner of an edge (can be\n any of the targets, but preferably an op result rather than a block\n argument), which shouldn't have any other uses. This op isn't pure because\n it can take an input that originally didn't have any uses.\n\n The `sdy.data_flow_edge` also holds an optional sharding for all targets of\n the edge, and that sharding should be updated instead of the targets'\n sharding (if can be attached) during propagation. This is useful when an op\n has many edges, as it's much more efficient to:\n - propagate through each edge separately.\n - update the sharding of each edge separately instead of all targets at once\n (e.g. an op has a single immutable `TensorShardingPerValueAttr` for result\n shardings).\n - add each edge to the worklist separately when the sharding of a source has\n changed.\n\n Propagation will propagate shardings between all sources and targets of a\n `sdy.data_flow_edge` as if it was a regular op with the sources as operands\n and targets as results, and an identity `sdy.op_sharding_rule`. That means\n that forward propagation is from sources to targets and backwards\n propagation is from targets to sources.\n\n We don't allow the input of a `sdy.data_flow_edge` to be defined by an\n `SdyDialect` op, so we can assume that it's defined by an op that has\n unregistered `sdy.sharding` attribute.\n\n NOTE: it's NOT the responsibility of the `sdy.data_flow_edge` to link\n between sources and targets, it's simply attached to the owner of the edge.\n The op that this edge is bound to (while in the example above) is\n responsible for providing this information.", "operands": [ { "name": "input", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "sharding", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input (`sharding````=``` $sharding^)? attr-dict `:` type($result)" }, { "name": "sdy.func_data_flow_edge", "summary": "func input/output data flow edge op.", "description": "A data flow edge op but for func arguments or call results.\n When its operand is a BlockArgument; it is a bridge from the caller callOp's\n argument to the users of the func argument. There is one func data flow edge\n for each func argument. When its operand is an OpResult; it is a bridge\n from the called funcOp's return value to the users of the call result. There\n is one func data flow edge for each call result.", "operands": [ { "name": "operand", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand attr-dict `:` type($result)" }, { "name": "sdy.manual_computation", "summary": "Multi-device parallelism operation with manual collectives", "description": "Jump into a region written in terms of per-device local code with explicit\n collectives, where logical shapes match local per-device physical buffer\n shapes and collectives correspond exactly to physical cross-device\n communication.\n\n The body is local wrt the manual_axes. Propagation will occur through\n the body on any free axes - those not in the manual_axes list.\n\n Note that any unranked tensors are expected to have a sharding with rank 0,\n i.e. fully replicated.\n\n **Constraints:**\n - Elements in `in_shardings` and `out_shardings` must satisfy the constraints listed in `TensorShardingAttr`.\n - The number of global and local tensor inputs/outputs of the op region must match.\n - The manual axes must come before any free axes in each dim sharding.\n - The manual axes cannot introduce padding. Namely, the dimension size must be divisible by the corresponding manual axes size.\n - The global and local shapes of the op regions arguments/results must match.", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "in_shardings", "type": "Sdy_TensorShardingPerValue" }, { "name": "out_shardings", "type": "Sdy_TensorShardingPerValue" }, { "name": "manual_axes", "type": "Sdy_ManualAxes" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(`operands`)`\n `in_shardings````=```custom($in_shardings)\n `out_shardings````=```custom($out_shardings)\n `manual_axes````=```$manual_axes\n custom($body)\n attr-dict\n `:`\n functional-type(operands, results)" }, { "name": "sdy.mesh", "summary": "Named mesh", "description": "Defines a new named mesh. All meshes in a module must have the same number\n of devices (except for meshes with a single device_id).\n The mesh is a `Symbol` operation that appears in the module's\n `SymbolTable` and can be referenced by its `name`.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "mesh", "type": "Sdy_Mesh" } ], "assemblyFormat": "$sym_name `=` $mesh attr-dict" }, { "name": "sdy.named_computation", "summary": "named computation operation", "description": "Groups a computation, i.e. a block of operations, and gives it a name.\n Propagation will flow in/out of the region as if everything was inlined.\n\n This can be used to handle propagating through call instructions to other\n functions. Any users of Shardy should write an import/export pass that\n converts their call ops to `sdy.named_computation` ops, duplicating/copying\n the body of the called function into the body of the `named_computation`.\n\n The type of each block arguments and returned values in the region must be\n the same as the type of the operands and results type of the op.\n\n Example:\n\n ```mlir\n %1 = sdy.named_computation<\"foo\">(%0) (%arg1: tensor<16x32xf32>) {\n sdy.return %arg1 : tensor<16x32xf32>\n } : (tensor<16x32xf32>) -> tensor<16x32xf32>\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "in_shardings", "type": "OptionalAttr" }, { "name": "out_shardings", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`<`$name`>` `` `(` $operands `)`\n (`in_shardings````=```custom($in_shardings)^)?\n (`out_shardings````=```custom($out_shardings)^)?\n custom($body)\n attr-dict\n `:` functional-type($operands, results)" }, { "name": "sdy.propagation_barrier", "summary": "Propagation barrier operation", "description": "This op operates like an identity op, outputting the same value it took as\n input. But in terms of propagation, this will only allow propagation to flow\n through it in a certain direction.\n\n This prevents shardings from being propagated between the uses of the result\n of the barrier op and its operand.\n\n - `FORWARD` means shardings can only flow from the operand to the result.\n - `BACKWARD` means shardings can only flow from the result to the operand.\n - `NONE` means no sharding can propagate through this op.\n - Cannot specify `BOTH`, as this op would be redundant.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "allowed_direction", "type": "Sdy_PropagationDirection{NONE|FORWARD|BACKWARD|BOTH}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input `allowed_direction````=```$allowed_direction attr-dict `:` type($input)" }, { "name": "sdy.reduce_scatter", "summary": "Performs a reduce-scatter communication along axes", "description": "Reduces chunks of a tensor along axes specified in `reduce_scatter_axes`,\n and then scatters the result along the same axes. This operation is\n essentially a combination of an `sdy.all_reduce` followed by an\n `sdy.all_slice` along the same `reduce_scatter_axes`.\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - Elements in `reduce_scatter_axes` must satisfy the constraints listed in\n `AxisRefListAttr`.\n - Applying `reduce_scatter_axes` to the operand sharding gets\n `out_sharding`.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "reduce_scatter_axes", "type": "Sdy_ListOfAxisRefLists" }, { "name": "reduction_op", "type": "DefaultValuedAttr" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "($reduction_op^)? $reduce_scatter_axes $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.replicated_to_unreduced", "summary": "Move implicitly or explicitly replicated axes to unreduced axes.", "description": "The `axes` should be implicitly or explicitly replicated in the operand.\n This operation makes them unreduced in the result. We have the following\n relationship:\n\n all-reduce(replicated-to-unreduced(x, axes), axes) = x\n\n Example:\n ```mlir\n %1 = stablehlo.tanh(%0) {sdy.sharding = #sdy.sharding_per_value<[<@mesh, [{\"b\"}, {}, {}\\], replicated={\"c\", \"d\"}, unreduced={\"e\"}>]>} : tensor<8x8x8xf32>\n %2 = sdy.replicated_to_unreduced {\"a\", \"c\", \"f\"} %1 out_sharding=<@mesh, [{\"b\"}, {}, {}\\], replicated={\"d\"}, unreduced={\"a\", \"c\", \"e\", \"f\"}> : tensor<8x8x8xf32>\n ```\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - `axes` must satisfy the constraints listed in `AxisRefListAttr`.\n - `axes` must be sorted w.r.t. the mesh.\n - `axes` are not empty.\n - The input and output sharding must have the same dimension shardings.\n - `axes` must be implicitly or explicitly replicated in the operand sharding.\n - inUnreducedAxes + axes = outUnreducedAxes.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "axes", "type": "Sdy_AxisRefList" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$axes $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.reshard", "summary": "Reshards a tensor to a different sharding", "description": "Reshards the input tensor with the specified sharding, which is different\n from the input tensor's existing sharding.\n\n Both ShardingConstraintOp and ReshardOp attach a sharding to a tensor. Their\n lifespan is:\n 1. Before sharding propagation, ShardingConstraintOp is added by users.\n 2. Sharding propagation consumes ShardingConstraintOp. There is no\n ShardingConstraintOp in the results of sharding propagation. Instead,\n ReshardOp may be added if needed.\n 3. A partitioner converts a ReshardOp into a collective op (or an identity\n op). There should be no ReshardOp in the results of the partitioner.", "operands": [ { "name": "input", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$input $sharding attr-dict `:` type($result)" }, { "name": "sdy.return", "summary": "The `sdy.return` operation terminates the regions attached to\n `sdy` region-based ops and any other Shardy region-based ops. It is\n variadic: it takes as arguments a list of values whose types can be any (but\n of the same kind, e.g. `AnyTensor`) and therefore can be reused at various\n levels of the Shardy IR stack.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "sdy.sharded_to_unreduced", "summary": "Move some sharded axes of the operand to unreduced axes of the result.", "description": "The `axes` should be used to shard the operand. This operation makes them\n unreduced in the result. We have the following relationship:\n\n all-gather(x, axes) = all-reduce(sharded-to-unreduced(x, axes), axes), where\n all-gather, sharded-to-unreduced, all-reduce are applied on the same axes.\n\n Example:\n ```mlir\n %1 = stablehlo.tanh(%0) {sdy.sharding = #sdy.sharding_per_value<[<@mesh, [{\"a\", \"b\", \"c\"}, {}, {\"d\"}\\], unreduced={\"e\"}>]>} : tensor<8x8x8xf32>\n %2 = sdy.sharded_to_unreduced [{\"b\", \"c\"}, {}, {\"d\"}\\] %1 out_sharding=<@mesh, [{\"a\"}, {}, {}\\], unreduced={\"b\", \"c\", \"d\", \"e\"}> : tensor<8x8x8xf32>\n ```\n\n **Constraints:**\n - Must satisfy the constraints listed in `Sdy_CollectiveOpInterface`.\n - Elements in `axes` must satisfy the constraints listed in `AxisRefListAttr`.\n - Applying `axes` to the operand sharding gets `out_sharding`.", "operands": [ { "name": "tensor", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "attributes": [ { "name": "axes", "type": "Sdy_ListOfAxisRefLists" }, { "name": "out_sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$axes $tensor `out_sharding````=```$out_sharding attr-dict `:` type($result)" }, { "name": "sdy.sharding_constraint", "summary": "Constrains a tensor to the specified sharding", "description": "Attaches a sharding to an intermediate tensor (e.g. the result of a matmul)\n to indicate that this is how that tensor, or a subset of its uses, should be\n sharded.\n\n If the sharding has open dimensions and unconstraint axes, it means the\n tensor can be further sharded along the open dimensions.\n\n This op can either:\n - Have no uses (dangling) - which means the attached sharding is how the\n input tensor itself should be sharded.\n - Have uses - which means the attached sharding is how the uses of the\n sharding constraint op should be sharded, while other uses of the input\n tensor might have a different sharding (if the input tensor has no other\n uses then the behavior is the same as the no uses case).", "operands": [ { "name": "input", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "sharding", "type": "Sdy_TensorSharding" } ], "traits": [ { "type": "SameOperandsAndResultType" }, { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$input $sharding attr-dict `:` type($result)" }, { "name": "sdy.sharding_group", "summary": "Constrains tensors in the group to have the same sharding.", "description": "This op provides an interface to assign tensors to sharding groups (\n groups of tensors that will be enforced to have identical shardings).\n During propagation, as soon as one group element is sharded, all other\n members will be sharded in exactly the same way. This operation takes the\n argument group ID and returns no result, but instead modifies the internal\n sharding group representation to add the input tensor to the group with the\n given ID.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "group_id", "type": "I64Attr" } ], "assemblyFormat": "$input `group_id````=```$group_id attr-dict `:` type($input)" }, { "name": "shape.add", "summary": "Addition of sizes and indices", "description": "Adds two sizes or indices. If either operand is an error it will be\n propagated to the result. The operands can be of type `size` or `index`. If\n at least one of the operands can hold an error, i.e. if it is of type\n `size`, the result must be of type `size`. If error propagation is not\n possible because both operands are of type `index` then the result may be\n of type `size` or `index`.", "operands": [ { "name": "lhs", "type": "Shape_SizeOrIndexType" }, { "name": "rhs", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "result", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "shape.any", "summary": "Return any combination of the input shapes", "description": "This operation takes multiple input shapes or extent tensors and returns\n some combination of their dimensions. This can be best seen with examples\n below.\n\n The result is undefined, but still side-effect free, in cases where the\n inputs have differing ranks or differ in extents of shared dimensions.\n\n Example:\n ```mlir\n %s0 = shape.any [2,?], [?,3] // [2,3]\n %s1 = shape.any [?,?], [1,2] // [1,2]\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrExtentTensorType" } ], "assemblyFormat": "$inputs attr-dict `:` type($inputs) `->` type($result)" }, { "name": "shape.assuming", "summary": "Execute the region", "description": "Executes the region assuming all witnesses are true.\n\n \"assuming\" operations represent an execution order restriction to the\n compiler, information for dependent code to rely on (by assuming), and\n nothing else. They should not exist after a program is fully lowered and\n ready to execute.", "operands": [ { "name": "witness", "type": "Shape_WitnessType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "doRegion", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "shape.assuming_all", "summary": "Return a logical AND of all witnesses", "description": "Used to simplify constraints as any single failing precondition is enough\n to prevent execution.\n\n \"assuming\" operations represent an execution order restriction to the\n compiler, information for dependent code to rely on (by assuming), and\n nothing else. They should not exist after a program is fully lowered and\n ready to execute.\n\n Example:\n ```mlir\n %w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing\n %w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure\n %w2 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing\n %wf = shape.assuming_all %w0, %w1 // Failure\n %wt = shape.assuming_all %w0, %w2 // Passing\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Shape_WitnessType" } ], "assemblyFormat": "$inputs attr-dict" }, { "name": "shape.assuming_yield", "summary": "Yield operation", "description": "This yield operation represents a return operation within the\n `shape.assuming` operation region. The operation takes variable number of\n operands and produces no results. The operand number and types must match\n the number and types of parent `shape.assuming` results.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "shape.broadcast", "summary": "Returns the broadcasted output shape of two or more inputs", "description": "Returns the broadcasted shape for input shapes or extent tensors. The rest\n of this description is simplified for the 2 input case but can be extended\n to more inputs. Both operands can be of type `shape.shape` or\n `tensor`. The result is of type `shape.shape` and, if both\n operands are tensors, may be of type `tensor`.\n\n If the two operand shapes are of different rank the smaller one is padded\n with 1's from the left. The resulting broadcasted shape is then defined as\n\n result[i] = lhs[i] if lhs[i] == rhs[i]\n = lhs[i] if rhs[i] == 1\n = rhs[i] if lhs[i] == 1.\n\n In case the resulting shape is undefined, i.e. if corresponding extents are\n different from each other but none is 1, the result is an error shape.\n Likewise error values are propagated if any of the operands holds an error\n value. If the result type is an extent tensor (and can therefore not hold\n the error value) the behavior may be undefined. The optional string\n attribute can be used to describe the error case.", "operands": [ { "name": "shapes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrExtentTensorType" } ], "attributes": [ { "name": "error", "type": "OptionalAttr" } ], "assemblyFormat": "$shapes attr-dict `:` type($shapes) `->` type($result)" }, { "name": "shape.concat", "summary": "Concatenates two shapes", "description": "Creates a shape whose dimensions consist of first the dimensions from `lhs`\n followed by the dimensions of `rhs`.\n\n Example:\n concat([2,3], [4,5]) -> [2,3,4,5]\n concat([], []) -> []\n concat([], [4,5,6]) -> [4,5,6]", "operands": [ { "name": "lhs", "type": "Shape_ShapeOrExtentTensorType" }, { "name": "rhs", "type": "Shape_ShapeOrExtentTensorType" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrExtentTensorType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "shape.const_shape", "summary": "Creates a constant shape or extent tensor", "description": "Creates a constant shape or extent tensor. The individual extents are given\n as the `shape` attribute. The number of these values equals the shape's\n rank.\n\n ```mlir\n %0 = shape.const_shape [] : !shape.shape\n %1 = shape.const_shape [1, 2, 3] : !shape.shape\n %2 = shape.const_shape [4, 5, 6] : tensor<3xindex>\n ```", "results": [ { "name": "result", "type": "Shape_ShapeOrExtentTensorType" } ], "attributes": [ { "name": "shape", "type": "IndexElementsAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "shape.const_size", "summary": "Creates a constant of type `shape.size`", "description": "Creates a `shape.size` type representing the constant size given by `value`.\n\n ```mlir\n %x = shape.const_size 10\n ```", "results": [ { "name": "result", "type": "Shape_SizeType" } ], "attributes": [ { "name": "value", "type": "IndexAttr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "shape.const_witness", "summary": "An operation that returns a statically known witness value", "description": "This operation represents a statically known witness result. This can be\n often used to canonicalize/fold constraint and assuming code that will always\n pass.\n\n ```mlir\n %0 = shape.const_shape [1,2,3]\n %1 = shape.const_shape [1,2,3]\n %w0 = shape.cstr_eq(%0, %1) // Can be folded to \"const_witness true\"\n %w1 = shape.const_witness true\n %w2 = shape.assuming_all(%w0, %w2) // Can be folded to \"const_witness true\"\n ```", "results": [ { "name": "result", "type": "Shape_WitnessType" } ], "attributes": [ { "name": "passing", "type": "BoolAttr" } ], "assemblyFormat": "$passing attr-dict" }, { "name": "shape.cstr_broadcastable", "summary": "Determines if 2+ shapes can be successfully broadcasted", "description": "Given input shapes or extent tensors, return a witness specifying if they\n are broadcastable. This broadcastable follows the same logic as what\n shape.broadcast documents.\n\n \"cstr\" operations represent runtime assertions.\n\n Example:\n ```mlir\n %w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing\n %w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure\n ```", "operands": [ { "name": "shapes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Shape_WitnessType" } ], "assemblyFormat": "$shapes attr-dict `:` type($shapes)" }, { "name": "shape.cstr_eq", "summary": "Determines if all input shapes are equal", "description": "Given 1 or more input shapes, determine if all shapes are the exact same.\n\n \"cstr\" operations represent runtime assertions.\n\n Example:\n ```mlir\n %w0 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing\n %w1 = shape.cstr_eq [2,2], [1,2] // Failure\n ```", "operands": [ { "name": "shapes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Shape_WitnessType" } ], "assemblyFormat": "$shapes attr-dict `:` type($shapes)" }, { "name": "shape.cstr_require", "summary": "Represents a runtime assertion that an i1 is `true`", "description": "Represents a runtime assertion that an i1 is true. It returns a\n !shape.witness to order this assertion.\n\n For simplicity, prefer using other cstr_* ops if they are available for a\n given constraint.\n\n Example:\n ```mlir\n %bool = ...\n %w0 = shape.cstr_require %bool, \"msg\" // Passing if `%bool` is true.\n ```\n\n Since this op can be used to express many different possible assertions\n (depending on whatever computation calculated `pred`), the `msg`\n should clarify the nature of the assertion for users.", "operands": [ { "name": "pred", "type": "I1" } ], "results": [ { "name": "result", "type": "Shape_WitnessType" } ], "attributes": [ { "name": "msg", "type": "StrAttr" } ], "assemblyFormat": "$pred `,` $msg attr-dict" }, { "name": "shape.debug_print", "summary": "Prints the input shape or size", "description": "Prints the input dim or shape and passes through input.\n\n Note: This is intended for testing and debugging only.", "operands": [ { "name": "input", "type": "Shape_ShapeOrSizeType" } ], "results": [ { "name": "output", "type": "Shape_ShapeOrSizeType" } ] }, { "name": "shape.dim", "summary": "Gets the specified extent from the shape of a shaped input", "description": "Gets the extent indexed by `dim` from the shape of the `value` operand. If\n the index is error or out-of-bound then it returns an invalid size if the\n return type carries error information else the behavior is undefined.\n\n This is a convenience op that performs the equivalent of getting the extent\n of a shape (e.g., `dim(x, i) == get_extent(shape_of(x), i)`).", "operands": [ { "name": "value", "type": "AnyShaped" }, { "name": "index", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "extent", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$value `,` $index attr-dict `:` type($value) `,`type($index) `->` type($extent)" }, { "name": "shape.div", "summary": "Division of sizes and indices", "description": "Divides two sizes or indices. If either operand is an error it will be\n propagated to the result. The operands can be of type `size` or `index`.\n If at least one of the operands can hold an error, i.e. if it is of type\n `size`, the result must be of type `size`. If error propagation is not\n possible because both operands are of type `index` then the result may be\n of type `size` or `index`. If both operands and result are of type\n `index`, their runtime values could be negative. The result is rounded\n toward negative infinity, i.e. floor(lhs / rhs), such that\n\n div(lhs, rhs) * rhs + mod(lhs, rhs) = lhs\n\n always holds. If any of the values is of type `size`, the behavior for\n negative value is undefined.", "operands": [ { "name": "lhs", "type": "Shape_SizeOrIndexType" }, { "name": "rhs", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "result", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "shape.from_extent_tensor", "summary": "Creates a shape from a tensor of extents", "description": "Creates a shape from a 1D integral tensor of extents. The rank of the\n resulting shape equals the number of elements in the tensor, and the\n extents match the values of the elements.", "operands": [ { "name": "input", "type": "1DTensorOf<[Index]>" } ], "results": [ { "name": "result", "type": "Shape_ShapeType" } ], "assemblyFormat": "$input attr-dict `:` type($input)" }, { "name": "shape.from_extents", "summary": "Creates a shape from extents", "description": "Creates a shape from multiple SSA values representing the extents of\n the shape.\n\n ```mlir\n // Rank 2 shape.\n %s0 = shape.from_extents %a, %b\n // Rank 0 shape.\n %s1 = shape.from_extents\n ```", "operands": [ { "name": "extents", "type": "Variadic" } ], "results": [ { "name": "shape", "type": "Shape_ShapeType" } ], "assemblyFormat": "$extents attr-dict `:` type($extents)" }, { "name": "shape.func", "summary": "Shape function", "description": "An operation with a name containing a single `SSACFG` region which\n represents a shape transfer function or helper function for shape transfer\n function.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "shape", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "shape.function_library", "summary": "Represents shape functions and corresponding ops", "description": "Represents a list of shape functions and the ops whose shape transfer\n functions they represent.\n\n Example:\n\n ```mlir\n shape.function_library {\n func @same_result_shape(%arg: !shape.value_shape) -> !shape.shape {\n %0 = shape_of %arg : !shape.value_shape -> !shape.shape\n return %0 : !shape.shape\n }\n } mapping {\n std.atan = @same_result_shape\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "mapping", "type": "DictionaryAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "shape", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "shape.get_extent", "summary": "Gets the specified extent from a shape or extent tensor", "description": "Gets the extent indexed by `dim` from the `shape` operand. If the shape is\n an error then it returns an invalid size.", "operands": [ { "name": "shape", "type": "Shape_ShapeOrExtentTensorType" }, { "name": "dim", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "extent", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$shape `,` $dim attr-dict `:` type($shape) `,` type($dim) `->` type($extent)" }, { "name": "shape.index_to_size", "summary": "Converts a standard index to a shape size", "description": "Converts a standard index to a `shape.size`. This operation and its\n inverse, `size_to_index`, facilitate index conversion between the standard\n and the shape dialect.\n\n The behavior is undefined for negative indices.", "operands": [ { "name": "arg", "type": "Index" } ], "results": [ { "name": "result", "type": "Shape_SizeType" } ], "assemblyFormat": "$arg attr-dict" }, { "name": "shape.is_broadcastable", "summary": "Determines if 2+ shapes can be successfully broadcasted", "description": "Given multiple input shapes or extent tensors, return a predicate\n specifying if they are broadcastable. This broadcastable follows the same\n logic as what shape.broadcast documents.\n\n Concretely, shape.is_broadcastable returning true implies that\n shape.broadcast will not give an error, and shape.cstr_broadcastable will\n not result in an assertion failure. Similarly, false implies an error or\n assertion failure.\n\n Example:\n ```mlir\n %true = shape.is_broadcastable [2,2], [3,1,2]\n %false = shape.is_broadcastable [2,2], [3,2]\n ```", "operands": [ { "name": "shapes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$shapes attr-dict `:` type($shapes)" }, { "name": "shape.max", "summary": "Elementwise maximum", "description": "Computes the elementwise maximum of two sizes or shapes with equal ranks.\n If either operand is an error, then an error will be propagated to the\n result. If the input types mismatch or the ranks do not match, then the\n result is an error.", "operands": [ { "name": "lhs", "type": "Shape_ShapeOrSizeType" }, { "name": "rhs", "type": "Shape_ShapeOrSizeType" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrSizeType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "shape.meet", "summary": "Returns the least general shape or size of its operands", "description": "An operation that computes the least general shape or dim of input operands.\n This effectively asserts that corresponding static dimensions are equal.\n The behavior is to match each element of the shape/size and propagate the\n most restrictive information, returning an invalid shape if there are\n contradictory requirements. E.g., using pseudo code\n\n ```\n shape.meet([*], [*]) -> [*]\n shape.meet([*], [1, ?]) -> [1, ?]\n shape.meet([1, 2], [1, ?]) -> [1, 2]\n shape.meet([*], [1, 2]) -> [1, 2]\n shape.meet([], []) -> []\n shape.meet([], [*]) -> []\n shape.meet([], [?, ?]) -> [invalid]\n shape.meet([1, ?], [2, ?, ?]) -> [invalid]\n ```\n\n `shape.meet` also allows specifying an optional error string, that may be\n used to return an error to the user upon mismatch of dimensions.\n\n ```mlir\n %c = shape.meet %a, %b, error=\"\" : !shape.shape, !shape.shape -> !shape.shape\n ```", "operands": [ { "name": "arg0", "type": "Shape_AnyShapeOrSizeType" }, { "name": "arg1", "type": "Shape_AnyShapeOrSizeType" } ], "results": [ { "name": "result", "type": "Shape_AnyShapeOrSizeType" } ], "attributes": [ { "name": "error", "type": "OptionalAttr" } ], "assemblyFormat": "$arg0 `,` $arg1 (`,` `error` `=` $error^)? attr-dict `:`\n type($arg0) `,` type($arg1) `->` type($result)" }, { "name": "shape.min", "summary": "Elementwise minimum", "description": "Computes the elementwise minimum of two sizes or shapes with equal ranks.\n If either operand is an error, then an error will be propagated to the\n result. If the input types mismatch or the ranks do not match, then the\n result is an error.", "operands": [ { "name": "lhs", "type": "Shape_ShapeOrSizeType" }, { "name": "rhs", "type": "Shape_ShapeOrSizeType" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrSizeType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "shape.mul", "summary": "Multiplication of sizes and indices", "description": "Multiplies two sizes or indices. If either operand is an error it will be\n propagated to the result. The operands can be of type `size` or `index`. If\n at least one of the operands can hold an error, i.e. if it is of type\n `size`, the result must be of type `size`. If error propagation is not\n possible because both operands are of type `index` then the result may be\n of type `size` or `index`.", "operands": [ { "name": "lhs", "type": "Shape_SizeOrIndexType" }, { "name": "rhs", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "result", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)" }, { "name": "shape.num_elements", "summary": "Returns the number of elements for a given shape", "description": "Returns the number of elements for a given shape which is the product of\n its extents. If the argument is of type `shape` then the result will be of\n type `size` and potential errors will be propagated. Otherwise, if the\n argument is and extent tensor `tensor` then the result will be of\n type `index`.", "operands": [ { "name": "shape", "type": "Shape_ShapeOrExtentTensorType" } ], "results": [ { "name": "result", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$shape attr-dict `:` type($shape) `->` type($result)" }, { "name": "shape.rank", "summary": "Gets the rank of a shape", "description": "Returns the rank of the shape or extent tensor, i.e. the number of extents.", "operands": [ { "name": "shape", "type": "Shape_ShapeOrExtentTensorType" } ], "results": [ { "name": "rank", "type": "Shape_SizeOrIndexType" } ], "assemblyFormat": "$shape attr-dict `:` type($shape) `->` type($rank)" }, { "name": "shape.reduce", "summary": "Returns an expression reduced over a shape or extent tensor", "description": "An operation that takes as input a shape or extent tensor, and a number of\n initial values. This operation has a region that is applied repeatedly for\n every extent of the input. Starting with the initial values, the individual\n extents are then aggregated as defined by the associated region.\n\n Conceptually this op performs the following reduction:\n\n ```\n res[] = init;\n for (int i = 0, i < shape.rank(); i++) {\n res = reduce(i, shape[i], res[0], ..., res[n]);\n }\n ```\n\n Where `reduce` represents the region attached and the result of the reduce\n op is the last computed output of the reduce region. As an example, the\n number of elements can be computed as follows:\n\n ```mlir\n func.func @reduce(%shape : !shape.shape, %init : !shape.size) ->\n !shape.size {\n %num_elements = shape.reduce(%shape, %init) -> !shape.size {\n ^bb0(%index: index, %dim: !shape.size, %acc: !shape.size):\n %updated_acc = \"shape.mul\"(%acc, %dim) :\n (!shape.size, !shape.size) -> !shape.size\n shape.yield %updated_acc : !shape.size\n }\n return %num_elements : !shape.size\n }\n ```", "operands": [ { "name": "shape", "type": "Shape_ShapeOrExtentTensorType" }, { "name": "initVals", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "shape.return", "summary": "Shape function return operation", "description": "The `shape.return` operation represents a return operation within a\n function. The operation takes variable number of operands and produces no\n results.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "shape.shape_eq", "summary": "Returns whether the input shapes or extent tensors are equal", "description": "Takes one or more shape or extent tensor operands and determines whether\n they are equal. When extent tensors are compared to shapes they are\n regarded as their equivalent non-error shapes. Error shapes can be tested\n for equality like any other shape value, meaning that the error value is\n equal to itself.", "operands": [ { "name": "shapes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$shapes attr-dict `:` type($shapes)" }, { "name": "shape.shape_of", "summary": "Returns shape of a value or shaped type operand", "description": "The operation takes a value or a shaped operand as an argument and it\n returns a shape or extent tensor.", "operands": [ { "name": "arg", "type": "AnyTypeOf<[AnyShaped, Shape_ValueShapeType]>" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrExtentTensorType" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `->` type($result)" }, { "name": "shape.size_to_index", "summary": "Casts between index types of the shape and standard dialect", "description": "Converts a `shape.size` to a standard index. This operation and its\n inverse, `index_to_size`, facilitate index conversion between the standard\n and the shape dialect. The behavior is undefined for unknown and invalid\n arguments.", "operands": [ { "name": "arg", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$arg attr-dict `:` type($arg)" }, { "name": "shape.split_at", "summary": "Splits a shape at a given index", "description": "Splits a shape at a given dimension `index`, returning two shapes. If\n `index` is negative, it is treated as indexing from the back of the shape.\n This negative-handling behavior is important when handling unranked shapes,\n where the positive index is not necessarily knowable due to a dynamic\n number of leading dimensions. If the result is in extent tensor form out of\n bounds indices result in undefined behavior.\n\n Examples:\n - split_at([4,5,6], index=0) -> [], [4,5,6]\n - split_at([4,5,6], index=1) -> [4], [5,6]\n - split_at([4,5,6], index=2) -> [4,5], [6]\n - split_at([4,5,6], index=3) -> [4,5,6], []\n - split_at([4,5,6], index=4) -> error\n - split_at([4,5,6], index=-1) -> [4,5], [6]\n - split_at([4,5,6], index=-2) -> [4], [5,6]\n - split_at([4,5,6], index=-3) -> [], [4,5,6]\n - split_at([4,5,6], index=-4) -> error\n\n Requires:\n - `index` is in the range [-rank(operand),rank(operand)]", "operands": [ { "name": "operand", "type": "Shape_ShapeOrExtentTensorType" }, { "name": "index", "type": "Shape_SizeOrIndexType" } ], "results": [ { "name": "head", "type": "Shape_ShapeOrExtentTensorType" }, { "name": "tail", "type": "Shape_ShapeOrExtentTensorType" } ] }, { "name": "shape.to_extent_tensor", "summary": "Creates a dimension tensor from a shape", "description": "Converts a shape to a 1D integral tensor of extents. The number of elements\n in the tensor equals the rank of the shape, and the elements equal the\n extents of the shape.\n\n If the shape represents an error, this op's behavior is undefined.", "operands": [ { "name": "input", "type": "Shape_ShapeOrExtentTensorType" } ], "results": [ { "name": "result", "type": "IndexTensor" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($result)" }, { "name": "shape.value_as_shape", "summary": "Returns value as a shape", "description": "The operations takes a ValueShape and returns a Shape corresponding to the\n value. If the input value cannot be shape (e.g., not a 1D tensor of\n integral value representing sizes) then this propagages the error shape.\n E.g.,\n\n ```mlir\n // The following\n %0 = arith.constant dense<[1,2]> : tensor<2xi32>\n %shape = shape.value_as_shape %0 : tensor<2xi32> -> !shape.shape\n // is equivalent to\n %shape' = shape.const_shape [1, 2] : !shape.shape\n ```\n\n This operation is the complement of `shape_of` wrt ValueShape values.", "operands": [ { "name": "arg", "type": "AnyTypeOf<[1DTensorOf<[AnyInteger, Index]>, Shape_ValueShapeType]>" } ], "results": [ { "name": "result", "type": "Shape_ShapeOrExtentTensorType" } ], "assemblyFormat": "$arg attr-dict `:` type($arg) `->` type($result)" }, { "name": "shape.value_of", "summary": "Returns value of a !shape.value_shape operand", "description": "The operation takes !shape.value_shape, a.k.a. (value, shape) tuple as an\n argument, and returns its value. The behavior is undefined for unknown and\n invalid arguments.", "operands": [ { "name": "arg", "type": "Shape_ValueShapeType" } ], "results": [ { "name": "result", "type": "AnyShaped" } ], "assemblyFormat": "$arg attr-dict `:` type($result)" }, { "name": "shape.with_shape", "summary": "Returns ValueShape with given shape", "description": "Returns ValueShape with the shape updated to match the shape operand. That\n is a new ValueShape tuple is created with value equal to `operand`'s\n value and shape equal to `shape`. If the ValueShape and given `shape` are\n non-conformant, then the returned ValueShape will represent an error of\n this mismatch. Similarly if either inputs are in an error state, then an\n error is propagated.\n\n Usage:\n %0 = shape.with_shape %1, %2 : tensor<...>, !shape.shape\n\n This is used, for example, where one combines shape function calculations\n and/or call one shape function from another. E.g.,\n\n ```mlir\n func.func @shape_foobah(%a: !shape.value_shape,\n %b: !shape.value_shape,\n %c: !shape.value_shape) -> !shape.shape {\n %0 = call @shape_foo(%a, %b) :\n (!shape.value_shape, !shape.value_shape) -> !shape.shape\n %1 = shape.with_shape %b, %0 : !shape.value_shape, !shape.shape\n %2 = call @shape_bah(%c, %1) :\n (!shape.value_shape, !shape.value_shape) -> !shape.shape\n return %2 : !shape.shape\n }\n ```\n\n This op need not be a refinement of the shape. In non-error cases the input\n ValueShape's value and shape are conformant and so too for the output, but\n the result may be less specified than `operand`'s shape as `shape` is\n merely used to construct the new ValueShape. If join behavior is desired\n then a join op should be used.", "operands": [ { "name": "operand", "type": "AnyTypeOf<[AnyShaped, Shape_ValueShapeType]>" }, { "name": "shape", "type": "Shape_ShapeOrExtentTensorType" } ], "results": [ { "name": "result", "type": "Shape_ValueShapeType" } ], "assemblyFormat": "operands attr-dict `:` type($operand) `,` type($shape)" }, { "name": "shape.yield", "summary": "Returns the value to parent op", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "shard.all_gather", "summary": "All-gather over a device grid.", "description": "Concatenates all tensor slices from a device group defined by `grid_axes` along\n the tensor dimension `gather_axis` and replicates the result across all devices\n in the group.\n\n Example:\n ```mlir\n shard.grid @grid0(shape = 2x2)\n ...\n %1 = shard.all_gather %0 on @grid0 grid_axes = [1] gather_axis = 1\n : tensor<2x2xi8> -> tensor<2x4xi8>\n ```\n Input:\n ```\n +-------+-------+\n device (0, 0) -> | 1 2 | 5 6 | <- device (0, 1)\n | 3 4 | 7 8 |\n +-------+-------+\n device (1, 0) -> | 9 10 | 13 14 | <- device (1, 1)\n | 11 12 | 15 16 |\n +-------+-------+\n ```\n Result:\n ```\n gather tensor\n axis 1\n ------------>\n +-------------+\n | 1 2 5 6 | <- devices (0, 0) and (0, 1)\n | 3 4 7 8 |\n +-------------+\n | 9 10 13 14 | <- devices (1, 0) and (1, 1)\n | 11 12 15 16 |\n +-------------+\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[AnyMemRef, AnyRankedTensor]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyMemRef, AnyRankedTensor]>" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "gather_axis", "type": "IndexAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)? `gather_axis` `=` $gather_axis\n attr-dict `:` type($input) `->` type($result)" }, { "name": "shard.all_reduce", "summary": "All-reduce over a device grid.", "description": "Reduces the input tensor across all devices within the groups defined by\n `grid_axes`, using the specified reduction method. The operation performs an\n element-wise reduction over the tensor slices from all devices in each group.\n Each device in a group receives a replicated copy of the reduction result.\n The accumulation element type is determined by the result type and does not\n need to match the input element type. Before performing the reduction, each\n input element is converted to the result element type.\n\n Attributes:\n `reduction`: Indicates the reduction method.\n\n Example:\n ```\n %1 = shard.all_reduce %0 on @grid0 grid_axes = [1, 0] reduction = \n : tensor<3x4xf32> -> tensor<3x4xf64>\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[AnyMemRef, AnyRankedTensor]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyMemRef, AnyRankedTensor]>" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "reduction", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)? (`reduction` `=` $reduction^)?\n attr-dict `:` type($input) `->` type($result)" }, { "name": "shard.all_slice", "summary": "All-slice over a device grid.", "description": "Within each device group defined by `grid_axes`, slices the input tensor along\n the `slice_axis` dimension. It can be viewed as the inverse of an all-gather if\n the input data is replicated along the `slice_axis`.\n Each process simply crops its local data to the slice corresponding to its\n in-group device index.\n Notice: `AllSliceOp` does not involve any communication between devices and\n devices within a group may not have replicated input data.\n\n Example:\n ```mlir\n shard.grid @grid0(shape = 2x2)\n ...\n %1 = shard.all_slice %0 on @grid0 grid_axes = [1] slice_axis = 1\n : tensor<2x4xi8> -> tensor<2x2xi8>\n ```\n Input:\n ```\n +-------------+\n | 1 2 5 6 | <- devices (0, 0) and (0, 1)\n | 3 4 7 8 |\n +-------------+\n | 9 10 13 14 | <- devices (1, 0) and (1, 1)\n | 11 12 15 16 |\n +-------------+\n ```\n Result:\n ```\n slice tensor\n axis 1\n ------------>\n +-------+-------+\n device (0, 0) -> | 1 2 | 5 6 | <- device (0, 1)\n | 3 4 | 7 8 |\n +-------+-------+\n device (1, 0) -> | 9 10 | 13 14 | <- device (1, 1)\n | 11 12 | 15 16 |\n +-------+-------+\n ```", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" } ], "results": [ { "name": "result", "type": "AnyNon0RankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "slice_axis", "type": "IndexAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)? `slice_axis` `=` $slice_axis\n attr-dict `:` type($input) `->` type($result)" }, { "name": "shard.all_to_all", "summary": "All-to-all over a device grid.", "description": "Each participant logically splits its input along split_axis,\n then scatters the resulting pieces across the group defined by `grid_axes`.\n After receiving data pieces from other participants' scatters,\n it concatenates them along concat_axis to produce the final result.\n\n Example:\n ```\n shard.grid @grid0(shape = 3)\n ...\n %1 = shard.all_to_all %0 on @grid0 grid_axes = [0]\n split_axis = 0 concat_axis = 0\n : tensor<3x2xi8> -> tensor<3x2xi8>\n ```\n Input:\n ```\n device device device\n (0) (1) (2)\n +-------+-------+-------+ | split and concat along\n | 11 12 | 21 22 | 31 32 | | tensor axis 0\n | 13 14 | 23 24 | 33 34 | ↓\n | 15 16 | 25 26 | 35 36 |\n +-------+-------+-------+\n ```\n Result:\n ```\n device device device\n (0) (1) (2)\n +-------+-------+-------+\n | 11 12 | 13 14 | 15 16 |\n | 21 22 | 23 24 | 25 26 |\n | 31 32 | 33 34 | 35 36 |\n +-------+-------+-------+\n ```", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" } ], "results": [ { "name": "result", "type": "AnyNon0RankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "split_axis", "type": "IndexAttr" }, { "name": "concat_axis", "type": "IndexAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n `split_axis` `=` $split_axis\n `concat_axis` `=` $concat_axis\n attr-dict `:` type($input) `->` type($result)" }, { "name": "shard.broadcast", "summary": "Broadcast over a device grid.", "description": "Copies the input tensor on `root` to all devices in each group defined by\n `grid_axes`. The `root` device is defined by its in-group multi-index.\n The contents of input tensors on non-root devices are ignored.\n \n Example:\n ```\n shard.grid @grid0(shape = 2x2)\n\n %1 = shard.broadcast %0 on @grid0\n grid_axes = [0]\n root = [0]\n : (tensor<2xi8>) -> tensor<2xi8>\n ```\n \n Input:\n ```\n +-------+-------+ | broadcast\n device (0, 0) -> | 1 2 | 3 4 | <- device (0, 1) | along axis 0\n +-------+-------+ ↓\n device (1, 0) -> | * * | * * | <- device (1, 1)\n +-------+-------+\n ```\n\n Output:\n ```\n +-------+-------+\n device (0, 0) -> | 1 2 | 3 4 | <- device (0, 1)\n +-------+-------+\n device (1, 0) -> | 1 2 | 3 4 | <- device (1, 1)\n +-------+-------+\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "root_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "root", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n `root` `=` custom($root_dynamic, $root)\n attr-dict `:` functional-type(operands, results)" }, { "name": "shard.gather", "summary": "Gather over a device grid.", "description": "Concatenates all tensor slices from a device group defined by `grid_axes` along\n the tensor dimension `gather_axis` and returns the resulting tensor on each\n `root` device. The result on all other (non-root) devices is undefined.\n The `root` device is defined by its in-group multi-index.\n\n Example:\n ```mlir\n shard.grid @grid0(shape = 2x2)\n ...\n %1 = shard.gather %0 on @grid0 grid_axes = [1]\n gather_axis = 1 root = [1]\n : (tensor<2x2xi8>) -> tensor<2x4xi8>\n ```\n Input:\n ```\n gather tensor\n axis 1\n ------------>\n +-------+-------+\n device (0, 0) -> | 1 2 | 5 6 | <- device (0, 1)\n | 3 4 | 7 8 |\n +-------+-------+\n device (1, 0) -> | 9 10 | 13 14 | <- device (1, 1)\n | 11 12 | 15 16 |\n +-------+-------+\n ```\n Result:\n ```\n +-------------+\n | 1 2 5 6 | <- devices (0, 1)\n | 3 4 7 8 |\n +-------------+\n | 9 10 13 14 | <- devices (1, 1)\n | 11 12 15 16 |\n +-------------+\n ```\n Devices `(0, 0)` and `(1, 0)` have undefined result.", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" }, { "name": "root_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyNon0RankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "gather_axis", "type": "IndexAttr" }, { "name": "root", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n `gather_axis` `=` $gather_axis\n `root` `=` custom($root_dynamic, $root)\n attr-dict `:` functional-type(operands, results)" }, { "name": "shard.get_sharding", "summary": "Get the sharding of the given tensor.", "description": "This operation returns the sharding of the given tensor as a Sharding.", "operands": [ { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "Shard_Sharding" } ], "assemblyFormat": "$source attr-dict `:` type($source) `->` type($result)" }, { "name": "shard.grid", "summary": "Description of a device/process grid.", "description": "The shard.grid operation is a symbol operation that identifies a specific\n grid. The operation has three attributes:\n\n 1. `sym_name`: This attribute uniquely identifies the name of the grid.\n This name serves as a symbolic reference to the grid throughout\n the MLIR module, allowing for consistent referencing and easier debugging.\n\n 2. `shape`: This attribute represents the shape of the device grid.\n It uses the same notation as a tensor shape. Also allowing for dynamic\n dimensions.\n This flexibility allows for dynamic device assignment or configurations\n where the exact number of devices might not be determined during compile\n time.\n For example `2x?x4`.\n\n Example:\n ```\n // A device grid with 3 axes, the total device number is 4 * 8 * 12\n // The dimension sizes are 4, 8, 12 \n shard.grid @grid0(shape = 4x8x12)\n\n // A device grid with 2 axes, the total device number is unknown\n // The first dimension size is 4 and the second is unknown\n shard.grid @grid1(shape = 4x?)\n\n // A device grid with 2 axes, the total device number is unknown\n // The first dimension size is unknown and the second is 4\n shard.grid @grid2(shape = ?x4)\n\n // A device grid with 2 axes, the number of devices along both axes\n // is unknown\n shard.grid @grid3(shape = ?x?)\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "shape", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$sym_name `(` `shape` `=` custom($shape) `)`\n attr-dict" }, { "name": "shard.grid_shape", "summary": "Get the shape of the grid.", "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "axes", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$grid (`axes` `=` $axes^)?\n attr-dict `:` type($result)" }, { "name": "shard.neighbors_linear_indices", "summary": "For given grid index get the linear indices of the direct neighbor processes along the given split.", "description": "Example:\n ```\n shard.grid @grid0(shape = 10x20x30)\n %c1 = arith.constant 1 : index\n %c2 = arith.constant 2 : index\n %c3 = arith.constant 3 : index\n %idx = shard.neighbors_linear_indices on @grid[%c1, %c2, %c3] split_axes = [1] : index\n ```\n The above returns two indices, `633` and `693`, which correspond to the\n index of the previous process `(1, 1, 3)`, and the next process \n `(1, 3, 3)` along the split axis `1`.\n\n A negative value is returned if there is no neighbor in the respective\n direction along the given `split_axes`.", "operands": [ { "name": "device", "type": "Variadic" } ], "results": [ { "name": "neighbor_down", "type": "Index" }, { "name": "neighbor_up", "type": "Index" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "split_axes", "type": "Shard_GridAxesAttr" } ], "assemblyFormat": "`on` $grid `[` $device `]`\n `split_axes` `=` $split_axes\n attr-dict `:` type(results)" }, { "name": "shard.process_linear_index", "summary": "Get the linear index of the current device.", "description": "Example:\n ```\n %idx = shard.process_linear_index on @grid : index\n ```\n if `@grid` has shape `(10, 20, 30)`, a device with multi\n index `(1, 2, 3)` will have linear index `3 + 30*2 + 20*30*1`.", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`on` $grid attr-dict `:` type($result)" }, { "name": "shard.process_multi_index", "summary": "Get the multi index of current device along specified grid axes.", "description": "It is used in the SPMD format of IR.\n The `axes` mush be non-negative and less than the total number of grid axes.\n If the axes are empty then get the index along all axes.", "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "axes", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`on` $grid (`axes` `=` $axes^)?\n attr-dict `:` type($result)" }, { "name": "shard.recv", "summary": "Send over a device grid.", "description": "Receive tensor from device `source`, which is defined by its in-group\n multi-index. The groups are defined by `grid_axes`.\n The content of input tensor is ignored.", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" }, { "name": "source_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "source", "type": "OptionalAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n (`source` `=` custom($source_dynamic, $source)^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "shard.reduce", "summary": "Reduce over a device grid.", "description": "Reduces the input tensor across all devices within the groups defined by\n `grid_axes`, using the specified reduction method. The operation performs an\n element-wise reduction over the tensor slices from all devices in each group.\n The reduction result will be returned on the `root` device of each group.\n It is undefined on all other (non-root) devices.\n The `root` device is defined by its in-group multi-index.\n The accumulation element type is determined by the result type and does not\n need to match the input element type. Before performing the reduction, each\n input element is converted to the result element type.\n\n Attributes:\n `reduction`: Indicates the reduction method.\n\n Example:\n ```\n %1 = shard.reduce %0 on @grid0 grid_axes = [1, 0]\n reduction = root = [2, 3]\n : (tensor<3x4xf32>) -> tensor<3x4xf64>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "root_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "reduction", "type": "DefaultValuedAttr" }, { "name": "root", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n (`reduction` `=` $reduction^)?\n `root` `=` custom($root_dynamic, $root)\n attr-dict `:` functional-type(operands, results)" }, { "name": "shard.reduce_scatter", "summary": "Reduce-scatter over a device grid.", "description": "Reduces the input tensor across all devices within the groups defined by\n `grid_axes` using the specified reduction method. The reduction is performed\n element-wise across the tensor pieces from all devices in the group.\n After reduction, the reduction result is scattered (split and distributed)\n across the device group along `scatter_dim`.\n Example:\n ```\n shard.grid @grid0(shape = 2x2)\n ...\n %1 = shard.reduce_scatter %0 on @grid0 grid_axes = [1]\n reduction = scatter_dim = 0\n : tensor<2x2xf32> -> tensor<1x2xf64>\n ```\n Input:\n ```\n device\n (0, 1)\n ↓\n +-------+-------+ | scatter tensor\n device (0, 0) -> | 1 2 | 5 6 | | axis 0\n | 3 4 | 7 8 | ↓\n +-------+-------+\n device (1, 0) -> | 9 10 | 13 14 |\n | 11 12 | 15 16 |\n +-------+-------+\n ↑\n device\n (1, 1)\n ```\n Result:\n ```\n +-------+\n | 5 6 | <- devices (0, 0)\n +-------+\n | 7 8 | <- devices (0, 1)\n +-------+\n | 13 14 | <- devices (1, 0)\n +-------+\n | 15 16 | <- devices (1, 1)\n +-------+\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[AnyMemRef, AnyRankedTensor]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyMemRef, AnyRankedTensor]>" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "reduction", "type": "DefaultValuedAttr" }, { "name": "scatter_dim", "type": "IndexAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n (`reduction` `=` $reduction^)?\n `scatter_dim` `=` $scatter_dim\n attr-dict `:` type($input) `->` type($result)" }, { "name": "shard.scatter", "summary": "Scatter over a device grid.", "description": "For each device group defined by `grid_axes`, the input tensor on the `root`\n device is split along axis `scatter_dim` and distributed across the group.\n The content of the input on all other (non-root) devices is ignored.\n The `root` device is defined by its in-group multi-index.\n\n Example:\n ```\n shard.grid @grid0(shape = 2x2)\n %1 = shard.scatter %0 on @grid0 grid_axes = [0]\n scatter_dim = 0\n root = [1]\n : (tensor<2x2xi8>) -> tensor<1x2xi8>\n ```\n\n Input:\n ```\n device\n (0, 1)\n ↓\n +-------+-------+ | scatter tensor\n device (0, 0) -> | * * | * * | | axis 0\n | * * | * * | ↓\n +-------+-------+\n device (1, 0) -> | 1 2 | 5 6 |\n | 3 4 | 7 8 |\n +-------+-------+\n ↑\n device\n (1, 1)\n ```\n \n Result:\n ```\n device\n (0, 1)\n ↓\n +-------+-------+\n device (0, 0) -> | 1 2 | 5 6 |\n +-------+-------+ \n device (1, 0) -> | 3 4 | 7 8 |\n +-------+-------+\n ↑\n device\n (1, 1)\n ```", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" }, { "name": "root_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "scatter_dim", "type": "IndexAttr" }, { "name": "root", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n `scatter_dim` `=` $scatter_dim\n `root` `=` custom($root_dynamic, $root)\n attr-dict `:` functional-type(operands, results)" }, { "name": "shard.send", "summary": "Send over a device grid.", "description": "Send input tensor to device `destination`, which is defined by its in-group\n multi-index. The groups are defined by `grid_axes`.", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" }, { "name": "destination_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "destination", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n `destination` `=` custom($destination_dynamic, $destination)\n attr-dict `:` functional-type(operands, results)" }, { "name": "shard.shard", "summary": "Annotate on how a tensor is sharded across a shard.", "description": "The shard.shard operation is designed to specify and guide the sharding\n behavior of a tensor value across a grid topology. This operation has two\n operands and two optional attributes:\n\n 1. `input`: This operand represents the tensor value that needs to be\n annotated for sharding.\n\n 2. `sharding`: This attribute is type of `ShardingType`, which is the core data\n structure to represent distribution of a tensor on a shard. it is typically defined\n by an `shard.sharding` operation.\n\n 3. `annotate_for_users`: A unit attribute addressing the scenario when a\n tensor's sharding annotation differs based on its context of use (either as\n a result or an operand). If specified, the sharding pertains to specific\n users of the tensor value, indicating how it should be considered when used\n as an operand in subsequent operations. If not, the sharding applies to the\n operation that defines the tensor value.\n\n Example:\n ```\n func.func @only_result_annotated(%arg0 : tensor<4x8xf32>) -> () {\n %sharding = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding : tensor<4x8xf32>\n ...\n }\n\n func.func @only_operand_annotated(%arg0 : tensor<4x8xf32>) -> () {\n %sharding = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding annotate_for_users : tensor<4x8xf32>\n ...\n }\n \n func.func @two_operands_annotated(%arg0 : tensor<4x8xf32>, %arg1 : tensor<16x8xf32>) -> () {\n %sharding = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding annotate_for_users : tensor<4x8xf32>\n %1 = shard.shard %arg1 to %sharding annotate_for_users : tensor<16x8xf32>\n ...\n }\n\n // The first shard.shard op applies to %arg0, the second shard.shard op\n // applies for the operand of op0, the third shard.shard op applies for the\n // operand of op2\n func.func @both_result_and_multi_operands_annotated(\n %arg0 : tensor<4x8xf32>) -> () {\n %sharding = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding : tensor<4x8xf32>\n %sharding1 = shard.sharding @grid0 split_axes = [[1]] : !shard.sharding\n %1 = shard.shard %0 to %sharding1 annotate_for_users : tensor<4x8xf32>\n %sharding2 = shard.sharding @grid0 split_axes = [[2]] : !shard.sharding\n %2 = shard.shard %0 to %sharding2 annotate_for_users : tensor<4x8xf32>\n \"op0\"(%1) : ...\n \"op1\"(%2) : ...\n ...\n }\n ```\n\n The following usages are undefined:\n ```\n func.func @annotate_on_same_result_with_different_sharding(\n %arg0 : tensor<4x8xf32>) -> () {\n %sharding1 = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %sharding2 = shard.sharding @grid0 split_axes = [[1]] : !shard.sharding\n %0 = shard.shard %arg0 to $sharding1 : tensor<4x8xf32>\n %1 = shard.shard %0 to sharding2 : tensor<4x8xf32>\n ...\n }\n\n func.func @annotate_on_same_result_same_value_with_different_sharding(\n %arg0 : tensor<4x8xf32>) -> () {\n %sharding1 = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %sharding2 = shard.sharding @grid0 split_axes = [[1]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding1 : tensor<4x8xf32>\n %1 = shard.shard %arg0 to %sharding2 : tensor<4x8xf32>\n ...\n }\n\n func.func @annotate_on_same_operand_with_different_sharding(\n %arg0 : tensor<4x8xf32>) -> () {\n %sharding1 = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %sharding2 = shard.sharding @grid0 split_axes = [[1]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding1 annotate_for_users : tensor<4x8xf32>\n %1 = shard.shard %0 to %sharding2 annotate_for_users : tensor<4x8xf32>\n ...\n }\n\n func.func @result_annotated_after_operand(\n %arg0 : tensor<4x8xf32>) -> () {\n %sharding1 = shard.sharding @grid0 split_axes = [[0]] : !shard.sharding\n %sharding2 = shard.sharding @grid0 split_axes = [[1]] : !shard.sharding\n %0 = shard.shard %arg0 to %sharding1 annotate_for_users : tensor<4x8xf32>\n %1 = shard.shard %0 to %sharding2 : tensor<4x8xf32>\n ...\n }\n ```", "operands": [ { "name": "src", "type": "AnyRankedTensor" }, { "name": "sharding", "type": "Shard_Sharding" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "annotate_for_users", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'src']>" } ], "assemblyFormat": "$src `to` $sharding\n (`annotate_for_users` $annotate_for_users^)?\n attr-dict `:` type($result)" }, { "name": "shard.shard_shape", "summary": "Get the shard shape for a given process/device.", "description": "The device/process id is a multi-index of the device/process in the shard.\n This operation might be used during partition when the shard shape depends\n on (non-constant) values used in `shard.sharding`.", "operands": [ { "name": "dims_dynamic", "type": "Variadic" }, { "name": "sharding", "type": "Shard_Sharding" }, { "name": "device_dynamic", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dims", "type": "DenseI64ArrayAttr" }, { "name": "device", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`dims` `=` custom($dims_dynamic, $dims)\n `sharding` `=` $sharding\n `device` `=` custom($device_dynamic, $device)\n attr-dict `:` type(results)" }, { "name": "shard.sharding", "summary": "Define a sharding of a tensor.", "description": "The Sharding specifies how a tensor is sharded and distributed across the\n process shard. It is typically used in a `shard.shard` operation.\n The operation has the following attributes and operands:\n\n 1. `grid`: this attribute is a FlatSymbolRefAttr that refers to the device\n grid where the distributed tensor is placed. The symbol must resolve to a\n `shard.grid` operation.\n\n 2. `split_axes`: is an array composed of int64_t sub-arrays. The outer array's\n maximum size is the `rank` of the related tensor. For the i-th sub-array, if\n its value is [x, y], it indicates that the tensor's i-th dimension is splitted\n along the x and y axes of the device grid.\n\n 3. [Optional] Sizes of halos to be added for each sharded tensor dimension.\n `halo_sizes` is provided as a flattened 1d array of i64s, 2 values for each\n sharded dimension. `halo_sizes = [1, 2]` means that the first sharded dimension\n gets an additional halo of size 1 at the start of the first dimension and a halo\n size is 2 at its end. `halo_sizes = [1, 2, 2, 3]` defines halos for the first 2\n sharded dimensions e.g. the first sharded dimension gets `[1,2]` halos and the\n seconds gets `[2,3]` halos. `?` indicates dynamic halo sizes.\n \n 4. [Optional] Offsets for each shard and sharded tensor dimension.\n `sharded_dims_offsets` is provided as a flattened 1d array of i64s. For each\n sharded tensor dimension the offsets (starting index) of all shards in that\n dimension and an additional value for the end of the last shard are provided.\n For a 1d sharding this means that position `i` has the exclusive prefix sum for\n shard `i`, and since only contiguous sharding is supported, its inclusive prefix\n sum is at position 'i+1'.\n \n Assuming a 3d-tensor of shape 32x32x32 with the first 2 dimensions being sharded,\n `sharded_dims_offsets` = [0, 24, 32, 0, 20, 32] means that the first device of\n the device-grid will get a shard of shape 24x20x32 and the second device will get\n a shard of shape 8x12x32. `?` indicates dynamic shard dimensions.\n \n `halo_sizes` and `sharded_dims_offsets` are mutually exclusive.\n\n Examples:\n\n ```\n shard.grid @grid0(shape = 2x2x4)\n shard.grid @grid1d_4(shape = 4)\n\n // The tensor is fully replicated on @grid0.\n // Currently, there must be at least one sub-array present in axes, even\n // if it's empty. Otherwise, a parsing error will occur.\n %sharding0 = shard.sharding @grid0 split_axes = [[]]\n\n // The tensor is sharded on the first dimension along axis 0 of @grid0\n %sharding1 = shard.sharding @grid0 split_axes = [[0]]\n\n // Could be used for a shard.shard op\n %sharded0 = shard.shard %arg0 to %sharding3 : tensor<4x8xf32>\n\n // The tensor is sharded on its first dimension along axis 0 of @grid0 and\n // and it has halo-sizes of 1 and 2 on the sharded dim.\n %halo_sharding = shard.sharding @grid0 split_axes = [[0]] halo_sizes = [1, 2]\n %sharded1 = shard.shard %arg0 to %halo_sharding : tensor<4x8xf32>\n \n // The tensor is sharded on its second dimension along axis 0 of @grid1d_4\n // and it has pre-defined shard sizes. The shards of the devices will have\n // the following shapes: [4x2, 4x3, 4x4, 4x5]\n %sharding4 = shard.sharding @grid1d_4 split_axes = [[], [0]] sharded_dims_offsets = [0, 2, 5, 9, 14]\n %sharded2 = shard.shard %arg0 to %sharding4 : tensor<4x14xf32>\n ```", "operands": [ { "name": "dynamic_sharded_dims_offsets", "type": "Variadic" }, { "name": "dynamic_halo_sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Shard_Sharding" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "split_axes", "type": "Shard_GridAxesArrayAttr" }, { "name": "static_sharded_dims_offsets", "type": "DefaultValuedAttr" }, { "name": "static_halo_sizes", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$grid\n `split_axes` `=` $split_axes\n (`halo_sizes` `=` custom($dynamic_halo_sizes, $static_halo_sizes)^)?\n (`sharded_dims_offsets` `=` custom($dynamic_sharded_dims_offsets, $static_sharded_dims_offsets)^)?\n attr-dict `:` type($result)" }, { "name": "shard.shift", "summary": "Shift over a device grid.", "description": "Within each device group defined by `grid_axes`, shifts input tensors along the\n device grid's axis `shift_axis` by the specified offset. The `shift_axis` must\n be one of the `grid_axes`. If the `rotate` attribute is set, the shift is circular.\n That is, the offset wraps around according to the group size along `shift_axis`.\n Otherwise, the results on devices without a corresponding source are undefined.\n\n Example:\n ```\n shard.grid @grid0(shape = 2x4)\n %1 = shard.shift on @grid0 grid_axes = [1]\n shift_axis = 1 offset = 2 rotate\n : tensor<2xi8> -> tensor<2xi8>\n ```\n\n Input:\n ```\n grid axis 1\n ----------->\n\n +----+----+----+----+\n | 1 | 2 | 3 | 4 |\n +----+----+----+----+\n | 5 | 6 | 7 | 8 |\n +----+----+----+----+\n ```\n\n Result:\n ```\n +----+----+----+----+\n | 3 | 4 | 1 | 2 |\n +----+----+----+----+\n | 7 | 8 | 5 | 6 |\n +----+----+----+----+\n ```", "operands": [ { "name": "input", "type": "AnyNon0RankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "grid_axes", "type": "DefaultValuedAttr" }, { "name": "shift_axis", "type": "IndexAttr" }, { "name": "offset", "type": "I64Attr" }, { "name": "rotate", "type": "UnitAttr" } ], "assemblyFormat": "$input `on` $grid (`grid_axes` `=` $grid_axes^)?\n `shift_axis` `=` $shift_axis\n `offset` `=` $offset\n (`rotate` $rotate^)?\n attr-dict `:` type($input) `->` type($result)" }, { "name": "shard.update_halo", "summary": "Update halo data.", "description": "This operation updates halo regions of shards, e.g. if their sharding\n specified halos and the actual tensor/memref data might have changed\n on the remote devices. Changes might be caused by mutating operations\n and/or if the new halo regions are larger than the existing ones.\n\n Destination is supposed to be initialized with the local data (not halos).\n\n Assumes all devices hold tensors with same-sized halo data as specified\n by `source_halo_sizes/static_source_halo_sizes` and\n `destination_halo_sizes/static_destination_halo_sizes` in source shard\n and destination/result shard.\n\n `split_axes` specifies for each tensor axis along which grid axes its halo\n data is updated.", "operands": [ { "name": "destination", "type": "AnyTypeOf<[AnyNon0RankedMemRef, AnyNon0RankedTensor]>" }, { "name": "halo_sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[AnyNon0RankedMemRef, AnyNon0RankedTensor]>" } ], "attributes": [ { "name": "grid", "type": "FlatSymbolRefAttr" }, { "name": "split_axes", "type": "Shard_GridAxesArrayAttr" }, { "name": "static_halo_sizes", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'result', 'destination', '$_self'>" } ], "assemblyFormat": "$destination\n `on` $grid\n `split_axes` `=` $split_axes\n (`halo_sizes` `=` custom($halo_sizes, $static_halo_sizes)^)?\n attr-dict `:` type($result)" }, { "name": "smt.and", "summary": "a boolean conjunction", "description": "This operation performs a boolean conjunction.\n The semantics are equivalent to the 'and' operator in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).\n of the SMT-LIB Standard 2.7.\n\n It supports a variadic number of operands, but requires at least two.\n This is because the operator is annotated with the `:left-assoc` attribute\n which means that `op a b c` is equivalent to `(op (op a b) c)`.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "BoolType" } ], "assemblyFormat": "$inputs attr-dict" }, { "name": "smt.apply_func", "summary": "apply a function", "description": "This operation performs a function application as described in the\n [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).\n It is part of the language itself rather than a theory or logic.", "operands": [ { "name": "func", "type": "SMTFuncType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyNonFuncSMTType" } ], "traits": [ { "type": "TypesMatchWith<'func', 'result', 'cast($_self).getRangeType()'>" }, { "type": "TypesMatchWith<'func', 'args', 'cast($_self).getDomainTypes()'>" } ], "assemblyFormat": "$func `(` $args `)` attr-dict `:` qualified(type($func))" }, { "name": "smt.array.broadcast", "summary": "construct an array with the given value stored at every index", "description": "This operation represents a broadcast of the 'value' operand to all indices\n of the array. It is equivalent to\n ```\n %0 = smt.declare_fun \"array\" : !smt.array<[!smt.int -> !smt.bool]>\n %1 = smt.forall [\"idx\"] {\n ^bb0(%idx: !smt.int):\n %2 = smt.array.select %0[%idx] : !smt.array<[!smt.int -> !smt.bool]>\n %3 = smt.eq %value, %2 : !smt.bool\n smt.yield %3 : !smt.bool\n }\n smt.assert %1\n // return %0\n ```\n\n In SMT-LIB, this is frequently written as\n `((as const (Array Int Bool)) value)`.", "operands": [ { "name": "value", "type": "AnySMTType" } ], "results": [ { "name": "result", "type": "ArrayType" } ], "traits": [ { "type": "TypesMatchWith<'result', 'value', 'cast($_self).getRangeType()'>" } ], "assemblyFormat": "$value attr-dict `:` qualified(type($result))" }, { "name": "smt.array.select", "summary": "get the value stored in the array at the given index", "description": "This operation is retuns the value stored in the given array at the given\n index. The semantics are equivalent to the `select` operator defined in the\n [SMT ArrayEx theory](https://smtlib.cs.uiowa.edu/Theories/ArraysEx.smt2) of\n the SMT-LIB standard 2.7.", "operands": [ { "name": "array", "type": "ArrayType" }, { "name": "index", "type": "AnySMTType" } ], "results": [ { "name": "result", "type": "AnySMTType" } ], "traits": [ { "type": "TypesMatchWith<'array', 'index', 'cast($_self).getDomainType()'>" }, { "type": "TypesMatchWith<'array', 'result', 'cast($_self).getRangeType()'>" } ], "assemblyFormat": "$array `[` $index `]` attr-dict `:` qualified(type($array))" }, { "name": "smt.array.store", "summary": "stores a value at a given index and returns the new array", "description": "This operation returns a new array which is the same as the 'array' operand\n except that the value at the given 'index' is changed to the given 'value'.\n The semantics are equivalent to the 'store' operator described in the\n [SMT ArrayEx theory](https://smtlib.cs.uiowa.edu/Theories/ArraysEx.smt2) of\n the SMT-LIB standard 2.7.", "operands": [ { "name": "array", "type": "ArrayType" }, { "name": "index", "type": "AnySMTType" }, { "name": "value", "type": "AnySMTType" } ], "results": [ { "name": "result", "type": "ArrayType" } ], "traits": [ { "type": "TypesMatchWith<'array', 'index', 'cast($_self).getDomainType()'>" }, { "type": "TypesMatchWith<'array', 'value', 'cast($_self).getRangeType()'>" }, { "type": "AllTypesMatch<['array', 'result']>" } ], "assemblyFormat": "$array `[` $index `]` `,` $value attr-dict `:` qualified(type($array))" }, { "name": "smt.assert", "summary": "assert that a boolean expression holds", "operands": [ { "name": "input", "type": "BoolType" } ], "assemblyFormat": "$input attr-dict" }, { "name": "smt.bv.add", "summary": "equivalent to bvadd in SMT-LIB", "description": "This operation performs addition. The semantics are\n equivalent to the `bvadd` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.and", "summary": "equivalent to bvand in SMT-LIB", "description": "This operation performs bitwise AND. The semantics are\n equivalent to the `bvand` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.ashr", "summary": "equivalent to bvashr in SMT-LIB", "description": "This operation performs arithmetic shift right. The semantics are\n equivalent to the `bvashr` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.cmp", "summary": "compare bit-vectors interpreted as signed or unsigned", "description": "This operation compares bit-vector values, interpreting them as signed or\n unsigned values depending on the predicate. The semantics are equivalent to\n the `bvslt`, `bvsle`, `bvsgt`, `bvsge`, `bvult`, `bvule`, `bvugt`, or\n `bvuge` operator defined in the SMT-LIB 2.7 standard depending on the\n specified predicate. More precisely in the\n [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BoolType" } ], "attributes": [ { "name": "pred", "type": "BVCmpPredicate{slt|sle|sgt|sge|ult|ule|ugt|uge}" } ], "assemblyFormat": "$pred $lhs `,` $rhs attr-dict `:` qualified(type($lhs))" }, { "name": "smt.bv.concat", "summary": "bit-vector concatenation", "description": "This operation concatenates bit-vector values with semantics equivalent to\n the `concat` operator defined in the SMT-LIB 2.7 standard. More precisely in\n the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.\n\n Note that the following equivalences hold:\n * `smt.bv.concat %a, %b : !smt.bv<4>, !smt.bv<4>` is equivalent to\n `(concat a b)` in SMT-LIB\n * `(= (concat #xf #x0) #xf0)`", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type(operands))" }, { "name": "smt.bv.constant", "summary": "produce a constant bit-vector", "description": "This operation produces an SSA value equal to the bit-vector constant\n specified by the 'value' attribute.\n Refer to the `BitVectorAttr` documentation for more information about\n the semantics of bit-vector constants, their format, and associated sort.\n The result type always matches the attribute's type.\n\n Examples:\n ```mlir\n %c92_bv8 = smt.bv.constant #smt.bv<92> : !smt.bv<8>\n %c5_bv4 = smt.bv.constant #smt.bv<5> : !smt.bv<4>\n ```", "results": [ { "name": "result", "type": "BitVectorType" } ], "attributes": [ { "name": "value", "type": "BitVectorAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ], "assemblyFormat": "qualified($value) attr-dict" }, { "name": "smt.bv.extract", "summary": "bit-vector extraction", "description": "This operation extracts the range of bits starting at the 'lowBit' index\n (inclusive) up to the 'lowBit' + result-width index (exclusive). The\n semantics are equivalent to the `extract` operator defined in the SMT-LIB\n 2.7 standard. More precisely in the\n [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.\n\n Note that `smt.bv.extract %bv from 2 : (!smt.bv<32>) -> !smt.bv<16>` is\n equivalent to `((_ extract 17 2) bv)`, i.e., the SMT-LIB operator takes the\n low and high indices where both are inclusive. The following equivalence\n holds: `(= ((_ extract 3 0) #x0f) #xf)`", "operands": [ { "name": "input", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "attributes": [ { "name": "lowBit", "type": "I32Attr" } ], "assemblyFormat": "$input `from` $lowBit attr-dict `:` functional-type($input, $result)" }, { "name": "smt.bv.lshr", "summary": "equivalent to bvlshr in SMT-LIB", "description": "This operation performs logical shift right. The semantics are\n equivalent to the `bvlshr` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.mul", "summary": "equivalent to bvmul in SMT-LIB", "description": "This operation performs multiplication. The semantics are\n equivalent to the `bvmul` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.neg", "summary": "equivalent to bvneg in SMT-LIB", "description": "This operation performs two's complement unary minus. The semantics are\n equivalent to the `bvneg` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "input", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.not", "summary": "equivalent to bvnot in SMT-LIB", "description": "This operation performs bitwise negation. The semantics are\n equivalent to the `bvnot` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "input", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.or", "summary": "equivalent to bvor in SMT-LIB", "description": "This operation performs bitwise OR. The semantics are\n equivalent to the `bvor` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.repeat", "summary": "repeated bit-vector concatenation of one value", "description": "This operation is a shorthand for repeated concatenation of the same\n bit-vector value, i.e.,\n ```mlir\n smt.bv.repeat 5 times %a : !smt.bv<4>\n // is the same as\n %0 = smt.bv.repeat 4 times %a : !smt.bv<4>\n smt.bv.concat %a, %0 : !smt.bv<4>, !smt.bv<16>\n // or also \n %0 = smt.bv.repeat 4 times %a : !smt.bv<4>\n smt.bv.concat %0, %a : !smt.bv<16>, !smt.bv<4>\n ```\n \n The semantics are equivalent to the `repeat` operator defined in the SMT-LIB\n 2.7 standard. More precisely in the\n [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "input", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "hasCustomAssemblyFormat": true }, { "name": "smt.bv.sdiv", "summary": "equivalent to bvsdiv in SMT-LIB", "description": "This operation performs two's complement signed division. The semantics are\n equivalent to the `bvsdiv` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.shl", "summary": "equivalent to bvshl in SMT-LIB", "description": "This operation performs shift left. The semantics are\n equivalent to the `bvshl` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.smod", "summary": "equivalent to bvsmod in SMT-LIB", "description": "This operation performs two's complement signed remainder (sign follows divisor). The semantics are\n equivalent to the `bvsmod` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.srem", "summary": "equivalent to bvsrem in SMT-LIB", "description": "This operation performs two's complement signed remainder (sign follows dividend). The semantics are\n equivalent to the `bvsrem` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.udiv", "summary": "equivalent to bvudiv in SMT-LIB", "description": "This operation performs unsigned division (rounded towards zero). The semantics are\n equivalent to the `bvudiv` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.urem", "summary": "equivalent to bvurem in SMT-LIB", "description": "This operation performs unsigned remainder. The semantics are\n equivalent to the `bvurem` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv.xor", "summary": "equivalent to bvxor in SMT-LIB", "description": "This operation performs bitwise exclusive OR. The semantics are\n equivalent to the `bvxor` operator defined in the SMT-LIB 2.7\n standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)\n and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)\n describing closed quantifier-free formulas over the theory of fixed-size\n bit-vectors.", "operands": [ { "name": "lhs", "type": "BitVectorType" }, { "name": "rhs", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` qualified(type($result))" }, { "name": "smt.bv2int", "summary": "Convert an SMT bit-vector to an SMT integer.", "description": "Create an integer from the bit-vector argument `input`. If `is_signed` is\n present, the bit-vector is treated as two's complement signed. Otherwise,\n it is treated as an unsigned integer in the range [0..2^N-1], where N is\n the number of bits in `input`.", "operands": [ { "name": "input", "type": "BitVectorType" } ], "results": [ { "name": "result", "type": "IntType" } ], "attributes": [ { "name": "is_signed", "type": "UnitAttr" } ], "assemblyFormat": "$input (`signed` $is_signed^)? attr-dict `:`\n qualified(type($input))" }, { "name": "smt.check", "summary": "check if the current set of assertions is satisfiable", "description": "This operation checks if all the assertions in the solver defined by the\n nearest ancestor operation of type `smt.solver` are consistent. The outcome\n an be 'satisfiable', 'unknown', or 'unsatisfiable' and the corresponding\n region will be executed. It is the corresponding construct to the\n `check-sat` in SMT-LIB.\n\n Example:\n ```mlir\n %0 = smt.check sat {\n %c1_i32 = arith.constant 1 : i32\n smt.yield %c1_i32 : i32\n } unknown {\n %c0_i32 = arith.constant 0 : i32\n smt.yield %c0_i32 : i32\n } unsat {\n %c-1_i32 = arith.constant -1 : i32\n smt.yield %c-1_i32 : i32\n } -> i32\n ```", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "satRegion", "type": "SizedRegion<1>" }, { "name": "unknownRegion", "type": "SizedRegion<1>" }, { "name": "unsatRegion", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict `sat` $satRegion `unknown` $unknownRegion `unsat` $unsatRegion\n (`->` qualified(type($results))^ )?" }, { "name": "smt.constant", "summary": "Produce a constant boolean", "description": "Produces the constant expressions 'true' and 'false' as described in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB\n Standard 2.7.", "results": [ { "name": "result", "type": "BoolType" } ], "attributes": [ { "name": "value", "type": "BoolAttr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "smt.declare_fun", "summary": "declare a symbolic value of a given sort", "description": "This operation declares a symbolic value just as the `declare-const` and\n `declare-fun` statements in SMT-LIB 2.7. The result type determines the SMT\n sort of the symbolic value. The returned value can then be used to refer to\n the symbolic value instead of using the identifier like in SMT-LIB.\n\n The optionally provided string will be used as a prefix for the newly\n generated identifier (useful for easier readability when exporting to\n SMT-LIB). Each `declare` will always provide a unique new symbolic value\n even if the identifier strings are the same.\n\n Note that there does not exist a separate operation equivalent to\n SMT-LIBs `define-fun` since\n ```\n (define-fun f (a Int) Int (-a))\n ```\n is only syntactic sugar for\n ```\n %f = smt.declare_fun : !smt.func<(!smt.int) !smt.int>\n %0 = smt.forall {\n ^bb0(%arg0: !smt.int):\n %1 = smt.apply_func %f(%arg0) : !smt.func<(!smt.int) !smt.int>\n %2 = smt.int.neg %arg0\n %3 = smt.eq %1, %2 : !smt.int\n smt.yield %3 : !smt.bool\n }\n smt.assert %0\n ```\n\n Note that this operation cannot be marked as Pure since two operations (even\n with the same identifier string) could then be CSEd, leading to incorrect\n behavior.", "results": [ { "name": "result", "type": "AnySMTType" } ], "attributes": [ { "name": "namePrefix", "type": "OptionalAttr" } ], "assemblyFormat": "($namePrefix^)? attr-dict `:` qualified(type($result))" }, { "name": "smt.distinct", "summary": "returns true iff all operands are not identical to any other", "description": "This operation compares the operands and returns true iff all operands are\n not identical to any of the other operands. The semantics are equivalent to\n the `distinct` operator defined in the SMT-LIB Standard 2.7 in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).\n\n Any SMT sort/type is allowed for the operands and it supports a variadic\n number of operands, but requires at least two. This is because the\n `distinct` operator is annotated with `:pairwise` which means that\n `distinct a b c d` is equivalent to\n ```\n and (distinct a b) (distinct a c) (distinct a d)\n (distinct b c) (distinct b d)\n (distinct c d)\n ```\n where `and` is annotated `:left-assoc`, i.e., it can be further rewritten to\n ```\n (and (and (and (and (and (distinct a b)\n (distinct a c))\n (distinct a d))\n (distinct b c))\n (distinct b d))\n (distinct c d)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "smt.eq", "summary": "returns true iff all operands are identical", "description": "This operation compares the operands and returns true iff all operands are\n identical. The semantics are equivalent to the `=` operator defined in the\n SMT-LIB Standard 2.7 in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).\n\n Any SMT sort/type is allowed for the operands and it supports a variadic\n number of operands, but requires at least two. This is because the `=`\n operator is annotated with `:chainable` which means that `= a b c d` is\n equivalent to `and (= a b) (= b c) (= c d)` where `and` is annotated\n `:left-assoc`, i.e., it can be further rewritten to\n `and (and (= a b) (= b c)) (= c d)`.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "smt.exists", "summary": "exists quantifier", "description": "This operation represents theexists quantifieras described in the\n [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).\n It is part of the language itself rather than a theory or logic.\n\n The operation specifies the name prefixes (as an optional attribute) and\n types (as the types of the block arguments of the regions) of bound\n variables that may be used in the 'body' of the operation. If a 'patterns'\n region is specified, the block arguments must match the ones of the 'body'\n region and (other than there) must be used at least once in the 'patterns'\n region. It may also not contain any operations that bind variables, such as\n quantifiers. While the 'body' region must always yield exactly one\n `!smt.bool`-typed value, the 'patterns' region can yield an arbitrary number\n (but at least one) of SMT values.\n\n The bound variables can be any SMT type except of functions, since SMT only\n supports first-order logic.\n\n The 'no_patterns' attribute is only allowed when no 'patterns' region is\n specified and forbids the solver to generate and use patterns for this\n quantifier.\n\n The 'weight' attribute indicates the importance of this quantifier being\n instantiated compared to other quantifiers that may be present. The default\n value is zero.\n\n Both the 'no_patterns' and 'weight' attributes are annotations to the\n quantifiers body term. Annotations and attributes are described in the\n standard in sections 3.4, and 3.6 (specifically 3.6.5). SMT-LIB allows\n adding custom attributes to provide solvers with additional metadata, e.g.,\n hints such as above mentioned attributes. They are not part of the standard\n themselves, but supported by common SMT solvers (e.g., Z3).", "results": [ { "name": "result", "type": "BoolType" } ], "attributes": [ { "name": "weight", "type": "DefaultValuedAttr" }, { "name": "noPattern", "type": "UnitAttr" }, { "name": "boundVarNames", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" }, { "name": "patterns", "type": "VariadicRegion>" } ], "assemblyFormat": "($boundVarNames^)? (`no_pattern` $noPattern^)? (`weight` $weight^)?\n attr-dict-with-keyword $body (`patterns` $patterns^)?" }, { "name": "smt.forall", "summary": "forall quantifier", "description": "This operation represents theforall quantifieras described in the\n [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).\n It is part of the language itself rather than a theory or logic.\n\n The operation specifies the name prefixes (as an optional attribute) and\n types (as the types of the block arguments of the regions) of bound\n variables that may be used in the 'body' of the operation. If a 'patterns'\n region is specified, the block arguments must match the ones of the 'body'\n region and (other than there) must be used at least once in the 'patterns'\n region. It may also not contain any operations that bind variables, such as\n quantifiers. While the 'body' region must always yield exactly one\n `!smt.bool`-typed value, the 'patterns' region can yield an arbitrary number\n (but at least one) of SMT values.\n\n The bound variables can be any SMT type except of functions, since SMT only\n supports first-order logic.\n\n The 'no_patterns' attribute is only allowed when no 'patterns' region is\n specified and forbids the solver to generate and use patterns for this\n quantifier.\n\n The 'weight' attribute indicates the importance of this quantifier being\n instantiated compared to other quantifiers that may be present. The default\n value is zero.\n\n Both the 'no_patterns' and 'weight' attributes are annotations to the\n quantifiers body term. Annotations and attributes are described in the\n standard in sections 3.4, and 3.6 (specifically 3.6.5). SMT-LIB allows\n adding custom attributes to provide solvers with additional metadata, e.g.,\n hints such as above mentioned attributes. They are not part of the standard\n themselves, but supported by common SMT solvers (e.g., Z3).", "results": [ { "name": "result", "type": "BoolType" } ], "attributes": [ { "name": "weight", "type": "DefaultValuedAttr" }, { "name": "noPattern", "type": "UnitAttr" }, { "name": "boundVarNames", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" }, { "name": "patterns", "type": "VariadicRegion>" } ], "assemblyFormat": "($boundVarNames^)? (`no_pattern` $noPattern^)? (`weight` $weight^)?\n attr-dict-with-keyword $body (`patterns` $patterns^)?" }, { "name": "smt.implies", "summary": "boolean implication", "description": "This operation performs a boolean implication. The semantics are equivalent\n to the '=>' operator in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB\n Standard 2.7.", "operands": [ { "name": "lhs", "type": "BoolType" }, { "name": "rhs", "type": "BoolType" } ], "results": [ { "name": "result", "type": "BoolType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "smt.int.abs", "summary": "the absolute value of an Int", "description": "This operation represents the absolute value function for the `Int` sort.\n The semantics are equivalent to the `abs` operator as described in the\n [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "input", "type": "IntType" } ], "results": [ { "name": "result", "type": "IntType" } ], "assemblyFormat": "$input attr-dict" }, { "name": "smt.int.add", "summary": "integer addition", "description": "This operation represents (infinite-precision)integer addition.\n The semantics are equivalent to the corresponding operator described in\n the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "IntType" } ], "assemblyFormat": "$inputs attr-dict" }, { "name": "smt.int.cmp", "summary": "integer comparison", "description": "This operation represents the comparison of (infinite-precision) integers.\n The semantics are equivalent to the `<= (le)`, `< (lt)`, `>= (ge)`, or\n `> (gt)` operator depending on the predicate (indicated in parentheses) as\n described in the\n [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "lhs", "type": "IntType" }, { "name": "rhs", "type": "IntType" } ], "results": [ { "name": "result", "type": "BoolType" } ], "attributes": [ { "name": "pred", "type": "IntPredicate{lt|le|gt|ge}" } ], "assemblyFormat": "$pred $lhs `,` $rhs attr-dict" }, { "name": "smt.int.constant", "summary": "produce a constant (infinite-precision) integer", "description": "This operation represents (infinite-precision) integer literals of the `Int`\n sort. The set of values for the sort `Int` consists of all numerals and\n all terms of the form `-n`where n is a numeral other than 0. For more\n information refer to the \n [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "results": [ { "name": "result", "type": "IntType" } ], "attributes": [ { "name": "value", "type": "APIntAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "smt.int.div", "summary": "integer division", "description": "This operation represents (infinite-precision)integer division.\n The semantics are equivalent to the corresponding operator described in\n the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "lhs", "type": "IntType" }, { "name": "rhs", "type": "IntType" } ], "results": [ { "name": "result", "type": "IntType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "smt.int.mod", "summary": "integer remainder", "description": "This operation represents (infinite-precision)integer remainder.\n The semantics are equivalent to the corresponding operator described in\n the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "lhs", "type": "IntType" }, { "name": "rhs", "type": "IntType" } ], "results": [ { "name": "result", "type": "IntType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "smt.int.mul", "summary": "integer multiplication", "description": "This operation represents (infinite-precision)integer multiplication.\n The semantics are equivalent to the corresponding operator described in\n the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "IntType" } ], "assemblyFormat": "$inputs attr-dict" }, { "name": "smt.int.sub", "summary": "integer subtraction", "description": "This operation represents (infinite-precision)integer subtraction.\n The semantics are equivalent to the corresponding operator described in\n the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the\n SMT-LIB 2.7 standard.", "operands": [ { "name": "lhs", "type": "IntType" }, { "name": "rhs", "type": "IntType" } ], "results": [ { "name": "result", "type": "IntType" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict" }, { "name": "smt.int2bv", "summary": "Convert an integer to an inferred-width bitvector.", "description": "Designed to lower directly to an operation of the same name in Z3. The Z3\n C API describes the semantics as follows:\n Create an n bit bit-vector from the integer argument t1.\n The resulting bit-vector has n bits, where the i'th bit (counting from 0\n to n-1) is 1 if (t1 div 2^i) mod 2 is 1.\n The node t1 must have integer sort.", "operands": [ { "name": "input", "type": "IntType" } ], "results": [ { "name": "result", "type": "BitVectorType" } ], "assemblyFormat": "$input attr-dict `:` qualified(type($result))" }, { "name": "smt.ite", "summary": "an if-then-else function", "description": "This operation returns its second operand or its third operand depending on\n whether its first operand is true or not. The semantics are equivalent to\n the `ite` operator defined in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB\n 2.7 standard.", "operands": [ { "name": "cond", "type": "BoolType" }, { "name": "thenValue", "type": "AnySMTType" }, { "name": "elseValue", "type": "AnySMTType" } ], "results": [ { "name": "result", "type": "AnySMTType" } ], "traits": [ { "type": "AllTypesMatch<['thenValue', 'elseValue', 'result']>" } ], "assemblyFormat": "$cond `,` $thenValue `,` $elseValue attr-dict `:` qualified(type($result))" }, { "name": "smt.not", "summary": "a boolean negation", "description": "This operation performs a boolean negation. The semantics are equivalent to\n the 'not' operator in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB\n Standard 2.7.", "operands": [ { "name": "input", "type": "BoolType" } ], "results": [ { "name": "result", "type": "BoolType" } ], "assemblyFormat": "$input attr-dict" }, { "name": "smt.or", "summary": "a boolean disjunction", "description": "This operation performs a boolean disjunction.\n The semantics are equivalent to the 'or' operator in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).\n of the SMT-LIB Standard 2.7.\n\n It supports a variadic number of operands, but requires at least two.\n This is because the operator is annotated with the `:left-assoc` attribute\n which means that `op a b c` is equivalent to `(op (op a b) c)`.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "BoolType" } ], "assemblyFormat": "$inputs attr-dict" }, { "name": "smt.pop", "summary": "pop a given number of levels from the assertion stack", "attributes": [ { "name": "count", "type": "ConfinedAttr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "smt.push", "summary": "push a given number of levels onto the assertion stack", "attributes": [ { "name": "count", "type": "ConfinedAttr" } ], "assemblyFormat": "$count attr-dict" }, { "name": "smt.reset", "summary": "reset the solver", "assemblyFormat": "attr-dict" }, { "name": "smt.set_logic", "summary": "set the logic for the SMT solver", "attributes": [ { "name": "logic", "type": "StrAttr" } ], "assemblyFormat": "$logic attr-dict" }, { "name": "smt.solver", "summary": "create a solver instance within a lifespan", "description": "This operation defines an SMT context with a solver instance. SMT operations\n are only valid when being executed between the start and end of the region\n of this operation. Any invocation outside is undefined. However, they do not\n have to be direct children of this operation. For example, it is allowed to\n have SMT operations in a `func.func` which is only called from within this\n region. No SMT value may enter or exit the lifespan of this region (such\n that no value created from another SMT context can be used in this scope and\n the solver can deallocate all state required to keep track of SMT values at\n the end).\n\n As a result, the region is comparable to an entire SMT-LIB script, but\n allows for concrete operations and control-flow. Concrete values may be\n passed in and returned to influence the computations after the `smt.solver`\n operation.\n\n Example:\n ```mlir\n %0:2 = smt.solver (%in) {smt.some_attr} : (i8) -> (i8, i32) {\n ^bb0(%arg0: i8):\n %c = smt.declare_fun \"c\" : !smt.bool\n smt.assert %c\n %1 = smt.check sat {\n %c1_i32 = arith.constant 1 : i32\n smt.yield %c1_i32 : i32\n } unknown {\n %c0_i32 = arith.constant 0 : i32\n smt.yield %c0_i32 : i32\n } unsat {\n %c-1_i32 = arith.constant -1 : i32\n smt.yield %c-1_i32 : i32\n } -> i32\n smt.yield %arg0, %1 : i8, i32\n }\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $inputs `)` attr-dict `:` functional-type($inputs, $results) $bodyRegion" }, { "name": "smt.xor", "summary": "a boolean exclusive OR", "description": "This operation performs a boolean exclusive OR.\n The semantics are equivalent to the 'xor' operator in the\n [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).\n of the SMT-LIB Standard 2.7.\n\n It supports a variadic number of operands, but requires at least two.\n This is because the operator is annotated with the `:left-assoc` attribute\n which means that `op a b c` is equivalent to `(op (op a b) c)`.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "BoolType" } ], "assemblyFormat": "$inputs attr-dict" }, { "name": "smt.yield", "summary": "terminator operation for various regions of SMT operations", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "($values^ `:` qualified(type($values)))? attr-dict" }, { "name": "sparse_tensor.assemble", "summary": "Returns a sparse tensor assembled from the given levels and values", "description": "Assembles the per-level position and coordinate arrays together with\n the values arrays into a sparse tensor. The order and types of the\n provided levels must be consistent with the actual storage layout of\n the returned sparse tensor described below.\n\n - `levels: [tensor, ...]`\n supplies the sparse tensor position and coordinate arrays\n of the sparse tensor for the corresponding level as specifed by\n `sparse_tensor::StorageLayout`.\n - `values : tensor`\n supplies the values array for the stored elements in the sparse tensor.\n\n This operation can be used to assemble a sparse tensor from an\n external source; e.g., by passing numpy arrays from Python. It\n is the user's responsibility to provide input that can be correctly\n interpreted by the sparsifier, which does not perform any sanity\n test to verify data integrity.\n\n Example:\n\n ```mlir\n %pos = arith.constant dense<[0, 3]> : tensor<2xindex>\n %index = arith.constant dense<[[0,0], [1,2], [1,3]]> : tensor<3x2xindex>\n %values = arith.constant dense<[ 1.1, 2.2, 3.3 ]> : tensor<3xf64>\n %s = sparse_tensor.assemble (%pos, %index), %values\n : (tensor<2xindex>, tensor<3x2xindex>), tensor<3xf64> to tensor<3x4xf64, #COO>\n // yields COO format |1.1, 0.0, 0.0, 0.0|\n // of 3x4 matrix |0.0, 0.0, 2.2, 3.3|\n // |0.0, 0.0, 0.0, 0.0|\n ```", "operands": [ { "name": "levels", "type": "Variadic>" }, { "name": "values", "type": "RankedTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "AnySparseTensor" } ], "assemblyFormat": "` ` `(` $levels `)` `,` $values attr-dict `:` `(` type($levels) `)` `,` type($values) `to` type($result)" }, { "name": "sparse_tensor.binary", "summary": "Binary set operation utilized within linalg.generic", "description": "Defines a computation within a `linalg.generic` operation that takes two\n operands and executes one of the regions depending on whether both operands\n or either operand is nonzero (i.e. stored explicitly in the sparse storage\n format).\n\n Three regions are defined for the operation and must appear in this order:\n - overlap (elements present in both sparse tensors)\n - left (elements only present in the left sparse tensor)\n - right (element only present in the right sparse tensor)\n\n Each region contains a single block describing the computation and result.\n Every non-empty block must end with a sparse_tensor.yield and the return\n type must match the type of `output`. The primary region's block has two\n arguments, while the left and right region's block has only one argument.\n\n A region may also be declared empty (i.e. `left={}`), indicating that the\n region does not contribute to the output. For example, setting both\n `left={}` and `right={}` is equivalent to the intersection of the two\n inputs as only the overlap region will contribute values to the output.\n\n As a convenience, there is also a special token `identity` which can be\n used in place of the left or right region. This token indicates that\n the return value is the input value (i.e. func(%x) => return %x).\n As a practical example, setting `left=identity` and `right=identity`\n would be equivalent to a union operation where non-overlapping values\n in the inputs are copied to the output unchanged.\n\n Due to the possibility of empty regions, i.e. lack of a value for certain\n cases, the result of this operation may only feed directly into the output\n of the `linalg.generic` operation or into into a custom reduction\n `sparse_tensor.reduce` operation that follows in the same region.\n\n Example of isEqual applied to intersecting elements only:\n\n ```mlir\n %C = tensor.empty(...)\n %0 = linalg.generic #trait\n ins(%A: tensor,\n %B: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %b: f64, %c: i8) :\n %result = sparse_tensor.binary %a, %b : f64, f64 to i8\n overlap={\n ^bb0(%arg0: f64, %arg1: f64):\n %cmp = arith.cmpf \"oeq\", %arg0, %arg1 : f64\n %ret_i8 = arith.extui %cmp : i1 to i8\n sparse_tensor.yield %ret_i8 : i8\n }\n left={}\n right={}\n linalg.yield %result : i8\n } -> tensor\n ```\n\n Example of A+B in upper triangle, A-B in lower triangle:\n\n ```mlir\n %C = tensor.empty(...)\n %1 = linalg.generic #trait\n ins(%A: tensor, %B: tensor\n outs(%C: tensor {\n ^bb0(%a: f64, %b: f64, %c: f64) :\n %row = linalg.index 0 : index\n %col = linalg.index 1 : index\n %result = sparse_tensor.binary %a, %b : f64, f64 to f64\n overlap={\n ^bb0(%x: f64, %y: f64):\n %cmp = arith.cmpi \"uge\", %col, %row : index\n %upperTriangleResult = arith.addf %x, %y : f64\n %lowerTriangleResult = arith.subf %x, %y : f64\n %ret = arith.select %cmp, %upperTriangleResult, %lowerTriangleResult : f64\n sparse_tensor.yield %ret : f64\n }\n left=identity\n right={\n ^bb0(%y: f64):\n %cmp = arith.cmpi \"uge\", %col, %row : index\n %lowerTriangleResult = arith.negf %y : f64\n %ret = arith.select %cmp, %y, %lowerTriangleResult : f64\n sparse_tensor.yield %ret : f64\n }\n linalg.yield %result : f64\n } -> tensor\n ```\n\n Example of set difference. Returns a copy of A where its sparse structure\n is *not* overlapped by B. The element type of B can be different than A\n because we never use its values, only its sparse structure:\n\n ```mlir\n %C = tensor.empty(...)\n %2 = linalg.generic #trait\n ins(%A: tensor, %B: tensor\n outs(%C: tensor {\n ^bb0(%a: f64, %b: i32, %c: f64) :\n %result = sparse_tensor.binary %a, %b : f64, i32 to f64\n overlap={}\n left=identity\n right={}\n linalg.yield %result : f64\n } -> tensor\n ```", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ], "results": [ { "name": "output", "type": "AnyType" } ], "attributes": [ { "name": "left_identity", "type": "UnitAttr" }, { "name": "right_identity", "type": "UnitAttr" } ], "regions": [ { "name": "overlapRegion", "type": "AnyRegion" }, { "name": "leftRegion", "type": "AnyRegion" }, { "name": "rightRegion", "type": "AnyRegion" } ], "assemblyFormat": "$x `,` $y `:` attr-dict type($x) `,` type($y) `to` type($output) `\\n`\n `overlap` `=` $overlapRegion `\\n`\n `left` `=` (`identity` $left_identity^):($leftRegion)? `\\n`\n `right` `=` (`identity` $right_identity^):($rightRegion)?" }, { "name": "sparse_tensor.coiterate", "summary": "Co-iterates over a set of sparse iteration spaces", "description": "The `sparse_tensor.coiterate` operation represents a loop (nest) over\n a set of iteration spaces. The operation can have multiple regions,\n with each of them defining a case to compute a result at the current iterations.\n The case condition is defined solely based on the pattern of specified iterators.\n For example:\n ```mlir\n %ret = sparse_tensor.coiterate (%sp1, %sp2) at(%coord) iter_args(%arg = %init)\n : (!sparse_tensor.iter_space<#CSR, lvls = 0>,\n !sparse_tensor.iter_space<#COO, lvls = 0>)\n -> index\n case %it1, _ {\n // %coord is specifed in space %sp1 but *NOT* specified in space %sp2.\n }\n case %it1, %it2 {\n // %coord is specifed in *BOTH* spaces %sp1 and %sp2.\n }\n ```\n\n `sparse_tensor.coiterate` can also operate on loop-carried variables.\n It returns the final value for each loop-carried variable after loop termination.\n The initial values of the variables are passed as additional SSA operands\n to the iterator SSA value and used coordinate SSA values.\n Each operation region has variadic arguments for specified (used), one argument\n for each loop-carried variable, representing the value of the variable\n at the current iteration, followed by a list of arguments for iterators.\n The body region must contain exactly one block that terminates with\n `sparse_tensor.yield`.\n\n The results of an `sparse_tensor.coiterate` hold the final values after\n the last iteration. If the `sparse_tensor.coiterate` defines any values,\n a yield must be explicitly present in every region defined in the operation.\n The number and types of the `sparse_tensor.coiterate` results must match\n the initial values in the iter_args binding and the yield operands.\n\n\n A `sparse_tensor.coiterate` example that does elementwise addition between two\n sparse vectors.\n\n\n ```mlir\n %ret = sparse_tensor.coiterate (%sp1, %sp2) at(%coord) iter_args(%arg = %init)\n : (!sparse_tensor.iter_space<#CSR, lvls = 0>,\n !sparse_tensor.iter_space<#CSR, lvls = 0>)\n -> tensor\n case %it1, _ {\n // v = v1 + 0 = v1\n %v1 = sparse_tensor.extract_value %t1 at %it1 : index\n %yield = sparse_tensor.insert %v1 into %arg[%coord]\n sparse_tensor.yield %yield\n }\n case _, %it2 {\n // v = v2 + 0 = v2\n %v2 = sparse_tensor.extract_value %t2 at %it2 : index\n %yield = sparse_tensor.insert %v1 into %arg[%coord]\n sparse_tensor.yield %yield\n }\n case %it1, %it2 {\n // v = v1 + v2\n %v1 = sparse_tensor.extract_value %t1 at %it1 : index\n %v2 = sparse_tensor.extract_value %t2 at %it2 : index\n %v = arith.addi %v1, %v2 : index\n %yield = sparse_tensor.insert %v into %arg[%coord]\n sparse_tensor.yield %yield\n }\n ```", "operands": [ { "name": "iterSpaces", "type": "Variadic" }, { "name": "initArgs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "crdUsedLvls", "type": "I64BitSetAttr" }, { "name": "cases", "type": "TypedArrayAttrBase" } ], "regions": [ { "name": "caseRegions", "type": "VariadicRegion>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "sparse_tensor.compress", "summary": "Compressed an access pattern for insertion", "description": "Finishes a single access pattern expansion by moving inserted elements\n into the sparse storage scheme of the given tensor with the given\n level-coordinates. The arity of `lvlCoords` is one less than the\n level-rank of the tensor, with the coordinate of the innermost\n level defined through the `added` array. The `values` and `filled`\n arrays are reset in a *sparse* fashion by only iterating over set\n elements through an indirection using the `added` array, so that\n the operations are kept proportional to the number of nonzeros.\n See the `sparse_tensor.expand` operation for more details.\n\n Note that this operation is \"impure\" in the sense that even though\n the result is modeled through an SSA value, the insertion is eventually\n done \"in place\", and referencing the old SSA value is undefined behavior.\n\n Example:\n\n ```mlir\n %result = sparse_tensor.compress %values, %filled, %added, %count into %tensor[%i]\n : memref, memref, memref, tensor<4x4xf64, #CSR>\n ```", "operands": [ { "name": "values", "type": "AnyStridedMemRefOfRank<1>" }, { "name": "filled", "type": "StridedMemRefRankOf<[I1], [1]>" }, { "name": "added", "type": "StridedMemRefRankOf<[Index], [1]>" }, { "name": "count", "type": "Index" }, { "name": "tensor", "type": "AnySparseTensor" }, { "name": "lvlCoords", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnySparseTensor" } ], "traits": [ { "type": "AllTypesMatch<['tensor', 'result']>" } ], "assemblyFormat": "$values `,` $filled `,` $added `,` $count `into` $tensor `[` $lvlCoords `]` attr-dict `:` type($values) `,` type($filled) `,` type($added) `,` type($tensor)" }, { "name": "sparse_tensor.concatenate", "summary": "Concatenates a list of tensors into a single tensor.", "description": "Concatenates a list input tensors and the output tensor with the same\n dimension-rank. The concatenation happens on the specified `dimension`\n (0 <= dimension < dimRank). The resulting `dimension` size is the\n sum of all the input sizes for that dimension, while all the other\n dimensions should have the same size in the input and output tensors.\n\n Only statically-sized input tensors are accepted, while the output tensor\n can be dynamically-sized.\n\n Example:\n\n ```mlir\n %0 = sparse_tensor.concatenate %1, %2 { dimension = 0 : index }\n : tensor<64x64xf64, #CSR>, tensor<64x64xf64, #CSR> to tensor<128x64xf64, #CSR>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dimension", "type": "DimensionAttr" } ], "assemblyFormat": "$inputs attr-dict `:` type($inputs) `to` type($result)" }, { "name": "sparse_tensor.convert", "summary": "Converts between different tensor types", "description": "Converts one sparse or dense tensor type to another tensor type. The rank\n of the source and destination types must match exactly, and the dimension\n sizes must either match exactly or relax from a static to a dynamic size.\n The sparse encoding of the two types can obviously be completely different.\n The name `convert` was preferred over `cast`, since the operation may incur\n a non-trivial cost.\n\n When converting between two different sparse tensor types, only explicitly\n stored values are moved from one underlying sparse storage format to\n the other. When converting from an unannotated dense tensor type to a\n sparse tensor type, an explicit test for nonzero values is used. When\n converting to an unannotated dense tensor type, implicit zeroes in the\n sparse storage format are made explicit. Note that the conversions can have\n non-trivial costs associated with them, since they may involve elaborate\n data structure transformations. Also, conversions from sparse tensor types\n into dense tensor types may be infeasible in terms of storage requirements.\n\n Trivial dense-to-dense convert will be removed by canonicalization while\n trivial sparse-to-sparse convert will be removed by the sparse codegen. This\n is because we use trivial sparse-to-sparse convert to tell bufferization\n that the sparse codegen will expand the tensor buffer into sparse tensor\n storage.\n\n Examples:\n\n ```mlir\n %0 = sparse_tensor.convert %a : tensor<32x32xf32> to tensor<32x32xf32, #CSR>\n %1 = sparse_tensor.convert %a : tensor<32x32xf32> to tensor\n %2 = sparse_tensor.convert %b : tensor<8x8xi32, #CSC> to tensor<8x8xi32, #CSR>\n %3 = sparse_tensor.convert %c : tensor<4x8xf64, #CSR> to tensor<4x?xf64, #CSC>\n\n // The following conversion is not allowed (since it would require a\n // runtime assertion that the source's dimension size is actually 100).\n %4 = sparse_tensor.convert %d : tensor to tensor<100xf64, #SV>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "dest", "type": "AnyRankedTensor" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "sparse_tensor.coordinates", "summary": "Extracts the `level`-th coordinates array of the `tensor`", "description": "Returns the coordinates array of the tensor's storage at the given\n level. This is similar to the `bufferization.to_buffer` operation\n in the sense that it provides a bridge between a tensor world view\n and a bufferized world view. Unlike the `bufferization.to_buffer`\n operation, however, this sparse operation actually lowers into code\n that extracts the coordinates array from the sparse storage itself\n (either by calling a support library or through direct code).\n\n Writing into the result of this operation is undefined behavior.\n\n Example:\n\n ```mlir\n %1 = sparse_tensor.coordinates %0 { level = 1 : index }\n : tensor<64x64xf64, #CSR> to memref\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "result", "type": "AnyNon0RankedMemRef" } ], "attributes": [ { "name": "level", "type": "LevelAttr" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor) `to` type($result)" }, { "name": "sparse_tensor.coordinates_buffer", "summary": "Extracts the linear coordinates array from a tensor", "description": "Returns the linear coordinates array for a sparse tensor with\n a trailing COO region with at least two levels. It is an error\n if the tensor doesn't contain such a COO region. This is similar\n to the `bufferization.to_buffer` operation in the sense that it\n provides a bridge between a tensor world view and a bufferized\n world view. Unlike the `bufferization.to_buffer` operation,\n however, this operation actually lowers into code that extracts\n the linear coordinates array from the sparse storage scheme that\n stores the coordinates for the COO region as an array of structures.\n For example, a 2D COO sparse tensor with two non-zero elements at\n coordinates (1, 3) and (4, 6) are stored in a linear buffer as\n (1, 4, 3, 6) instead of two buffer as (1, 4) and (3, 6).\n\n Writing into the result of this operation is undefined behavior.\n\n Example:\n\n ```mlir\n %1 = sparse_tensor.coordinates_buffer %0\n : tensor<64x64xf64, #COO> to memref\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "result", "type": "AnyNon0RankedMemRef" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor) `to` type($result)" }, { "name": "sparse_tensor.crd_translate", "summary": "Performs coordinate translation between level and dimension coordinate space.", "description": "Performs coordinate translation between level and dimension coordinate space according\n to the affine maps defined by $encoder.\n\n Example:\n\n ```mlir\n %l0, %l1, %l2, %l3 = sparse_tensor.crd_translate dim_to_lvl [%d0, %d1] as #BSR\n : index, index, index, index\n ```", "operands": [ { "name": "in_crds", "type": "Variadic" } ], "results": [ { "name": "out_crds", "type": "Variadic" } ], "attributes": [ { "name": "direction", "type": "SparseTensorCrdTransDirectionAttr{dim_to_lvl|lvl_to_dim}" }, { "name": "encoder", "type": "SparseTensorEncodingAttr" } ], "assemblyFormat": "$direction `[` $in_crds `]` `as` $encoder attr-dict `:` type($out_crds)" }, { "name": "sparse_tensor.disassemble", "summary": "Copies the levels and values of the given sparse tensor", "description": "The disassemble operation is the inverse of `sparse_tensor::assemble`.\n It copies the per-level position and coordinate arrays together with\n the values array of the given sparse tensor into the user-supplied buffers\n along with the actual length of the memory used in each returned buffer.\n\n This operation can be used for returning a disassembled MLIR sparse tensor;\n e.g., copying the sparse tensor contents into pre-allocated numpy arrays\n back to Python. It is the user's responsibility to allocate large enough\n buffers of the appropriate types to hold the sparse tensor contents.\n The sparsifier simply copies all fields of the sparse tensor into the\n user-supplied buffers without any sanity test to verify data integrity.\n\n Example:\n\n ```mlir\n // input COO format |1.1, 0.0, 0.0, 0.0|\n // of 3x4 matrix |0.0, 0.0, 2.2, 3.3|\n // |0.0, 0.0, 0.0, 0.0|\n %p, %c, %v, %p_len, %c_len, %v_len =\n sparse_tensor.disassemble %s : tensor<3x4xf64, #COO>\n out_lvls(%op, %oi : tensor<2xindex>, tensor<3x2xindex>)\n out_vals(%od : tensor<3xf64>) ->\n (tensor<2xindex>, tensor<3x2xindex>), tensor<3xf64>, (index, index), index\n // %p = arith.constant dense<[ 0, 3 ]> : tensor<2xindex>\n // %c = arith.constant dense<[[0,0], [1,2], [1,3]]> : tensor<3x2xindex>\n // %v = arith.constant dense<[ 1.1, 2.2, 3.3 ]> : tensor<3xf64>\n // %p_len = 2\n // %c_len = 6 (3x2)\n // %v_len = 3\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" }, { "name": "out_levels", "type": "Variadic>" }, { "name": "out_values", "type": "RankedTensorOf<[AnyType]>" } ], "results": [ { "name": "ret_levels", "type": "Variadic>" }, { "name": "ret_values", "type": "RankedTensorOf<[AnyType]>" }, { "name": "lvl_lens", "type": "Variadic" }, { "name": "val_len", "type": "AnyIndexingScalarLike" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor)`out_lvls` `(` $out_levels `:` type($out_levels) `)` `out_vals` `(` $out_values `:` type($out_values) `)` `->``(` type($ret_levels) `)` `,` type($ret_values) `,` `(` type($lvl_lens) `)` `,` type($val_len)" }, { "name": "sparse_tensor.expand", "summary": "Expands an access pattern for insertion", "description": "Performs an access pattern expansion for the innermost levels of the\n given tensor. This operation is useful to implement kernels in which a\n sparse tensor appears as output. This technique is known under several\n different names and using several alternative implementations,\n for example, phase counter [Gustavson72], expanded or switch array\n [Pissanetzky84], in phase scan [Duff90], access pattern expansion [Bik96],\n and workspaces [Kjolstad19].\n\n The `values` and `filled` arrays must have lengths equal to the\n level-size of the innermost level (i.e., as if the innermost level\n were *dense*). The `added` array and `count` are used to store new\n level-coordinates when a false value is encountered in the `filled`\n array. All arrays should be allocated before the loop (possibly even\n shared between loops in a future optimization) so that their *dense*\n initialization can be amortized over many iterations. Setting and\n resetting the dense arrays in the loop nest itself is kept *sparse*\n by only iterating over set elements through an indirection using\n the added array, so that the operations are kept proportional to\n the number of nonzeros.\n\n Note that this operation is \"impure\" in the sense that even though the\n results are modeled through SSA values, the operation relies on a proper\n side-effecting context that sets and resets the expanded arrays.\n\n Example:\n\n ```mlir\n %values, %filled, %added, %count = sparse_tensor.expand %tensor\n : tensor<4x4xf64, #CSR> to memref, memref, memref\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "values", "type": "AnyStridedMemRefOfRank<1>" }, { "name": "filled", "type": "StridedMemRefRankOf<[I1], [1]>" }, { "name": "added", "type": "StridedMemRefRankOf<[Index], [1]>" }, { "name": "count", "type": "Index" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor) `to` type($values) `,` type($filled) `,` type($added)" }, { "name": "sparse_tensor.extract_iteration_space", "summary": "Extracts an iteration space from a sparse tensor between certain levels", "description": "Extracts a `!sparse_tensor.iter_space` from a sparse tensor between\n certain (consecutive) levels. For sparse levels, it is usually done by\n loading a postion range from the underlying sparse tensor storage.\n E.g., for a compressed level, the iteration space is extracted by\n [pos[i], pos[i+1]) supposing the the parent iterator points at `i`.\n\n `tensor`: the input sparse tensor that defines the iteration space.\n `parentIter`: the iterator for the previous level, at which the iteration space\n at the current levels will be extracted.\n `loLvl`, `hiLvl`: the level range between [loLvl, hiLvl) in the input tensor that\n the returned iteration space covers. `hiLvl - loLvl` defines the dimension of the\n iteration space.\n\n The type of returned the value is must be\n `!sparse_tensor.iter_space<#INPUT_ENCODING, lvls = $loLvl to $hiLvl>`.\n The returned iteration space can then be iterated over by\n `sparse_tensor.iterate` operations to visit every stored element\n (usually nonzeros) in the input sparse tensor.\n\n Example:\n ```mlir\n // Extracts a 1-D iteration space from a COO tensor at level 1.\n %space = sparse_tensor.iteration.extract_space %sp at %it1 lvls = 1\n : tensor<4x8xf32, #COO>, !sparse_tensor.iterator<#COO, lvls = 0>\n ->!sparse_tensor.iter_space<#COO, lvls = 1>\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" }, { "name": "parentIter", "type": "Optional" } ], "results": [ { "name": "extractedSpace", "type": "AnySparseIterSpace" } ], "attributes": [ { "name": "loLvl", "type": "LevelAttr" }, { "name": "hiLvl", "type": "LevelAttr" } ], "assemblyFormat": "$tensor (`at` $parentIter^)? `lvls` `=` custom($loLvl, $hiLvl) attr-dict `:` type($tensor) (`,` type($parentIter)^)? `->` qualified(type($extractedSpace))" }, { "name": "sparse_tensor.extract_value", "summary": "Extracts a value from a sparse tensor using an iterator.", "description": "The `sparse_tensor.extract_value` operation extracts the value\n pointed to by a sparse iterator from a sparse tensor.\n\n Example:\n\n ```mlir\n %val = sparse_tensor.extract_value %sp at %it\n : tensor, !sparse_tensor.iterator<#CSR, lvl = 1>\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" }, { "name": "iterator", "type": "AnySparseIterator" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'tensor', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$tensor `at` $iterator attr-dict `:` type($tensor)`,` qualified(type($iterator))" }, { "name": "sparse_tensor.foreach", "summary": "Iterates over elements in a tensor", "description": "Iterates over stored elements in a tensor (which are typically, but not always,\n non-zero for sparse tensors) and executes the block.\n\n `tensor`: the input tensor to iterate over.\n `initArgs`: the initial loop argument to carry and update during each iteration.\n `order`: an optional permutation affine map that specifies the order in which\n the dimensions are visited (e.g., row first or column first). This is only\n applicable when the input tensor is a non-annotated dense tensor.\n\n For an input tensor with dim-rank `n`, the block must take `n + 1`\n arguments (plus additional loop-carried variables as described below).\n The first `n` arguments provide the dimension-coordinates of the element\n being visited, and must all have `index` type. The `(n+1)`-th argument\n provides the element's value, and must have the tensor's element type.\n\n `sparse_tensor.foreach` can also operate on loop-carried variables and returns\n the final values after loop termination. The initial values of the variables are\n passed as additional SSA operands to the \"sparse_tensor.foreach\" following the n + 1\n SSA values mentioned above (n coordinates and 1 value).\n\n The region must terminate with a \"sparse_tensor.yield\" that passes the current\n values of all loop-carried variables to the next iteration, or to the\n result, if at the last iteration. The number and static types of loop-carried\n variables may not change with iterations.\n\n For example:\n ```mlir\n %c0 = arith.constant 0 : i32\n %ret = sparse_tensor.foreach in %0 init(%c0): tensor, i32 -> i32 do {\n ^bb0(%arg1: index, %arg2: index, %arg3: i32, %iter: i32):\n %sum = arith.add %iter, %arg3\n sparse_tensor.yield %sum\n }\n ```\n\n It is important to note that the generated loop iterates over\n elements in their storage order. However, regardless of the\n storage scheme used by the tensor, the block is always given\n the dimension-coordinates.\n\n For example:\n ```mlir\n #COL_MAJOR = #sparse_tensor.encoding<{\n map = (d0, d1) -> (d1 : compressed, d0 : compressed)\n }>\n\n // foreach on a column-major sparse tensor\n sparse_tensor.foreach in %0 : tensor<2x3xf64, #COL_MAJOR> do {\n ^bb0(%row: index, %col: index, %arg3: f64):\n // [%row, %col] -> [0, 0], [1, 0], [2, 0], [0, 1], [1, 1], [2, 1]\n }\n\n #ROW_MAJOR = #sparse_tensor.encoding<{\n map = (d0, d1) -> (d0 : compressed, d1 : compressed)\n }>\n\n // foreach on a row-major sparse tensor\n sparse_tensor.foreach in %0 : tensor<2x3xf64, #ROW_MAJOR> do {\n ^bb0(%row: index, %col: index, %arg3: f64):\n // [%row, %col] -> [0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]\n }\n\n // foreach on a row-major dense tensor but visit column first\n sparse_tensor.foreach in %0 {order=affine_map<(i,j)->(j,i)>}: tensor<2x3xf64> do {\n ^bb0(%row: index, %col: index, %arg3: f64):\n // [%row, %col] -> [0, 0], [1, 0], [2, 0], [0, 1], [1, 1], [2, 1]\n }\n\n ```", "operands": [ { "name": "tensor", "type": "AnyRankedTensor" }, { "name": "initArgs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "order", "type": "OptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "`in` $tensor (`init``(`$initArgs^`)`)? attr-dict `:` type($tensor) (`,` type($initArgs)^)? (`->` type($results)^)? `do` $region" }, { "name": "sparse_tensor.has_runtime_library", "summary": "Indicates whether running in runtime/codegen mode", "description": "Returns a boolean value that indicates whether the sparsifier runs in\n runtime library mode or not. For testing only! This operation is useful\n for writing test cases that require different code depending on\n runtime/codegen mode.\n\n Example:\n\n ```mlir\n %has_runtime = sparse_tensor.has_runtime_library\n scf.if %has_runtime {\n ...\n }\n ```", "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "attr-dict" }, { "name": "sparse_tensor.iterate", "summary": "Iterates over a sparse iteration space", "description": "The `sparse_tensor.iterate` operation represents a loop (nest) over\n the provided iteration space extracted from a specific sparse tensor.\n The operation defines an SSA value for a sparse iterator that points\n to the current stored element in the sparse tensor and SSA values\n for coordinates of the stored element. The coordinates are always\n converted to `index` type despite of the underlying sparse tensor\n storage. When coordinates are not used, the SSA values can be skipped\n by `_` symbols, which usually leads to simpler generated code after\n sparsification. For example:\n\n ```mlir\n // The coordinate for level 0 is not used when iterating over a 2-D\n // iteration space.\n %sparse_tensor.iterate %iterator in %space at(_, %crd_1)\n : !sparse_tensor.iter_space<#CSR, lvls = 0 to 2>\n ```\n\n `sparse_tensor.iterate` can also operate on loop-carried variables.\n It returns the final values after loop termination.\n The initial values of the variables are passed as additional SSA operands\n to the iterator SSA value and used coordinate SSA values mentioned\n above. The operation region has an argument for the iterator, variadic\n arguments for specified (used) coordiates and followed by one argument\n for each loop-carried variable, representing the value of the variable\n at the current iteration.\n The body region must contain exactly one block that terminates with\n `sparse_tensor.yield`.\n\n The results of an `sparse_tensor.iterate` hold the final values after\n the last iteration. If the `sparse_tensor.iterate` defines any values,\n a yield must be explicitly present.\n The number and types of the `sparse_tensor.iterate` results must match\n the initial values in the iter_args binding and the yield operands.\n\n\n A nested `sparse_tensor.iterate` example that prints all the coordinates\n stored in the sparse input:\n\n ```mlir\n func.func @nested_iterate(%sp : tensor<4x8xf32, #COO>) {\n // Iterates over the first level of %sp\n %l1 = sparse_tensor.extract_iteration_space %sp lvls = 0\n : tensor<4x8xf32, #COO> -> !sparse_tensor.iter_space<#COO, lvls = 0 to 1>\n %r1 = sparse_tensor.iterate %it1 in %l1 at (%coord0)\n : !sparse_tensor.iter_space<#COO, lvls = 0 to 1> {\n // Iterates over the second level of %sp\n %l2 = sparse_tensor.extract_iteration_space %sp at %it1 lvls = 1\n : tensor<4x8xf32, #COO>, !sparse_tensor.iterator<#COO, lvls = 0 to 1>\n -> !sparse_tensor.iter_space<#COO, lvls = 1 to 2>\n %r2 = sparse_tensor.iterate %it2 in %l2 at (coord1)\n : !sparse_tensor.iter_space<#COO, lvls = 1 to 2> {\n vector.print %coord0 : index\n vector.print %coord1 : index\n }\n }\n }\n\n ```", "operands": [ { "name": "iterSpace", "type": "AnySparseIterSpace" }, { "name": "initArgs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "crdUsedLvls", "type": "I64BitSetAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "sparse_tensor.load", "summary": "Rematerializes tensor from underlying sparse storage format", "description": "Rematerializes a tensor from the underlying sparse storage format of the\n given tensor. This is similar to the `bufferization.to_tensor` operation\n in the sense that it provides a bridge between a bufferized world view\n and a tensor world view. Unlike the `bufferization.to_tensor` operation,\n however, this sparse operation is used only temporarily to maintain a\n correctly typed intermediate representation during progressive\n bufferization.\n\n The `hasInserts` attribute denote whether insertions to the underlying\n sparse storage format may have occurred, in which case the underlying\n sparse storage format needs to be finalized. Otherwise, the operation\n simply folds away.\n\n Note that this operation is \"impure\" in the sense that even though\n the result is modeled through an SSA value, the operation relies on\n a proper context of materializing and inserting the tensor value.\n\n Examples:\n\n ```mlir\n %result = sparse_tensor.load %tensor : tensor<8xf64, #SV>\n\n %1 = sparse_tensor.load %0 hasInserts : tensor<16x32xf32, #CSR>\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "hasInserts", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$tensor (`hasInserts` $hasInserts^)? attr-dict `:` type($tensor)" }, { "name": "sparse_tensor.lvl", "summary": "level index operation", "description": "The `sparse_tensor.lvl` behaves similar to `tensor.dim` operation.\n It takes a sparse tensor and a level operand of type `index` and returns\n the size of the requested level of the given sparse tensor.\n If the sparse tensor has an identity dimension to level mapping, it returns\n the same result as `tensor.dim`.\n If the level index is out of bounds, the behavior is undefined.\n\n Example:\n\n ```mlir\n #BSR = #sparse_tensor.encoding<{\n map = ( i, j ) ->\n ( i floordiv 2 : dense,\n j floordiv 3 : compressed,\n i mod 2 : dense,\n j mod 3 : dense\n )\n }>\n\n // Always returns 2 (4 floordiv 2), can be constant folded:\n %c0 = arith.constant 0 : index\n %x = sparse_tensor.lvl %A, %c0 : tensor<4x?xf32, #BSR>\n\n // Return the dynamic dimension of %A computed by %j mod 3.\n %c1 = arith.constant 1 : index\n %y = sparse_tensor.lvl %A, %c1 : tensor<4x?xf32, #BSR>\n\n // Always return 3 (since j mod 3 < 3), can be constant fold\n %c3 = arith.constant 3 : index\n %y = sparse_tensor.lvl %A, %c3 : tensor<4x?xf32, #BSR>\n ```", "operands": [ { "name": "source", "type": "AnySparseTensor" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict $source `,` $index `:` type($source)" }, { "name": "sparse_tensor.new", "summary": "Materializes a new sparse tensor from given source", "description": "Materializes a sparse tensor with contents taken from an opaque pointer\n provided by `source`. For targets that have access to a file system,\n for example, this pointer may be a filename (or file) of a sparse\n tensor in a particular external storage format. The form of the operation\n is kept deliberately very general to allow for alternative implementations\n in the future, such as pointers to buffers or runnable initialization\n code. The operation is provided as an anchor that materializes a properly\n typed sparse tensor with inital contents into a computation.\n\n Reading in a symmetric matrix will result in just the lower/upper triangular\n part of the matrix (so that only relevant information is stored). Proper\n symmetry support for operating on symmetric matrices is still TBD.\n\n Example:\n\n ```mlir\n sparse_tensor.new %source : !Source to tensor<1024x1024xf64, #CSR>\n ```", "operands": [ { "name": "source", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnySparseTensor" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($result)" }, { "name": "sparse_tensor.number_of_entries", "summary": "Returns the number of entries that are stored in the tensor.", "description": "Returns the number of entries that are stored in the given sparse tensor.\n Note that this is typically the number of nonzero elements in the tensor,\n but since explicit zeros may appear in the storage formats, the more\n accurate nomenclature is used.\n\n Example:\n\n ```mlir\n %noe = sparse_tensor.number_of_entries %tensor : tensor<64x64xf64, #CSR>\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor)" }, { "name": "sparse_tensor.out", "summary": "Outputs a sparse tensor to the given destination", "description": "Outputs the contents of a sparse tensor to the destination defined by an\n opaque pointer provided by `dest`. For targets that have access to a file\n system, for example, this pointer may specify a filename (or file) for output.\n The form of the operation is kept deliberately very general to allow for\n alternative implementations in the future, such as sending the contents to\n a buffer defined by a pointer.\n\n Note that this operation is \"impure\" in the sense that its behavior\n is solely defined by side-effects and not SSA values.\n\n Example:\n\n ```mlir\n sparse_tensor.out %t, %dest : tensor<1024x1024xf64, #CSR>, !Dest\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" }, { "name": "dest", "type": "AnyType" } ], "assemblyFormat": "$tensor `,` $dest attr-dict `:` type($tensor) `,` type($dest)" }, { "name": "sparse_tensor.positions", "summary": "Extracts the `level`-th positions array of the `tensor`", "description": "Returns the positions array of the tensor's storage at the given\n level. This is similar to the `bufferization.to_buffer` operation\n in the sense that it provides a bridge between a tensor world view\n and a bufferized world view. Unlike the `bufferization.to_buffer`\n operation, however, this sparse operation actually lowers into code\n that extracts the positions array from the sparse storage itself\n (either by calling a support library or through direct code).\n\n Writing into the result of this operation is undefined behavior.\n\n Example:\n\n ```mlir\n %1 = sparse_tensor.positions %0 { level = 1 : index }\n : tensor<64x64xf64, #CSR> to memref\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "result", "type": "AnyNon0RankedMemRef" } ], "attributes": [ { "name": "level", "type": "LevelAttr" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor) `to` type($result)" }, { "name": "sparse_tensor.print", "summary": "Prints a sparse tensor (for testing and debugging)", "description": "Prints the individual components of a sparse tensors (the positions,\n coordinates, and values components) to stdout for testing and debugging\n purposes. This operation lowers to just a few primitives in a light-weight\n runtime support to simplify supporting this operation on new platforms.\n\n Example:\n\n ```mlir\n sparse_tensor.print %tensor : tensor<1024x1024xf64, #CSR>\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor)" }, { "name": "sparse_tensor.push_back", "summary": "Pushes a value to the back of a given buffer", "description": "Pushes `value` to the end of the given sparse tensor storage buffer\n `inBuffer` as indicated by the value of `curSize` and returns the\n new size of the buffer in `newSize` (`newSize = curSize + n`).\n The capacity of the buffer is recorded in the memref type of `inBuffer`.\n If the current buffer is full, then `inBuffer.realloc` is called before\n pushing the data to the buffer. This is similar to std::vector push_back.\n\n The optional input `n` specifies the number of times to repeately push\n the value to the back of the tensor. When `n` is a compile-time constant,\n its value can't be less than 1. If `n` is a runtime value that is less\n than 1, the behavior is undefined. Although using input `n` is semantically\n equivalent to calling push_back n times, it gives compiler more chances to\n to optimize the memory reallocation and the filling of the memory with the\n same value.\n\n The `inbounds` attribute tells the compiler that the insertion won't go\n beyond the current storage buffer. This allows the compiler to not generate\n the code for capacity check and reallocation. The typical usage will be for\n \"dynamic\" sparse tensors for which a capacity can be set beforehand.\n\n Note that this operation is \"impure\" in the sense that even though\n the result is modeled through an SSA value, referencing the memref\n through the old SSA value after this operation is undefined behavior.\n\n Example:\n\n ```mlir\n %buf, %newSize = sparse_tensor.push_back %curSize, %buffer, %val\n : index, memref, f64\n ```\n\n ```mlir\n %buf, %newSize = sparse_tensor.push_back inbounds %curSize, %buffer, %val\n : xindex, memref, f64\n ```\n\n ```mlir\n %buf, %newSize = sparse_tensor.push_back inbounds %curSize, %buffer, %val, %n\n : xindex, memref, f64\n ```", "operands": [ { "name": "curSize", "type": "Index" }, { "name": "inBuffer", "type": "StridedMemRefRankOf<[AnyType], [1]>" }, { "name": "value", "type": "AnyType" }, { "name": "n", "type": "Optional" } ], "results": [ { "name": "outBuffer", "type": "StridedMemRefRankOf<[AnyType], [1]>" }, { "name": "newSize", "type": "Index" } ], "attributes": [ { "name": "inbounds", "type": "UnitAttr" } ], "traits": [ { "type": "TypesMatchWith<'inBuffer', 'value', '::llvm::cast($_self).getElementType()'>" }, { "type": "AllTypesMatch<['inBuffer', 'outBuffer']>" } ], "assemblyFormat": "(`inbounds` $inbounds^)? $curSize `,` $inBuffer `,` $value (`,` $n^ )? attr-dict `:` type($curSize) `,` type($inBuffer) `,` type($value) (`,` type($n)^ )?" }, { "name": "sparse_tensor.reduce", "summary": "Custom reduction operation utilized within linalg.generic", "description": "Defines a computation with a `linalg.generic` operation that takes two\n operands and an identity value and reduces all stored values down to a\n single result based on the computation in the region.\n\n The region must contain exactly one block taking two arguments. The block\n must end with a sparse_tensor.yield and the output must match the input\n argument types.\n\n Note that this operation is only required for custom reductions beyond\n the standard reduction operations (add, sub, or, xor) that can be\n sparsified by merely reducing the stored values. More elaborate reduction\n operations (mul, and, min, max, etc.) would need to account for implicit\n zeros as well. They can still be handled using this custom reduction\n operation. The `linalg.generic` `iterator_types` defines which indices\n are being reduced. When the associated operands are used in an operation,\n a reduction will occur. The use of this explicit `reduce` operation\n is not required in most cases.\n\n Example of Matrix->Vector reduction using max(product(x_i), 100):\n\n ```mlir\n %cf1 = arith.constant 1.0 : f64\n %cf100 = arith.constant 100.0 : f64\n %C = tensor.empty(...)\n %0 = linalg.generic #trait\n ins(%A: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %c: f64) :\n %result = sparse_tensor.reduce %c, %a, %cf1 : f64 {\n ^bb0(%arg0: f64, %arg1: f64):\n %0 = arith.mulf %arg0, %arg1 : f64\n %cmp = arith.cmpf \"ogt\", %0, %cf100 : f64\n %ret = arith.select %cmp, %cf100, %0 : f64\n sparse_tensor.yield %ret : f64\n }\n linalg.yield %result : f64\n } -> tensor\n ```", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" }, { "name": "identity", "type": "AnyType" } ], "results": [ { "name": "output", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$x `,` $y `,` $identity attr-dict `:` type($output) $region" }, { "name": "sparse_tensor.reinterpret_map", "summary": "Reinterprets the dimension/level maps of the source tensor", "description": "Reinterprets the dimension-to-level and level-to-dimension map specified in\n `source` according to the type of `dest`.\n `reinterpret_map` is a no-op and is introduced merely to resolve type conflicts.\n It does not make any modification to the source tensor and source/dest tensors\n are considered to be aliases.\n\n `source` and `dest` tensors are \"reinterpretable\" if and only if they have\n the exactly same storage at a low level.\n That is, both `source` and `dest` has the same number of levels and level types,\n and their shape is consistent before and after `reinterpret_map`.\n\n Example:\n ```mlir\n #CSC = #sparse_tensor.encoding<{\n map = (d0, d1) -> (d1: dense, d0: compressed)\n }>\n #CSR = #sparse_tensor.encoding<{\n map = (d0, d1) -> (d0: dense, d1: compressed)\n }>\n %t1 = sparse_tensor.reinterpret_map %t0 : tensor<3x4xi32, #CSC> to tensor<4x3xi32, #CSR>\n\n #BSR = #sparse_tensor.encoding<{\n map = ( i, j ) -> ( i floordiv 2 : dense,\n j floordiv 3 : compressed,\n i mod 2 : dense,\n j mod 3 : dense\n )\n }>\n #DSDD = #sparse_tensor.encoding<{\n map = (i, j, k, l) -> (i: dense, j: compressed, k: dense, l: dense)\n }>\n %t1 = sparse_tensor.reinterpret_map %t0 : tensor<6x12xi32, #BSR> to tensor<3x4x2x3xi32, #DSDD>\n ```", "operands": [ { "name": "source", "type": "AnySparseTensor" } ], "results": [ { "name": "dest", "type": "AnySparseTensor" } ], "attributes": [ { "name": "dstEnc", "type": "SparseTensorEncodingAttr" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "sparse_tensor.reorder_coo", "summary": "Reorder the input COO such that it has the the same order as the output COO", "description": "Reorders the input COO to the same order as specified by the output format.\n E.g., reorder an unordered COO into an ordered one.\n\n The input and result COO tensor must have the same element type, position type and\n coordinate type. At the moment, the operation also only supports ordering\n input and result COO with the same dim2lvl map.\n\n Example:\n\n ```mlir\n %res = sparse_tensor.reorder_coo quick_sort %coo : tensor to\n tensor\n\n ```", "operands": [ { "name": "input_coo", "type": "AnySparseTensor" } ], "results": [ { "name": "result_coo", "type": "AnySparseTensor" } ], "attributes": [ { "name": "algorithm", "type": "SparseTensorSortKindAttr{hybrid_quick_sort|insertion_sort_stable|quick_sort|heap_sort}" } ], "assemblyFormat": "$algorithm $input_coo attr-dict`:` type($input_coo) `to` type($result_coo)" }, { "name": "sparse_tensor.select", "summary": "Select operation utilized within linalg.generic", "description": "Defines an evaluation within a `linalg.generic` operation that takes a single\n operand and decides whether or not to keep that operand in the output.\n\n A single region must contain exactly one block taking one argument. The block\n must end with a sparse_tensor.yield and the output type must be boolean.\n\n Value threshold is an obvious usage of the select operation. However, by using\n `linalg.index`, other useful selection can be achieved, such as selecting the\n upper triangle of a matrix.\n\n Example of selecting A >= 4.0:\n\n ```mlir\n %C = tensor.empty(...)\n %0 = linalg.generic #trait\n ins(%A: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %c: f64) :\n %result = sparse_tensor.select %a : f64 {\n ^bb0(%arg0: f64):\n %cf4 = arith.constant 4.0 : f64\n %keep = arith.cmpf \"uge\", %arg0, %cf4 : f64\n sparse_tensor.yield %keep : i1\n }\n linalg.yield %result : f64\n } -> tensor\n ```\n\n Example of selecting lower triangle of a matrix:\n\n ```mlir\n %C = tensor.empty(...)\n %1 = linalg.generic #trait\n ins(%A: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %c: f64) :\n %row = linalg.index 0 : index\n %col = linalg.index 1 : index\n %result = sparse_tensor.select %a : f64 {\n ^bb0(%arg0: f64):\n %keep = arith.cmpf \"olt\", %col, %row : f64\n sparse_tensor.yield %keep : i1\n }\n linalg.yield %result : f64\n } -> tensor\n ```", "operands": [ { "name": "x", "type": "AnyType" } ], "results": [ { "name": "output", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$x attr-dict `:` type($x) $region" }, { "name": "sparse_tensor.slice.offset", "summary": "Extracts the offset of the sparse tensor slice at the given dimension", "description": "Extracts the offset of the sparse tensor slice at the given dimension.\n\n Currently, sparse tensor slices are still a work in progress, and only\n works when runtime library is disabled (i.e., running the sparsifier\n with `enable-runtime-library=false`).\n\n Example:\n\n ```mlir\n %0 = tensor.extract_slice %s[%v1, %v2][64, 64][1, 1] : tensor<128x128xf64, #DCSR>\n to tensor<64x64xf64, #Slice>\n\n %1 = sparse_tensor.slice.offset %0 at 0 : tensor<64x64xf64, #Slice>\n %2 = sparse_tensor.slice.offset %0 at 1 : tensor<64x64xf64, #Slice>\n // %1 = %v1\n // %2 = %v2\n ```", "operands": [ { "name": "slice", "type": "AnySparseTensorSlice" } ], "results": [ { "name": "offset", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "IndexAttr" } ], "assemblyFormat": "$slice `at` $dim attr-dict `:` type($slice)" }, { "name": "sparse_tensor.slice.stride", "summary": "Extracts the stride of the sparse tensor slice at the given dimension", "description": "Extracts the stride of the sparse tensor slice at the given dimension.\n\n Currently, sparse tensor slices are still a work in progress, and only\n works when runtime library is disabled (i.e., running the sparsifier\n with `enable-runtime-library=false`).\n\n Example:\n\n ```mlir\n %0 = tensor.extract_slice %s[%v1, %v2][64, 64][%s1, %s2] : tensor<128x128xf64, #DCSR>\n to tensor<64x64xf64, #Slice>\n\n %1 = sparse_tensor.slice.stride %0 at 0 : tensor<64x64xf64, #Slice>\n %2 = sparse_tensor.slice.stride %0 at 1 : tensor<64x64xf64, #Slice>\n // %1 = %s1\n // %2 = %s2\n\n ```", "operands": [ { "name": "slice", "type": "AnySparseTensorSlice" } ], "results": [ { "name": "stride", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "IndexAttr" } ], "assemblyFormat": "$slice `at` $dim attr-dict `:` type($slice)" }, { "name": "sparse_tensor.sort", "summary": "Sorts the arrays in xs and ys lexicographically on the integral values found in the xs list", "description": "Sorts the `xs` values along with some `ys` values that are put in a single linear\n buffer `xy`. The affine map attribute `perm_map` specifies the permutation to be\n applied on the `xs` before comparison, the rank of the permutation map\n also specifies the number of `xs` values in `xy`.\n The optional index attribute `ny` provides the number of `ys` values in `xy`.\n When `ny` is not explicitly specified, its value is 0.\n This instruction supports a more efficient way to store the COO definition\n in sparse tensor type.\n\n The buffer xy should have a dimension not less than n * (rank(perm_map) + ny) while the\n buffers in `ys` should have a dimension not less than `n`. The behavior of\n the operator is undefined if this condition is not met.\n\n Example:\n\n ```mlir\n sparse_tensor.sort insertion_sort_stable %n, %x { perm_map = affine_map<(i,j) -> (j,i)> }\n : memref\n ```", "operands": [ { "name": "n", "type": "Index" }, { "name": "xy", "type": "StridedMemRefRankOf<[AnyInteger, Index], [1]>" }, { "name": "ys", "type": "Variadic>" } ], "attributes": [ { "name": "perm_map", "type": "AffineMapAttr" }, { "name": "ny", "type": "OptionalAttr" }, { "name": "algorithm", "type": "SparseTensorSortKindAttr{hybrid_quick_sort|insertion_sort_stable|quick_sort|heap_sort}" } ], "assemblyFormat": "$algorithm $n`,`$xy (`jointly` $ys^)? attr-dict`:` type($xy) (`jointly` type($ys)^)?" }, { "name": "sparse_tensor.storage_specifier.get", "description": "Returns the requested field of the given storage_specifier.\n\n Example of querying the size of the coordinates array for level 0:\n\n ```mlir\n %0 = sparse_tensor.storage_specifier.get %arg0 crd_mem_sz at 0\n : !sparse_tensor.storage_specifier<#COO>\n ```", "operands": [ { "name": "specifier", "type": "SparseTensorStorageSpecifier" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "specifierKind", "type": "SparseTensorStorageSpecifierKindAttr{lvl_sz|pos_mem_sz|crd_mem_sz|val_mem_sz|dim_offset|dim_stride}" }, { "name": "level", "type": "OptionalAttr" } ], "assemblyFormat": "$specifier $specifierKind (`at` $level^)? attr-dict`:` qualified(type($specifier))" }, { "name": "sparse_tensor.storage_specifier.init", "description": "Returns an initial storage specifier value. A storage specifier\n value holds the level-sizes, position arrays, coordinate arrays,\n and the value array.\n If this is a specifier for slices, it also holds the extra strides/offsets\n for each tensor dimension.\n\n TODO: The sparse tensor slice support is currently in a unstable state, and\n is subject to change in the future.\n\n Example:\n\n ```mlir\n #CSR = #sparse_tensor.encoding<{\n map = (i, j) -> (i : dense, j : compressed)\n }>\n #CSR_SLICE = #sparse_tensor.encoding<{\n map = (d0 : #sparse_tensor,\n d1 : #sparse_tensor) ->\n (d0 : dense, d1 : compressed)\n }>\n\n %0 = sparse_tensor.storage_specifier.init : !sparse_tensor.storage_specifier<#CSR>\n %1 = sparse_tensor.storage_specifier.init with %src\n : !sparse_tensor.storage_specifier<#CSR> to\n !sparse_tensor.storage_specifier<#CSR_SLICE>\n ```", "operands": [ { "name": "source", "type": "Optional" } ], "results": [ { "name": "result", "type": "SparseTensorStorageSpecifier" } ], "assemblyFormat": "attr-dict (`with` $source^)? `:` (`from` qualified(type($source))^ `to`)? qualified(type($result))" }, { "name": "sparse_tensor.storage_specifier.set", "description": "Set the field of the storage specifier to the given input value. Returns\n the updated storage_specifier as a new SSA value.\n\n Example of updating the sizes of the coordinates array for level 0:\n\n ```mlir\n %0 = sparse_tensor.storage_specifier.set %arg0 crd_mem_sz at 0 with %new_sz\n : !sparse_tensor.storage_specifier<#COO>\n ```", "operands": [ { "name": "specifier", "type": "SparseTensorStorageSpecifier" }, { "name": "value", "type": "Index" } ], "results": [ { "name": "result", "type": "SparseTensorStorageSpecifier" } ], "attributes": [ { "name": "specifierKind", "type": "SparseTensorStorageSpecifierKindAttr{lvl_sz|pos_mem_sz|crd_mem_sz|val_mem_sz|dim_offset|dim_stride}" }, { "name": "level", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['result', 'specifier']>" } ], "assemblyFormat": "$specifier $specifierKind (`at` $level^)? `with` $value attr-dict `:` qualified(type($result))" }, { "name": "sparse_tensor.unary", "summary": "Unary set operation utilized within linalg.generic", "description": "Defines a computation with a `linalg.generic` operation that takes a single\n operand and executes one of two regions depending on whether the operand is\n nonzero (i.e. stored explicitly in the sparse storage format).\n\n Two regions are defined for the operation must appear in this order:\n - present (elements present in the sparse tensor)\n - absent (elements not present in the sparse tensor)\n\n Each region contains a single block describing the computation and result.\n A non-empty block must end with a sparse_tensor.yield and the return type\n must match the type of `output`. The primary region's block has one\n argument, while the missing region's block has zero arguments. The\n absent region may only generate constants or values already computed\n on entry of the `linalg.generic` operation.\n\n A region may also be declared empty (i.e. `absent={}`), indicating that the\n region does not contribute to the output.\n\n Due to the possibility of empty regions, i.e. lack of a value for certain\n cases, the result of this operation may only feed directly into the output\n of the `linalg.generic` operation or into into a custom reduction\n `sparse_tensor.reduce` operation that follows in the same region.\n\n Example of A+1, restricted to existing elements:\n\n ```mlir\n %C = tensor.empty(...) : tensor\n %0 = linalg.generic #trait\n ins(%A: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %c: f64) :\n %result = sparse_tensor.unary %a : f64 to f64\n present={\n ^bb0(%arg0: f64):\n %cf1 = arith.constant 1.0 : f64\n %ret = arith.addf %arg0, %cf1 : f64\n sparse_tensor.yield %ret : f64\n }\n absent={}\n linalg.yield %result : f64\n } -> tensor\n ```\n\n Example returning +1 for existing values and -1 for missing values:\n\n ```mlir\n %p1 = arith.constant 1 : i32\n %m1 = arith.constant -1 : i32\n %C = tensor.empty(...) : tensor\n %1 = linalg.generic #trait\n ins(%A: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %c: i32) :\n %result = sparse_tensor.unary %a : f64 to i32\n present={\n ^bb0(%x: f64):\n sparse_tensor.yield %p1 : i32\n }\n absent={\n sparse_tensor.yield %m1 : i32\n }\n linalg.yield %result : i32\n } -> tensor\n ```\n\n Example showing a structural inversion (existing values become missing in\n the output, while missing values are filled with 1):\n\n ```mlir\n %c1 = arith.constant 1 : i64\n %C = tensor.empty(...) : tensor\n %2 = linalg.generic #trait\n ins(%A: tensor)\n outs(%C: tensor) {\n ^bb0(%a: f64, %c: i64) :\n %result = sparse_tensor.unary %a : f64 to i64\n present={}\n absent={\n sparse_tensor.yield %c1 : i64\n }\n linalg.yield %result : i64\n } -> tensor\n ```", "operands": [ { "name": "x", "type": "AnyType" } ], "results": [ { "name": "output", "type": "AnyType" } ], "regions": [ { "name": "presentRegion", "type": "AnyRegion" }, { "name": "absentRegion", "type": "AnyRegion" } ], "assemblyFormat": "$x attr-dict `:` type($x) `to` type($output) `\\n`\n `present` `=` $presentRegion `\\n`\n `absent` `=` $absentRegion" }, { "name": "sparse_tensor.values", "summary": "Extracts numerical values array from a tensor", "description": "Returns the values array of the sparse storage format for the given\n sparse tensor, independent of the actual dimension. This is similar to\n the `bufferization.to_buffer` operation in the sense that it provides a bridge\n between a tensor world view and a bufferized world view. Unlike the\n `bufferization.to_buffer` operation, however, this sparse operation actually\n lowers into code that extracts the values array from the sparse storage\n scheme (either by calling a support library or through direct code).\n\n Writing into the result of this operation is undefined behavior.\n\n Example:\n\n ```mlir\n %1 = sparse_tensor.values %0 : tensor<64x64xf64, #CSR> to memref\n ```", "operands": [ { "name": "tensor", "type": "AnySparseTensor" } ], "results": [ { "name": "result", "type": "AnyNon0RankedMemRef" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor) `to` type($result)" }, { "name": "sparse_tensor.yield", "summary": "Yield from sparse_tensor set-like operations", "description": "Yields a value from within a `binary`, `unary`, `reduce`,\n `select` or `foreach` block.\n\n Example:\n\n ```mlir\n %0 = sparse_tensor.unary %a : i64 to i64 {\n present={\n ^bb0(%arg0: i64):\n %cst = arith.constant 1 : i64\n %ret = arith.addi %arg0, %cst : i64\n sparse_tensor.yield %ret : i64\n }\n }\n ```", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$results attr-dict `:` type($results)" }, { "name": "spirv.AccessChain", "summary": "Create a pointer into a composite object.", "description": "Result Type must be an OpTypePointer. Its Type operand must be the type\n reached by walking the Base’s type hierarchy down to the last provided\n index in Indexes, and its Storage Class operand must be the same as the\n Storage Class of Base.\n\n Base must be a pointer, pointing to the base of a composite object.\n\n Indexes walk the type hierarchy to the desired depth, potentially down\n to scalar granularity. The first index in Indexes will select the top-\n level member/element/component/element of the base composite. All\n composite constituents use zero-based numbering, as described by their\n OpType… instruction. The second index will apply similarly to that\n result, and so on. Once any non-composite type is reached, there must be\n no remaining (unused) indexes.\n\n Each index in Indexes\n\n - must be a scalar integer type,\n\n - is treated as a signed count, and\n\n - must be an OpConstant when indexing into a structure.\n\n \n\n #### Example:\n\n ```mlir\n %0 = \"spirv.Constant\"() { value = 1: i32} : () -> i32\n %1 = spirv.Variable : !spirv.ptr>, Function>\n %2 = spirv.AccessChain %1[%0] : !spirv.ptr>, Function> -> !spirv.ptr, Function>\n %3 = spirv.Load \"Function\" %2 [\"Volatile\"] : !spirv.array<4xf32>\n ```", "operands": [ { "name": "base_ptr", "type": "SPIRV_AnyPtr" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "component_ptr", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$base_ptr `[` $indices `]` attr-dict `:` type($base_ptr) `,` type($indices) `->` type(results)" }, { "name": "spirv.All", "summary": "Result is true if all components of Vector are true.", "description": "Result Type must be a Boolean type scalar.\n\n Vector must be a vector of Boolean type.\n\n \n\n #### Example:\n\n ```mlir\n %result = spirv.All %vector : vector<4xi1>\n ```", "operands": [ { "name": "vector", "type": "SPIRV_VectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Bool" } ], "assemblyFormat": "$vector attr-dict `:` type($vector)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Any", "summary": "Result is true if any component of Vector is true.", "description": "Result Type must be a Boolean type scalar.\n\n Vector must be a vector of Boolean type.\n\n \n\n #### Example:\n\n ```mlir\n %result = spirv.Any %vector : vector<4xi1>\n ```", "operands": [ { "name": "vector", "type": "SPIRV_VectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Bool" } ], "assemblyFormat": "$vector attr-dict `:` type($vector)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ARM.Graph", "summary": "Declare or define a SPIR-V graph", "description": "This op declares or defines a SPIR-V graph using one region, which\n contains one or more blocks.\n\n This op is not allowed to implicitly capture global values, and all external\n references must use function arguments or symbol references. This op itself\n defines a symbol that is unique in the enclosing module op.\n\n Note that this op does not have a 1:1 mapping to the SPIR-V ops representing\n a graph. Indeed during serialization a single GraphARMOp is serialized into\n several different SPIR-V ops: OpGraphARM, OpGraphInputARM and OpGraphEndARM.\n There are as many occurences of OpGraphInputARM ops as many inputs in the\n graph. Deserialization maps that set of operations into a single GraphARMOp.\n\n This op itself takes no operands and generates no results. Its region\n can take zero or more arguments and return one or more values.\n\n ```\n spv-graph-arm-op ::= `spirv.ARM.Graph` function-signature\n region\n ```\n\n #### Example:\n\n ```mlir\n spirv.ARM.Graph @graph(%arg0: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {\n spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16>\n }\n ```", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "entry_point", "type": "OptionalAttr" }, { "name": "sym_name", "type": "StrAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.ARM.GraphConstant", "summary": "Declare a graph constant.", "description": "Declare a graph constant.\n Result Type must be an OpTypeTensorARM.\n GraphConstantID must be a 32-bit integer literal.\n\n #### Example:\n\n ```mlir\n %0 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor<2x3xi16>\n ```\n\n GraphConstantID is a unique identifier which is use to map the contants\n defined by GraphConstantARM in the SPIRV module with the one provided at\n shader creation time via the VkDataGraphPipelineShaderModuleCreateInfoARM.\n That Vulkan structure provides a list of VkDataGraphPipelineConstantARM\n which contains the bindings from id to data. (For more details see\n https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#graphs)", "results": [ { "name": "output", "type": "SPIRV_AnyTensorArm" } ], "attributes": [ { "name": "graph_constant_id", "type": "I32Attr" } ], "assemblyFormat": "attr-dict `:` type($output)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ARM.GraphEntryPoint", "summary": "Declare a graph entry point and its interface.", "description": "Graph Entry Point must be the Result `` of an OpGraphARM instruction.\n\n Name is a name string for the graphentry point. A module cannot have two\n OpGraphEntryPointARM instructions with the same Name string.\n\n Interface is a list of symbol references to `spirv.GlobalVariable`\n operations. These declare the set of global variables from a\n module that form the interface of this entry point. The set of\n Interface symbols must be equal to or a superset of the\n `spirv.GlobalVariable`s referenced by the entry point’s static call\n tree, within the interface’s storage classes.\n\n #### Example:\n\n ```mlir\n spirv.GlobalVariable @arg_0 bind(0, 0) : !spirv.ptr, UniformConstant>\n spirv.GlobalVariable @res_0 bind(0, 1) : !spirv.ptr, UniformConstant>\n spirv.ARM.GraphEntryPoint @graph, @arg_0, @res_0\n spirv.ARM.Graph @graph(%arg0 : !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {\n ...\n }\n ```", "attributes": [ { "name": "fn", "type": "FlatSymbolRefAttr" }, { "name": "interface", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.ARM.GraphOutputs", "summary": "Define graph outputs.", "description": "Values are the graph outputs values and must match the GraphOutputs Type\n operand of the OpTypeGraphARM type of the OpGraphARM body this\n instruction is in.\n\n This instruction must be the last instruction in a block.\n\n #### Example:\n\n ```mlir\n spirv.ARM.Graph @graph(%arg0 : !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {\n spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16>\n }\n ```", "operands": [ { "name": "value", "type": "Variadic" } ], "assemblyFormat": "$value attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "spirv.AtomicAnd", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by the bitwise AND of Original Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicAnd %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicCompareExchange", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value from Value only if Original Value equals Comparator,\n and\n\n 3) store the New Value back through Pointer'only if 'Original Value\n equaled Comparator.\n\n The instruction's result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n Use Equal for the memory semantics of this instruction when Value and\n Original Value compare equal.\n\n Use Unequal for the memory semantics of this instruction when Value and\n Original Value compare unequal. Unequal must not be set to Release or\n Acquire and Release. In addition, Unequal cannot be set to a stronger\n memory-order then Equal.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type. This type\n must also match the type of Comparator.\n\n Memory is a memory Scope.\n\n \n\n #### Example:\n\n ```\n %0 = spirv.AtomicCompareExchange \n %pointer, %value, %comparator\n : !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" }, { "name": "comparator", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "equal_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" }, { "name": "unequal_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'comparator', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $equal_semantics $unequal_semantics operands attr-dict `:`\n type($pointer)" }, { "name": "spirv.AtomicCompareExchangeWeak", "summary": "Deprecated (use OpAtomicCompareExchange).", "description": "Has the same semantics as OpAtomicCompareExchange.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicCompareExchangeWeak \n %pointer, %value, %comparator\n : !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" }, { "name": "comparator", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "equal_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" }, { "name": "unequal_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'comparator', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $equal_semantics $unequal_semantics operands attr-dict `:`\n type($pointer)" }, { "name": "spirv.AtomicExchange", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value from copying Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction's result is the Original Value.\n\n Result Type must be a scalar of integer type or floating-point type.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory is a memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicExchange %pointer, %value,\n : !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Numerical" } ], "results": [ { "name": "result", "type": "SPIRV_Numerical" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicIAdd", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by integer addition of Original Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicIAdd %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicIDecrement", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value through integer subtraction of 1 from Original Value,\n and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar. The type of the value\n pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicIDecrement %pointer :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicIIncrement", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value through integer addition of 1 to Original Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar. The type of the value\n pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicIIncrement %pointer :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicISub", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by integer subtraction of Value from Original Value,\n and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicISub %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicLoad", "summary": "Atomically load through Pointer using the given Semantics.", "description": "All subparts of the value that is loaded are read atomically with respect\n to all other atomic accesses to it within Scope.\n\n Result Type must be a scalar of integer type or floating-point type.\n\n The type of the value pointed to by Pointer must be the same as Result\n Type.\n\n Memory is a memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicLoad %pointer :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_Numerical" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicOr", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by the bitwise OR of Original Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicOr %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicSMax", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by finding the largest signed integer of Original\n Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicSMax %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicSMin", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by finding the smallest signed integer of Original\n Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicSMin %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicStore", "summary": "Atomically store through Pointer using the given Semantics.", "description": "All subparts of Value are written atomically with respect to all other\n atomic accesses to it within Scope.\n\n The type of the value pointed to by Pointer must be the same as the type\n of Value, and must be a scalar of integer type or floating-point type.\n\n Memory is a memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n spirv.AtomicStore %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Numerical" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicUMax", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by finding the largest unsigned integer of Original\n Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicUMax %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicUMin", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by finding the smallest unsigned integer of Original\n Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicUMin %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.AtomicXor", "summary": "Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:", "description": "1) load through Pointer to get an Original Value,\n\n 2) get a New Value by the bitwise exclusive OR of Original Value and\n Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction’s result is the Original Value.\n\n Result Type must be an integer type scalar.\n\n The type of Value must be the same as Result Type. The type of the\n value pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.AtomicXor %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)" }, { "name": "spirv.Bitcast", "summary": "Bit pattern-preserving type conversion.", "description": "Result Type must be an OpTypePointer, cooperative matrix, or a scalar or\n vector of numerical-type.\n\n Operand must have a type of OpTypePointer, cooperative matrix, or a scalar\n or vector of numerical-type. It must be a different type than Result Type.\n\n If either Result Type or Operand is a pointer, the other must be a\n pointer (diverges from the SPIR-V spec).\n\n If Result Type has a different number of components than Operand, the\n total number of bits in Result Type must equal the total number of bits\n in Operand. Let L be the type, either Result Type or Operand's type,\n that has the larger number of components. Let S be the other type, with\n the smaller number of components. The number of components in L must be\n an integer multiple of the number of components in S. The first\n component (that is, the only or lowest-numbered component) of S maps to\n the first components of L, and so on, up to the last component of S\n mapping to the last components of L. Within this mapping, any single\n component of S (mapping to multiple components of L) maps its lower-\n ordered bits to the lower-numbered components of L.\n\n #### Example:\n\n ```mlir\n %1 = spirv.Bitcast %0 : f32 to i32\n %1 = spirv.Bitcast %0 : vector<2xf32> to i64\n %1 = spirv.Bitcast %0 : !spirv.ptr to !spirv.ptr\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrPtrOrCoopMatrix" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrPtrOrCoopMatrix" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitCount", "summary": "Count the number of set bits in an object.", "description": "Results are computed per component.\n\n Result Type must be a scalar or vector of integer type. The components\n must be wide enough to hold the unsigned Width of Base as an unsigned\n value. That is, no sign bit is needed or counted when checking for a\n wide enough result width.\n\n Base must be a scalar or vector of integer type. It must have the same\n number of components as Result Type.\n\n The result is the unsigned value that is the number of bits in Base that\n are 1.\n\n #### Example:\n\n ```mlir\n %2 = spirv.BitCount %0: i32\n %3 = spirv.BitCount %1: vector<4xi32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitFieldInsert", "summary": "Make a copy of an object, with a modified bit field that comes from\n another object.", "description": "Results are computed per component.\n\n Result Type must be a scalar or vector of integer type.\n\n The type of Base and Insert must be the same as Result Type.\n\n Any result bits numbered outside [Offset, Offset + Count - 1]\n (inclusive) will come from the corresponding bits in Base.\n\n Any result bits numbered in [Offset, Offset + Count - 1] come, in\n order, from the bits numbered [0, Count - 1] of Insert.\n\n Count must be an integer type scalar. Count is the number of bits taken\n from Insert. It will be consumed as an unsigned value. Count can be 0,\n in which case the result will be Base.\n\n Offset must be an integer type scalar. Offset is the lowest-order bit\n of the bit field. It will be consumed as an unsigned value.\n\n The resulting value is undefined if Count or Offset or their sum is\n greater than the number of bits in the result.\n\n #### Example:\n\n ```mlir\n %0 = spirv.BitFieldInsert %base, %insert, %offset, %count : vector<3xi32>, i8, i8\n ```", "operands": [ { "name": "base", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "insert", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "offset", "type": "SPIRV_Integer" }, { "name": "count", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['base', 'insert', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($base) `,` type($offset) `,` type($count)", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitFieldSExtract", "summary": "Extract a bit field from an object, with sign extension.", "description": "Results are computed per component.\n\n Result Type must be a scalar or vector of integer type.\n\n The type of Base must be the same as Result Type.\n\n If Count is greater than 0: The bits of Base numbered in [Offset, Offset\n + Count - 1] (inclusive) become the bits numbered [0, Count - 1] of the\n result. The remaining bits of the result will all be the same as bit\n Offset + Count - 1 of Base.\n\n Count must be an integer type scalar. Count is the number of bits\n extracted from Base. It will be consumed as an unsigned value. Count can\n be 0, in which case the result will be 0.\n\n Offset must be an integer type scalar. Offset is the lowest-order bit\n of the bit field to extract from Base. It will be consumed as an\n unsigned value.\n\n The resulting value is undefined if Count or Offset or their sum is\n greater than the number of bits in the result.\n\n #### Example:\n\n ```mlir\n %0 = spirv.BitFieldSExtract %base, %offset, %count : vector<3xi32>, i8, i8\n ```", "operands": [ { "name": "base", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "offset", "type": "SPIRV_Integer" }, { "name": "count", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['base', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($base) `,` type($offset) `,` type($count)", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitFieldUExtract", "summary": "Extract a bit field from an object, without sign extension.", "description": "The semantics are the same as with OpBitFieldSExtract with the exception\n that there is no sign extension. The remaining bits of the result will\n all be 0.\n\n #### Example:\n\n ```mlir\n %0 = spirv.BitFieldUExtract %base, %offset, %count : vector<3xi32>, i8, i8\n ```", "operands": [ { "name": "base", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "offset", "type": "SPIRV_Integer" }, { "name": "count", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['base', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($base) `,` type($offset) `,` type($count)", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitReverse", "summary": "Reverse the bits in an object.", "description": "Results are computed per component.\n\n Result Type must be a scalar or vector of integer type.\n\n The type of Base must be the same as Result Type.\n\n The bit-number n of the result will be taken from bit-number Width - 1 -\n n of Base, where Width is the OpTypeInt operand of the Result Type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.BitReverse %0 : i32\n %3 = spirv.BitReverse %1 : vector<4xi32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitwiseAnd", "summary": "Result is 1 if both Operand 1 and Operand 2 are 1. Result is 0 if either\n Operand 1 or Operand 2 are 0.", "description": "Results are computed per component, and within each component, per bit.\n\n Result Type must be a scalar or vector of integer type. The type of\n Operand 1 and Operand 2 must be a scalar or vector of integer type.\n They must have the same number of components as Result Type. They must\n have the same component width as Result Type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.BitwiseAnd %0, %1 : i32\n %2 = spirv.BitwiseAnd %0, %1 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitwiseOr", "summary": "Result is 1 if either Operand 1 or Operand 2 is 1. Result is 0 if both\n Operand 1 and Operand 2 are 0.", "description": "Results are computed per component, and within each component, per bit.\n\n Result Type must be a scalar or vector of integer type. The type of\n Operand 1 and Operand 2 must be a scalar or vector of integer type.\n They must have the same number of components as Result Type. They must\n have the same component width as Result Type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.BitwiseOr %0, %1 : i32\n %2 = spirv.BitwiseOr %0, %1 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.BitwiseXor", "summary": "Result is 1 if exactly one of Operand 1 or Operand 2 is 1. Result is 0\n if Operand 1 and Operand 2 have the same value.", "description": "Results are computed per component, and within each component, per bit.\n\n Result Type must be a scalar or vector of integer type. The type of\n Operand 1 and Operand 2 must be a scalar or vector of integer type.\n They must have the same number of components as Result Type. They must\n have the same component width as Result Type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.BitwiseXor %0, %1 : i32\n %2 = spirv.BitwiseXor %0, %1 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Branch", "summary": "Unconditional branch to target block.", "description": "This instruction must be the last instruction in a block.\n\n #### Example:\n\n ```mlir\n spirv.Branch ^target\n spirv.Branch ^target(%0, %1: i32, f32)\n ```", "operands": [ { "name": "targetOperands", "type": "Variadic" } ], "successors": [ { "name": "target", "type": "AnySuccessor" } ], "assemblyFormat": "$target (`(` $targetOperands^ `:` type($targetOperands) `)`)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.BranchConditional", "summary": "If Condition is true, branch to true block, otherwise branch to false\n block.", "description": "Condition must be a Boolean type scalar.\n\n Branch weights are unsigned 32-bit integer literals. There must be\n either no Branch Weights or exactly two branch weights. If present, the\n first is the weight for branching to True Label, and the second is the\n weight for branching to False Label. The implied probability that a\n branch is taken is its weight divided by the sum of the two Branch\n weights. At least one weight must be non-zero. A weight of zero does not\n imply a branch is dead or permit its removal; branch weights are only\n hints. The two weights must not overflow a 32-bit unsigned integer when\n added together.\n\n This instruction must be the last instruction in a block.\n\n \n\n ```\n branch-conditional-op ::= `spirv.BranchConditional` ssa-use\n (`[` integer-literal, integer-literal `]`)?\n `,` successor `,` successor\n successor ::= bb-id branch-use-list?\n branch-use-list ::= `(` ssa-use-list `:` type-list-no-parens `)`\n ```\n\n #### Example:\n\n ```mlir\n spirv.BranchConditional %condition, ^true_branch, ^false_branch\n spirv.BranchConditional %condition, ^true_branch(%0: i32), ^false_branch(%1: i32)\n ```", "operands": [ { "name": "condition", "type": "SPIRV_Bool" }, { "name": "trueTargetOperands", "type": "Variadic" }, { "name": "falseTargetOperands", "type": "Variadic" } ], "attributes": [ { "name": "branch_weights", "type": "OptionalAttr>" } ], "successors": [ { "name": "trueTarget", "type": "AnySuccessor" }, { "name": "falseTarget", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.acos", "summary": "Compute the arc cosine of x.", "description": "Result is an angle in radians.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.acos %0 : f32\n %3 = spirv.CL.acos %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.acosh", "summary": "Compute the inverse hyperbolic cosine of x .", "description": "Result is an angle in radians.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.acosh %0 : f32\n %3 = spirv.CL.acosh %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.asin", "summary": "Compute the arc sine of x.", "description": "Result is an angle in radians.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.asin %0 : f32\n %3 = spirv.CL.asin %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.asinh", "summary": "Compute the inverse hyperbolic sine of x.", "description": "Result is an angle in radians.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.asinh %0 : f32\n %3 = spirv.CL.asinh %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.atan", "summary": "Compute the arc tangent of x.", "description": "Result is an angle in radians.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.atan %0 : f32\n %3 = spirv.CL.atan %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.atan2", "summary": "Compute the arc tangent of y / x.", "description": "Result is an angle in radians.\n\n Result Type, y and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.atan2 %0, %1 : f32\n %3 = spirv.CL.atan2 %0, %1 : vector<4xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.atanh", "summary": "Compute the hyperbolic arc tangent of x.", "description": "Result is an angle in radians.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.atanh %0 : f32\n %3 = spirv.CL.atanh %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.cbrt", "summary": "Compute the cube root of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.cbrt %0 : f32\n %3 = spirv.CL.cbrt %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.ceil", "summary": "Round x to integral value using the round to positive infinity rounding\n mode.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.ceil %0 : f32\n %3 = spirv.CL.ceil %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.clz", "summary": "Count leading zeros in operand", "description": "Returns the number of most-significant 0-bits in x.\n\n Result Type and x must be integer or vector(2,3,4,8,16) of\n integer values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.clz %0 : i32\n %3 = spirv.CL.clz %1 : vector<3xi16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.copysign", "summary": "Computes the value with the magnitude of x and the sign of y.", "description": "Result Type, x and y must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.copysign %0, %1 : f32\n %3 = spirv.CL.copysign %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.cos", "summary": "Compute the cosine of x radians.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.cos %0 : f32\n %3 = spirv.CL.cos %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.cosh", "summary": "Compute the hyperbolic cosine of x radians.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.cosh %0 : f32\n %3 = spirv.CL.cosh %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.erf", "summary": "Error function of x encountered in integrating the normal distribution.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.erf %0 : f32\n %3 = spirv.CL.erf %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.erfc", "summary": "Complementary error function of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.erfc %0 : f32\n %3 = spirv.CL.erfc %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.exp", "summary": "Exponentiation of Operand 1", "description": "Compute the base-e exponential of x. (i.e. ex)\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.exp %0 : f32\n %3 = spirv.CL.exp %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.exp10", "summary": "Compute the base-10 exponential of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.exp10 %0 : f32\n %3 = spirv.CL.exp10 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.exp2", "summary": "Compute the base-2 exponential of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.exp2 %0 : f32\n %3 = spirv.CL.exp2 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.expm1", "summary": "Compute the base-e exponential of x minus 1.0.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.expm1 %0 : f32\n %3 = spirv.CL.expm1 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.fabs", "summary": "Absolute value of operand", "description": "Compute the absolute value of x.\n\n Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.fabs %0 : f32\n %3 = spirv.CL.fabs %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.fdim", "summary": "Compute the positive difference between x and y.", "description": "Returns x - y if x > y, otherwise it returns +0.0.\n\n Result Type, x and y must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.fdim %0, %1 : f32\n %3 = spirv.CL.fdim %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.floor", "summary": "Round x to the integral value using the round to negative infinity\n rounding mode.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.floor %0 : f32\n %3 = spirv.CL.floor %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.fma", "summary": "Compute the correctly rounded floating-point representation of the sum\n of c with the infinitely precise product of a and b. Rounding of\n intermediate products shall not occur. Edge case results are per the\n IEEE 754-2008 standard.", "description": "Result Type, a, b and c must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.CL.fma %a, %b, %c : f32\n %1 = spirv.CL.fma %a, %b, %c : vector<3xf16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.fmax", "summary": "Return maximum of two floating-point operands", "description": "Returns y if x < y, otherwise it returns x. If one argument is a NaN,\n Fmax returns the other argument. If both arguments are NaNs, Fmax returns a NaN.\n\n Result Type, x and y must be floating-point or vector(2,3,4,8,16)\n of floating-point values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.fmax %0, %1 : f32\n %3 = spirv.CL.fmax %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.fmin", "summary": "Return minimum of two floating-point operands", "description": "Returns y if y < x, otherwise it returns x. If one argument is a NaN, Fmin returns the other argument.\n If both arguments are NaNs, Fmin returns a NaN.\n\n Result Type,x and y must be floating-point or vector(2,3,4,8,16) of floating-point values.\n\n All of the operands, including the Result Type operand, must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.fmin %0, %1 : f32\n %3 = spirv.CL.fmin %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.fmod", "summary": "Modulus. Returns x - y * trunc(x / y), with the same sign as x.", "description": "Result Type, x and y must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.fmod %0, %1 : f32\n %3 = spirv.CL.fmod %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.hypot", "summary": "Compute the square root of x^2 + y^2.", "description": "Result Type, x and y must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.hypot %0, %1 : f32\n %3 = spirv.CL.hypot %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.ldexp", "summary": "Builds y such that y = significand * 2^exponent.", "description": "Builds a floating-point number from x and the corresponding\n integral exponent of two in exp:\n\n significand * 2^exponent\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n The exp operand must be a scalar or vector with integer component type.\n The number of components in x and exp must be the same.\n\n Result Type must be the same type as the type of x. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %y = spirv.CL.ldexp %x, %exp : f32, i32 -> f32\n %y = spirv.CL.ldexp %x, %exp : vector<3xf32>, vector<3xi32> -> vector<3xf32>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "exp", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "y", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['x', 'y']>" } ], "assemblyFormat": "attr-dict $x `,` $exp `:` type($x) `,` type($exp) `->` type($y)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.log", "summary": "Compute the natural logarithm of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.log %0 : f32\n %3 = spirv.CL.log %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.log10", "summary": "Compute the base-10 logarithm of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.log10 %0 : f32\n %3 = spirv.CL.log10 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.log1p", "summary": "Compute the natural logarithm of x + 1.0.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.log1p %0 : f32\n %3 = spirv.CL.log1p %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.log2", "summary": "Compute the base-2 logarithm of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.log2 %0 : f32\n %3 = spirv.CL.log2 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.mix", "summary": "Returns the linear blend of x & y implemented as: x + (y - x) * a", "description": "Result Type, x, y and a must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n Note: This instruction can be implemented using contractions such as mad\n or fma.\n\n #### Example:\n\n ```mlir\n %0 = spirv.CL.mix %a, %b, %c : f32\n %1 = spirv.CL.mix %a, %b, %c : vector<3xf16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.pow", "summary": "Compute x to the power y.", "description": "Result Type, x and y must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.pow %0, %1 : f32\n %3 = spirv.CL.pow %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.pown", "summary": "Compute x to the power y, where y is an integer.", "description": "Result is x raised to the power y, where y is an integer.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n The y operand must be a scalar or vector with integer component type.\n The number of components in x and y must be the same.\n\n Result Type must be the same type as the type of x. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.pown %0, %1 : f32, i32 -> f32\n %2 = spirv.CL.pown %0, %1 : vector<3xf32>, vector<3xi32> -> vector<3xf32>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "attr-dict $x `,` $y `:` type($x) `,` type($y) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.printf", "summary": "The printf extended instruction writes output to an implementation-\n defined stream such as stdout under control of the string pointed to by\n format that specifies how subsequent arguments are converted for output.", "description": "printf returns 0 if it was executed successfully and -1 otherwise.\n\n Result Type must be i32.\n\n Format must be a pointer(constant) to i8. If there are insufficient \n arguments for the format, the behavior is undefined. If the format \n is exhausted while arguments remain, the excess arguments are evaluated\n (as always) but are otherwise ignored. The printf instruction returns \n when the end of the format string is encountered.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.CL.printf %fmt %1, %2 : !spirv.ptr, i32, i32 -> i32\n ```", "operands": [ { "name": "format", "type": "SPIRV_AnyPtr" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "assemblyFormat": "$format ( $arguments^ )? attr-dict `:` type($format) ( `,` type($arguments)^ )? `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.rint", "summary": "Round x to integral value (using round to nearest even rounding mode) in\n floating-point format.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.CL.rint %0 : f32\n %1 = spirv.CL.rint %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.rootn", "summary": "Compute the n-th root of x, where n is an integer.", "description": "Result is the n-th root of x, where n is an integer.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n The n operand must be a scalar or vector with integer component type.\n The number of components in x and n must be the same.\n\n Result Type must be the same type as the type of x. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.rootn %0, %1 : f32, i32 -> f32\n %2 = spirv.CL.rootn %0, %1 : vector<3xf32>, vector<3xi32> -> vector<3xf32>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "n", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "attr-dict $x `,` $n `:` type($x) `,` type($n) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.round", "summary": "Return the integral value nearest to x rounding halfway cases away from\n zero, regardless of the current rounding direction.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.round %0 : f32\n %3 = spirv.CL.round %0 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.rsqrt", "summary": "Compute inverse square root of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.rsqrt %0 : f32\n %3 = spirv.CL.rsqrt %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.s_abs", "summary": "Absolute value of operand", "description": "Returns |x|, where x is treated as signed integer.\n\n Result Type and x must be integer or vector(2,3,4,8,16) of\n integer values.\n\n All of the operands, including the Result Type operand,\n must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.s_abs %0 : i32\n %3 = spirv.CL.s_abs %1 : vector<3xi16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.s_max", "summary": "Return maximum of two signed integer operands", "description": "Returns y if x < y, otherwise it returns x, where x and y are treated as signed integers.\n\n Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.\n\n All of the operands, including the Result Type operand, must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.s_max %0, %1 : i32\n %3 = spirv.CL.s_max %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.s_min", "summary": "Return minimum of two signed integer operands", "description": "Returns y if x < y, otherwise it returns x, where x and y are treated as signed integers.\n\n Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.\n\n All of the operands, including the Result Type operand, must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.s_min %0, %1 : i32\n %3 = spirv.CL.s_min %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.sin", "summary": "Compute sine of x radians.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.sin %0 : f32\n %3 = spirv.CL.sin %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.sinh", "summary": "Compute hyperbolic sine of x radians.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.sinh %0 : f32\n %3 = spirv.CL.sinh %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.sqrt", "summary": "Compute square root of x.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.sqrt %0 : f32\n %3 = spirv.CL.sqrt %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.tan", "summary": "Compute tangent of x radians.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.tan %0 : f32\n %3 = spirv.CL.tan %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.tanh", "summary": "Compute hyperbolic tangent of x radians.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.tanh %0 : f32\n %3 = spirv.CL.tanh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.trunc", "summary": "Round to integral value using the round to zero rounding mode.", "description": "Result Type and x must be floating-point or vector(2,3,4,8,16) of\n floating-point values.\n\n All of the operands, including the Result Type operand, must be of the\n same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.trunc %0 : f32\n %3 = spirv.CL.trunc %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.u_max", "summary": "Return maximum of two unsigned integer operands", "description": "Returns y if x < y, otherwise it returns x, where x and y are treated as unsigned integers.\n\n Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.\n\n All of the operands, including the Result Type operand, must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.u_max %0, %1 : i32\n %3 = spirv.CL.u_max %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CL.u_min", "summary": "Return minimum of two unsigned integer operands", "description": "Returns y if x < y, otherwise it returns x, where x and y are treated as unsigned integers.\n\n Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.\n\n All of the operands, including the Result Type operand, must be of the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.CL.u_min %0, %1 : i32\n %3 = spirv.CL.u_min %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CompositeConstruct", "summary": "Construct a new composite object from a set of constituent objects.", "description": "Result Type must be a composite type, whose top-level\n members/elements/components/columns have the same type as the types of\n the operands, with one exception. The exception is that for constructing\n a vector, the operands may also be vectors with the same component type\n as the Result Type component type. When constructing a vector, the total\n number of components in all the operands must equal the number of\n components in Result Type.\n\n Constituents will become members of a structure, or elements of an\n array, or components of a vector, or columns of a matrix. There must be\n exactly one Constituent for each top-level\n member/element/component/column of the result, with one exception. The\n exception is that for constructing a vector, a contiguous subset of the\n scalars consumed can be represented by a vector operand instead. The\n Constituents must appear in the order needed by the definition of the\n type of the result. When constructing a vector, there must be at least\n two Constituent operands.\n\n #### Example:\n\n ```mlir\n %a = spirv.CompositeConstruct %1, %2, %3 : vector<3xf32>\n %b = spirv.CompositeConstruct %a, %1 : (vector<3xf32>, f32) -> vector<4xf32>\n\n %c = spirv.CompositeConstruct %1 :\n (f32) -> !spirv.coopmatrix<4x4xf32, Subgroup, MatrixA>\n\n %d = spirv.CompositeConstruct %a, %4, %5 :\n (vector<3xf32>, !spirv.array<4xf32>, !spirv.struct<(f32)>) ->\n !spirv.struct<(vector<3xf32>, !spirv.array<4xf32>, !spirv.struct<(f32)>)>\n ```", "operands": [ { "name": "constituents", "type": "Variadic" } ], "results": [ { "name": "result", "type": "SPIRV_Composite" } ], "assemblyFormat": "$constituents attr-dict `:` `(` type(operands) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CompositeExtract", "summary": "Extract a part of a composite object.", "description": "Result Type must be the type of object selected by the last provided\n index. The instruction result is the extracted object.\n\n Composite is the composite to extract from.\n\n Indexes walk the type hierarchy, potentially down to component\n granularity, to select the part to extract. All indexes must be in\n bounds. All composite constituents use zero-based numbering, as\n described by their OpType… instruction.\n\n \n\n ```\n composite-extract-op ::= ssa-id `=` `spirv.CompositeExtract` ssa-use\n `[` integer-literal (',' integer-literal)* `]`\n `:` composite-type\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.Variable : !spirv.ptr>, Function>\n %1 = spirv.Load \"Function\" %0 [\"Volatile\"] : !spirv.array<4x!spirv.array<4xf32>>\n %2 = spirv.CompositeExtract %1[1 : i32] : !spirv.array<4x!spirv.array<4xf32>>\n ```", "operands": [ { "name": "composite", "type": "SPIRV_Composite" } ], "results": [ { "name": "component", "type": "SPIRV_Type" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.CompositeInsert", "summary": "Make a copy of a composite object, while modifying one part of it.", "description": "Result Type must be the same type as Composite.\n\n Object is the object to use as the modified part.\n\n Composite is the composite to copy all but the modified part from.\n\n Indexes walk the type hierarchy of Composite to the desired depth,\n potentially down to component granularity, to select the part to modify.\n All indexes must be in bounds. All composite constituents use zero-based\n numbering, as described by their OpType… instruction. The type of the\n part selected to modify must match the type of Object.\n\n \n\n ```\n composite-insert-op ::= ssa-id `=` `spirv.CompositeInsert` ssa-use, ssa-use\n `[` integer-literal (',' integer-literal)* `]`\n `:` object-type `into` composite-type\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.CompositeInsert %object, %composite[1 : i32] : f32 into !spirv.array<4xf32>\n ```", "operands": [ { "name": "object", "type": "SPIRV_Type" }, { "name": "composite", "type": "SPIRV_Composite" } ], "results": [ { "name": "result", "type": "SPIRV_Composite" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.Constant", "summary": "Declare a new integer-type or floating-point-type scalar constant.", "description": "This op declares a SPIR-V normal constant. SPIR-V has multiple constant\n instructions covering different constant types:\n\n * `OpConstantTrue` and `OpConstantFalse` for boolean constants\n * `OpConstant` for scalar constants\n * `OpConstantComposite` for composite constants\n * `OpConstantNull` for null constants\n * ...\n\n Having such a plethora of constant instructions renders IR transformations\n more tedious. Therefore, we use a single `spirv.Constant` op to represent\n them all. Note that conversion between those SPIR-V constant instructions\n and this op is purely mechanical; so it can be scoped to the binary\n (de)serialization process.\n\n \n\n ```\n spirv.Constant-op ::= ssa-id `=` `spirv.Constant` attribute-value\n (`:` spirv-type)?\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.Constant true\n %1 = spirv.Constant dense<[2.0, 3.0]> : vector<2xf32>\n %2 = spirv.Constant [dense<3.0> : vector<2xf32>] : !spirv.array<1xvector<2xf32>>\n ```\n\n TODO: support constant structs", "results": [ { "name": "constant", "type": "SPIRV_Type" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.ControlBarrier", "summary": "Wait for other invocations of this module to reach the current point of\n execution.", "description": "All invocations of this module within Execution scope must reach this\n point of execution before any invocation will proceed beyond it.\n\n When Execution is Workgroup or larger, behavior is undefined if this\n instruction is used in control flow that is non-uniform within\n Execution. When Execution is Subgroup or Invocation, the behavior of\n this instruction in non-uniform control flow is defined by the client\n API.\n\n If Semantics is not None, this instruction also serves as an\n OpMemoryBarrier instruction, and must also perform and adhere to the\n description and semantics of an OpMemoryBarrier instruction with the\n same Memory and Semantics operands. This allows atomically specifying\n both a control barrier and a memory barrier (that is, without needing\n two instructions). If Semantics is None, Memory is ignored.\n\n Before version 1.3, it is only valid to use this instruction with\n TessellationControl, GLCompute, or Kernel execution models. There is no\n such restriction starting with version 1.3.\n\n When used with the TessellationControl execution model, it also\n implicitly synchronizes the Output Storage Class: Writes to Output\n variables performed by any invocation executed prior to a\n OpControlBarrier will be visible to any other invocation after return\n from that OpControlBarrier.\n\n #### Example:\n\n ```mlir\n spirv.ControlBarrier , , \n ```", "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "assemblyFormat": "$execution_scope `,` $memory_scope `,` $memory_semantics attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.ConvertFToS", "summary": "Convert value numerically from floating point to signed integer, with\n round toward 0.0.", "description": "Result Type must be a scalar or vector of integer type.\n\n Float Value must be a scalar or vector of floating-point type. It must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertFToS %0 : f32 to i32\n %3 = spirv.ConvertFToS %2 : vector<3xf32> to vector<3xi32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ConvertFToU", "summary": "Convert value numerically from floating point to unsigned integer, with\n round toward 0.0.", "description": "Result Type must be a scalar or vector of integer type, whose Signedness\n operand is 0.\n\n Float Value must be a scalar or vector of floating-point type. It must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertFToU %0 : f32 to i32\n %3 = spirv.ConvertFToU %2 : vector<3xf32> to vector<3xi32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ConvertPtrToU", "summary": "Bit pattern-preserving conversion of a pointer to\n an unsigned scalar integer of possibly different bit width.", "description": "Result Type must be a scalar of integer type, whose Signedness operand is 0.\n\n Pointer must be a physical pointer type. If the bit width of Pointer is\n smaller than that of Result Type, the conversion zero extends Pointer.\n If the bit width of Pointer is larger than that of Result Type,\n the conversion truncates Pointer.\n\n For same bit width Pointer and Result Type, this is the same as OpBitcast.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertPtrToU %0 : !spirv.ptr to i32\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "assemblyFormat": "$pointer attr-dict `:` type($pointer) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ConvertSToF", "summary": "Convert value numerically from signed integer to floating point.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Signed Value must be a scalar or vector of integer type. It must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertSToF %0 : i32 to f32\n %3 = spirv.ConvertSToF %2 : vector<3xi32> to vector<3xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ConvertUToF", "summary": "Convert value numerically from unsigned integer to floating point.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Unsigned Value must be a scalar or vector of integer type. It must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertUToF %0 : i32 to f32\n %3 = spirv.ConvertUToF %2 : vector<3xi32> to vector<3xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ConvertUToPtr", "summary": "Bit pattern-preserving conversion of an unsigned scalar integer\n to a pointer.", "description": "Result Type must be a physical pointer type.\n\n Integer Value must be a scalar of integer type, whose Signedness\n operand is 0. If the bit width of Integer Value is smaller\n than that of Result Type, the conversion zero extends Integer Value.\n If the bit width of Integer Value is larger than that of Result Type,\n the conversion truncates Integer Value.\n\n For same-width Integer Value and Result Type, this is the same as OpBitcast.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertUToPtr %0 : i32 to !spirv.ptr\n ```", "operands": [ { "name": "operand", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.CopyMemory", "summary": "Copy from the memory pointed to by Source to the memory pointed to by\n Target. Both operands must be non-void pointers and having the same ``\n Type operand in their OpTypePointer type declaration. Matching Storage\n Class is not required. The amount of memory copied is the size of the\n type pointed to. The copied type must have a fixed size; i.e., it must\n not be, nor include, any OpTypeRuntimeArray types.", "description": "If present, any Memory Operands must begin with a memory operand\n literal. If not present, it is the same as specifying the memory operand\n None. Before version 1.4, at most one memory operands mask can be\n provided. Starting with version 1.4 two masks can be provided, as\n described in Memory Operands. If no masks or only one mask is present,\n it applies to both Source and Target. If two masks are present, the\n first applies to Target and cannot include MakePointerVisible, and the\n second applies to Source and cannot include MakePointerAvailable.\n\n \n\n ```\n copy-memory-op ::= `spirv.CopyMemory ` storage-class ssa-use\n storage-class ssa-use\n (`[` memory-access `]` (`, [` memory-access `]`)?)?\n ` : ` spirv-element-type\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.Variable : !spirv.ptr\n %1 = spirv.Variable : !spirv.ptr\n spirv.CopyMemory \"Function\" %0, \"Function\" %1 : f32\n ```", "operands": [ { "name": "target", "type": "SPIRV_AnyPtr" }, { "name": "source", "type": "SPIRV_AnyPtr" } ], "attributes": [ { "name": "memory_access", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" }, { "name": "source_memory_access", "type": "OptionalAttr" }, { "name": "source_alignment", "type": "OptionalAttr>" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.Dot", "summary": "Dot product of Vector 1 and Vector 2", "description": "Result Type must be a floating point scalar.\n\n Vector 1 and Vector 2 must be vectors of the same type, and their component\n type must be Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.Dot %v1, %v2 : vector<4xf32> -> f32\n ```", "operands": [ { "name": "vector1", "type": "AnyTypeOf<[SPIRV_FloatVector, SPIRV_VectorOf]>" }, { "name": "vector2", "type": "AnyTypeOf<[SPIRV_FloatVector, SPIRV_VectorOf]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_Float, SPIRV_BFloat16KHR]>" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" } ], "assemblyFormat": "operands attr-dict `:` type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.EmitVertex", "summary": "Emits the current values of all output variables to the current output\n primitive. After execution, the values of all output variables are\n undefined.", "description": "This instruction must only be used when only one stream is present.\n\n #### Example:\n\n ```mlir\n spirv.EmitVertex\n ```", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.EndPrimitive", "summary": "Finish the current primitive and start a new one. No vertex is emitted.", "description": "This instruction must only be used when only one stream is present.\n\n #### Example:\n\n ```mlir\n spirv.EndPrimitive\n ```", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.EntryPoint", "summary": "Declare an entry point, its execution model, and its interface.", "description": "Execution Model is the execution model for the entry point and its\n static call tree. See Execution Model.\n\n Entry Point must be the Result `` of an OpFunction instruction.\n\n Name is a name string for the entry point. A module cannot have two\n OpEntryPoint instructions with the same Execution Model and the same\n Name string.\n\n Interface is a list of symbol references to `spirv.GlobalVariable`\n operations. These declare the set of global variables from a\n module that form the interface of this entry point. The set of\n Interface symbols must be equal to or a superset of the\n `spirv.GlobalVariable`s referenced by the entry point’s static call\n tree, within the interface’s storage classes. Before version 1.4,\n the interface’s storage classes are limited to the Input and\n Output storage classes. Starting with version 1.4, the interface’s\n storage classes are all storage classes used in declaring all\n global variables referenced by the entry point’s call tree.\n\n \n\n ```\n execution-model ::= \"Vertex\" | \"TesellationControl\" |\n \n\n entry-point-op ::= ssa-id `=` `spirv.EntryPoint` execution-model\n symbol-reference (`, ` symbol-reference)*\n ```\n\n #### Example:\n\n ```mlir\n spirv.EntryPoint \"GLCompute\" @foo\n spirv.EntryPoint \"Kernel\" @foo, @var1, @var2\n\n ```", "attributes": [ { "name": "execution_model", "type": "SPIRV_ExecutionModelAttr{Vertex|TessellationControl|TessellationEvaluation|Geometry|Fragment|GLCompute|Kernel|RayGenerationKHR|IntersectionKHR|AnyHitKHR|ClosestHitKHR|MissKHR|CallableKHR|TaskEXT|MeshEXT}" }, { "name": "fn", "type": "FlatSymbolRefAttr" }, { "name": "interface", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.ExecutionMode", "summary": "Declare an execution mode for an entry point.", "description": "Entry Point must be the Entry Point `` operand of an OpEntryPoint\n instruction.\n\n Mode is the execution mode. See Execution Mode.\n\n This instruction is only valid when the Mode operand is an execution\n mode that takes no Extra Operands, or takes Extra Operands that are not\n `` operands.\n\n \n\n ```\n execution-mode ::= \"Invocations\" | \"SpacingEqual\" |\n \n\n execution-mode-op ::= `spirv.ExecutionMode ` ssa-use execution-mode\n (integer-literal (`, ` integer-literal)* )?\n ```\n\n #### Example:\n\n ```mlir\n spirv.ExecutionMode @foo \"ContractionOff\"\n spirv.ExecutionMode @bar \"LocalSizeHint\", 3, 4, 5\n ```", "attributes": [ { "name": "fn", "type": "FlatSymbolRefAttr" }, { "name": "execution_mode", "type": "SPIRV_ExecutionModeAttr{Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|SubgroupUniformControlFlowKHR|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|EarlyAndLateFragmentTestsAMD|StencilRefReplacingEXT|StencilRefUnchangedFrontAMD|StencilRefGreaterFrontAMD|StencilRefLessFrontAMD|StencilRefUnchangedBackAMD|StencilRefGreaterBackAMD|StencilRefLessBackAMD|OutputLinesEXT|OutputPrimitivesEXT|DerivativeGroupQuadsNV|DerivativeGroupLinearNV|OutputTrianglesEXT|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT|SharedLocalMemorySizeINTEL|RoundingModeRTPINTEL|RoundingModeRTNINTEL|FloatingPointModeALTINTEL|FloatingPointModeIEEEINTEL|MaxWorkgroupSizeINTEL|MaxWorkDimINTEL|NoGlobalOffsetINTEL|NumSIMDWorkitemsINTEL|SchedulerTargetFmaxMhzINTEL|StreamingInterfaceINTEL|NamedBarrierCountINTEL}" }, { "name": "values", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.ExecutionModeId", "summary": "Declare an execution mode for an entry point, using s as Extra\n Operands.", "description": "Entry Point must be the Entry Point operand of an OpEntryPoint\n instruction.\n\n Mode is the execution mode. See Execution Mode.\n\n This instruction is only valid if the Mode operand is an execution mode\n that takes Extra Operands that are operands. Otherwise, use\n OpExecutionMode.\n\n \n\n ```\n execution-mode ::= \"Invocations\" | \"SpacingEqual\" |\n \n execution-mode-id-op ::= `spirv.ExecutionMode ` ssa-use execution-mode\n symbol-reference (`, ` symbol-reference)*\n ```\n\n #### Example:\n\n ```mlir\n spirv.ExecutionModeId @foo \"LocalSizeId\" @var0, @var1, @var2\n spirv.ExecutionModeId @bar \"LocalSizeHintId\" @x, @y, @z\n ```", "attributes": [ { "name": "fn", "type": "FlatSymbolRefAttr" }, { "name": "execution_mode", "type": "SPIRV_ExecutionModeAttr{Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|SubgroupUniformControlFlowKHR|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|EarlyAndLateFragmentTestsAMD|StencilRefReplacingEXT|StencilRefUnchangedFrontAMD|StencilRefGreaterFrontAMD|StencilRefLessFrontAMD|StencilRefUnchangedBackAMD|StencilRefGreaterBackAMD|StencilRefLessBackAMD|OutputLinesEXT|OutputPrimitivesEXT|DerivativeGroupQuadsNV|DerivativeGroupLinearNV|OutputTrianglesEXT|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT|SharedLocalMemorySizeINTEL|RoundingModeRTPINTEL|RoundingModeRTNINTEL|FloatingPointModeALTINTEL|FloatingPointModeIEEEINTEL|MaxWorkgroupSizeINTEL|MaxWorkDimINTEL|NoGlobalOffsetINTEL|NumSIMDWorkitemsINTEL|SchedulerTargetFmaxMhzINTEL|StreamingInterfaceINTEL|NamedBarrierCountINTEL}" }, { "name": "values", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.ExperimentalML.Call", "summary": "Call an Arm experimental ML operation.", "description": "Calls an operation encoded using the Arm.ExperimentalMLOperations extended\n instruction set. The `opcode` attribute is serialized as the operation\n opcode literal integer operand of CALL.", "operands": [ { "name": "parameters", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyType" } ], "attributes": [ { "name": "opcode", "type": "I32Attr" } ], "assemblyFormat": "`opcode` `=` $opcode `,`\n $parameters attr-dict `:` functional-type($parameters, $output)", "hasCustomAssemblyFormat": true }, { "name": "spirv.EXT.AtomicFAdd", "summary": "TBD", "description": "\n\n Perform the following steps atomically with respect to any other atomic\n accesses within Scope to the same location:\n\n 1) load through Pointer to get an Original Value,\n\n 2) get a New Value by float addition of Original Value and Value, and\n\n 3) store the New Value back through Pointer.\n\n The instruction's result is the Original Value.\n\n Result Type must be a floating-point type scalar.\n\n The type of Value must be the same as Result Type. The type of the value\n pointed to by Pointer must be the same as Result Type.\n\n Memory must be a valid memory Scope.\n\n #### Example:\n\n ```mlir\n %0 = spirv.EXT.AtomicFAdd %pointer, %value :\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Float" } ], "results": [ { "name": "result", "type": "SPIRV_Float" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "traits": [ { "type": "TypesMatchWith<'pointer', 'result', 'llvm::cast($_self).getPointeeType()'>" }, { "type": "TypesMatchWith<'pointer', 'value', 'llvm::cast($_self).getPointeeType()'>" } ], "assemblyFormat": "$memory_scope $semantics operands attr-dict `:` type($pointer)", "hasCustomAssemblyFormat": true }, { "name": "spirv.EXT.ConstantCompositeReplicate", "summary": "Declare a new replicated composite constant op.", "description": "Represents a splat composite constant i.e., all elements of composite constant\n have the same value.\n\n #### Example:\n\n ```mlir\n %0 = spirv.EXT.ConstantCompositeReplicate [1 : i32] : vector<2xi32>\n %1 = spirv.EXT.ConstantCompositeReplicate [1 : i32] : !spirv.array<2 x vector<2xi32>>\n %2 = spirv.EXT.ConstantCompositeReplicate [dense<[1, 2]> : vector<2xi32>] : !spirv.array<2 x vector<2xi32>>\n ```", "results": [ { "name": "replicated_constant", "type": "SPIRV_Composite" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "` ` `[` $value `]` `:` type($replicated_constant) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.EXT.EmitMeshTasks", "summary": "Defines the grid size of subsequent mesh shader workgroups to generate upon\n completion of the task shader workgroup.", "description": "Defines the grid size of subsequent mesh shader workgroups to generate upon\n completion of the task shader workgroup.\n\n Group Count X Y Z must each be a 32-bit unsigned integer value. They\n configure the number of local workgroups in each respective dimensions for the\n launch of child mesh tasks. See Vulkan API specification for more detail.\n\n Payload is an optional pointer to the payload structure to pass to the\n generated mesh shader invocations. Payload must be the result of an OpVariable\n with a storage class of TaskPayloadWorkgroupEXT.\n\n The arguments are taken from the first invocation in each workgroup.\n Behaviour is undefined if any invocation terminates without executing this\n instruction, or if any invocation executes this instruction in non-uniform\n control flow.\n\n This instruction also serves as an OpControlBarrier instruction, and also\n performs and adheres to the description and semantics of an OpControlBarrier\n instruction with the Execution and Memory operands set to Workgroup and the\n Semantics operand set to a combination of WorkgroupMemory and AcquireRelease.\n\n Ceases all further processing: Only instructions executed before\n OpEmitMeshTasksEXT have observable side effects.\n\n This instruction must be the last instruction in a block.\n\n This instruction is only valid in the TaskEXT Execution Model.\n\n \n\n #### Example:\n\n ```mlir\n spirv.EmitMeshTasksEXT %x, %y, %z : i32, i32, i32\n spirv.EmitMeshTasksEXT %x, %x, %z, %payload : i32, i32, i32, !spirv.ptr\n ```", "operands": [ { "name": "group_count_x", "type": "SignlessOrUnsignedIntOfWidths<[32]>" }, { "name": "group_count_y", "type": "SignlessOrUnsignedIntOfWidths<[32]>" }, { "name": "group_count_z", "type": "SignlessOrUnsignedIntOfWidths<[32]>" }, { "name": "payload", "type": "Optional" } ], "assemblyFormat": "operands attr-dict `:` type(operands)", "hasCustomAssemblyFormat": true }, { "name": "spirv.EXT.SetMeshOutputs", "summary": "Sets the actual output size of the primitives and vertices that the mesh\n shader workgroup will emit upon completion.", "description": "Vertex Count must be a 32-bit unsigned integer value. It defines the array size\n of per-vertex outputs.\n\n Primitive Count must a 32-bit unsigned integer value. It defines the array size\n of per-primitive outputs.\n\n The arguments are taken from the first invocation in each workgroup. Behavior\n is undefined if any invocation executes this instruction more than once or\n under non-uniform control flow. Behavior is undefined if there is any control\n flow path to an output write that is not preceded by this instruction.\n\n This instruction is only valid in the MeshEXT Execution Model.\n\n \n\n #### Example:\n\n ```mlir\n spirv.SetMeshOutputsEXT %vcount, %pcount : i32, i32\n ```", "operands": [ { "name": "vertex_count", "type": "SignlessOrUnsignedIntOfWidths<[32]>" }, { "name": "primitive_count", "type": "SignlessOrUnsignedIntOfWidths<[32]>" } ], "assemblyFormat": "operands attr-dict `:` type(operands)", "hasCustomAssemblyFormat": true }, { "name": "spirv.EXT.SpecConstantCompositeReplicate", "summary": "Declare a new replicated composite specialization constant op.", "description": "Represents a splat spec composite constant i.e., all elements of spec composite\n constant have the same value. The splat value must come from a symbol reference\n of spec constant instruction.\n\n #### Example:\n\n ```mlir\n spirv.SpecConstant @sc_i32_1 = 1 : i32\n spirv.EXT.SpecConstantCompositeReplicate @scc_splat_array_of_i32 (@sc_i32_1) : !spirv.array<3 x i32>\n spirv.EXT.SpecConstantCompositeReplicate @scc_splat_struct_of_i32 (@sc_i32_1) : !spirv.struct<(i32, i32, i32)>\n ```", "attributes": [ { "name": "type", "type": "TypeAttr" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "constituent", "type": "SymbolRefAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.FAdd", "summary": "Floating-point addition of Operand 1 and Operand 2.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FAdd %0, %1 : f32\n %5 = spirv.FAdd %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FConvert", "summary": "Convert value numerically from one floating-point width to another\n width.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Float Value must be a scalar or vector of floating-point type. It must\n have the same number of components as Result Type. The component width\n cannot equal the component width in Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.FConvert %0 : f32 to f64\n %3 = spirv.FConvert %2 : vector<3xf32> to vector<3xf64>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FDiv", "summary": "Floating-point division of Operand 1 divided by Operand 2.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FDiv %0, %1 : f32\n %5 = spirv.FDiv %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FMod", "summary": "The floating-point remainder whose sign matches the sign of Operand 2.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0. Otherwise, the result is the remainder r of Operand\n 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the\n sign of Operand 2.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FMod %0, %1 : f32\n %5 = spirv.FMod %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FMul", "summary": "Floating-point multiplication of Operand 1 and Operand 2.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FMul %0, %1 : f32\n %5 = spirv.FMul %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FNegate", "summary": "Inverts the sign bit of Operand. (Note, however, that OpFNegate is still\n considered a floating-point instruction, and so is subject to the\n general floating-point rules regarding, for example, subnormals and NaN\n propagation).", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The type of Operand must be the same as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.FNegate %0 : f32\n %3 = spirv.FNegate %2 : vector<4xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FOrdEqual", "summary": "Floating-point comparison for being ordered and equal.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FOrdEqual %0, %1 : f32\n %5 = spirv.FOrdEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FOrdGreaterThan", "summary": "Floating-point comparison if operands are ordered and Operand 1 is\n greater than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FOrdGreaterThan %0, %1 : f32\n %5 = spirv.FOrdGreaterThan %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FOrdGreaterThanEqual", "summary": "Floating-point comparison if operands are ordered and Operand 1 is\n greater than or equal to Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FOrdGreaterThanEqual %0, %1 : f32\n %5 = spirv.FOrdGreaterThanEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FOrdLessThan", "summary": "Floating-point comparison if operands are ordered and Operand 1 is less\n than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FOrdLessThan %0, %1 : f32\n %5 = spirv.FOrdLessThan %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FOrdLessThanEqual", "summary": "Floating-point comparison if operands are ordered and Operand 1 is less\n than or equal to Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FOrdLessThanEqual %0, %1 : f32\n %5 = spirv.FOrdLessThanEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FOrdNotEqual", "summary": "Floating-point comparison for being ordered and not equal.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FOrdNotEqual %0, %1 : f32\n %5 = spirv.FOrdNotEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FRem", "summary": "The floating-point remainder whose sign matches the sign of Operand 1.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0. Otherwise, the result is the remainder r of Operand\n 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the\n sign of Operand 1.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FRem %0, %1 : f32\n %5 = spirv.FRem %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FSub", "summary": "Floating-point subtraction of Operand 2 from Operand 1.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FSub %0, %1 : f32\n %5 = spirv.FSub %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.func", "summary": "Declare or define a function", "description": "This op declares or defines a SPIR-V function using one region, which\n contains one or more blocks.\n\n Different from the SPIR-V binary format, this op is not allowed to\n implicitly capture global values, and all external references must use\n function arguments or symbol references. This op itself defines a symbol\n that is unique in the enclosing module op.\n\n This op itself takes no operands and generates no results. Its region\n can take zero or more arguments and return zero or one values.\n\n From `SPV_KHR_physical_storage_buffer`:\n If a parameter of function is\n - a pointer (or contains a pointer) in the PhysicalStorageBuffer storage\n class, the function parameter must be decorated with exactly one of\n `Aliased` or `Restrict`.\n - a pointer (or contains a pointer) and the type it points to is a pointer\n in the PhysicalStorageBuffer storage class, the function parameter must\n be decorated with exactly one of `AliasedPointer` or `RestrictPointer`.\n\n \n\n ```\n spv-function-control ::= \"None\" | \"Inline\" | \"DontInline\" | ...\n spv-function-op ::= `spirv.func` function-signature\n spv-function-control region\n ```\n\n #### Example:\n\n ```mlir\n spirv.func @foo() -> () \"None\" { ... }\n spirv.func @bar() -> () \"Inline|Pure\" { ... }\n\n spirv.func @aliased_pointer(%arg0: !spirv.ptr,\n { spirv.decoration = #spirv.decoration }) -> () \"None\" { ... }\n\n spirv.func @restrict_pointer(%arg0: !spirv.ptr,\n { spirv.decoration = #spirv.decoration }) -> () \"None\" { ... }\n\n spirv.func @aliased_pointee(%arg0: !spirv.ptr, Generic> { spirv.decoration =\n #spirv.decoration }) -> () \"None\" { ... }\n\n spirv.func @restrict_pointee(%arg0: !spirv.ptr, Generic> { spirv.decoration =\n #spirv.decoration }) -> () \"None\" { ... }\n ```", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "function_control", "type": "SPIRV_FunctionControlAttr{None|Inline|DontInline|Pure|Const|OptNoneINTEL}" }, { "name": "linkage_attributes", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.FunctionCall", "summary": "Call a function.", "description": "Result Type is the type of the return value of the function. It must be\n the same as the Return Type operand of the Function Type operand of the\n Function operand.\n\n Function is an OpFunction instruction. This could be a forward\n reference.\n\n Argument N is the object to copy to parameter N of Function.\n\n Note: A forward call is possible because there is no missing type\n information: Result Type must match the Return Type of the function, and\n the calling argument types must match the formal parameter types.\n\n #### Example:\n\n ```mlir\n spirv.FunctionCall @f_void(%arg0) : (i32) -> ()\n %0 = spirv.FunctionCall @f_iadd(%arg0, %arg1) : (i32, i32) -> i32\n ```", "operands": [ { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "return_value", "type": "Optional" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $arguments `)` attr-dict `:`\n functional-type($arguments, results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.FUnordEqual", "summary": "Floating-point comparison for being unordered or equal.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FUnordEqual %0, %1 : f32\n %5 = spirv.FUnordEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FUnordGreaterThan", "summary": "Floating-point comparison if operands are unordered or Operand 1 is\n greater than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FUnordGreaterThan %0, %1 : f32\n %5 = spirv.FUnordGreaterThan %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FUnordGreaterThanEqual", "summary": "Floating-point comparison if operands are unordered or Operand 1 is\n greater than or equal to Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FUnordGreaterThanEqual %0, %1 : f32\n %5 = spirv.FUnordGreaterThanEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FUnordLessThan", "summary": "Floating-point comparison if operands are unordered or Operand 1 is less\n than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FUnordLessThan %0, %1 : f32\n %5 = spirv.FUnordLessThan %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FUnordLessThanEqual", "summary": "Floating-point comparison if operands are unordered or Operand 1 is less\n than or equal to Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FUnordLessThanEqual %0, %1 : f32\n %5 = spirv.FUnordLessThanEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.FUnordNotEqual", "summary": "Floating-point comparison for being unordered or not equal.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n floating-point type. They must have the same type, and they must have\n the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.FUnordNotEqual %0, %1 : f32\n %5 = spirv.FUnordNotEqual %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GenericCastToPtr", "summary": "Convert a pointer’s Storage Class to a non-Generic class.", "description": "Result Type must be an OpTypePointer. Its Storage Class must be\n Workgroup, CrossWorkgroup, or Function.\n\n Pointer must point to the Generic Storage Class.\n\n Result Type and Pointer must point to the same type.\n\n \n\n #### Example:\n\n ```mlir\n %1 = spirv.GenericCastToPtr %0 : !spirv.ptr to\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$pointer attr-dict `:` type($pointer) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GenericCastToPtrExplicit", "summary": "Attempts to explicitly convert Pointer to Storage storage-class pointer\n value.", "description": "Result Type must be an OpTypePointer. Its Storage Class must be Storage.\n\n Pointer must have a type of OpTypePointer whose Type is the same as the\n Type of Result Type.Pointer must point to the Generic Storage Class. If\n the cast fails, the instruction result is an OpConstantNull pointer in\n the Storage Storage Class.\n\n Storage must be one of the following literal values from Storage Class:\n Workgroup, CrossWorkgroup, or Function.\n\n \n\n #### Example:\n\n ```mlir\n %1 = spirv.GenericCastToPtrExplicit %0 : !spirv.ptr to\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$pointer attr-dict `:` type($pointer) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Acos", "summary": "Arc Cosine of operand in radians", "description": "The standard trigonometric arc cosine of x radians.\n\n Result is an angle, in radians, whose cosine is x. The range of result\n values is [0, π]. The resulting value is NaN if abs x > 1.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Acos %0 : f32\n %3 = spirv.GL.Acos %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Acosh", "summary": "Arc hyperbolic cosine of operand in radians.", "description": "Arc hyperbolic cosine; result is the non-negative inverse of cosh. The resulting\n value is NaN if x < 1.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Acosh %0 : f32\n %3 = spirv.GL.Acosh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Asin", "summary": "Arc Sine of operand in radians", "description": "The standard trigonometric arc sine of x radians.\n\n Result is an angle, in radians, whose sine is x. The range of result values\n is [-π / 2, π / 2]. The resulting value is NaN if abs x > 1.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Asin %0 : f32\n %3 = spirv.GL.Asin %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Asinh", "summary": "Arc hyperbolic sine of operand in radians.", "description": "Arc hyperbolic sine; result is the inverse of sinh.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Asinh %0 : f32\n %3 = spirv.GL.Asinh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Atan", "summary": "Arc Tangent of operand in radians", "description": "The standard trigonometric arc tangent of x radians.\n\n Result is an angle, in radians, whose tangent is y_over_x. The range of\n result values is [-π / 2, π / 2].\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Atan %0 : f32\n %3 = spirv.GL.Atan %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Atan2", "summary": "Arc tangent of y / x in radians", "description": "Result is the arc tangent of y / x. The signs of x and y are used to\n determine what quadrant the angle is in. The range of result values is\n [-π, π]. Result is poison if x and y are both 0.\n\n The operand y and x must be a scalar or vector whose component type is\n 16-bit or 32-bit floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Atan2 %0, %1 : f32\n %3 = spirv.GL.Atan2 %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Atanh", "summary": "Arc hyperbolic tangent of operand in radians.", "description": "Arc hyperbolic tangent; result is the inverse of tanh. The resulting value\n is NaN if abs x ≥ 1.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Atanh %0 : f32\n %3 = spirv.GL.Atanh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Ceil", "summary": "Rounds up to the next whole number", "description": "Result is the value equal to the nearest whole number that is greater than\n or equal to x.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Ceil %0 : f32\n %3 = spirv.GL.Ceil %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Cos", "summary": "Cosine of operand in radians", "description": "The standard trigonometric cosine of x radians.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Cos %0 : f32\n %3 = spirv.GL.Cos %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Cosh", "summary": "Hyperbolic cosine of operand in radians", "description": "Hyperbolic cosine of x radians.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Cosh %0 : f32\n %3 = spirv.GL.Cosh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Cross", "summary": "Return the cross product of two 3-component vectors", "description": "Result is the cross product of x and y, i.e., the resulting components are, in order:\n\n x[1] * y[2] - y[1] * x[2]\n\n x[2] * y[0] - y[2] * x[0]\n\n x[0] * y[1] - y[0] * x[1]\n\n All the operands must be vectors of 3 components of a floating-point type.\n\n Result Type and the type of all operands must be the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Cross %0, %1 : vector<3xf32>\n %3 = spirv.GL.Cross %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Degrees", "summary": "Convert a quantity in radians to degrees", "description": "Result is the quantity in degrees for the quantity x given in radians, i.e.,\n (180 / π) * x.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Degrees %0 : f32\n %3 = spirv.GL.Degrees %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Distance", "summary": "Return distance between two points", "description": "Result is the distance between p0 and p1, i.e., length(p0 - p1).\n\n The operands must all be a scalar or vector whose component type is floating-point.\n\n Result Type must be a scalar of the same type as the component type of the operands.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Distance %0, %1 : vector<3xf32>, vector<3xf32> -> f32\n ```", "operands": [ { "name": "p0", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "p1", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Float" } ], "traits": [ { "type": "AllTypesMatch<['p0', 'p1']>" }, { "type": "TypesMatchWith<'p0', 'result', '::mlir::getElementTypeOrSelf($_self)'>" } ], "assemblyFormat": "operands attr-dict `:` type($p0) `,` type($p1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Exp", "summary": "Exponentiation of Operand 1", "description": "Result is the natural exponentiation of x; e^x.\n\n The operand x must be a scalar or vector whose component type is\n 16-bit or 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are\n computed per component.\";\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Exp %0 : f32\n %3 = spirv.GL.Exp %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Exp2", "summary": "Result is 2 raised to the x power", "description": "Result is 2 raised to the x power; 2**x.\n\n ```\n exp2(Inf) = Inf.\n exp2(-Inf) = +0.\n ```\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Exp2 %0 : f32\n %3 = spirv.GL.Exp2 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FAbs", "summary": "Absolute value of operand", "description": "Result is x if x >= 0; otherwise result is -x.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.FAbs %0 : f32\n %3 = spirv.GL.FAbs %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FClamp", "summary": "Clamp x between min and max values.", "description": "Result is min(max(x, minVal), maxVal). The resulting value is poison if\n minVal > maxVal. The semantics used by min() and max() are those of FMin and\n FMax.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n \n ```\n fclamp-op ::= ssa-id `=` `spirv.GL.FClamp` ssa-use, ssa-use, ssa-use `:`\n float-scalar-vector-type\n ```\n #### Example:\n\n ```mlir\n %2 = spirv.GL.FClamp %x, %min, %max : f32\n %3 = spirv.GL.FClamp %x, %min, %max : vector<3xf16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FindILsb", "summary": "Integer least-significant bit", "description": "Results in the bit number of the least-significant 1-bit in the binary\n representation of Value. If Value is 0, the result is -1.\n\n Result Type and the type of Value must both be integer scalar or\n integer vector types. Result Type and operand types must have the\n same number of components with the same component width. Results are\n computed per component.", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FindSMsb", "summary": "Signed-integer most-significant bit, with Value interpreted as a signed integer", "description": "For positive numbers, the result will be the bit number of the most significant\n 1-bit. For negative numbers, the result will be the bit number of the most\n significant 0-bit. For a Value of 0 or -1, the result is -1.\n\n Result Type and the type of Value must both be integer scalar or\n integer vector types. Result Type and operand types must have the\n same number of components with the same component width. Results are\n computed per component.\n\n This instruction is currently limited to 32-bit width components.", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FindUMsb", "summary": "Unsigned-integer most-significant bit", "description": "Results in the bit number of the most-significant 1-bit in the binary\n representation of Value. If Value is 0, the result is -1.\n\n Result Type and the type of Value must both be integer scalar or\n integer vector types. Result Type and operand types must have the\n same number of components with the same component width. Results are\n computed per component.\n\n This instruction is currently limited to 32-bit width components.", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Floor", "summary": "Rounds down to the next whole number", "description": "Result is the value equal to the nearest whole number that is less than or\n equal to x.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Floor %0 : f32\n %3 = spirv.GL.Floor %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Fma", "summary": "Computes a * b + c.", "description": "In uses where this operation is decorated with NoContraction:\n\n - fma is considered a single operation, whereas the expression a * b + c\n is considered two operations.\n - The precision of fma can differ from the precision of the expression\n a * b + c.\n - fma will be computed with the same precision as any other fma decorated\n with NoContraction, giving invariant results for the same input values\n of a, b, and c.\n\n Otherwise, in the absence of a NoContraction decoration, there are no\n special constraints on the number of operations or difference in precision\n between fma and the expression a * b +c.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results\n are computed per component.\n\n \n ```\n fma-op ::= ssa-id `=` `spirv.GL.Fma` ssa-use, ssa-use, ssa-use `:`\n float-scalar-vector-type\n ```\n #### Example:\n\n ```mlir\n %0 = spirv.GL.Fma %a, %b, %c : f32\n %1 = spirv.GL.Fma %a, %b, %c : vector<3xf16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FMax", "summary": "Return maximum of two floating-point operands", "description": "Result is y if x < y; otherwise result is x. Which operand is the result\n if one of the operands is a NaN is implementation-dependent.\n\n The operands must all be a scalar or vector whose component type\n is floating-point.\n\n Result Type and the type of all operands must be the same\n type. Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.FMax %0, %1 : f32\n %3 = spirv.GL.FMax %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FMin", "summary": "Return minimum of two floating-point operands", "description": "Result is y if y < x; otherwise result is x. Which operand is the result\n if one of the operands is a NaN is implementation-dependent.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.FMin %0, %1 : f32\n %3 = spirv.GL.FMin %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FMix", "summary": "Builds the linear blend of x and y", "description": "Result is the linear blend of x and y, i.e., x * (1 - a) + y * a.\n\n The operands must all be a scalar or vector whose component type is floating-point.\n\n Result Type and the type of all operands must be the same type. Results are computed per component.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.GL.FMix %x : f32, %y : f32, %a : f32 -> f32\n %0 = spirv.GL.FMix %x : vector<4xf32>, %y : vector<4xf32>, %a : vector<4xf32> -> vector<4xf32>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "a", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['x', 'y', 'a', 'result']>" } ], "assemblyFormat": "attr-dict $x `:` type($x) `,` $y `:` type($y) `,` $a `:` type($a) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Fract", "summary": "Returns the `x - floor(x)` of the operand", "description": "Result is:\n\n ```\n fract(x) = x - floor(x)\n fract(±0) = +0\n fract(±Inf) = NaN\n ```\n\n The operand x must be a scalar or vector whose component type is floating-point.\n\n Result Type and the type of x must be the same type. Results are computed per component.\n\n #### Example:\n\n ```mlir\n %result = spirv.GL.Sqrt %x : f32\n %result = spirv.GL.Sqrt %x : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FrexpStruct", "summary": "Splits x into two components such that x = significand * 2^exponent", "description": "Result is a structure containing x split into a floating-point significand\n in the range (-1.0, 0.5] or [0.5, 1.0) and an integral exponent of 2, such that:\n\n x = significand * 2^exponent\n\n If x is a zero, the exponent is 0.0. If x is an infinity or a NaN, the\n exponent is poison. If x is 0.0, the significand is 0.0. If x is -0.0,\n the significand is -0.0\n\n Result Type must be an OpTypeStruct with two members. Member 0 must have\n the same type as the type of x. Member 0 holds the significand. Member 1\n must be a scalar or vector with integer component type, with 32-bit\n component width. Member 1 holds the exponent. These two members and x must\n have the same number of components.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.FrexpStruct %0 : f32 -> !spirv.struct\n %3 = spirv.GL.FrexpStruct %0 : vector<3xf32> -> !spirv.struct, vector<3xi32>>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_AnyStruct" } ], "assemblyFormat": "attr-dict $operand `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.FSign", "summary": "Returns the sign of the operand", "description": "Result is 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.FSign %0 : f32\n %3 = spirv.GL.FSign %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.InverseSqrt", "summary": "Reciprocal of sqrt(operand)", "description": "Result is the reciprocal of sqrt x. The resulting value is NaN if x < 0.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.InverseSqrt %0 : f32\n %3 = spirv.GL.InverseSqrt %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Ldexp", "summary": "Builds y such that y = significand * 2^exponent", "description": "Builds a floating-point number from x and the corresponding\n integral exponent of two in exp:\n\n significand * 2^exponent\n\n If this product is too large to be finitely represented in the floating-point\n type, the resulting value is poison. If exp is greater than +128 (single\n precision), +1024 (double precision) or +16 (half precision), the resulting\n value is poison. If exp is less than -126 (single precision) or -1022 (double\n precision), the result may be flushed to zero. Additionally, splitting the\n value into a significand and exponent using frexp and then reconstructing a\n floating-point value using ldexp should yield the original input for zero and\n all finite non-denormalized values.\n\n The operand x must be a scalar or vector whose component type is floating-point.\n\n The exp operand must be a scalar or vector with integer component type.\n The number of components in x and exp must be the same.\n\n Result Type must be the same type as the type of x. Results are computed per\n component.\n\n \n\n #### Example:\n\n ```mlir\n %y = spirv.GL.Ldexp %x : f32, %exp : i32 -> f32\n %y = spirv.GL.Ldexp %x : vector<3xf32>, %exp : vector<3xi32> -> vector<3xf32>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "exp", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "y", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['x', 'y']>" } ], "assemblyFormat": "attr-dict $x `:` type($x) `,` $exp `:` type($exp) `->` type($y)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Length", "summary": "Return the length of a vector x", "description": "Result is the length of vector x, i.e., sqrt(x[0]**2 + x[1]**2 + ...).\n\n The operand x must be a scalar or vector whose component type is floating-point.\n\n Result Type must be a scalar of the same type as the component type of x.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Length %0 : vector<3xf32> -> f32\n %3 = spirv.GL.Length %1 : f32 -> f32\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Float" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', '::mlir::getElementTypeOrSelf($_self)'>" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Log", "summary": "Natural logarithm of the operand", "description": "Result is the natural logarithm of x, i.e., the value y which satisfies the\n equation x = ey. The resulting value is NaN if x < 0.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Log %0 : f32\n %3 = spirv.GL.Log %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Log2", "summary": "Result is the base-2 logarithm of x", "description": "Result is the base-2 logarithm of x, i.e., the value y which satisfies the\n equation x = 2**y. The resulting value is NaN if x < 0. Moreover:\n\n ```\n log(Inf) = Inf\n log(1.0) = +0\n log(±0) = -Inf\n ```\n \n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n \n ```mlir\n %2 = spirv.GL.Log2 %0 : f32\n %3 = spirv.GL.Log2 %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.NClamp", "summary": "Clamp x between min and max values, NaN-aware", "description": "Result is min(max(x, minVal), maxVal). The resulting value is poison if\n minVal > maxVal. The semantics used by min() and max() are those of NMin\n and NMax, so NaN arguments are considered missing.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.NClamp %x, %min, %max : f32\n %3 = spirv.GL.NClamp %x, %min, %max : vector<3xf16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.NMax", "summary": "Return maximum of two floating-point operands, NaN-aware", "description": "Result is y if x < y; otherwise result is x, where x and y are interpreted\n as floating-point. NMax considers a NaN argument as missing, so if one\n operand is a NaN the result is the other operand. If both operands are NaNs,\n the result is a NaN.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.NMax %0, %1 : f32\n %3 = spirv.GL.NMax %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.NMin", "summary": "Return minimum of two floating-point operands, NaN-aware", "description": "Result is y if y < x; otherwise result is x, where x and y are interpreted\n as floating-point. NMin considers a NaN argument as missing, so if one\n operand is a NaN the result is the other operand. If both operands are NaNs,\n the result is a NaN.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.NMin %0, %1 : f32\n %3 = spirv.GL.NMin %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Normalize", "summary": "Normalizes a vector operand", "description": "Result is the vector in the same direction as x but with a length of 1.\n\n The operand x must be a scalar or vector whose component type is floating-point.\n\n Result Type and the type of x must be the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Normalize %0 : vector<3xf32>\n %3 = spirv.GL.Normalize %1 : vector<4xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.PackHalf2x16", "summary": "Pack two-component vector of 32-bit floats into a 32-bit integer", "description": "Result is the unsigned integer obtained by converting the components of a\n two-component floating-point vector to the 16-bit OpTypeFloat, and then packing\n these two 16-bit integers into a 32-bit unsigned integer. The first vector\n component specifies the 16 least-significant bits of the result; the second\n component specifies the 16 most-significant bits.\n\n The RelaxedPrecision Decoration only affects the conversion step of the instruction.\n\n The v operand must be a vector of 2 components whose type is a 32-bit floating-point.\n\n Result Type must be a 32-bit integer type.\n\n #### Example:\n\n ```mlir\n %1 = spirv.GL.PackHalf2x16 %0 : vector<2xf32> -> i32\n ```", "operands": [ { "name": "operand", "type": "VectorOfLengthAndType<[2], [SPIRV_Float32]>" } ], "results": [ { "name": "result", "type": "SPIRV_Int32" } ], "assemblyFormat": "attr-dict $operand `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.PackSnorm4x8", "summary": "Pack four-component vector of normalized 32-bit floats into a 32-bit integer", "description": "First, converts each component of the normalized floating-point value v into\n 8-bit integer values. These are then packed into the result.\n\n The conversion for component c of v to fixed point is done as follows:\n\n ```\n round(clamp(c, -1, +1) * 127.0)\n ```\n\n The RelaxedPrecision Decoration only affects the conversion step of the instruction.\n\n The first component of the vector is written to the least significant bits of the\n output; the last component is written to the most significant bits.\n\n The v operand must be a vector of 4 components whose type is a 32-bit floating-point.\n\n Result Type must be a 32-bit integer type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GL.PackSnorm4x8 %1 : vector<4xf32> -> i32\n ```", "operands": [ { "name": "operand", "type": "VectorOfLengthAndType<[4], [SPIRV_Float32]>" } ], "results": [ { "name": "result", "type": "SPIRV_Int32" } ], "assemblyFormat": "attr-dict $operand `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Pow", "summary": "Return x raised to the y power of two operands", "description": "Result is x raised to the y power; x^y.\n\n The resulting value is poison if x < 0. Result is poison if x = 0 and y ≤ 0.\n\n The operand x and y must be a scalar or vector whose component type is\n 16-bit or 32-bit floating-point.\n\n Result Type and the type of all operands must be the same type. Results are\n computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Pow %0, %1 : f32\n %3 = spirv.GL.Pow %0, %1 : vector<3xf16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Radians", "summary": "Convert a quantity in degrees to radians", "description": "Result is the quantity in radians for the quantity x given in degrees, i.e.,\n (π / 180) * x.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Radians %0 : f32\n %3 = spirv.GL.Radians %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Reflect", "summary": "Calculate reflection direction vector", "description": "For the incident vector I and surface orientation N, the result is the reflection direction:\n\n I - 2 * dot(N, I) * N\n\n N must already be normalized in order to achieve the desired result.\n\n The operands must all be a scalar or vector whose component type is floating-point.\n\n Result Type and the type of all operands must be the same type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Reflect %0, %1 : f32\n %3 = spirv.GL.Reflect %0, %1 : vector<3xf32>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Round", "summary": "Rounds to the nearest whole number", "description": "Result is the value equal to the nearest whole number to x. The fraction\n 0.5 will round in a direction chosen by the implementation, presumably\n the direction that is fastest. This includes the possibility that\n Round x is the same value as RoundEven x for all values of x.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Round %0 : f32\n %3 = spirv.GL.Round %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.RoundEven", "summary": "Rounds to the nearest even whole number", "description": "Result is the value equal to the nearest whole number to x. A fractional\n part of 0.5 will round toward the nearest even whole number. (Both 3.5 and\n 4.5 for x will be 4.0.)\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.RoundEven %0 : f32\n %3 = spirv.GL.RoundEven %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.SAbs", "summary": "Absolute value of operand", "description": "Result is x if x ≥ 0; otherwise result is -x, where x is interpreted as a\n signed integer.\n\n Result Type and the type of x must both be integer scalar or integer vector\n types. Result Type and operand types must have the same number of components\n with the same component width. Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.SAbs %0 : i32\n %3 = spirv.GL.SAbs %1 : vector<3xi16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.SClamp", "summary": "Clamp x between min and max values.", "description": "Result is min(max(x, minVal), maxVal), where x, minVal and maxVal are\n interpreted as signed integers. The resulting value is poison if\n minVal > maxVal.\n\n Result Type and the type of the operands must both be integer scalar or\n integer vector types. Result Type and operand types must have the same number\n of components with the same component width. Results are computed per\n component.\n\n \n ```\n uclamp-op ::= ssa-id `=` `spirv.GL.UClamp` ssa-use, ssa-use, ssa-use `:`\n sgined-scalar-vector-type\n ```\n #### Example:\n\n ```mlir\n %2 = spirv.GL.SClamp %x, %min, %max : si32\n %3 = spirv.GL.SClamp %x, %min, %max : vector<3xsi16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Sin", "summary": "Sine of operand in radians", "description": "The standard trigonometric sine of x radians.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Sin %0 : f32\n %3 = spirv.GL.Sin %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Sinh", "summary": "Hyperbolic sine of operand in radians", "description": "Hyperbolic sine of x radians.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Sinh %0 : f32\n %3 = spirv.GL.Sinh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.SMax", "summary": "Return maximum of two signed integer operands", "description": "Result is y if x < y; otherwise result is x, where x and y are interpreted\n as signed integers.\n\n Result Type and the type of x and y must both be integer scalar or integer\n vector types. Result Type and operand types must have the same number of\n components with the same component width. Results are computed per\n component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.SMax %0, %1 : i32\n %3 = spirv.GL.SMax %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.SMin", "summary": "Return minimum of two signed integer operands", "description": "Result is y if y < x; otherwise result is x, where x and y are interpreted\n as signed integers.\n\n Result Type and the type of x and y must both be integer scalar or integer\n vector types. Result Type and operand types must have the same number of\n components with the same component width. Results are computed per\n component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.SMin %0, %1 : i32\n %3 = spirv.GL.SMin %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.SmoothStep", "summary": "Return smooth Hermite interpolation between 0 and 1", "description": "Result is 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth\n Hermite interpolation between 0 and 1 when edge0 < x < edge1. This is\n equivalent to:\n t = clamp((x - edge0) / (edge1 - edge0), 0, 1)\n t * t * (3 - 2 * t)\n\n The resulting value is undefined if edge0 >= edge1.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results\n are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.SmoothStep %edge0, %edge1, %x : f32\n %3 = spirv.GL.SmoothStep %edge0, %edge1, %x : vector<3xf32>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Sqrt", "summary": "Returns the square root of the operand", "description": "Result is the square root of x. The resulting value is NaN if x < 0.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Sqrt %0 : f32\n %3 = spirv.GL.Sqrt %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.SSign", "summary": "Returns the sign of the operand", "description": "Result is 1 if x > 0, 0 if x = 0, or -1 if x < 0, where x is interpreted as\n a signed integer.\n\n Result Type and the type of x must both be integer scalar or integer vector\n types. Result Type and operand types must have the same number of components\n with the same component width. Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.SSign %0 : i32\n %3 = spirv.GL.SSign %1 : vector<3xi16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Step", "summary": "Return 0.0 if x < edge, else 1.0", "description": "Result is 0.0 if x < edge; otherwise result is 1.0.\n\n The operands must all be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of all operands must be the same type. Results\n are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Step %edge, %x : f32\n %3 = spirv.GL.Step %edge, %x : vector<3xf32>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Tan", "summary": "Tangent of operand in radians", "description": "The standard trigonometric tangent of x radians.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Tan %0 : f32\n %3 = spirv.GL.Tan %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Tanh", "summary": "Hyperbolic tangent of operand in radians", "description": "Hyperbolic tangent of x radians.\n\n The operand x must be a scalar or vector whose component type is 16-bit or\n 32-bit floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Tanh %0 : f32\n %3 = spirv.GL.Tanh %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.Trunc", "summary": "Rounds to the nearest whole number toward zero", "description": "Result is the value equal to the nearest whole number to x whose absolute\n value is not larger than the absolute value of x.\n\n The operand x must be a scalar or vector whose component type is\n floating-point.\n\n Result Type and the type of x must be the same type. Results are computed\n per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.Trunc %0 : f32\n %3 = spirv.GL.Trunc %1 : vector<3xf16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.UClamp", "summary": "Clamp x between min and max values.", "description": "Result is min(max(x, minVal), maxVal), where x, minVal and maxVal are\n interpreted as unsigned integers. The resulting value is poison if\n minVal > maxVal.\n\n Result Type and the type of the operands must both be integer scalar or\n integer vector types. Result Type and operand types must have the same number\n of components with the same component width. Results are computed per\n component.\n\n \n ```\n uclamp-op ::= ssa-id `=` `spirv.GL.UClamp` ssa-use, ssa-use, ssa-use `:`\n unsigned-signless-scalar-vector-type\n ```\n #### Example:\n\n ```mlir\n %2 = spirv.GL.UClamp %x, %min, %max : i32\n %3 = spirv.GL.UClamp %x, %min, %max : vector<3xui16>\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "y", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "z", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.UMax", "summary": "Return maximum of two unsigned integer operands", "description": "Result is y if x < y; otherwise result is x, where x and y are interpreted\n as unsigned integers.\n\n Result Type and the type of x and y must both be integer scalar or integer\n vector types. Result Type and operand types must have the same number of\n components with the same component width. Results are computed per\n component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.UMax %0, %1 : i32\n %3 = spirv.GL.UMax %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.UMin", "summary": "Return minimum of two unsigned integer operands", "description": "Result is y if y < x; otherwise result is x, where x and y are interpreted\n as unsigned integers.\n\n Result Type and the type of x and y must both be integer scalar or integer\n vector types. Result Type and operand types must have the same number of\n components with the same component width. Results are computed per\n component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.GL.UMin %0, %1 : i32\n %3 = spirv.GL.UMin %0, %1 : vector<3xi16>\n ```", "operands": [ { "name": "lhs", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "rhs", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.UnpackHalf2x16", "summary": "Unpack 32-bit integer into two-component vector of 32-bit floats", "description": "Result is the two-component floating-point vector with components obtained by\n unpacking a 32-bit unsigned integer into a pair of 16-bit values, interpreting\n those values as 16-bit floating-point numbers according to the OpenGL\n Specification, and converting them to 32-bit floating-point values. Subnormal\n numbers are either preserved or flushed to zero, consistently within an\n implementation.\n\n The first component of the vector is obtained from the 16 least-significant bits\n of v; the second component is obtained from the 16 most-significant bits of v.\n\n The RelaxedPrecision Decoration only affects the conversion step of the instruction.\n\n The v operand must be a scalar with 32-bit integer type.\n\n Result Type must be a vector of 2 components whose type is 32-bit floating point.\n\n #### Example:\n\n ```mlir\n %1 = spirv.GL.UnpackHalf2x16 %0 : i32 -> vector<2xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_Int32" } ], "results": [ { "name": "result", "type": "VectorOfLengthAndType<[2], [SPIRV_Float32]>" } ], "assemblyFormat": "attr-dict $operand `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GL.UnpackSnorm4x8", "summary": "Unpack 32-bit integer into four-component vector of normalized 32-bit floats", "description": "First, unpacks a single 32-bit unsigned integer p into four 8-bit signed integers.\n Then, each component is converted to a normalized floating-point value to generate\n the result. The conversion for unpacked fixed-point value f to floating point is\n done as follows:\n\n ```\n clamp(f / 127.0, -1, +1)\n ```\n\n The first component of the result is extracted from the least significant bits of the\n input; the last component is extracted from the most significant bits.\n\n The RelaxedPrecision Decoration only affects the conversion step of the instruction.\n\n The p operand must be a scalar with 32-bit integer type.\n\n Result Type must be a vector of 4 components whose type is 32-bit floating point.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GL.UnpackSnorm4x8 %1 : i32 -> vector<4xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_Int32" } ], "results": [ { "name": "result", "type": "VectorOfLengthAndType<[4], [SPIRV_Float32]>" } ], "assemblyFormat": "attr-dict $operand `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GlobalVariable", "summary": "Allocate an object in memory at module scope. The object is\n referenced using a symbol name.", "description": "The variable type must be an OpTypePointer. Its type operand is the type of\n object in memory.\n\n Storage Class is the Storage Class of the memory holding the object. It\n cannot be Generic. It must be the same as the Storage Class operand of\n the variable types. Only those storage classes that are valid at module\n scope (like Input, Output, StorageBuffer, etc.) are valid.\n\n Initializer is optional. If Initializer is present, it will be\n the initial value of the variable’s memory content. Initializer\n must be an symbol defined from a constant instruction or other\n `spirv.GlobalVariable` operation in module scope. Initializer must\n have the same type as the type of the defined symbol.\n\n \n\n ```\n variable-op ::= `spirv.GlobalVariable` spirv-type symbol-ref-id\n (`initializer(` symbol-ref-id `)`)?\n (`bind(` integer-literal, integer-literal `)`)?\n (`built_in(` string-literal `)`)?\n attribute-dict?\n ```\n\n where `initializer` specifies initializer and `bind` specifies the\n descriptor set and binding number. `built_in` specifies SPIR-V\n BuiltIn decoration associated with the op.\n\n #### Example:\n\n ```mlir\n spirv.GlobalVariable @var0 : !spirv.ptr\n spirv.GlobalVariable @var1 initializer(@var0) : !spirv.ptr\n spirv.GlobalVariable @var2 bind(1, 2) : !spirv.ptr\n spirv.GlobalVariable @var3 built_in(\"GlobalInvocationId\") : !spirv.ptr, Input>\n ```", "attributes": [ { "name": "type", "type": "TypeAttr" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "initializer", "type": "OptionalAttr" }, { "name": "location", "type": "OptionalAttr" }, { "name": "binding", "type": "OptionalAttr" }, { "name": "descriptor_set", "type": "OptionalAttr" }, { "name": "built_in", "type": "OptionalAttr" }, { "name": "linkage_attributes", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.GLSL.Fma", "hasCustomAssemblyFormat": 1 }, { "name": "spirv.GroupBroadcast", "summary": "Broadcast the Value of the invocation identified by the local id LocalId\n to the result of all invocations in the group.", "description": "All invocations of this module within Execution must reach this point of\n execution.\n\n Behavior is undefined if this instruction is used in control flow that\n is non-uniform within Execution.\n\n Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The type of Value must be the same as Result Type.\n\n LocalId must be an integer datatype. It can be a scalar, or a vector\n with 2 components or a vector with 3 components. LocalId must be the\n same for all invocations in the group.\n\n #### Example:\n\n ```mlir\n %scalar_value = ... : f32\n %vector_value = ... : vector<4xf32>\n %scalar_localid = ... : i32\n %vector_localid = ... : vector<3xi32>\n %0 = spirv.GroupBroadcast %scalar_value, %scalar_localid : f32, i32\n %1 = spirv.GroupBroadcast %vector_value, %vector_localid :\n vector<4xf32>, vector<3xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "localid", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVector" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value) `,` type($localid)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupFAdd", "summary": "A floating-point add group operation specified for all values of X\n specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of floating-point type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupFAdd %value : f32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupFMax", "summary": "A floating-point maximum group operation specified for all values of X\n specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of floating-point type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is -INF.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupFMax %value : f32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupFMin", "summary": "A floating-point minimum group operation specified for all values of X\n specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of floating-point type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is +INF.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupFMin %value : f32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupIAdd", "summary": "An integer add group operation specified for all values of X specified\n by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupIAdd %value : i32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformAll", "summary": "Evaluates a predicate for all tangled invocations within the Execution\n scope, resulting in true if predicate evaluates to true for all tangled\n invocations within the Execution scope, otherwise the result is false.", "description": "Result Type must be a Boolean type.\n\n Execution is the scope defining the scope restricted tangle affected by\n this command. It must be Subgroup.\n\n Predicate must be a Boolean type.\n\n An invocation will not execute a dynamic instance of this instruction\n (X') until all invocations in its scope restricted tangle have executed\n all dynamic instances that are program-ordered before X'.\n\n \n\n #### Example:\n\n ```mlir\n %predicate = ... : i1\n %0 = spirv.GroupNonUniformAll %predicate : i1\n ```", "operands": [ { "name": "predicate", "type": "SPIRV_Bool" } ], "results": [ { "name": "result", "type": "SPIRV_Bool" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope $predicate attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformAllEqual", "summary": "Evaluates a value for all tangled invocations within the Execution\n scope. The result is true if Value is equal for all tangled invocations\n within the Execution scope. Otherwise, the result is false.", "description": "Result Type must be a Boolean type.\n\n Execution is the scope defining the scope restricted tangle affected by\n this command. It must be Subgroup.\n\n Value must be a scalar or vector of floating-point type, integer type,\n or Boolean type. The compare operation is based on this type, and if it\n is a floating-point type, an ordered-and-equal compare is used.\n\n An invocation will not execute a dynamic instance of this instruction\n (X') until all invocations in its scope restricted tangle have executed\n all dynamic instances that are program-ordered before X'.\n\n \n\n #### Example:\n\n ```mlir\n %scalar_value = ... : f32\n %vector_value = ... : vector<4xf32>\n %0 = spirv.GroupNonUniformAllEqual %scalar_value : f32, i1\n %1 = spirv.GroupNonUniformAllEqual %vector_value : vector<4xf32>, i1\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" } ], "results": [ { "name": "result", "type": "SPIRV_Bool" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope $value attr-dict `:` type($value) `,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformAny", "summary": "Evaluates a predicate for all tangled invocations within the Execution\n scope, resulting in true if predicate evaluates to true for any tangled\n invocations within the Execution scope, otherwise the result is false.", "description": "Result Type must be a Boolean type.\n\n Execution is the scope defining the scope restricted tangle affected by\n this command. It must be Subgroup.\n\n Predicate must be a Boolean type.\n\n An invocation will not execute a dynamic instance of this instruction\n (X') until all invocations in its scope restricted tangle have executed\n all dynamic instances that are program-ordered before X'.\n\n \n\n #### Example:\n\n ```mlir\n %predicate = ... : i1\n %0 = spirv.GroupNonUniformAny %predicate : i1\n ```", "operands": [ { "name": "predicate", "type": "SPIRV_Bool" } ], "results": [ { "name": "result", "type": "SPIRV_Bool" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope $predicate attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformBallot", "summary": "Result is a bitfield value combining the Predicate value from all\n invocations in the group that execute the same dynamic instance of this\n instruction. The bit is set to one if the corresponding invocation is\n active and the Predicate for that invocation evaluated to true;\n otherwise, it is set to zero.", "description": "Result Type must be a vector of four components of integer type scalar,\n whose Signedness operand is 0.\n\n Result is a set of bitfields where the first invocation is represented\n in the lowest bit of the first vector component and the last (up to the\n size of the group) is the higher bit number of the last bitmask needed\n to represent all bits of the group invocations.\n\n Execution must be Workgroup or Subgroup Scope.\n\n Predicate must be a Boolean type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformBallot %predicate : vector<4xi32>\n ```", "operands": [ { "name": "predicate", "type": "SPIRV_Bool" } ], "results": [ { "name": "result", "type": "SPIRV_IOrUIVec4" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope $predicate attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformBallotBitCount", "summary": "Result is the number of bits that are set to 1 in Value, considering\n only the bits in Value required to represent all bits of the scope\n restricted tangle.", "description": "Result Type must be a scalar of integer type, whose Signedness operand\n is 0.\n\n Execution is the scope defining the scope restricted tangle affected by\n this command. It must be Subgroup.\n\n The identity I for Operation is 0.\n\n Value must be a vector of four components of integer type scalar, whose\n Width operand is 32 and whose Signedness operand is 0.\n\n Value is a set of bitfields where the first invocation is represented in\n the lowest bit of the first vector component and the last (up to the\n size of the scope) is the higher bit number of the last bitmask needed\n to represent all bits of the invocations in the scope restricted tangle.\n\n An invocation will not execute a dynamic instance of this instruction\n (X') until all invocations in its scope restricted tangle have executed\n all dynamic instances that are program-ordered before X'.\n\n \n\n #### Example:\n\n ```mlir\n %count = spirv.GroupNonUniformBallotBitCount %val : vector<4xi32> -> i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_Vec4>" } ], "results": [ { "name": "result", "type": "SPIRV_SignlessOrUnsignedInt" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value attr-dict `:` type($value) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformBallotFindLSB", "summary": "Find the least significant bit set to 1 in Value, considering only the\n bits in Value required to represent all bits of the group's invocations.\n If none of the considered bits is set to 1, the resulting value is\n undefined.", "description": "Result Type must be a scalar of integer type, whose Signedness operand\n is 0.\n\n Execution is a Scope that identifies the group of invocations affected\n by this command. It must be Subgroup.\n\n Value must be a vector of four components of integer type scalar, whose\n Width operand is 32 and whose Signedness operand is 0.\n\n Value is a set of bitfields where the first invocation is represented in\n the lowest bit of the first vector component and the last (up to the\n size of the group) is the higher bit number of the last bitmask needed\n to represent all bits of the group invocations.\n\n \n\n #### Example:\n\n ```mlir\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformBallotFindLSB %vector : vector<4xi32>, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_IOrUIVec4" } ], "results": [ { "name": "result", "type": "SPIRV_SignlessOrUnsignedInt" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope $value attr-dict `:` type($value) `,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformBallotFindMSB", "summary": "Find the most significant bit set to 1 in Value, considering only the\n bits in Value required to represent all bits of the group's invocations.\n If none of the considered bits is set to 1, the resulting value is\n undefined.", "description": "Result Type must be a scalar of integer type, whose Signedness operand\n is 0.\n\n Execution is a Scope that identifies the group of invocations affected\n by this command. It must be Subgroup.\n\n Value must be a vector of four components of integer type scalar, whose\n Width operand is 32 and whose Signedness operand is 0.\n\n Value is a set of bitfields where the first invocation is represented in\n the lowest bit of the first vector component and the last (up to the\n size of the group) is the higher bit number of the last bitmask needed\n to represent all bits of the group invocations.\n\n \n\n #### Example:\n\n ```mlir\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformBallotFindMSB %vector : vector<4xi32>, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_IOrUIVec4" } ], "results": [ { "name": "result", "type": "SPIRV_SignlessOrUnsignedInt" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope $value attr-dict `:` type($value) `,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformBitwiseAnd", "summary": "A bitwise `and` group operation of all Value operands contributed by active\n invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is ~0. If Operation is ClusteredReduce,\n ClusterSize must be present.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformBitwiseAnd %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformBitwiseAnd \n %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformBitwiseOr", "summary": "A bitwise `or` group operation of all Value operands contributed by active\n invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be present.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformBitwiseOr %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformBitwiseOr \n %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformBitwiseXor", "summary": "A bitwise `xor` group operation of all Value operands contributed by active\n invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be present.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformBitwiseXor %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformBitwiseXor \n %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformBroadcast", "summary": "Result is the Value of the invocation identified by the id Id to all\n active invocations in the group.", "description": "Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The type of Value must be the same as Result Type.\n\n Id must be a scalar of integer type, whose Signedness operand is 0.\n\n Before version 1.5, Id must come from a constant instruction. Starting\n with version 1.5, Id must be dynamically uniform.\n\n The resulting value is undefined if Id is an inactive invocation, or is\n greater than or equal to the size of the group.\n\n #### Example:\n\n ```mlir\n %scalar_value = ... : f32\n %vector_value = ... : vector<4xf32>\n %id = ... : i32\n %0 = spirv.GroupNonUniformBroadcast %scalar_value, %id : f32, i32\n %1 = spirv.GroupNonUniformBroadcast %vector_value, %id :\n vector<4xf32>, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "id", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVector" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value) `,` type($id)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformBroadcastFirst", "summary": "Broadcast the value from the active invocation with the lowest id in\n the subgroup.", "description": "Result is the Value of the invocation from the active invocations with\n the lowest id within the Execution scope to all active invocations\n within the Execution scope.\n\n Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution must be Subgroup Scope.\n\n The type of Value must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %scalar_value = ... : f32\n %vector_value = ... : vector<4xf32>\n %0 = spirv.GroupNonUniformBroadcastFirst %scalar_value : f32\n %1 = spirv.GroupNonUniformBroadcastFirst %vector_value : vector<4xf32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVector" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformElect", "summary": "Result is true only in the active invocation with the lowest id in the\n group, otherwise result is false.", "description": "Result Type must be a Boolean type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformElect : i1\n ```", "results": [ { "name": "result", "type": "SPIRV_Bool" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "assemblyFormat": "$execution_scope attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformFAdd", "summary": "A floating point add group operation of all Value operands contributed\n by active invocations in the group.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type. The method used to\n perform the group operation on the contributed Value(s) from active\n invocations is implementation defined.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : f32\n %vector = ... : vector<4xf32>\n %0 = spirv.GroupNonUniformFAdd %scalar : f32 -> f32\n %1 = spirv.GroupNonUniformFAdd %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformFMax", "summary": "A floating point maximum group operation of all Value operands\n contributed by active invocations in by group.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is -INF. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type. The method used to\n perform the group operation on the contributed Value(s) from active\n invocations is implementation defined. From the set of Value(s) provided\n by active invocations within a subgroup, if for any two Values one of\n them is a NaN, the other is chosen. If all Value(s) that are used by the\n current invocation are NaN, then the result is an undefined value.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : f32\n %vector = ... : vector<4xf32>\n %0 = spirv.GroupNonUniformFMax %scalar : f32 -> f32\n %1 = spirv.GroupNonUniformFMax %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformFMin", "summary": "A floating point minimum group operation of all Value operands\n contributed by active invocations in the group.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is +INF. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type. The method used to\n perform the group operation on the contributed Value(s) from active\n invocations is implementation defined. From the set of Value(s) provided\n by active invocations within a subgroup, if for any two Values one of\n them is a NaN, the other is chosen. If all Value(s) that are used by the\n current invocation are NaN, then the result is an undefined value.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : f32\n %vector = ... : vector<4xf32>\n %0 = spirv.GroupNonUniformFMin %scalar : f32 -> i32\n %1 = spirv.GroupNonUniformFMin %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformFMul", "summary": "A floating point multiply group operation of all Value operands\n contributed by active invocations in the group.", "description": "Result Type must be a scalar or vector of floating-point type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is 1. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type. The method used to\n perform the group operation on the contributed Value(s) from active\n invocations is implementation defined.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : f32\n %vector = ... : vector<4xf32>\n %0 = spirv.GroupNonUniformFMul %scalar : f32 -> f32\n %1 = spirv.GroupNonUniformFMul %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformIAdd", "summary": "An integer add group operation of all Value operands contributed by\n active invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformIAdd %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformIAdd %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformIMul", "summary": "An integer multiply group operation of all Value operands contributed by\n active invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is 1. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformIMul %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformIMul %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformLogicalAnd", "summary": "A logical `and` group operation of all Value operands contributed by active\n invocations in the group.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is ~0. If Operation is ClusteredReduce,\n ClusterSize must be present.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i1\n %vector = ... : vector<4xi1>\n %0 = spirv.GroupNonUniformLogicalAnd %scalar : i1 -> i1\n %1 = spirv.GroupNonUniformLogicalAnd \n %vector cluster_size(%four) : vector<4xi1>, i32 -> vector<4xi1>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformLogicalOr", "summary": "A logical `or` group operation of all Value operands contributed by active\n invocations in the group.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be present.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i1\n %vector = ... : vector<4xi1>\n %0 = spirv.GroupNonUniformLogicalOr %scalar : i1 -> i1\n %1 = spirv.GroupNonUniformLogicalOr \n %vector cluster_size(%four) : vector<4xi1>, i32 -> vector<4xi1>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformLogicalXor", "summary": "A logical `xor` group operation of all Value operands contributed by active\n invocations in the group.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be present.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i1\n %vector = ... : vector<4xi1>\n %0 = spirv.GroupNonUniformLogicalXor %scalar : i1 -> i1\n %1 = spirv.GroupNonUniformLogicalXor \n %vector cluster_size(%four) : vector<4xi1>, i32 -> vector<4xi1>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformQuadSwap", "summary": "Swap the Value of the invocation within the quad with another invocation\n in the quad using Direction.", "description": "Result Type must be a scalar or vector of floating-point type, integer type,\n or Boolean type.\n\n Execution is a Scope, but has no effect on the behavior of this instruction.\n It must be Subgroup.\n\n The type of Value must be the same as Result Type.\n\n Direction is the kind of swap to perform.\n\n Direction must be a scalar of integer type, whose Signedness operand is 0.\n\n Direction must come from a constant instruction.\n\n The value returned in Result is the value provided to Value by another invocation\n in the same quad scope instance. The invocation providing this value is\n determined according to Direction.\n\n A Direction of 0 indicates a horizontal swap;\n - Invocations with quad indices of 0 and 1 swap values\n - Invocations with quad indices of 2 and 3 swap values\n A Direction of 1 indicates a vertical swap;\n - Invocations with quad indices of 0 and 2 swap values\n - Invocations with quad indices of 1 and 3 swap values\n A Direction of 2 indicates a diagonal swap;\n - Invocations with quad indices of 0 and 3 swap values\n - Invocations with quad indices of 1 and 2 swap values\n\n Direction must be one of the above values.\n\n If a tangled invocation within the quad reads Value from an invocation not part\n of the tangled invocation within the same quad, the resulting value is undefined.\n\n An invocation will not execute a dynamic instance of this instruction (X') until\n all invocations in its quad have executed all dynamic instances that are program-ordered\n before X'.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformQuadSwap %value : f32\n %1 = spirv.GroupNonUniformQuadSwap %value : vector<4xf32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVector" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "direction", "type": "SPIRV_QuadSwapDirectionAttr{Horizontal|Vertical|Diagonal}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope $direction $value attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformRotateKHR", "summary": "Rotate values across invocations within a subgroup.", "description": "Return the Value of the invocation whose id within the group is calculated\n as follows:\n\n LocalId = SubgroupLocalInvocationId if Execution is Subgroup or\n LocalInvocationId if Execution is Workgroup\n RotationGroupSize = ClusterSize when ClusterSize is present, otherwise\n RotationGroupSize = SubgroupMaxSize if the Kernel capability is declared\n and SubgroupSize if not.\n Invocation ID = ( (LocalId + Delta) & (RotationGroupSize - 1) ) +\n (LocalId & ~(RotationGroupSize - 1))\n\n Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The type of Value must be the same as Result Type.\n\n Delta must be a scalar of integer type, whose Signedness operand is 0.\n Delta must be dynamically uniform within Execution.\n\n Delta is treated as unsigned and the resulting value is undefined if the\n selected lane is inactive.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar of\n integer type, whose Signedness operand is 0. ClusterSize must come from a\n constant instruction. Behavior is undefined unless ClusterSize is at least\n 1 and a power of 2. If ClusterSize is greater than the declared\n SubGroupSize, executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %0 = spirv.GroupNonUniformRotateKHR %value, %delta : f32, i32 -> f32\n %1 = spirv.GroupNonUniformRotateKHR %value, %delta,\n cluster_size(%four) : f32, i32, i32 -> f32\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "delta", "type": "SPIRV_SignlessOrUnsignedInt" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVector" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope $value `,` $delta (`,` `cluster_size` `(` $cluster_size^ `)`)? attr-dict `:` type($value) `,` type($delta) (`,` type($cluster_size)^)? `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformShuffle", "summary": "Result is the Value of the invocation identified by the id Id.", "description": "Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The type of Value must be the same as Result Type.\n\n Id must be a scalar of integer type, whose Signedness operand is 0.\n\n The resulting value is undefined if Id is an inactive invocation, or is\n greater than or equal to the size of the group.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformShuffle %val, %id : f32, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "id", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVector" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value) `,` type($id)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformShuffleDown", "summary": "Result is the Value of the invocation identified by the current\n invocation’s id within the group + Delta.", "description": "Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The type of Value must be the same as Result Type.\n\n Delta must be a scalar of integer type, whose Signedness operand is 0.\n\n Delta is treated as unsigned and the resulting value is undefined if\n Delta is greater than or equal to the size of the group, or if the\n current invocation’s id within the group + Delta is either an inactive\n invocation or greater than or equal to the size of the group.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformShuffleDown %val, %delta : f32, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "delta", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Type" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value) `,` type($delta)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformShuffleUp", "summary": "Result is the Value of the invocation identified by the current\n invocation’s id within the group - Delta.", "description": "Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The type of Value must be the same as Result Type.\n\n Delta must be a scalar of integer type, whose Signedness operand is 0.\n\n Delta is treated as unsigned and the resulting value is undefined if\n Delta is greater than the current invocation’s id within the group or if\n the selected lane is inactive.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformShuffleUp %val, %delta : f32, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "delta", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Type" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value) `,` type($delta)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformShuffleXor", "summary": "Result is the Value of the invocation identified by the current\n invocation’s id within the group xor’ed with Mask.", "description": "Result Type must be a scalar or vector of floating-point type, integer\n type, or Boolean type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The type of Value must be the same as Result Type.\n\n Mask must be a scalar of integer type, whose Signedness operand is 0.\n\n The resulting value is undefined if current invocation’s id within the\n group xor’ed with Mask is an inactive invocation, or is greater than or\n equal to the size of the group.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupNonUniformShuffleXor %val, %mask : f32, i32\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVector" }, { "name": "mask", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Type" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$execution_scope operands attr-dict `:` type($value) `,` type($mask)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupNonUniformSMax", "summary": "A signed integer maximum group operation of all Value operands\n contributed by active invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is INT_MIN. If Operation is\n ClusteredReduce, ClusterSize must be specified.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformSMax %scalar : i32\n %1 = spirv.GroupNonUniformSMax %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformSMin", "summary": "A signed integer minimum group operation of all Value operands\n contributed by active invocations in the group.", "description": "Result Type must be a scalar or vector of integer type.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is INT_MAX. If Operation is\n ClusteredReduce, ClusterSize must be specified.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformSMin %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformSMin %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformUMax", "summary": "An unsigned integer maximum group operation of all Value operands\n contributed by active invocations in the group.", "description": "Result Type must be a scalar or vector of integer type, whose\n Signedness operand is 0.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is 0. If Operation is ClusteredReduce,\n ClusterSize must be specified.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformUMax %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformUMax %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupNonUniformUMin", "summary": "An unsigned integer minimum group operation of all Value operands\n contributed by active invocations in the group.", "description": "Result Type must be a scalar or vector of integer type, whose\n Signedness operand is 0.\n\n Execution must be Workgroup or Subgroup Scope.\n\n The identity I for Operation is UINT_MAX. If Operation is\n ClusteredReduce, ClusterSize must be specified.\n\n The type of Value must be the same as Result Type.\n\n ClusterSize is the size of cluster to use. ClusterSize must be a scalar\n of integer type, whose Signedness operand is 0. ClusterSize must come\n from a constant instruction. ClusterSize must be at least 1, and must be\n a power of 2. If ClusterSize is greater than the declared SubGroupSize,\n executing this instruction results in undefined behavior.\n\n \n\n #### Example:\n\n ```mlir\n %four = spirv.Constant 4 : i32\n %scalar = ... : i32\n %vector = ... : vector<4xi32>\n %0 = spirv.GroupNonUniformUMin %scalar : i32 -> i32\n %1 = spirv.GroupNonUniformUMin %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "cluster_size", "type": "Optional" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "assemblyFormat": "$execution_scope $group_operation $value (`cluster_size``(` $cluster_size^ `)`)? attr-dict `:` type($value) (`,` type($cluster_size)^)? `->` type(results)" }, { "name": "spirv.GroupSMax", "summary": "A signed integer maximum group operation specified for all values of X\n specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is INT_MIN when X is 32 bits wide and\n LONG_MIN when X is 64 bits wide.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupSMax %value : i32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupSMin", "summary": "A signed integer minimum group operation specified for all values of X\n specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is INT_MAX when X is 32 bits wide and\n LONG_MAX when X is 64 bits wide.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupSMin %value : i32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupUMax", "summary": "An unsigned integer maximum group operation specified for all values of\n X specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is 0.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupUMax %value : i32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.GroupUMin", "summary": "An unsigned integer minimum group operation specified for all values of\n X specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n Execution reach this point of execution.\n\n Behavior is undefined unless all invocations within Execution execute\n the same dynamic instance of this instruction.\n\n Result Type must be a scalar or vector of integer type.\n\n Execution is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for Operation is UINT_MAX when X is 32 bits wide and\n ULONG_MAX when X is 64 bits wide.\n\n The type of X must be the same as Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.GroupUMin %value : i32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.IAdd", "summary": "Integer addition of Operand 1 and Operand 2.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same number of components as Result\n Type. They must have the same component width as Result Type.\n\n The resulting value will equal the low-order N bits of the correct\n result R, where N is the component width and R is computed with enough\n precision to avoid overflow and underflow.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.IAdd %0, %1 : i32\n %5 = spirv.IAdd %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.IAddCarry", "summary": "Integer addition of Operand 1 and Operand 2, including the carry.", "description": "Result Type must be from OpTypeStruct. The struct must have two\n members, and the two members must be the same type. The member type\n must be a scalar or vector of integer type, whose Signedness operand is\n 0.\n\n Operand 1 and Operand 2 must have the same type as the members of Result\n Type. These are consumed as unsigned integers.\n\n Results are computed per component.\n\n Member 0 of the result gets the low-order bits (full component width) of\n the addition.\n\n Member 1 of the result gets the high-order (carry) bit of the result of\n the addition. That is, it gets the value 1 if the addition overflowed\n the component width, and 0 otherwise.\n\n \n\n #### Example:\n\n ```mlir\n %2 = spirv.IAddCarry %0, %1 : !spirv.struct<(i32, i32)>\n %2 = spirv.IAddCarry %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_AnyStruct" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.IEqual", "summary": "Integer comparison for equality.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.IEqual %0, %1 : i32\n %5 = spirv.IEqual %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.Image", "summary": "Extract the image from a sampled image.", "description": "Result Type must be OpTypeImage.\n\n Sampled Image must have type OpTypeSampledImage whose Image Type is the\n same as Result Type.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.Image %1 : !spirv.sampled_image>\n ```", "operands": [ { "name": "sampled_image", "type": "SPIRV_AnySampledImage" } ], "results": [ { "name": "result", "type": "SPIRV_AnyImage" } ], "traits": [ { "type": "TypesMatchWith<'sampled_image', 'result', '::llvm::cast($_self).getImageType()'>" } ], "assemblyFormat": "$sampled_image attr-dict `:` type($sampled_image)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageDrefGather", "summary": "Gathers the requested depth-comparison from four texels.", "description": "Result Type must be a vector of four components of floating-point type\n or integer type. Its components must be the same as Sampled Type of the\n underlying OpTypeImage (unless that underlying Sampled Type is\n OpTypeVoid). It has one component per gathered texel.\n\n Sampled Image must be an object whose type is OpTypeSampledImage. Its\n OpTypeImage must have a Dim of 2D, Cube, or Rect. The MS operand of the\n underlying OpTypeImage must be 0.\n\n Coordinate must be a scalar or vector of floating-point type. It\n contains (u[, v] ... [, array layer]) as needed by the definition of\n Sampled Image.\n\n Dref is the depth-comparison reference value. It must be a 32-bit\n floating-point type scalar.\n\n Image Operands encodes what operands follow, as per Image Operands.\n\n #### Example:\n\n ```mlir\n %0 = spirv.ImageDrefGather %1, %2, %3 : !spirv.sampled_image>, vector<4xf32>, f32 -> vector<4xi32>\n %0 = spirv.ImageDrefGather %1, %2, %3 [\"NonPrivateTexel\"] : !spirv.sampled_image>, vector<4xf32>, f32 -> vector<4xi32>\n ```", "operands": [ { "name": "sampled_image", "type": "SPIRV_AnySampledImage" }, { "name": "coordinate", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "dref", "type": "SPIRV_Float32" }, { "name": "operand_arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_Vec4, SPIRV_Vec4]>" } ], "attributes": [ { "name": "image_operands", "type": "OptionalAttr" } ], "assemblyFormat": "$sampled_image `,` $coordinate `,` $dref custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($sampled_image) `,` type($coordinate) `,` type($dref) ( `,` type($operand_arguments)^ )?\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageFetch", "summary": "Fetch a single texel from an image whose Sampled operand is 1.", "description": "Result Type must be a vector of four components of floating-point type or\n integer type. Its components must be the same as Sampled Type of the underlying\n OpTypeImage (unless that underlying Sampled Type is OpTypeVoid).\n\n Image must be an object whose type is OpTypeImage. Its Dim operand must not be\n Cube, and its Sampled operand must be 1.\n\n Coordinate must be a scalar or vector of integer type. It contains (u[, v] … [,\n array layer]) as needed by the definition of Sampled Image.\n\n Image Operands encodes what operands follow, as per Image Operands.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.ImageFetch %1, %2 : !spirv.image, vector<2xsi32> -> vector<4xf32>\n ```", "operands": [ { "name": "image", "type": "SPIRV_AnyImage" }, { "name": "coordinate", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand_arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_Vec4, SPIRV_Vec4]>" } ], "attributes": [ { "name": "image_operands", "type": "OptionalAttr" } ], "assemblyFormat": "$image `,` $coordinate custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($image) `,` type($coordinate) ( `,` type($operand_arguments)^ )?\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageQuerySize", "summary": "Query the dimensions of Image, with no level of detail.", "description": "Result Type must be an integer type scalar or vector. The number of\n components must be:\n\n 1 for the 1D and Buffer dimensionalities,\n\n 2 for the 2D, Cube, and Rect dimensionalities,\n\n 3 for the 3D dimensionality,\n\n plus 1 more if the image type is arrayed. This vector is filled in with\n (width [, height] [, elements]) where elements is the number of layers\n in an image array or the number of cubes in a cube-map array.\n\n Image must be an object whose type is OpTypeImage. Its Dim operand must\n be one of those listed under Result Type, above. Additionally, if its\n Dim is 1D, 2D, 3D, or Cube, it must also have either an MS of 1 or a\n Sampled of 0 or 2. There is no implicit level-of-detail consumed by this\n instruction. See OpImageQuerySizeLod for querying images having level of\n detail. This operation is allowed on an image decorated as NonReadable.\n See the client API specification for additional image type restrictions.\n\n \n\n #### Example:\n\n ```mlir\n %3 = spirv.ImageQuerySize %0 : !spirv.image -> i32\n %4 = spirv.ImageQuerySize %1 : !spirv.image -> vector<2xi32>\n %5 = spirv.ImageQuerySize %2 : !spirv.image -> vector<3xi32>\n ```", "operands": [ { "name": "image", "type": "SPIRV_AnyImage" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "assemblyFormat": "$image attr-dict `:` type($image) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageRead", "summary": "Read a texel from an image without a sampler.", "description": "Result Type must be a scalar or vector of floating-point type or integer\n type. It must be a scalar or vector with component type the same as Sampled\n Type of the OpTypeImage (unless that Sampled Type is OpTypeVoid).\n\n Image must be an object whose type is OpTypeImage with a Sampled operand of\n 0 or 2. If the Arrayed operand is 1, then additional capabilities may be\n required; e.g., ImageCubeArray, or ImageMSArray.\n\n Coordinate must be a scalar or vector of floating-point type or integer\n type. It contains non-normalized texel coordinates (u[, v] ... [, array\n layer]) as needed by the definition of Image. See the client API\n specification for handling of coordinates outside the image.\n\n If the Image Dim operand is SubpassData, Coordinate is relative to the\n current fragment location. See the client API specification for more detail\n on how these coordinates are applied.\n\n If the Image Dim operand is not SubpassData, the Image Format must not be\n Unknown, unless the StorageImageReadWithoutFormat Capability was declared.\n\n Image Operands encodes what operands follow, as per Image Operands.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.ImageRead %1, %2 : !spirv.image, vector<2xsi32> -> vector<4xf32>\n ```", "operands": [ { "name": "image", "type": "SPIRV_AnyImage" }, { "name": "coordinate", "type": "AnyTypeOf<[SPIRV_ScalarOrVectorOf, SPIRV_ScalarOrVectorOf]>" }, { "name": "operand_arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_ScalarOrVectorOf, SPIRV_ScalarOrVectorOf]>" } ], "attributes": [ { "name": "image_operands", "type": "OptionalAttr" } ], "assemblyFormat": "$image `,` $coordinate custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($image) `,` type($coordinate) ( `,` type($operand_arguments)^ )?\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageSampleExplicitLod", "summary": "Sample an image using an explicit level of detail.", "description": "Result Type must be a vector of four components of floating-point type\n or integer type. Its components must be the same as Sampled Type of the\n underlying OpTypeImage (unless that underlying Sampled Type is\n OpTypeVoid).\n\n Sampled Image must be an object whose type is OpTypeSampledImage. Its\n OpTypeImage must not have a Dim of Buffer. The MS operand of the\n underlying OpTypeImage must be 0.\n\n Coordinate must be a scalar or vector of floating-point type or integer\n type. It contains (u[, v] ... [, array layer]) as needed by the\n definition of Sampled Image. Unless the Kernel capability is declared,\n it must be floating point. It may be a vector larger than needed, but\n all unused components appear after all used components.\n\n Image Operands encodes what operands follow, as per Image Operands.\n Either Lod or Grad image operands must be present.\n\n \n\n #### Example:\n\n ```mlir\n %result = spirv.ImageSampleExplicitLod %image, %coord [\"Lod\"](%lod) :\n !spirv.sampled_image>,\n vector<2xf32> (f32) -> vector<4xf32>\n ```", "operands": [ { "name": "sampled_image", "type": "SPIRV_AnySampledImage" }, { "name": "coordinate", "type": "AnyTypeOf<[SPIRV_ScalarOrVectorOf, SPIRV_ScalarOrVectorOf]>" }, { "name": "operand_arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_Vec4, SPIRV_Vec4]>" } ], "attributes": [ { "name": "image_operands", "type": "SPIRV_ImageOperandsAttr{None|Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod|MakeTexelAvailable|MakeTexelVisible|NonPrivateTexel|VolatileTexel|SignExtend|Offsets|ZeroExtend|Nontemporal}" } ], "assemblyFormat": "$sampled_image `,` $coordinate custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($sampled_image) `,` type($coordinate) ( `,` type($operand_arguments)^ )?\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageSampleImplicitLod", "summary": "Sample an image with an implicit level of detail.", "description": "An invocation will not execute a dynamic instance of this instruction\n (X') until all invocations in its derivative group have executed all\n dynamic instances that are program-ordered before X'.\n\n Result Type must be a vector of four components of floating-point type\n or integer type. Its components must be the same as Sampled Type of the\n underlying OpTypeImage (unless that underlying Sampled Type is\n OpTypeVoid).\n\n Sampled Image must be an object whose type is OpTypeSampledImage. Its\n OpTypeImage must not have a Dim of Buffer. The MS operand of the\n underlying OpTypeImage must be 0.\n\n Coordinate must be a scalar or vector of floating-point type. It\n contains (u[, v] ... [, array layer]) as needed by the definition of\n Sampled Image. It may be a vector larger than needed, but all unused\n components appear after all used components.\n\n Image Operands encodes what operands follow, as per Image Operands.\n\n This instruction is only valid in the Fragment Execution Model. In\n addition, it consumes an implicit derivative that can be affected by\n code motion.\n\n \n\n #### Example:\n\n ```mlir\n %result = spirv.ImageSampleImplicitLod %image, %coord :\n !spirv.sampled_image>,\n vector<3xf32> -> vector<4xf32>\n ```", "operands": [ { "name": "sampled_image", "type": "SPIRV_AnySampledImage" }, { "name": "coordinate", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand_arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_Vec4, SPIRV_Vec4]>" } ], "attributes": [ { "name": "image_operands", "type": "OptionalAttr" } ], "assemblyFormat": "$sampled_image `,` $coordinate custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($sampled_image) `,` type($coordinate) ( `,` type($operand_arguments)^ )?\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageSampleProjDrefImplicitLod", "summary": "Sample an image with a project coordinate, doing depth-comparison, with\n an implicit level of detail.", "description": "An invocation will not execute a dynamic instance of this instruction\n (X') until all invocations in its derivative group have executed all\n dynamic instances that are program-ordered before X'.\n\n Result Type must be a scalar of integer type or floating-point type. It\n must be the same as Sampled Type of the underlying OpTypeImage.\n\n Sampled Image must be an object whose type is OpTypeSampledImage. The\n Dim operand of the underlying OpTypeImage must be 1D, 2D, 3D, or Rect,\n and the Arrayed and MS operands must be 0.\n\n Coordinate must be a vector of floating-point type. It contains (u[,\n v] [, w], q), as needed by the definition of Sampled Image, with the q\n component consumed for the projective division. That is, the actual\n sample coordinate is (u/q [, v/q] [, w/q]), as needed by the definition\n of Sampled Image. It may be a vector larger than needed, but all unused\n components appear after all used components.\n\n Dref/q is the depth-comparison reference value. Dref must be a 32-bit\n floating-point type scalar.\n\n Image Operands encodes what operands follow, as per Image Operands.\n\n This instruction is only valid in the Fragment Execution Model. In\n addition, it consumes an implicit derivative that can be affected by\n code motion.\n\n \n\n #### Example:\n\n ```mlir\n %result = spirv.ImageSampleProjDrefImplicitLod %image, %coord, %dref :\n !spirv.sampled_image>,\n vector<4xf16>, f32 -> f32\n ```", "operands": [ { "name": "sampled_image", "type": "SPIRV_AnySampledImage" }, { "name": "coordinate", "type": "AnyTypeOf<[SPIRV_ScalarOrVectorOf, SPIRV_ScalarOrVectorOf]>" }, { "name": "dref", "type": "SPIRV_Float32" }, { "name": "operand_arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[SPIRV_Integer, SPIRV_Float]>" } ], "attributes": [ { "name": "image_operands", "type": "OptionalAttr" } ], "traits": [ { "type": "TypesMatchWith<'sampled_image', 'result', '::llvm::cast<::mlir::spirv::ImageType>(::llvm::cast($_self).getImageType()).getElementType()'>" } ], "assemblyFormat": "$sampled_image `,` $coordinate `,` $dref custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($sampled_image) `,` type($coordinate) `,` type($dref) ( `,` type($operand_arguments)^ )?\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ImageWrite", "summary": "Write a texel to an image without a sampler.", "description": "Image must be an object whose type is OpTypeImage with a Sampled operand\n of 0 or 2. If the Arrayed operand is 1, then additional capabilities may\n be required; e.g., ImageCubeArray, or ImageMSArray. Its Dim operand\n must not be SubpassData.\n\n Coordinate must be a scalar or vector of floating-point type or integer\n type. It contains non-normalized texel coordinates (u[, v] ... [, array\n layer]) as needed by the definition of Image. See the client API\n specification for handling of coordinates outside the image.\n\n Texel is the data to write. It must be a scalar or vector with component\n type the same as Sampled Type of the OpTypeImage (unless that Sampled\n Type is OpTypeVoid).\n\n The Image Format must not be Unknown, unless the\n StorageImageWriteWithoutFormat Capability was declared.\n\n Image Operands encodes what operands follow, as per Image Operands.\n\n \n\n #### Example:\n\n ```mlir\n spirv.ImageWrite %0, %1, %2 : !spirv.image, vector<2xsi32>, vector<4xf32>\n ```", "operands": [ { "name": "image", "type": "SPIRV_AnyImage" }, { "name": "coordinate", "type": "AnyTypeOf<[SPIRV_ScalarOrVectorOf, SPIRV_ScalarOrVectorOf]>" }, { "name": "texel", "type": "AnyTypeOf<[SPIRV_ScalarOrVectorOf, SPIRV_ScalarOrVectorOf]>" }, { "name": "operand_arguments", "type": "Variadic" } ], "attributes": [ { "name": "image_operands", "type": "OptionalAttr" } ], "assemblyFormat": "$image `,` $coordinate `,` $texel custom($image_operands) ( `,` $operand_arguments^ )? attr-dict\n `:` type($image) `,` type($coordinate) `,` type($texel) ( `,` type($operand_arguments)^ )?", "hasCustomAssemblyFormat": true }, { "name": "spirv.IMul", "summary": "Integer multiplication of Operand 1 and Operand 2.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same number of components as Result\n Type. They must have the same component width as Result Type.\n\n The resulting value will equal the low-order N bits of the correct\n result R, where N is the component width and R is computed with enough\n precision to avoid overflow and underflow.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.IMul %0, %1 : i32\n %5 = spirv.IMul %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.InBoundsPtrAccessChain", "summary": "Has the same semantics as OpPtrAccessChain, with the addition that the\n resulting pointer is known to point within the base object.", "description": "\n\n #### Example:\n\n ```mlir\n func @inbounds_ptr_access_chain(%arg0: !spirv.ptr, %arg1 : i64) -> () {\n %0 = spirv.InBoundsPtrAccessChain %arg0[%arg1] : !spirv.ptr, i64 -> !spirv.ptr\n ...\n }\n ```", "operands": [ { "name": "base_ptr", "type": "SPIRV_AnyPtr" }, { "name": "element", "type": "SPIRV_Integer" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$base_ptr `[` $element ($indices^)? `]` attr-dict `:` type($base_ptr) `,` type($element) (`,` type($indices)^)? `->` type($result)" }, { "name": "spirv.INotEqual", "summary": "Integer comparison for inequality.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.INotEqual %0, %1 : i32\n %5 = spirv.INotEqual %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.ControlBarrierArrive", "summary": "See extension SPV_INTEL_split_barrier", "description": "Indicates that an invocation has arrived at a split control barrier. This\n may allow other invocations waiting on the split control barrier to continue\n executing.\n\n When `Execution` is `Workgroup` or larger, behavior is undefined unless all\n invocations within `Execution` execute the same dynamic instance of this\n instruction. When `Execution` is `Subgroup` or `Invocation`, the behavior of\n this instruction in non-uniform control flow is defined by the client API.\n\n If `Semantics` is not `None`, this instruction also serves as the start of a\n memory barrier similar to an `OpMemoryBarrier` instruction with the same\n `Memory` and `Semantics` operands. This allows atomically specifying both a\n control barrier and a memory barrier (that is, without needing two\n instructions). If `Semantics` is `None`, `Memory` is ignored.\n\n #### Example:\n\n ```mlir\n spirv.ControlBarrierArrive \n ```", "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "assemblyFormat": "$execution_scope $memory_scope $memory_semantics attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.ControlBarrierWait", "summary": "See extension SPV_INTEL_split_barrier", "description": "Waits for other invocations of this module to arrive at a split control\n barrier.\n\n When `Execution` is `Workgroup` or larger, behavior is undefined unless all\n invocations within `Execution` execute the same dynamic instance of this\n instruction. When `Execution` is `Subgroup` or `Invocation`, the behavior of\n this instruction in non-uniform control flow is defined by the client API.\n\n If `Semantics` is not `None`, this instruction also serves as the end of a\n memory barrier similar to an `OpMemoryBarrier` instruction with the same\n `Memory` and `Semantics` operands. This ensures that memory accesses issued\n before arriving at the split barrier are observed before memory accesses\n issued after this instruction. This control is ensured only for memory\n accesses issued by this invocation and observed by another invocation\n executing within `Memory` scope. This allows atomically specifying both a\n control barrier and a memory barrier (that is, without needing two\n instructions). If `Semantics` is `None`, `Memory` is ignored.\n\n #### Example:\n\n ```mlir\n spirv.ControlBarrierWait \n ```", "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "assemblyFormat": "$execution_scope $memory_scope $memory_semantics attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.ConvertBF16ToF", "summary": "See extension SPV_INTEL_bfloat16_conversion", "description": "Interpret a 16-bit integer as bfloat16 and convert the value numerically to 32-bit floating point type.\n\n Result Type must be a scalar or vector of floating-point. The component width must be 32 bits.\n\n Bfloat16 Value must be a scalar or vector of integer type, which is interpreted as a bfloat16 type.\n The type must have the same number of components as the Result Type. The component width must be 16 bits.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertBF16ToF %0 : i16 to f32\n %3 = spirv.ConvertBF16ToF %2 : vector<3xi16> to vector<3xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.ConvertFToBF16", "summary": "See extension SPV_INTEL_bfloat16_conversion", "description": "Convert value numerically from 32-bit floating point to bfloat16,\n which is represented as a 16-bit unsigned integer.\n\n Result Type must be a scalar or vector of integer type.\n The component width must be 16 bits. Bit pattern in the Result represents a bfloat16 value.\n\n Float Value must be a scalar or vector of floating-point type.\n It must have the same number of components as Result Type. The component width must be 32 bits.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.ConvertFToBF16 %0 : f32 to i16\n %3 = spirv.ConvertFToBF16 %2 : vector<3xf32> to vector<3xi16>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.MaskedGather", "summary": "Gather values from memory using a vector of pointers and a mask", "description": "Reads values from a vector of pointers gathering them into a result\n vector. Lanes where the mask is false receive the corresponding\n FillEmpty value.\n\n Result Type must be a vector of numerical type.\n\n PtrVector must be a vector of pointers to the scalar element type of\n Result Type. It must have the same number of components as Result Type.\n\n Alignment is the known minimum alignment in bytes of each pointer in\n PtrVector.\n\n Mask must be a vector of boolean type with the same number of components\n as Result Type.\n\n FillEmpty must have the same type as Result Type.\n\n #### Example:\n\n ```mlir\n %result = spirv.INTEL.MaskedGather %ptrs, %alignment, %mask, %fill\n : vector<4x!spirv.ptr>, i32,\n vector<4xi1>, vector<4xf32> -> vector<4xf32>\n ```", "operands": [ { "name": "ptr_vector", "type": "SPIRV_VectorOf" }, { "name": "alignment", "type": "SPIRV_Int32" }, { "name": "mask", "type": "SPIRV_VectorOf" }, { "name": "fill_empty", "type": "SPIRV_VectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_VectorOf" } ], "traits": [ { "type": "AllTypesMatch<['fill_empty', 'result']>" }, { "type": "TypesMatchWith<'ptr_vector', 'result', '[object Object],[object Object],[object Object],[object Object],[object Object]'>" }, { "type": "TypesMatchWith<'result', 'mask', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$ptr_vector `,` $alignment `,` $mask `,` $fill_empty attr-dict `:`\n type($ptr_vector) `,` type($alignment) `,`\n type($mask) `,` type($fill_empty) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.MaskedScatter", "summary": "Scatter values to memory using a vector of pointers and a mask", "description": "Writes values from a vector into memory locations pointed to by a\n vector of pointers. Only lanes where the mask is true are written.\n\n PtrVector must be a vector of pointers to the scalar element type of\n InputVector. It must have the same number of components as InputVector.\n\n Alignment is the known minimum alignment in bytes of each pointer in\n PtrVector.\n\n Mask must be a vector of boolean type with the same number of components\n as InputVector.\n\n InputVector is the vector of values to scatter into memory.\n\n #### Example:\n\n ```mlir\n spirv.INTEL.MaskedScatter %ptrs, %alignment, %mask, %values\n : vector<4x!spirv.ptr>, i32,\n vector<4xi1>, vector<4xf32>\n ```", "operands": [ { "name": "ptr_vector", "type": "SPIRV_VectorOf" }, { "name": "alignment", "type": "SPIRV_Int32" }, { "name": "mask", "type": "SPIRV_VectorOf" }, { "name": "input_vector", "type": "SPIRV_VectorOf" } ], "traits": [ { "type": "TypesMatchWith<'ptr_vector', 'input_vector', '[object Object],[object Object],[object Object],[object Object],[object Object]'>" }, { "type": "TypesMatchWith<'input_vector', 'mask', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$ptr_vector `,` $alignment `,` $mask `,` $input_vector attr-dict `:`\n type($ptr_vector) `,` type($alignment) `,`\n type($mask) `,` type($input_vector)", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.RoundFToTF32", "summary": "See extension SPV_INTEL_tensor_float32_conversion", "description": "Convert value numerically from a 32-bit floating point type to tensor float32,\n with rounding to the nearest even.\n\n Result Type must be a scalar or vector of 32-bit floating-point type.\n The component width must be 32 bits. Bit pattern in the Result represents a tensor float32 value.\n\n Float Value must be a scalar or vector of floating-point type.\n It must have the same number of components as Result Type. The component width must be 32 bits.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.RoundFToTF32 %0 : f32 to f32\n %3 = spirv.RoundFToTF32 %2 : vector<3xf32> to vector<3xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.INTEL.SubgroupBlockRead", "summary": "See extension SPV_INTEL_subgroups", "description": "Reads one or more components of Result data for each invocation in the\n subgroup from the specified Ptr as a block operation.\n\n The data is read strided, so the first value read is:\n Ptr[ SubgroupLocalInvocationId ]\n\n and the second value read is:\n Ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ]\n etc.\n\n Result Type may be a scalar or vector type, and its component type must be\n equal to the type pointed to by Ptr.\n\n The type of Ptr must be a pointer type, and must point to a scalar type.\n\n \n\n ```\n subgroup-block-read-INTEL-op ::= ssa-id `=` `spirv.INTEL.SubgroupBlockRead`\n storage-class ssa_use `:` spirv-element-type\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.INTEL.SubgroupBlockRead \"StorageBuffer\" %ptr : i32\n ```", "operands": [ { "name": "ptr", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "value", "type": "SPIRV_Type" } ], "assemblyFormat": "$ptr attr-dict `:` type($ptr) `->` type($value)" }, { "name": "spirv.INTEL.SubgroupBlockWrite", "summary": "See extension SPV_INTEL_subgroups", "description": "Writes one or more components of Data for each invocation in the subgroup\n from the specified Ptr as a block operation.\n\n The data is written strided, so the first value is written to:\n Ptr[ SubgroupLocalInvocationId ]\n\n and the second value written is:\n Ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ]\n etc.\n\n The type of Ptr must be a pointer type, and must point to a scalar type.\n\n The component type of Data must be equal to the type pointed to by Ptr.\n\n \n\n ```\n subgroup-block-write-INTEL-op ::= ssa-id `=` `spirv.INTEL.SubgroupBlockWrite`\n storage-class ssa_use `,` ssa-use `:` spirv-element-type\n ```\n\n #### Example:\n\n ```mlir\n spirv.INTEL.SubgroupBlockWrite \"StorageBuffer\" %ptr, %value : i32\n ```", "operands": [ { "name": "ptr", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Type" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.IsFinite", "summary": "Result is true if x is an IEEE Finite, otherwise result is false", "description": "Result Type must be a scalar or vector of Boolean type.\n\n x must be a scalar or vector of floating-point type. It must have the\n same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.IsFinite %0: f32\n %3 = spirv.IsFinite %1: vector<4xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.IsInf", "summary": "Result is true if x is an IEEE Inf, otherwise result is false", "description": "Result Type must be a scalar or vector of Boolean type.\n\n x must be a scalar or vector of floating-point type. It must have the\n same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.IsInf %0: f32\n %3 = spirv.IsInf %1: vector<4xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.IsNan", "summary": "Result is true if x is an IEEE NaN, otherwise result is false.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n x must be a scalar or vector of floating-point type. It must have the\n same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.IsNan %0: f32\n %3 = spirv.IsNan %1: vector<4xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.IsNormal", "summary": "Result is true if x is an IEEE normal number, otherwise result is false", "description": "Result Type must be a scalar or vector of Boolean type.\n\n x must be a scalar or vector of floating-point type. It must have the\n same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.IsNormal %0: f32\n %3 = spirv.IsNormal %1: vector<4xf32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.ISub", "summary": "Integer subtraction of Operand 2 from Operand 1.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same number of components as Result\n Type. They must have the same component width as Result Type.\n\n The resulting value will equal the low-order N bits of the correct\n result R, where N is the component width and R is computed with enough\n precision to avoid overflow and underflow.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.ISub %0, %1 : i32\n %5 = spirv.ISub %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ISubBorrow", "summary": "Result is the unsigned integer subtraction of Operand 2 from Operand 1,\n and what it needed to borrow.", "description": "Result Type must be from OpTypeStruct. The struct must have two\n members, and the two members must be the same type. The member type\n must be a scalar or vector of integer type, whose Signedness operand is\n 0.\n\n Operand 1 and Operand 2 must have the same type as the members of Result\n Type. These are consumed as unsigned integers.\n\n Results are computed per component.\n\n Member 0 of the result gets the low-order bits (full component width) of\n the subtraction. That is, if Operand 1 is larger than Operand 2, member\n 0 gets the full value of the subtraction; if Operand 2 is larger than\n Operand 1, member 0 gets 2w + Operand 1 - Operand 2, where w is the\n component width.\n\n Member 1 of the result gets 0 if Operand 1 ≥ Operand 2, and gets 1\n otherwise.\n\n \n\n #### Example:\n\n ```mlir\n %2 = spirv.ISubBorrow %0, %1 : !spirv.struct<(i32, i32)>\n %2 = spirv.ISubBorrow %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_AnyStruct" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.AssumeTrue", "summary": "TBD", "description": "\n\n #### Example:\n\n ```mlir\n spirv.KHR.AssumeTrue %arg\n ```", "operands": [ { "name": "condition", "type": "SPIRV_Bool" } ], "assemblyFormat": "$condition attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.CooperativeMatrixLength", "summary": "Queries the number of cooperative matrix components", "description": "Number of components of a cooperative matrix type accessible to each\n invocation when treated as a composite.\n\n The type attribute must be a cooperative matrix type.\n\n #### Example:\n\n ```\n %0 = spirv.KHR.CooperativeMatrixLength :\n !spirv.coopmatrix<8x16xi32, Subgroup, MatrixA>\n ```", "results": [ { "name": "result", "type": "SPIRV_Int32" } ], "attributes": [ { "name": "cooperative_matrix_type", "type": "TypeAttrOf" } ], "assemblyFormat": "attr-dict `:` $cooperative_matrix_type", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.CooperativeMatrixLoad", "summary": "Loads a cooperative matrix through a pointer", "description": "Load a cooperative matrix through a pointer.\n\n Result Type is the type of the loaded object. It must be a cooperative\n matrix type.\n\n Pointer is a pointer. Its type must be an OpTypePointer whose Type operand is\n a scalar or vector type. If the Shader capability was declared, Pointer must\n point into an array and any ArrayStride decoration on Pointer is ignored.\n\n MemoryLayout specifies how matrix elements are laid out in memory. It must\n come from a 32-bit integer constant instruction whose value corresponds to a\n Cooperative Matrix Layout. See the Cooperative Matrix Layout table for a\n description of the layouts and detailed layout-specific rules.\n\n Stride further qualifies how matrix elements are laid out in memory. It must\n be a scalar integer type and its exact semantics depend on MemoryLayout.\n\n Memory Operand must be a Memory Operand literal. If not present, it is the\n same as specifying None.\n\n NOTE: In earlier versions of the SPIR-V spec, 'Memory Operand' was known\n as 'Memory Access'.\n\n For a given dynamic instance of this instruction, all operands of this\n instruction must be the same for all invocations in a given scope instance\n (where the scope is the scope the cooperative matrix type was created with).\n All invocations in a given scope instance must be active or all must be\n inactive.\n\n TODO: In the SPIR-V spec, `stride` is an optional argument. We should also\n support this optionality in the SPIR-V dialect.\n\n #### Example:\n\n ```\n %0 = spirv.KHR.CooperativeMatrixLoad %ptr, %stride, \n : !spirv.ptr, i32\n -> !spirv.KHR.coopmatrix<16x8xi32, Workgroup, MatrixA>\n\n %1 = spirv.KHR.CooperativeMatrixLoad %ptr, %stride, , \n : !spirv.ptr, i64\n -> !spirv.KHR.coopmatrix<8x8xf32, Subgroup, MatrixAcc>\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "stride", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_AnyCooperativeMatrix" } ], "attributes": [ { "name": "matrix_layout", "type": "SPIRV_KHR_CooperativeMatrixLayoutAttr{RowMajor|ColumnMajor}" }, { "name": "memory_operand", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$pointer `,` $stride `,` $matrix_layout ( `,` $memory_operand^ )? ( `,` $alignment^ )? attr-dict `:`\n type(operands) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.CooperativeMatrixMulAdd", "summary": "Returns the result of `(A x B) + C` of matrices A, B, and C", "description": "Linear-algebraic matrix multiply of A by B and then component-wise add C.\n The order of the operations is implementation-dependent. The internal\n precision of floating-point operations is defined by the client API. Integer\n operations used in the multiplication of A by B are performed at the\n precision of the Result Type and the resulting value will equal the\n low-order N bits of the correct result R, where N is the result width and R\n is computed with enough precision to avoid overflow and underflow if the\n SaturatingAccumulation Cooperative Matrix Operand is not present. If the\n SaturatingAccumulation Cooperative Matrix Operand is present and overflow or\n underflow occurs as part of calculating that intermediate result, the result\n of the instruction is undefined. Integer additions of the elements of that\n intermediate result with those of C are performed at the precision of Result\n Type, are exact, and are saturating if the SaturatingAccumulation\n Cooperative Matrix Operand is present, with the signedness of the saturation\n being that of the components of Result Type. If the SaturatingAccumulation\n Cooperative Matrix Operand is not present then the resulting value will\n equal the low-order N bits of the correct result R, where N is the result\n width and R is computed with enough precision to avoid overflow and\n underflow.\n\n Result Type must be a cooperative matrix type with M rows and N columns\n whose Use must be MatrixAccumulatorKHR.\n\n A is a cooperative matrix with M rows and K columns whose Use must be\n MatrixAKHR.\n\n B is a cooperative matrix with K rows and N columns whose Use must be\n MatrixBKHR.\n\n C is a cooperative matrix with M rows and N columns whose Use must be\n MatrixAccumulatorKHR.\n\n The values of M, N, and K must be consistent across the result and operands.\n This is referred to as an MxNxK matrix multiply.\n\n A, B, C, and Result Type must have the same scope, and this defines the\n scope of the operation. A, B, C, and Result Type need not necessarily have\n the same component type, this is defined by the client API.\n\n If the Component Type of any matrix operand is an integer type, then its\n components are treated as signed if the Matrix{A,B,C,Result}SignedComponents\n Cooperative Matrix Operand is present and are treated as unsigned otherwise.\n\n Cooperative Matrix Operands is an optional Cooperative Matrix Operand\n literal. If not present, it is the same as specifying the Cooperative Matrix\n Operand None.\n\n For a given dynamic instance of this instruction, all invocations in a given\n scope instance must be active or all must be inactive (where the scope is\n the scope of the operation).\n\n ``` {.ebnf}\n cooperative-matrixmuladd-op ::= ssa-id `=` `spirv.KHR.CooperativeMatrixMulAdd`\n ssa-use `,` ssa-use `,` ssa-use\n (`<` matrix-operands `>`)? `:`\n a-cooperative-matrix-type `,`\n b-cooperative-matrix-type `->`\n result-cooperative-matrix-type\n ```\n\n #### Example:\n\n ```\n %0 = spirv.KHR.CooperativeMatrixMulAdd %matA, %matB, %matC :\n !spirv.coopmatrix<4x4xf32, Subgroup, MatrixA>,\n !spirv.coopmatrix<4x4xf32, Subgroup, MatrixB> ->\n !spirv.coopmatrix<4x4xf32, Subgroup, MatrixAcc>\n\n %1 = spirv.KHR.CooperativeMatrixMulAdd %matA, %matB, %matC, :\n !spirv.coopmatrix<8x16xi32, Subgroup, MatrixA>,\n !spirv.coopmatrix<16x4xi32, Subgroup, MatrixB> ->\n !spirv.coopmatrix<8x4xi32, Subgroup, MatrixAcc>\n ```", "operands": [ { "name": "a", "type": "SPIRV_AnyCooperativeMatrix" }, { "name": "b", "type": "SPIRV_AnyCooperativeMatrix" }, { "name": "c", "type": "SPIRV_AnyCooperativeMatrix" } ], "results": [ { "name": "result", "type": "SPIRV_AnyCooperativeMatrix" } ], "attributes": [ { "name": "matrix_operands", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['c', 'result']>" } ], "assemblyFormat": "$a `,` $b `,` $c ( `,` $matrix_operands^ )? attr-dict `:`\n type($a) `,` type($b) `->` type($c)", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.CooperativeMatrixStore", "summary": "Stores a cooperative matrix through a pointer", "description": "Store a cooperative matrix through a pointer.\n Pointer is a pointer. Its type must be an OpTypePointer whose Type operand\n is a scalar or vector type. If the Shader capability was declared, Pointer\n must point into an array and any ArrayStride decoration on Pointer is\n ignored.\n\n Object is the object to store. Its type must be an\n OpTypeCooperativeMatrixKHR.\n\n MemoryLayout specifies how matrix elements are laid out in memory. It must\n come from a 32-bit integer constant instruction whose value corresponds to a\n Cooperative Matrix Layout. See the Cooperative Matrix Layout table for a\n description of the layouts and detailed layout-specific rules.\n\n Stride further qualifies how matrix elements are laid out in memory. It must\n be a scalar integer type and its exact semantics depend on MemoryLayout.\n\n Memory Operand must be a Memory Operand literal. If not present, it is the\n same as specifying None.\n\n NOTE: In earlier versions of the SPIR-V spec, 'Memory Operand' was known\n as 'Memory Access'.\n\n For a given dynamic instance of this instruction, all operands of this\n instruction must be the same for all invocations in a given scope instance\n (where the scope is the scope the cooperative matrix type was created with).\n All invocations in a given scope instance must be active or all must be\n inactive.\n\n TODO: In the SPIR-V spec, `stride` is an optional argument. We should also\n support this optionality in the SPIR-V dialect.\n\n #### Example:\n\n ```\n spirv.KHR.CooperativeMatrixStore %ptr, %obj, %stride, :\n !spirv.ptr, !spirv.coopmatrix<16x8xi32, Workgroup, MatrixA>, i32\n\n spirv.KHR.CooperativeMatrixStore %ptr, %obj, %stride, , :\n !spirv.ptr, !spirv.coopmatrix<8x8xf32, Subgroup, MatrixAcc>, i64\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" }, { "name": "object", "type": "SPIRV_AnyCooperativeMatrix" }, { "name": "stride", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "matrix_layout", "type": "SPIRV_KHR_CooperativeMatrixLayoutAttr{RowMajor|ColumnMajor}" }, { "name": "memory_operand", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$pointer `,` $object `,` $stride `,` $matrix_layout ( `,` $memory_operand^ )? ( `,` $alignment^ )? attr-dict `:`\n type(operands)", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.Expect", "summary": "Provides a hint to the optimizer that the value is likely to equal the expected value.", "description": "Result Type must be a scalar or vector of integer type or Boolean type.\n\n Value and Expected Value must be of Result Type. Result is the same as\n Value.\n\n \n\n #### Example:\n\n ```mlir\n %2 = spirv.KHR.Expect %0, %1 : i32\n %5 = spirv.KHR.Expect %3, %4 : vector<4xi1>\n ```", "operands": [ { "name": "value", "type": "SPIRV_ScalarOrVectorOf>" }, { "name": "expectedValue", "type": "SPIRV_ScalarOrVectorOf>" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf>" } ], "traits": [ { "type": "AllTypesMatch<['value', 'expectedValue', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.GroupFMul", "summary": "A floating-point multiplication group operation specified for all values of\n 'X' specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n 'Execution' reach this point of execution.\n\n Behavior is undefined unless all invocations within 'Execution' execute the\n same dynamic instance of this instruction.\n\n 'Result Type' must be a scalar or vector of floating-point type.\n\n 'Execution' is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for 'Operation' is 1.\n\n The type of 'X' must be the same as 'Result Type'.\n\n\n #### Example:\n\n ```mlir\n %0 = spirv.KHR.GroupFMul %value : f32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.GroupIMul", "summary": "An integer multiplication group operation specified for all values of 'X'\n specified by invocations in the group.", "description": "Behavior is undefined if not all invocations of this module within\n 'Execution' reach this point of execution.\n\n Behavior is undefined unless all invocations within 'Execution' execute the\n same dynamic instance of this instruction.\n\n 'Result Type' must be a scalar or vector of integer type.\n\n 'Execution' is a Scope. It must be either Workgroup or Subgroup.\n\n The identity I for 'Operation' is 1.\n\n The type of 'X' must be the same as 'Result Type'.\n\n #### Example:\n\n ```mlir\n %0 = spirv.KHR.GroupIMul %value : i32\n ```", "operands": [ { "name": "x", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "attributes": [ { "name": "execution_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "group_operation", "type": "SPIRV_GroupOperationAttr{Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV}" } ], "traits": [ { "type": "AllTypesMatch<['x', 'result']>" } ], "assemblyFormat": "$execution_scope $group_operation operands attr-dict `:` type($x)", "hasCustomAssemblyFormat": true }, { "name": "spirv.KHR.SubgroupBallot", "summary": "See extension SPV_KHR_shader_ballot", "description": "Computes a bitfield value combining the Predicate value from all invocations\n in the current Subgroup that execute the same dynamic instance of this\n instruction. The bit is set to one if the corresponding invocation is active\n and the predicate is evaluated to true; otherwise, it is set to zero.\n\n Predicate must be a Boolean type.\n\n Result Type must be a 4 component vector of 32 bit integer types.\n\n Result is a set of bitfields where the first invocation is represented in bit\n 0 of the first vector component and the last (up to SubgroupSize) is the\n higher bit number of the last bitmask needed to represent all bits of the\n subgroup invocations.\n\n \n\n ```\n subgroup-ballot-op ::= ssa-id `=` `spirv.KHR.SubgroupBallot`\n ssa-use `:` `vector` `<` 4 `x` `i32` `>`\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.KHR.SubgroupBallot %predicate : vector<4xi32>\n ```", "operands": [ { "name": "predicate", "type": "SPIRV_Bool" } ], "results": [ { "name": "result", "type": "SPIRV_Int32Vec4" } ], "assemblyFormat": "$predicate attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Kill", "summary": "Deprecated (use OpTerminateInvocation or OpDemoteToHelperInvocation).", "description": "Fragment-shader discard.\n\n Ceases all further processing in any invocation that executes it: Only\n instructions these invocations executed before OpKill have observable\n side effects. If this instruction is executed in non-uniform control\n flow, all subsequent control flow is non-uniform (for invocations that\n continue to execute).\n\n This instruction must be the last instruction in a block.\n\n This instruction is only valid in the Fragment Execution Model.\n\n \n\n #### Example:\n\n ```mlir\n spirv.Kill\n ```", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.Load", "summary": "Load through a pointer.", "description": "Result Type is the type of the loaded object. It must be a type with\n fixed size; i.e., it cannot be, nor include, any OpTypeRuntimeArray\n types.\n\n Pointer is the pointer to load through. Its type must be an\n OpTypePointer whose Type operand is the same as Result Type.\n\n If present, any Memory Operands must begin with a memory operand\n literal. If not present, it is the same as specifying the memory operand\n None.\n\n \n\n ```\n memory-access ::= `\"None\"` | `\"Volatile\"` | `\"Aligned\", ` integer-literal\n | `\"NonTemporal\"`\n\n load-op ::= ssa-id ` = spirv.Load ` storage-class ssa-use\n (`[` memory-access `]`)? ` : ` spirv-element-type\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.Variable : !spirv.ptr\n %1 = spirv.Load \"Function\" %0 : f32\n %2 = spirv.Load \"Function\" %0 [\"Volatile\"] : f32\n %3 = spirv.Load \"Function\" %0 [\"Aligned\", 4] : f32\n ```", "operands": [ { "name": "ptr", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "value", "type": "SPIRV_Type" } ], "attributes": [ { "name": "memory_access", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.LogicalAnd", "summary": "Result is true if both Operand 1 and Operand 2 are true. Result is false\n if either Operand 1 or Operand 2 are false.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 must be the same as Result Type.\n\n The type of Operand 2 must be the same as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.LogicalAnd %0, %1 : i1\n %2 = spirv.LogicalAnd %0, %1 : vector<4xi1>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.LogicalEqual", "summary": "Result is true if Operand 1 and Operand 2 have the same value. Result is\n false if Operand 1 and Operand 2 have different values.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 must be the same as Result Type.\n\n The type of Operand 2 must be the same as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.LogicalEqual %0, %1 : i1\n %2 = spirv.LogicalEqual %0, %1 : vector<4xi1>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.LogicalNot", "summary": "Result is true if Operand is false. Result is false if Operand is true.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand must be the same as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.LogicalNot %0 : i1\n %2 = spirv.LogicalNot %0 : vector<4xi1>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.LogicalNotEqual", "summary": "Result is true if Operand 1 and Operand 2 have different values. Result\n is false if Operand 1 and Operand 2 have the same value.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 must be the same as Result Type.\n\n The type of Operand 2 must be the same as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.LogicalNotEqual %0, %1 : i1\n %2 = spirv.LogicalNotEqual %0, %1 : vector<4xi1>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.LogicalOr", "summary": "Result is true if either Operand 1 or Operand 2 is true. Result is false\n if both Operand 1 and Operand 2 are false.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 must be the same as Result Type.\n\n The type of Operand 2 must be the same as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.LogicalOr %0, %1 : i1\n %2 = spirv.LogicalOr %0, %1 : vector<4xi1>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.MatrixTimesMatrix", "summary": "Linear-algebraic multiply of LeftMatrix X RightMatrix.", "description": "Result Type must be an OpTypeMatrix whose Column Type is a vector of\n floating-point type.\n\n LeftMatrix must be a matrix whose Column Type is the same as the Column\n Type in Result Type.\n\n RightMatrix must be a matrix with the same Component Type as the\n Component Type in Result Type. Its number of columns must equal the\n number of columns in Result Type. Its columns must have the same number\n of components as the number of columns in LeftMatrix.\n\n #### Example:\n\n ```mlir\n %0 = spirv.MatrixTimesMatrix %matrix_1, %matrix_2 :\n !spirv.matrix<4 x vector<3xf32>>, !spirv.matrix<3 x vector<4xf32>> ->\n !spirv.matrix<4 x vector<4xf32>>\n ```", "operands": [ { "name": "leftmatrix", "type": "SPIRV_AnyMatrix" }, { "name": "rightmatrix", "type": "SPIRV_AnyMatrix" } ], "results": [ { "name": "result", "type": "SPIRV_AnyMatrix" } ], "assemblyFormat": "operands attr-dict `:` type($leftmatrix) `,` type($rightmatrix) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.MatrixTimesScalar", "summary": "Scale a floating-point matrix.", "description": "Result Type must be a matrix type with a float component type.\n\n The type of Matrix must be the same as Result Type. Each component in\n each column in Matrix is multiplied by Scalar.\n\n Scalar must have the same type as the Component Type in Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.MatrixTimesScalar %matrix, %scalar :\n !spirv.matrix<3 x vector<3xf32>>, f32 -> !spirv.matrix<3 x vector<3xf32>>\n\n ```", "operands": [ { "name": "matrix", "type": "SPIRV_MatrixOrCoopMatrixOf" }, { "name": "scalar", "type": "SPIRV_Float" } ], "results": [ { "name": "result", "type": "SPIRV_MatrixOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['matrix', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($matrix) `,` type($scalar)", "hasCustomAssemblyFormat": true }, { "name": "spirv.MatrixTimesVector", "summary": "Linear-algebraic Matrix X Vector.", "description": "Result Type must be a vector of floating-point type.\n\n Matrix must be an OpTypeMatrix whose Column Type is Result Type.\n\n Vector must be a vector with the same Component Type as the Component Type in Result Type. Its number of components must equal the number of columns in Matrix.\n\n #### Example:\n\n ```mlir\n %0 = spirv.MatrixTimesVector %matrix, %vector : \n !spirv.matrix<3 x vector<2xf32>>, vector<3xf32> -> vector<2xf32>\n ```", "operands": [ { "name": "matrix", "type": "SPIRV_MatrixOf" }, { "name": "vector", "type": "SPIRV_VectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_VectorOf" } ], "assemblyFormat": "operands attr-dict `:` type($matrix) `,` type($vector) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.MemoryBarrier", "summary": "Control the order that memory accesses are observed.", "description": "Ensures that memory accesses issued before this instruction will be\n observed before memory accesses issued after this instruction. This\n control is ensured only for memory accesses issued by this invocation\n and observed by another invocation executing within Memory scope. If the\n Vulkan memory model is declared, this ordering only applies to memory\n accesses that use the NonPrivatePointer memory operand or\n NonPrivateTexel image operand.\n\n Semantics declares what kind of memory is being controlled and what kind\n of control to apply.\n\n To execute both a memory barrier and a control barrier, see\n OpControlBarrier.\n\n #### Example:\n\n ```mlir\n spirv.MemoryBarrier \"Device\", \"Acquire|UniformMemory\"\n ```", "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "assemblyFormat": "$memory_scope `,` $memory_semantics attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.MemoryNamedBarrier", "summary": "Wait on a named barrier and apply a memory barrier.", "description": "Wait for other invocations of this module to reach the current point\n of execution.\n\n Named Barrier must be the type OpTypeNamedBarrier.\n\n If Semantics is not None, this instruction also serves as an\n OpMemoryBarrier instruction, and also performs and adheres to the\n description and semantics of an OpMemoryBarrier instruction with the\n same Memory and Semantics operands. This allows atomically specifying\n both a control barrier and a memory barrier (that is, without needing\n two instructions). If Semantics is None, Memory is ignored.\n\n Capability: NamedBarrier\n\n Missing before version 1.1.\n\n #### Example:\n\n ```mlir\n spirv.MemoryNamedBarrier %nb, , \n : !spirv.named_barrier\n ```", "operands": [ { "name": "named_barrier", "type": "SPIRV_AnyNamedBarrier" } ], "attributes": [ { "name": "memory_scope", "type": "SPIRV_ScopeAttr{CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR}" }, { "name": "memory_semantics", "type": "SPIRV_MemorySemanticsAttr{None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile}" } ], "assemblyFormat": "$named_barrier `,` $memory_scope `,` $memory_semantics attr-dict\n `:` type($named_barrier)", "hasCustomAssemblyFormat": true }, { "name": "spirv.mlir.addressof", "summary": "Get the address of a global variable.", "description": "Variables in module scope are defined using symbol names. This op generates\n an SSA value that can be used to refer to the symbol within function scope\n for use in ops that expect an SSA value. This operation has no corresponding\n SPIR-V instruction; it's merely used for modelling purpose in the SPIR-V\n dialect. Since variables in module scope in SPIR-V dialect are of pointer\n type, this op returns a pointer type as well, and the type is the same as\n the variable referenced.\n\n #### Example:\n\n ```mlir\n %0 = spirv.mlir.addressof @global_var : !spirv.ptr\n ```", "results": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "attributes": [ { "name": "variable", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$variable attr-dict `:` type($pointer)", "hasCustomAssemblyFormat": true }, { "name": "spirv.mlir.loop", "summary": "Define a structured loop.", "description": "SPIR-V can explicitly declare structured control-flow constructs using merge\n instructions. These explicitly declare a header block before the control\n flow diverges and a merge block where control flow subsequently converges.\n These blocks delimit constructs that must nest, and can only be entered\n and exited in structured ways. See \"2.11. Structured Control Flow\" of the\n SPIR-V spec for more details.\n\n Instead of having a `spirv.LoopMerge` op to directly model loop merge\n instruction for indicating the merge and continue target, we use regions\n to delimit the boundary of the loop: the merge target is the next op\n following the `spirv.mlir.loop` op and the continue target is the block that\n has a back-edge pointing to the entry block inside the `spirv.mlir.loop`'s region.\n This way it's easier to discover all blocks belonging to a construct and\n it plays nicer with the MLIR system.\n\n The `spirv.mlir.loop` region should contain at least four blocks: one entry block,\n one loop header block, one loop continue block, one loop merge block.\n The entry block should be the first block and it should jump to the loop\n header block, which is the second block. The loop merge block should be the\n last block. The merge block should only contain a `spirv.mlir.merge` op.\n The continue block should be the second to last block and it should have a\n branch to the loop header block. The loop continue block should be the only\n block, except the entry block, branching to the header block.\n\n Values defined inside the loop regions cannot be directly used\n outside of them; however, the loop region can yield values. These values are\n yielded using a `spirv.mlir.merge` op and returned as a result of the loop op.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "loop_control", "type": "SPIRV_LoopControlAttr{None|Unroll|DontUnroll|DependencyInfinite|DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount|InitiationIntervalINTEL|LoopCoalesceINTEL|MaxConcurrencyINTEL|MaxInterleavingINTEL|DependencyArrayINTEL|SpeculatedIterationsINTEL|PipelineEnableINTEL|NoFusionINTEL}" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.mlir.merge", "summary": "A special terminator for merging a structured selection/loop.", "description": "We use `spirv.mlir.selection`/`spirv.mlir.loop` for modelling structured selection/loop.\n This op is a terminator used inside their regions to mean jumping to the\n merge point, which is the next op following the `spirv.mlir.selection` or\n `spirv.mlir.loop` op. This op does not have a corresponding instruction in the\n SPIR-V binary format; it's solely for structural purpose.\n\n The instruction is also used to yield values from inside the selection/loop region\n to the outside, as values that were sunk into the region cannot otherwise escape it.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "spirv.mlir.referenceof", "summary": "Reference a specialization constant.", "description": "Specialization constants in module scope are defined using symbol names.\n This op generates an SSA value that can be used to refer to the symbol\n within function scope for use in ops that expect an SSA value.\n This operation has no corresponding SPIR-V instruction; it's merely used\n for modelling purpose in the SPIR-V dialect. This op's return type is\n the same as the specialization constant.\n\n #### Example:\n\n ```mlir\n %0 = spirv.mlir.referenceof @spec_const : f32\n ```\n\n TODO Add support for composite specialization constants.", "results": [ { "name": "reference", "type": "SPIRV_Type" } ], "attributes": [ { "name": "spec_const", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$spec_const attr-dict `:` type($reference)", "hasCustomAssemblyFormat": true }, { "name": "spirv.mlir.selection", "summary": "Define a structured selection.", "description": "SPIR-V can explicitly declare structured control-flow constructs using merge\n instructions. These explicitly declare a header block before the control\n flow diverges and a merge block where control flow subsequently converges.\n These blocks delimit constructs that must nest, and can only be entered\n and exited in structured ways. See \"2.11. Structured Control Flow\" of the\n SPIR-V spec for more details.\n\n Instead of having a `spirv.SelectionMerge` op to directly model selection\n merge instruction for indicating the merge target, we use regions to delimit\n the boundary of the selection: the merge target is the next op following the\n `spirv.mlir.selection` op. This way it's easier to discover all blocks belonging to\n the selection and it plays nicer with the MLIR system.\n\n The `spirv.mlir.selection` region should contain at least two blocks: one selection\n header block, and one selection merge. The selection header block should be\n the first block. The selection merge block should be the last block.\n The merge block should only contain a `spirv.mlir.merge` op.\n\n Values defined inside the selection regions cannot be directly used\n outside of them; however, the selection region can yield values. These values are\n yielded using a `spirv.mlir.merge` op and returned as a result of the selection op.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "selection_control", "type": "SPIRV_SelectionControlAttr{None|Flatten|DontFlatten}" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.mlir.yield", "summary": "Yields the result computed in `spirv.SpecConstantOperation`'s\n region back to the parent op.", "description": "This op is a special terminator whose only purpose is to terminate\n an `spirv.SpecConstantOperation`'s enclosed region. It accepts a\n single operand produced by the preceeding (and only other) instruction\n in its parent block (see SPIRV_SpecConstantOperation for further\n details). This op has no corresponding SPIR-V instruction.\n\n #### Example:\n\n ```mlir\n %0 = ... (some op supported by SPIR-V OpSpecConstantOp)\n spirv.mlir.yield %0\n ```", "operands": [ { "name": "operand", "type": "AnyType" } ], "assemblyFormat": "attr-dict $operand `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "spirv.module", "summary": "The top-level op that defines a SPIR-V module", "description": "This op defines a SPIR-V module using a MLIR region. The region contains\n one block. Module-level operations, including functions definitions,\n are all placed in this block.\n\n Using an op with a region to define a SPIR-V module enables \"embedding\"\n SPIR-V modules in other dialects in a clean manner: this op guarantees\n the validity and serializability of a SPIR-V module and thus serves as\n a clear-cut boundary.\n\n This op takes no operands and generates no results. This op should not\n implicitly capture values from the enclosing environment.\n\n This op has only one region, which only contains one block. The block\n has no terminator.\n\n \n\n ```\n addressing-model ::= `Logical` | `Physical32` | `Physical64` | ...\n memory-model ::= `Simple` | `GLSL450` | `OpenCL` | `Vulkan` | ...\n spv-module-op ::= `spirv.module` addressing-model memory-model\n (requires spirv-vce-attribute)?\n (`attributes` attribute-dict)?\n region\n ```\n\n #### Example:\n\n ```mlir\n spirv.module Logical GLSL450 {}\n\n spirv.module Logical Vulkan\n requires #spirv.vce\n attributes { some_additional_attr = ... } {\n spirv.func @do_nothing() -> () {\n spirv.Return\n }\n }\n ```", "attributes": [ { "name": "addressing_model", "type": "SPIRV_AddressingModelAttr{Logical|Physical32|Physical64|PhysicalStorageBuffer64}" }, { "name": "memory_model", "type": "SPIRV_MemoryModelAttr{Simple|GLSL450|OpenCL|Vulkan}" }, { "name": "vce_triple", "type": "OptionalAttr" }, { "name": "sym_name", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.NamedBarrierInitialize", "summary": "Initialize a named barrier with a subgroup count.", "description": "Declare a new named-barrier object.\n\n Result Type must be the type OpTypeNamedBarrier.\n\n Subgroup Count must be a 32-bit integer type scalar representing the\n number of subgroups that must reach the current point of execution.\n\n Capability: NamedBarrier\n\n Missing before version 1.1.\n\n #### Example:\n\n ```mlir\n %nb = spirv.NamedBarrierInitialize %subgroup_count : i32 -> !spirv.named_barrier\n ```", "operands": [ { "name": "subgroup_count", "type": "SPIRV_Int32" } ], "results": [ { "name": "result", "type": "SPIRV_AnyNamedBarrier" } ], "assemblyFormat": "$subgroup_count attr-dict `:` type($subgroup_count) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Not", "summary": "Complement the bits of Operand.", "description": "Results are computed per component, and within each component, per bit.\n\n Result Type must be a scalar or vector of integer type.\n\n Operand's type must be a scalar or vector of integer type. It must\n have the same number of components as Result Type. The component width\n must equal the component width in Result Type.\n\n #### Example:\n\n ```mlir\n %2 = spirv.Not %0 : i32\n %3 = spirv.Not %1 : vector<4xi32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.Ordered", "summary": "Result is true if both x == x and y == y are true, where IEEE comparison\n is used, otherwise result is false.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n x must be a scalar or vector of floating-point type. It must have the\n same number of components as Result Type.\n\n y must have the same type as x.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.Ordered %0, %1 : f32\n %5 = spirv.Ordered %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.OuterProduct", "summary": "Linear-algebraic outer product of vector1 and vector2.", "description": "Result Type must be a Matrix Type whose Column Type is a vector of\n floating-point type.\n\n Vector1 must have the same type as the Column Type in Result Type.\n\n Vector2 must be a vector with the same Component Type as the Component\n Type in Result Type. Its number of components must equal the number of\n columns in Result Type.\n\n #### Example:\n\n ```mlir\n %0 = spirv.OuterProduct %vector1, %vector2 :\n vector<3xf32>, vector<2xf32> -> !spirv.matrix<2 x vector<3xf32>>\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_VectorOf" }, { "name": "vector2", "type": "SPIRV_VectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_MatrixOf" } ], "assemblyFormat": "operands attr-dict `:` type($vector1) `,` type($vector2) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.PtrAccessChain", "summary": "Has the same semantics as OpAccessChain, with the addition of the\n Element operand.", "description": "Element is used to do an initial dereference of Base: Base is treated as\n the address of an element in an array, and a new element address is\n computed from Base and Element to become the OpAccessChain Base to\n dereference as per OpAccessChain. This computed Base has the same type\n as the originating Base.\n\n To compute the new element address, Element is treated as a signed count\n of elements E, relative to the original Base element B, and the address\n of element B + E is computed using enough precision to avoid overflow\n and underflow. For objects in the Uniform, StorageBuffer, or\n PushConstant storage classes, the element's address or location is\n calculated using a stride, which will be the Base-type's Array Stride if\n the Base type is decorated with ArrayStride. For all other objects, the\n implementation calculates the element's address or location.\n\n With one exception, undefined behavior results when B + E is not an\n element in the same array (same innermost array, if array types are\n nested) as B. The exception being when B + E = L, where L is the length\n of the array: the address computation for element L is done with the\n same stride as any other B + E computation that stays within the array.\n\n Note: If Base is typed to be a pointer to an array and the desired\n operation is to select an element of that array, OpAccessChain should be\n directly used, as its first Index selects the array element.\n\n \n\n #### Example:\n\n ```mlir\n func @ptr_access_chain(%arg0: !spirv.ptr, %arg1 : i64) -> () {\n %0 = spirv.PtrAccessChain %arg0[%arg1] : !spirv.ptr, i64 -> !spirv.ptr\n ...\n }\n ```", "operands": [ { "name": "base_ptr", "type": "SPIRV_AnyPtr" }, { "name": "element", "type": "SPIRV_Integer" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$base_ptr `[` $element ($indices^)? `]` attr-dict `:` type($base_ptr) `,` type($element) (`,` type($indices)^)? `->` type($result)" }, { "name": "spirv.PtrCastToGeneric", "summary": "Convert a pointer’s Storage Class to Generic.", "description": "Result Type must be an OpTypePointer. Its Storage Class must be Generic.\n\n Pointer must point to the Workgroup, CrossWorkgroup, or Function Storage\n Class.\n\n Result Type and Pointer must point to the same type.\n\n \n\n #### Example:\n\n ```mlir\n %1 = spirv.PtrCastToGeneric %0 : !spirv.ptr to\n !spirv.ptr\n ```", "operands": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "results": [ { "name": "result", "type": "SPIRV_AnyPtr" } ], "assemblyFormat": "$pointer attr-dict `:` type($pointer) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Return", "summary": "Return with no value from a function with void return type.", "description": "This instruction must be the last instruction in a block.\n\n #### Example:\n\n ```mlir\n spirv.Return\n ```", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.ReturnValue", "summary": "Return a value from a function.", "description": "Value is the value returned, by copy, and must match the Return Type\n operand of the OpTypeFunction type of the OpFunction body this return\n instruction is in.\n\n This instruction must be the last instruction in a block.\n\n #### Example:\n\n ```mlir\n spirv.ReturnValue %0 : f32\n ```", "operands": [ { "name": "value", "type": "SPIRV_Type" } ], "assemblyFormat": "$value attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SampledImage", "summary": "Create a sampled image, containing both a sampler and an image.", "description": "Result Type must be OpTypeSampledImage whose Image Type is the same as\n the type of the Image operand.\n\n Image must be an object whose type is an OpTypeImage, whose Sampled\n operand is 0 or 1. The Dim operand of the underlying OpTypeImage must\n not be SubpassData. Additionally, starting with version 1.6, the Dim\n operand must not be Buffer.\n\n Sampler must be an object of a type made by OpTypeSampler.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.SampledImage %image, %sampler : !spirv.image, !spirv.sampler -> !spirv.sampled_image>\n ```", "operands": [ { "name": "image", "type": "SPIRV_AnyImage" }, { "name": "sampler", "type": "SPIRV_AnySampler" } ], "results": [ { "name": "result", "type": "SPIRV_AnySampledImage" } ], "traits": [ { "type": "TypesMatchWith<'result', 'image', '::llvm::cast($_self).getImageType()'>" } ], "assemblyFormat": "$image `,` $sampler attr-dict `:` type($image) `,` type($sampler)\n `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SConvert", "summary": "Convert signed width. This is either a truncate or a sign extend.", "description": "Result Type must be a scalar or vector of integer type.\n\n Signed Value must be a scalar or vector of integer type. It must have\n the same number of components as Result Type. The component width\n cannot equal the component width in Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.SConvert %0 : i32 to i64\n %3 = spirv.SConvert %2 : vector<3xi32> to vector<3xi64>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SDiv", "summary": "Signed-integer division of Operand 1 divided by Operand 2.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same number of components as Result\n Type. They must have the same component width as Result Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SDiv %0, %1 : i32\n %5 = spirv.SDiv %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SDot", "summary": "Signed integer dot product of Vector 1 and Vector 2.", "description": "Result Type must be an integer type whose Width must be greater than or\n equal to that of the components of Vector 1 and Vector 2.\n\n Vector 1 and Vector 2 must have the same type.\n\n Vector 1 and Vector 2 must be either 32-bit integers (enabled by the\n DotProductInput4x8BitPacked capability) or vectors of integer type\n (enabled by the DotProductInput4x8Bit or DotProductInputAll capability).\n\n When Vector 1 and Vector 2 are scalar integer types, Packed Vector\n Format must be specified to select how the integers are to be\n interpreted as vectors.\n\n All components of the input vectors are sign-extended to the bit width\n of the result's type. The sign-extended input vectors are then\n multiplied component-wise and all components of the vector resulting\n from the component-wise multiplication are added together. The resulting\n value will equal the low-order N bits of the correct result R, where N\n is the result width and R is computed with enough precision to avoid\n overflow and underflow.\n\n \n\n #### Example:\n\n ```mlir\n %r = spirv.SDot %a, %b, : i32 -> i32\n %r = spirv.SDot %a, %b, : i32 -> i64\n %r = spirv.SDot %a, %b : vector<4xi8> -> i32\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "vector2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" } ], "assemblyFormat": "$vector1 `,` $vector2 ( `,` $format^ )? attr-dict `:`\n type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SDotAccSat", "summary": "Signed integer dot product of Vector 1 and Vector 2 and signed\n saturating addition of the result with Accumulator.", "description": "Result Type must be an integer type whose Width must be greater than or\n equal to that of the components of Vector 1 and Vector 2.\n\n Vector 1 and Vector 2 must have the same type.\n\n Vector 1 and Vector 2 must be either 32-bit integers (enabled by the\n DotProductInput4x8BitPacked capability) or vectors of integer type\n (enabled by the DotProductInput4x8Bit or DotProductInputAll capability).\n\n The type of Accumulator must be the same as Result Type.\n\n When Vector 1 and Vector 2 are scalar integer types, Packed Vector\n Format must be specified to select how the integers are to be\n interpreted as vectors.\n\n All components of the input vectors are sign-extended to the bit width\n of the result's type. The sign-extended input vectors are then\n multiplied component-wise and all components of the vector resulting\n from the component-wise multiplication are added together. Finally, the\n resulting sum is added to the input accumulator. This final addition is\n saturating.\n\n If any of the multiplications or additions, with the exception of the\n final accumulation, overflow or underflow, the result of the instruction\n is undefined.\n\n \n\n #### Example:\n\n ```mlir\n %r = spirv.SDotAccSat %a, %b, %acc, : i32 -> i32\n %r = spirv.SDotAccSat %a, %b, %acc, : i32 -> i64\n %r = spirv.SDotAccSat %a, %b, %acc : vector<4xi8> -> i32\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "vector2", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "accumulator", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" }, { "type": "AllTypesMatch<['accumulator', 'result']>" } ], "assemblyFormat": "$vector1 `,` $vector2 `,` $accumulator ( `,` $format^ )? attr-dict `:`\n type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Select", "summary": "Select between two objects. Before version 1.4, results are only\n computed per component.", "description": "Before version 1.4, Result Type must be a pointer, scalar, or vector.\n\n The types of Object 1 and Object 2 must be the same as Result Type.\n\n Condition must be a scalar or vector of Boolean type.\n\n If Condition is a scalar and true, the result is Object 1. If Condition\n is a scalar and false, the result is Object 2.\n\n If Condition is a vector, Result Type must be a vector with the same\n number of components as Condition and the result is a mix of Object 1\n and Object 2: When a component of Condition is true, the corresponding\n component in the result is taken from Object 1, otherwise it is taken\n from Object 2.\n\n #### Example:\n\n ```mlir\n %3 = spirv.Select %0, %1, %2 : i1, f32\n %3 = spirv.Select %0, %1, %2 : i1, vector<3xi32>\n %3 = spirv.Select %0, %1, %2 : vector<3xi1>, vector<3xf32>\n ```", "operands": [ { "name": "condition", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "true_value", "type": "SPIRV_SelectType" }, { "name": "false_value", "type": "SPIRV_SelectType" } ], "results": [ { "name": "result", "type": "SPIRV_SelectType" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($condition) `,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SGreaterThan", "summary": "Signed-integer comparison if Operand 1 is greater than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SGreaterThan %0, %1 : i32\n %5 = spirv.SGreaterThan %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.SGreaterThanEqual", "summary": "Signed-integer comparison if Operand 1 is greater than or equal to\n Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SGreaterThanEqual %0, %1 : i32\n %5 = spirv.SGreaterThanEqual %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.ShiftLeftLogical", "summary": "Shift the bits in Base left by the number of bits specified in Shift.\n The least-significant bits are zero filled.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of each Base and Shift must be a scalar or vector of integer\n type. Base and Shift must have the same number of components. The\n number of components and bit width of the type of Base must be the same\n as in Result Type.\n\n Shift is treated as unsigned. The result is undefined if Shift is\n greater than or equal to the bit width of the components of Base.\n\n The number of components and bit width of Result Type must match those\n Base type. All types must be integer types.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.ShiftLeftLogical %0, %1 : i32, i16\n %5 = spirv.ShiftLeftLogical %3, %4 : vector<3xi32>, vector<3xi16>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($operand1) `,` type($operand2)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ShiftRightArithmetic", "summary": "Shift the bits in Base right by the number of bits specified in Shift.\n The most-significant bits are filled with the sign bit from Base.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of each Base and Shift must be a scalar or vector of integer\n type. Base and Shift must have the same number of components. The\n number of components and bit width of the type of Base must be the same\n as in Result Type.\n\n Shift is treated as unsigned. The result is undefined if Shift is\n greater than or equal to the bit width of the components of Base.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.ShiftRightArithmetic %0, %1 : i32, i16\n %5 = spirv.ShiftRightArithmetic %3, %4 : vector<3xi32>, vector<3xi16>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($operand1) `,` type($operand2)", "hasCustomAssemblyFormat": true }, { "name": "spirv.ShiftRightLogical", "summary": "Shift the bits in Base right by the number of bits specified in Shift.\n The most-significant bits are zero filled.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of each Base and Shift must be a scalar or vector of integer\n type. Base and Shift must have the same number of components. The\n number of components and bit width of the type of Base must be the same\n as in Result Type.\n\n Shift is consumed as an unsigned integer. The result is undefined if\n Shift is greater than or equal to the bit width of the components of\n Base.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %2 = spirv.ShiftRightLogical %0, %1 : i32, i16\n %5 = spirv.ShiftRightLogical %3, %4 : vector<3xi32>, vector<3xi16>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($operand1) `,` type($operand2)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SLessThan", "summary": "Signed-integer comparison if Operand 1 is less than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SLessThan %0, %1 : i32\n %5 = spirv.SLessThan %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.SLessThanEqual", "summary": "Signed-integer comparison if Operand 1 is less than or equal to Operand\n 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SLessThanEqual %0, %1 : i32\n %5 = spirv.SLessThanEqual %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.SMod", "summary": "Signed remainder operation for the remainder whose sign matches the sign\n of Operand 2.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same number of components as Result\n Type. They must have the same component width as Result Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0. Otherwise, the result is the remainder r of Operand\n 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the\n sign of Operand 2.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SMod %0, %1 : i32\n %5 = spirv.SMod %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SMulExtended", "summary": "Result is the full value of the signed integer multiplication of Operand\n 1 and Operand 2.", "description": "Result Type must be from OpTypeStruct. The struct must have two\n members, and the two members must be the same type. The member type\n must be a scalar or vector of integer type.\n\n Operand 1 and Operand 2 must have the same type as the members of Result\n Type. These are consumed as signed integers.\n\n Results are computed per component.\n\n Member 0 of the result gets the low-order bits of the multiplication.\n\n Member 1 of the result gets the high-order bits of the multiplication.\n\n \n\n #### Example:\n\n ```mlir\n %2 = spirv.SMulExtended %0, %1 : !spirv.struct<(i32, i32)>\n %2 = spirv.SMulExtended %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_AnyStruct" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.SNegate", "summary": "Signed-integer subtract of Operand from zero.", "description": "Result Type must be a scalar or vector of integer type.\n\n Operand's type must be a scalar or vector of integer type. It must\n have the same number of components as Result Type. The component width\n must equal the component width in Result Type.\n\n Results are computed per component.\n\n \n\n #### Example:\n\n ```mlir\n %1 = spirv.SNegate %0 : i32\n %3 = spirv.SNegate %2 : vector<4xi32>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SpecConstant", "summary": "Declare a new integer-type or floating-point-type scalar specialization\n constant.", "description": "This op declares a SPIR-V scalar specialization constant. SPIR-V has\n multiple constant instructions covering different scalar types:\n\n * `OpSpecConstantTrue` and `OpSpecConstantFalse` for boolean constants\n * `OpSpecConstant` for scalar constants\n\n Similar as `spirv.Constant`, this op represents all of the above cases.\n `OpSpecConstantComposite` and `OpSpecConstantOp` are modelled with\n separate ops.\n\n \n\n ```\n spv-spec-constant-op ::= `spirv.SpecConstant` symbol-ref-id\n `spec_id(` integer `)`\n `=` attribute-value (`:` spirv-type)?\n ```\n\n where `spec_id` specifies the SPIR-V SpecId decoration associated with\n the op.\n\n #### Example:\n\n ```mlir\n spirv.SpecConstant @spec_const1 = true\n spirv.SpecConstant @spec_const2 spec_id(5) = 42 : i32\n ```", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "default_value", "type": "TypedAttrInterface" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.SpecConstantComposite", "summary": "Declare a new composite specialization constant.", "description": "This op declares a SPIR-V composite specialization constant. This covers\n the `OpSpecConstantComposite` SPIR-V instruction. Scalar constants are\n covered by `spirv.SpecConstant`.\n\n A constituent of a spec constant composite can be:\n - A symbol referring of another spec constant.\n - The SSA ID of a non-specialization constant (i.e. defined through\n `spirv.SpecConstant`).\n - The SSA ID of a `spirv.Undef`.\n\n ```\n spv-spec-constant-composite-op ::= `spirv.SpecConstantComposite` symbol-ref-id ` (`\n symbol-ref-id (`, ` symbol-ref-id)*\n `) :` composite-type\n ```\n\n where `composite-type` is some non-scalar type that can be represented in the `spv`\n dialect: `spirv.struct`, `spirv.array`, or `vector`.\n\n #### Example:\n\n ```mlir\n spirv.SpecConstant @sc1 = 1 : i32\n spirv.SpecConstant @sc2 = 2.5 : f32\n spirv.SpecConstant @sc3 = 3.5 : f32\n spirv.SpecConstantComposite @scc (@sc1, @sc2, @sc3) : !spirv.struct\n ```\n\n TODO Add support for constituents that are:\n - regular constants.\n - undef.\n - spec constant composite.", "attributes": [ { "name": "type", "type": "TypeAttr" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "constituents", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.SpecConstantOperation", "summary": "Declare a new specialization constant that results from doing an operation.", "description": "This op declares a SPIR-V specialization constant that results from\n doing an operation on other constants (specialization or otherwise).\n\n In the `spv` dialect, this op is modelled as follows:\n\n ```\n spv-spec-constant-operation-op ::= `spirv.SpecConstantOperation` `wraps`\n generic-spirv-op `:` function-type\n ```\n\n In particular, an `spirv.SpecConstantOperation` contains exactly one\n region. In turn, that region, contains exactly 2 instructions:\n - One of SPIR-V's instructions that are allowed within an\n OpSpecConstantOp.\n - An `spirv.mlir.yield` instruction as the terminator.\n\n The following SPIR-V instructions are valid:\n - OpSConvert,\n - OpUConvert,\n - OpFConvert,\n - OpSNegate,\n - OpNot,\n - OpIAdd,\n - OpISub,\n - OpIMul,\n - OpUDiv,\n - OpSDiv,\n - OpUMod,\n - OpSRem,\n - OpSMod\n - OpShiftRightLogical,\n - OpShiftRightArithmetic,\n - OpShiftLeftLogical\n - OpBitwiseOr,\n - OpBitwiseXor,\n - OpBitwiseAnd\n - OpVectorShuffle,\n - OpCompositeExtract,\n - OpCompositeInsert\n - OpLogicalOr,\n - OpLogicalAnd,\n - OpLogicalNot,\n - OpLogicalEqual,\n - OpLogicalNotEqual\n - OpSelect\n - OpIEqual,\n - OpINotEqual\n - OpULessThan,\n - OpSLessThan\n - OpUGreaterThan,\n - OpSGreaterThan\n - OpULessThanEqual,\n - OpSLessThanEqual\n - OpUGreaterThanEqual,\n - OpSGreaterThanEqual\n\n TODO Add capability-specific ops when supported.\n\n #### Example:\n ```mlir\n %0 = spirv.Constant 1: i32\n %1 = spirv.Constant 1: i32\n\n %2 = spirv.SpecConstantOperation wraps \"spirv.IAdd\"(%0, %1) : (i32, i32) -> i32\n ```", "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.SRem", "summary": "Signed remainder operation for the remainder whose sign matches the sign\n of Operand 1.", "description": "Result Type must be a scalar or vector of integer type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same number of components as Result\n Type. They must have the same component width as Result Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0. Otherwise, the result is the remainder r of Operand\n 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the\n sign of Operand 1.\n\n #### Example:\n\n ```mlir\n %4 = spirv.SRem %0, %1 : i32\n %5 = spirv.SRem %2, %3 : vector<4xi32>\n\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Store", "summary": "Store through a pointer.", "description": "Pointer is the pointer to store through. Its type must be an\n OpTypePointer whose Type operand is the same as the type of Object.\n\n Object is the object to store.\n\n If present, any Memory Operands must begin with a memory operand\n literal. If not present, it is the same as specifying the memory operand\n None.\n\n \n\n ```\n store-op ::= `spirv.Store ` storage-class ssa-use `, ` ssa-use `, `\n (`[` memory-access `]`)? `:` spirv-element-type\n ```\n\n #### Example:\n\n ```mlir\n %0 = spirv.Variable : !spirv.ptr\n %1 = spirv.FMul ... : f32\n spirv.Store \"Function\" %0, %1 : f32\n spirv.Store \"Function\" %0, %1 [\"Volatile\"] : f32\n spirv.Store \"Function\" %0, %1 [\"Aligned\", 4] : f32\n ```", "operands": [ { "name": "ptr", "type": "SPIRV_AnyPtr" }, { "name": "value", "type": "SPIRV_Type" } ], "attributes": [ { "name": "memory_access", "type": "OptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.SUDot", "summary": "Mixed-signedness integer dot product of Vector 1 and Vector 2.\n Components of Vector 1 are treated as signed, components of Vector 2 are\n treated as unsigned.", "description": "Result Type must be an integer type whose Width must be greater than or\n equal to that of the components of Vector 1 and Vector 2.\n\n Vector 1 and Vector 2 must be either 32-bit integers (enabled by the\n DotProductInput4x8BitPacked capability) or vectors of integer type with\n the same number of components and same component Width (enabled by the\n DotProductInput4x8Bit or DotProductInputAll capability). When Vector 1\n and Vector 2 are vectors, the components of Vector 2 must have a\n Signedness of 0.\n\n When Vector 1 and Vector 2 are scalar integer types, Packed Vector\n Format must be specified to select how the integers are to be\n interpreted as vectors.\n\n All components of Vector 1 are sign-extended to the bit width of the\n result's type. All components of Vector 2 are zero-extended to the bit\n width of the result's type. The sign- or zero-extended input vectors are\n then multiplied component-wise and all components of the vector\n resulting from the component-wise multiplication are added together. The\n resulting value will equal the low-order N bits of the correct result R,\n where N is the result width and R is computed with enough precision to\n avoid overflow and underflow.\n\n \n\n #### Example:\n\n ```mlir\n %r = spirv.SUDot %a, %b, : i32 -> i32\n %r = spirv.SUDot %a, %b, : i32 -> i64\n %r = spirv.SUDot %a, %b : vector<4xi8> -> i32\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "vector2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" } ], "assemblyFormat": "$vector1 `,` $vector2 ( `,` $format^ )? attr-dict `:`\n type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.SUDotAccSat", "summary": "Mixed-signedness integer dot product of Vector 1 and Vector 2 and signed\n saturating addition of the result with Accumulator. Components of Vector\n 1 are treated as signed, components of Vector 2 are treated as unsigned.", "description": "Result Type must be an integer type whose Width must be greater than or\n equal to that of the components of Vector 1 and Vector 2.\n\n Vector 1 and Vector 2 must be either 32-bit integers (enabled by the\n DotProductInput4x8BitPacked capability) or vectors of integer type with\n the same number of components and same component Width (enabled by the\n DotProductInput4x8Bit or DotProductInputAll capability). When Vector 1\n and Vector 2 are vectors, the components of Vector 2 must have a\n Signedness of 0.\n\n The type of Accumulator must be the same as Result Type.\n\n When Vector 1 and Vector 2 are scalar integer types, Packed Vector\n Format must be specified to select how the integers are to be\n interpreted as vectors.\n\n All components of Vector 1 are sign-extended to the bit width of the\n result's type. All components of Vector 2 are zero-extended to the bit\n width of the result's type. The sign- or zero-extended input vectors are\n then multiplied component-wise and all components of the vector\n resulting from the component-wise multiplication are added together.\n Finally, the resulting sum is added to the input accumulator. This final\n addition is saturating.\n\n If any of the multiplications or additions, with the exception of the\n final accumulation, overflow or underflow, the result of the instruction\n is undefined.\n\n \n\n #### Example:\n\n ```mlir\n %r = spirv.SUDotAccSat %a, %b, %acc, : i32 -> i32\n %r = spirv.SUDotAccSat %a, %b, %acc, : i32 -> i64\n %r = spirv.SUDotAccSat %a, %b, %acc : vector<4xi8> -> i32\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "vector2", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "accumulator", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" }, { "type": "AllTypesMatch<['accumulator', 'result']>" } ], "assemblyFormat": "$vector1 `,` $vector2 `,` $accumulator ( `,` $format^ )? attr-dict `:`\n type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Switch", "summary": "Multi-way branch to one of the operand label ``.", "description": "Selector must have a type of OpTypeInt. Selector is compared for equality to\n the Target literals.\n\n Default must be the `` of a label. If Selector does not equal any of the\n Target literals, control flow branches to the Default label ``.\n\n Target must be alternating scalar integer literals and the `` of a label.\n If Selector equals a literal, control flow branches to the following label\n ``. It is invalid for any two literal to be equal to each other. If Selector\n does not equal any literal, control flow branches to the Default label ``.\n Each literal is interpreted with the type of Selector: The bit width of\n Selector’s type is the width of each literal’s type. If this width is not a\n multiple of 32-bits and the OpTypeInt Signedness is set to 1, the literal values\n are interpreted as being sign extended.\n\n If Selector is an OpUndef, behavior is undefined.\n\n This instruction must be the last instruction in a block.\n\n #### Example:\n\n ```mlir\n spirv.Switch %selector : si32, [\n default: ^bb1(%a : i32),\n 0: ^bb1(%b : i32),\n 1: ^bb3(%c : i32)\n ]\n ```", "operands": [ { "name": "selector", "type": "SPIRV_Integer" }, { "name": "defaultOperands", "type": "Variadic" }, { "name": "targetOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "literals", "type": "OptionalAttr" }, { "name": "case_operand_segments", "type": "DenseI32ArrayAttr" } ], "successors": [ { "name": "defaultTarget", "type": "AnySuccessor" }, { "name": "targets", "type": "VariadicSuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$selector `:` type($selector) `,` `[` `\\n`\n custom(ref(type($selector)),$defaultTarget,\n $defaultOperands,\n type($defaultOperands),\n $literals,\n $targets,\n $targetOperands,\n type($targetOperands))\n `]`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Abs", "summary": "Absolute value operation.", "description": "Elementwise Absolute value operation. Input and Output types must match.\n Integer element types are always interpreted as signed. The behaviour is\n undefined if the input value is min_value.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_abs\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_abs\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Abs %input1 : !spirv.arm.tensor<5x1x4x4xi32> -> !spirv.arm.tensor<5x1x4x4xi32>\n %0 = spirv.Tosa.Abs %input1 : !spirv.arm.tensor<3x6x14x8xf16> -> !spirv.arm.tensor<3x6x14x8xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Add", "summary": "Addition operator.", "description": "Elementwise Addition of input1 and input2. Axis of size 1 will be broadcast,\n as necessary. Rank of input tensors must match. Integer element types are\n always interpreted as signed. The behavior is undefined if the integer\n addition overflows or underflows the signed integer range.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_add\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_add\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Add %input1, %input2 : !spirv.arm.tensor<4x7x3x10xi32>, !spirv.arm.tensor<4x7x3x1xi32> -> !spirv.arm.tensor<4x7x3x10xi32>\n %0 = spirv.Tosa.Add %input1, %input2 : !spirv.arm.tensor<26x37x18xf16>, !spirv.arm.tensor<1x37x18xf16> -> !spirv.arm.tensor<26x37x18xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ArgMax", "summary": "Perform argmax on the input.", "description": "Returns the index with the largest value across the given axis of the\n input tensor. If multiple locations have equal values, returns the first\n match along the search axis.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_argmax\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_argmax\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.ArgMax axis = 3, nan_mode = , %input : !spirv.arm.tensor<3x28x17x17xi8> -> !spirv.arm.tensor<3x28x17xi32>\n %2 = spirv.Tosa.ArgMax axis = 2, nan_mode = , %input : !spirv.arm.tensor<2x2x7x14xf32> -> !spirv.arm.tensor<2x2x14xi32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32_TensorArmUpTo5D" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" }, { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "assemblyFormat": "`axis` `=` $axis `,`\n `nan_mode` `=` $nan_mode `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ArithmeticRightShift", "summary": "Arithmetic Right Shift.", "description": "Elementwise Arithmetic Right Shift of input1 by the amount specified in\n input2. Axis of size 1 will be broadcast, as necessary. Rank of input\n tensors must match. Integer element types are always interpreted as signed.\n The behavior is undefined if the shift value is negative or greater or\n equal to the bitwidth of the element type.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_arithmetic_right_shift\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_arithmetic_right_shift\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.ArithmeticRightShift round = true, %input1, %shift : !spirv.arm.tensor<1x47x22xi16>, !spirv.arm.tensor<49x47x22xi16> -> !spirv.arm.tensor<49x47x22xi16>\n ```\n\n If an element of `%shift` is `3`, the matching element of `%input1` is\n shifted right by 3 bits; because this is an arithmetic shift, the sign bit\n is preserved.", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "attributes": [ { "name": "round", "type": "ConfinedAttr" } ], "assemblyFormat": "`round` `=` $round `,`\n $input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.AvgPool2D", "summary": "Performs average pooling on the input.", "description": "Performs an average pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor, with\n the mean value being placed in the output tensor. When calculating the\n average, only the number of valid input tensor values, but not padding, are\n used to calculate the divisor. The behaviour is undefined if the accumulated\n result overflows or underflows.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_avg_pool2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_avg_pool2d\n\n #### Example:\n ```mlir\n %6 = spirv.Tosa.AvgPool2D kernel = [3, 3], stride = [1, 2], pad = [0, 1, 0, 0], acc_type = , %input, %input_zp, %output_zp : !spirv.arm.tensor<1x3x65537x1xi8>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<1x2x32768x1xi8>\n %6 = spirv.Tosa.AvgPool2D kernel = [2, 2], stride = [1, 1], pad = [1, 0, 0, 0], acc_type = , %input, %input_zp, %output_zp : !spirv.arm.tensor<1x2x65533x2xf32>, !spirv.arm.tensor<1xf32>, !spirv.arm.tensor<1xf32> -> !spirv.arm.tensor<1x2x65532x2xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "input_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" }, { "name": "output_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" } ], "attributes": [ { "name": "kernel", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "stride", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "pad", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<0>]>" }, { "name": "acc_type", "type": "SPIRV_TosaExtAccTypeAttr{INT32|FP16|FP32|INT48}" } ], "assemblyFormat": "`kernel` `=` custom($kernel) `,`\n `stride` `=` custom($stride) `,`\n `pad` `=` custom($pad) `,`\n `acc_type` `=` $acc_type `,`\n $input `,`\n $input_zp `,`\n $output_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.BitwiseAnd", "summary": "Bitwise AND operator.", "description": "Elementwise Bitwise AND of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match. Integer element\n types are always interpreted as signed.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_bitwise_and\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_bitwise_and\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.BitwiseAnd %input1, %input2 : !spirv.arm.tensor<4x1x7x12xi16>, !spirv.arm.tensor<4x13x7x12xi16> -> !spirv.arm.tensor<4x13x7x12xi16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.BitwiseNot", "summary": "Bitwise NOT operator.", "description": "Elementwise Bitwise NOT of input tensor. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_bitwise_not\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_bitwise_not\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.BitwiseNot %input1 : !spirv.arm.tensor<12x56x50xi32> -> !spirv.arm.tensor<12x56x50xi32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.BitwiseOr", "summary": "Bitwise OR operator.", "description": "Elementwise Bitwise OR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match. Integer element\n types are always interpreted as signed.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_bitwise_or\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_bitwise_or\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.BitwiseOr %input1, %input2 : !spirv.arm.tensor<11x30x23xi32>, !spirv.arm.tensor<1x30x23xi32> -> !spirv.arm.tensor<11x30x23xi32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.BitwiseXor", "summary": "Bitwise XOR operator.", "description": "Elementwise Bitwise XOR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match. Integer element\n types are always interpreted as signed.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_bitwise_xor\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_bitwise_xor\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.BitwiseXor %input1, %input2 : !spirv.arm.tensor<4x8x13x9xi16>, !spirv.arm.tensor<4x8x1x9xi16> -> !spirv.arm.tensor<4x8x13x9xi16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Cast", "summary": "Cast operation.", "description": "Casts a tensor from one data type to another.\n\n Valid casting combinations are defined in the following table:\n\n | From | To |\n |---------|---------|\n | float16 | float32 |\n | float16 | int16 |\n | float16 | int32 |\n | float16 | int8 |\n | float32 | float16 |\n | float32 | int16 |\n | float32 | int32 |\n | float32 | int8 |\n | int16 | float16 |\n | int16 | float32 |\n | int32 | float16 |\n | int32 | float32 |\n | int8 | float16 |\n | int8 | float32 |\n | Boolean | int16 |\n | Boolean | int32 |\n | Boolean | int8 |\n | int16 | Boolean |\n | int16 | int32 |\n | int16 | int8 |\n | int32 | Boolean |\n | int32 | int16 |\n | int32 | int8 |\n | int8 | Boolean |\n | int8 | int16 |\n | int8 | int32 |\n | bf16 | float32 |\n | bf16 | int16 |\n | bf16 | int32 |\n | bf16 | int8 |\n | float32 | bf16 |\n | int16 | bf16 |\n | int32 | bf16 |\n | int8 | bf16 |\n | bf16 | fp8e4m3 |\n | fp8e4m3 | bf16 |\n | bf16 | fp8e5m2 |\n | fp8e5m2 | bf16 |\n | float16 | fp8e4m3 |\n | float32 | fp8e4m3 |\n | fp8e4m3 | float16 |\n | fp8e4m3 | float32 |\n | float16 | fp8e5m2 |\n | float32 | fp8e5m2 |\n | fp8e5m2 | float16 |\n | fp8e5m2 | float32 |\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_cast\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_cast\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Cast %input : !spirv.arm.tensor<1x65538x1x2xi8> -> !spirv.arm.tensor<1x65538x1x2xi32>\n %0 = spirv.Tosa.Cast %input : !spirv.arm.tensor<11x5x14x4xf32> -> !spirv.arm.tensor<11x5x14x4xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32OrBoolOrF16OrF32OrBF16OrFP8_TensorArm" } ], "assemblyFormat": "$input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Ceil", "summary": "Ceil operator.", "description": "Elementwise Ceiling operation. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_ceil\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_ceil\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Ceil %input1 : !spirv.arm.tensor<46x55x53xf16> -> !spirv.arm.tensor<46x55x53xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Clamp", "summary": "Computes Clamp(min, max).", "description": "Clamp to an arbitrary minimum and maximum value. Maximum and minimum values\n are specified as values in the range of the input type. Integer element\n types are always interpreted as signed.\n No zero point subtraction is done to the values, thus to clamp to the zero\n point value, the zero point itself should be supplied as the minimum value.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_clamp\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_clamp\n\n #### Example:\n ```mlir\n %3 = spirv.Tosa.Clamp min_val = -102 : i8, max_val = -100 : i8, nan_mode = , %input : !spirv.arm.tensor<27x44x55xi8> -> !spirv.arm.tensor<27x44x55xi8>\n %3 = spirv.Tosa.Clamp min_val = -1.19339396E+38 : f32, max_val = 2.38255944E+38 : f32, nan_mode = , %input : !spirv.arm.tensor<18x5x17x6xf32> -> !spirv.arm.tensor<18x5x17x6xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "min_val", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16ConstAttr" }, { "name": "max_val", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16ConstAttr" }, { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "traits": [ { "type": "AllTypesMatch<['input', 'output']>" } ], "assemblyFormat": "`min_val` `=` $min_val `,`\n `max_val` `=` $max_val `,`\n `nan_mode` `=` $nan_mode `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Clz", "summary": "Count Leading Zero operator.", "description": "Elementwise Count Leading Zeros operation. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_clz\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_clz\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Clz %input1 : !spirv.arm.tensor<14x10x7x5xi32> -> !spirv.arm.tensor<14x10x7x5xi32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Concat", "summary": "Concatenates tensors along one dimension.", "description": "Concatenates a list of tensors along a given axis.\n No data conversion happens during a concat operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_concat\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_concat\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Concat axis = 2, %input1, %input2, %input3, %input4 : !spirv.arm.tensor<12x13x3x14xi8>, !spirv.arm.tensor<12x13x3x14xi8>, !spirv.arm.tensor<12x13x3x14xi8>, !spirv.arm.tensor<12x13x3x14xi8> -> !spirv.arm.tensor<12x13x12x14xi8>\n %1 = spirv.Tosa.Concat axis = 1, %input1, %input2, %input3 : !spirv.arm.tensor<40x31x19xf32>, !spirv.arm.tensor<40x15x19xf32>, !spirv.arm.tensor<40x16x19xf32> -> !spirv.arm.tensor<40x62x19xf32>\n ```", "operands": [ { "name": "input1", "type": "Variadic" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`axis` `=` $axis `,`\n $input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Conv2D", "summary": "2D Convolution operator.", "description": "Performs a 2D convolution over the given tensor input, using the weight\n tensor. Implementations may choose to skip calculation of multiplies in\n the padding area.\n\n Input and weight have respective zero point values provided in input_zp and weight_zp.\n\n The behaviour is undefined if the accumulated result overflows or underflows.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_conv2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_conv2d\n\n #### Example:\n ```mlir\n %7 = spirv.Tosa.Conv2D pad = [1, 0, 0, 0], stride = [1, 2], dilation = [7, 1], acc_type = , local_bound = false, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x65535x3x1xi8>, !spirv.arm.tensor<7x1x1x1xi8>, !spirv.arm.tensor<1xi32>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<1x65536x2x7xi32>\n %7 = spirv.Tosa.Conv2D pad = [0, 0, 0, 0], stride = [1, 1], dilation = [1, 1], acc_type = , local_bound = true, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x34x18x27xf16>, !spirv.arm.tensor<11x1x1x27xf16>, !spirv.arm.tensor<11xf16>, !spirv.arm.tensor<1xf16>, !spirv.arm.tensor<1xf16> -> !spirv.arm.tensor<1x34x18x11xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "weight", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "bias", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm1D" }, { "name": "input_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" }, { "name": "weight_zp", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm4D" } ], "attributes": [ { "name": "pad", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<0>]>" }, { "name": "stride", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "dilation", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "acc_type", "type": "SPIRV_TosaExtAccTypeAttr{INT32|FP16|FP32|INT48}" }, { "name": "local_bound", "type": "ConfinedAttr" } ], "assemblyFormat": "`pad` `=` custom($pad) `,`\n `stride` `=` custom($stride) `,`\n `dilation` `=` custom($dilation) `,`\n `acc_type` `=` $acc_type `,`\n `local_bound` `=` $local_bound `,`\n $input `,`\n $weight `,`\n $bias `,`\n $input_zp `,`\n $weight_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Conv3D", "summary": "3D Convolution operator.", "description": "Performs a 3D convolution over the given input tensor. Implementations\n may choose to skip calculation of multiplies in the padding area.\n\n Input and weight have respective zero point values provided in input_zp and weight_zp.\n\n The behaviour is undefined if the accumulated result overflows or underflows.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_conv3d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_conv3d\n\n #### Example:\n ```mlir\n %7 = spirv.Tosa.Conv3D pad = [0, 0, 0, 0, 0, 0], stride = [1, 1, 1], dilation = [1, 1, 1], acc_type = , local_bound = false, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x9x21x14x1xi8>, !spirv.arm.tensor<2x1x2x1x1xi8>, !spirv.arm.tensor<1xi32>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<1x9x20x14x2xi32>\n %7 = spirv.Tosa.Conv3D pad = [0, 1, 1, 0, 0, 1], stride = [1, 1, 1], dilation = [1, 1, 7], acc_type = , local_bound = false, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x2x65539x1x2xf32>, !spirv.arm.tensor<1x1x1x1x2xf32>, !spirv.arm.tensor<1xf32>, !spirv.arm.tensor<1xf32>, !spirv.arm.tensor<1xf32> -> !spirv.arm.tensor<1x3x65540x2x1xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm5D" }, { "name": "weight", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_TensorArm5D" }, { "name": "bias", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm1D" }, { "name": "input_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" }, { "name": "weight_zp", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm5D" } ], "attributes": [ { "name": "pad", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<0>]>" }, { "name": "stride", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "dilation", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "acc_type", "type": "SPIRV_TosaExtAccTypeAttr{INT32|FP16|FP32|INT48}" }, { "name": "local_bound", "type": "ConfinedAttr" } ], "assemblyFormat": "`pad` `=` custom($pad) `,`\n `stride` `=` custom($stride) `,`\n `dilation` `=` custom($dilation) `,`\n `acc_type` `=` $acc_type `,`\n `local_bound` `=` $local_bound `,`\n $input `,`\n $weight `,`\n $bias `,`\n $input_zp `,`\n $weight_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Cos", "summary": "Cosine operator.", "description": "Elementwise Cosine operation for values given in radians. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_cos\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_cos\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Cos %input1 : !spirv.arm.tensor<44x49x51xf32> -> !spirv.arm.tensor<44x49x51xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.DepthwiseConv2D", "summary": "Depthwise 2D Convolution operator.", "description": "Performs 2D convolutions separately over each channel of the given tensor\n input, using the weight tensor. Implementations may choose to skip\n calculation of multiplies in the padding area.\n\n Input and weight have respective zero point values provided in input_zp and weight_zp.\n\n The behaviour is undefined if the accumulated result overflows or underflows.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_depthwise_conv2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_depthwise_conv2d\n\n #### Example:\n ```mlir\n %7 = spirv.Tosa.DepthwiseConv2D pad = [0, 0, 0, 0], stride = [1, 2], dilation = [7, 7], acc_type = , local_bound = false, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x4x65537x1xi8>, !spirv.arm.tensor<1x3x1x4xi8>, !spirv.arm.tensor<4xi32>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<1x4x32762x4xi32>\n %7 = spirv.Tosa.DepthwiseConv2D pad = [0, 1, 1, 1], stride = [1, 2], dilation = [1, 7], acc_type = , local_bound = true, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x65540x1x3xf32>, !spirv.arm.tensor<1x1x3x1xf32>, !spirv.arm.tensor<1xf32>, !spirv.arm.tensor<1xf32>, !spirv.arm.tensor<1xf32> -> !spirv.arm.tensor<1x65541x2x3xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "weight", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "bias", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm1D" }, { "name": "input_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" }, { "name": "weight_zp", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm4D" } ], "attributes": [ { "name": "pad", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<0>]>" }, { "name": "stride", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "dilation", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "acc_type", "type": "SPIRV_TosaExtAccTypeAttr{INT32|FP16|FP32|INT48}" }, { "name": "local_bound", "type": "ConfinedAttr" } ], "assemblyFormat": "`pad` `=` custom($pad) `,`\n `stride` `=` custom($stride) `,`\n `dilation` `=` custom($dilation) `,`\n `acc_type` `=` $acc_type `,`\n `local_bound` `=` $local_bound `,`\n $input `,`\n $weight `,`\n $bias `,`\n $input_zp `,`\n $weight_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Equal", "summary": "Equal comparison operation", "description": "Elementwise Equal comparison operation: returns the truth value of\n (input1 == input2) element-wise.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_equal\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_equal\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Equal %input1, %input2 : !spirv.arm.tensor<51x28x59xi32>, !spirv.arm.tensor<51x1x59xi32> -> !spirv.arm.tensor<51x28x59xi1>\n %0 = spirv.Tosa.Equal %input1, %input2 : !spirv.arm.tensor<16x11x5x3xf32>, !spirv.arm.tensor<16x1x5x3xf32> -> !spirv.arm.tensor<16x11x5x3xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Erf", "summary": "Gauss Error Function.", "description": "Gauss Error Function: $ erf(x) = \\frac{2}{\\sqrt{\\pi}} \\int_{0}^{x} e^{-t^2} dt $\n For quantized integer data types, the `spirv.Tosa.Table` operator should be used instead.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_erf\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_erf\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Erf %input : !spirv.arm.tensor<47x38x51xf32> -> !spirv.arm.tensor<47x38x51xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input', 'output']>" } ], "assemblyFormat": "$input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Exp", "summary": "Exp operator.", "description": "Elementwise e to the power of x operation. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_exp\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_exp\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Exp %input1 : !spirv.arm.tensor<37x53x47xf32> -> !spirv.arm.tensor<37x53x47xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.FFT2D", "summary": "Performs FFT2D operation on the input.", "description": "Performs a batched complex 2D Fast Fourier Transform over the input. The\n complex input values are constructed from the corresponding values in the\n input_real and input_imag tensors. The resulting values in the output are\n split into the output_real and output_imag tensors. No normalization is\n applied on either the forward or inverse versions of the operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_fft2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_fft2d\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.FFT2D inverse = true, local_bound = false, %input_real, %input_imag : !spirv.arm.tensor<1x32x32xf32>, !spirv.arm.tensor<1x32x32xf32> -> !spirv.struct<(!spirv.arm.tensor<1x32x32xf32>, !spirv.arm.tensor<1x32x32xf32>)>\n %1 = spirv.CompositeExtract %0[0 : i32] : !spirv.struct<(!spirv.arm.tensor<1x32x32xf32>, !spirv.arm.tensor<1x32x32xf32>)>\n %2 = spirv.CompositeExtract %0[1 : i32] : !spirv.struct<(!spirv.arm.tensor<1x32x32xf32>, !spirv.arm.tensor<1x32x32xf32>)>\n ```", "operands": [ { "name": "input_real", "type": "SPIRV_F32_TensorArm3D" }, { "name": "input_imag", "type": "SPIRV_F32_TensorArm3D" } ], "results": [ { "name": "output", "type": "SPIRV_Struct_2_F32_TensorArm3D" } ], "attributes": [ { "name": "inverse", "type": "ConfinedAttr" }, { "name": "local_bound", "type": "ConfinedAttr" } ], "assemblyFormat": "`inverse` `=` $inverse `,`\n `local_bound` `=` $local_bound `,`\n $input_real `,`\n $input_imag\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Floor", "summary": "Floor operator.", "description": "Elementwise Floor operation. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_floor\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_floor\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Floor %input1 : !spirv.arm.tensor<40x52x42xf32> -> !spirv.arm.tensor<40x52x42xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Gather", "summary": "Gather operation.", "description": "Generate a tensor for which each element in the output is a subtensor of the\n values tensor based on the indices. Undefined behaviour may occur if the\n specified indices are out of range.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_gather\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_gather\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Gather %values, %indices : !spirv.arm.tensor<31x11x45xi32>, !spirv.arm.tensor<31x15xi32> -> !spirv.arm.tensor<31x15x45xi32>\n %0 = spirv.Tosa.Gather %values, %indices : !spirv.arm.tensor<59x61x19xf32>, !spirv.arm.tensor<59x65xi32> -> !spirv.arm.tensor<59x65x19xf32>\n ```\n\n If a row of `%indices` is `[4, 4, 0]`, the corresponding output row copies\n slices 4, 4, and 0 from the matching batch of `%values`.", "operands": [ { "name": "values", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm3D" }, { "name": "indices", "type": "SPIRV_I32_TensorArm2D" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm3D" } ], "assemblyFormat": "$values `,`\n $indices\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Greater", "summary": "Greater comparison operation", "description": "Elementwise Greater than comparison operation: returns the truth value of\n (input1 > input2) element-wise.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_greater\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_greater\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Greater %input1, %input2 : !spirv.arm.tensor<11x10x10x2xi32>, !spirv.arm.tensor<11x10x10x1xi32> -> !spirv.arm.tensor<11x10x10x2xi1>\n %0 = spirv.Tosa.Greater %input1, %input2 : !spirv.arm.tensor<6x3x12x4xf16>, !spirv.arm.tensor<6x3x1x4xf16> -> !spirv.arm.tensor<6x3x12x4xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.GreaterEqual", "summary": "Greater or Equal comparison operation", "description": "Elementwise Greater or Equal than comparison operation: returns the truth value of\n (input1 >= input2) element-wise.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_greater_equal\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_greater_equal\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.GreaterEqual %input1, %input2 : !spirv.arm.tensor<10x17x7x1xi32>, !spirv.arm.tensor<10x17x7x16xi32> -> !spirv.arm.tensor<10x17x7x16xi1>\n %0 = spirv.Tosa.GreaterEqual %input1, %input2 : !spirv.arm.tensor<3x17x6x3xf32>, !spirv.arm.tensor<1x17x6x3xf32> -> !spirv.arm.tensor<3x17x6x3xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.IntDiv", "summary": "Integer Divide operator.", "description": "Elementwise Integer Divide of input1 by input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match. Integer element\n types are always interpreted as signed. The behavior is undefined if the\n divisor value is equal to zero and if the divisor value is min_value\n and the dividend is -1.\n\n The result of the divide is truncated towards zero. Expected use is for\n operations on non-scaled integers. Floating point divide should use\n `spirv.Tosa.Reciprocal` and `spirv.Tosa.Mul`. Quantized integer divide\n should use `spirv.Tosa.Table`(for $ 1/x $) and `spirv.Tosa.Mul`.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_intdiv\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_intdiv\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.IntDiv %input1, %input2 : !spirv.arm.tensor<1x65533x1xi32>, !spirv.arm.tensor<2x65533x1xi32> -> !spirv.arm.tensor<2x65533x1xi32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32_TensorArm" }, { "name": "input2", "type": "SPIRV_I32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Log", "summary": "Log operator.", "description": "Elementwise Natural Logarithm operation. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_log\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_log\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Log %input1 : !spirv.arm.tensor<45x43x36xf16> -> !spirv.arm.tensor<45x43x36xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.LogicalAnd", "summary": "Logical AND operator.", "description": "Elementwise Logical AND of input1 and input2. Axis of size 1 will be\n broadcast, as necessary. Rank of input tensors must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_logical_and\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_logical_and\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.LogicalAnd %input1, %input2 : !spirv.arm.tensor<2x1x7x11xi1>, !spirv.arm.tensor<2x4x7x11xi1> -> !spirv.arm.tensor<2x4x7x11xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_Bool_TensorArm" }, { "name": "input2", "type": "SPIRV_Bool_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.LogicalLeftShift", "summary": "Logical Left Shift operator.", "description": "Elementwise Logical Left Shift of input1 by the amount specified in input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors\n must match. Integer element types are always interpreted as signed. The\n behavior is undefined if the shift value is negative or greater or equal to\n the bitwidth of the element type.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_logical_left_shift\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_logical_left_shift\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.LogicalLeftShift %input1, %shift : !spirv.arm.tensor<7x1x11x4xi8>, !spirv.arm.tensor<7x8x11x4xi8> -> !spirv.arm.tensor<7x8x11x4xi8>\n ```\n\n If an element of `%shift` is `2`, the matching element of `%input1` is\n shifted left by 2 bits.", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.LogicalNot", "summary": "Logical NOT operator.", "description": "Elementwise Logical NOT of input. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_logical_not\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_logical_not\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.LogicalNot %input1 : !spirv.arm.tensor<54x26x10xi1> -> !spirv.arm.tensor<54x26x10xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_Bool_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.LogicalOr", "summary": "Logical OR operator.", "description": "Elementwise logical OR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_logical_or\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_logical_or\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.LogicalOr %input1, %input2 : !spirv.arm.tensor<3x6x12x5xi1>, !spirv.arm.tensor<3x6x1x5xi1> -> !spirv.arm.tensor<3x6x12x5xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_Bool_TensorArm" }, { "name": "input2", "type": "SPIRV_Bool_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.LogicalRightShift", "summary": "Logical Right Shift operator.", "description": "Elementwise Logical Right Shift of input1 by the amount specified in input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors must\n match. Integer element types are always interpreted as signed. The\n behavior is undefined if the shift value is negative or greater or equal to\n the bitwidth of the element type.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_logical_right_shift\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_logical_right_shift\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.LogicalRightShift %input1, %shift : !spirv.arm.tensor<6x13x1x19xi8>, !spirv.arm.tensor<6x13x6x19xi8> -> !spirv.arm.tensor<6x13x6x19xi8>\n ```\n\n If an element of `%shift` is `2`, the matching element of `%input1` is\n shifted right by 2 bits, filling the new high bits with zero.", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.LogicalXor", "summary": "Logical XOR operator.", "description": "Elementwise logical XOR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_logical_xor\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_logical_xor\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.LogicalXor %input1, %input2 : !spirv.arm.tensor<11x4x9x12xi1>, !spirv.arm.tensor<11x4x9x1xi1> -> !spirv.arm.tensor<11x4x9x12xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_Bool_TensorArm" }, { "name": "input2", "type": "SPIRV_Bool_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.MatMul", "summary": "Matrix Multiplication operator.", "description": "Performs two dimensional matrix multiplications.\n\n A, B are the inputs with respective zero point values in A_zp, B_zp.\n\n The behaviour is undefined if the accumulated result overflows or underflows.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_matmul\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_matmul\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.MatMul %A, %B, %A_zp, %B_zp : !spirv.arm.tensor<8x2x3xi8>, !spirv.arm.tensor<8x3x8xi8>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<8x2x8xi32>\n %2 = spirv.Tosa.MatMul %A, %B, %A_zp, %B_zp : !spirv.arm.tensor<15x39x50xf16>, !spirv.arm.tensor<15x50x24xf16>, !spirv.arm.tensor<1xf16>, !spirv.arm.tensor<1xf16> -> !spirv.arm.tensor<15x39x24xf16>\n ```", "operands": [ { "name": "A", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm3D" }, { "name": "B", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm3D" }, { "name": "A_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" }, { "name": "B_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrI64OrF16OrF32_TensorArm3D" } ], "assemblyFormat": "$A `,`\n $B `,`\n $A_zp `,`\n $B_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Maximum", "summary": "Maximum.", "description": "Elementwise maximum of input1 and input2. Axis of size 1 will be broadcast,\n as necessary. Rank of input tensors must match. Integer element types are\n always interpreted as signed.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_maximum\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_maximum\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Maximum nan_mode = , %input1, %input2 : !spirv.arm.tensor<1x2x65533x1xi32>, !spirv.arm.tensor<1x2x65533x2xi32> -> !spirv.arm.tensor<1x2x65533x2xi32>\n %1 = spirv.Tosa.Maximum nan_mode = , %input1, %input2 : !spirv.arm.tensor<1x12x14x7xf16>, !spirv.arm.tensor<11x12x14x7xf16> -> !spirv.arm.tensor<11x12x14x7xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "assemblyFormat": "`nan_mode` `=` $nan_mode `,`\n $input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.MaxPool2D", "summary": "Performs max pooling on the input.", "description": "Performs a max pooling over the given input tensor. A sliding window of\n size given by is passed over the input tensor, with the\n maximum value being placed in the output tensor.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_max_pool2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_max_pool2d\n\n #### Example:\n ```mlir\n %4 = spirv.Tosa.MaxPool2D kernel = [3, 2], stride = [1, 2], pad = [1, 0, 0, 1], nan_mode = , %input : !spirv.arm.tensor<1x3x65537x1xi8> -> !spirv.arm.tensor<1x2x32769x1xi8>\n %4 = spirv.Tosa.MaxPool2D kernel = [3, 2], stride = [2, 2], pad = [1, 0, 1, 1], nan_mode = , %input : !spirv.arm.tensor<1x6x65536x1xf32> -> !spirv.arm.tensor<1x3x32769x1xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" } ], "attributes": [ { "name": "kernel", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "stride", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "pad", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<0>]>" }, { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "assemblyFormat": "`kernel` `=` custom($kernel) `,`\n `stride` `=` custom($stride) `,`\n `pad` `=` custom($pad) `,`\n `nan_mode` `=` $nan_mode `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Minimum", "summary": "Minimum.", "description": "Elementwise minimum of input1 and input2. Axis of size 1 will be broadcast,\n as necessary. Rank of input tensors must match. Integer element types are\n always interpreted as signed.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_minimum\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_minimum\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Minimum nan_mode = , %input1, %input2 : !spirv.arm.tensor<15x2x10x11xi32>, !spirv.arm.tensor<15x1x10x11xi32> -> !spirv.arm.tensor<15x2x10x11xi32>\n %1 = spirv.Tosa.Minimum nan_mode = , %input1, %input2 : !spirv.arm.tensor<1x65531x2x1xf32>, !spirv.arm.tensor<1x1x2x1xf32> -> !spirv.arm.tensor<1x65531x2x1xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "assemblyFormat": "`nan_mode` `=` $nan_mode `,`\n $input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Mul", "summary": "Multiplication operator.", "description": "Elementwise Multiplication (Hadamard product) of input1 and input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors must\n match. Integer element types are always interpreted as signed.\n The shift value is used to right shift the result (rounded up) and\n it is used only if input element type is i32 and it must be zero for the\n other element types. The behavior is undefined if the integer\n multiplication overflows or underflows the signed integer range or the\n shift value exceeds the bitwidth of i32.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_mul\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_mul\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Mul %input1, %input2, %shift : !spirv.arm.tensor<34x21x39xi32>, !spirv.arm.tensor<34x21x1xi32>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<34x21x39xi32>\n %1 = spirv.Tosa.Mul %input1, %input2, %shift : !spirv.arm.tensor<57x1x55xf16>, !spirv.arm.tensor<57x37x55xf16>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<57x37x55xf16>\n ```\n\n For integer multiplication, `%shift = [7]` would round the product and\n shift it right by 7 bits; for floating-point inputs the shift tensor must\n be `[0]`.", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" }, { "name": "shift", "type": "SPIRV_I8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2 `,`\n $shift\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Negate", "summary": "Negate operator.", "description": "Elementwise Negation operation. Input and Output types must match. Integer\n element types are always interpreted as signed. The behaviour is undefined\n if the input value is min_value.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_negate\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_negate\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.Negate %input1, %input1_zp, %output_zp : !spirv.arm.tensor<3x1x65540x1xi8>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<3x1x65540x1xi8>\n %2 = spirv.Tosa.Negate %input1, %input1_zp, %output_zp : !spirv.arm.tensor<2x7x15x13xf16>, !spirv.arm.tensor<1xf16>, !spirv.arm.tensor<1xf16> -> !spirv.arm.tensor<2x7x15x13xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" }, { "name": "input1_zp", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_1DTensorArmOfLength1" }, { "name": "output_zp", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1 `,`\n $input1_zp `,`\n $output_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Pad", "summary": "Pads a tensor with value specified.", "description": "Pads a tensor along the borders of each dimension with a supplied value.\n Returns a new tensor with the padding included. The pad_const value includes\n the zero point if the tensor uses a zero point.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_pad\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_pad\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.Pad %input1, %padding, %pad_const : !spirv.arm.tensor<4x7xi8>, !spirv.arm.tensor<4xi32>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<21x19xi8>\n %2 = spirv.Tosa.Pad %input1, %padding, %pad_const : !spirv.arm.tensor<2x9x2x3xf32>, !spirv.arm.tensor<8xi32>, !spirv.arm.tensor<1xf32> -> !spirv.arm.tensor<4x9x4x4xf32>\n ```\n\n For the first example, `%padding = [8, 9, 6, 6]` pads dimension 0 by 8\n before and 9 after, and dimension 1 by 6 on both sides.", "operands": [ { "name": "input1", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" }, { "name": "padding", "type": "SPIRV_I32_1DTensorArmOfEvenLength2To12" }, { "name": "pad_const", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $padding `,`\n $pad_const\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Pow", "summary": "Power operator.", "description": "Elementwise input1 value raised to the Power of input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors must\n match. The behavior is undefined if the the input1 value is negative, or\n both input values are zero or negative, or both input values are NaN or\n infinite.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_pow\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_pow\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Pow %input1, %input2 : !spirv.arm.tensor<1x52x53xf16>, !spirv.arm.tensor<44x52x53xf16> -> !spirv.arm.tensor<44x52x53xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Reciprocal", "summary": "Reciprocal operator.", "description": "Elementwise Reciprocal operation. Input and Output types must match. For\n integer operation, a table should be used with the appropriate ranges.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reciprocal\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reciprocal\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Reciprocal %input1 : !spirv.arm.tensor<38x47x44xf32> -> !spirv.arm.tensor<38x47x44xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ReduceAll", "summary": "Reduce All operator.", "description": "Reduces a tensor along the given axis with a Logical AND operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reduce_all\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reduce_all\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.ReduceAll axis = 2, %input1 : !spirv.arm.tensor<18x22x23x12xi1> -> !spirv.arm.tensor<18x22x1x12xi1>\n ```", "operands": [ { "name": "input", "type": "SPIRV_Bool_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`axis` `=` $axis `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ReduceAny", "summary": "Reduce Any operator.", "description": "Reduces a tensor along the given axis with a Logical OR operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reduce_any\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reduce_any\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.ReduceAny axis = 2, %input1 : !spirv.arm.tensor<25x13x30x8xi1> -> !spirv.arm.tensor<25x13x1x8xi1>\n ```", "operands": [ { "name": "input", "type": "SPIRV_Bool_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_Bool_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`axis` `=` $axis `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ReduceMax", "summary": "Reduce Max operator.", "description": "Reduces a tensor along the given axis with a Maximum operation.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reduce_max\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reduce_max\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.ReduceMax axis = 2, nan_mode = , %input1 : !spirv.arm.tensor<8x30x12x3xi8> -> !spirv.arm.tensor<8x30x1x3xi8>\n %2 = spirv.Tosa.ReduceMax axis = 2, nan_mode = , %input1 : !spirv.arm.tensor<16x20x10xf16> -> !spirv.arm.tensor<16x20x1xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" }, { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "assemblyFormat": "`axis` `=` $axis `,`\n `nan_mode` `=` $nan_mode `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ReduceMin", "summary": "Reduce Min operator.", "description": "Reduces a tensor along the given axis with a Minimum operation.\n NaN Propagation Mode is ignored for inputs using integer element types.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reduce_min\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reduce_min\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.ReduceMin axis = 2, nan_mode = , %input1 : !spirv.arm.tensor<2x5x5x1xi8> -> !spirv.arm.tensor<2x5x1x1xi8>\n %2 = spirv.Tosa.ReduceMin axis = 2, nan_mode = , %input1 : !spirv.arm.tensor<27x10x25x9xf16> -> !spirv.arm.tensor<27x10x1x9xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" }, { "name": "nan_mode", "type": "SPIRV_TosaExtNaNPropagationModeAttr{Propagate|Ignore}" } ], "assemblyFormat": "`axis` `=` $axis `,`\n `nan_mode` `=` $nan_mode `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ReduceProduct", "summary": "Reduce Product operator.", "description": "Reduces a tensor along the given axis by computing the Product of the axis.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reduce_product\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reduce_product\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.ReduceProduct axis = 2, %input1 : !spirv.arm.tensor<2x16x25xf16> -> !spirv.arm.tensor<2x16x1xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`axis` `=` $axis `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.ReduceSum", "summary": "Reduce Sum operator.", "description": "Reduces a tensor along the given axis by computing the Sum of the axis.\n Integer element types are always interpreted as signed. The behavior is\n undefined if the integer addition overflows or underflows the signed\n integer range.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reduce_sum\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reduce_sum\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.ReduceSum axis = 1, %input1 : !spirv.arm.tensor<20x24x22xi32> -> !spirv.arm.tensor<20x1x22xi32>\n %1 = spirv.Tosa.ReduceSum axis = 1, %input1 : !spirv.arm.tensor<32x32x33xf32> -> !spirv.arm.tensor<32x1x33xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`axis` `=` $axis `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Rescale", "summary": "Rescale operator.", "description": "Rescale is defined using an integer multiply, add, and shift.\n\n Rescale supports two precisions of multiplier: 16-bit and 32-bit. The\n 32-bit multiplier version supports two rounding modes to enable simpler\n lowering of existing frameworks that use two stage rounding. All arithmetic\n is designed so that it does not overflow a 64-bit accumulator and that the\n result fits in 32 bits. In particular, a 48-bit value (represented as a\n 64-bit value in SPIR-V) cannot be scaled with the 32-bit multiplier because\n the accumulator would need to have 80 bits.\n\n The shift and value range are limited to allow a variety of implementations.\n The limit of 62 on shift allows the shift to be decomposed as two right\n shifts of 31.\n\n Unsigned 8- and 16-bit values are only allowed in the Rescale operation,\n to allow for compatibility with networks which expect unsigned 8-bit or\n 16-bit tensors for input and output.\n\n Undefined behaviour may occur if the calculated result underflows or overflows\n their integer ranges.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_rescale\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_rescale\n\n #### Example:\n ```mlir\n %9 = spirv.Tosa.Rescale scale32 = true, rounding_mode = , per_channel = false, input_unsigned = false, output_unsigned = true, %input, %multiplier, %shift, %input_zp, %output_zp : !spirv.arm.tensor<17x29x19xi16>, !spirv.arm.tensor<1xi32>, !spirv.arm.tensor<1xi8>, !spirv.arm.tensor<1xi16>, !spirv.arm.tensor<1xi16> -> !spirv.arm.tensor<17x29x19xi16>\n ```\n\n With `per_channel = false`, `%multiplier` and `%shift` are 1D tensors with\n a single value, so they define one global scale for the whole tensor, while\n `%input_zp` and `%output_zp` are scalar zero points. For example,\n `%multiplier = [1073741824]`, `%shift = [30]`, `%input_zp = [0]`, and\n `%output_zp = [128]` mean \"apply one global rescale to every element, then\n store the result using output zero point 128\".", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrI32OrI64_TensorArm" }, { "name": "multiplier", "type": "SPIRV_I16OrI32_TensorArm1D" }, { "name": "shift", "type": "SPIRV_I8_TensorArm1D" }, { "name": "input_zp", "type": "SPIRV_I8OrI16OrI32OrI64_1DTensorArmOfLength1" }, { "name": "output_zp", "type": "SPIRV_I8OrI16OrI32_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI16OrI32_TensorArm" } ], "attributes": [ { "name": "scale32", "type": "ConfinedAttr" }, { "name": "rounding_mode", "type": "SPIRV_TosaExtRoundingModeAttr{SingleRound|InexactRound|DoubleRound}" }, { "name": "per_channel", "type": "ConfinedAttr" }, { "name": "input_unsigned", "type": "ConfinedAttr" }, { "name": "output_unsigned", "type": "ConfinedAttr" } ], "assemblyFormat": "`scale32` `=` $scale32 `,`\n `rounding_mode` `=` $rounding_mode `,`\n `per_channel` `=` $per_channel `,`\n `input_unsigned` `=` $input_unsigned `,`\n `output_unsigned` `=` $output_unsigned `,`\n $input `,`\n $multiplier `,`\n $shift `,`\n $input_zp `,`\n $output_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Reshape", "summary": "Reshape operator.", "description": "Returns a tensor with the same type/values as the input, with a new shape\n specified by the shape argument. Reshape may operate on tensors of any rank.\n No data conversion happens during a reshape operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reshape\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reshape\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Reshape %input1, %shape : !spirv.arm.tensor<25x6x29x35xi16>, !spirv.arm.tensor<4xi32> -> !spirv.arm.tensor<125x6x7x29xi16>\n %1 = spirv.Tosa.Reshape %input1, %shape : !spirv.arm.tensor<1x2x7x2xf32>, !spirv.arm.tensor<3xi32> -> !spirv.arm.tensor<2x1x14xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" }, { "name": "shape", "type": "SPIRV_I32_1DTensorArmOfLength1To6" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $shape\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Resize", "summary": "Resize operation, supports various resize/upsample modes.", "description": "Resizes a tensor. Resize is only allowed in the H and W dimensions, given the input\n shape = [N,H,W,C].\n\n The height dimension (H) is scaled by factor ($ scale_y_n/scale_y_d $). The width\n dimension (W) is scaled by factor ($ scale_x_n/scale_x_d $).\n\n The NearestNeighbor mode returns the value of the input tensor closest to\n the calculated sample position for both floating-point and integer data\n formats.\n\n Floating-point Bilinear mode returns a bilinearly interpolated output value\n based on the four closest input sample positions.\n\n For integer Bilinear interpolation mode, the output value must be scaled by\n $ 1/(scale_y_n * scale_x_n) $ in a following operation to complete the\n interpolation (for example with a rescale operator).\n\n The output dimensions can be derived from the input dimensions by inverting\n the scale. The [border_y, border_x] values adjust the output size to allow\n fractional sampling beyond integer input position (H - 1,W - 1).\n\n The limit MAX_SCALE=256 is applied to each scale ratio after reduction of the\n ratio. Individual scale numerator and denominator values are allowed to be\n larger than MAX_SCALE.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_resize\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_resize\n\n #### Example:\n ```mlir\n %4 = spirv.Tosa.Resize mode = , %input, %scale, %offset, %border : !spirv.arm.tensor<1x1x31x55xi8>, !spirv.arm.tensor<4xi32>, !spirv.arm.tensor<2xi32>, !spirv.arm.tensor<2xi32> -> !spirv.arm.tensor<1x1x278x55xi8>\n %4 = spirv.Tosa.Resize mode = , %input, %scale, %offset, %border : !spirv.arm.tensor<1x48x33x63xf32>, !spirv.arm.tensor<4xi32>, !spirv.arm.tensor<2xi32>, !spirv.arm.tensor<2xi32> -> !spirv.arm.tensor<1x753x297x63xf32>\n ```\n\n The resize tensors are ordered as\n `%scale = [scale_y_n, scale_y_d, scale_x_n, scale_x_d]`,\n `%offset = [offset_y, offset_x]`, and `%border = [border_y, border_x]`;\n for example, `%scale = [2, 1, 3, 2]` means \"double height and scale width\n by 3/2\".", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16_TensorArm4D" }, { "name": "scale", "type": "SPIRV_I32_1DTensorArmOfLength4" }, { "name": "offset", "type": "SPIRV_I32_1DTensorArmOfLength2" }, { "name": "border", "type": "SPIRV_I32_1DTensorArmOfLength2" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrI8OrI64OrI16OrF16OrF32OrBF16_TensorArm4D" } ], "attributes": [ { "name": "mode", "type": "SPIRV_TosaExtResizeModeAttr{NearestNeighbor|Bilinear}" } ], "assemblyFormat": "`mode` `=` $mode `,`\n $input `,`\n $scale `,`\n $offset `,`\n $border\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Reverse", "summary": "Reverse operator.", "description": "Returns a tensor with the same type/values as the input, with the data\n reversed along the given axis. No data conversion happens during a reverse\n operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_reverse\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_reverse\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Reverse axis = 2, %input1 : !spirv.arm.tensor<20x5x28x31xi32> -> !spirv.arm.tensor<20x5x28x31xi32>\n %1 = spirv.Tosa.Reverse axis = 1, %input1 : !spirv.arm.tensor<21x34x47xf32> -> !spirv.arm.tensor<21x34x47xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr]>" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "`axis` `=` $axis `,`\n $input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.RFFT2D", "summary": "Performs RFFT2D operation on the input.", "description": "Performs a batched 2D real-valued Fast Fourier Transform over the input where\n the input tensor consists of real values producing complex valued output. The\n complex output values will be split into the output_real and output_imag\n tensor arguments. This operator takes advantage of Hermitian symmetry to only\n calculate the first half of the final output axis. Implementations may choose\n to skip calculation of the imaginary values at (0,0), (0,W/2), (H/2,0), and\n (H/2, W/2). If the calculation is skipped, the result at that location must be\n zero.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_rfft2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_rfft2d\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.RFFT2D local_bound = false, %input_real : !spirv.arm.tensor<1x32x32xf32> -> !spirv.struct<(!spirv.arm.tensor<1x32x17xf32>, !spirv.arm.tensor<1x32x17xf32>)>\n %1 = spirv.CompositeExtract %0[0 : i32] : !spirv.struct<(!spirv.arm.tensor<1x32x17xf32>, !spirv.arm.tensor<1x32x17xf32>)>\n %2 = spirv.CompositeExtract %0[1 : i32] : !spirv.struct<(!spirv.arm.tensor<1x32x17xf32>, !spirv.arm.tensor<1x32x17xf32>)>\n ```", "operands": [ { "name": "input_real", "type": "SPIRV_F32_TensorArm3D" } ], "results": [ { "name": "output", "type": "SPIRV_Struct_2_F32_TensorArm3D" } ], "attributes": [ { "name": "local_bound", "type": "ConfinedAttr" } ], "assemblyFormat": "`local_bound` `=` $local_bound `,`\n $input_real\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Rsqrt", "summary": "Reverse Square Root operator.", "description": "Elementwise Reciprocal Square Root operation ($ 1/sqrt $). Input and\n Output types must match. For integer operation, a table should be used\n with the appropriate ranges.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_rsqrt\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_rsqrt\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Rsqrt %input1 : !spirv.arm.tensor<40x57x56xf32> -> !spirv.arm.tensor<40x57x56xf32>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Scatter", "summary": "Scatter operation.", "description": "The values_out tensor is set to the values_in tensor with data modified as\n follows: data from the input tensor is inserted at the positions specified\n by the indices tensor. In use cases that require multiple updates to the\n same output position, these must be decomposed into multiple scatter\n operations. Undefined behaviour may occur if the specified indices are\n out of range or duplicate indices are provided.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_scatter\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_scatter\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Scatter %values_in, %indices, %input1 : !spirv.arm.tensor<34x28x54xi32>, !spirv.arm.tensor<34x18xi32>, !spirv.arm.tensor<34x18x54xi32> -> !spirv.arm.tensor<34x28x54xi32>\n %0 = spirv.Tosa.Scatter %values_in, %indices, %input1 : !spirv.arm.tensor<18x34x25xf16>, !spirv.arm.tensor<18x20xi32>, !spirv.arm.tensor<18x20x25xf16> -> !spirv.arm.tensor<18x34x25xf16>\n ```\n\n If a row of `%indices` is `[4, 9]`, the two subtensors from `%input1` are\n written into slices 4 and 9 of `%values_in` for that batch.", "operands": [ { "name": "values_in", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm3D" }, { "name": "indices", "type": "SPIRV_I32_TensorArm2D" }, { "name": "input", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm3D" } ], "results": [ { "name": "values_out", "type": "SPIRV_I8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm3D" } ], "traits": [ { "type": "AllTypesMatch<['values_in', 'values_out']>" } ], "assemblyFormat": "$values_in `,`\n $indices `,`\n $input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Select", "summary": "Select operator.", "description": "Elementwise Select of the output based on a condition.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_select\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_select\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Select %cond, %trueVal, %falseVal : !spirv.arm.tensor<4x1x4x5xi1>, !spirv.arm.tensor<4x6x4x5xi8>, !spirv.arm.tensor<4x6x4x5xi8> -> !spirv.arm.tensor<4x6x4x5xi8>\n %0 = spirv.Tosa.Select %cond, %trueVal, %falseVal : !spirv.arm.tensor<9x2x15x8xi1>, !spirv.arm.tensor<9x2x15x8xf16>, !spirv.arm.tensor<9x1x15x8xf16> -> !spirv.arm.tensor<9x2x15x8xf16>\n ```", "operands": [ { "name": "condition", "type": "SPIRV_Bool_TensorArm" }, { "name": "true_value", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16_TensorArm" }, { "name": "false_value", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16_TensorArm" } ], "assemblyFormat": "$condition `,`\n $true_value `,`\n $false_value\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Sigmoid", "summary": "Sigmoid operator.", "description": "Applies the sigmoid logistic function to each element of the input tensor:\n $ sigmoid(x) = \\frac{1}{1 + e^{-x}} $.\n\n For quantized integer data types, the `spirv.Tosa.Table` operator should be used instead.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_sigmoid\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_sigmoid\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Sigmoid %input : !spirv.arm.tensor<28x43x45xf32> -> !spirv.arm.tensor<28x43x45xf32>\n ```", "operands": [ { "name": "input", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input', 'output']>" } ], "assemblyFormat": "$input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Sin", "summary": "Sin operator.", "description": "Elementwise Sine operation for values given in radians. Input and Output types must match.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_sin\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_sin\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Sin %input1 : !spirv.arm.tensor<49x38x58xf16> -> !spirv.arm.tensor<49x38x58xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input1', 'output']>" } ], "assemblyFormat": "$input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Slice", "summary": "Slice operator.", "description": "Extracts a slice of input1, beginning at the start coordinates,\n and extending for size elements in each direction.\n No data conversion happens during a slice operation.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_slice\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_slice\n\n #### Example:\n ```mlir\n %2 = spirv.Tosa.Slice %input1, %start, %size : !spirv.arm.tensor<32x19x41xi8>, !spirv.arm.tensor<3xi32>, !spirv.arm.tensor<3xi32> -> !spirv.arm.tensor<21x5x2xi8>\n %2 = spirv.Tosa.Slice %input1, %start, %size : !spirv.arm.tensor<30x45x29xf32>, !spirv.arm.tensor<3xi32>, !spirv.arm.tensor<3xi32> -> !spirv.arm.tensor<5x12x11xf32>\n ```\n\n For the first example, `%start = [3, 10, 20]` and `%size = [21, 5, 2]`\n extract `%input1[3:24, 10:15, 20:22]`.", "operands": [ { "name": "input1", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" }, { "name": "start", "type": "SPIRV_I32_1DTensorArmOfLength1To6" }, { "name": "size", "type": "SPIRV_I32_1DTensorArmOfLength1To6" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $start `,`\n $size\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Sub", "summary": "Subtraction operator.", "description": "Elementwise Subtraction of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match. Integer element\n types are always interpreted as signed. The behavior is undefined if the\n integer subtraction overflows or underflows the signed integer range.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_sub\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_sub\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Sub %input1, %input2 : !spirv.arm.tensor<6x10x6x6xi32>, !spirv.arm.tensor<1x10x6x6xi32> -> !spirv.arm.tensor<6x10x6x6xi32>\n %0 = spirv.Tosa.Sub %input1, %input2 : !spirv.arm.tensor<1x10x13x12xf16>, !spirv.arm.tensor<6x10x13x12xf16> -> !spirv.arm.tensor<6x10x13x12xf16>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" }, { "name": "input2", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrF16OrF32OrBF16_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $input2\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Table", "summary": "Table lookup operator.", "description": "Table lookup operation. For int8_t, perform a 256 entry table lookup\n returning an int8_t value. For int16_t tables, the int16_t input is treated\n as a fixed-point 9.7 value. The most significant 9 bits are used to index\n into the table. The fractional 7 bits are used to interpolate based on\n table[index] and table[index+1]. The behavior is undefined if during the\n interpolation step, the integer subtraction table[index+1] - table[index]\n overflows or underflows the signed int16 range.\n\n For int16_t inputs, this operator returns a 16.7 interpolated value in an\n int32_t. This value can then be input to the `spirv.Tosa.Rescale` operator\n to scale to the required output data type. Note that int16_t table has 513\n values to handle table[index+1] when index=511.\n\n An int16_t to int16_t table lookup can be constructed as follows:\n * Use the table operator to produce a fixed point 16.7 interpolated result\n * Use `spirv.Tosa.Rescale` (in_t=int32_t, out_t=int16_t, scale=1<<14, shift=21)\n to scale the output to int16_t range (or alternate scale as required)\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_table\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_table\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Table %input, %table : !spirv.arm.tensor<3x2x15x7xi8>, !spirv.arm.tensor<256xi8> -> !spirv.arm.tensor<3x2x15x7xi8>\n ```\n\n In the example, `%table` is the 256-entry lookup table, such as a\n precomputed quantized activation curve.", "operands": [ { "name": "input1", "type": "SPIRV_I8OrI16_TensorArm" }, { "name": "table", "type": "SPIRV_I8OrI16_TensorArm1D" } ], "results": [ { "name": "output", "type": "SPIRV_I8OrI32_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $table\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Tanh", "summary": "Hyperbolic Tangent operator.", "description": "Elementwise Parameterized Hyperbolic Tangent: $ tanh(x) = \\frac{1 - e^{-2x}}{1 + e^{-2x}} $.\n\n For quantized integer data types, the `spirv.Tosa.Table` operator should be used instead.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_tanh\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_tanh\n\n #### Example:\n ```mlir\n %0 = spirv.Tosa.Tanh %input : !spirv.arm.tensor<46x50x36xf16> -> !spirv.arm.tensor<46x50x36xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_F16OrF32OrBF16_TensorArm" } ], "traits": [ { "type": "AllTypesMatch<['input', 'output']>" } ], "assemblyFormat": "$input\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Tile", "summary": "Tile operator.", "description": "Replicates input1 multiples times along each dimension.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_tile\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_tile\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Tile %input1, %multiples : !spirv.arm.tensor<10x28x21xi16>, !spirv.arm.tensor<3xi32> -> !spirv.arm.tensor<10x28x63xi16>\n %1 = spirv.Tosa.Tile %input1, %multiples : !spirv.arm.tensor<31x19x5xf16>, !spirv.arm.tensor<3xi32> -> !spirv.arm.tensor<62x57x10xf16>\n ```\n\n For `%multiples = [1, 1, 3]`, the first two dimensions will be tiled once,\n while the third will be tiled 3 times.", "operands": [ { "name": "input1", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" }, { "name": "multiples", "type": "SPIRV_I32_1DTensorArmOfLength1To6" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "assemblyFormat": "$input1 `,`\n $multiples\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.Transpose", "summary": "Transpose operator.", "description": "Permutes the dimensions of the input tensor input1 based on the perms\n argument. Each value in the perms list must be a valid dimension of the\n input tensor and may not be repeated.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_transpose\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_transpose\n\n #### Example:\n ```mlir\n %1 = spirv.Tosa.Transpose perms = [2, 0, 1, 3], %input1 : !spirv.arm.tensor<14x28x1x61xi16> -> !spirv.arm.tensor<1x14x28x61xi16>\n %1 = spirv.Tosa.Transpose perms = [2, 0, 1], %input1 : !spirv.arm.tensor<42x22x49xi1> -> !spirv.arm.tensor<49x42x22xi1>\n ```", "operands": [ { "name": "input1", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "results": [ { "name": "output", "type": "SPIRV_BoolOrI8OrI16OrI32OrF16OrF32OrBF16OrFP8_TensorArm" } ], "attributes": [ { "name": "perms", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`perms` `=` custom($perms) `,`\n $input1\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Tosa.TransposeConv2D", "summary": "Transpose 2D Convolution operator.", "description": "Performs a 2D transposed convolution over the given tensor input, using the\n weights tensor. Implementations may choose to skip calculation of multiplies\n by zero at fractional input positions.\n\n Input and weight have respective zero point values provided in input_zp and weight_zp.\n\n The behaviour is undefined if the accumulated result overflows or underflows.\n\n References:\n * https://github.khronos.org/SPIRV-Registry/extended/TOSA.001000.1.html#_transpose_conv2d\n * https://www.mlplatform.org/tosa/tosa_spec_1_0_1.html#_transpose_conv2d\n\n #### Example:\n ```mlir\n %6 = spirv.Tosa.TransposeConv2D out_pad = [0, 0, 0, 0], stride = [1, 1], acc_type = , local_bound = false, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<1x13x33x3xi16>, !spirv.arm.tensor<11x1x3x3xi8>, !spirv.arm.tensor<1xi64>, !spirv.arm.tensor<1xi16>, !spirv.arm.tensor<1xi8> -> !spirv.arm.tensor<1x13x35x11xi64>\n %6 = spirv.Tosa.TransposeConv2D out_pad = [0, 1, 0, 0], stride = [1, 8], acc_type = , local_bound = true, %input, %weight, %bias, %input_zp, %weight_zp : !spirv.arm.tensor<10x24x9x13xf16>, !spirv.arm.tensor<14x1x1x13xf16>, !spirv.arm.tensor<14xf16>, !spirv.arm.tensor<1xf16>, !spirv.arm.tensor<1xf16> -> !spirv.arm.tensor<10x25x65x14xf16>\n ```", "operands": [ { "name": "input", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "weight", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_TensorArm4D" }, { "name": "bias", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm1D" }, { "name": "input_zp", "type": "SPIRV_I8OrI16OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" }, { "name": "weight_zp", "type": "SPIRV_I8OrF16OrF32OrBF16OrFP8_1DTensorArmOfLength1" } ], "results": [ { "name": "output", "type": "SPIRV_I32OrI64OrF16OrF32OrBF16_TensorArm4D" } ], "attributes": [ { "name": "out_pad", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType]>" }, { "name": "stride", "type": "ConfinedAttr, [SPIRV_DenseElementAttrsWithTensorArmType, IntElementsAttrAllValuesAtLeast<1>]>" }, { "name": "acc_type", "type": "SPIRV_TosaExtAccTypeAttr{INT32|FP16|FP32|INT48}" }, { "name": "local_bound", "type": "ConfinedAttr" } ], "assemblyFormat": "`out_pad` `=` custom($out_pad) `,`\n `stride` `=` custom($stride) `,`\n `acc_type` `=` $acc_type `,`\n `local_bound` `=` $local_bound `,`\n $input `,`\n $weight `,`\n $bias `,`\n $input_zp `,`\n $weight_zp\n attr-dict `:` type(operands) `->` type(results)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Transpose", "summary": "Transpose a matrix.", "description": "Result Type must be an OpTypeMatrix.\n\n Matrix must be an object of type OpTypeMatrix. The number of columns and\n the column size of Matrix must be the reverse of those in Result Type.\n The types of the scalar components in Matrix and Result Type must be the\n same.\n\n Matrix must have of type of OpTypeMatrix.\n\n #### Example:\n\n ```mlir\n %0 = spirv.Transpose %matrix: !spirv.matrix<2 x vector<3xf32>> ->\n !spirv.matrix<3 x vector<2xf32>>\n ```", "operands": [ { "name": "matrix", "type": "SPIRV_AnyMatrix" } ], "results": [ { "name": "result", "type": "SPIRV_AnyMatrix" } ], "assemblyFormat": "operands attr-dict `:` type($matrix) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.UConvert", "summary": "Convert unsigned width. This is either a truncate or a zero extend.", "description": "Result Type must be a scalar or vector of integer type, whose Signedness\n operand is 0.\n\n Unsigned Value must be a scalar or vector of integer type. It must have\n the same number of components as Result Type. The component width\n cannot equal the component width in Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %1 = spirv.UConvert %0 : i32 to i64\n %3 = spirv.UConvert %2 : vector<3xi32> to vector<3xi64>\n ```", "operands": [ { "name": "operand", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.UDiv", "summary": "Unsigned-integer division of Operand 1 divided by Operand 2.", "description": "Result Type must be a scalar or vector of integer type, whose Signedness\n operand is 0.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0.\n\n #### Example:\n\n ```mlir\n %4 = spirv.UDiv %0, %1 : i32\n %5 = spirv.UDiv %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOrCoopMatrixOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.UDot", "summary": "Unsigned integer dot product of Vector 1 and Vector 2.", "description": "Result Type must be an integer type with Signedness of 0 whose Width\n must be greater than or equal to that of the components of Vector 1 and\n Vector 2.\n\n Vector 1 and Vector 2 must have the same type.\n\n Vector 1 and Vector 2 must be either 32-bit integers (enabled by the\n DotProductInput4x8BitPacked capability) or vectors of integer type with\n Signedness of 0 (enabled by the DotProductInput4x8Bit or\n DotProductInputAll capability).\n\n When Vector 1 and Vector 2 are scalar integer types, Packed Vector\n Format must be specified to select how the integers are to be\n interpreted as vectors.\n\n All components of the input vectors are zero-extended to the bit width\n of the result's type. The zero-extended input vectors are then\n multiplied component-wise and all components of the vector resulting\n from the component-wise multiplication are added together. The resulting\n value will equal the low-order N bits of the correct result R, where N\n is the result width and R is computed with enough precision to avoid\n overflow and underflow.\n\n \n\n #### Example:\n\n ```mlir\n %r = spirv.UDot %a, %b, : i32 -> i32\n %r = spirv.UDot %a, %b, : i32 -> i64\n %r = spirv.UDot %a, %b : vector<4xi8> -> i32\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "vector2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" } ], "assemblyFormat": "$vector1 `,` $vector2 ( `,` $format^ )? attr-dict `:`\n type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.UDotAccSat", "summary": "Unsigned integer dot product of Vector 1 and Vector 2 and unsigned\n saturating addition of the result with Accumulator.", "description": "Result Type must be an integer type with Signedness of 0 whose Width\n must be greater than or equal to that of the components of Vector 1 and\n Vector 2.\n\n Vector 1 and Vector 2 must have the same type.\n\n Vector 1 and Vector 2 must be either 32-bit integers (enabled by the\n DotProductInput4x8BitPacked capability) or vectors of integer type with\n Signedness of 0 (enabled by the DotProductInput4x8Bit or\n DotProductInputAll capability).\n\n The type of Accumulator must be the same as Result Type.\n\n When Vector 1 and Vector 2 are scalar integer types, Packed Vector\n Format must be specified to select how the integers are to be\n interpreted as vectors.\n\n All components of the input vectors are zero-extended to the bit width\n of the result's type. The zero-extended input vectors are then\n multiplied component-wise and all components of the vector resulting\n from the component-wise multiplication are added together. Finally, the\n resulting sum is added to the input accumulator. This final addition is\n saturating.\n\n If any of the multiplications or additions, with the exception of the\n final accumulation, overflow or underflow, the result of the instruction\n is undefined.\n\n \n\n #### Example:\n\n ```mlir\n %r = spirv.UDotAccSat %a, %b, %acc, : i32 -> i32\n %r = spirv.UDotAccSat %a, %b, %acc, : i32 -> i64\n %r = spirv.UDotAccSat %a, %b, %acc : vector<4xi8> -> i32\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "vector2", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "accumulator", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_Integer" } ], "attributes": [ { "name": "format", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['vector1', 'vector2']>" }, { "type": "AllTypesMatch<['accumulator', 'result']>" } ], "assemblyFormat": "$vector1 `,` $vector2 `,` $accumulator ( `,` $format^ )? attr-dict `:`\n type($vector1) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.UGreaterThan", "summary": "Unsigned-integer comparison if Operand 1 is greater than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.UGreaterThan %0, %1 : i32\n %5 = spirv.UGreaterThan %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.UGreaterThanEqual", "summary": "Unsigned-integer comparison if Operand 1 is greater than or equal to\n Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.UGreaterThanEqual %0, %1 : i32\n %5 = spirv.UGreaterThanEqual %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.ULessThan", "summary": "Unsigned-integer comparison if Operand 1 is less than Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.ULessThan %0, %1 : i32\n %5 = spirv.ULessThan %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.ULessThanEqual", "summary": "Unsigned-integer comparison if Operand 1 is less than or equal to\n Operand 2.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n The type of Operand 1 and Operand 2 must be a scalar or vector of\n integer type. They must have the same component width, and they must\n have the same number of components as Result Type.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.ULessThanEqual %0, %1 : i32\n %5 = spirv.ULessThanEqual %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.UMod", "summary": "Unsigned modulo operation of Operand 1 modulo Operand 2.", "description": "Result Type must be a scalar or vector of integer type, whose Signedness\n operand is 0.\n\n The types of Operand 1 and Operand 2 both must be the same as Result\n Type.\n\n Results are computed per component. The resulting value is undefined\n if Operand 2 is 0.\n\n #### Example:\n\n ```mlir\n %4 = spirv.UMod %0, %1 : i32\n %5 = spirv.UMod %2, %3 : vector<4xi32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "AllTypesMatch<['operand1', 'operand2', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.UMulExtended", "summary": "Result is the full value of the unsigned integer multiplication of\n Operand 1 and Operand 2.", "description": "Result Type must be from OpTypeStruct. The struct must have two\n members, and the two members must be the same type. The member type\n must be a scalar or vector of integer type, whose Signedness operand is\n 0.\n\n Operand 1 and Operand 2 must have the same type as the members of Result\n Type. These are consumed as unsigned integers.\n\n Results are computed per component.\n\n Member 0 of the result gets the low-order bits of the multiplication.\n\n Member 1 of the result gets the high-order bits of the multiplication.\n\n \n\n #### Example:\n\n ```mlir\n %2 = spirv.UMulExtended %0, %1 : !spirv.struct<(i32, i32)>\n %2 = spirv.UMulExtended %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_AnyStruct" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.Undef", "summary": "Make an intermediate object whose value is undefined.", "description": "Result Type is the type of object to make.\n\n Each consumption of Result `` yields an arbitrary, possibly different\n bit pattern or abstract value resulting in possibly different concrete,\n abstract, or opaque values.\n\n #### Example:\n\n ```mlir\n %0 = spirv.Undef : f32\n %1 = spirv.Undef : !spirv.struct>>\n ```", "results": [ { "name": "result", "type": "SPIRV_Type" } ], "assemblyFormat": "attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.Unordered", "summary": "Result is true if either x or y is an IEEE NaN, otherwise result is\n false.", "description": "Result Type must be a scalar or vector of Boolean type.\n\n x must be a scalar or vector of floating-point type. It must have the\n same number of components as Result Type.\n\n y must have the same type as x.\n\n Results are computed per component.\n\n #### Example:\n\n ```mlir\n %4 = spirv.Unordered %0, %1 : f32\n %5 = spirv.Unordered %2, %3 : vector<4xf32>\n ```", "operands": [ { "name": "operand1", "type": "SPIRV_ScalarOrVectorOf" }, { "name": "operand2", "type": "SPIRV_ScalarOrVectorOf" } ], "results": [ { "name": "result", "type": "SPIRV_ScalarOrVectorOf" } ], "traits": [ { "type": "TypesMatchWith<'operand1', 'result', 'getMatchingBoolType($_self)'>" } ], "assemblyFormat": "$operand1 `,` $operand2 `:` type($operand1) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.Unreachable", "summary": "Behavior is undefined if this instruction is executed.", "description": "This instruction must be the last instruction in a block.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "spirv.Variable", "summary": "Allocate an object in memory, resulting in a pointer to it, which can be\n used with OpLoad and OpStore.", "description": "Result Type must be an OpTypePointer. Its Type operand is the type of\n object in memory.\n\n Storage Class is the Storage Class of the memory holding the object.\n Since the op is used to model function-level variables, the storage class\n must be the `Function` Storage Class.\n\n Initializer is optional. If Initializer is present, it will be the\n initial value of the variable's memory content. Initializer must be an\n `` from a constant instruction or a global (module scope) OpVariable\n instruction. Initializer must have the same type as the type pointed to\n by Result Type.\n\n From `SPV_KHR_physical_storage_buffer`:\n If an OpVariable's pointee type is a pointer (or array of pointers) in\n PhysicalStorageBuffer storage class, then the variable must be decorated\n with exactly one of AliasedPointer or RestrictPointer.\n\n \n\n ```\n variable-op ::= ssa-id `=` `spirv.Variable` (`init(` ssa-use `)`)?\n attribute-dict? `:` spirv-pointer-type\n ```\n\n where `init` specifies initializer.\n\n #### Example:\n\n ```mlir\n %0 = spirv.Constant ...\n\n %1 = spirv.Variable : !spirv.ptr\n %2 = spirv.Variable init(%0): !spirv.ptr\n\n %3 = spirv.Variable {aliased_pointer} :\n !spirv.ptr, Function>\n ```", "operands": [ { "name": "initializer", "type": "Optional" } ], "results": [ { "name": "pointer", "type": "SPIRV_AnyPtr" } ], "attributes": [ { "name": "storage_class", "type": "SPIRV_StorageClassAttr{UniformConstant|Input|Uniform|Output|Workgroup|CrossWorkgroup|Private|Function|Generic|PushConstant|AtomicCounter|Image|StorageBuffer|CallableDataKHR|IncomingCallableDataKHR|RayPayloadKHR|HitAttributeKHR|IncomingRayPayloadKHR|ShaderRecordBufferKHR|PhysicalStorageBuffer|TaskPayloadWorkgroupEXT|CodeSectionINTEL|DeviceOnlyINTEL|HostOnlyINTEL}" } ], "hasCustomAssemblyFormat": true }, { "name": "spirv.VectorExtractDynamic", "summary": "Extract a single, dynamically selected, component of a vector.", "description": "Result Type must be a scalar type.\n\n Vector must have a type OpTypeVector whose Component Type is Result\n Type.\n\n Index must be a scalar integer. It is interpreted as a 0-based index of\n which component of Vector to extract.\n\n Behavior is undefined if Index's value is less than zero or greater than\n or equal to the number of components in Vector.\n\n \n\n #### Example:\n\n ```\n %2 = spirv.VectorExtractDynamic %0[%1] : vector<8xf32>, i32\n ```", "operands": [ { "name": "vector", "type": "SPIRV_ExtendedVector" }, { "name": "index", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ExtendedScalar" } ], "traits": [ { "type": "TypesMatchWith<'vector', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$vector `[` $index `]` attr-dict `:` type($vector) `,` type($index)", "hasCustomAssemblyFormat": true }, { "name": "spirv.VectorInsertDynamic", "summary": "Make a copy of a vector, with a single, variably selected, component\n modified.", "description": "Result Type must be an OpTypeVector.\n\n Vector must have the same type as Result Type and is the vector that the\n non-written components are copied from.\n\n Component is the value supplied for the component selected by Index. It\n must have the same type as the type of components in Result Type.\n\n Index must be a scalar integer. It is interpreted as a 0-based index of\n which component to modify.\n\n Behavior is undefined if Index's value is less than zero or greater than\n or equal to the number of components in Vector.\n\n #### Example:\n\n ```mlir\n %scalar = ... : f32\n %2 = spirv.VectorInsertDynamic %scalar, %0[%1] : vector<8xf32>, i32\n ```", "operands": [ { "name": "vector", "type": "SPIRV_ExtendedVector" }, { "name": "component", "type": "SPIRV_ExtendedScalar" }, { "name": "index", "type": "SPIRV_Integer" } ], "results": [ { "name": "result", "type": "SPIRV_ExtendedVector" } ], "traits": [ { "type": "TypesMatchWith<'vector', 'component', '::llvm::cast($_self).getElementType()'>" }, { "type": "AllTypesMatch<['vector', 'result']>" } ], "assemblyFormat": "$component `,` $vector `[` $index `]` attr-dict `:` type($vector) `,` type($index)", "hasCustomAssemblyFormat": true }, { "name": "spirv.VectorShuffle", "summary": "Select arbitrary components from two vectors to make a new vector.", "description": "Result Type must be an OpTypeVector. The number of components in Result\n Type must be the same as the number of Component operands.\n\n Vector 1 and Vector 2 must both have vector types, with the same\n Component Type as Result Type. They do not have to have the same number\n of components as Result Type or with each other. They are logically\n concatenated, forming a single vector with Vector 1's components\n appearing before Vector 2's. The components of this logical vector are\n logically numbered with a single consecutive set of numbers from 0 to N\n - 1, where N is the total number of components.\n\n Components are these logical numbers (see above), selecting which of the\n logically numbered components form the result. Each component is an\n unsigned 32-bit integer. They can select the components in any order\n and can repeat components. The first component of the result is selected\n by the first Component operand, the second component of the result is\n selected by the second Component operand, etc. A Component literal may\n also be FFFFFFFF, which means the corresponding result component has no\n source and is undefined. All Component literals must either be FFFFFFFF\n or in [0, N - 1] (inclusive).\n\n Note: A vector “swizzle” can be done by using the vector for both Vector\n operands, or using an OpUndef for one of the Vector operands.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.VectorShuffle [1: i32, 3: i32, 5: i32] %vector1, %vector2 :\n vector<4xf32>, vector<2xf32> -> vector<3xf32>\n ```", "operands": [ { "name": "vector1", "type": "SPIRV_ExtendedVector" }, { "name": "vector2", "type": "SPIRV_ExtendedVector" } ], "results": [ { "name": "result", "type": "SPIRV_ExtendedVector" } ], "attributes": [ { "name": "components", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "attr-dict $components $vector1 `,` $vector2 `:`\n type($vector1) `,` type($vector2) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.VectorTimesMatrix", "summary": "Linear-algebraic Vector X Matrix.", "description": "Result Type must be a vector of floating-point type.\n\n Vector must be a vector with the same Component Type as the Component\n Type in Result Type. Its number of components must equal the number of\n components in each column in Matrix.\n\n Matrix must be a matrix with the same Component Type as the Component\n Type in Result Type. Its number of columns must equal the number of\n components in Result Type.\n\n \n\n #### Example:\n\n ```mlir\n %result = spirv.VectorTimesMatrix %vector, %matrix : vector<4xf32>, !spirv.matrix<4 x vector<4xf32>> -> vector<4xf32>\n ```", "operands": [ { "name": "vector", "type": "SPIRV_VectorOf" }, { "name": "matrix", "type": "SPIRV_MatrixOf" } ], "results": [ { "name": "result", "type": "SPIRV_VectorOf" } ], "assemblyFormat": "operands attr-dict `:` type($vector) `,` type($matrix) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "spirv.VectorTimesScalar", "summary": "Scale a floating-point vector.", "description": "Result Type must be a vector of floating-point type.\n\n The type of Vector must be the same as Result Type. Each component of\n Vector is multiplied by Scalar.\n\n Scalar must have the same type as the Component Type in Result Type.\n\n \n\n #### Example:\n\n ```mlir\n %0 = spirv.VectorTimesScalar %vector, %scalar : vector<4xf32>\n ```", "operands": [ { "name": "vector", "type": "VectorOfLengthAndType<[2, 3, 4], [SPIRV_Float]>" }, { "name": "scalar", "type": "SPIRV_Float" } ], "results": [ { "name": "result", "type": "VectorOfLengthAndType<[2, 3, 4], [SPIRV_Float]>" } ], "assemblyFormat": "operands attr-dict `:` `(` type(operands) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "stablehlo.abs", "summary": "Abs operation", "description": "Performs element-wise abs operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#abs\n\n Example:\n ```mlir\n %result = stablehlo.abs %operand : tensor<3xi32>\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[ HLO_SInt, HLO_Float, HLO_Complex, HLO_QuantizedInt ]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[ HLO_SInt, HLO_Float, HLO_QuantizedInt ]>" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.add", "summary": "Add operation", "description": "Performs element-wise addition of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#add\n\n Example:\n ```mlir\n %result = stablehlo.add %lhs, %rhs : tensor<2x2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_TensorOrPerAxisQuantizedTensor" }, { "name": "rhs", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.after_all", "summary": "AfterAll operation", "description": "Ensures that the operations producing the `inputs` are executed before any\n operations that depend on `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#after_all\n\n Example:\n ```mlir\n %result = stablehlo.after_all %input0, %input1 : !stablehlo.token\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Token" } ], "assemblyFormat": "$inputs attr-dict\n `:` custom(ref($inputs), type($inputs), type($result))" }, { "name": "stablehlo.all_gather", "summary": "AllGather operation", "description": "Within each process group in the process grid, concatenates the values of the\n `operand` tensor from each process along `all_gather_dim` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_gather\n\n Example:\n ```mlir\n %result:2 = \"stablehlo.all_gather\"(%operand0, %operand1) {\n all_gather_dim = 1 : i64,\n replica_groups = #stablehlo.replica_group_mesh_axes<\n mesh = #stablehlo.mesh]>, axes = [\"foo\"]>,\n channel_handle = #stablehlo.channel_handle\n } : (tensor<2x2xi64>, tensor<2x2xi64>) -> (tensor<2x4xi64>, tensor<2x4xi64>)\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "all_gather_dim", "type": "ConfinedAttr" }, { "name": "replica_groups", "type": "StableHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" }, { "name": "use_global_device_ids", "type": "UnitAttr" } ] }, { "name": "stablehlo.all_reduce", "summary": "AllReduce operation", "description": "Within each process group in the process grid, applies a reduction function\n `computation` to the values of the `operand` tensor from each process and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_reduce\n\n Example:\n ```mlir\n %result:2 = \"stablehlo.all_reduce\"(%operand0, %operand0) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"stablehlo.add\"(%arg0, %arg1) : (tensor, tensor) -> tensor\n \"stablehlo.return\"(%0) : (tensor) -> ()\n }) {\n replica_groups = #stablehlo.replica_group_mesh_axes<\n mesh = #stablehlo.mesh]>, axes = [\"foo\"]\n >,\n channel_handle = #stablehlo.channel_handle\n } : (tensor<4xi64>, tensor<4xi64>) -> (tensor<4xi64>, tensor<4xi64>)\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "replica_groups", "type": "StableHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" }, { "name": "use_global_device_ids", "type": "UnitAttr" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.all_to_all", "summary": "AllToAll operation", "description": "Within each process group in the process grid, splits the values of the\n `operand` tensor along `split_dimension` into parts, scatters the split parts\n between the processes, concatenates the scattered parts along `concat_dimension`\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_to_all\n\n Example:\n ```mlir\n %result:2 = \"stablehlo.all_to_all\"(%operand1, %operand2) {\n split_dimension = 1 : i64,\n concat_dimension = 0 : i64,\n split_count = 2 : i64,\n replica_groups = #stablehlo.replica_group_mesh_axes<\n mesh = #stablehlo.mesh]>, axes = [\"foo\"]\n >\n } : (tensor<2x4xi64>, tensor<2x4xi64>) -> (tensor<4x2xi64>, tensor<4x2xi64>)\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "split_dimension", "type": "ConfinedAttr" }, { "name": "concat_dimension", "type": "ConfinedAttr" }, { "name": "split_count", "type": "ConfinedAttr" }, { "name": "replica_groups", "type": "StableHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" } ] }, { "name": "stablehlo.and", "summary": "And operation", "description": "Performs element-wise AND of two tensors `lhs` and `rhs` and produces a\n `result` tensor\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#and\n\n Example:\n ```mlir\n %result = stablehlo.and %lhs, %rhs : tensor<2x2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_PredOrIntTensor" }, { "name": "rhs", "type": "HLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.async_done", "summary": "AsyncDone operation", "description": "Waits for the completion of an asynchronous execution of an operation.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#async_done\n\n Example:\n ```mlir\n %0 = \"stablehlo.async_start\"(%arg0) ({\n %1 = \"stablehlo.all_gather\"(%arg0) {\n all_gather_dim = 1 : i64,\n replica_groups = dense<[[0, 2, 4, 6], [1, 3, 5, 7]]> : tensor<2x4xi64>\n } : (tensor<8x2xf32>) -> tensor<8x8xf32>\n \"stablehlo.return\"(%1) : (tensor<8x8xf32>) -> ()\n }) : (tensor<8x2xf32>) -> !stablehlo.future>\n %2 = \"stablehlo.async_done\"(%0) : (!stablehlo.future>) -> tensor<8x8xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Future" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ] }, { "name": "stablehlo.async_start", "summary": "AsyncStart operation", "description": "Starts an asynchronous execution of an operation.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#async_start\n\n Example:\n ```mlir\n %0 = \"stablehlo.async_start\"(%arg0) ({\n %1 = \"stablehlo.all_gather\"(%arg0) {\n all_gather_dim = 1 : i64,\n replica_groups = dense<[[0, 2, 4, 6], [1, 3, 5, 7]]> : tensor<2x4xi64>\n } : (tensor<8x2xf32>) -> tensor<8x8xf32>\n \"stablehlo.return\"(%1) : (tensor<8x8xf32>) -> ()\n }) : (tensor<8x2xf32>) -> !stablehlo.future>\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Future" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "stablehlo.atan2", "summary": "Atan2 operation", "description": "Performs element-wise atan2 operation on `lhs` and `rhs` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#atan2\n\n Example:\n ```mlir\n %result = stablehlo.atan2 %lhs, %rhs : tensor<3xf64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_FpComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.batch_norm_grad", "summary": "BatchNormGrad operation", "description": "Computes gradients of several inputs of BatchNormTrainingOp backpropagating\n from `grad_output`, and produces `grad_operand`, `grad_scale` and\n `grad_offset` tensors.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#batch_norm_grad\n\n Example:\n ```mlir\n %grad_operand, %grad_scale, %grad_offset =\n \"stablehlo.batch_norm_grad\"(%operand, %scale, %mean, %variance, %grad_output) {\n epsilon = 0.0 : f32,\n feature_index = 2 : i64\n } : (tensor<2x2x2xf64>, tensor<2xf64>, tensor<2xf64>, tensor<2xf64>,\n tensor<2x2x2xf64>) -> (tensor<2x2x2xf64>, tensor<2xf64>, tensor<2xf64>)\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "scale", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "mean", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "variance", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "grad_output", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" } ], "results": [ { "name": "grad_operand", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "grad_scale", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "grad_offset", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "feature_index", "type": "ConfinedAttr" } ] }, { "name": "stablehlo.batch_norm_inference", "category": "Normalization", "summary": "BatchNormInference operation", "description": "Normalizes the `operand` tensor across all dimensions except for the\n `feature_index` dimension and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#batch_norm_inference\n\n Example:\n ```mlir\n %result = \"stablehlo.batch_norm_inference\"(%operand, %scale, %offset, %mean, %variance) {\n epsilon = 0.0 : f32,\n feature_index = 2 : i64\n } : (tensor<2x2x2xf64>, tensor<2xf64>, tensor<2xf64>, tensor<2xf64>, tensor<2xf64>) -> tensor<2x2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "scale", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "offset", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "mean", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "variance", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "feature_index", "type": "ConfinedAttr" } ] }, { "name": "stablehlo.batch_norm_training", "summary": "BatchNormTraining operation", "description": "Computes mean and variance across batch and spatial dimensions and\n normalizes the `operand` tensor, for each feature in the `feature_index`\n dimension and produces `output`, `batch_mean` and `batch_var` tensors.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#batch_norm_training\n\n Example:\n ```mlir\n %output, %batch_mean, %batch_var = \"stablehlo.batch_norm_training\"(%operand, %scale, %offset) {\n epsilon = 0.0 : f32,\n feature_index = 2 : i64\n } : (tensor<2x2x2xf64>, tensor<2xf64>, tensor<2xf64>) ->\n (tensor<2x2x2xf64>, tensor<2xf64>, tensor<2xf64>)\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "scale", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "offset", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" } ], "results": [ { "name": "output", "type": "RankedTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "batch_mean", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" }, { "name": "batch_var", "type": "1DTensorOf<[HLO_Float, HLO_QuantizedInt]>" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "feature_index", "type": "ConfinedAttr" } ] }, { "name": "stablehlo.bitcast_convert", "summary": "BitcastConvert operation", "description": "Performs a bitcast operation on `operand` tensor and produces a `result`\n tensor where the bits of the entire `operand` tensor are reinterpreted using\n the type of the `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#bitcast_convert\n\n Example:\n ```mlir\n %result = stablehlo.bitcast_convert %operand : (tensor) -> tensor<4xf16>\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.broadcast", "summary": "Broadcast operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as XLA's Broadcast:\n https://www.tensorflow.org/xla/operation_semantics#broadcast\n\n Example:\n ```mlir\n %result = stablehlo.broadcast %operand, sizes = [1, 2] : (tensor<3xi32>) -> tensor<1x2x3xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "broadcast_sizes", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` `sizes` `=` $broadcast_sizes\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.broadcast_in_dim", "category": "Shape", "summary": "BroadcastInDim operation", "description": "Expands the dimensions and/or rank of an input tensor by duplicating the\n data in the `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#broadcast_in_dim\n\n Example:\n ```mlir\n %result = stablehlo.broadcast_in_dim %operand, dims = [2, 1] : (tensor<1x3xi32>) -> tensor<2x3x2xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_StaticShapeTensorPerAxisQuantizedTensorOrBoundedTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` `dims` `=` $broadcast_dimensions\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.case", "summary": "Case operation", "description": "Produces the output from executing exactly one `function` from `branches`\n depending on the value of `index`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#case\n\n Example:\n ```mlir\n %result0, %result1 = \"stablehlo.case\"(%index) ({\n stablehlo.return %result_branch0, %result_branch0 : tensor<2xi64>, tensor<2xi64>\n }, {\n stablehlo.return %result_branch1, %result_branch1 : tensor<2xi64>, tensor<2xi64>\n }) : (tensor) -> (tensor<2xi64>, tensor<2xi64>)\n ```", "operands": [ { "name": "index", "type": "I32RankedTensor" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "branches", "type": "VariadicRegion>" } ] }, { "name": "stablehlo.cbrt", "summary": "Cbrt operation", "description": "Performs element-wise cubic root operation on `operand` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cbrt\n\n Example:\n ```mlir\n %result = stablehlo.cbrt %operand : tensor<4xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.ceil", "summary": "Ceil operation", "description": "Performs element-wise ceil of `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#ceil\n\n Example:\n ```mlir\n %result = stablehlo.ceil %operand : tensor<5xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.cholesky", "summary": "Cholesky operation", "description": "Computes the Cholesky decomposition of a batch of matrices.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cholesky\n\n Example:\n ```mlir\n %result = stablehlo.cholesky %a, lower = true : tensor<3x3xf64>\n ```", "operands": [ { "name": "a", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "lower", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$a (`,` `lower` `=` $lower^)? attr-dict `:` custom(type($a), type($result))" }, { "name": "stablehlo.clamp", "category": "Activation", "summary": "Clamp operation", "description": "Clamps every element of the `operand` tensor between a minimum and maximum\n value and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#clamp\n\n Example:\n ```mlir\n %result = stablehlo.clamp %min, %operand, %max : tensor<3xi32>\n ```", "operands": [ { "name": "min", "type": "HLO_Tensor" }, { "name": "operand", "type": "HLO_Tensor" }, { "name": "max", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$min `,` $operand `,` $max attr-dict\n `:` custom(type($min), type($operand), type($max), type($result))" }, { "name": "stablehlo.collective_broadcast", "summary": "CollectiveBroadcast operation", "description": "Within each process group in the process grid, send the value of the\n `operand` tensor from the source process to the target processes and produce a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#collective_broadcast\n\n Example:\n ```mlir\n %result = \"stablehlo.collective_broadcast\"(%operand) {\n replica_groups = #stablehlo.replica_group_mesh_axes<\n mesh = #stablehlo.mesh]>, axes = [\"foo\"]\n >,\n channel_handle = #stablehlo.channel_handle\n } : (tensor<1x2xi64>) -> tensor<1x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "replica_groups", "type": "StableHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" } ] }, { "name": "stablehlo.collective_permute", "summary": "CollectivePermute operation", "description": "Within each process group in the process grid, sends the value of the\n `operand` tensor from the source process to the target process and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#collective_permute\n\n Example:\n ```mlir\n %result = \"stablehlo.collective_permute\"(%operand) {\n source_target_pairs = dense<[[0, 1], [1, 2]]> : tensor<2x2xi64>,\n channel_handle = #stablehlo.channel_handle\n } : (tensor<2x2xi64>) -> tensor<2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "source_target_pairs", "type": "I64ElementsAttr" }, { "name": "channel_handle", "type": "OptionalAttr" } ] }, { "name": "stablehlo.compare", "summary": "Compare operation", "description": "Performs element-wise comparison of `lhs` and `rhs` tensors according to\n `comparison_direction` and `compare_type`, and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#compare\n\n Example:\n ```mlir\n %result = stablehlo.compare LT, %lhs, %rhs, FLOAT : (tensor<2xf32>, tensor<2xf32>) -> tensor<2xi1>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_PredTensor" } ], "attributes": [ { "name": "comparison_direction", "type": "StableHLO_ComparisonDirectionAttr{EQ|NE|GE|GT|LE|LT}" }, { "name": "compare_type", "type": "OptionalAttr" } ], "assemblyFormat": "$comparison_direction `,` $lhs `,` $rhs (`,` $compare_type^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.complex", "summary": "Complex operation", "description": "Performs element-wise conversion to a complex value from a pair of real and\n imaginary values, `lhs` and `rhs`, and produces a `result` tensor.\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#complex\n Example:\n ```mlir\n %result = stablehlo.complex %lhs, %rhs : tensor<2xcomplex>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Fp32Or64Tensor" }, { "name": "rhs", "type": "HLO_Fp32Or64Tensor" } ], "results": [ { "name": "result", "type": "HLO_ComplexTensor" } ], "assemblyFormat": "operands attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.composite", "summary": "Composite operation", "description": "Encapsulates an operation made up (composed) of other StableHLO operations,\n taking `inputs` and `composite_attributes` and producing `results`. The\n semantics of the op are implemented by the `decomposition` attribute. The\n `composite` op can be replaced with its decomposition without changing program\n semantics. In cases where inlining the decomposition does not provide the same\n op semantics, prefer using `custom_call`.\n\n The `version` field (defaults to `0`) is used to denote when a composite's\n semantics change.\n\n The intent of `composite_regions` is to only be used to model ops with\n bodies, regions are thrown away if the fallback decomposition function gets\n inlined.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#composite\n\n Example:\n ```mlir\n %results = stablehlo.composite \"my.op\" %input0, %input1 {\n composite_attributes = {\n my_attribute = \"my_value\"\n },\n decomposition = @my_op,\n version = 1 : i32\n } : (tensor, tensor) -> tensor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "composite_attributes", "type": "DefaultValuedOptionalAttr" }, { "name": "decomposition", "type": "FlatSymbolRefAttr" }, { "name": "version", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "composite_regions", "type": "VariadicRegion" } ], "assemblyFormat": "$name operands (` ` `(` $composite_regions^ `)`)? attr-dict\n `:` functional-type(operands, results)" }, { "name": "stablehlo.concatenate", "category": "Tensor", "summary": "Concatenate operation", "description": "Concatenates a variadic number of tensors in `inputs` along `dimension`\n dimension in the same order as the given arguments and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#concatenate\n\n Example:\n ```mlir\n %result = stablehlo.concatenate %input0, %input1, dim = 0 : (tensor<3x2xi64>, tensor<1x2xi64>) -> tensor<4x2xi64>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" } ], "assemblyFormat": "custom($inputs) `dim` `=` $dimension attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.constant", "summary": "Constant operation", "description": "Produces an `output` tensor from a constant `value`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#constant\n\n Example:\n ```mlir\n %output = stablehlo.constant dense<[[0.0, 1.0], [2.0, 3.0]]> : tensor<2x2xf32>\n ```", "results": [ { "name": "output", "type": "HLO_StaticShapeTensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "stablehlo.convert", "summary": "Convert operation", "description": "Performs an element-wise conversion from one element type to another on\n `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#convert\n\n Example:\n ```mlir\n %result = stablehlo.convert %operand : (tensor<3xi64>) -> tensor<3xcomplex>\n ```", "operands": [ { "name": "operand", "type": "HLO_NonQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_NonQuantizedTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.convolution", "category": "Layer", "summary": "Convolution operation", "description": "Computes dot products between windows of `lhs` and slices of `rhs` and\n produces `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#convolution\n\n Example:\n ```mlir\n %result = stablehlo.convolution(%lhs, %rhs)\n dim_numbers = [b, 0, 1, f]x[0, 1, i, o]->[b, 0, 1, f],\n window = {\n stride = [4, 4],\n pad = [[0, 0], [0, 0]],\n lhs_dilate = [2, 2],\n rhs_dilate = [1, 1],\n reverse = [0, 0]\n } {\n feature_group_count = 1 : i64,\n batch_group_count = 1 : i64,\n precision_config = [#stablehlo, #stablehlo]\n } :\n (tensor<1x4x4x1xi64>, tensor<3x3x1x1xi64>) -> tensor<1x2x2x1xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "window_strides", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" }, { "name": "lhs_dilation", "type": "OptionalAttr" }, { "name": "rhs_dilation", "type": "OptionalAttr" }, { "name": "window_reversal", "type": "OptionalAttr" }, { "name": "dimension_numbers", "type": "StableHLO_ConvDimensionNumbers" }, { "name": "feature_group_count", "type": "ConfinedAttr" }, { "name": "batch_group_count", "type": "ConfinedAttr" }, { "name": "precision_config", "type": "OptionalAttr>" } ], "assemblyFormat": "`(`operands`)`\n `dim_numbers` `=` custom($dimension_numbers) `,`\n `window` `=` `{` custom($window_strides, $padding,\n $lhs_dilation, $rhs_dilation,\n $window_reversal) `}`\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.cosine", "summary": "Cosine operation", "description": "Performs element-wise cosine operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cosine\n\n Example:\n ```mlir\n %result = stablehlo.cosine %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.count_leading_zeros", "summary": "Clz operation", "description": "Performs element-wise count of the number of leading zero bits in the\n `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#count_leading_zeros\n\n Example:\n ```mlir\n %result = stablehlo.count_leading_zeros %operand : tensor<2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.create_token", "summary": "CreateToken operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as AfterAllOp with 0 inputs:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#after_all\n\n Example:\n ```mlir\n %output = stablehlo.create_token : !stablehlo.token\n ```", "results": [ { "name": "output", "type": "HLO_Token" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "stablehlo.cross-replica-sum", "summary": "CrossReplicaSum operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as AllReduceOp with\n `channel_id = 0`, `use_global_device_ids = false` and `computation`\n implementing addition:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_reduce\n\n Example:\n ```mlir\n %result = \"stablehlo.cross-replica-sum\"(%operand) {\n replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>\n } : (tensor<4xf32>) -> tensor<4xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "replica_groups", "type": "I64ElementsAttr" } ] }, { "name": "stablehlo.custom_call", "summary": "CustomCall operation", "description": "Encapsulates an implementation-defined operation `call_target_name` that\n takes `inputs` and `called_computations` and produces `results`.\n\n Depending on the API version there are two ways to pass extra bits of static\n information to the external function:\n 1. Use `API_VERSION_TYPED_FFI` which allows passing a dictionary attribute.\n 2. Use a previous API version with a StringAttr to encode backend config.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#custom_call\n\n Example:\n ```mlir\n %results = stablehlo.custom_call @foo(%input0) {\n backend_config = {bar = 42 : i32},\n api_version = 4 : i32,\n called_computations = [@foo]\n } : (tensor) -> tensor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "call_target_name", "type": "StrAttr" }, { "name": "has_side_effect", "type": "DefaultValuedOptionalAttr" }, { "name": "backend_config", "type": "OptionalAttr>" }, { "name": "api_version", "type": "DefaultValuedOptionalAttr" }, { "name": "called_computations", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "operand_layouts", "type": "OptionalAttr>" }, { "name": "result_layouts", "type": "OptionalAttr>" }, { "name": "output_operand_aliases", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "result_tilings", "type": "OptionalAttr>>" } ], "assemblyFormat": "custom($call_target_name) `(` $inputs `)`\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.divide", "summary": "Div operation", "description": "Performs element-wise division of dividend `lhs` and divisor `rhs` tensors\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#divide\n\n Example:\n ```mlir\n %result = stablehlo.divide %lhs, %rhs : tensor<4xf32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.dot", "summary": "Dot operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as XLA's Dot:\n https://www.tensorflow.org/xla/operation_semantics#dot\n\n Example:\n ```mlir\n %0 = stablehlo.dot %arg0, %arg1 : (tensor<1x2xi32>, tensor<2x1xi32>) -> tensor<1x1xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "precision_config", "type": "OptionalAttr>" } ], "assemblyFormat": "$lhs `,` $rhs `` custom($precision_config) attr-dict\n `:` functional-type(operands, results)" }, { "name": "stablehlo.dot_general", "summary": "DotGeneral operation", "description": "Computes dot products between slices of `lhs` and slices of `rhs` and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dot_general\n\n Example:\n ```mlir\n %result = stablehlo.dot_general %lhs, %rhs,\n batching_dims = [0] x [0],\n contracting_dims = [2] x [1],\n precision = [DEFAULT, DEFAULT],\n algorithm = \n : (tensor<2x2x2xi64>, tensor<2x2x2xi64>) -> tensor<2x2x2xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "dot_dimension_numbers", "type": "StableHLO_DotDimensionNumbers" }, { "name": "precision_config", "type": "OptionalAttr>" }, { "name": "algorithm", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs `,` custom($dot_dimension_numbers) ``\n custom($precision_config, $algorithm) attr-dict\n `:` functional-type(operands, results)" }, { "name": "stablehlo.dynamic_broadcast_in_dim", "summary": "DynamicBroadcastInDim operation", "description": "This operation is functionally identical to\n [broadcast_in_dim](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#broadcast_in_dim)\n op, but the result shape is specified dynamically via `output_dimensions`.\n\n It also accepts optional attributes to express static knowledge about the\n expanding behavior of dimensions. If not specified, all dimensions are\n assumed to be possibly expanding. The sets of dimensions that are known to\n be expanding and the set of dimensions that are known to be non-expanding\n must be disjoint and they must be a subset of the operand's dimensions.\n\n See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_broadcast_in_dim\n\n Example:\n ```mlir\n %operand = stablehlo.constant dense<[[1, 2, 3]]> : tensor<1x3xi64>\n %output_dimensions = stablehlo.constant dense<[2, 3, 2]> : tensor<3xi64>\n %result = \"stablehlo.dynamic_broadcast_in_dim\"(%operand, %output_dimensions) {\n broadcast_dimensions = array,\n known_expanding_dimensions = array,\n known_nonexpanding_dimensions = array\n } : (tensor<1x3xi64>, tensor<3xi64>) -> tensor<2x3x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" }, { "name": "output_dimensions", "type": "HLO_StaticDimensionTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "DenseI64ArrayAttr" }, { "name": "known_expanding_dimensions", "type": "OptionalAttr" }, { "name": "known_nonexpanding_dimensions", "type": "OptionalAttr" } ], "assemblyFormat": "$operand `,` $output_dimensions `,` `dims` `=` $broadcast_dimensions\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.dynamic_conv", "summary": "DynamicConv operation", "description": "This operation is functionally identical to\n [convolution](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#convolution)\n op, but the padding is specified dynamically via `padding`.\n\n Example:\n ```mlir\n %padding = stablehlo.constant dense<2> : tensor<2x2xi64>\n %result = \"stablehlo.dynamic_conv\"(%lhs, %rhs, %padding) {\n window_strides = array,\n lhs_dilation = array,\n rhs_dilation = array,\n window_reversal = array,\n dimension_numbers = #stablehlo.conv<[b, 0, 1, f]x[0, 1, i, o]->[b, 0, 1, f]>,\n batch_group_count = 1 : i64,\n feature_group_count = 1 : i64,\n precision_config = [#stablehlo, #stablehlo]\n } : (tensor<1x4x4x1xi64>, tensor<3x3x1x1xi64>, tensor<2x2xi64>) -> tensor<1x2x2x1xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" }, { "name": "padding", "type": "HLO_Static2DIntTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "window_strides", "type": "OptionalAttr" }, { "name": "lhs_dilation", "type": "OptionalAttr" }, { "name": "rhs_dilation", "type": "OptionalAttr" }, { "name": "window_reversal", "type": "OptionalAttr" }, { "name": "dimension_numbers", "type": "StableHLO_ConvDimensionNumbers" }, { "name": "feature_group_count", "type": "ConfinedAttr" }, { "name": "batch_group_count", "type": "ConfinedAttr" }, { "name": "precision_config", "type": "OptionalAttr>" } ] }, { "name": "stablehlo.dynamic_gather", "summary": "DynamicGather operation", "description": "This operation is functionally identical to\n [gather](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#gather)\n op, with the `slice_sizes` specified dynamically as an operand.\n\n Example:\n ```mlir\n %slice_sizes = stablehlo.constant dense<[1, 2, 2]> : tensor<3xi64>\n %result = \"stablehlo.dynamic_gather\"(%operand, %start_indices, %slice_sizes) {\n dimension_numbers = #stablehlo.gather<\n offset_dims = [2, 3],\n collapsed_slice_dims = [0],\n start_index_map = [0, 2],\n index_vector_dim = 2>,\n indices_are_sorted = false\n } : (tensor<3x4x2xi64>, tensor<2x3x2xi64>, tensor<3xi64>) -> tensor<2x3x2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "HLO_IntTensor" }, { "name": "slice_sizes", "type": "HLO_Static1DIntTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "StableHLO_GatherDimensionNumbers" }, { "name": "indices_are_sorted", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "stablehlo.dynamic_iota", "summary": "DynamicIota operation", "description": "This operation is functionally identical to\n [iota](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#iota)\n op, but the result shape is specified dynamically via `output_shape`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_iota\n\n Example:\n ```mlir\n %output_shape = stablehlo.constant dense<[4, 5]> : tensor<2xi64>\n %0 = stablehlo.dynamic_iota %output_shape, dim = 0 : (tensor<2xi64>) -> tensor<4x5xi64>\n ```", "operands": [ { "name": "output_shape", "type": "HLO_StaticDimensionTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "iota_dimension", "type": "ConfinedAttr" } ], "assemblyFormat": "$output_shape `,` `dim` `=` $iota_dimension attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.dynamic_pad", "summary": "DynamicPad operation", "description": "This operation is functionally identical to\n [pad](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#pad)\n https://github.com/openxla/stablehlo/pull/2306#discussion_r1595669709\n op, but with `edge_padding_low`, `edge_padding_high` and `interior_padding`\n specified dynamically as values.\n\n See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_pad\n\n Example:\n ```mlir\n %edge_padding_low = stablehlo.constant dense<[0, 1]> : tensor<2xi32>\n %edge_padding_high = stablehlo.constant dense<[2, 1]> : tensor<2xi32>\n %interior_padding = stablehlo.constant dense<[1, 2]> : tensor<2xi32>\n %result = stablehlo.dynamic_pad %operand, %padding_value,\n %edge_padding_low, %edge_padding_high, %interior_padding\n : (tensor<2x3xi64>, tensor, tensor<2xi64>, tensor<2xi64>, tensor<2xi64>) -> tensor<5x9xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "padding_value", "type": "HLO_ScalarTensor" }, { "name": "edge_padding_low", "type": "HLO_StaticDimensionTensor" }, { "name": "edge_padding_high", "type": "HLO_StaticDimensionTensor" }, { "name": "interior_padding", "type": "HLO_StaticDimensionTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['edge_padding_low', 'edge_padding_high', 'interior_padding']>" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.dynamic_reshape", "category": "Shape", "summary": "DynamicReshape operation", "description": "This operation is functionally identical to\n [reshape](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reshape)\n op, but the result shape is specified dynamically via `output_shape`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_reshape\n\n Example:\n ```mlir\n %output_shape = stablehlo.constant dense<[3, 2]> : tensor<2xi64>\n %result = stablehlo.dynamic_reshape %operand, %output_shape : (tensor<2x3xi64>, tensor<2xi64>) -> tensor<3x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" }, { "name": "output_shape", "type": "HLO_StaticDimensionTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.dynamic_slice", "category": "Tensor", "summary": "DynamicSlice operation", "description": "Extracts a slice from the `operand` using dynamically-computed starting\n indices and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_slice\n\n Example:\n ```mlir\n %result = stablehlo.dynamic_slice %operand, %start_indices0, %start_indices1, sizes = [2, 2]\n : (tensor<4x4xi32>, tensor, tensor) -> tensor<2x2xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "slice_sizes", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` custom($start_indices)\n `sizes` `=` $slice_sizes attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.dynamic_update_slice", "summary": "DynamicUpdateSlice operation", "description": "Produces a `result` tensor which is equal to the `operand` tensor except\n that the slice starting at `start_indices` is updated with the values in\n `update`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#dynamic_update_slice\n\n Example:\n ```mlir\n %result = stablehlo.dynamic_update_slice %operand, %update, %start_indices0, %start_indices1\n : (tensor<4x4xi32>, tensor<2x2xi32>, tensor, tensor) -> tensor<4x4xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "update", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.einsum", "summary": "Einsum operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as TF's einsum:\n https://www.tensorflow.org/api_docs/python/tf/einsum\n\n Example:\n ```mlir\n %result = \"stablehlo.einsum\"(%lhs, %rhs) {\n einsum_config = \"ab,bc->ac\"\n } : (tensor<4x16xf32>, tensor<16x4xf32>) -> tensor<4x4xf32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "einsum_config", "type": "StrAttr" } ], "assemblyFormat": "$lhs `,` $rhs `,` `config` `=` $einsum_config attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.exponential", "summary": "Exp operation", "description": "Performs element-wise exponential operation on `operand` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#exponential\n\n Example:\n ```mlir\n %result = stablehlo.exponential %operand : tensor<2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.exponential_minus_one", "summary": "Expm1 operation", "description": "Performs element-wise exponential minus one operation on `operand` tensor\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#exponential_minus_one\n\n Example:\n ```mlir\n %result = stablehlo.exponential_minus_one %operand : tensor<2xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.fft", "summary": "Fft operation", "description": "Performs the forward and inverse Fourier transforms for real and complex\n inputs/outputs.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#fft\n\n Example:\n ```mlir\n %result = stablehlo.fft %operand, type = FFT, length = [4] : (tensor<4xcomplex>) -> tensor<4xcomplex>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_FpOrComplexTensor" } ], "attributes": [ { "name": "fft_type", "type": "StableHLO_FftTypeAttr{FFT|IFFT|RFFT|IRFFT}" }, { "name": "fft_length", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` `type` `=` $fft_type `,` `length` `=` $fft_length\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.floor", "summary": "Floor operation", "description": "Performs element-wise floor of `operand` tensor and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#floor\n\n Example:\n ```mlir\n %result = stablehlo.floor %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.gather", "category": "Tensor", "summary": "Gather operation", "description": "Gathers slices from `operand` tensor from offsets specified in\n `start_indices` and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#gather\n\n Example:\n ```mlir\n %result = \"stablehlo.gather\"(%operand, %start_indices) {\n dimension_numbers = #stablehlo.gather<\n offset_dims = [3, 4],\n collapsed_slice_dims = [1],\n operand_batching_dims = [0],\n start_indices_batching_dims = [1],\n start_index_map = [2, 1],\n index_vector_dim = 3>,\n slice_sizes = array,\n indices_are_sorted = false\n } : (tensor<2x3x4x2xi64>, tensor<2x2x3x2xi64>) -> tensor<2x2x3x2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "StableHLO_GatherDimensionNumbers" }, { "name": "slice_sizes", "type": "DenseI64ArrayAttr" }, { "name": "indices_are_sorted", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "stablehlo.get_dimension_size", "summary": "GetDimensionSize operation", "description": "Produces the size of the given `dimension` of the `operand`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#get_dimension_size\n\n Example:\n ```mlir\n %result = stablehlo.get_dimension_size %operand, dim = 1 : (tensor<2x3xi64>) -> tensor\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "I32RankedTensor" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `,` `dim` `=` $dimension attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.get_tuple_element", "summary": "GetTupleElement operation", "description": "Extracts element at `index` position of the `operand` tuple and produces a\n `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#get_tuple_element\n\n Example:\n ```mlir\n %result = stablehlo.get_tuple_element %operand[0] : (tuple, tuple>>) -> tensor<2xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tuple" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensorOrTokenOrTupleOrBuffer" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `[` $index `]` attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.if", "summary": "If operation", "description": "Produces the output from executing exactly one branch from `true_branch` or\n `false_branch` depending on the value of `pred`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#if\n\n Example:\n %result = \"stablehlo.if\"(%pred) ({\n \"stablehlo.return\"(%result_true_branch) : (tensor) -> ()\n }, {\n \"stablehlo.return\"(%result_false_branch) : (tensor) -> ()\n }) : (tensor) -> tensor", "operands": [ { "name": "pred", "type": "HLO_PredTensor" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "true_branch", "type": "SizedRegion<1>" }, { "name": "false_branch", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.imag", "summary": "Imag operation", "description": "Extracts the imaginary part, element-wise, from the `operand` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#imag\n\n Example:\n ```mlir\n %result = stablehlo.imag %operand : (tensor<2xcomplex>) -> tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.infeed", "summary": "Infeed operation", "description": "Reads data from the infeed and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#infeed\n\n Example:\n ```mlir\n %results0:2 = \"stablehlo.infeed\"(%token) :\n (!stablehlo.token) -> (tensor<2x2xi64>, !stablehlo.token)\n ```", "operands": [ { "name": "token", "type": "HLO_Token" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "infeed_config", "type": "DefaultValuedStrAttr" }, { "name": "layout", "type": "OptionalAttr" } ] }, { "name": "stablehlo.iota", "summary": "Iota operation", "description": "Fills an `output` tensor with values in increasing order starting from zero\n along the `iota_dimension` dimension.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#iota\n\n Example:\n ```mlir\n %output = stablehlo.iota dim = 0 : tensor<4x5xi32>\n ```", "results": [ { "name": "output", "type": "HLO_StaticShapeIntFpComplexOrQuantizedTensor" } ], "attributes": [ { "name": "iota_dimension", "type": "ConfinedAttr" } ], "assemblyFormat": "`dim` `=` $iota_dimension attr-dict `:` type($output)" }, { "name": "stablehlo.is_finite", "summary": "IsFinite operation", "description": "Performs element-wise check whether the value in `x` is finite (i.e. is\n neither +Inf, -Inf, nor NaN) and produces a `y` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#is_finite\n\n Example:\n ```mlir\n %y = stablehlo.is_finite %x : (tensor<7xf64>) -> tensor<7xi1>\n ```", "operands": [ { "name": "x", "type": "HLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "y", "type": "HLO_PredTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.log", "summary": "Log operation", "description": "Performs element-wise logarithm operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#log\n\n Example:\n ```mlir\n %result = stablehlo.log %operand : tensor<2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.log_plus_one", "summary": "Log1p operation", "description": "Performs element-wise logarithm plus one operation on `operand` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#log_plus_one\n\n Example:\n ```mlir\n %result = stablehlo.log_plus_one %operand : tensor<5xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.logistic", "summary": "Logistic operation", "description": "Performs element-wise logistic operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#logistic\n\n Example:\n ```mlir\n %result = stablehlo.logistic %operand : tensor<2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.map", "summary": "Map operation", "description": "Applies a map function `computation` to `inputs` along the `dimensions` and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#map\n\n Example:\n ```mlir\n %result = \"stablehlo.map\"(%input0, %input1) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.multiply %arg0, %arg1 : tensor\n stablehlo.return %0 : tensor\n }) {\n dimensions = array\n } : (tensor<2x2xi64>, tensor<2x2xi64>) -> tensor<2x2xi64>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dimensions", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.maximum", "summary": "Max operation", "description": "Performs element-wise max operation on tensors `lhs` and `rhs` and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#maximum\n\n Example:\n ```mlir\n %result = stablehlo.maximum %lhs, %rhs : tensor<4xf32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.minimum", "summary": "Min operation", "description": "Performs element-wise min operation on tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#minimum\n\n Example:\n ```mlir\n %result = stablehlo.minimum %lhs, %rhs : tensor<4xf32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.multiply", "summary": "Mul operation", "description": "Performs element-wise product of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#multiply\n\n Example:\n ```mlir\n %result = stablehlo.multiply %lhs, %rhs : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_Tensor" }, { "name": "rhs", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.negate", "summary": "Neg operation", "description": "Performs element-wise negation of `operand` tensor and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#negate\n\n Example:\n ```mlir\n %result = stablehlo.negate %operand : tensor<2x3xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.not", "summary": "Not operation", "description": "Performs element-wise NOT of tensor `operand` of type integer and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#not\n\n Example:\n ```mlir\n %result = stablehlo.not %operand : tensor<5x3x1xi1>\n ```", "operands": [ { "name": "operand", "type": "HLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_PredOrIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.optimization_barrier", "summary": "OptimizationBarrier operation", "description": "Ensures that the operations that produce the `operand` are executed before any\n operations that depend on the `result` and prevents compiler transformations\n from moving operations across the barrier. Other than that, the operation is\n an identity, i.e. `result` = `operand`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#optimization_barrier\n\n Example:\n ```mlir\n %result0, %result1 = stablehlo.optimization_barrier %operand0, %operand1 : tensor, tensor\n ```", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operand^ `:` custom(type($operand), type($result))):(`(` `)`)?" }, { "name": "stablehlo.or", "summary": "Or operation", "description": "Performs element-wise OR of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#or\n\n Example:\n ```mlir\n %result = stablehlo.or %lhs, %rhs : tensor<2xi1>\n ```", "operands": [ { "name": "lhs", "type": "HLO_PredOrIntTensor" }, { "name": "rhs", "type": "HLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.outfeed", "summary": "Outfeed operation", "description": "Writes `inputs` to the outfeed and produces a `result` token.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#outfeed\n\n Example:\n ```mlir\n %result = \"stablehlo.outfeed\"(%input0, %token) :\n (tensor<2x2x2xi64>, !stablehlo.token) -> !stablehlo.token\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "HLO_Token" } ], "results": [ { "name": "result", "type": "HLO_Token" } ], "attributes": [ { "name": "outfeed_config", "type": "DefaultValuedStrAttr" } ] }, { "name": "stablehlo.pad", "category": "Transform", "summary": "Pad operation", "description": "Expands `operand` by padding around the tensor as well as between the\n elements of the tensor with the given `padding_value`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#pad\n\n Example:\n ```mlir\n %0 = stablehlo.pad %arg0, %arg1, low = [0, 1], high = [2, 1], interior = [1, 2]\n : (tensor<2x3xi32>, tensor) -> tensor<5x9xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "padding_value", "type": "HLO_ScalarTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "edge_padding_low", "type": "DenseI64ArrayAttr" }, { "name": "edge_padding_high", "type": "DenseI64ArrayAttr" }, { "name": "interior_padding", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` $padding_value `,`\n `low` `=` $edge_padding_low `,`\n `high` `=` $edge_padding_high `,`\n `interior` `=` $interior_padding\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.partition_id", "summary": "PartitionId operation", "description": "Produces `partition_id` of the current process.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#partition_id\n\n Example:\n ```mlir\n %result = stablehlo.partition_id : tensor\n ```", "results": [ { "name": "result", "type": "UI32RankedTensor" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "stablehlo.popcnt", "summary": "PopulationCount operation", "description": "Performs element-wise count of the number of bits set in the `operand`\n tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#popcnt\n\n Example:\n ```mlir\n %result = stablehlo.popcnt %operand : tensor<4xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.power", "summary": "Power operation", "description": "Performs element-wise exponentiation of `lhs` tensor by `rhs` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#power\n\n Example:\n ```mlir\n %result = stablehlo.power %lhs, %rhs : tensor<6xf64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.real", "summary": "Real operation", "description": "Extracts the real part, element-wise, from the `operand` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#real\n\n Example:\n ```mlir\n %result = stablehlo.real %operand : (tensor<2xcomplex>) -> tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.real_dynamic_slice", "summary": "RealDynamicSlice operation", "description": "This operation is a work in progress, so it is not yet included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/8.\n\n Informally, this operation does the same thing as SliceOp except\n that `start_indices`, `limit_indices` and `strides` are specified dynamically:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#slice\n\n Example:\n ```mlir\n %result = stablehlo.real_dynamic_slice %operand,\n %start_indices, %limit_indices, %strides\n : (tensor<256x?xf32>, tensor<2xindex>, tensor<2xindex>, tensor<2xindex>) -> tensor<256x?xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "start_indices", "type": "HLO_DimensionTensor" }, { "name": "limit_indices", "type": "HLO_DimensionTensor" }, { "name": "strides", "type": "HLO_DimensionTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "traits": [ { "type": "AllTypesMatch<['start_indices', 'limit_indices', 'strides']>" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.recv", "summary": "Recv operation", "description": "Receives data from a channel with `channel_id` and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#recv\n\n Example:\n ```mlir\n %results:2 = \"stablehlo.recv\"(%token) {\n channel_handle = #stablehlo.channel_handle,\n is_host_transfer = false,\n source_target_pairs = dense<[[0, 1], [1, 2]]> : tensor<2x2xi64>\n } : (!stablehlo.token) -> (tensor<2x2xi64>, !stablehlo.token)\n ```", "operands": [ { "name": "token", "type": "HLO_Token" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "channel_handle", "type": "StableHLO_ChannelHandle" }, { "name": "is_host_transfer", "type": "DefaultValuedOptionalAttr" }, { "name": "source_target_pairs", "type": "OptionalAttr" } ] }, { "name": "stablehlo.reduce", "summary": "Reduce operation", "description": "Applies a reduction function `body` to `inputs` and `init_values` along the\n `dimensions` and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce\n\n Example:\n ```mlir\n %result = \"stablehlo.reduce\"(%input, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.add %arg0, %arg1 : tensor\n stablehlo.return %0 : tensor\n }) {\n dimensions = array\n } : (tensor<1x6xi64>, tensor) -> tensor<1xi64>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimensions", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "stablehlo.reduce_precision", "summary": "ReducePrecision operation", "description": "Performs element-wise conversion of `operand` to another floating-point type\n that uses `exponent_bits` and `mantissa_bits` and back to the original\n floating-point type and produces an `output` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce_precision\n\n Example:\n ```mlir\n %output = stablehlo.reduce_precision %operand, format = e5m10 : tensor<6xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "output", "type": "HLO_FpOrQuantizedIntTensor" } ], "attributes": [ { "name": "exponent_bits", "type": "ConfinedAttr" }, { "name": "mantissa_bits", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `,` `format` `=` custom($exponent_bits, $mantissa_bits)\n attr-dict `:` custom(type($operand), type($output))" }, { "name": "stablehlo.reduce_scatter", "summary": "ReduceScatter operation", "description": "Within each process group in the process grid, performs reduction, using\n `computations`, over the values of the `operand` tensor from each process,\n splits the reduction result along `scatter_dimension` into parts, and\n scatters the split parts between the processes to produce the `result`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce_scatter\n\n Example:\n ```mlir\n %result = \"stablehlo.reduce_scatter\"(%operand) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.add %arg0, %arg1 : tensor\n stablehlo.return %0 : tensor\n }) {\n scatter_dimension = 1 : i64,\n replica_groups = #stablehlo.replica_group_mesh_axes<\n mesh = #stablehlo.mesh]>, axes = [\"foo\"]\n >,\n channel_handle = #stablehlo.channel_handle\n } : (tensor<2x4xi64>) -> tensor<2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "scatter_dimension", "type": "ConfinedAttr" }, { "name": "replica_groups", "type": "StableHLO_ReplicaGroups" }, { "name": "channel_handle", "type": "OptionalAttr" }, { "name": "use_global_device_ids", "type": "UnitAttr" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.reduce_window", "summary": "ReduceWindow operation", "description": "Applies a reduction function `body` to windows of `inputs` and `init_values`\n and produces `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reduce_window\n\n Example:\n ```mlir\n %result = \"stablehlo.reduce_window\"(%input, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.add %arg0, %arg1 : tensor\n stablehlo.return %0 : tensor\n }) {\n window_dimensions = array,\n window_strides = array,\n base_dilations = array,\n window_dilations = array,\n padding = dense<[[2, 1], [0, 0]]> : tensor<2x2xi64>\n } : (tensor<3x2xi64>, tensor) -> tensor<2x2xi64>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "window_dimensions", "type": "DenseI64ArrayAttr" }, { "name": "window_strides", "type": "OptionalAttr" }, { "name": "base_dilations", "type": "OptionalAttr" }, { "name": "window_dilations", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.remainder", "summary": "Rem operation", "description": "Performs element-wise remainder of dividend `lhs` and divisor `rhs` tensors\n and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#remainder\n\n Example:\n ```mlir\n %result = stablehlo.remainder %lhs, %rhs : tensor<4xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.replica_id", "summary": "ReplicaId operation", "description": "Produces `replica_id` of the current process.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#replica_id\n\n Example:\n ```mlir\n %result = stablehlo.replica_id : tensor\n ```", "results": [ { "name": "result", "type": "UI32RankedTensor" } ], "assemblyFormat": "attr-dict `:` type(results)" }, { "name": "stablehlo.reshape", "category": "Shape", "summary": "Reshape operation", "description": "Performs reshape of `operand` tensor to a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reshape\n\n Example:\n ```mlir\n %result = stablehlo.reshape %operand : (tensor<2xf32>) -> tensor<1x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_StaticShapeTensorPerAxisQuantizedTensorOrBoundedTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.return", "summary": "This operation is a work in progress, so it is not yet included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/425.\n\n Informally, this operation serves as a terminator for regions defined by\n the StableHLO ops. Non-StableHLO ops, e.g. `func.func`, have their own\n terminators, e.g. `func.return`.\n\n Example:\n ```mlir\n %result = \"stablehlo.reduce\"(%input, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = \"stablehlo.add\"(%arg0, %arg1) : (tensor, tensor) -> tensor\n \"stablehlo.return\"(%0) : (tensor) -> ()\n }) {\n dimensions = array\n } : (tensor<1x6xi32>, tensor) -> tensor<1xi32>\n ```", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$results attr-dict (`:` type($results)^)?" }, { "name": "stablehlo.reverse", "category": "Transform", "summary": "Reverse operation", "description": "Reverses the order of elements in the `operand` along the specified\n `dimensions` and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reverse\n\n Example:\n ```mlir\n %result = stablehlo.reverse %operand, dims = [1] : tensor<3x2xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dimensions", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` `dims` `=` $dimensions\n attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.rng", "summary": "Rng operation", "description": "Generates random numbers using the `rng_distribution` algorithm and produces\n a `result` tensor of a given shape `shape`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#rng\n\n Example:\n ```mlir\n %result = stablehlo.rng %a, %b, %shape, distribution = NORMAL : (tensor, tensor, tensor<2xi64>) -> tensor<3x3xi32>\n ```", "operands": [ { "name": "a", "type": "0DTensorOf<[HLO_Pred, HLO_Int, HLO_Float]>" }, { "name": "b", "type": "0DTensorOf<[HLO_Pred, HLO_Int, HLO_Float]>" }, { "name": "shape", "type": "HLO_StaticDimensionTensor" } ], "results": [ { "name": "result", "type": "HLO_PredIntOrFpTensor" } ], "attributes": [ { "name": "rng_distribution", "type": "StableHLO_RngDistributionAttr{UNIFORM|NORMAL}" } ], "assemblyFormat": "$a `,` $b `,` $shape `,` `distribution` `=` $rng_distribution\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.rng_bit_generator", "summary": "RngBitGenerator operation", "description": "Returns an `output` filled with uniform random data and an updated output\n state `output_state` given an initial state `initial_state` using the\n pseudorandom number generator algorithm `rng_algorithm`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#rng_bit_generator\n\n Example:\n ```mlir\n %output_state, %output = stablehlo.rng_bit_generator %initial_state, algorithm = THREE_FRY : (tensor<2xui64>) -> (tensor<2xui64>, tensor<2x2xui64>)\n ```", "operands": [ { "name": "initial_state", "type": "HLO_IntOrFpTensor" } ], "results": [ { "name": "output_state", "type": "HLO_IntOrFpTensor" }, { "name": "output", "type": "HLO_StaticShapeIntOrFpTensor" } ], "attributes": [ { "name": "rng_algorithm", "type": "StableHLO_RngAlgorithmAttr{DEFAULT|THREE_FRY|PHILOX}" } ], "assemblyFormat": "$initial_state `,` `algorithm` `=` $rng_algorithm attr-dict\n `:` functional-type(operands, results)" }, { "name": "stablehlo.round_nearest_afz", "summary": "Round operation", "description": "Performs element-wise rounding towards the nearest integer, breaking ties\n away from zero, on the `operand` tensor and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#round_nearest_afz\n\n Example:\n ```mlir\n %result = stablehlo.round_nearest_afz %operand : tensor<5xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.round_nearest_even", "summary": "RoundNearestEven operation", "description": "Performs element-wise rounding towards the nearest integer, breaking ties\n towards the even integer, on the `operand` tensor and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#round_nearest_even\n\n Example:\n ```mlir\n %result = stablehlo.round_nearest_even %operand : tensor<5xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpOrQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.rsqrt", "summary": "Rsqrt operation", "description": "Performs element-wise reciprocal square root operation on `operand` tensor\n and produces a `result` tensor, implementing the `rSqrt` operation from the\n IEEE-754 specification.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#rsqrt\n\n Example:\n ```mlir\n %result = stablehlo.rsqrt %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.scatter", "category": "Tensor", "summary": "Scatter operation", "description": "Produces `results` tensors which are equal to `inputs` tensors except that\n several slices specified by `scatter_indices` are updated with the values\n `updates` using `update_computation`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#scatter\n\n Example:\n ```mlir\n %result = \"stablehlo.scatter\"(%input, %scatter_indices, %update) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.add %arg0, %arg1 : tensor\n stablehlo.return %0 : tensor\n }) {\n scatter_dimension_numbers = #stablehlo.scatter<\n update_window_dims = [3, 4],\n inserted_window_dims = [1],\n input_batching_dims = [0],\n scatter_indices_batching_dims = [1],\n scatter_dims_to_operand_dims = [2, 1],\n index_vector_dim = 3>,\n indices_are_sorted = false,\n unique_indices = false\n } : (tensor<2x3x4x2xi64>, tensor<2x2x3x2xi64>, tensor<2x2x3x2x2xi64>) -> tensor<2x3x4x2xi64>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "scatter_indices", "type": "RankedTensorOf<[AnyInteger, Index]>" }, { "name": "updates", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "scatter_dimension_numbers", "type": "StableHLO_ScatterDimensionNumbers" }, { "name": "indices_are_sorted", "type": "DefaultValuedOptionalAttr" }, { "name": "unique_indices", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "update_computation", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.select", "summary": "Select operation", "description": "Produces a `result` tensor where each element is selected from `on_true` or\n `on_false` tensor based on the value of the corresponding element of `pred`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#select\n\n Example:\n ```mlir\n %result = stablehlo.select %pred, %on_true, %on_false : tensor<2x2xi1>, tensor<2x2xi32>\n ```", "operands": [ { "name": "pred", "type": "HLO_PredTensor" }, { "name": "on_true", "type": "HLO_Tensor" }, { "name": "on_false", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "operands attr-dict `:`\n custom(type($pred), type($on_true), type($on_false), type($result))" }, { "name": "stablehlo.select_and_scatter", "summary": "SelectAndScatter operation", "description": "Scatters the values from the `source` tensor using `scatter` based on the\n outcome of `reduce_window` of the `input` tensor using `select` and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#select_and_scatter\n\n Example:\n ```mlir\n %result = \"stablehlo.select_and_scatter\"(%operand, %source, %init_value) ({\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.compare GE, %arg0, %arg1 : (tensor, tensor) -> tensor\n stablehlo.return %0 : tensor\n }, {\n ^bb0(%arg0: tensor, %arg1: tensor):\n %0 = stablehlo.add %arg0, %arg1 : tensor\n stablehlo.return %0 : tensor\n }) {\n window_dimensions = array,\n window_strides = array,\n padding = dense<[[0, 1], [0, 0]]> : tensor<2x2xi64>\n } : (tensor<4x2xi64>, tensor<2x2xi64>, tensor) -> tensor<4x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "source", "type": "HLO_Tensor" }, { "name": "init_value", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "window_dimensions", "type": "OptionalAttr" }, { "name": "window_strides", "type": "OptionalAttr" }, { "name": "padding", "type": "OptionalAttr" } ], "regions": [ { "name": "select", "type": "SizedRegion<1>" }, { "name": "scatter", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.send", "summary": "Send operation", "description": "Sends `inputs` to a channel `channel_id` and produces a `result` token.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#send\n\n Example:\n ```mlir\n %result = \"stablehlo.send\"(%operand, %token) {\n channel_handle = #stablehlo.channel_handle,\n is_host_transfer = false,\n source_target_pairs = dense<[[0, 1], [1, 2]]> : tensor<2x2xi64>\n } : (tensor<2x2xi64>, !stablehlo.token) -> !stablehlo.token\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "HLO_Token" } ], "results": [ { "name": "result", "type": "HLO_Token" } ], "attributes": [ { "name": "channel_handle", "type": "StableHLO_ChannelHandle" }, { "name": "is_host_transfer", "type": "DefaultValuedOptionalAttr" }, { "name": "source_target_pairs", "type": "OptionalAttr" } ] }, { "name": "stablehlo.set_dimension_size", "summary": "SetDimensionSize operation", "description": "This operation is a work in progress, so it is not yet included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/8.\n\n Informally, this operation does the same thing as XLA's SetDimensionSize:\n https://www.tensorflow.org/xla/operation_semantics#setdimensionsize\n\n Example:\n ```mlir\n %0 = stablehlo.set_dimension_size %arg0, %arg1, dim = 1 : (tensor<4x2xf32>, tensor) -> tensor<4x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "size", "type": "I32RankedTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `,` $size `,` `dim` `=` $dimension attr-dict\n `:` functional-type(operands, results)" }, { "name": "stablehlo.shift_left", "summary": "ShiftLeft operation", "description": "Performs element-wise left-shift operation on the `lhs` tensor by `rhs`\n number of bits and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#shift_left\n\n Example:\n ```mlir\n %result = stablehlo.shift_left %lhs, %rhs : tensor<3xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntTensor" }, { "name": "rhs", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.shift_right_arithmetic", "summary": "ShiftRightArithmetic operation", "description": "Performs element-wise arithmetic right-shift operation on the `lhs` tensor\n by `rhs` number of bits and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#shift_right_arithmetic\n\n Example:\n ```mlir\n %result = stablehlo.shift_right_arithmetic %lhs, %rhs : tensor<3xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntTensor" }, { "name": "rhs", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.shift_right_logical", "summary": "ShiftRightLogical operation", "description": "Performs element-wise logical right-shift operation on the `lhs` tensor by\n `rhs` number of bits and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#shift_right_logical\n\n Example:\n ```mlir\n %result = stablehlo.shift_right_logical %lhs, %rhs : tensor<3xi64>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntTensor" }, { "name": "rhs", "type": "HLO_IntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.sign", "summary": "Sign operation", "description": "Returns the sign of the `operand` element-wise and produces a `result`\n tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sign\n\n Example:\n ```mlir\n %result = stablehlo.sign %operand : tensor<5xf64>\n ```", "operands": [ { "name": "operand", "type": "RankedTensorOf<[ HLO_SInt, HLO_Float, HLO_Complex, HLO_QuantizedInt ]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[ HLO_SInt, HLO_Float, HLO_Complex, HLO_QuantizedInt ]>" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.sine", "summary": "Sine operation", "description": "Performs element-wise sine operation on `operand` tensor and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sine\n\n Example:\n ```mlir\n %result = stablehlo.sine %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.slice", "category": "Tensor", "summary": "Slice operation", "description": "Extracts a slice from the `operand` using statically-computed starting\n indices and produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#slice\n\n Example:\n ```mlir\n %result = stablehlo.slice %operand [1:3, 4:8:2]\n : (tensor<3x8xi64>) -> tensor<2x2xi64>\n\n // Same in generic form: the `1:3` above is mapped to the first entry in\n // `start_indices` and `limit_indices`, while `strides` is implicitly 1.\n // The `4:8:2` above is parsed into the second entry of `start_indices`,\n // `limit_indices` and `strides` respectively.\n %result = \"stablehlo.slice\" (%operand) {\n start_indices = array,\n limit_indices = array,\n strides = array\n } : (tensor<3x8xi64>) -> tensor<2x2xi64>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "start_indices", "type": "DenseI64ArrayAttr" }, { "name": "limit_indices", "type": "DenseI64ArrayAttr" }, { "name": "strides", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand custom($start_indices, $limit_indices, $strides)\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.sort", "summary": "Sort operation", "description": "Sorts a variadic number of tensors in `inputs` together, according to a\n custom `comparator`, along the given `dimension` and produces a variadic\n number of tensors as `results`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sort\n\n Example:\n ```mlir\n %result0, %result1 = \"stablehlo.sort\"(%input0, %input1) ({\n ^bb0(%arg0: tensor, %arg1: tensor, %arg2: tensor, %arg3: tensor):\n %predicate = stablehlo.compare GT, %arg0, %arg1 : (tensor, tensor) -> tensor\n stablehlo.return %predicate : tensor\n }) {\n dimension = 0 : i64,\n is_stable = true\n } : (tensor<2x3xi64>, tensor<2x3xi64>) -> (tensor<2x3xi64>, tensor<2x3xi64>)", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stable", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "comparator", "type": "SizedRegion<1>" } ] }, { "name": "stablehlo.sqrt", "summary": "Sqrt operation", "description": "Performs element-wise square root operation on `operand` tensor and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#sqrt\n\n Example:\n ```mlir\n %result = stablehlo.sqrt %operand : tensor<2x2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.subtract", "summary": "Subtract operation", "description": "Performs element-wise subtraction of two tensors `lhs` and `rhs` and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#subtract\n\n Example:\n ```mlir\n %result = stablehlo.subtract %lhs, %rhs : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" }, { "name": "rhs", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_IntFpOrComplexOrQuantizedIntTensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "stablehlo.tan", "summary": "Tan operation", "description": "Performs element-wise tangent operation on `operand` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#tan\n\n Example:\n ```mlir\n %result = stablehlo.tan %operand : tensor<2x2xf64>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.tanh", "category": "Activation", "summary": "Tanh operation", "description": "Performs element-wise hyperbolic tangent operation on `operand` tensor and\n produces a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#tanh\n\n Example:\n ```mlir\n %result = stablehlo.tanh %operand : tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpComplexOrQuantizedIntTensor" } ], "attributes": [ { "name": "result_accuracy", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.torch_index_select", "summary": "TorchIndexSelect operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as PyTorch's index_select,\n augmented with support for batch dimensions:\n https://pytorch.org/docs/stable/generated/torch.index_select.html.\n\n The `batch_dims` attribute specifies the number of major batch dimensions\n (0 or more) that act like a multidimensional loop over both the operand and\n the index.\n\n Example:\n ```mlir\n %result = \"stablehlo.torch_index_select\"(%operand, %index) {\n dim = 2 : i64,\n batch_dims = 1 : i64\n } : (tensor<8x128x3072x64xf32>, tensor<8x16x1024xi32>) -> tensor<8x128x16x1024x64xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" }, { "name": "index", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" }, { "name": "batch_dims", "type": "I64Attr" } ] }, { "name": "stablehlo.transpose", "category": "Transform", "summary": "Transpose operation", "description": "Permutes the dimensions of `operand` tensor using `permutation` and produces\n a `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#transpose\n\n Example:\n ```mlir\n %0 = stablehlo.transpose %arg0, dims = [2, 1, 0] : (tensor<1x2x3xi32>) -> tensor<3x2x1xi32>\n ```", "operands": [ { "name": "operand", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "results": [ { "name": "result", "type": "HLO_TensorOrPerAxisQuantizedTensor" } ], "attributes": [ { "name": "permutation", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$operand `,` `dims` `=` $permutation\n attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.triangular_solve", "summary": "TriangularSolve operation", "description": "Solves batches of systems of linear equations with lower or upper triangular\n coefficient matrices.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#triangular_solve\n\n Example:\n ```mlir\n %result = \"stablehlo.triangular_solve\"(%a, %b) {\n left_side = true,\n lower = true,\n unit_diagonal = false,\n transpose_a = #stablehlo\n } : (tensor<3x3xf32>, tensor<3x3xf32>) -> tensor<3x3xf32>\n ```", "operands": [ { "name": "a", "type": "HLO_FpOrComplexTensor" }, { "name": "b", "type": "HLO_FpOrComplexTensor" } ], "results": [ { "name": "result", "type": "HLO_FpOrComplexTensor" } ], "attributes": [ { "name": "left_side", "type": "BoolAttr" }, { "name": "lower", "type": "BoolAttr" }, { "name": "unit_diagonal", "type": "BoolAttr" }, { "name": "transpose_a", "type": "StableHLO_TransposeAttr{TRANSPOSE_INVALID|NO_TRANSPOSE|TRANSPOSE|ADJOINT}" } ] }, { "name": "stablehlo.tuple", "summary": "Tuple operation", "description": "Produces a `result` tuple from values `val`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#tuple\n\n Example:\n ```mlir\n %result = stablehlo.tuple %val0, %val1 : tuple, tuple>>\n ```", "operands": [ { "name": "val", "type": "Variadic" } ], "results": [ { "name": "result", "type": "HLO_Tuple" } ], "assemblyFormat": "$val attr-dict `:` custom(type($val), type($result))" }, { "name": "stablehlo.unary_einsum", "summary": "UnaryEinsum operation", "description": "This operation is on its way out of StableHLO, so it is not included in\n the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.\n\n Informally, this operation does the same thing as TF's einsum:\n https://www.tensorflow.org/api_docs/python/tf/einsum\n\n Example:\n ```mlir\n %result = \"stablehlo.unary_einsum\"(%operand) {\n einsum_config = \"ab->a\"\n } : (tensor<4x16xf32>) -> tensor<4xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_Tensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "attributes": [ { "name": "einsum_config", "type": "StrAttr" } ], "assemblyFormat": "$operand `,` `config` `=` $einsum_config attr-dict `:` functional-type(operands, results)" }, { "name": "stablehlo.uniform_dequantize", "summary": "UniformDequantize operation", "description": "Performs element-wise conversion of quantized tensor `operand` to a\n floating-point tensor `result` according to the quantization parameters\n defined by the `operand` type.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#uniform_dequantize\n\n Example:\n ```mlir\n %result = stablehlo.uniform_dequantize %operand : (tensor<2x!quant.uniform>) -> tensor<2xf32>\n ```", "operands": [ { "name": "operand", "type": "HLO_QuantizedIntOrPerAxisQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_FpTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.uniform_quantize", "summary": "UniformQuantize operation", "description": "Performs element-wise conversion of floating-point tensor or quantized\n tensor `operand` to a quantized tensor `result` according to the\n quantization parameters defined by the `result` type.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#uniform_quantize\n\n Example:\n ```mlir\n %result = stablehlo.uniform_quantize %operand : (tensor<2xf32>) -> tensor<2x!quant.uniform>\n ```", "operands": [ { "name": "operand", "type": "HLO_FloatOrQuantizedIntOrPerAxisQuantizedIntTensor" } ], "results": [ { "name": "result", "type": "HLO_QuantizedIntOrPerAxisQuantizedIntTensor" } ], "assemblyFormat": "$operand attr-dict `:` custom(type($operand), type($result))" }, { "name": "stablehlo.while", "summary": "While operation", "description": "Produces the output from executing `body` function 0 or more times while the\n `cond` function outputs `true`.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#while\n\n Example:\n ```mlir\n %results0, %results1 = stablehlo.while(%arg0 = %init_i, %arg1 = %init_sum) : tensor, tensor\n cond {\n %cond = stablehlo.compare LT, %arg0, %ten : (tensor, tensor) -> tensor\n stablehlo.return %cond : tensor\n } do {\n %new_sum = stablehlo.add %arg1, %one : tensor\n %new_i = stablehlo.add %arg0, %one : tensor\n stablehlo.return %new_i, %new_sum : tensor, tensor\n }\n ```", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "cond", "type": "SizedRegion<1>" }, { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "stablehlo.xor", "summary": "Xor operation", "description": "Performs element-wise XOR of two tensors `lhs` and `rhs` and produces a\n `result` tensor.\n\n See:\n https://github.com/openxla/stablehlo/blob/main/docs/spec.md#xor\n\n Example:\n ```mlir\n %result = stablehlo.xor %lhs, %rhs : tensor<2xi32>\n ```", "operands": [ { "name": "lhs", "type": "HLO_PredOrIntTensor" }, { "name": "rhs", "type": "HLO_PredOrIntTensor" } ], "results": [ { "name": "result", "type": "HLO_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict\n `:` custom(type($lhs), type($rhs), type($result))" }, { "name": "standalone.foo", "summary": "Illustrates how to define an operation.", "description": "The `standalone.foo` operation illustrates how to define a new\n operation in a dialect. It uses an operation trait to declare that it\n has no side effects.\n\n This operation takes an integer argument and returns an integer.\n\n Example:\n\n ```mlir\n %0 = arith.constant 2 : i32\n // Apply the foo operation to %0\n %1 = standalone.foo %0 : i32\n ```", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "res", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input attr-dict `:` type($input)" }, { "name": "std.add", "summary": "Polymorphic addition operation (legacy)", "description": "Generic addition operation from the historical Standard dialect.\n This operation takes two operands and returns one result of the same type.\n The type may be an integer or floating point scalar type, a vector whose\n element type is integer or floating point, or a tensor of integers or floats.\n\n Note: The Standard dialect was split in 2021, with arithmetic operations\n moved to the `arith` dialect as `arith.addi` (integer) and `arith.addf`\n (floating point). This entry exists for compatibility with legacy MLIR code\n and symbolic references in reduction operations.\n\n Example:\n\n ```mlir\n // Used symbolically in reduce operations:\n %0 = mhlo.reduce(%arg0 init: %arg1) applies std.add across dimensions = [1]\n : (tensor, tensor) -> tensor\n ```", "operands": [ { "name": "lhs", "type": "AnyType" }, { "name": "rhs", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "stdx.acos", "summary": "arccosine", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.acosh", "summary": "hyperbolic arccosine", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.asin", "summary": "arcsine", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.asinh", "summary": "hyperbolic arcsine", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.atanh", "summary": "hyperbolic arctangent", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.closure", "attributes": [ { "name": "type", "type": "TypeAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "stdx.cosh", "summary": "hyperbolic cosine", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.pack", "summary": "Pack multiple values into a tuple", "operands": [ { "name": "in", "type": "Variadic" } ], "results": [ { "name": "out", "type": "AnyTuple" } ], "assemblyFormat": "`(` $in `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.relu", "summary": "ReLU operation", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.reshape", "summary": "memref reshape operation", "operands": [ { "name": "tensor", "type": "AnyMemRef" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "`(` $tensor `)` attr-dict `:` functional-type($tensor, results)", "hasCustomAssemblyFormat": true }, { "name": "stdx.round", "summary": "round to nearest integer", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.sinh", "summary": "hyperbolic sine", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.subgroup_block_read_intel", "summary": "See intel_subgroups extension.", "operands": [ { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyVectorOrScalar" } ], "assemblyFormat": "$memref `[` $indices `]` attr-dict `:` type($memref)`,` type($result)", "hasCustomAssemblyFormat": true }, { "name": "stdx.subgroup_block_write_intel", "summary": "See intel_subgroups extension.", "operands": [ { "name": "value", "type": "AnyVectorOrScalar" }, { "name": "memref", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "assemblyFormat": "$value `,` $memref `[` $indices `]` attr-dict `:` type($value) `,` type($memref)", "hasCustomAssemblyFormat": true }, { "name": "stdx.subgroup_broadcast", "summary": "broadcast to all elements in subgroup", "operands": [ { "name": "value", "type": "AnyStdScalar" }, { "name": "localid", "type": "Index" } ], "results": [ { "name": "result", "type": "AnyStdScalar" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "`(` $value `,` $localid `)` attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "stdx.tan", "summary": "tangent", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.unpack", "summary": "Unpack multiple values from a tuple", "operands": [ { "name": "in", "type": "AnyTuple" } ], "results": [ { "name": "out", "type": "Variadic" } ], "assemblyFormat": "`(` $in `)` attr-dict `:` functional-type(operands, results)" }, { "name": "stdx.yield", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "stream.async.alloca", "summary": "Allocates a transient value with undefined contents.", "description": "Allocates a transient value (one that is short-lived and local to the\n current computation) with undefined contents. Consumers of the allocated\n result must assume nothing of the contents and use `discard` access.", "operands": [ { "name": "storage_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n attr-dict `:` type($result) `{` $storage_size `}`", "hasCustomAssemblyFormat": true }, { "name": "stream.async.barrier", "summary": "Indicates a value that must have a specific affinity.", "description": "Prevents fusion and scheduling of a value across an affinity boundary.\n May introduce copy-on-write behavior if the operand value is used as well as\n the result and users should try to keep the operand to a single use by this\n op.", "operands": [ { "name": "source", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" }, { "name": "size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:` type($source)\n `` `{` $size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.call", "summary": "Calls a streamable external host function.", "description": "Calls a function taking/returning resource values with stream semantics.\n Asynchronous calls must have no side-effects.\n\n Note that returned resources must have their sizes declared prior to the\n call as this is what allows the call to be made on the stream. If external\n host logic is required to compute the size (avoid at all costs!) a separate\n func.call can be used outside of the stream to do so. If sizes are\n unknownable until the operation is performed it should be made as a normal\n asynchronous host call with 'coarse-fences' instead.", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "resource_operand_offsets", "type": "Variadic" }, { "name": "resource_operand_ends", "type": "Variadic" }, { "name": "resource_operand_lengths", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $callee ``\n custom($resource_operands,\n $resource_operand_offsets,\n $resource_operand_ends,\n $resource_operand_lengths) attr-dict `:`\n custom(ref($resource_operands),\n type($resource_operands), $resource_operand_sizes,\n type($results), $result_sizes,\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "stream.async.cast", "summary": "Casts a resource to a different lifetime within async phase.", "description": "Asserts that a resource has a specific lifetime. This is an async-phase\n operation that participates in scheduling. It must be resolved by\n RefineUsage before leaving the async phase.\n\n If RefineUsage cannot make the source type match the target type by\n backward propagation, it converts this to a proper transfer operation.\n If this op survives past the async phase, it indicates a bug in RefineUsage.\n\n The source and result share the same underlying storage (tied operation).\n\n Example:\n ```mlir\n // Assert resource must resolve to external lifetime.\n %1 = stream.async.cast %0 : !stream.resource<*>{%size} -> !stream.resource{%size}\n ```", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:` type($source) `{` $source_size `}`\n `->` type($result) `{` $result_size `}`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "stream.async.clone", "summary": "Clones the contents of a value.", "description": "Clones the contents of a value at a snapshot in time. Future changes to the\n cloned value will not effect the result. Acts as a copy-on-write operation.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:`\n type($source) `` `{` $source_size `}` `->`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.collective", "summary": "Performs a collective operation.", "description": "TODO: document different usage. For now this should be considered a\n prototype and that modeling of collective operations may change in the\n future to better ensure in-place operations (where send/recv is a subset of\n recv/send). We may have dedicated operations for the send and recv verbs as\n they have sequencing implications - or we could add optional sequencing to\n this base op.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_end", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" }, { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_end", "type": "Stream_Offset" }, { "name": "source_length", "type": "Stream_Size" }, { "name": "element_count", "type": "Stream_Size" }, { "name": "channel", "type": "Stream_Channel" }, { "name": "param", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "op", "type": "Stream_CollectiveAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "`` $op `` `[` $element_count `]`\n (`on` `(` $affinity^ `)`)?\n `channel` `(` $channel `)`\n custom(ref($op), $param) ``\n $source `[` $source_offset `to` $source_end `for` $source_length `]` `,`\n $target `[` $target_offset `to` $target_end `for` $target_length `]` `:`\n type($source) `` `{` $source_size `}` `->`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.concurrent", "summary": "Executes all ops concurrently.", "description": "Represents a wave of work scheduled concurrently (each op executing at the\n same time). All resource inputs must be captured explicitly. All results are\n only ready once all nested ops complete execution.\n\n Waves can be nested to create a DAG. For example, take the following graph:\n ```\n |\n v---------+---------v\n +-------|-------+ +-------|-------+\n | v--+--v | | v--+--v |\n | +----+ +----+ | | +----+ +----+ |\n | | %a | | %b | | | | %c | | %d | |\n | +----+ +----+ | | +----+ +----+ |\n | +--v--+ | | +--v--+ |\n +-------|-------+ +-------|-------+\n +---------v---------+\n |\n ```\n\n Represented with nested waves:\n ```mlir\n %0 = stream.async.concurrent with(%arg) -> ... {\n %1 = stream.async.concurrent with(%arg as %arg0) -> ... {\n %a = ...\n %b = ...\n stream.yield %a, %b\n }\n %2 = stream.async.concurrent with(%arg as %arg1) -> ... {\n %c = ...\n %d = ...\n stream.yield %c, %d\n }\n stream.yield %1, %2\n }\n ```", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "affinity", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n `with` ``\n custom($resource_operands,\n type($resource_operands), $resource_operand_sizes,\n type($results), $result_sizes,\n $tied_operands, $body)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.constant", "summary": "Defines a constant resource.", "description": "Returns a new resource with the given constant value.\n\n When no await_timepoint is specified the constant may be hoisted and\n materialized at any point prior to its first use. When an await_timepoint\n is specified the constant will not begin materialization until that\n timepoint is reached, allowing for explicit ordering with other timeline\n operations.", "operands": [ { "name": "await_timepoint", "type": "Optional" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "value", "type": "AnyAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n `:`\n type($result) `` `{` $result_size `}`\n `=`\n $value\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.copy", "summary": "Copies a subview of a stream resource to another.", "description": "Copies a subview of a resource into a subview of another.\n As with memcpy this does not support overlapping updates into the same\n resource. Unlike `stream.async.update` copy sources cannot be allocated\n in-place.\n\n Equivalent to a stream.async.slice + stream.async.update.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_end", "type": "Stream_Offset" }, { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_end", "type": "Stream_Offset" }, { "name": "length", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `[` $source_offset `to` $source_end `]` `,`\n $target `[` $target_offset `to` $target_end `]` `,`\n $length `:`\n type($source) `` `{` $source_size `}` `->`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.dispatch", "summary": "Dispatches a parallelized grid of work.", "description": "Calls the specified entry point function once for each element in the\n specified workgroup count. Each workgroup has access to the same operands\n and results and is able to load/store at will.", "operands": [ { "name": "workload", "type": "Variadic" }, { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "resource_operand_offsets", "type": "Variadic" }, { "name": "resource_operand_ends", "type": "Variadic" }, { "name": "resource_operand_lengths", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "entry_points", "type": "TypedArrayAttrBase" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n custom($entry_points)\n (`[` $workload^ `]`)? ``\n custom($resource_operands,\n $resource_operand_offsets,\n $resource_operand_ends,\n $resource_operand_lengths) attr-dict `:`\n custom(ref($resource_operands),\n type($resource_operands), $resource_operand_sizes,\n type($results), $result_sizes,\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "stream.async.execute", "summary": "Executes a dependency-aware sequence of streamable ops.", "description": "Evaluates the operations within the region by dependency order while obeying\n ties when present. Nested ops execute serially in block order and nested\n `stream.async.concurrent` ops can be used to run multiple ops concurrently\n within the stream. All resource inputs must be captured explicitly. All\n results are only ready once all nested ops complete execution and the\n returned timepoint is reached. Zero or more timepoints may be provided to\n block execution until they are all reached; zero timepoints indicates that\n execution may begin immediately.", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic>" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "affinity", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `with` ``\n custom($resource_operands,\n type($resource_operands), $resource_operand_sizes,\n type($results), $result_sizes,\n $tied_operands, $body)\n `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.fill", "summary": "Fills a subview of a stream resource with a value.", "description": "Splats a value into a subview of the given stream resource and returns the\n resource with the update applied.\n\n Equivalent to a stream.async.splat + stream.async.update.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_end", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" }, { "name": "value", "type": "Stream_FillPatternType" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $value `,`\n $target `[` $target_offset `to` $target_end `for` $target_length `]` `:`\n type($value) `->`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.func", "summary": "Streamable function declaration.", "description": "Declares a function that can be called as an asynchronous streaming\n operation via `stream.async.call`. Today only external functions are\n allowed.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n ``\n custom($function_type,\n $tied_operands,\n $arg_attrs,\n $res_attrs)\n attr-dict-with-keyword\n ($body^)?", "hasCustomAssemblyFormat": true }, { "name": "stream.async.load", "summary": "Loads a value from a resource.", "description": "Returns the element at the given location from within the resource.", "operands": [ { "name": "source", "type": "Stream_StagingResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "assemblyFormat": "$source `[` $source_offset `]` `:`\n type($source) `` `{` $source_size `}`\n `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.parameter.gather", "summary": "Gathers multiple resources from parameter archives into a target resource.", "description": "Reads multiple parameter ranges from parameter archives and gathers them\n into a single target resource at specified offsets. This is equivalent to\n multiple async.parameter.read operations but allows implementations to\n batch operations for better performance.\n\n Example:\n ```mlir\n %updated, %result_timepoint = stream.async.parameter.gather {\n \"scope\"::\"key0\"[%offset0] -> %target[%target_offset0 to %target_end0 for %length0],\n \"scope\"::\"key1\"[%offset1] -> %target[%target_offset1 to %target_end1 for %length1]\n } : !stream.resource{%target_size} => !stream.timepoint\n ```", "operands": [ { "name": "source_scope", "type": "Optional" }, { "name": "source_keys", "type": "Variadic" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "target_ends", "type": "Variadic" }, { "name": "target_lengths", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n $target, type($target), $target_size, $target_offsets, $target_ends, $target_lengths)\n `}` `:` type($result) `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.parameter.load", "summary": "Allocates and loads a new resource from a parameter archive.", "description": "Allocates a new resource and populates it with data from a parameter archive\n file (or in-memory buffer) at the specified byte offset. Unlike `read` which\n writes into an existing allocation, `load` returns a freshly allocated\n resource. The implementation may use direct access or memory mapping when\n the result resource type allows, avoiding copies entirely.\n\n When no await_timepoint is specified the load may be hoisted and begin at\n any point prior to the first use. When an await_timepoint is specified the\n load will not begin until that timepoint is reached, allowing for explicit\n ordering with other timeline operations.\n\n Example:\n ```mlir\n %result, %result_timepoint = stream.async.parameter.load \"scope\"::\"key\"[%offset]\n : !stream.resource{%size} => !stream.timepoint\n %ordered, %ordered_timepoint = stream.async.parameter.load await(%tp) \"scope\"::\"key2\"[%offset]\n : !stream.resource{%size} => !stream.timepoint\n ```", "operands": [ { "name": "await_timepoint", "type": "Optional" }, { "name": "source_scope", "type": "Optional" }, { "name": "source_key", "type": "Util_BufferType" }, { "name": "source_offset", "type": "I64" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n custom($source_scope, $source_key)\n `` `[` $source_offset `]` `:`\n type($result) `` `{` $result_size `}` `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.parameter.read", "summary": "Reads parameter data into an existing resource allocation.", "description": "Reads data from a parameter archive file (or in-memory buffer) at the\n specified byte offset into an existing target resource. Unlike `load` which\n allocates a new resource, `read` writes into a caller-provided allocation.\n This is useful for partial updates, populating sub-regions of larger\n resources, or when the allocation is managed separately (e.g., staging\n buffers). The target resource is a tied operand: the input is mutated and\n returned with the specified range updated.\n\n Example:\n ```mlir\n %updated, %result_timepoint = stream.async.parameter.read \"scope\"::\"key\"[%param_offset]\n -> %target[%target_offset to %target_end for %length]\n : !stream.resource{%target_size} => !stream.timepoint\n ```", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_end", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" }, { "name": "source_scope", "type": "Optional" }, { "name": "source_key", "type": "Util_BufferType" }, { "name": "source_offset", "type": "I64" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n custom($source_scope, $source_key)\n `` `[` $source_offset `]` `->`\n $target `` `[` $target_offset `to` $target_end `for` $target_length `]` `:`\n type($target) `` `{` $target_size `}` `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.parameter.scatter", "summary": "Scatters multiple ranges from a source resource to parameter archives.", "description": "Writes multiple ranges from a single source resource to parameter archives\n at specified offsets. This is equivalent to multiple async.parameter.write\n operations but allows implementations to batch operations for better\n performance. The source resource is returned unchanged to establish proper\n data flow dependencies.\n\n Example:\n ```mlir\n %result, %result_timepoint = stream.async.parameter.scatter {\n %source[%source_offset0 to %source_end0 for %length0] -> \"scope\"::\"key0\"[%target_offset0],\n %source[%source_offset1 to %source_end1 for %length1] -> \"scope\"::\"key1\"[%target_offset1]\n } : !stream.resource{%source_size} => !stream.timepoint\n ```", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "source_ends", "type": "Variadic" }, { "name": "source_lengths", "type": "Variadic" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_keys", "type": "Variadic" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n `{`\n custom(\n $source, type($source), $source_size, $source_offsets, $source_ends, $source_lengths,\n $target_scope, $target_keys, $target_offsets)\n `}` `:` type($result) `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.parameter.write", "summary": "Writes a resource to a parameter archive from a source resource.", "description": "Writes data from a source resource to a parameter archive file (or in-memory\n buffer) at the specified byte offset. This is useful for checkpointing or\n saving model weights. The source resource is returned unchanged to establish\n proper data flow dependencies.\n\n Example:\n ```mlir\n %result, %result_timepoint = stream.async.parameter.write %source[%source_offset to %source_end for %length]\n -> \"scope\"::\"key\"[%param_offset]\n : !stream.resource{%source_size} => !stream.timepoint\n ```", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_end", "type": "Stream_Offset" }, { "name": "source_length", "type": "Stream_Size" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_key", "type": "Util_BufferType" }, { "name": "target_offset", "type": "I64" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n $source `` `[` $source_offset `to` $source_end `for` $source_length `]` `->`\n custom($target_scope, $target_key)\n `` `[` $target_offset `]` `:`\n type($source) `` `{` $source_size `}` `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.slice", "summary": "Slices out a cloned subview of a value.", "description": "Slices a subrange of a stream resource based on a byte range. Acts as a\n copy-on-write operation.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_end", "type": "Stream_Offset" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `[` $source_offset `to` $source_end `]` `:`\n type($source) `` `{` $source_size `}` `->`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.splat", "summary": "Splats a value into a resource.", "description": "Returns a new resource with the given primitive value splatted out to fill\n the entire contents.\n\n When no await_timepoint is specified the splat may be hoisted and\n materialized at any point prior to its first use. When an await_timepoint\n is specified the splat will not begin until that timepoint is reached,\n allowing for explicit ordering with other timeline operations.", "operands": [ { "name": "await_timepoint", "type": "Optional" }, { "name": "value", "type": "Stream_FillPatternType" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)`)?\n $value `:` type($value) `->` type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.store", "summary": "Stores a value into a resource.", "description": "Returns a resource with the element at the given offset set to the given\n value.", "operands": [ { "name": "target", "type": "Stream_StagingResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "value", "type": "AnyTypeOf<[Stream_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "results": [ { "name": "result", "type": "Stream_StagingResource" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "$value `,`\n $target `[` $target_offset `]` `:`\n type($value)\n `->`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.transfer", "summary": "Transfers a resource from one location/state to another.", "description": "Transfers a resource between different states (such as a `staging` lifetime\n to a `local` lifetime) or different affinities. This is roughly equivalent\n to a cast but may have special semantics when later lowered to one or more\n devices with discrete memory spaces or pools.", "operands": [ { "name": "source", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" } ], "attributes": [ { "name": "source_affinity", "type": "OptionalAttr" }, { "name": "target_affinity", "type": "OptionalAttr" } ], "assemblyFormat": "$source `:` type($source)\n `` `{` $source_size `}`\n (`from` `(` $source_affinity^ `)`)?\n `->`\n (`to` `(` $target_affinity^ `)`)?\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.async.update", "summary": "Updates a slice of a subview of a resource in-place.", "description": "Copies a value into a resource based on a byte range. The returned value\n is the entire updated target value. Updates can be turned into placement\n allocations and avoid copies.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_end", "type": "Stream_Offset" }, { "name": "update", "type": "Stream_AnyStreamResource" }, { "name": "update_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $update `,`\n $target `[` $target_offset `to` $target_end `]` `:`\n type($update) `` `{` $update_size `}` `->`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.binding.subspan", "summary": "Returns an alias to a subspan of interface binding data.", "description": "Returns a subview to a tensor or memref-like type from a binding. The same\n binding may have multiple subviews at different byte offsets.", "operands": [ { "name": "binding", "type": "Stream_AnyBinding" }, { "name": "byte_offset", "type": "Stream_Offset" }, { "name": "dynamic_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$binding `` `[` $byte_offset `]`\n attr-dict `:` type($binding) `->` type($result) (`{` $dynamic_dims^ `}`)?", "hasCustomAssemblyFormat": true }, { "name": "stream.channel.count", "summary": "Returns the total number of participants in the group.", "description": "Returns the total participant count in the collective communicator group.", "operands": [ { "name": "channel", "type": "Stream_Channel" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$channel `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.channel.create", "summary": "Creates a new channel for collective communication.", "description": "Returns a new channel with the given rank associated with the specified\n affinity. Collective operations using this channel must only be submitted on\n compatible affinities.\n\n The group and ID are optional and may be null. The rank and count can be\n omitted to indicate a default inherited from the environment or device\n configuration at runtime.", "operands": [ { "name": "id", "type": "Optional" }, { "name": "rank", "type": "Optional" }, { "name": "count", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_Channel" } ], "attributes": [ { "name": "group", "type": "OptionalAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`id` `(` $id^ `)`)?\n (`group` `(` $group^ `)`)?\n (`rank` `(` $rank^ `)`)?\n (`count` `(` $count^ `)`)?\n `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.channel.rank", "summary": "Returns the rank of the local participant in the group.", "description": "Returns the rank the channel represents as a participant in a collective\n group in `[0, count)`.", "operands": [ { "name": "channel", "type": "Stream_Channel" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$channel `:` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.channel.split", "summary": "Splits a collective communication channel.", "description": "Partitions the group associated with the given channel into disjoint\n subgroups for each unique value of color. Each new subgroup contains all\n participants of the same color and within each subgroup the key argument\n is used to define the rank order. When multiple participants in a group\n use the same key the tie will be broken using their rank in the parent\n group. A color of -1 indicates that the rank does not participate in any\n subgroup and will return a null channel.", "operands": [ { "name": "channel", "type": "Stream_Channel" }, { "name": "color", "type": "Index" }, { "name": "key", "type": "Index" } ], "results": [ { "name": "result", "type": "Stream_Channel" } ], "assemblyFormat": "$channel `,` $color `,` $key\n `:` type($channel) `->` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.call", "summary": "Calls a streamable external host function.", "description": "Calls a function operating on resource values with stream semantics.\n Asynchronous calls must have no side-effects.", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "resource_operand_offsets", "type": "Variadic" }, { "name": "resource_operand_lengths", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "resource_operand_accesses", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee ``\n custom($resource_operands,\n $resource_operand_offsets,\n $resource_operand_lengths,\n $resource_operand_accesses) attr-dict `:`\n custom(ref($resource_operands),\n type($resource_operands),\n $resource_operand_sizes,\n type($results),\n $result_sizes,\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.collective", "summary": "Dispatches a collective operation.", "description": "Dispatches a collective operation specified against the device. If grouped\n with other collectives in a `stream.cmd.concurrent` region the collective\n operations may fuse and execute more efficiently.", "operands": [ { "name": "channel", "type": "Stream_Channel" }, { "name": "element_count", "type": "Stream_Size" }, { "name": "param", "type": "Optional" }, { "name": "resources", "type": "Variadic" }, { "name": "resource_sizes", "type": "Variadic" }, { "name": "resource_offsets", "type": "Variadic" }, { "name": "resource_lengths", "type": "Variadic" } ], "attributes": [ { "name": "op", "type": "Stream_CollectiveAttr" }, { "name": "resource_accesses", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`` $op `` `[` $element_count `]`\n `channel` `(` $channel `)`\n (`param` `(` $param^ `:` type($param) `)`)? `{`\n custom($resources, type($resources), $resource_sizes,\n $resource_offsets, $resource_lengths,\n $resource_accesses)\n `\\n` `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.concurrent", "summary": "Executes all ops concurrently.", "description": "Represents a wave of work scheduled concurrently (each op executing at the\n same time).\n\n Waves can be nested to create a DAG. For example, take the following graph:\n ```\n |\n v---------+---------v\n +-------|-------+ +-------|-------+\n | v--+--v | | v--+--v |\n | +----+ +----+ | | +----+ +----+ |\n | | @a | | @b | | | | @c | | @d | |\n | +----+ +----+ | | +----+ +----+ |\n | +--v--+ | | +--v--+ |\n +-------|-------+ +-------|-------+\n +---------v---------+\n |\n ```\n\n Represented with nested waves:\n ```mlir\n stream.cmd.concurrent {\n stream.cmd.concurrent {\n stream.cmd.dispatch @a\n stream.cmd.dispatch @b\n }\n stream.cmd.concurrent {\n stream.cmd.dispatch @c\n stream.cmd.dispatch @d\n }\n }\n ```", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$body\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.copy", "summary": "Copies a subview of a stream resource to another.", "description": "Copies a subview of a resource into a subview of another.\n As with memcpy this does not support overlapping updates into the same\n resource.", "operands": [ { "name": "source", "type": "Stream_AnyResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "target", "type": "Stream_AnyResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "length", "type": "Stream_Size" } ], "assemblyFormat": "$source `[` $source_offset `]` `,`\n $target `[` $target_offset `]` `,`\n $length `:`\n type($source) `` `{` $source_size `}` `->`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.discard", "summary": "Discards a subview of a resource.", "description": "Discards a subview of a resource, indicating that after this command the\n specified contents are no longer needed. This can be used to trim memory\n or invalidate caches.", "operands": [ { "name": "target", "type": "Stream_AnyResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" } ], "assemblyFormat": "$target `[` $target_offset `for` $target_length `]` `:`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.dispatch", "summary": "Dispatches a parallelized grid of work.", "description": "Calls the specified entry point function once for each element in the\n specified workgroup count. Each workgroup has access to the same operands\n and results and is able to load/store at will.", "operands": [ { "name": "workload", "type": "Variadic" }, { "name": "uniform_operands", "type": "Variadic" }, { "name": "resources", "type": "Variadic" }, { "name": "resource_sizes", "type": "Variadic" }, { "name": "resource_offsets", "type": "Variadic" }, { "name": "resource_lengths", "type": "Variadic" } ], "attributes": [ { "name": "entry_points", "type": "TypedArrayAttrBase" }, { "name": "resource_accesses", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($entry_points)\n (`[` $workload^ `]`)? ``\n (`(` $uniform_operands^ `:` type($uniform_operands) `)`)? `{`\n custom($resources, type($resources), $resource_sizes,\n $resource_offsets, $resource_lengths,\n $resource_accesses)\n `\\n` `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.execute", "summary": "Executes a dependency-aware sequence of streamable ops.", "description": "Evaluates the operations within the region by dependency order while obeying\n ties when present. Nested ops execute serially in block order and nested\n `stream.cmd.concurrent` ops can be used to run multiple ops concurrently\n within the stream. All resource inputs must be captured explicitly. All\n results are only ready once all nested ops complete execution and the\n returned timepoint is reached. Zero or more timepoints may be provided to\n block execution until they are all reached; zero timepoints indicates that\n execution may begin immediately.", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "once", "type": "UnitAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`once` $once^)?\n (`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `with` ``\n custom($resource_operands,\n type($resource_operands), $resource_operand_sizes,\n $body)\n `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.fill", "summary": "Fills a subview of a stream resource with a value.", "description": "Splats a value into a subview of the given stream resource and returns the\n resource with the update applied.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" }, { "name": "value", "type": "Stream_NativeFillPatternType" } ], "assemblyFormat": "$value `,`\n $target `[` $target_offset `for` $target_length `]` `:`\n type($value) `->`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.flush", "summary": "Flushes a subview of a resource.", "description": "Transfers a resource to an external target. The resource memory is made\n available to the target and can be made visible there using\n `stream.cmd.invalidate`.", "operands": [ { "name": "target", "type": "Stream_AnyResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" } ], "attributes": [ { "name": "source_affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`to` `(` $source_affinity^ `)`)?\n $target `[` $target_offset `for` $target_length `]` `:`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.func", "summary": "Streamable function declaration.", "description": "Declares a function that can be called as an asynchronous streaming\n operation via `stream.cmd.call`. Today only external functions are\n allowed.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name ``\n custom($function_type,\n $arg_attrs,\n $res_attrs)\n attr-dict-with-keyword\n ($body^)?", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.invalidate", "summary": "Invalidates a subview of a resource.", "description": "Transfers a resource from an external source into the current target. The\n resource memory is assumed to have been made available at the source via\n `stream.cmd.flush`.", "operands": [ { "name": "target", "type": "Stream_AnyResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" } ], "attributes": [ { "name": "source_affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`from` `(` $source_affinity^ `)`)?\n $target `[` $target_offset `for` $target_length `]` `:`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.parameter.gather", "summary": "Gathers multiple resources from a parameter scope.", "description": "Asynchronously gathers one or more resources into a single target stream\n resource. This is equivalent to one `stream.cmd.parameter.read` per\n parameter but allows implementations that can batch operations to do so\n without additional timeline overhead.", "operands": [ { "name": "source_scope", "type": "Optional" }, { "name": "source_keys", "type": "Variadic" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "target_lengths", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n $target, type($target), $target_size, $target_offsets, $target_lengths)\n `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.parameter.load", "summary": "Reads one or more resources from a parameter scope.", "description": "Asynchronously reads one or more resources from an external parameter\n provider and returns the resulting stream resources. Depending on the\n resource type this may alias existing cached storage or be directly mapped\n to the parameter origin or result in a copy as if `stream.resource.alloca`\n and `stream.cmd.parameter.read` had been used per parameter.", "operands": [ { "name": "source_scope", "type": "Optional" }, { "name": "source_keys", "type": "Variadic" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['results']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n type($results), $result_sizes)\n `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.parameter.read", "summary": "Reads a resource from a parameter scope.", "description": "Asynchronously reads a resource from an external parameter provider into the\n provided target resource range.", "operands": [ { "name": "source_scope", "type": "Optional" }, { "name": "source_key", "type": "Util_BufferType" }, { "name": "source_offset", "type": "I64" }, { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n custom($source_scope, $source_key)\n `` `[` $source_offset `]` `->`\n $target `[` $target_offset `for` $target_length `]` `:`\n type($target) `` `{` $target_size `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.parameter.scatter", "summary": "Scatters multiple resources to a parameter scope.", "description": "Asynchronously scatters one or more resources from a single source resource\n into one or more parameters. This is equivalent to one\n `stream.cmd.parameter.write` per parameter but allows implementations that\n can batch operations to do so without additional overhead.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "source_lengths", "type": "Variadic" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_keys", "type": "Variadic" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `{`\n custom(\n $source, type($source), $source_size, $source_offsets, $source_lengths,\n $target_scope, $target_keys, $target_offsets)\n `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.parameter.write", "summary": "Writes a resource to a parameter scope.", "description": "Asynchronously writes a resource to an external parameter provider from\n the provided source resource range.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_length", "type": "Stream_Size" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_key", "type": "Util_BufferType" }, { "name": "target_offset", "type": "I64" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n $source `[` $source_offset `for` $source_length `]` `:`\n type($source) `` `{` $source_size `}` `->`\n custom($target_scope, $target_key)\n `` `[` $target_offset `]`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.cmd.serial", "summary": "Executes all ops serially (in-order).", "description": "Represents a sequence of work scheduled serially (each op executing one\n after the other).\n\n Regions can be nested to create a DAG. For example, take the following graph:\n ```\n |\n v---------+-----v\n +-------|-------+ +---|----+\n | v--+--v | | v |\n | +----+ +----+ | | +----+ |\n | | @a | | @b | | | | @c | |\n | +----+ +----+ | | +----+ |\n | | | | | | |\n | | | | | +-v--+ |\n | | | | | | @d | |\n | | | | | +----+ |\n | +--v--+ | | | |\n +-------|-------+ +---|----+\n +---------v-----+\n |\n ```\n\n Represented with nested regions:\n ```mlir\n stream.cmd.concurrent {\n stream.cmd.concurrent {\n stream.cmd.dispatch @a\n stream.cmd.dispatch @b\n }\n stream.cmd.serial {\n stream.cmd.dispatch @c\n stream.cmd.dispatch @d\n }\n }\n ```", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$body\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.context.resolve", "summary": "Resolves low-level context resources based on type.", "description": "WIP; allows for accessing the implementation details of lower-level dialects\n such as the HAL. This will likely be reworked in the future to either\n live inside other dialects, use some op interface instead of having a\n dedicated op here, or remove the op entirely and make resolution happen\n explicitly.\n\n Examples:\n ```\n // Returns a HAL device.\n = stream.context.resolve on(#something) : !hal.device\n // Returns a HAL device and (optional) queue affinity.\n = stream.context.resolve on(#something) : !hal.device, i64\n // Returns a HAL allocator and (optional) queue affinity.\n = stream.context.resolve on(#something) : !hal.allocator, i64\n ```", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n attr-dict `:` type($results)", "hasCustomAssemblyFormat": true }, { "name": "stream.dispatch.workgroup.count", "summary": "Returns the total workgroup count of the grid.", "description": "The total number of workgroups along each dimension in the dispatch grid.\n\n Represented as a 3D grid classically written as XYZ.\n Corresponds to the `NumWorkgroups` SPIR-V built-in and the `gridDim` CUDA\n built-in variable.\n\n ```mlir\n %x = stream.dispatch.workgroup.count[0] : index\n %y = stream.dispatch.workgroup.count[1] : index\n %z = stream.dispatch.workgroup.count[2] : index\n ```", "results": [ { "name": "result", "type": "Stream_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "assemblyFormat": "`[` $dimension `]` attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "stream.dispatch.workgroup.id", "summary": "Returns the index of the current workgroup in the grid.", "description": "The global workgroup ID of the current workgroup in the range of\n `[0, stream.dispatch.workgroup.count)` along each dimension.\n\n Represented as a 3D grid classically written as XYZ.\n Corresponds to the `WorkgroupId` SPIR-V built-in and the `blockIdx` CUDA\n built-in variable.\n\n ```mlir\n %x = stream.dispatch.workgroup.id[0] : index\n %y = stream.dispatch.workgroup.id[1] : index\n %z = stream.dispatch.workgroup.id[2] : index\n ```", "results": [ { "name": "result", "type": "Stream_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "assemblyFormat": "`[` $dimension `]` attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "stream.dispatch.workgroup.size", "summary": "Returns the size of each workgroup in invocations.", "description": "The number of local invocations within the current workgroup along each\n dimension. Depending on backend this may map to the SIMT thread count or\n inner loop nest parameters.\n\n Workgroup sizes are not determined at the stream dialect level as they are\n dependent on the target backend determined when lowering into the HAL. It's\n still possible to use the symbolic workgroup size inside of dispatch\n executables as a placeholder for the resolved value once in the HAL.\n\n Represented as a 3D grid classically written as XYZ.\n Corresponds to the `WorkgroupSize` SPIR-V built-in and the `blockDim` CUDA\n built-in variable.\n\n ```mlir\n %x = stream.dispatch.workgroup.size[0] : index\n %y = stream.dispatch.workgroup.size[1] : index\n %z = stream.dispatch.workgroup.size[2] : index\n ```", "results": [ { "name": "result", "type": "Stream_Dim" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "assemblyFormat": "`[` $dimension `]` attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "stream.executable", "summary": "Generic executable module.", "description": "An executable module containing one or more public functions. The contents\n of the functions are safe to dispatch and can be lowered further to\n target-specific backend IR representations.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n attr-dict-with-keyword\n regions", "hasCustomAssemblyFormat": true }, { "name": "stream.executable.end", "summary": "Terminator pseudo-op for the executable op.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "stream.executable.export", "summary": "Defines an executable entry point for dispatch operations.", "description": "Specifies an exported function with an externally-visible alias. Multiple\n exports can reference the same internal function.\n\n Each entry point can have a unique workgroup count calculation region.\n This region takes the workload parameters passed to each flow.dispatch and\n produces an XYZ workgroup count for the 3D grid dispatch.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_ref", "type": "FlatSymbolRefAttr" } ], "regions": [ { "name": "workgroup_count", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n custom($sym_name, $function_ref)\n custom($workgroup_count)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.file.constant", "summary": "Creates a file backed by the provided constant host memory.", "description": "Synchronously wraps a host heap buffer into a stream-accessible file handle.\n Changing the source buffer after definition has undefined behavior.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_length", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_File" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `[` $source_offset `for` $source_length `]` `:`\n type($source) `` `{` $source_size `}`\n `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.file.read", "summary": "Reads a segment of a file into a resource.", "description": "Asynchronously reads a segment of a file into a resource.\n\n Some implementations can stream directly from the source file into\n device-local memory and file ops should be preferred to manually staging\n memory through host buffers.", "operands": [ { "name": "source", "type": "Stream_File" }, { "name": "source_offset", "type": "I64" }, { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "length", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`):(`:`)?\n $source `[` $source_offset `]` `,`\n $target `[` $target_offset `]` `,`\n $length `:`\n type($source) `->`\n type($target) `` `{` $target_size `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.file.write", "summary": "Writes a segment of a file from a resource.", "description": "Asynchronously writes a segment of a resource into a file.\n The file range must be valid within the file as this operation cannot\n grow the underlying file storage.\n\n Some implementations can stream directly from device-local memory into the\n target file and file ops should be preferred to manually staging memory\n through host buffers.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "target", "type": "Stream_File" }, { "name": "target_offset", "type": "I64" }, { "name": "length", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`):(`:`)?\n $source `[` $source_offset `]` `,`\n $target `[` $target_offset `]` `,`\n $length `:`\n type($source) `` `{` $source_size `}` `->`\n type($target)\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.parameter.gather", "summary": "Gathers multiple resources from a parameter scope.", "description": "Asynchronously gathers one or more resources into a single target stream\n resource. This is equivalent to one `stream.parameter.read` per parameter\n but allows implementations that can batch operations to do so without\n additional timeline overhead.", "operands": [ { "name": "source_offsets", "type": "Variadic" }, { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "target_lengths", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "source_scope", "type": "OptionalAttr" }, { "name": "source_keys", "type": "StrArrayAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n $target, type($target), $target_size, $target_offsets, $target_lengths)\n `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "stream.parameter.load", "summary": "Reads one or more resources from a parameter scope.", "description": "Asynchronously reads one or more resources from an external parameter\n provider and returns the resulting stream resources. Depending on the\n resource type this may alias existing cached storage or be directly mapped\n to the parameter origin or result in a copy as if `stream.resource.alloca`\n and `stream.parameter.read` had been used per parameter.", "operands": [ { "name": "source_offsets", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "source_scope", "type": "OptionalAttr" }, { "name": "source_keys", "type": "StrArrayAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `{`\n custom(\n $source_scope, $source_keys, $source_offsets,\n type($results), $result_sizes)\n `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "stream.parameter.read", "summary": "Reads a resource from a parameter scope.", "description": "Asynchronously reads a resource from an external parameter provider into the\n provided target resource range.", "operands": [ { "name": "source_offset", "type": "I64" }, { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "target_length", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "source_scope", "type": "OptionalAttr" }, { "name": "source_key", "type": "StrAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n custom($source_scope, $source_key)\n `` `[` $source_offset `]` `->`\n $target `[` $target_offset `for` $target_length `]` `:`\n type($target) `` `{` $target_size `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "stream.parameter.scatter", "summary": "Scatters multiple resources to a parameter scope.", "description": "Asynchronously scatters one or more resources from a single source resource\n into one or more parameters. This is equivalent to one\n `stream.parameter.write` per parameter but allows implementations that can\n batch operations to do so without additional overhead.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offsets", "type": "Variadic" }, { "name": "source_lengths", "type": "Variadic" }, { "name": "target_offsets", "type": "Variadic" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "target_scope", "type": "OptionalAttr" }, { "name": "target_keys", "type": "StrArrayAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n `{`\n custom(\n $source, type($source), $source_size, $source_offsets, $source_lengths,\n $target_scope, $target_keys, $target_offsets)\n `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "stream.parameter.write", "summary": "Writes a resource to a parameter scope.", "description": "Asynchronously writes a resource to an external parameter provider from\n the provided source resource range.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "source_length", "type": "Stream_Size" }, { "name": "target_offset", "type": "I64" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "target_scope", "type": "OptionalAttr" }, { "name": "target_key", "type": "StrAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n $source `[` $source_offset `for` $source_length `]` `:`\n type($source) `` `{` $source_size `}` `->`\n custom($target_scope, $target_key)\n `` `[` $target_offset `]`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": 1 }, { "name": "stream.resource.alloc", "summary": "Allocates a persistent resource.", "description": "Allocates a persistent value (one that is long-lived and possibly external\n to the program) with undefined contents. Consumers of the allocated\n result must assume nothing of the contents and use `discard` access.\n\n Uninitialized allocations will have undefined contents and must only be used\n when all bytes are discarded prior to any reads. Runtimes decide what\n \"undefined contents\" means and here it only indicates that execution will be\n correct even if the memory starts with non-zero values.\n\n If multiple values are allocated from the same operation it implies that\n they have matching lifetimes. When lowering to execution environments the\n separate allocations may be fused into one or more slab allocations in order\n to reduce overheads. How many allocations can be fused is based on the size\n of the individual resources and the target constraints (how large any single\n buffer may be, etc).", "operands": [ { "name": "storage_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyResource" } ], "attributes": [ { "name": "uninitialized", "type": "UnitAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`uninitialized` $uninitialized^)?\n (`on` `(` $affinity^ `)`)?\n attr-dict `:`\n type($result) `{` $storage_size `}`", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.alloca", "summary": "Allocates a transient value with undefined contents.", "description": "Allocates a transient value (one that is short-lived and local to the\n current computation) with undefined contents. Consumers of the allocated\n result must assume nothing of the contents and use `discard` access.\n\n The resource returned is not valid for use until the timepoint is reached;\n execution using this resource must await on the timepoint.\n\n If the lifetime of the allocation is unknowable (analysis fails, etc) the\n `indeterminate_lifetime` will be set indicating that the resource should not\n be deallocated asynchronously and only after all references have been\n released.", "operands": [ { "name": "storage_size", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "indeterminate_lifetime", "type": "UnitAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "`uninitialized`\n (`indeterminate` $indeterminate_lifetime^)?\n (`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`):(`:`)?\n attr-dict\n type($result) `{` $storage_size `}`\n `=` `` `>`\n type($result_timepoint)", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.constants", "summary": "Asynchronously uploads or maps constant values.", "description": "Represents an upload of constant resources that may be packed, suballocated,\n and mapped depending on the final lowering target.\n\n In runtime environments where memory is shared between host and device this\n turns into a mapping operation that avoids additional memory allocation and\n copies. When memory cannot be shared an asynchronous stream will be created\n to allocate and copy all of the constant values.\n\n Though this op returns a unique resource for each constant value it's\n expected that almost all end up aliasing into the same storage. The exact\n packing and number of storage resources that are needed are not known until\n lowering to a particular backend, though, so they are separate here for\n proper usage tracking.\n\n Both constant and variable resources can be produced; a constant is\n immutable while a variable will be treated as a constant-value initializer\n for a mutable resource. By modeling these together it's not required that\n variable initializers first be allocated, copied to the target, and then\n copied into the variable storage if the target is capable of doing a direct\n upload or mapping.", "operands": [ { "name": "result_sizes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic>" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "values", "type": "TypedArrayAttrBase" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n attr-dict `:`\n custom(type($results),\n $result_sizes,\n $values)\n `\\n` ` ` ` ` `=` `` `>` type($result_timepoint)", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.dealloca", "summary": "Frees a transient value when available.", "description": "Deallocates a transient value (one that is short-lived and local to the\n current computation) previously allocated using `stream.resource.alloca`.\n\n The resource is considered live and valid until the provided timepoint is\n reached and the memory is only made available for future requests after\n the result timepoint is reached.\n\n If `prefer_origin` is set then the deallocation will be scheduled against\n the original placement affinity of the allocation at runtime. In cases where\n the original placement is unavailable the affinity of the deallocation op\n will be used to perform a barrier operation.", "operands": [ { "name": "operand", "type": "Stream_AnyResource" }, { "name": "operand_size", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "prefer_origin", "type": "UnitAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`origin` $prefer_origin^)?\n (`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>`)?\n $operand `:` type($operand) `{` $operand_size `}`\n `=` `` `>` type($result_timepoint)\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.is_terminal", "summary": "Returns true if the resource has no other claims to ownership.", "description": "Resources may have multiple conceptual owners and are generally only safe to\n deallocate if the code performing the deallocation is the last owner. This\n op can be used to see if the current owner is the last one claiming\n ownership and can deallocate or reuse the resource for other purposes.", "operands": [ { "name": "operand", "type": "Stream_AnyResource" }, { "name": "operand_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `{` $operand_size `}`", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.load", "summary": "Loads a value from a staging resource.", "description": "Returns the element(s) at the given offset in the staging resource.\n The operation will complete synchronously against the resource though it may\n introduce a yield point if the staging resource needs to be transferred.", "operands": [ { "name": "source", "type": "Stream_StagingResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "assemblyFormat": "$source `[` $source_offset `]` `:`\n type($source) `` `{` $source_size `}`\n `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.pack", "summary": "Packs variable-sized slices into a single slab.", "description": "Performs a greedy packing of one or more sized slices with specified\n lifetimes and returns their relative offsets in an aliased linear space.\n\n Slices are `[start, end] = %slice_byte_size`, where the start and end values\n define an inclusive lifetime range and the size is the total number of bytes\n required to be live for that range.\n\n ```mlir\n // Computes the total length required for the packed values and the offsets\n // of the 3 slices requested relative to the base of the packed memory:\n %total_length, %offset_0, %offset_1, %offset_2 =\n stream.resource.pack\n // Each slice gets one result offset:\n slices({\n // 3 slices where A and B overlap and will get unique offsets\n // while B and C do not overlap and are allowed to alias.\n [0, 10] = %size_0, // A => %offset_0\n [3, 8] = %size_1, // B => %offset_1\n [9, 10] = %size_2, // C => %offset_2\n ...\n }) : index\n ```\n\n The lifetime start and end points (inclusive) are only used for relative\n comparisons and may originate with any meaning (op order in block, epoch,\n phase of the moon, etc). The packing algorithm uses the intervals to\n determine slice liveness and when aliasing is safe.\n\n The size of each slice may either be a constant or runtime-computed dynamic\n value. Constant slices can achieve more dense packing than the dynamic\n values and CSE/canonicalization should be applied to ensure that as many of\n the dynamic values are equivalent if possible.\n\n The total length required to pack all slices is returned and can be used to\n acquire storage. The individual slice offsets are 0-based and as such if are\n directly used as buffer offsets may need additional offsetting. This can\n either be applied via the optional `offset` operand or slicing of the\n underlying allocation buffer.", "operands": [ { "name": "offset", "type": "Optional" }, { "name": "dynamic_slice_sizes", "type": "Variadic" } ], "results": [ { "name": "total_length", "type": "Stream_Size" }, { "name": "packed_offsets", "type": "Variadic" } ], "attributes": [ { "name": "lifetime_intervals", "type": "TypedArrayAttrBase" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`offset` `(` $offset^ `)`)?\n `slices` `(` `{`\n custom($lifetime_intervals,\n $dynamic_slice_sizes,\n type($packed_offsets))\n `}` `)`\n `:` type($total_length)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.release", "summary": "Releases an ownership claim on the resource.", "description": "A resource is allowed to be deallocated or reused once the last owner\n releases their ownership. Returns a boolean indicating whether the owner\n releasing their claim was the last owner (equivalent to having used\n `stream.resource.is_terminal`).", "operands": [ { "name": "operand", "type": "Stream_AnyResource" }, { "name": "operand_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `{` $operand_size `}`", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.retain", "summary": "Retains ownership of the resource.", "description": "Retains ownership of the resource for the parent code until a corresponding\n `stream.resource.release` is used to release the ownership claim. A\n particular resource may have multiple owners at any given time indicating\n that multiple parts of the program are sharing responsibility for\n deallocating the resource.\n\n This is primarily only relevant for resources allocated asynchronously and\n that need `stream.resource.dealloca` operations scheduled on timelines.\n Synchronously allocated resources have their lifetimes tied directly to\n their reference-type and do not need additional ownership management.", "operands": [ { "name": "operand", "type": "Stream_AnyResource" }, { "name": "operand_size", "type": "Stream_Size" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `{` $operand_size `}`", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.size", "summary": "Returns the size of the resource storage in bytes.", "description": "Returns a possibly runtime-dynamic byte size of the resource backing\n storage. This may differ from the logical storage size of a value based on\n the alignment requirements of the target as well as encoding of higher level\n values such as sparse tensor formats.", "operands": [ { "name": "operand", "type": "Stream_AnyResource" } ], "results": [ { "name": "result", "type": "Stream_Size" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "$operand\n attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.store", "summary": "Stores a value into a staging resource.", "description": "The operation will complete synchronously against the resource though it may\n introduce a yield point if the staging resource needs to be acquired.", "operands": [ { "name": "target", "type": "Stream_StagingResource" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "target_offset", "type": "Stream_Offset" }, { "name": "value", "type": "AnyTypeOf<[Stream_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "assemblyFormat": "$value `,`\n $target `[` $target_offset `]` `:`\n type($value)\n `->`\n type($target) `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.subview", "summary": "Slices out a subview of a value.", "description": "Aliases a byte subrange of a resource.", "operands": [ { "name": "source", "type": "Stream_AnyResource" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyResource" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "$source `[` $source_offset `]` `:`\n type($source) `` `{` $source_size `}` `->`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.transients", "summary": "Annotates a resource to use transient storage from provided storage.", "description": "Annotates that any transient memory used in the production of the given\n resource should be suballocated from the provided storage. This allows\n users to control transient allocations by providing their own backing\n storage enabling zero-allocation execution in steady state.\n\n The storage provided must have sufficient space for all transient\n allocations required to produce the resource. Unless otherwise overridden\n the compiler will verify that all allocation sizes are computable and\n generate size query functions to allow users to query the required storage\n size. If size checks are disabled then the user must ensure they pass in\n storage with sufficient capacity.\n\n This operation preserves SSA use-def chains by returning the same resource\n value it receives. It exists purely for annotation purposes and will be\n lowered away during compilation. The operation is timeline-aware and\n threads timepoints through to enable proper synchronization.\n\n Example:\n ```mlir\n %result, %result_timepoint = some.operation(%input) : !stream.resource<*>\n %annotated, %annotated_tp = stream.resource.transients\n await(%result_timepoint) => %result : !stream.resource<*>{%size}\n from %storage : !stream.resource{%storage_size}\n => !stream.timepoint\n ```", "operands": [ { "name": "resource", "type": "Stream_AnyStreamResource" }, { "name": "resource_size", "type": "Stream_Size" }, { "name": "storage", "type": "Stream_AnyResource" }, { "name": "storage_size", "type": "Stream_Size" }, { "name": "await_timepoint", "type": "Optional" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['resource', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`await` `(` $await_timepoint^ `)` `=` `` `>` )?\n $resource `:` type($resource) `` `{` $resource_size `}`\n `from`\n $storage `:` type($storage) `` `{` $storage_size `}`\n `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.resource.try_map", "summary": "Maps read-only memory into a resource.", "description": "Synchronously maps a host heap buffer into a stream-accessible resource\n with the requested lifetime. If the given source cannot be mapped the\n `did_map` result will be 0 and users must find another route into memory\n (such as file I/O). The resulting resource is not coherent with the source\n and behavior is undefined if the underlying contents change.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_offset", "type": "Stream_Offset" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "did_map", "type": "I1" }, { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `[` $source_offset `]` `:`\n type($source)\n `->`\n type($did_map) `,` type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.return", "summary": "Returns results from a region.", "description": "The values returned are copied by-value.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict\n $operands `:` type($operands)", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.clone", "summary": "Clones the contents of a value.", "description": "Clones the contents of a value at a snapshot in time. Future changes to the\n cloned value will not effect the result. Acts as a copy-on-write operation.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_encoding_dims", "type": "Variadic" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" }, { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:`\n $source_encoding (`` `{` $source_encoding_dims^ `}`)?\n `in`\n type($source) `` `{` $source_size `}`\n `->`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.constant", "summary": "Defines a constant tensor value.", "description": "Returns a typed resource initialized to the given constant value.", "operands": [ { "name": "result_encoding_dims", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" }, { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n `:`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result)\n `=`\n $value\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.dispatch", "summary": "Dispatches a parallelized grid of work.", "description": "Calls the specified entry point function once for each element in the\n specified workgroup count. Each workgroup has access to the same operands\n and results and is able to load/store at will.", "operands": [ { "name": "workload", "type": "Variadic" }, { "name": "mixed_operands", "type": "Variadic>" }, { "name": "operand_sizes", "type": "Variadic" }, { "name": "operand_encoding_dims", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" }, { "name": "result_encoding_dims", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "entry_points", "type": "TypedArrayAttrBase" }, { "name": "operand_encodings", "type": "TypedArrayAttrBase" }, { "name": "result_encodings", "type": "TypedArrayAttrBase" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n custom($entry_points)\n (`[` $workload^ `]`)? ``\n `(` $mixed_operands `)`\n attr-dict `:`\n custom(\n ref($mixed_operands),\n type($mixed_operands), $operand_sizes,\n $operand_encodings, $operand_encoding_dims,\n type($results), $result_sizes,\n $result_encodings, $result_encoding_dims,\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.empty", "summary": "Defines an empty tensor value.", "description": "Returns a typed resource initialized with no contents. This still carries\n shape metadata and may encode to a non-empty resource such as in cases\n where the empty representation still has data (e.g. sparse tensors).\n Subsequent writes must populate any ranges of the tensor that are later\n read.", "operands": [ { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n `:`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.encode", "summary": "Encodes the contents of a value.", "description": "Elones the contents of a value at a snapshot in time. Future changes to the\n identity encoding will not effect the result. Acts as a copy-on-write\n operation. Otherwise, an executable for encoding the value is generated\n during lowering.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_encoding_dims", "type": "Variadic" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" }, { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:`\n $source_encoding (`` `{` $source_encoding_dims^ `}`)?\n `in`\n type($source) `` `{` $source_size `}`\n `->`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.export", "summary": "Conversion placeholder for stream->other type conversion.", "description": "Defines a conversion to a higher-level dialect type such as `tensor` that\n is resolved during lowering into the stream dialect. This can be used to\n interoperate between levels of the stack that require specifying stream\n types and those that prior to lowering do not handle them.", "operands": [ { "name": "source", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" }, { "name": "source_encoding_dims", "type": "Variadic" }, { "name": "source_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `:`\n $source_encoding (`` `{` $source_encoding_dims^ `}`)?\n `in`\n type($source) `` `{` $source_size `}`\n `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.fill", "summary": "Fills a subview of a stream resource with a value.", "description": "Splats a value into a subview of the given stream resource and returns the\n resource with the update applied.\n\n Equivalent to a stream.tensor.splat + stream.tensor.update.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_encoding_dims", "type": "Variadic" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "start_indices", "type": "Variadic" }, { "name": "lengths", "type": "Variadic" }, { "name": "value", "type": "Stream_PrimitiveType" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "target_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $value `,` $target (`[` $start_indices `for` $lengths^ `]`)? `:`\n type($value)\n `->`\n $target_encoding (`` `{` $target_encoding_dims^ `}`)?\n `in`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.import", "summary": "Conversion placeholder for other->stream type conversion.", "description": "Defines a conversion from a higher-level dialect type such as `tensor` that\n is resolved during lowering into the stream dialect. This can be used to\n interoperate between levels of the stack that require specifying stream\n types and those that prior to lowering do not handle them.\n\n `consume` can be used to indicate a transfer of ownership. Though the\n imported value may still have external references when consumed a resource\n will be conceptually released from its existing owner and retained by the\n importer atomically.", "operands": [ { "name": "source", "type": "AnyType" }, { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" } ], "attributes": [ { "name": "result_encoding", "type": "TypeAttr" }, { "name": "consume", "type": "UnitAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n (`consume` $consume^)?\n $source `:`\n type($source)\n `->`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result) `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.load", "summary": "Loads a value from a tensor element.", "description": "Returns the element at the given location from within the tensor.", "operands": [ { "name": "source", "type": "Stream_StagingResource" }, { "name": "source_encoding_dims", "type": "Variadic" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source (`[` $indices^ `]`)? `:`\n $source_encoding (`` `{` $source_encoding_dims^ `}`)?\n `in`\n type($source) `` `{` $source_size `}`\n `->`\n type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.parameter.load", "summary": "Loads a new resource from a parameter archive.", "description": "Allocates a new resource and populates it with data from a parameter archive\n file (or in-memory buffer) at the specified byte offset. This is the\n tensor-phase equivalent of `stream.async.parameter.load` and retains tensor\n encoding metadata for proper size calculation during encoding.\n\n Example:\n ```mlir\n %r = stream.tensor.parameter.load %key[%offset]\n : tensor<4x8xf32> in !stream.resource<*>{%size}\n %r = stream.tensor.parameter.load %scope::%key[%offset]\n : tensor{%dim0} in !stream.resource<*>{%size}\n ```", "operands": [ { "name": "source_scope", "type": "Optional" }, { "name": "source_key", "type": "Util_BufferType" }, { "name": "source_offset", "type": "I64" }, { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n custom($source_scope, $source_key)\n `` `[` $source_offset `]`\n `:` $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in` type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.parameter.write", "summary": "Writes a resource to a parameter archive.", "description": "Writes data from a source resource to a parameter archive file (or in-memory\n buffer) at the specified byte offset. The source resource is returned\n unchanged to establish proper data flow dependencies. This is the\n tensor-phase equivalent of `stream.async.parameter.write` and retains tensor\n encoding metadata for proper size calculation during encoding.\n\n Example:\n ```mlir\n %r = stream.tensor.parameter.write %source -> %key[%offset]\n : tensor<4x8xf32> in !stream.resource<*>{%size}\n %r = stream.tensor.parameter.write %source -> %scope::%key[%offset]\n : tensor{%dim0} in !stream.resource<*>{%size}\n ```", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_encoding_dims", "type": "Variadic" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "target_scope", "type": "Optional" }, { "name": "target_key", "type": "Util_BufferType" }, { "name": "target_offset", "type": "I64" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `->` custom($target_scope, $target_key)\n `` `[` $target_offset `]`\n `:` $source_encoding (`` `{` $source_encoding_dims^ `}`)?\n `in` type($source) `` `{` $source_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.sizeof", "summary": "Calculates the storage size of a given high-level type.", "description": "Target-dependent storage size calculation using a high-level annotated type.\n While within the stream dialect the storage size of a value is left as a\n placeholder using this op. The requisite target-specific parameters for\n expanding the size calculation are only available after affinities have been\n assigned.", "operands": [ { "name": "encoding_dims", "type": "Variadic" } ], "results": [ { "name": "storage_size", "type": "Stream_Size" } ], "attributes": [ { "name": "encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $encoding (`{` $encoding_dims^ `}`)?\n attr-dict `:` type($storage_size)", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.slice", "summary": "Slices out a cloned subview of a value.", "description": "Slices a subrange of a stream resource based on a tensor encoding. Acts as a\n copy-on-write operation.", "operands": [ { "name": "source", "type": "Stream_AnyStreamResource" }, { "name": "source_encoding_dims", "type": "Variadic" }, { "name": "source_size", "type": "Stream_Size" }, { "name": "start_indices", "type": "Variadic" }, { "name": "lengths", "type": "Variadic" }, { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "source_encoding", "type": "TypeAttr" }, { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $source `[` $start_indices `for` $lengths `]` `:`\n $source_encoding (`` `{` $source_encoding_dims^ `}`)?\n `in`\n type($source) `` `{` $source_size `}`\n `->`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.splat", "summary": "Splats a value into a shaped tensor.", "description": "Returns a typed resource initialized to the given primitive value.", "operands": [ { "name": "value", "type": "Stream_PrimitiveType" }, { "name": "result_encoding_dims", "type": "Variadic" }, { "name": "result_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "result_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $value\n `:` type($value)\n `->`\n $result_encoding (`` `{` $result_encoding_dims^ `}`)?\n `in`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.store", "summary": "Stores a value into a tensor element.", "description": "Returns a tensor with the element at the given index set to the given value.", "operands": [ { "name": "target", "type": "Stream_StagingResource" }, { "name": "target_encoding_dims", "type": "Variadic" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "indices", "type": "Variadic" }, { "name": "value", "type": "AnyTypeOf<[Stream_PrimitiveType, AnyVectorOfNonZeroRank]>" } ], "results": [ { "name": "result", "type": "Stream_StagingResource" } ], "attributes": [ { "name": "target_encoding", "type": "TypeAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "$value `,`\n $target (`[` $indices^ `]`)? `:`\n type($value)\n `->`\n $target_encoding (`` `{` $target_encoding_dims^ `}`)?\n `in`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.trace", "summary": "Traces one or more tensor values at runtime.", "description": "Traces out to a runtime trace sink (console, log file, etc) the given\n tensors. The key is arbitrary and can be used for identifying the set of\n values being traced.", "operands": [ { "name": "resources", "type": "Variadic" }, { "name": "resource_sizes", "type": "Variadic" }, { "name": "resource_encoding_dims", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "resource_encodings", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$key `=` `[`\n custom(\n $resources, type($resources), $resource_sizes,\n $resource_encodings, $resource_encoding_dims)\n `]` attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.tensor.update", "summary": "Updates a slice of a subview of a resource in-place.", "description": "Copies a value into a resource based on tensor encodings. The returned value\n is the entire updated target value.", "operands": [ { "name": "target", "type": "Stream_AnyStreamResource" }, { "name": "target_encoding_dims", "type": "Variadic" }, { "name": "target_size", "type": "Stream_Size" }, { "name": "start_indices", "type": "Variadic" }, { "name": "update", "type": "Stream_AnyStreamResource" }, { "name": "update_encoding_dims", "type": "Variadic" }, { "name": "update_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "Stream_AnyStreamResource" } ], "attributes": [ { "name": "target_encoding", "type": "TypeAttr" }, { "name": "update_encoding", "type": "TypeAttr" }, { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "AllTypesMatch<['target', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $update `,` $target `[` $start_indices `]` `:`\n $update_encoding (`` `{` $update_encoding_dims^ `}`)?\n `in`\n type($update) `` `{` $update_size `}`\n `->`\n $target_encoding (`` `{` $target_encoding_dims^ `}`)?\n `in`\n custom(type($target), $target_size)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.test.timeline_aware", "summary": "Test op implementing TimelineAwareOpInterface.", "description": "Test-only operation that implements TimelineAwareOpInterface directly,\n allowing Stream dialect tests to verify timeline-aware behavior without\n requiring HAL/etc dialect dependencies.\n\n Mimics util.call with the HAL coarse-fences model:\n - Takes wait fences that must complete before execution.\n - Takes a signal fence to signal when complete.\n - Returns an arbitrary result.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "wait_fence_likes", "type": "Variadic" }, { "name": "signal_fence_like", "type": "Stream_TestFence" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $args `)` `waits` `(` $wait_fence_likes `)` `signals` `(` $signal_fence_like `)`\n attr-dict `:` functional-type($args, $results)", "hasCustomAssemblyFormat": true }, { "name": "stream.test.timeline_op", "summary": "Test op implementing TimelineOpInterface.", "description": "Test-only operation that implements TimelineOpInterface directly,\n allowing Stream dialect tests to verify timeline behavior without\n requiring execution regions or specific op semantics.\n\n This op takes zero or more resource operands with their sizes, zero or more\n await timepoints, and produces zero or more resource results with a result\n timepoint. It has no side effects and no execution region - it purely exists\n to test timepoint propagation, coverage analysis, and timeline scheduling.\n\n The `await_limit` attribute (default -1) controls how many await timepoints\n this op can accept before forcing join creation:\n - await_limit = -1: Unlimited awaits (default, no joins created)\n - await_limit = 0: No awaits allowed (all timepoints must be joined)\n - await_limit = 1: Max 1 await (mimics stream.async.execute behavior)\n - await_limit = N: Max N awaits\n\n Use this op when testing passes that operate on TimelineOpInterface methods.\n It's simpler than stream.async.execute (no execution region) but can still\n model resource-timepoint flows. For example:\n - ElideTimepointsPass coverage analysis (elide_timepoints_coverage.mlir)\n - PropagateTimepointsPass scheduling (propagate_timepoints.mlir)\n - SCF region handling with resources (elide_timepoints_scf.mlir)\n\n Examples:\n // Simple timeline op with no dependencies or resources.\n %tp0 = stream.test.timeline_op with() : () -> () => !stream.timepoint\n\n // Timeline op awaiting other timepoints.\n %tp1 = stream.test.timeline_op await(%tp0) => with() : () -> () => !stream.timepoint\n\n // Timeline op with resource operands and results.\n %r, %tp = stream.test.timeline_op\n with(%arg) : (!stream.resource{%size}) -> !stream.resource{%size}\n => !stream.timepoint\n\n // Timeline op with await_limit to test join creation.\n %r, %tp = stream.test.timeline_op await_limit(1) await(%tp0) =>\n with(%arg) : (!stream.resource{%size}) -> !stream.resource{%size}\n => !stream.timepoint", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "result_sizes", "type": "Variadic" }, { "name": "await_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic>" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "await_limit", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`await_limit` `(` $await_limit^ `)`)?\n (`await` `(` $await_operands^ `)` `=` `` `>`)?\n `with` `(` $resource_operands `)` attr-dict `:`\n custom(ref($resource_operands),\n type($resource_operands), $resource_operand_sizes,\n type($results), $result_sizes,\n $tied_operands)\n `=` `` `>` type($result_timepoint)", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.await", "summary": "Awaits a timepoint before returning a set of resources.", "description": "After asynchronous execution scheduling resources may exist in different\n states at different points in the execution timeline. This op enables\n resolving the version of a resource after a particular point in the\n timeline. As timepoints transitively chain the timepoint must only cover the\n resource availability but not be limited to its original production\n timepoint.", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" }, { "name": "await_timepoint", "type": "Stream_Timepoint" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "sync", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`sync` $sync^)?\n $await_timepoint `=` `` `>`\n $resource_operands `:`\n custom(type($resource_operands),\n type($results), $resource_operand_sizes)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.barrier", "summary": "Returns a timepoint indicating when a resource is available.", "description": "After asynchronous execution scheduling resources may exist in different\n states at different points in the execution timeline. This op enables\n identifying when the version of a resource after a particular point in the\n timeline is available. As timepoints transitively chain the timepoint must\n only cover the resource availability but not be limited to its original\n production timepoint.", "operands": [ { "name": "resource", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" }, { "name": "resource_size", "type": "Stream_Size" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Stream_AnyStreamResource, Stream_StagingResource]>" }, { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['resource', 'result']>" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $resource `:` type($resource) `` `{` $resource_size `}`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.chain_external", "summary": "Exports a timepoint to an external dialect type.", "description": "Defines a conversion to an external dialect type such as `hal.fence`\n that is resolved during lowering into the stream dialect. This can be used\n to interoperate between levels of the stack that require specifying stream\n types and those that prior to lowering do not handle them.", "operands": [ { "name": "await_timepoint", "type": "Stream_Timepoint" }, { "name": "external_values", "type": "Variadic" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $await_timepoint\n `=` `` `>`\n `(` $external_values `:` type($external_values) `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.export", "summary": "Exports a timepoint to an external dialect type.", "description": "Defines a conversion to an external dialect type such as `hal.fence`\n that is resolved during lowering into the stream dialect. This can be used\n to interoperate between levels of the stack that require specifying stream\n types and those that prior to lowering do not handle them.", "operands": [ { "name": "await_timepoint", "type": "Stream_Timepoint" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $await_timepoint\n `=` `` `>`\n `(` type($results) `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.immediate", "summary": "Results an immediately-available timepoint.", "description": "Timepoints indicate a point in the execution timeline and this op can be\n used to get a placeholder representing the start of the timeline. Any waits\n on the returned timepoint will resolve immediately. This generally folds\n away but can be useful if needing to initialize globals or branch args.", "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "assemblyFormat": "attr-dict\n `=` `` `>` type($result_timepoint)", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.import", "summary": "Imports a timepoint from an external dialect type.", "description": "Defines a conversion from an external dialect type such as `hal.semaphore`\n that is resolved during lowering into the stream dialect. This can be used\n to interoperate between levels of the stack that require specifying stream\n types and those that prior to lowering do not handle them.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "attributes": [ { "name": "affinity", "type": "OptionalAttr" } ], "assemblyFormat": "(`on` `(` $affinity^ `)`)?\n $operands `:` `(` type($operands) `)`\n `=` `` `>`\n type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.timepoint.join", "summary": "Joins one or more timepoints into the max of all of them.", "description": "Returns a timepoint that indicates that all of the input timepoints have\n been reached.", "operands": [ { "name": "await_timepoints", "type": "Variadic" } ], "results": [ { "name": "result_timepoint", "type": "Stream_Timepoint" } ], "assemblyFormat": "`max` `(` $await_timepoints `)` `=` `` `>` type($result_timepoint)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "stream.yield", "summary": "Yields stream values from an execution region.", "description": "The values returned represent the asynchronous value at the point in time\n the SSA value is defined (or tied).", "operands": [ { "name": "resource_operands", "type": "Variadic>" }, { "name": "resource_operand_sizes", "type": "Variadic" } ], "assemblyFormat": "attr-dict\n ($resource_operands^ `:`\n custom(type($resource_operands),\n $resource_operand_sizes))?", "hasCustomAssemblyFormat": true }, { "name": "tensor.bitcast", "summary": "tensor bitcast operation", "description": "Bitcast a tensor from one type to another type of equivalent element width.\n If both are ranked, then the rank should be the same and static dimensions\n should match.\n\n Example:\n\n ```mlir\n // Bitcast from unsigned to signed or signless integer.\n %2 = tensor.bitcast %1 : tensor<4xui32> to tensor<4xi32>\n ```", "operands": [ { "name": "source", "type": "TensorOf<[AnySignlessInteger, AnyUnsignedInteger, AnySignedInteger, AnyFloat]>" } ], "results": [ { "name": "dest", "type": "TensorOf<[AnySignlessInteger, AnyUnsignedInteger, AnySignedInteger, AnyFloat]>" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "tensor.cast", "summary": "tensor cast operation", "description": "Convert a tensor from one type to an equivalent type without changing any\n data elements. The source and destination types must both be tensor types\n with the same element type. If both are ranked, then the rank should be the\n same and static dimensions should match. The operation is invalid if\n converting to a mismatching constant dimension.\n\n Example:\n\n ```mlir\n // Convert from unknown rank to rank 2 with unknown dimension sizes.\n %2 = tensor.cast %1 : tensor<*xf32> to tensor\n\n // Convert to a type with more known dimensions.\n %3 = tensor.cast %2 : tensor to tensor<4x?xf32>\n\n // Discard static dimension and rank information.\n %4 = tensor.cast %3 : tensor<4x?xf32> to tensor\n %5 = tensor.cast %4 : tensor to tensor<*xf32>\n ```", "operands": [ { "name": "source", "type": "AnyTensor" } ], "results": [ { "name": "dest", "type": "AnyTensor" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "tensor.collapse_shape", "summary": "operation to produce a tensor with a smaller rank", "description": "The `tensor.collapse_shape` op produces a new tensor of lower (or equal)\n rank whose dimension sizes are a reassociation of the original `src` dimensions.\n\n A reassociation is defined as a continuous grouping of dimensions and is\n represented by an array of DenseI64ArrayAttr attribute. The reassociation\n maps are applied to the operand shape to obtain the result shape.\n\n\n Example:\n\n ```mlir\n // Dimension collapse (i, j) -> i' and k -> k'\n %b = tensor.collapse_shape %a [[0, 1], [2]]\n : tensor into tensor\n ```", "operands": [ { "name": "src", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reassociation", "type": "TypedArrayAttrBase>" } ], "assemblyFormat": "$src $reassociation attr-dict `:` type($src) `into` type($result)" }, { "name": "tensor.concat", "summary": "tensor concatenation operation", "description": "The \"concat\" operation constructs a tensor out of a variadic list of input\n tensors, concatenated along a static dimension number. All inputs and the\n result type must share the same rank.\n\n `dim` specifies the dimension along which to concatenate. The size of the\n concatenated dimension in the result must be equal to the sum of the sizes\n of the inputs along that dimension. All other dimensions in both the inputs\n and result must be the same size.\n\n Example:\n\n ```mlir\n %0 = tensor.concat dim(0) %0, %1, %2 :\n (tensor<3x6xf32>, tensor<3x6xf32>, tensor<1x6xf32) -> tensor<7x6xf32>\n\n // Dynamic + dynamic -> static\n %0 = tensor.concat dim(1) %0, %1, %2 :\n (tensor<3x?xf32>, tensor<3x2xf32>, tensor<3x?xf32) -> tensor<3x10xf32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" } ], "assemblyFormat": "`dim` `(` $dim `)` $inputs attr-dict\n `:` functional-type(operands, results)" }, { "name": "tensor.dim", "summary": "dimension index operation", "description": "The `tensor.dim` operation takes a tensor and a dimension operand of type\n `index`. It returns the size of the requested dimension of the given\n tensor. If the dimension index is out of bounds, the behavior is undefined.\n\n The specified tensor type is that of the first operand.\n\n Example:\n\n ```mlir\n // Always returns 4, can be constant folded:\n %c0 = arith.constant 0 : index\n %x = tensor.dim %A, %c0 : tensor<4x?xf32>\n\n // Return the dynamic dimension of %A.\n %c1 = arith.constant 1 : index\n %y = tensor.dim %A, %c1 : tensor<4x?xf32>\n\n // Equivalent generic form:\n %x = \"tensor.dim\"(%A, %c0) : (tensor<4x?xf32>, index) -> index\n %y = \"tensor.dim\"(%A, %c1) : (tensor<4x?xf32>, index) -> index\n ```", "operands": [ { "name": "source", "type": "AnyNon0RankedOrUnrankedTensor" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict $source `,` $index `:` type($source)" }, { "name": "tensor.empty", "summary": "empty tensor operation", "description": "`tensor.empty` is an operation that defines a tensor of a particular shape.\n The shape could be dynamic or static. The contents of the tensor are\n unspecified and the only purpose of the op result is to materialize the\n specified shape in IR and make it available to other transformations.\n\n `tensor.empty` is useful in transformations that expect destination style\n ops. I.e., ops that implement `DestinationStyleOpInterface`. Ops that are\n not in destination style can be made compatible with such transformations\n with a `tensor.empty` destination.\n\n Note: This op can be lowered to a `bufferization.alloc_tensor`, at which\n point it turns into an explicit buffer allocation.", "operands": [ { "name": "dynamicSizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "`(`$dynamicSizes`)` attr-dict `:` type($result)" }, { "name": "tensor.expand_shape", "summary": "operation to produce a tensor with a higher rank", "description": "The `tensor.expand_shape` op produces a tensor of higher (or equal)\n rank than the operand `src` whose dimension sizes are a reassociation of\n `src`.\n\n A reassociation is defined as a continuous grouping of dimensions and is\n represented with an array of DenseI64ArrayAttr attribute. The reassociation\n maps applied to the result tensor with the higher rank must result in the\n operand tensor with the smaller rank.\n\n The representation for the output shape supports a partially-static\n specification via attributes specified through the `static_output_shape`\n argument. A special sentinel value `ShapedType::kDynamic` encodes that the\n corresponding entry has a dynamic value. Both the number of SSA inputs in\n `output_shape` and the number of `ShapedType::kDynamic` entries in\n `static_output_shape` match the number of dynamic dimensions in the result\n type.\n\n Example:\n\n ```mlir\n // Dimension expansion i -> (i', j') and (k) -> (k')\n %b = tensor.expand_shape %a [[0, 1], [2]] output_shape [%sz0, %sz1, 32]\n : tensor into tensor\n ```", "operands": [ { "name": "src", "type": "AnyRankedTensor" }, { "name": "output_shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reassociation", "type": "TypedArrayAttrBase>" }, { "name": "static_output_shape", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$src $reassociation `output_shape`\n custom($output_shape, $static_output_shape) attr-dict `:`\n type($src) `into` type($result)" }, { "name": "tensor.extract", "summary": "element extraction operation", "description": "The `tensor.extract` op reads a ranked tensor and returns one element as\n specified by the given indices. The result of the op is a value with the\n same type as the elements of the tensor. The arity of indices must match\n the rank of the accessed value. All indices should all be of `index` type.\n\n Example:\n\n ```mlir\n %4 = tensor.extract %t[%1, %2] : tensor<4x4xi32>\n %5 = tensor.extract %rt[%1, %2] : tensor\n ```", "operands": [ { "name": "tensor", "type": "AnyRankedTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'tensor', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$tensor `[` $indices `]` attr-dict `:` type($tensor)" }, { "name": "tensor.extract_slice", "summary": "extract slice operation", "description": "The \"extract_slice\" operation extract a tensor from another tensor as\n specified by the operation's offsets, sizes and strides arguments.\n\n The extract_slice operation supports the following arguments:\n\n * source: the \"base\" tensor from which to extract a slice.\n * offsets: tensor-rank number of offsets into the \"base\" tensor from which\n to extract the slice.\n * sizes: tensor-rank number of sizes which specify the sizes of the result\n tensor type.\n * strides: tensor-rank number of strides specifying subsampling in each\n dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value ShapedType::kDynamic encodes that the corresponding entry has\n a dynamic value.\n\n After buffer allocation, the \"extract_slice\" op is expected to lower into a\n memref.subview op.\n\n An extract_slice operation may additionally reduce the rank of the resulting\n tensor by removing dimensions that are statically known to be of size 1.\n This rank-reduction behavior is not required by the op semantics: this\n flexibility allows to progressively drop unit dimensions while lowering\n between different flavors of ops on that operate on tensors.\n\n #### Verification vs Inference in the rank-reduced case\n\n Note that there may be multiple ways to infer a resulting rank-reduced type.\n e.g. 1x6x1 could potentially rank-reduce to either 1x6 or 6x1 2-D shapes.\n\n To disambiguate, the inference helpers `inferCanonicalRankReducedResultType`\n only drop the first unit dimensions, in order:\n e.g. 1x6x1 rank-reduced to 2-D will infer the 6x1 2-D shape, but not 1x6.\n\n Verification however has access to result type and does not need to infer.\n The verifier calls `isRankReducedType(getSource(), getResult())` to\n determine whether the result type is rank-reduced from the source type.\n This computes a so-called rank-reduction mask, consisting of dropped unit\n dims, to map the rank-reduced type to the source type by dropping ones:\n e.g. 1x6 is a rank-reduced version of 1x6x1 by mask {2}\n 6x1 is a rank-reduced version of 1x6x1 by mask {0}\n 1x2x1x4 is a rank-reduced version of 1x1x2x1x1x4x1 by mask {1, 4, 6}\n (remaining common 1 dimensions are matched eagerly)\n\n Example:\n\n ```mlir\n // Rank-reducing extract_slice.\n %1 = tensor.extract_slice %0[0, 0, 0][1, 16, 4][1, 1, 1] :\n tensor<8x16x4xf32> to tensor<16x4xf32>\n %3 = tensor.extract_slice %2[%o0, 4, %o2][1, %sz1, 1][1, %st1, 1] :\n tensor<8x16x4xf32> to tensor<1x?xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `to` type($result)" }, { "name": "tensor.from_elements", "summary": "tensor from elements operation.", "description": "Create a N-D tensor from a range of same-type arguments. The number of\n provided `elements` should equal to the number of the elements in the\n result type. The `elements` correspond to a flattened tensor.\n\n Example:\n\n ```mlir\n tensor.from_elements %a, %b, %c, %d, %e, %f : tensor<2x3xindex>\n ```\n\n will result in a tensor\n\n [[%a, %b, %c]\n [%d, %e, %f]]", "operands": [ { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyStaticShapeTensor" } ], "traits": [ { "type": "TypesMatchWith<'result', 'elements', '[object Object],[object Object],[object Object]'>" } ], "assemblyFormat": "$elements attr-dict `:` type($result)" }, { "name": "tensor.gather", "summary": "gather a subset of a tensor at specified indices", "description": "The `gather` operation extracts a subset of the elements from a `source`\n tensor at the given indices.\n\n In its most general form, the tensor of indices specifies all the coordinates\n of every element to extract (i.e. COO format, without the payload).\n The indices are expected to be confined to coordinate values that fit the\n range of the `source` tensor, otherwise the behavior is undefined.\n\n The leading dimensions of the index tensor give the result tensor its leading\n dimensions. The trailing dimensions of the result tensor are obtained from\n the source tensor by omitting the dimensions specified in `gather_dims`\n (rank-reducing semantics) or setting them to `1` (rank-preserving semantics)\n (see examples).\n The trailing dimension of the index tensor contains the coordinates and is\n expected to have its size equal to the number of dimensions being gathered.\n This convention allows an idiomatic specification and lowering of \"gathering\n multiple N-D slices from the source tensor\".\n\n Note: in the examples below, we separate out the indexing part of the tensor\n type by a whitespace for readability purposes.\n\n Example:\n\n ```mlir\n // For each 1x2 triple of coordinates in %indices, extract the\n // element (i.e. 0-D subset) at the coordinates triple in %source.\n //\n %out = tensor.gather %source[%indices] gather_dims([0, 1, 2]) :\n (tensor<4x4x4xf32>, tensor<1x2x 3xindex>) -> tensor<1x2x 1x1x1xf32>\n\n // Note: result type may be further rank-reduced to tensor<1x2x f32>.\n ```\n\n A slice variant is provided to allow specifying whole slices of the source\n tensor.\n\n Example:\n\n ```mlir\n // For each 5x6 singleton of coordinates in %indices, extract the 2-D\n // slice %source[*, %indices[...]:%indices[...] + 1, *] with the indices\n // corresponding to the `gather_dims` attribute specified by %indices.\n //\n %out = tensor.gather %source[%indices] gather_dims([1]) :\n (tensor<3x4x5xf32>, tensor<6x7x 1xindex>) -> tensor<6x7x 3x1x5xf32>\n\n // Note: result type may be further rank-reduced to tensor<6x7x 3x5xf32>.\n ```\n\n The dimensions specified in the gather_dims attribute are ones for which the\n result tensor has size `1`.\n I.e. if the source type is `axbxcxd` and the coordinates are [1, 3], then\n the shape suffix is `ax1xcx1`.\n Gather also allows rank-reducing semantics where the shape `ax1xcx1` can be\n further simplified to `axc`.\n\n The elemental type of the indices tensor can be any integer type.\n In the absence of target-specific or problem specific information the default\n type one should use is `index`.\n\n This operation does not support unranked tensors.\n\n An optional `unique` unit attribute may be specified to indicate that the\n coordinates in `indices` are statically guaranteed to be unique at runtime.\n Incorrectly setting the `unique` attribute when the coordinates are not truly\n unique is undefined behavior.\n\n Only full slices are meant to be supported by this op, if one desires\n partial slices (e.g. strided windows) one should compose this op with other\n tensor ops (e.g. tensor.extract_slice). This is to avoid a slippery slope of\n complexity that would make the op unusable in practice.\n\n At the tensor-level, the index tensor is specified in an AoS form (i.e.\n coordinate tuple is the most minor). It is the responsibility of further\n lowerings and bufferization to implement various concrete layouts.\n\n Note: As currently specified, the operation must lower to an abstraction that\n performs copies to the output tensor. This is because the buffer type system\n is currently not rich enough to allow multiple non-contiguous views in the\n same type. This is visible more clearly in a notional buffer version of the\n op:\n\n ```mlir\n // memref is a contiguous buffer of ?x4x1 elements.\n // gather from random source slices must copy to the contiguous output.\n %out = memref.gather %source[%indices] gather_dims([1]) :\n (memref<4x4xf32>, memref) -> memref\n\n // Nested buffer support would allow gather to directly index into the\n // source buffer (i.e. represent a jagged view into the source).\n %out = memref.gather %source[%indices] gather_dims([1]) :\n (memref<4x4xf32>, memref) -> memref>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "indices", "type": "RankedTensorOf<[AnySignlessIntegerOrIndex]>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "gather_dims", "type": "DenseI64ArrayAttr" }, { "name": "unique", "type": "UnitAttr" } ], "assemblyFormat": "$source `[` $indices `]`\n `gather_dims` `(` $gather_dims `)`\n (`unique` $unique^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "tensor.generate", "summary": "Creates a dynamically sized tensor from elements", "description": "This operation creates a dynamically sized tensor with elements of any type.\n It expects one index operand per dynamic extent of the result tensor.\n\n The body region defines the tensor's elements. It takes index operands as\n its region arguments that span the index space. The element at the given\n position is yielded with the `yield` operation (see `YieldOp`). There is\n no defined ordering to the invocations of the body. It is conceptually\n a \"parallel map\" operation.\n\n Example:\n\n ```mlir\n %tnsr = tensor.generate %m, %n {\n ^bb0(%i : index, %j : index, %k : index):\n ...\n yield %elem : f32\n } : tensor\n ```", "operands": [ { "name": "dynamicExtents", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$dynamicExtents $body attr-dict `:` type($result)" }, { "name": "tensor.insert", "summary": "element insertion operation", "description": "The `tensor.insert` op inserts a scalar into a ranked tensor `dest` as\n specified by the operation's indices.\n\n It returns a copy of `dest` with the indexed position updated to the value\n of `scalar`.\n\n The arity of `indices `must match the rank of the tensor `dest`. All\n indices should be of `index` type.\n\n Example:\n\n ```mlir\n %4 = tensor.insert %t into %dest[%1, %2] : tensor<4x4xi32>\n %5 = tensor.insert %rt into %dest[%1, %2] : tensor\n ```", "operands": [ { "name": "scalar", "type": "AnyType" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "traits": [ { "type": "TypesMatchWith<'dest', 'result', '$_self'>" }, { "type": "TypesMatchWith<'dest', 'scalar', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$scalar `into` $dest `[` $indices `]` attr-dict `:` type($dest)" }, { "name": "tensor.insert_slice", "summary": "insert_slice operation", "description": "The \"insert_slice\" operation insert a tensor `source` into another\n tensor `dest` as specified by the operation's offsets, sizes and strides\n arguments.\n\n It returns a copy of `dest` with the proper slice updated with the value\n of `source`.\n\n The insert_slice operation supports the following arguments:\n\n * source: the tensor that is inserted.\n * dest: the tensor into which the source tensor is inserted.\n * offsets: tensor-rank number of offsets into the `dest` tensor into which\n the slice is inserted.\n * sizes: tensor-rank number of sizes which specify the sizes of the source\n tensor type.\n * strides: tensor-rank number of strides that specify subsampling in each\n dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value ShapedType::kDynamic encodes that the corresponding entry has\n a dynamic value.\n\n After buffer allocation, the \"insert_slice\" op is expected to lower into a\n memref.subview op.\n\n An insert_slice operation may additionally specify insertion into a tensor\n of higher rank than the source tensor, along dimensions that are statically\n known to be of size 1.\n This rank-altering behavior is not required by the op semantics: this\n flexibility allows to progressively drop unit dimensions while lowering\n between different flavors of ops on that operate on tensors.\n The rank-altering behavior of tensor.insert_slice matches the rank-reducing\n behavior of tensor.extract_slice.\n\n #### Verification in the rank-reduced case\n\n The same verification discussion and mechanisms apply as for ExtractSliceOp.\n Unlike ExtractSliceOp however, there is no need for a specific inference.\n\n Example:\n\n ```mlir\n // Rank-altering insert_slice.\n %1 = tensor.insert_slice %t into %0[0, 0, 0][1, 16, 4][1, 1, 1] :\n tensor<16x4xf32> into tensor<8x16x4xf32>\n %3 = tensor.insert_slice %tt into %2[%o0, 4, %o2][1, %sz1, 1][1, %st1, 1] :\n tensor<1x?xf32> into tensor<8x16x4xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'dest', 'result', '$_self'>" } ], "assemblyFormat": "$source `into` $dest ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `into` type($dest)" }, { "name": "tensor.pad", "summary": "tensor pad operation", "description": "`tensor.pad` is an operation that pads the `source` tensor\n with given `low` and `high` padding config.\n\n The PadOp operation supports the following arguments:\n\n * source: the \"base\" tensor on which to pad.\n * low: A list contains the padding along the start of each\n dimension, i.e., how many padded values are prepended\n to the beginning of the tensor in each dimension.\n * high: A list contains the padding along the end of each\n dimension, i.e., how many padded values are appended\n to the end of the tensor in each dimension.\n * nofold: indicates that the operation should not be folded when source and\n result types are equal.\n\n The result tensor dimensions are `low[i]` + `dim[i]` + `high[i]` for each\n dimension `i`. The number of elements of `low` and `high` must match the\n rank of the input tensor. They can be either a constant or a dynamic value.\n\n The region of the `tensor.pad` operation returns the value to use\n for the padding. The arguments of the region represent the index\n of the source being accessed. There should be as many arguments as\n the rank of the `source` tensor. The value `yield`-ed by the\n region is used as the value of the view at the given position.\n\n If `nofold` is set, the padding operation will not be folded away even\n if the source type and the padded type have the same static shape. This can\n be used, e.g., for packing or promotion to faster memory.\n\n Example 1: add 3 zeros to the beginning and 5 zeros to the end of a 1D\n tensor.\n\n ```mlir\n %arg0 = ... : tensor<10xi32>\n %c0_i32 = arith.constant 0 : i32\n %padded = tensor.pad %arg0 low[3] high[5] {\n ^bb0(%arg1: index):\n tensor.yield %c0_i32 : i32\n } : tensor<10xi32> to tensor<18xi32>\n ```\n\n Example 2: add 1 value to the beginning of dimension 0, 2 values to the end\n of dimension 0, 2 values to the start of dimension 1, and 3 values to the\n end of dimension 1.\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %0 low[1, 2] high[2, 3] {\n ^bb0(%arg0 : index, %arg1 : index):\n tensor.yield %pad_value : f32\n } : tensor to tensor\n ```\n\n Example 3:\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %arg0 low[2, %arg1, 3, 3] high[3, 3, %arg1, 2] {\n ^bb0(%arg2: index, %arg3: index, %arg4: index, %arg5: index):\n tensor.yield %pad_value : f32\n } : tensor<1x2x2x?xf32> to tensor<6x?x?x?xf32>\n ```\n\n Example 4:\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %arg0 low[0, 0] high[%ub0, %ub1] {\n ^bb0(%arg1: index, %arg2: index):\n tensor.yield %pad_value : f32\n } : tensor<2x3xf32> to tensor\n ```\n\n Example 5: Force a padded value to be always exist with `nofold`, even\n though the padding config specifies that no new elements will be added to\n the tensor.\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %arg0 nofold low[0, 0] high[0, 0] {\n ^bb0(%arg1: index, %arg2: index):\n tensor.yield %pad_value : f32\n } : tensor<2x3xf32> to tensor<2x3xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "low", "type": "Variadic" }, { "name": "high", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_low", "type": "DenseI64ArrayAttr" }, { "name": "static_high", "type": "DenseI64ArrayAttr" }, { "name": "nofold", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source\n (`nofold` $nofold^)?\n `low` `` custom($low, $static_low)\n `high` `` custom($high, $static_high)\n $region attr-dict `:` type($source) `to` type($result)" }, { "name": "tensor.parallel_insert_slice", "summary": "Specify the tensor slice update of a single thread of a parent\n InParallelOpInterface op.", "description": "The `parallel_insert_slice` yields a subset tensor value to its parent\n InParallelOpInterface. These subset tensor values are aggregated to\n in some unspecified order into a full tensor value returned by the parent\n parallel iterating op.\n The `parallel_insert_slice` is one such op allowed in the\n InParallelOpInterface op.\n\n Conflicting writes result in undefined semantics, in that the indices written\n to by multiple parallel updates might contain data from any of the updates,\n or even a malformed bit pattern.\n\n If an index is updated exactly once, the value contained at that index\n in the resulting tensor will be equal to the value at a corresponding index\n of a slice that was used for the updated. If an index is not updated at all,\n its value will be equal to the one in the original tensor.\n\n This op does not create a new value, which allows maintaining a clean\n separation between the subset and full tensor.\n\n Note that we cannot mark this operation as pure (Pures), even\n though it has no side effects, because it will get DCEd during\n canonicalization.\n\n The parallel_insert_slice operation supports the following arguments:\n\n * source: the tensor that is inserted.\n * dest: the tensor into which the source tensor is inserted.\n * offsets: tensor-rank number of offsets into the `dest` tensor into which\n the slice is inserted.\n * sizes: tensor-rank number of sizes which specify the sizes of the source\n tensor type.\n * strides: tensor-rank number of strides that specify subsampling in each\n dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value ShapedType::kDynamic encodes that the corresponding entry has\n a dynamic value.\n\n After buffer allocation, the \"parallel_insert_slice\" op is expected to lower\n into a memref.subview op.\n\n A parallel_insert_slice operation may additionally specify insertion into a\n tensor of higher rank than the source tensor, along dimensions that are\n statically known to be of size 1.\n This rank-altering behavior is not required by the op semantics: this\n flexibility allows to progressively drop unit dimensions while lowering\n between different flavors of ops on that operate on tensors.\n The rank-altering behavior of tensor.parallel_insert_slice matches the\n rank-reducing behavior of tensor.insert_slice and tensor.extract_slice.\n\n #### Verification in the rank-reduced case\n\n The same verification discussion and mechanisms apply as for ExtractSliceOp.\n Unlike ExtractSliceOp however, there is no need for a specific inference.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source `into` $dest ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `into` type($dest)" }, { "name": "tensor.rank", "summary": "rank operation", "description": "The `tensor.rank` operation takes a tensor operand and returns its rank.\n\n Example:\n\n ```mlir\n %0 = tensor.rank %arg0 : tensor<*xf32>\n %1 = tensor.rank %arg1 : tensor\n ```", "operands": [ { "name": "tensor", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor)" }, { "name": "tensor.reshape", "summary": "tensor reshape operation", "description": "The `reshape` operation converts a tensor from one type to an equivalent\n type with a provided shape. The source and destination types are compatible\n if both have the same element type, same number of elements. The following\n combinations are possible:\n\n a. Source type is ranked or unranked. Shape argument has static size.\n Result type is ranked.\n\n ```mlir\n // Reshape statically-shaped tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor<4x1xf32>, tensor<1xi32>) -> tensor<4xf32>\n %dst0 = tensor.reshape %src(%shape0)\n : (tensor<4x1xf32>, tensor<2xi32>) -> tensor<2x2xf32>\n // Flatten unranked tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor<*xf32>, tensor<1xi32>) -> tensor\n ```\n\n b. Source type is ranked or unranked. Shape argument has dynamic size.\n Result type is unranked.\n\n ```mlir\n // Reshape dynamically-shaped 1D tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor, tensor) -> tensor<*xf32>\n // Reshape unranked tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor<*xf32>, tensor) -> tensor<*xf32>\n ```", "operands": [ { "name": "source", "type": "AnyTensor" }, { "name": "shape", "type": "TensorRankOf<[AnySignlessInteger, Index], [1]>" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "assemblyFormat": "$source `(` $shape `)` attr-dict `:` functional-type(operands, results)" }, { "name": "tensor.scatter", "summary": "scatter a tensor into a destination tensor at specified indices", "description": "The `scatter` operation inserts a `source` tensor into a `dest` tensor at\n the given indices.\n\n In its most general form, the tensor of indices specifies all the coordinates\n of every element to insert (i.e. COO format, without the payload).\n The indices are expected to be confined to coordinate values that fit the\n range of the `dest` tensor, otherwise the behavior is undefined.\n\n The leading dimensions of the index tensor must match that of the dest\n tensor. The trailing dimensions of the dest tensor must match those of the\n source tensor by omitting the dimensions specified in scatter_dims\n (rank-reducing semantics) or setting them to `1` (rank-preserving semantics)\n (see examples).\n This convention allows an idiomatic specification and lowering of\n \"scattering multiple N-D slices into the dest tensor\".\n The result type must match the type of the dest tensor.\n\n Note: in the examples below, we separate out the indexing part of the tensor\n type by a whitespace for readability purposes.\n\n Example:\n\n ```mlir\n // For each 1x2 triple of coordinates in %indices, insert the\n // element (i.e. 0-D subset) at the coordinates triple in %dest.\n //\n %out = tensor.scatter %source into %dest[%indices]\n scatter_dims([0, 1, 2]) unique :\n (tensor<1x2x 1x1x1xf32>, tensor<4x4x4xf32>, tensor<1x2x 3xindex>)\n -> tensor<4x4x4xf32>\n\n // Note: source type may be further rank-reduced to tensor<1x2x f32>.\n ```\n\n A slice variant is provided to allow specifying insertion of whole tensor\n slices into the `dest` tensor.\n\n Example:\n\n ```mlir\n // For each 3 singleton of coordinates in %indices, insert the 2-D\n // slice into %dest[*, %indices[...]:%indices[...] + 1, *] with the\n // indices corresponding to the scatter_dims attribute specified by\n // %indices.\n //\n %out = tensor.scatter %source into %dest[%indices] scatter_dims([1]) unique :\n (tensor<3x 4x1x6xf32>, tensor<4x5x6xf32>, tensor<3x 1xindex>)\n -> tensor<4x5x6xf32>\n ```\n\n The dimensions specified in the scatter_dims attribute are ones for which the\n source tensor has size `1`.\n I.e. if the dest type is `axbxcxd` and the coordinates are [1, 3], then\n the source type suffix is `ax1xcx1`.\n Scatter also allows rank-reducing semantics where the shape `ax1xcx1` can be\n further simplified to `axc`.\n\n The elemental type of the indices tensor can be any integer type.\n In the absence of target-specific or problem specific information the default\n type one should use is `index`.\n\n This operation does not support unranked tensors.\n\n A `unique` unit attribute must be be specified to indicate that the\n coordinates are statically guaranteed to be unique at runtime. If coordinates\n are not truly unique at runtime, the behavior is undefined.\n\n Only full slices are meant to be supported by this op, if one desires\n partial slices (e.g. strided windows) one should compose this op with other\n tensor ops (e.g. tensor.insert_slice). This is to avoid a slippery slope of\n complexity that would make the op unusable in practice.\n\n At the tensor-level, the index tensor is specified in an AoS form (i.e.\n coordinate tuple is the most minor). It is the responsibility of further\n lowerings and bufferization to implement various concrete layouts.\n\n Note: As currently specified, the operation must lower to an abstraction that\n performs copies to the output tensor. This is because the buffer type system\n is currently not rich enough to allow multiple non-contiguous views in the\n same type. This is visible more clearly in a notional buffer version of the\n op:\n\n ```mlir\n // memref is a contiguous buffer of ?x4 elements, scatter into\n // random dest slices must copy to the contiguous dest.\n //\n some_side_effecting_op_writing_into %source, ...: memref<3x 4xf32>\n memref.scatter %source into %dest[%indices] scatter_dims([1]) unique :\n (memref<3x 4xf32>, memref, memref)\n\n // Nested buffer support in the producing op would allow writing directly\n // into the dest buffer.\n %v = some_nested_buffer_view_op %dest[%indices] scatter_dims([1]) unique :\n memref>\n some_side_effecting_op_writing_into %v, ...: memref>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "indices", "type": "RankedTensorOf<[AnySignlessIntegerOrIndex]>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scatter_dims", "type": "DenseI64ArrayAttr" }, { "name": "unique", "type": "UnitAttr" } ], "assemblyFormat": "$source `into` $dest `[` $indices `]`\n `scatter_dims` `(` $scatter_dims `)`\n (`unique` $unique^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "tensor.splat", "summary": "tensor splat or broadcast operation", "description": "Broadcast the operand to all elements of the result tensor.\n\n An additional argument of type `index` must be provided for each dynamic\n dimension present in the result type.\n\n Example for a statically shaped tensor:\n\n ```mlir\n %s = arith.constant 1.0 : f32\n %t = tensor.splat %s : tensor<8x16xf32>\n ```\n\n Example for a tensor containing dynamic dimensions:\n\n ```mlir\n // Broadcasts %s to a 3D dynamically shaped tensor, with %m and %n binding\n // to dimensions 0 and 2 of the resulting tensor, respectively.\n %m = arith.constant 10 : index\n %n = arith.constant 30 : index\n %t = tensor.splat %s[%m, %n] : tensor\n ```", "operands": [ { "name": "input", "type": "AnyType" }, { "name": "dynamicSizes", "type": "Variadic" } ], "results": [ { "name": "aggregate", "type": "AnyRankedTensor" } ], "traits": [ { "type": "TypesMatchWith<'aggregate', 'input', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$input (`[` $dynamicSizes^ `]`)? attr-dict `:` type($aggregate)" }, { "name": "tensor.yield", "summary": "Yield a value from a region", "description": "This operation is used to yield a single value from a within a region. It\n is used to create dynamically sized tensors\n (see `tensor.generate` and `tensor.pad` ops).", "operands": [ { "name": "value", "type": "AnyType" } ], "assemblyFormat": "$value attr-dict `:` type($value)" }, { "name": "tensorrt.activation", "summary": "TensorRT activation (IActivationLayer) operation", "description": "The `tensorrt.activation` operation models a unary operation that depends\n on up to two parameters (`alpha` and `beta`). The purpose of the two\n parameters depends on the `activationType`.\n\n This op applies the `activationType` function on an element-wise basis\n to form the result.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "attributes": [ { "name": "activationType", "type": "TensorRT_ActivationTypeAttr{kRELU|kSIGMOID|kTANH|kLEAKY_RELU|kELU|kSELU|kSOFTSIGN|kSOFTPLUS|kCLIP|kHARD_SIGMOID|kSCALED_TANH|kTHRESHOLDED_RELU|kGELU_ERF|kGELU_TANH}" }, { "name": "alpha", "type": "OptionalAttr" }, { "name": "beta", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input)" }, { "name": "tensorrt.argmax", "summary": "Represents an argmax operation", "description": "The `tensorrt.argmax` operation returns the maximum value as well as\n the index for the that value along the specified dimension. The\n result types are not rank-reduced.\n\n This operation is a TensorRT dialect extension operation and will be\n lowered to a `tensorrt.top_k` operation before translation to a\n TensorRT engine.", "operands": [ { "name": "input", "type": "TensorRT_Tensor" } ], "results": [ { "name": "values", "type": "TensorRT_Tensor" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32]>" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input) `->` type(results)" }, { "name": "tensorrt.argmin", "summary": "Represents an argmin operation", "description": "The `tensorrt.argmin` operation returns the minimum value as well as\n the index for the that value along the specified dimension. The\n result types are not rank-reduced.\n\n This operation is a TensorRT dialect extension operation and will be\n lowered to a `tensorrt.top_k` operation before translation to a\n TensorRT engine.", "operands": [ { "name": "input", "type": "TensorRT_Tensor" } ], "results": [ { "name": "values", "type": "TensorRT_Tensor" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32]>" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input) `->` type(results)" }, { "name": "tensorrt.assertion", "summary": "TensorRT IAssertionLayer operation", "description": "An assertion layer in a network\n\n The `tensorrt.assertion` operation has an input tensor, `condition` and no output.\n The input tensor must be a boolean type of rank 0 or 1.\n If any element of the input is provably false at build time, the network is rejected.\n If any element of the input is false at runtime for the supplied runtime dimensions,\n an error occurs, much the same as if any other runtime error is handled.\n\n The attribute named `message` defines the message to print if the assertion fails.", "operands": [ { "name": "condition", "type": "TensorRT_RankedTensorOf<[I1]>" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)`" }, { "name": "tensorrt.broadcast", "summary": "Represents a broadcast explicitly that occurs in different TensorRT operations", "description": "`tensorrt.broadcast` is an explicit representation of the broadcasting\n operation that occurs in TensorRT operations such as\n `tensorrt.element_wise`. In addition, this broadcast operation is allowed to\n perform a rank expansion as well. The semantics are aligned with the\n StableHLO `broadcast_in_dim` operation.\n\n The `broadcast_dims` attribute contains a list of indices that such that\n input type dimension `i` is mapped to `broadcast_dims[i]` of the result\n type. `broadcast_dims` do not have to be increasing; the mapping is allowed\n to permute the ordering of the input dimensions.\n\n If the result shape is not fully specified, then the `shape` tensor\n containing must be provided to specify the result shape.\n\n This operation is a TensorRT dialect extension operation and will either be\n canonicalized away (by absorbing into e.g. `tensorrt.element_wise`) or be lowered\n into a reshape operation such as `tensorrt.shuffle`.\n\n #### Example\n\n ```mlir\n %result = tensorrt.broadcast %input broadcast_dims<3, 1>\n : tensor<1x10xf32> to tensor <4x10x4x28xf32>\n ```", "operands": [ { "name": "input", "type": "TensorRT_AllTypesTensor" }, { "name": "shape", "type": "Optional" } ], "results": [ { "name": "result", "type": "TensorRT_AllTypesTensor" } ], "attributes": [ { "name": "broadcast_dims", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$input `broadcast_dims` `<` custom($broadcast_dims) `>`\n (`shape` `(` $shape^ `:` type($shape) `)`)?\n attr-dict `:` type($input) `to` type($result)" }, { "name": "tensorrt.call", "summary": "calls a TensorRT engine defined in a `tensorrt.module`", "operands": [ { "name": "inputs", "type": "Variadic>" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee `(` ($inputs^ `:` type($inputs))? `)`\n `outs` `(` $outputs `:` type($outputs) `)`\n attr-dict (`->` type($results)^)?" }, { "name": "tensorrt.call_alloc", "summary": "calls a TensorRT engine defined in a `tensorrt.module` and allocates output tensors", "description": "This operation calls a TensorRT engine and allocates output tensors. It will be converted to an\n `enqueue_alloc` operation in a later pass.", "operands": [ { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` ($inputs^ `:` type($inputs))? `)`\n attr-dict (`->` type($results)^)?" }, { "name": "tensorrt.cast", "summary": "TensorRT cast (ICastLayer) operation", "description": "The `tensorrt.cast` operation performs a cast from the the input tensor\n type to the result tensor type, changing only the element type.\n\n This operation supports casting to and from all data types except f8 and i4.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[I1, UI8, TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[I1, UI8, TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "assemblyFormat": "attr-dict $input `:` type($input) `to` type($result)" }, { "name": "tensorrt.collapse_rank", "summary": "Collapses the rank of the input tensor by removing 1's from the shape", "description": "The shape of the tensor is \"collapsed\" by removing 1's (not necessarily all\n of them). This operation achieves the result commonly known as \"squeezing\"\n a tensor in deep learning frameworks.\n\n This operation is a TensorRT dialect extension operation and is lowered\n into a TensorRT shuffle operation.", "operands": [ { "name": "input", "type": "TensorRT_AllTypesTensor" } ], "results": [ { "name": "result", "type": "TensorRT_AllTypesTensor" } ], "assemblyFormat": "attr-dict $input `:` type($input) `to` type($result)" }, { "name": "tensorrt.concatenation", "summary": "TensorRT concatenate (IConcatenationLayer) operation", "description": "The `tensorrt.concatenation` operation concatenates the given `inputs`\n along the dimension `axis`. The input types must have equal rank and\n the shapes must be such that dimension sizes other than the size for\n `axis` must be equal among all inputs.\n\n The concatenation axis is expected to be non-negative.\n\n The result dimension size along the concatenation axis is the sum of\n the corresponding input dimensions. Every other output dimension is\n the same as the corresponding dimension of the inputs.", "operands": [ { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type($result)" }, { "name": "tensorrt.condition", "summary": "While loop's continuation condition.", "description": "The `tensorrt.condition` operation accepts the continuation of\n `tensorrt.while` construct. If its first argument is true, the\n \"body\" region of the `tensorrt.while` is executed, with the remaining\n arguments forwarded to the entry block of the region. Otherwise,\n the loop terminates.", "operands": [ { "name": "condition", "type": "0DTensorOf<[I1]>" }, { "name": "args", "type": "Variadic" } ], "assemblyFormat": "`(` $condition `:` type($condition) `)` attr-dict ($args^ `:` type($args))?" }, { "name": "tensorrt.constant", "summary": "TensorRT constant (IConstantLayer) operation", "description": "The `tensorrt.constant` op represents a constant value.", "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[I1, TensorRT_I4, TensorRT_I8, I32, I64, TensorRT_F8, F16, BF16, F32]>" } ], "attributes": [ { "name": "weights", "type": "ElementsAttr" } ], "traits": [ { "type": "AllTypesMatch<['weights', 'result']>" } ], "assemblyFormat": "attr-dict $weights" }, { "name": "tensorrt.convolution", "summary": "TensorRT convolution (IConvolutionLayer) operation", "description": "The `tensorrt.convolution` operation represents a 2D or 3D convolution:\n `input`'s spatial dimensions are convolved with the filters of `kernel`\n to form the result.\n\n The `input` is assumed to be organized such that the dimensions of the shape\n correspond to `[batch_dim, chan_dim, spatial dimensions... ]`.\n\n The `kernel` is assumed to be organized such that the dimensions of the shape\n correspond to `[num_filters, chan_dim / num_groups, filter spatial dimensions... ]`.\n\n The `kernel` input must be computable at build time via constant folding.\n\n An optional `bias` is supported, which adds a per-channel constant to each\n value in the output. If supplied `bias` must be the result of a\n `tensorrt.constant` operation.\n\n TODO: add other padding modes.\n TODO: add stride/padding/dilation/groups description.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" }, { "name": "kernel", "type": "Optional>" }, { "name": "bias", "type": "Optional>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernelStatic", "type": "OptionalAttr" }, { "name": "biasStatic", "type": "OptionalAttr" }, { "name": "stride", "type": "DenseI64ArrayAttr" }, { "name": "pre_padding", "type": "DenseI64ArrayAttr" }, { "name": "post_padding", "type": "DenseI64ArrayAttr" }, { "name": "num_groups", "type": "DefaultValuedAttr" }, { "name": "dilation", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict `in` `(` $input `:` type($input) `)`\n (`kernel` `(` $kernel^ `:` type($kernel) `)` )?\n (`bias` `(` $bias^ `:` type($bias) `)` )?\n `->` type($result)" }, { "name": "tensorrt.deconvolution", "summary": "TensorRT deconvolution (IDeconvolutionLayer) operation", "description": "The `tensorrt.deconvolution` operation represents a 2D or 3D deconvolution:\n `input`'s spatial dimensions are convolved with the filters of `kernelWeights`\n to form the result.\n\n The `input` is assumed to be organized such that the dimensions of the shape\n correspond to `[batch_dim, chan_dim, spatial dimensions... ]`.\n\n The `kernelWeights` is assumed to be organized such that the dimensions of the shape\n correspond to `[chan_dim, num_filters / num_groups, filter spatial dimensions... ]`.\n\n The `kernelWeights` input must be computable at build time via constant folding.\n\n An optional `biasWeights` is supported, which adds a per-channel constant to each\n value in the output. If supplied `biasWeights` must be the result of a\n `tensorrt.constant` operation.\n\n TODO: add other padding modes.\n TODO: add stride/padding/dilation/groups description.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" }, { "name": "kernelWeights", "type": "Optional>" }, { "name": "biasWeights", "type": "Optional>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernelWeightsStatic", "type": "OptionalAttr" }, { "name": "biasWeightsStatic", "type": "OptionalAttr" }, { "name": "stride", "type": "DenseI64ArrayAttr" }, { "name": "pre_padding", "type": "DenseI64ArrayAttr" }, { "name": "post_padding", "type": "DenseI64ArrayAttr" }, { "name": "num_groups", "type": "DefaultValuedAttr" }, { "name": "dilation", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `in` `(` $input `:` type($input) `)`\n (`kernelWeights` `(` $kernelWeights^ `:` type($kernelWeights) `)` )?\n (`biasWeights` `(` $biasWeights^ `:` type($biasWeights) `)` )?\n `->` type($result)" }, { "name": "tensorrt.dequantize", "summary": "TensorRT Dequantize(IDequantizeLayer) operation", "description": "The `tensorrt.dequantize` operation dequantize an 8-bit signed integer into\n a floating-point output tensor using the `scale` input.\n\n NOTE: Although `zero_point` is an optional input for TensorRT\n Dequantize(IDequantizeLayer) operation, it is removed here because it's just\n a placeholder which is not actually used and cannot be set to other values\n other than 0 in TensorRT.\n `zero_point` is omitted for the following description.\n\n Dequantization can either be applied uniformly for the entire input\n (\"per-tensor\" manner) using a single scalar \"scale\" value, or it can be\n applied in a \"per-channel\" manner, meaning that different slices of the input\n tensor along a specified `axis` are dequantized using different parameters in\n a 1D \"scale\" tensor, or it can be applied in a \"2D block\" manner using a 2D\n \"scale\" tensor (supports only `INT4` 2D weight inputs).\n\n #### Caveats\n\n - `scale` must be compile time constants (after constant folding by either\n MLIR-TRT or TRT itself).\n\n #### Argument Constraints\n\n If `axis` is not given:\n\n - `scale` must be 2D for INT4 block dequantization. Block dequantization always\n happens along `axis` 0.\n - `scale` must be a scalar (0D tensor i.e. `tensor<[element type]>`) for\n per-tensor dequantization.\n\n If `axis` is given:\n\n - `scale` must be 1D tensors with `input.shape[axis]`\n number of elements, for per-channel dequantization.\n - Similarly, the size of input dimension `input.shape[axis]` must be\n a compile time constant (i.e. it cannot be `?`).\n - `axis` must be in the range of `[0, R)`.\n\n #### Dequantization Computation\n\n Let `(i_0, ..., i_{R-1})` represent indices in the index space of the\n `input` tensor, which is of rank `R`.\n\n Per-tensor dequantization transforms the input\n uniformly as follows:\n\n ```\n output[ i_0, ..., i_{R-1} ] := input[ i_0, ..., i_{R-1} ] * (f32)scale\n ```\n\n Per-channel dequantization is supported only for weight inputs. Activations\n can't be dequantized per-channel. Given a 1D tensor of `scale` values and\n `axis`, the input is transformed as follows:\n\n ```\n output[i_0, ..., i_{axis}, ..., i_{R-1} ] :=\n input[ i_0, ..., i_{axis}, ..., i_{R-1} ] * scale[ i_{axis} ]\n ```\n\n Block quantization is supported only for 2-D weight inputs of type `INT4`.\n Axis for block quantization is always 0. Let `B` be the block size. Block\n quantization transforms the input as follows:\n\n ```\n output[i_0, i_1] :=\n input[ i_0, i_1 ] * scale[ i_0 // B, i_1 ]\n ```\n\n The output shape is the same as the input shape. The dequantization axis is\n in reference to the input tensor's dimensions.\n\n Valid conversions are as follows:\n\n ```\n (int8 | f8E4M3FN | int4) -> (f32 | f16 | bf16)\n ```\n\n #### Examples\n\n ```mlir\n %1 = tensorrt.dequantize in(%arg0 : tensor<10x10xi8>)\n scale(%arg1 : tensor<1xf32>) -> tensor<10x10xf32>\n %2 = tensorrt.dequantize { axis = 1 : i32 } in(%arg0 : tensor<10x10xi8>)\n scale(%arg1 : tensor<10xf32>) -> tensor<10x10xf32>\n ```", "operands": [ { "name": "input", "type": "TensorRT_Non0RankedTensorOf<[TensorRT_I8, TensorRT_F8, TensorRT_F4, TensorRT_I4]>" }, { "name": "scale", "type": "TensorRT_RankedTensorOf<[F32, F16, BF16]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F32, F16, BF16]>" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict `in` `(` $input `:` type($input) `)`\n `scale` `(` $scale `:` type($scale) `)`\n `->` type($result)" }, { "name": "tensorrt.dynamic_quantize", "summary": "TensorRT DynamicQuantize(IDynamicQuantize) operation", "description": "This layer performs dynamic, per-block quantization on the `input` tensor,\n converting it to the NVFP4 format. It uses a \"double quantization\" scheme\n to maintain accuracy while minimizing memory usage.\n\n The quantization process involves two levels of scaling:\n 1. **First-Level Scale (Dynamic, Per-Block)**: For each block of `block_size`\n (currently, only block size of 16 is supported) values along the specified `axis`,\n the layer dynamically computes a scaling factor.\n 2. **Second-Level Scale (Static, Per-Tensor)**: A single `FP32` scaling factor,\n `double_quant_scale`, is provided as an input to the layer. This\n \"scale for the scales\" is computed offline via calibration and is used\n to quantize the first-level scales into the limited `FP8` range `scales`.\n\n Thus, final quantized `result` is in `FP4` format and scales `scales`\n is in `FP8` format.\n\n **Constraints:**\n - The `block_size` is fixed at 16.\n - The dimension of the `axis` must be a compile-time constant and be divisible by 16.\n\n **Example**\n ```\n %double_quant_scale = tensorrt.constant dense<1.0> : tensor\n %axis = arith.constant 1 : i32\n %inp_f32 = tensorrt.constant ... : tensor<2x32xf32>\n %out_f4, %scale_f8 = tensorrt.dynamic_quantize {axis = 1, block_size = 16}\n in(%inp_f32 : tensor<2x2xf32>) double_quant_scale(%double_quant_scale : tensor)\n -> (tensor<2x32xf4E2M1FN>, tensor<2x2xf8E4M3FN>);\n\n .....\n\n %dequantize_scale = tensorrt.dequantize in(%scale_f8 : tensor<2x2xf8E4M3FN>)\n scale(%double_quant_scale : tensor) -> tensor<2x2xf32>\n %dequantize_data = tensorrt.dequantize {axis = 1} in(%out_f4 : tensor<2x32xf4E2M1FN>)\n scale(%dequantize_scale : tensor<2x2xf32>) -> tensor<2x32xf32>\n ```", "operands": [ { "name": "input", "type": "TensorRT_Non0RankedTensorOf<[F32, F16, BF16]>" }, { "name": "double_quant_scale", "type": "TensorRankOf<[F32, F16, BF16], [0]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_F4]>" }, { "name": "scales", "type": "TensorRT_RankedTensorOf<[TensorRT_F8]>" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "block_size", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `in` `(` $input `:` type($input) `)`\n `double_quant_scale` `(` $double_quant_scale `:` type($double_quant_scale) `)`\n `->` type(results)" }, { "name": "tensorrt.einsum", "summary": "TensorRT einsum (IEinsumLayer) operation", "description": "The `tensorrt.einsum` op implements a summation over the elements of the\n inputs along dimensions specified by the equation parameter, based on the\n Einstein summation convention.\n\n The layer can have one or two inputs of rank >= 0. All the inputs must have\n `f16` or `f32` data types, but can differ in data type.\n\n The result type has element type`f32` and a shape that is determined by\n the einsum equation.\n\n The equation specifies ASCII lower-case letters for each dimension in the\n inputs in the same order as the dimensions, separated by comma for each\n input. The dimensions labeled with the same subscript must match or be\n broadcastable. Repeated subscript labels in one input take the diagonal.\n Repeating a label across multiple inputs means that those axes will be\n multiplied. Omitting a label from the output means values along those axes\n will be reduced (summed).\n\n There are two modes of interpretation of the equation: implicit and\n explicit.\n\n #### Implicit Mode\n\n In implicit mode, the indices which appear once in the expression will be\n part of the output in increasing\n alphabetical order.\n\n #### Explicit Mode\n\n In explicit mode, the output can be controlled by specifying output\n subscript labels by adding an arrow (`->`) followed by subscripts for\n the output. For example, “ij,jk->ik” is equivalent to “ij,jk”.\n\n #### Examples\n\n Many common operations can be expressed using the Einsum equation.\n For example:\n Matrix Transpose: ij->ji\n Sum: ij->\n Matrix-Matrix Multiplication: ik,kj->ij\n Dot Product: i,i->\n Matrix-Vector Multiplication: ik,k->i\n Batch Matrix Multiplication: ijk,ikl->ijl\n\n #### Unsupported einsum features\n\n The following einsum conventions are not supported by TensorRT\n (as of TensorRT 8.5):\n - Diagonal (repeated index in one operand)\n - Use of ellipsis", "operands": [ { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "attributes": [ { "name": "equation", "type": "StrAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type($result)" }, { "name": "tensorrt.element_wise", "summary": "TensorRT element-wise (IElementWiseLayer) operation", "description": "The `tensorrt.element_wise` operation takes two Tensor-typed inputs\n and performs a mathematical operation to yield the result in a per-element\n manner. This operation also has broadcast semantics described below.\n\n #### Broadcasting Semantics\n\n The input tensors must have the same rank. For each dimension, their lengths\n must match, or one of them must be one. In the latter case, the tensor is\n broadcast along that axis.\n\n The output tensor has the same rank as the inputs. For each output dimension,\n its length is equal to the lengths of the corresponding input dimensions if they match,\n otherwise it is equal to the length that is not one.\n\n Note that during compile time, the length of a dimension may be unknown.\n Therefore, it may not be possible to validate broadcasting semantics until\n runtime. For example:\n\n ```mlir\n tensorrt.element_wise kADD\n (%input0, %input1 : tensor<10x128xf32>, tensor) -> tensor<10x128xf32>\n ```\n\n In this case, the compiler will not reject the IR because it cannot prove\n that `?` is not `1`. But at runtime, TensorRT should throw an error if `?`\n does not turn out to be 1.", "operands": [ { "name": "input1", "type": "TensorRT_Tensor" }, { "name": "input2", "type": "TensorRT_Tensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "elementwiseOperation", "type": "TensorRT_ElementWiseOperationAttr{kSUM|kPROD|kMAX|kMIN|kSUB|kDIV|kPOW|kFLOOR_DIV|kAND|kOR|kXOR|kEQUAL|kGREATER|kLESS}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $elementwiseOperation\n `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.expand_rank", "summary": "Expands the rank of the input tensor by inserting 1's in the shape", "description": "The shape of the tensor is \"expanded\" by inserting 1's into the shape.\n\n This operation is typically used to ensure that result tensor meets the required\n rank for broadcasting in elementwise operations or for certain operations\n such as matrix multiplication.\n\n This operation is a TensorRT dialect extension operation and is lowered\n into a TensorRT shuffle operation.", "operands": [ { "name": "input", "type": "TensorRT_AllTypesTensor" } ], "results": [ { "name": "result", "type": "TensorRT_AllTypesTensor" } ], "assemblyFormat": "attr-dict $input `:` type($input) `to` type($result)" }, { "name": "tensorrt.for", "summary": "TensorRT Loop (ILoopLayer) operation", "description": "The `tensorrt.for` operation represents a for-style loop that executes its\n body once for each valid value of the induction variable.\n\n The iteration variable takes values in [`start`, `stop`), incrementing by\n `step` each iteration. The values `start`, `stop`, and `step` must be\n `tensor` (0-D i32 tensor types).\n\n The loop body is a single-block region. The block arguments represent\n the following (in order from first to last):\n\n 1. The induction variable.\n 2. Loop carried dependencies.\n\n #### Loop carried dependencies\n\n The initial values of all loop carried dependencies are given by the op's\n `init` arguments (see example). For each loop carried dependency, the loop\n body must yield a value, representing the value that should be passed to\n the next iteration.\n\n #### Example\n\n The below example constructs a simple loop that adds a tensor of 1's\n to the input argument 10 times:\n\n ```mlir\n func.func @trt_for_loop(%arg0: tensor<10xf32>) -> tensor<10xf32> {\n %lb = tensorrt.constant dense<0> : tensor\n %ub = tensorrt.constant dense<10> : tensor\n %step = tensorrt.constant dense<1> : tensor\n %ones = tensorrt.constant dense<1.0> : tensor<10xf32>\n %0 = tensorrt.for %i = %lb to %ub step %step init(%iter0 = %arg0) -> tensor<10xf32> {\n %add = tensorrt.element_wise (%iter0, %ones : tensor<10xf32>, tensor<10xf32>) -> tensor<10xf32>\n tensorrt.yield %add : tensor<10xf32>\n }\n return %0 : tensor<10xf32>\n }\n ```", "operands": [ { "name": "lb", "type": "0DTensorOf<[I32]>" }, { "name": "ub", "type": "0DTensorOf<[I32]>" }, { "name": "step", "type": "0DTensorOf<[I32]>" }, { "name": "init", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body_region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tensorrt.gather", "summary": "TensorRT gather (IGatherLayer with kDEFAULT mode) operation", "description": "The `tensorrt.gather` operation represents a gather operation on the input\n data elements `data` using the indices `indices`. The operation additionally\n has two parameters:\n\n 1. `numBroadcastDims`: controls how the dimensions of `indices` are\n interpreted. It must be either 0 (default) or 1 and follow `numBroadcastDims` <= `axis`.\n 2. `axis`: The dimension number in the shape of `data`'s type from which\n to start gathering data.\n\n The rank of the `indices` tensor has no restrictions.\n\n The result is expected to be equal to\n `rank(data) + rank(indices) - 1 - numBroadcastDims`.\n\n First `numBroadcastDims` dimensions of the output are computed by\n applying broadcast rules to first `numBroadcastDims` dimensions of\n the indices indices and data tensors. Note that `0 <= numBroadcastDims <= 1`.\n The rest of dimensions are computed by copying the dimensions of the `data`\n and replacing the `axis` dimension with the dimensions of the corresponding\n indices.\n\n This op follows the semantics of\n [tf.GatherV2](https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/gather-v2)\n and [onnx.Gather](https://github.com/onnx/onnx/blob/main/docs/Operators.md#Gather)\n and [torch.index_select](https://pytorch.org/docs/stable/generated/torch.index_select.html)\n (when the rank of `indices` is constrained to be `1`).\n\n #### Output Computation when `numBroadcastDims = 0`:\n\n For data of rank `D`, indices of rank `I`, the result rank `R := D + I -1`.\n\n Let `J = (r_0, ..., r_{axis-1}, r_{axis},..., r_{axis+I-1}, ..., r_{R-1})` be a point\n in the iteration space of `result`.\n\n For each `J`, the slice of these numbers `J[axis, axis+I-1] = (r_{axis}, ..., r_{axis+I-1})`\n is an iteration point in the space of `indices`.\n\n Then let `K = index[r_{axis}, ..., r_{axis+I-1} ]` and the result is formed by\n\n ```\n result[r_0, ..., r_{R-1} ]\n = data[r_0, ..., r_{axis-1}, K, r_{axis+I}, ..., r_{R-1} ]\n ```\n\n #### Caveats\n\n * If an dimension of `data` has dynamic/unknown length, then using a negative\n index for it has undefined behavior.\n * This layer does not support DLA.\n * Zero will be stored for all out-of-bounds (OOB) access.", "operands": [ { "name": "data", "type": "TensorRT_Tensor" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32, I64]>" } ], "results": [ { "name": "result", "type": "TensorRT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "numBroadcastDims", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type($result)" }, { "name": "tensorrt.gather_elements", "summary": "TensorRT gather (IGatherLayer with kELEMENTS mode) operation", "description": "The `tensorrt.gather_elements` operation represents a gather operation on\n the input data elements `data` using the indices `indices`. The operation\n additionally has a parameter`axis`, which is the dimension number in\n the shape of `data` from which to start gathering data.\n\n This op follows the semantics of\n [onnx.GatherElements](https://github.com/onnx/onnx/blob/main/docs/Operators.md#GatherElements).\n\n The shape of the result is equal to the shape of `indices`.\n\n For each element X of indices:\n Let J denote a sequence for the subscripts of X\n Let K = sequence J with element [axis] replaced by X\n output[J] = data[K]\n\n #### Output Calculation\n\n For each point `(i_0, ..., i_{rank-1})` in the iteration space of `indices`:\n\n Let `idx = indices[i_0, ..., i_{rank-1} ]`.\n\n Then the result values are calculated as follows:\n\n ```\n result[i_0, ..., i_{axis}, ..., i_{rank-1} ] = data[i_0, ..., idx, ..., i_rank{-1} ]\n ```\n\n #### Example\n\n Given a tensor `input : tensor<2x20xf32>`, suppose you wanted to permute\n the elements of `input[0, :]` and `input[1, :]` according to two\n separate permutations `perm1 : tensor<20xi64>` and `perm2 : tensor<20xi64>`.\n\n Form the `indices : tensor<2x20xi64>` such that `indices[0, :] = perm1`\n and `indices[1, :] = perm2`.\n\n Then the desired result can be achieved via\n\n ```mlir\n %result = tensorrt.gather_elements {\n axis = 1 : i64\n } ins(%input, %indices : tensor<2x20xf32>, tensor<2x20xi64>)\n -> tensor<2x20xf32>\n ```", "operands": [ { "name": "data", "type": "TensorRT_Tensor" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32, I64]>" } ], "results": [ { "name": "result", "type": "TensorRT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type($result)" }, { "name": "tensorrt.gather_nd", "summary": "TensorRT gather-ND operation (IGatherLayer with kND mode)", "description": "The `tensorrt.gather_nd` operation gathers slices of `data` into the\n `result`. The operation can be described using the below pseudo-code.\n The key difference between `tensorrt.gather` and `tensorrt.gather_nd` is that\n the indices of `tensorrt.gather` specify an scalar offset into a particular\n axis while the indices of `tensorrt.gather` specify an N-dimensional index.\n `N` is less than or equal to the rank of `data`:\n\n ```\n let r = rank(data)\n let q = rank(indices)\n let index_vector_size = shape(indices)[-1]\n\n let result_shape = concat( shape(indices)[:-1], shape(data)[-index_vector_size:] )\n let index_volume = volume(shape(indices)[:-1])\n\n let result = tensor_of(shape=result_shape, element_type=element_type(data))\n\n for i in 0..index_volume:\n let index_coord = *delin(i, shape(indices)[:-1])\n // Slice 1D 'offsets' from indices.\n let offsets = indices[*index_coord]\n assert rank(offsets) == 1\n // Use `offsets` to select a (r-index_vector_size) slice\n // from `data`.\n slice_offsets = concat(offsets, [0]*(r-index_vector_size))\n slice_sizes = concat([1]*len(offsets), shape(data)[-index_vector_size:])\n slice_strides = [1] * r\n data_slice = slice(data, slice_offsets, slice_sizes, slice_strides)\n result[concat(index_coord, [0] * (r-index_vector_size)] = data_slice\n ```\n\n #### Constraints:\n\n - `index_vector_size == shape(indices)[-1] <= rank(data)`\n - `rank(result) == q + r - 1 - shape(indices)[-1]`\n - `shape(result) == concat(shape(indices)[0:-1], shape(data)[-index_vector_size:])`\n - `element_type(result) == element_type(data)`\n\n #### Example:\n\n\n ```mlir\n %0 = tensorrt.gather_nd data(%arg0) indices(%arg1)\n : (tensor<1024x32x4xf32>, tensor<16x17x2xi32>) -> tensor<16x17x4xf32>\n ```", "operands": [ { "name": "data", "type": "TensorRT_Tensor" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32, I64]>" } ], "results": [ { "name": "result", "type": "TensorRT_Tensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `data` `(` $data `)` `indices` `(` $indices `)`\n `:` functional-type(operands, results)" }, { "name": "tensorrt.identity", "summary": "TensorRT identity (IIdentityLayer) operation", "description": "The `tensorrt.identity` operation performs a cast from the the input tensor\n type to the result tensor type, changing only the element type.\n\n This operation corresponds to the TensorRT 8.5 specification.\n\n Valid conversions are as follows:\n\n (f32 | f16 | bf16 | i32 | bool) -> (f32 | f16 | bf16 | i32 | bool)\n (f32 | f16) -> (uint8)\n (uint8) -> (f32 | f16)\n\n NOTE: When creating this operation, conversions `x -> uint8` and\n `uint8 -> x` are allowed even when `x` is not strictly limited to {f32, f16}.\n The `ApplyWorkaroundsPass` pass addresses these situations by inserting an\n additional `tensorrt.identity` operation for casting through `f32`. This\n ensures that the TensorRT graph doesn't break due to a single identity operation\n with strictly not supported `uint8` conversion.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[I1, UI8, TensorRT_I8, I32, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[I1, UI8, TensorRT_I8, I32, F16, BF16, F32]>" } ], "assemblyFormat": "attr-dict $input `:` type($input) `to` type($result)" }, { "name": "tensorrt.if", "summary": "TensorRT if (IIfConditionalLayer) operation", "description": "The `tensorrt.if` operation represents an \"if-then-else\" type control flow\n operation. The condition determines which of the \"true branch\" or \"false\n branch\" executes. Only one of the branches execute at runtime (i.e. the\n branches are not \"eagerly\" executed).\n\n The result types yielded from both branches must be equivalent and\n equal to the result type of the `tensorrt.if` operation.\n\n This operation obeys the following convention: if an operation is within the\n region, then it is lazily executed. By using any SSA value defined above,\n that SSA value becomes a \"conditional branch input\" in the\n [terminology of TensorRT API](https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#work-with-conditionals).\n\n In other words, unlike the TensorRT API, there is not a\n \"ConditionalInputLayer\" abstraction because this is captured implicitly through\n the nested structure of the IR. If the intent is to execute an operation\n \"eagerly\" regardless of the conditional value, then it should be\n moved out of the conditional body.\n\n #### Example\n\n ```mlir\n func.func @trt_if(%arg1: tensor<10xf32>, %arg2: tensor<10xf32>) -> tensor<10xf32> {\n %cond = arith.constant dense<1> : tensor\n %result = tensorrt.if (%cond: tensor) -> tensor<10xf32> {\n %add = tensorrt.element_wise (%arg1, %arg2 : tensor<10xf32>, tensor<10xf32>)\n -> tensor<10xf32>\n tensorrt.yield %arg1: tensor<10xf32>\n } else {\n %sub = tensorrt.element_wise (%arg1, %arg2 : tensor<10xf32>, tensor<10xf32>)\n -> tensor<10xf32>\n tensorrt.yield %arg1: tensor<10xf32>\n }\n return %result: tensor<10xf32>\n }\n ```", "operands": [ { "name": "condition", "type": "0DTensorOf<[I1]>" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "regions": [ { "name": "trueRegion", "type": "SizedRegion<1>" }, { "name": "falseRegion", "type": "AnyRegion" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` $condition `:` type($condition) `)` attr-dict `->` type($results)\n $trueRegion\n `else`\n $falseRegion" }, { "name": "tensorrt.linspace", "summary": "TensorRT linspace (a variant of FillLayer) operation", "description": "Generate an output tensor `result` using the \"linspace\" operation,\n described below.\n\n Let the output rank be `n` and let `s` be a tensor that is a\n slice of the result along dimension `i`. Then the contents of\n `s` are given by:\n\n - If `step` is a tensor:\n\n `s[coord...] = start + dot(step, [coord...])\n\n - If `step` is a static scalar:\n\n `s[j] = start + step * j`\n\n The inputs `start` and `step` must either both be given by\n tensor-typed SSA values or both be given by static attributes. One\n cannot be static and the other dynamic.\n\n The shape can either be static and given by the shape of the\n result type, or it can be given by the `shape` input. If the\n result has unknown dimensions, then the `shape` parameter\n must be present.", "operands": [ { "name": "shape", "type": "Optional<1DTensorOf<[ I32, I64 ]>>" }, { "name": "start", "type": "Optional<0DTensorOf<[ I32, I64, F32 ]>>" }, { "name": "step", "type": "Optional<1DTensorOf<[ I32, I64, F32 ]>>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[I32, I64, F32]>" } ], "attributes": [ { "name": "static_start", "type": "OptionalAttr" }, { "name": "static_step", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `[` ($start^ `:` type($start)) : ($static_start)? `]`\n `[` ($shape^ `:` type($shape)) : (`static`)? `]`\n `[` ($step^ `:` type($step)) : ($static_step)? `]`\n `:` type($result)" }, { "name": "tensorrt.matrix_multiply", "summary": "TensorRT IMatrixMultiplyLayer operation", "description": "The `tensorrt.matrix_multiply`layer represents a Matrix Multiplication C = A * B.\n\n When A and B are matrices or vectors, computes the inner product A * B:\n\n matrix * matrix -> matrix\n matrix * vector -> vector\n vector * matrix -> vector\n vector * vector -> scalar\n\n Matrix Operation (tensorrt::MatrixOperation) attribute defines the operations performed in a tensor before multiplication.\n - kNONE\n Treat x as a matrix if it has two dimensions, or as a collection of matrices if x has more than two dimensions,\n where the last two dimensions are the matrix dimensions. x must have at least two dimensions.\n - kTRANSPOSE\n Like kNONE, but transpose the matrix dimensions.\n - kVECTOR\n Treat x as a vector if it has one dimension, or as a collection of vectors if x has more than one dimension. x\n must have at least one dimension.\n The first input tensor with dimensions [M,K] used with MatrixOperation::kVECTOR is equivalent to a tensor\n with dimensions [M, 1, K] with MatrixOperation::kNONE.\n The second input tensor with dimensions [M,K] used with MatrixOperation::kVECTOR is equivalent to a tensor\n with dimensions [M, K, 1] with MatrixOperation::kNONE.\n\n Matrix/Vector dimensions can be thought as combination of collection dimensions and inner product dimensions.\n - For Matrices, all but the last two dimensions are collection dimensions.\n - For Vectors, all but the last dimension are collection dimensions.\n - The number of collection dimensions MUST be equal.\n - Broadcast rules* apply to the collection dimensions.\n\n * For each collection dimension, the lengths must match, or one of them must be equal to 1. In the latter case, the tensor\n is broadcast along that axis.\n\n The output rank is the number of collection dimensions plus 0..2 dimensions for the inner products. 0 for vector*vector,\n 1 for vector*matrix or converse and 2 for matrix*matrix.\n\n Inputs MUST have same datatype but can have unequal rank if one of them is kVECTOR.\n\n Example,\n ```mlir\n func.func @trt_matrix_vector(%arg0: tensor<1x64xf32>, %arg1: tensor<10x64x128xf32>)\n -> tensor<10x128xf32> {\n %0 = tensorrt.matrix_multiply {\n op0 = #tensorrt.matrix_operation,\n op1 = #tensorrt.matrix_operation\n } ins(%arg0, %arg1 : tensor<1x64xf32>, tensor<10x64x128xf32>) -> tensor<10x128xf32>\n return %0 : tensor<10x128xf32>\n }\n ```", "operands": [ { "name": "input0", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" }, { "name": "input1", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "op0", "type": "TensorRT_MatrixOperationAttr{kNONE|kTRANSPOSE|kVECTOR}" }, { "name": "op1", "type": "TensorRT_MatrixOperationAttr{kNONE|kTRANSPOSE|kVECTOR}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.module", "summary": "A top level container for functions describing TensorRT programs", "description": "A `tensorrt.module` is a container that encapsulates IR defining TensorRT\n programs. Each `func.func` in a TensorRT module should compile to a single\n TensorRT engine.\n\n The module has a symbol name so that operations outside the module\n can refer to the symbols names of nested functions.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$sym_name attr-dict-with-keyword $bodyRegion" }, { "name": "tensorrt.non_zero", "summary": "TensorRT NonZero (INonZeroLayer) operation", "description": "`tensorrt.non_zero` layer computes the indices of the input tensor where the value is non zero.\n The `result` has shape [input rank, #of non-zero elements] and contains indices of non-zero elements\n in row major order.\n\n This operation follows same semantics as that of `onnx.NonZero` and is similar to `tf.Where`.\n\n #### Examples:\n\n ```mlir\n %0 = tensorrt.non_zero %input : tensor<100x200xf32> -> tensor<2x?xi32>\n ```", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[I1, I8, I32, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[I32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input) `->` type($result)" }, { "name": "tensorrt.normalization", "summary": "TensorRT normalization (INormalizationLayer) operation", "description": "The `tensorrt.normalization` layer normalizes an input tensor using the\n following equation.\n ```\n result = ((input-E(input, a))/(sqrt(V(input, a))+eps)) * scale + bias\n ```\n where,\n - `input` = input tensor.\n - E(input, a) = mean of the input tensor along `a` axis.\n - sqrt = square root operation.\n - V(input, a) = variance of the input tensor along `a` axis.\n - `eps` = a small value added to the denominator for numerical stability.\n Default is `1e-5`.\n - `scale` = scale tensor.\n - `bias` = bias tensor.\n - `axis` (a) = axis to perform normalization on.\n\n Value of the attribute `num_groups` (default is 1) decides the type of\n normalization. If `num_groups != 1`, the input channels will be split into\n `num_groups` before normalization is performed. The channel dimension is\n considered to be the second dimension.\n\n In general, the following holds true for different types of normalizations.\n 1. Batch Normalization\n - Input: [N, C, H, W, ..]\n - Axis: 0\n - Scale and Bias: [1, C, 1, 1, ..., 1]\n - Mean and standard-deviation are computed over the batch dimensions.\n 2. Group Normalization (num_groups = G)\n - Input: [N, C, H, W, ...]\n - Grouped Input: [N, G, C//G, H, W, ...]\n - Axis: [2, 3, 4, ....]\n - Scale and Bias: [1, G, 1, 1, ... , 1]\n - Input channels are split into `G` groups, each with `C/G` channels. Mean\n and standard-deviation are computed for each group separately.\n - If G=1, this is equivalent to the Layer Normalization.\n - If G=C, this is equivalent to the Instance Normalization.\n 3. Instance Normalization\n - Input: [N, C, H, W, ..]\n - Axis: [2, 3, 4, ....]\n - Scale and Bias: [1, C, 1, 1, ..., 1]\n - Mean and standard-deviation are computed per dimension for each object in\n a batch.\n 4. Layer Normalization\n - Input: [D0, D1, D2, D3 .... DN]\n - Axis: [2, 3, .. N]\n - Scale and Bias: [1, 1, D2, D3, D4 ... DN]\n - Mean and standard-deviation are computed over the last D dimensions.\n - In general, if axis selected forms `normalized` shape ([Di, Di+1, ...],\n starting at index `i`), scale and bias has [1, 1, .. 1i, normalized] shape.\n Scale/bias shape has dim 1 up-to `i`th dim from which normalization axis\n starts.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" }, { "name": "scale", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" }, { "name": "bias", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "attributes": [ { "name": "axis", "type": "ConfinedAttr, DenseArrayNonNegative]>" }, { "name": "eps", "type": "OptionalAttr" }, { "name": "num_groups", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `(`$input `:` type($input) `,` $scale `:` type($scale) `,` $bias `:` type($bias)`)` `->` type($result)" }, { "name": "tensorrt.one_hot", "summary": "TensorRT IOneHotLayer operation", "description": "The `tensorrt.one_hot` operation requires 'indices', 'values', 'depth', and 'axis' as as inputs.\n The locations represented by the index values in 'indices' will have 'on_value' in the output tensor and\n the other locations will have 'off_value'.\n Here, 'on_value' and 'off_value' are specified by 'values' of format ['off_value', 'on_value'].\n The rank of the output tensor will be one greater than the rank of the input tensor.\n The additional dimension in the output tensor is of size 'depth'.\n As mentioned before, only one of 'depth' elements in the dimension is 'on_value' and the others are 'off_value'.\n The additional dimension will be inserted at the position specified by 'axis'.\n\n Example 1:\n When indices = [0, 2, 4], values = [0, 1], depth = 5, and axis = -1 (the innermost dimension)\n the output is\n [[1 0 0 0 0]\n [0 0 1 0 0]\n [0 0 0 0 1]].\n\n Example 2:\n When indices = [[0, 1], [2, 3], [4, 1]], values = [0, 2], depth = 5, and axis = -1 (the innermost dimension)\n the output is\n [[[2 0 0 0 0], [0 2 0 0 0]],\n [[0 0 2 0 0], [0 0 0 2 0]],\n [[0 0 0 0 2], [0 2 0 0 0]]].\n\n Example 3:\n When indices = [0, 2, 4], values = [0, 2], depth = 5, and axis = 0\n the output is\n [[2 0 0]\n [0 0 0]\n [0 2 0]\n [0 0 0]\n [0 0 2]].", "operands": [ { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32]>" }, { "name": "values", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" }, { "name": "depth", "type": "TensorRT_RankedTensorOf<[I32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "attributes": [ { "name": "axis", "type": "SI64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.opaque_plugin", "summary": "a representation of an opaque external TensorRT plugin", "description": "The `tensorrt.opaque_plugin` operation represents an external TensorRT\n plugin that is provided as a dynamic shared object library (DSO).\n\n This operation supports the PluginV3/PluginCreatorV3One API introduced\n in TensorRT 10. Older TensorRT plugin APIs are not supported.\n\n The attributes of the plugin specify the path to the DSO as well as the\n information needed to construct a plugin instance using the plugin's\n PluginCreator implementation. The `creator_params` are serialized into\n a PluginFieldCollection in order to\n\n The steps for loading and creating the plugin are executed as follows.\n First, a reference to the PluginCreatorV3One for the TensorRT plugin\n must be acquired. There are three possible mechanisms for doing this:\n\n 1. If both the `dso_path` and the `creator_func` attributes are provided,\n then the DSO is loaded (e.g. on POSIX using `dlopen`) and the symbol name\n specified by the attribute `creator_func` is searched\n for in the loaded library. This must be a function that accepts no\n parameters and returns an `nvinfer1::IPluginCreatorV3One*`. In the\n event of an error in the function, it is allowed to return `nullptr`.\n The compiler takes ownership over the creator and caches it for all\n translations of this operation that have the same `plugin_name`, so\n the creator class should be stateless.\n\n 2. If the `dso_path` is specified, but no `creator_func` is provided,\n then the DSO is loaded and it is expected that loading the DSO\n triggers registration of the creator with TensorRT's global plugin creator\n registry. The plugin creator is then looked up in that registry.\n\n 3. Otherwise, if no `dso_path` is given, then it is expected that\n that the plugin creator is already registered in the glboal plugin\n registry, and we lookup the plugin by name/version/namespace in the\n global registry.\n\n After acquiring a reference to the creator, we create the plugin with\n the following steps:\n\n 1. The plugin creator is instantiated by calling the function with name\n specified by `creator_func` and is cache. Subsequent\n translations of an operation with the same `plugin_name` will not\n create a new PluginCreator.\n\n 2. The translator queries the instantiated PluginCreator for the relevant\n fields by calling the `PluginCreatorV3One::getFieldNames()` member\n function. The plugin must provide an implementation for `getFieldNames`.\n All attributes in `creator_params` are validated against the plugin\n specifications returned by `getFieldNames()`.\n\n 3. The `creator_params` are serialized into a `PluginFieldCollection`\n and passed to the creator's `getPlugin` call.\n\n\n #### Dynamic Shapes and Shape Calculation Region\n\n The plugin has a single region, `shapes_region`, which is allowed to be\n empty.\n\n When populated, the `shapes_region` should contain a single block of\n scalar arithmetic IR for calculating result shapes. The block arguments should\n contain one scalar argument for each input dimension for each tensor operand.\n The single block should be terminated by `tensorrt.yield` and yield a scalar\n for each dimension for each result tensor.\n\n The `shapes_region` is made optional even when the results have dynamic\n extents in order to enable lazy population of the content by directly\n querying the actual TensorRT plugin. The `tensorrt-infer-plugin-shapes`\n will load the plugin and use a simple mechanism to construct the right IR\n in the shapes region.\n\n #### TODO:\n\n The following items are currently unimplemnted:\n\n 1. Any sort of verification by loading the plugin before translation\n time.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "plugin_name", "type": "StrAttr" }, { "name": "plugin_version", "type": "StrAttr" }, { "name": "plugin_namespace", "type": "StrAttr" }, { "name": "dso_path", "type": "OptionalAttr" }, { "name": "creator_func", "type": "OptionalAttr" }, { "name": "creator_params", "type": "DictionaryAttr" } ], "regions": [ { "name": "shapes_region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict `(` ($inputs^)? `)` `:` functional-type($inputs, $results)\n ( $shapes_region^ )?" }, { "name": "tensorrt.padding", "summary": "TensorRT padding(IPaddingLayer) operation", "description": "The `tensorrt.padding` operation adds zero-padding at the start and end of\n the input tensor and store the result in an output tensor.\n\n When `prePadding` and `postPadding` are positive, the tensor is pad with\n zeros, otherwise it is trimmed. The amount of padding/trimming to use at\n the start and end of each dimension is defined by `prePadding` and\n `postPadding` respectively. It only supports padding/trimming along exactly\n two innermost dimensions.\n\n Each output dimension `O_{i}` is calculated based on input dimension `I_{i}`\n prePadding and postPadding as follows,\n n = rank(input)\n O_{i} = I_{i} for 0 <= i < (n - 2)\n O_{i} = I_{i} + prePadding[j] + postPadding[j] for (n - 2) <= i < n and j = i - ( n- 2)\n\n #### Examples:\n\n ```mlir\n\n %0 = tensorrt.padding {\n prePadding = array,\n postPadding = array\n } %input : tensor<1x1x10x10xf32> -> tensor<1x1x15x4xf32>\n\n ```\n\n #### Caveat\n Padding exactly two innermost dimensions is supported.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, F16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, F16, F32]>" } ], "attributes": [ { "name": "prePadding", "type": "DenseI64ArrayAttr" }, { "name": "postPadding", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.parametric_relu", "summary": "TensorRT ParametricReLU(IParametricReLULayer) operation", "description": "The `tensorrt.parametricrelu` applies the function `f` to each element `x` at indices`i=(i_0, ... i_n)` of the input tensor,\n where `f` is given as 'f(x) := x if x > 0, otherwise `slope[i_0,...,i_n]` * x`\n\n #### Example\n\n ```mlir\n\n %result = tensorrt.parametric_relu ins(%input, %slope : tensor<2x20xf32>, tensor<2x20xf32>)\n -> tensor<2x20xf32>\n\n ```", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, BF16, F32]>" }, { "name": "slope", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, BF16, F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.pooling", "summary": "TensorRT pooling (IPoolingLayer) operation", "description": "The `tensorrt.pooling` operation applies a windowed reduction over the\n input. By convention, the input tensor type's shape dimensions are\n assumed to be in the form `[batch_dim, channel_dim, spatial_dims...]`.\n\n The mathematical operation for the windowed reduction is given by the\n `poolingType` attribute. See the `PoolingType` enum definition for an\n enumeration of the various supported operations.\n\n The reduction window size is given by `windowSize` and should be of\n size 2 or size 3.\n\n TODO: Currently only explicit pre/post padding is supported, but the\n underlying TensorRT layer also supports automatic padding styles\n\n The `blendFactor` attribute is only relevant when `poolingType` is\n set to `kMAX_AVERAGE_BLEND`.\n\n The `averageCountExcludesPassing` is only relevant when `poolingType`\n is set to `kMAX_AVERAGE_BLEND` or `kAVERAGE`. When set, elements of\n the input that correspond to elements added during padding are not\n counted toward the total when performing an average calculation for\n a given window position.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32, BF16]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32, BF16]>" } ], "attributes": [ { "name": "windowSize", "type": "DenseI64ArrayAttr" }, { "name": "stride", "type": "DenseI64ArrayAttr" }, { "name": "prePadding", "type": "DenseI64ArrayAttr" }, { "name": "postPadding", "type": "DenseI64ArrayAttr" }, { "name": "poolingType", "type": "TensorRT_PoolingTypeAttr{kMAX|kAVERAGE|kMAX_AVERAGE_BLEND}" }, { "name": "blendFactor", "type": "OptionalAttr" }, { "name": "averageCountExcludesPadding", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict `ins` `(` $input `:` type($input) `)` `->` type($result)" }, { "name": "tensorrt.quantize", "summary": "TensorRT Quantize(IQuantizeLayer) operation", "description": "The `tensorrt.quantize` operation quantize a floating-point input tensor into\n an 8-bit signed integer output tensor using the `scale` input.\n\n NOTE: Although `zero_point` is an optional input for TensorRT Quantize(IQuantizeLayer)\n operation, it is removed here because it's just a placeholder which is not\n actually used and cannot be set to other values other than 0 in TensorRT.\n `zero_point` is omitted for the following decryption.\n\n Quantization can either be applied uniformly for the entire input (\"per-tensor\" manner)\n using a single scalar \"scale\" value, or it can be applied in a \"per-channel\" manner,\n meaning that different slices of the input tensor along a specified `axis` are\n quantized using different parameters in a 1D \"scale\" tensor, or it can be applied\n in a \"2D block\" manner using a 2D \"scale\" tensor (supports only `INT4` 2D weight inputs).\n\n #### Caveats\n\n - `scale` must be compile time constants (after constant folding by either\n MLIR-TRT or TRT itself).\n\n #### Argument Constraints\n\n If `axis` is not given:\n\n - `scale` must be 2D for INT4 block quantization. Block quantization always happens\n along `axis` 0.\n - `scale` must be a scalar (0D tensor i.e. `tensor<[element type]>`) for per-tensor\n quantization.\n\n If `axis` is given:\n\n - `scale` must be 1D tensors with `input.shape[axis]`\n number of elements, for per-channel quantization.\n - Similarly, the size of input dimension `input.shape[axis]` must be\n a compile time constant (i.e. it cannot be `?`).\n - `axis` must be in the range of `[0, R)`.\n\n #### Quantization Computation\n\n Let `(i_0, ..., i_{R-1})` represent indices in the index space of the\n `input` tensor, which is of rank `R`.\n\n In the below, the `round` function rounds f32 values to i8 values with the\n semantic of\n [\"round-to-nearest-with-ties-to-even\"](https://en.wikipedia.org/wiki/Rounding#Round_half_to_even).\n\n Per-tensor quantization transforms the input\n uniformly as follows:\n\n ```\n output[ i_0, ..., i_{R-1} ] :=\n clamp(\n round(\n input[ i_0, ..., i_{R-1} ] / (f32)scale\n ),\n min = (i8) -128,\n max = (i8) 127\n )\n ```\n\n Per-channel quantization is supported only for weight inputs. Activations\n can't be quantized per-channel. Given a 1D tensor of `scale` values and\n `axis`, the input is transformed as follows:\n\n ```\n output[i_0, ..., i_{axis}, ..., i_{R-1} ] :=\n clamp(\n round(\n input[ i_0, ..., i_{axis}, ..., i_{R-1} ] /\n scale[ i_{axis} ]\n ),\n min = (i8) -128,\n max = (i8) 127\n )\n ```\n\n Block quantization is supported only for 2-D weight inputs of type\n `INT4`. Axis for block quantization is always 0. Let `B` be the block size.\n Block quantization transforms the input as follows:\n\n ```\n output[i_0, i_1] :=\n clamp(\n round(\n input[ i_0, i_1 ] / scale[ i_0 // B, i_1 ]\n ),\n min = (i4) -8,\n max = (i4) 7\n )\n ```\n\n The output shape is the same as the input shape. The quantization axis is\n in reference to the input tensor's dimensions.\n\n Valid conversions are as follows:\n\n ```\n (f32 | f16 | bf16) -> (int8 | f8E4M3FN | int4)\n ```\n\n #### Examples\n\n ```mlir\n %1 = tensorrt.quantize in(%arg0 : tensor<10x10xf32>)\n scale(%arg1 : tensor<1xf32>) -> tensor<10x10xi8>\n %2 = tensorrt.quantize { axis = 1 : i32 } in(%arg0 : tensor<10x10xf32>)\n scale(%arg1 : tensor<10xf32>) -> tensor<10x10xi8>\n ```", "operands": [ { "name": "input", "type": "TensorRT_Non0RankedTensorOf<[F32, F16, BF16]>" }, { "name": "scale", "type": "TensorRT_RankedTensorOf<[F32, F16, BF16]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, TensorRT_F8, TensorRT_I4]>" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict `in` `(` $input `:` type($input) `)`\n `scale` `(` $scale `:` type($scale) `)`\n `->` type($result)" }, { "name": "tensorrt.ragged_softmax", "summary": "TensorRT IRaggedSoftMaxLayer operation", "description": "The `tensorrt.ragged_softmax` operation requires `input` and `bounds` as input tensors\n and produces `output` as the output tensor. The `input` is of ZxS and\n the `bounds` is Zx1, which specifies the length of each of the Z sequences.\n The shape of `output` is the same as `input`.\n This layer computes a softmax across each of the Z sequences for the specified length.\n Values outside of the specified lengths are set to zero.\n\n As of TRT 8.6.10.0, `input` and `bounds` must be a 3D tensor in the explicit batch mode,\n or a 2D tensor in the implicit batch mode, which is deprecated but exists for backward compatibility.\n\n Example:\n When `input` is of 1x3x5\n [[[1.0, 1.0, 1.0, 1.0, 1.0],\n [1.0, 1.0, 1.0, 1.0, 0.5],\n [3.0, 4.0, -2.0, 10.0, 5.0]]]\n and `bounds` is of 1x3x1\n [[[5], [4], [3]]],\n\n the `output` is of 1x3x5\n [[[0.2000, 0.2000, 0.2000, 0.2000, 0.2000],\n [0.2500, 0.2500, 0.2500, 0.2500, 0.0000],\n [0.2685, 0.7297, 0.0018, 0.0000, 0.0000]]]", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" }, { "name": "bounds", "type": "TensorRT_RankedTensorOf<[I32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.random_normal", "summary": "TensorRT random normal (a variant of FillLayer) operation", "description": "Generates an output tensor with samples drawn from a normal (Gaussian)\n distribution. The mean of the normal distribution is give by `mean`\n and the standard deviation is given by `std` inputs.\n\n Both of these inputs are either tensor-typed SSA values or static\n attributes.If nothing is provided, default value of `mean` is 0 and\n `std` is 1 i.e. samples are drawn from the standard normal distribution,\n by default.\n\n The shape can either be static and given by the shape of the\n result type, or it can be given by the `shape` input. If the\n result has unknown dimensions, then the `shape` parameter\n must be present.", "operands": [ { "name": "shape", "type": "Optional<1DTensorOf<[ I32 ]>>" }, { "name": "mean", "type": "Optional<0DTensorOf<[ F32, F16 ]>>" }, { "name": "std", "type": "Optional<0DTensorOf<[ F32, F16 ]>>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F32, F16]>" } ], "attributes": [ { "name": "static_mean", "type": "OptionalAttr" }, { "name": "static_std", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n (`mean` `(` $mean^ `:` type($mean) `)` )?\n (`std` `(` $std^ `:` type($std) `)` )?\n (`shape` `(` $shape^ `:` type($shape) `)` )?\n `->` type($result)" }, { "name": "tensorrt.random_uniform", "summary": "TensorRT random uniform (a variant of FillLayer) operation", "description": "Generates an output tensor with samples drawn from a uniform distribution.\n Range ([low, high)) of the distribution is give by `low` and `high` inputs.\n Both of these inputs are either tensor-typed SSA values or static attributes.\n If nothing is provided, default value of `low` is 0 and `high` is 1.\n\n The shape can either be static and given by the shape of the\n result type, or it can be given by the `shape` input. If the\n result has unknown dimensions, then the `shape` parameter\n must be present.", "operands": [ { "name": "shape", "type": "Optional<1DTensorOf<[ I32 ]>>" }, { "name": "low", "type": "Optional<0DTensorOf<[ F32, F16 ]>>" }, { "name": "high", "type": "Optional<0DTensorOf<[ F32, F16 ]>>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F32, F16]>" } ], "attributes": [ { "name": "static_low", "type": "OptionalAttr" }, { "name": "static_high", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n (`low` `(` $low^ `:` type($low) `)` )?\n (`high` `(` $high^ `:` type($high) `)` )?\n (`shape` `(` $shape^ `:` type($shape) `)` )?\n `->` type($result)" }, { "name": "tensorrt.reduce", "summary": "TensorRT reduction operation", "description": "The `tensorrt.reduce` operation models the TensorRT IReduceLayer semantics.\n\n The operation reduces one or more axes of the `input` tensor as described\n by the attribute `reduceAxes`, which is an array of dimension indices.\n NOTE: This differs from the underlying TensorRT API, which requires the\n reduction axes to be specified as a bitmask. The conversion to a bitmask\n occurs automatically during translation to the C++ or TensorRT target.\n\n The `keepDimensions` attribute specifies whether the result should be\n rank-reduced (`keepDimensions = false`) or the same rank as the input\n (`keepDimensions = true`). When not rank-reduced, the result shape\n dimensions that were reduced by the operation are equal to `1`.\n\n The `reduceOperation` attribute specifies what reduction operation is\n performed (see the `ReduceOperation` enum definition).", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "attributes": [ { "name": "reduceAxes", "type": "ConfinedAttr, DenseArrayNonNegative]>" }, { "name": "keepDimensions", "type": "DefaultValuedAttr" }, { "name": "reduceOperation", "type": "TensorRT_ReduceOperationAttr{kSUM|kPROD|kMAX|kMIN|kAVG}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$reduceOperation $input attr-dict `:` type($input) `->` type($result)" }, { "name": "tensorrt.reshape", "summary": "A reshape operation", "description": "The `tensorrt.reshape` operation performs a reshape operation. The reshape\n can be dynamic in the sense that the sizes of the dimensions are unknown,\n but all ranks must be known. Reshapes that only add/remove unit dimensions\n will be canonicalized to `tensorrt.expand_rank` and `tensorrt.collapse_rank`\n respectively.\n\n If the dynamic `shape` operand is not provided, then the result type is\n allowed to have at most one dynamic dimensin. Otherwise, the `shape`\n operand must be provided.\n\n #### Examples\n\n A static reshape:\n\n ```\n %reshaped = tensorrt.reshape %input : tensor<10xf32> to tensor<2x5xf32>\n ```\n\n A dynamic reshape:\n\n ```\n %reshaped = tensorrt.reshape %input shape(%shape: tensor<2xi32>)\n : tensor to tensor\n ```\n\n A dynamic reshape with only one unknown dimension:\n\n ```\n %reshaped = tensorrt.reshape %input\n : tensor to tensor<2x?xf32>\n ```", "operands": [ { "name": "input", "type": "TensorRT_AllTypesTensor" }, { "name": "shape", "type": "Optional<1DTensorOf<[ I32 ]>>" } ], "results": [ { "name": "result", "type": "TensorRT_AllTypesTensor" } ], "assemblyFormat": "$input (`shape` `(` $shape^ `` `:` type($shape) `)`)? attr-dict\n `:` type($input) `to` type($result)" }, { "name": "tensorrt.resize_cubic", "summary": "TensorRT Resize(IResizeLayer with CUBIC mode) operation", "description": "The `tensorrt.resize_cubic` operation resize an input tensor into an output\n tensor with the LINEAR mode. The operation resizes innermost `m` dimensions\n of an input tensor of rank N, when 0 <= m <= min(3, N).\n\n For IResizeLayer there are 2 parameters `shape` and `scales` which are used to\n determine output shape. If the input has static input/output shapes, then these\n 2 parameters don't need to be kept as attributes since `tensorrt.resize_cubic`\n can directly retrieve the output shape from its output type information to\n initialize `shape` parameter. If the input has dynamic shapes, then `scales`\n parameter is used as an attribute to determine the output shapes.\n\n `tensorrt.resize_cubic` uses `coordinate_transformation` to control how the\n coordinates in the output tensor are mapped to coordinates in the input tensor.\n Specifically, for each spatial dimension i, input[..., f(y_i), ...] = result[..., y_i, ...]\n where f is given by one of the following equations, depending on the value of\n the `coordinate_transformation` attribute:\n\n - ResizeCoordinateTransformation::kALIGN_CORNERS, in this mode:\n f(y_i) = y_i * (shape(input)[i] - 1) / (shape(result)[i] - 1)\n - ResizeCoordinateTransformation::kASYMMETRIC, in this mode:\n f(y_i) = y_i * shape(input)[i] / shape(result)[i]\n - ResizeCoordinateTransformation::kHALF_PIXEL, in this mode:\n f(y_i) = (y_i + 0.5) * shape(input)[i] / shape(result)[i] - 0.5\n\n There is another parameter `selector_for_single_pixel` for IResizeLayer which\n controls selector when resize to single pixel output, it supports 2 modes:\n\n - FORMULA, use formula to map the original index\n - UPPER, use the upper left pixel\n\n `tensorrt.resize_cubic` uses `cubic_coeff` as coefficient in cubic interpolation.\n Two common choice are -0.5 (in some cases of TensorFlow) and -0.75 (in PyTorch).", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" }, { "name": "output_shape", "type": "Optional" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" } ], "attributes": [ { "name": "scales", "type": "OptionalAttr" }, { "name": "coordinateTransformation", "type": "TensorRT_ResizeCoordinateTransformationAttr{kALIGN_CORNERS|kASYMMETRIC|kHALF_PIXEL}" }, { "name": "selectorForSinglePixel", "type": "TensorRT_ResizeSelectorAttr{kFORMULA|kUPPER}" }, { "name": "cubicCoeff", "type": "F32Attr" } ], "assemblyFormat": "attr-dict $input ( `,` $output_shape^ )? `:` functional-type(operands,results)" }, { "name": "tensorrt.resize_linear", "summary": "TensorRT Resize(IResizeLayer with LINEAR mode) operation", "description": "The `tensorrt.resize_linear` operation resize an input tensor into an output\n tensor with the LINEAR mode. The operation resizes innermost `m` dimensions\n of an input tensor of rank N, when 0 <= m <= min(3, N).\n\n For IResizeLayer there are 2 parameters `shape` and `scales` which are used to\n determine output shape. If the input has static input/output shapes, then these\n 2 parameters don't need to be kept as attributes since `tensorrt.resize_linear`\n can directly retrieve the output shape from its output type information to\n initialize `shape` parameter. If the input has dynamic shapes, then `scales`\n parameter is used as an attribute to determine the output shapes.\n\n `tensorrt.resize_linear` uses `coordinate_transformation` to control how the\n coordinates in the output tensor are mapped to coordinates in the input tensor.\n Specifically, for each spatial dimension i, input[..., f(y_i), ...] = result[..., y_i, ...]\n where f is given by one of the following equations, depending on the value of\n the `coordinate_transformation` attribute:\n\n - ResizeCoordinateTransformation::kALIGN_CORNERS, in this mode:\n f(y_i) = y_i * (shape(input)[i] - 1) / (shape(result)[i] - 1)\n - ResizeCoordinateTransformation::kASYMMETRIC, in this mode:\n f(y_i) = y_i * shape(input)[i] / shape(result)[i]\n - ResizeCoordinateTransformation::kHALF_PIXEL, in this mode:\n f(y_i) = (y_i + 0.5) * shape(input)[i] / shape(result)[i] - 0.5\n\n There is another parameter `selector_for_single_pixel` for IResizeLayer which\n controls selector when resize to single pixel output, it supports 2 modes:\n\n - FORMULA, use formula to map the original index\n - UPPER, use the upper left pixel", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" }, { "name": "output_shape", "type": "Optional" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" } ], "attributes": [ { "name": "scales", "type": "OptionalAttr" }, { "name": "coordinateTransformation", "type": "TensorRT_ResizeCoordinateTransformationAttr{kALIGN_CORNERS|kASYMMETRIC|kHALF_PIXEL}" }, { "name": "selectorForSinglePixel", "type": "TensorRT_ResizeSelectorAttr{kFORMULA|kUPPER}" } ], "assemblyFormat": "attr-dict $input ( `,` $output_shape^ )? `:` functional-type(operands,results)" }, { "name": "tensorrt.resize_nearest", "summary": "TensorRT Resize(IResizeLayer with NEAREST mode) operation", "description": "The `tensorrt.resize_nearest` operation resize an input tensor into an output\n tensor with the NEAREST mode. The operation resizes innermost `m` dimensions\n of an input tensor of rank N, when 0 <= m <= min(3, N).\n\n For IResizeLayer there are 2 parameters `shape` and `scales` which are used to\n determine output shape. If the input has static input/output shapes, then these\n 2 parameters don't need to be kept as attributes since `tensorrt.resize_nearest`\n can directly retrieve the output shape from its output type information to\n initialize `shape` parameter. If the input has dynamic shapes, then `scales`\n parameter is used as an attribute to determine the output shapes.\n\n `tensorrt.resize_nearest` uses `coordinate_transformation` to control how the\n coordinates in the output tensor are mapped to coordinates in the input tensor.\n Specifically, for each spatial dimension i, input[..., f(y_i), ...] = result[..., y_i, ...]\n where f is given by one of the following equations, depending on the value of\n the `coordinate_transformation` attribute:\n\n - ResizeCoordinateTransformation::kALIGN_CORNERS, in this mode:\n f(y_i) = y_i * (shape(input)[i] - 1) / (shape(result)[i] - 1)\n - ResizeCoordinateTransformation::kASYMMETRIC, in this mode:\n f(y_i) = y_i * shape(input)[i] / shape(result)[i]\n - ResizeCoordinateTransformation::kHALF_PIXEL, in this mode:\n f(y_i) = (y_i + 0.5) * shape(input)[i] / shape(result)[i] - 0.5\n\n `tensorrt.resize_nearest` uses `nearest_rounding` to control the rounding mode for\n nearest neighbor resize, it indicates how to get \"nearest\" pixel from the calculated\n input coordinate f(y_i) above, it supports following modes:\n\n - ResizeRoundMode::kHALF_UP, round half up\n - ResizeRoundMode::kHALF_DOWN, round half down\n - ResizeRoundMode::kFLOOR, round to floor\n - ResizeRoundMode::kCEIL, round to ceil\n\n There is another parameter `selector_for_single_pixel` for IResizeLayer which\n controls selector when resize to single pixel output, it supports 2 modes:\n\n - FORMULA, use formula to map the original index, f(y_i) above\n - UPPER, use the upper left pixel", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" }, { "name": "output_shape", "type": "Optional" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>" } ], "attributes": [ { "name": "scales", "type": "OptionalAttr" }, { "name": "coordinateTransformation", "type": "TensorRT_ResizeCoordinateTransformationAttr{kALIGN_CORNERS|kASYMMETRIC|kHALF_PIXEL}" }, { "name": "nearestRounding", "type": "TensorRT_ResizeRoundModeAttr{kHALF_UP|kHALF_DOWN|kFLOOR|kCEIL}" }, { "name": "selectorForSinglePixel", "type": "TensorRT_ResizeSelectorAttr{kFORMULA|kUPPER}" } ], "assemblyFormat": "attr-dict $input ( `,` $output_shape^ )? `:` functional-type(operands,results)" }, { "name": "tensorrt.scatter_elements", "summary": "TensorRT scatter (IScatterLayer with kELEMENT mode) operation", "description": "The `tensorrt.scatter_elements` operation creates an output tensor by\n copying values from an input tensor `data` and then updating values at\n indices given by the `indices` tensor with values from the `updates` tensor.\n Its output shape is the same as the shape of `data`.\n\n This operation takes three inputs:\n\n - A `data` tensor of rank r >= 1, that stores the values to be duplicated in\n the output. - An `indices` tensor of the same rank as `data` that determines\n which locations in the output to write new data to. The indices are\n interpreted as a tensor of rank 1 of indexing tuples. - An `updates` tensor\n of the same rank as `data`, that provides the data to write to output, at\n the index specified by the corresponding location in the `indices` tensor. -\n An optional `axis` attribute that identifies an axis of `data` along which\n to scatter on. By default, this is the outermost axis, which is 0.\n\n This operation produces one output: - An `output` tensor of the same\n dimensions as `data` that stores the resulting values of the transformation.\n\n This op follows the semantics of\n [tf.scatter_nd](https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_add)\n and\n [onnx.ScatterElements](https://github.com/onnx/onnx/blob/main/docs/Operators.md#ScatterND)\n and\n [torch.index_select](https://pytorch.org/docs/stable/generated/torch.scatter.html)\n\n #### Output Computation:\n\n For each entry in `updates`, the target index in `data` is obtained by\n combining the corresponding entry in `indices` with the index of the entry\n itself: the index-value for dimension = axis is obtained from the value of\n the corresponding entry in `indices` and the index-value for dimension !=\n axis is obtained from the index of the entry itself.\n\n For each element X of indices:\n Let J denote a sequence for the subscripts of X\n Let K = sequence J with element[axis] replaced by X\n Then,\n output[K] = updates[J]\n\n For example, if indices has dimensions [N,C,H,W] and axis is 2, then the\n updates happen as:\n\n for n in [0, N)\n for c in [0, C)\n for h in [0, H)\n for w in [0, W)\n output[n,c,indices[n,c,h,w],w] = updates[n,c,h,w]\n\n\n #### Caveats\n\n Writes to the same output element cause undefined behavior.", "operands": [ { "name": "data", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32, I64]>" }, { "name": "updates", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_Tensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict\n `data` `(` $data `:` type($data) `)`\n `indices` `(` $indices `:` type($indices) `)`\n `updates` `(` $updates `:` type($updates) `)`" }, { "name": "tensorrt.scatter_nd", "summary": "TensorRT scatter (IScatterLayer with kND mode) operation", "description": "The `tensorrt.scatter_nd` operation creates an output tensor by copying values\n from an input tensor `data` and then updating values by the given `indices`\n and `updates` tensors.\n\n This operation takes three inputs:\n\n - A `data` tensor of rank r >= 1, that stores the values to be duplicated in\n the output.\n - An `indices` tensor of rank q >= 1 that determines which locations in the\n output to write new data to. The indices are interpreted as a tensor of\n rank q-1 of indexing tuples.\n - An `updates` tensor of rank s, that provides the data to write to output,\n at the index specified by the corresponding location in the `indices`\n tensor. For this operation, rank s = (q - 1) + (r - indices.shape[-1]).\n\n This operation produces one output:\n - An `output` tensor of the same dimensions as data that stores the\n resulting values of the transformation.\n\n The output of the operation is obtained by updating the data tensor's value\n to values specified by updates at specific index positions specified by\n indices. Its shape is the same as the shape of data.\n\n The types of data, update, and output shall be the same.\n\n This op follows the semantics of\n [tf.scatter_nd](https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_add)\n and\n [onnx.ScatterND](https://github.com/onnx/onnx/blob/main/docs/Operators.md#ScatterND)\n and\n [torch.index_select](https://pytorch.org/docs/stable/generated/torch.scatter.html)\n\n #### Output Computation:\n\n Assuming that data dims are {d_0,...,d_{r-1}} and indices dims are\n {i_0,...,i_{q-1}}, define k = indices.shape[q-1], the updates dims must be\n {i_0,...,i_{q-2},d_k,...,d_{r-1}}.\n\n The updating can be computed by:\n foreach slice in indices[i_0,...i_{q-2} ]\n output[indices[slice]] = updates[slice]\n\n #### Caveats\n Writes to the same output element cause undefined behavior.", "operands": [ { "name": "data", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32, I64]>" }, { "name": "updates", "type": "TensorRT_RankedTensorOf<[TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_Tensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict\n `data` `(` $data `:` type($data) `)`\n `indices` `(` $indices `:` type($indices) `)`\n `updates` `(` $updates `:` type($updates) `)`" }, { "name": "tensorrt.select", "summary": "TensorRT ISelectLayer operation", "description": "The `tensorrt.select` operation accepts a boolean\n tensor and produces an output that is elementwise equal to\n `thenInput` where `condition` is true and otherwise equal to\n `elseInput`.\n\n The input shapes may be broadcasted according to TensorRT's\n broadcasting semantics. The element types of `thenInput` and\n `elseInput` must be equal and also equal to the element type of\n the result.", "operands": [ { "name": "condition", "type": "TensorRT_RankedTensorOf<[I1]>" }, { "name": "thenInput", "type": "TensorRT_RankedTensorOf<[I1, TensorRT_I8, I32, I64, F16, BF16, F32]>" }, { "name": "elseInput", "type": "TensorRT_RankedTensorOf<[I1, TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[I1, TensorRT_I8, I32, I64, F16, BF16, F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type($result)" }, { "name": "tensorrt.shape", "summary": "TensorRT shape operation", "description": "The `tensorrt.shape` operation returns the shape of a given `input` tensor\n as a `i32` tensor.\n\n The `result` tensor is a rank-1 i32 tensor. The shape of the result tensor\n is `tensor<[inputRank]xi32>`. Note that for scalar tensors (e.g. of type\n `tensor`), the result type is `tensor<0xi32>`.\n\n #### Example\n\n ```mlir\n\n %1 = tensorrt.shape %arg0 : tensor<10x?x?xf32> -> tensor<3xi32>\n %2 = tensorrt.shape %arg1 : tensor -> tensor<0xi32>\n\n ```", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[I1, TensorRT_I4, TensorRT_I8, I32, I64, TensorRT_F8, F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "1DTensorOf<[I32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input) `->` type($result)" }, { "name": "tensorrt.shuffle", "summary": "TensorRT IShuffleLayer operation", "description": "The `tensorrt.shuffle` layer applies the following operations in sequence:\n\n 1. Transpose the input (`first_transpose`)\n 2. Reshape the result of (1) - the specified shape may be either\n static (`reshape`) or dynamic (`dynamic_reshape`).\n 3. Transpose the result of (2).\n\n This operation tries to follow exactly the semantics of the underlying\n TensorRT \"IShuffleLayer\" operation. When applying a pure reshape or\n transpose, it is recommended to use one of the extension operations\n \"tensorrt.reshape\" or \"tensorrt.transpose\".\n\n #### Caveats\n\n #### Scalar reshapes\n\n It is legal to shape to a scalar (e.g. `tensor<1xf32>` to `tensor`)\n and vice-versa.\n\n #### `-1` in the Reshape Specification\n\n The value `-1` in the reshape specification infers that dimension\n by inspecting the source shape and the rest of the reshape dimensions.\n\n If 'zero_is_placeholder' is false, it is invalid for the specified shape\n to contain both a 0 and a -1, since the value of the dimension\n corresponding to -1 cannot be determined uniquely.\n\n #### \"Zero is Placeholder\" Mode\n\n **WARNING**: the \"zero is placeholder\" mode follows the underlying TRT\n mode, which can have surprising and unintuitive behavior. The intent\n of this mode historically was allow direct correspondence to frameworks\n that also has this mode, e.g. Cafe. Although it is not deprecated as of\n TRT 8.5, it is not recommended to use this mode unless absolutely necessary.\n\n When `zero_is_placeholder = true`, 0-values in the reshape specification\n are interpreted as being placeholders for input dimensions.\n\n In this mode, an inference procedure is followed to identify which input\n dimension corresponds to each \"0\". The procedure is described as follows:\n\n 1. Let `i` be the index of some \"0\" in the `reshape` array.\n 2. Let `f(i)` be the corresponding dimension in the source shape (the\n transposed input).\n 3. Let `f` be the identity: `f(i) = i`.\n\n Any case where this results in out-of-bounds access for **any zero**\n in the reshape specification is considered invalid.\n\n Any case where this results in a shape whose volume does not equal\n the volume of the source shape is considered invalid.\n\n To illustrate this point, consider the following examples, where\n \"I\" is the source shape, \"R\" is the reshape specification, and \"O\"\n is the shape after reshaping. When the result is invalid (and will\n result in verification failure)\n\n 1. I: [1, 2, 3, 4]\n R: [0, -1, 0]\n O: [1, 8, 3]\n\n 2. I: [1, 2, 3, 4]\n R: [1, 0, 0, 0]\n O: [1, 2, 3, 4]\n\n 3. I: [1, 2, 3, 4]\n R: [0, 2, 0, 0, 1]\n O: [1, 2, 3, 4, 1]\n\n 4. I: [1, 2, 3, 4]\n R: [0, 1, 0, 0]\n O: [1, 1, 3, 4] INVALID (VOLUME)\n\n 5. I: [30, 20, 10, 1]\n R: [600, 0, 0, 0, 0]\n O: [1, 2, 3, 4, _] INVALID (OOB)\n\n 6. I: [30, 20, 10, 1]\n R: [600, 0, 0]\n O: [600, 20, 10] INVALID (VOLUME)\n\n #### Examples:\n\n ```mlir\n func.func @trt_shuffle(%arg0: tensor<2x224x224x3xf32>) -> tensor<2x3x224x224xf32> {\n %0 = tensorrt.shuffle {\n first_transpose = array,\n reshape = array,\n second_transpose = array\n } ins(%arg0 : tensor<2x224x224x3xf32>) -> tensor<2x3x224x224xf32>\n return %0 : tensor<2x3x224x224xf32>\n }\n\n func.func @trt_shuffle_infer(%arg0: tensor<3x4x6xf32>) -> tensor<3x24xf32> {\n %0 = tensorrt.shuffle {\n first_transpose = array,\n reshape = array,\n second_transpose = array\n } ins(%arg0 : tensor<3x4x6xf32>) -> tensor<3x24xf32>\n return %0 : tensor<3x24xf32>\n }\n\n func.func @trt_shuffle_reshape_copy(%arg0: tensor<1x10x20x40xf32>) -> tensor<1x10x800xf32> {\n %0 = tensorrt.shuffle {\n first_transpose = array,\n reshape = array,\n second_transpose = array\n } ins(%arg0 : tensor<1x10x20x40xf32>) -> tensor<1x10x800xf32>\n return %0 : tensor<1x10x800xf32>\n }\n ```", "operands": [ { "name": "input", "type": "TensorRT_AllTypesTensor" }, { "name": "dynamic_reshape", "type": "Optional<1DTensorOf<[ I32 ]>>" } ], "results": [ { "name": "result", "type": "TensorRT_AllTypesTensor" } ], "attributes": [ { "name": "first_transpose", "type": "DenseI64ArrayAttr" }, { "name": "reshape", "type": "OptionalAttr" }, { "name": "second_transpose", "type": "DenseI64ArrayAttr" }, { "name": "zero_is_placeholder", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict `ins` `(` operands `:` type(operands) `)` `->` type(results)" }, { "name": "tensorrt.slice", "summary": "TensorRT slice (ISliceLayer) operation", "description": "The `tensorrt.slice` operation slices an input tensor based on\n offset, size, and stride values.\n\n The offset, size, and stride values can be either a static list of\n i32 values, or each of them can come from a rank-1 i32 tensor-typed\n SSA value.\n\n The slice layer selects for each dimension a start location from\n within the input tensor specified by `start`/`static_start`, and\n copies elements to the output tensor using the specified `stride`/\n `static_stride` across the input tensor.\n\n The `mode` attribute specifies how the slice behaves at out-of-bounds\n (OOB) access. When `mode` is kCLAMP or kREFLECT, for each input\n dimension, if its size is 0 then the corresponding output\n dimension must be 0 too.", "operands": [ { "name": "input", "type": "TensorRT_Tensor" }, { "name": "fill", "type": "Optional" }, { "name": "start", "type": "Optional" }, { "name": "size", "type": "Optional" }, { "name": "stride", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_start", "type": "OptionalAttr" }, { "name": "static_size", "type": "OptionalAttr" }, { "name": "static_stride", "type": "OptionalAttr" }, { "name": "mode", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$input\n `[` ( $start^ `` `:` type($start) ) : ( `` custom($static_start) ) ? `]` ``\n `[` ( $size^ `` `:` type($size) ) : ( `` custom($static_size) ) ? `]` ``\n `[` ( $stride^ `` `:` type($stride) ) : ( `` custom($static_stride) ) ? `]`\n ( `fill` `(` $fill^ `:` type($fill) `)` )?\n attr-dict `:` type($input) `to` type($result)" }, { "name": "tensorrt.softmax", "summary": "TensorRT softmax (ISoftMaxLayer) operation", "description": "The `tensorrt.softmax` operation applies the \"softmax\" to the\n `axis` dimension of the input tensor. The shape of the result tensor is\n equal to the shape of the input tensor. The computation that yields the\n result tensor is described below.\n\n Let the input tensor be of type `tensor`.\n Let `x := input_{i_1, ..., i_axis, ..., i_n}` be a point in the input\n tensor. The point `y` in the result with the same coordinates is given by\n\n ```\n y = e^{x} \\ ( sum_{i_axis=0}^{d_axis - 1} input_{i_1, ..., i_axis, ..., i_n} )\n ```\n\n In other words, the result is the pointwise exponential of the input, normalized\n along the `axis` dimension.", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "results": [ { "name": "result", "type": "TensorRT_RankedTensorOf<[F16, BF16, F32]>" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input)" }, { "name": "tensorrt.top_k", "summary": "TensorRT top K (ITopKLayer) operation", "description": "The `tensorrt.top_k` operation finds the top K largest or smallest elements\n and their indices from each slice of the tensor along the `axis`\n dimension. The two results correspond to the values and indices,\n respectively.\n\n The `topkOperation` is either `kMAX` or `kMIN` and determines whether the\n K largest or K smallest values are returned.\n\n The result values and indices are sorted with respect to the values:\n\n `kMAX`: sorted from largest to smallest value\n `kMAX`: sorted from smallest to largest value\n\n The result of the operation are never rank-reduced, even if `K=1`.\n\n #### Examples:\n\n ```mlir\n\n %0 = tensorrt.top_k {\n topkOperation = #tensorrt.topKOperation,\n k = 1 : i64,\n axis = 2 : i64\n } %input : tensor<100x200xf32> -> (tensor<100x1xf32>, <100x1xi32>)\n\n ```", "operands": [ { "name": "input", "type": "TensorRT_RankedTensorOf<[I32, I64, F16, BF16, F32]>" } ], "results": [ { "name": "values", "type": "AnyRankedTensor" }, { "name": "indices", "type": "TensorRT_RankedTensorOf<[I32]>" } ], "attributes": [ { "name": "k", "type": "I64Attr" }, { "name": "axis", "type": "I64Attr" }, { "name": "topkOperation", "type": "TensorRT_TopKOperationAttr{kMAX|kMIN}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$topkOperation attr-dict $input `:` type($input) `->` type(results)" }, { "name": "tensorrt.transpose", "summary": "Permutes the dimensions of the input tensor", "description": "Permutes the dimensions of the `input` according to `permutation`.\n\n This operation is a TensorRT dialect extension operation and is lowered\n into a TensorRT shuffle operation.", "operands": [ { "name": "input", "type": "TensorRT_AllTypesTensor" } ], "results": [ { "name": "result", "type": "TensorRT_AllTypesTensor" } ], "attributes": [ { "name": "permutation", "type": "AffineMapAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input) `to` type($result)" }, { "name": "tensorrt.unary", "summary": "TensorRT unary (IUnaryLayer) operation", "description": "The `tensorrt.unary` operation consists of applying single\n operation given by `unaryOperation` to the `input` elementwise.\n The result type is identical to the input type.", "operands": [ { "name": "input", "type": "TensorRT_Tensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "unaryOperation", "type": "TensorRT_UnaryOperationAttr{kEXP|kLOG|kSQRT|kRECIP|kABS|kNEG|kSIN|kCOS|kTAN|kSINH|kCOSH|kASIN|kACOS|kATAN|kASINH|kACOSH|kATANH|kCEIL|kFLOOR|kERF|kNOT|kSIGN|kROUND}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "attr-dict $input `:` type($input)" }, { "name": "tensorrt.while", "summary": "TensorRT While Loop (ILoopLayer) operation", "description": "The `tensorrt.while` operation represents a while-style loop that executes its\n body while a condition is satisfied.\n\n The `tensorrt.while` operation consists of two regions: \"condition\" region and\n \"body\" region.\n\n #### Example\n\n The below example constructs a simple while loop that performs an operation while\n the given input condition is true and saves the result to an output tensor.\n Here, the input condition checks that iter variable is less than limit and\n when the condition is satisfied, the sum of iter and one tensors is executed.\n\n ```mlir\n func.func @trt_while_loop() -> (tensor) {\n %one = tensorrt.constant dense<1.0> : tensor\n %iter_init = tensorrt.constant dense<1.0> : tensor\n %limit = tensorrt.constant dense<10.0> : tensor\n %result0 = tensorrt.while {} (%iter_init : tensor) -> tensor\n {\n // condition\n ^bb0(%iter:tensor):\n %cond = tensorrt.element_wise (%iter, %limit : tensor, tensor)\n -> tensor\n tensorrt.condition(%cond : tensor) %iter : tensor\n } ,\n {\n // body\n ^bb1(%iter:tensor):\n %new_iter = tensorrt.element_wise (%one, %iter : tensor, tensor) -> tensor\n tensorrt.yield %new_iter: tensor\n }\n return %result0 : tensor\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "condRegion", "type": "SizedRegion<1>" }, { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict `(` $operands `:` type($operands) `)` `->` type($results)\n $condRegion `,`\n $bodyRegion" }, { "name": "tensorrt.yield", "summary": "Yields one or more SSA values from a tensorrt dialect region", "description": "The `tensorrt.yield` operation yields SSA values from tensorrt dialect op region\n and terminate the regions. The semantics of how the values are yielded is\n defined by the parent operation.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "test.addi", "operands": [ { "name": "op1", "type": "AnyTypeOf<[I32, TestI32]>" }, { "name": "op2", "type": "AnyTypeOf<[I32, TestI32]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, TestI32]>" } ] }, { "name": "test.affine_scope", "summary": "affine scope operation", "description": "Test op that defines a new affine scope.", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "test.all_attr_constraint_of1", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "test.all_attr_constraint_of2", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "test.alloc_with_multiple_results", "results": [ { "name": "index", "type": "Index" }, { "name": "memref", "type": "AnyMemRef" } ], "assemblyFormat": "attr-dict `:` type($index) `,` type($memref)" }, { "name": "test.alloca_scope_region", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "test.always_speculatable_op", "description": "Op used to test conditional speculation. This op can always be\n speculatively executed.", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.another_three_result", "results": [ { "name": "result1", "type": "I32" }, { "name": "result2", "type": "F32" }, { "name": "result3", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "test.another_two_result", "results": [ { "name": "result1", "type": "F32" }, { "name": "result2", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "test.another_type_producer", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.any_attr_of_i32_str", "attributes": [ { "name": "attr", "type": "AnyAttrOf<[I32Attr, StrAttr]>" } ] }, { "name": "test.any_cond", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ] }, { "name": "test.arg_and_res_have_fixed_element_types", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "test.array_of_attr_op", "attributes": [ { "name": "a", "type": "TestArrayOfUglyAttrs" }, { "name": "b", "type": "TestArrayOfInts" }, { "name": "c", "type": "TestArrayOfEnums" } ], "assemblyFormat": "`a` `=` $a `,` `b` `=` $b `,` `c` `=` $c attr-dict" }, { "name": "test.asm_dialect_interface_op", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.asm_interface_op", "results": [ { "name": "first", "type": "AnyType" }, { "name": "middle_results", "type": "Variadic" }, { "name": "result2", "type": "AnyType" } ] }, { "name": "test.attr_sized_operands", "operands": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" }, { "name": "c", "type": "I32" }, { "name": "d", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.attr_sized_results", "results": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" }, { "name": "c", "type": "I32" }, { "name": "d", "type": "Variadic" } ] }, { "name": "test.attr_sized_results_compile_test", "results": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "I32" }, { "name": "c", "type": "Optional" } ] }, { "name": "test.attr_with_loc", "summary": "op's attribute has a location", "attributes": [ { "name": "loc", "type": "AnyAttr" }, { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "`(` $value `` custom($loc) `)` attr-dict" }, { "name": "test.attr_with_trait", "attributes": [ { "name": "attr", "type": "AnyAttr" } ] }, { "name": "test.benchmark", "summary": "benchmark operation", "description": "The \"tfrt_test.benchmark\" operation benchmarks the performance of an MLIR\n region by executing the given MLIR region repeatedly up to the\n `duratino_secs` seconds or `max_count` times. `num_warmup_runs` specifies\n the number of warm up runs to run the given MLIR region before the\n benchmark starts.\n\n The target MLIR region can take an arbitrary number of arguments and\n should return exactly one value. The arguments for the MLIR region are\n provided as the operands of the tfrt_test.benchmark op.\n\n Example:\n tfrt_test.benchmark \"add.i32\"(%c : i32, %d : f32) max_count = 100, duration_secs = 1 {\n // code for benchmarking\n ...\n }\n\n tfrt_test.benchmark \"add.i32\"(%c : i32)\n duration_secs = 1,\n max_count = 100,\n num_warmup_runs = 10 {\n // The MLIR code to be benchmarked goes here.\n // The following code benchmarks the tfrt.add.i32 kernel.\n %x = tfrt.add.i32 %c, %c\n // The benchmarked function needs to return exactly one value.\n tfrt.return %x : i32\n }", "attributes": [ { "name": "duration_secs", "type": "I32Attr" }, { "name": "max_count", "type": "I32Attr" }, { "name": "name", "type": "StrAttr" }, { "name": "num_warmup_runs", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "test.block_argument_name_from_type", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "test.block_argument_name_from_type_interface", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "test.block_names", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "test.br", "operands": [ { "name": "targetOperands", "type": "Variadic" } ], "successors": [ { "name": "target", "type": "AnySuccessor" } ] }, { "name": "test.broadcastable", "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "test.buffer_based", "description": "A buffer based operation, that uses memRefs as input and output.", "operands": [ { "name": "input", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "output", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "`in` `(` $input`:` type($input) `)` `out` `(` $output`:` type($output) `)`\n attr-dict" }, { "name": "test.call", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "test.call_and_store", "operands": [ { "name": "address", "type": "AnyMemRef" }, { "name": "callee_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "store_before_call", "type": "BoolAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $callee_operands `)` `,` $address attr-dict `:` functional-type(operands, results)" }, { "name": "test.call_on_device", "operands": [ { "name": "forwarded_operands", "type": "Variadic" }, { "name": "non_forwarded_device_operand", "type": "AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $forwarded_operands `)` `,` $non_forwarded_device_operand attr-dict `:` functional-type(operands, results)" }, { "name": "test.call_with_segments", "summary": "test call op with segmented args", "operands": [ { "name": "prefix", "type": "Variadic" }, { "name": "args", "type": "Variadic" }, { "name": "suffix", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$callee `(` $prefix `:` type($prefix) `)`\n `(` $args `:` type($args) `)`\n `(` $suffix `:` type($suffix) `)` attr-dict" }, { "name": "test.cast", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.compare", "description": "Compare `lhs` and `rhs`. A remark is emitted which indicates whether the\n specified comparison operator was proven to hold. The remark also indicates\n whether the opposite comparison operator was proven to hold.\n\n `var_operands` must have exactly two operands: one for the LHS operand and\n one for the RHS operand. If `lhs_map` is specified, as many operands as\n `lhs_map` has inputs are expected instead of the first operand. If `rhs_map`\n is specified, as many operands as `rhs_map` has inputs are expected instead\n of the second operand.", "operands": [ { "name": "var_operands", "type": "Variadic" } ], "attributes": [ { "name": "cmp", "type": "DefaultValuedAttr" }, { "name": "lhs_map", "type": "OptionalAttr" }, { "name": "rhs_map", "type": "OptionalAttr" }, { "name": "compose", "type": "UnitAttr" } ] }, { "name": "test.complex_f64", "results": [ { "name": "result", "type": "ComplexF64" } ] }, { "name": "test.complex_f64_tensor", "results": [ { "name": "result", "type": "TensorOf<[ComplexF64]>" } ] }, { "name": "test.conditional_side_effect_op", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "has_effects", "type": "BoolAttr" } ] }, { "name": "test.conditionally_speculatable_op", "description": "Op used to test conditional speculation. This op can be speculatively\n executed if the input to it is an `arith.constant`.", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.confined_dense_array_attr", "attributes": [ { "name": "emptyattr", "type": "ConfinedAttr]>" }, { "name": "i32attr", "type": "ConfinedAttr]>" }, { "name": "i64attr", "type": "ConfinedAttr]>" } ] }, { "name": "test.confined_non_negative_attr", "attributes": [ { "name": "i8attr", "type": "ConfinedAttr]>" }, { "name": "i16attr", "type": "ConfinedAttr]>" }, { "name": "i32attr", "type": "ConfinedAttr]>" }, { "name": "i64attr", "type": "ConfinedAttr]>" }, { "name": "f32attr", "type": "ConfinedAttr]>" }, { "name": "f64attr", "type": "ConfinedAttr]>" }, { "name": "emptyattr", "type": "ConfinedAttr]>" } ] }, { "name": "test.confined_strictly_positive_attr", "attributes": [ { "name": "i8attr", "type": "ConfinedAttr]>" }, { "name": "i16attr", "type": "ConfinedAttr]>" }, { "name": "i32attr", "type": "ConfinedAttr]>" }, { "name": "i64attr", "type": "ConfinedAttr]>" }, { "name": "f32attr", "type": "ConfinedAttr]>" }, { "name": "f64attr", "type": "ConfinedAttr]>" }, { "name": "emptyattr", "type": "ConfinedAttr]>" } ] }, { "name": "test.constant", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ] }, { "name": "test.conv_op_not_linalg_op", "operands": [ { "name": "image", "type": "AnyType" }, { "name": "filter", "type": "AnyType" }, { "name": "output", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "test.conversion_call_op", "operands": [ { "name": "arg_operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "test.conversion_func_op", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "test.convert_block_args", "operands": [ { "name": "val", "type": "Optional" } ], "attributes": [ { "name": "is_legal", "type": "UnitAttr" }, { "name": "replace_with_operand", "type": "UnitAttr" }, { "name": "duplicate", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$val\n (`is_legal` $is_legal^)?\n (`duplicate` $duplicate^)?\n (`replace_with_operand` $replace_with_operand^)?\n $body attr-dict `:` functional-type(operands, results)" }, { "name": "test.copy", "description": "Represents a copy operation.", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "target", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "`(` $source `,` $target `)` `:` `(` type($source) `,` type($target) `)`\n attr-dict" }, { "name": "test.count3.i32", "summary": "tfrt_test.count3 operation", "description": "An operation that takes one input x and returns x+1, x+2, x+3 as the\n result.\n\n Example:\n %1, %2, %3 = test.count3.i32 %0", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.count3.i64", "summary": "tfrt_test.count3 operation", "description": "An operation that takes one input x and returns x+1, x+2, x+3 as the\n result.\n\n Example:\n %1, %2, %3 = test.count3.i32 %0", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.crashing_return", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "valid", "type": "UnitAttr" } ], "assemblyFormat": "($args^ `:` type($args))? attr-dict" }, { "name": "test.create_memref_op", "results": [ { "name": "output", "type": "Bufferization_BufferLikeTypeInterface" } ] }, { "name": "test.create_tensor_op", "results": [ { "name": "output", "type": "Bufferization_TensorLikeTypeInterface" } ] }, { "name": "test.cse_of_single_block_op", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict `inputs` `(` $inputs `)`\n $region `:` type($inputs) `->` type($outputs)" }, { "name": "test.custom_dimension_list_attr", "description": "Test printing/parsing of dimension list attribute.", "attributes": [ { "name": "dimension_list", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "`dimension_list` `=` custom($dimension_list)\n attr-dict" }, { "name": "test.custom_result_name", "operands": [ { "name": "optional", "type": "Variadic" } ], "results": [ { "name": "r", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ] }, { "name": "test.data_layout_query", "summary": "A token op recognized by data layout query test pass", "description": "The data layout query pass pattern-matches this op and attaches to it an\n array attribute containing the result of data layout query of the result\n type of this op.", "results": [ { "name": "res", "type": "AnyType" } ] }, { "name": "test.decode_jpeg", "summary": "tfrt_test.decode_jpeg operation", "description": "The \"tfrt_test.decode_jpeg\" operation decodes Jpeg-formatted binary and\n returns a tensor with the same semantics as tf.image.decode_jpeg(image_encoded, channels=3).\n\n Example:\n %image_decoded = tfrt_test.decode_jpeg %image_encoded", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.default_dialect", "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "test", "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "test.default_value_print", "operands": [ { "name": "operand", "type": "I32" } ], "attributes": [ { "name": "value_with_default", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict $operand" }, { "name": "test.dense_array_attr", "attributes": [ { "name": "i1attr", "type": "DenseBoolArrayAttr" }, { "name": "i8attr", "type": "DenseI8ArrayAttr" }, { "name": "i16attr", "type": "DenseI16ArrayAttr" }, { "name": "i32attr", "type": "DenseI32ArrayAttr" }, { "name": "i64attr", "type": "DenseI64ArrayAttr" }, { "name": "f32attr", "type": "DenseF32ArrayAttr" }, { "name": "f64attr", "type": "DenseF64ArrayAttr" }, { "name": "emptyattr", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "`i1attr` `=` $i1attr `i8attr` `=` $i8attr `i16attr` `=` $i16attr\n `i32attr` `=` $i32attr `i64attr` `=` $i64attr `f32attr` `=` $f32attr\n `f64attr` `=` $f64attr `emptyattr` `=` $emptyattr attr-dict" }, { "name": "test.derived_type_attr", "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "test.destination_style_op", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" }, { "name": "other_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n (`outs` `(` $outputs^ `:` type($outputs) `)`)?\n (`(` $other_operands^ `:` type($other_operands) `)`)?\n (`->` type($results)^)?" }, { "name": "test.dialect_canonicalizable", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.do.async", "summary": "do.async operation", "description": "The \"tfrt_test.do.async\" operation allows its body to be executed\n asynchronously. It has one region which represents the body.\n\n The body region takes an arbitrary number of arguments and may return\n arbitrary number of return values, using a `tfrt.return` operation at the\n end of the region.\n\n Example:\n\n tfrt_test.do.async () -> () {\n tfrt.return\n }\n\n %res = tfrt_test.do.async () -> (i32) {\n %val = tfrt.constant.i32 1\n tfrt.return %val\n }\n\n %res1, %res2 = tfrt_test.do.async %val1, %val2 : (i32, f32) -> (i32, f32) {\n tfrt.return %val1, val2 : i32, f32\n }", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "test.dummy_cast_op", "operands": [ { "name": "source", "type": "Bufferization_BufferLikeTypeInterface" } ], "results": [ { "name": "dest", "type": "Bufferization_BufferLikeTypeInterface" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "test.dummy_memref_op", "operands": [ { "name": "input", "type": "Bufferization_BufferLikeTypeInterface" } ], "results": [ { "name": "output", "type": "Bufferization_BufferLikeTypeInterface" } ] }, { "name": "test.dummy_op_with_region_ref", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$body attr-dict custom(ref($body))" }, { "name": "test.dummy_op_with_successor_ref", "successors": [ { "name": "successor", "type": "AnySuccessor" } ], "assemblyFormat": "$successor attr-dict custom(ref($successor))" }, { "name": "test.dummy_tensor_op", "operands": [ { "name": "input", "type": "Bufferization_TensorLikeTypeInterface" } ], "results": [ { "name": "output", "type": "Bufferization_TensorLikeTypeInterface" } ] }, { "name": "test.either_helper_op_a", "operands": [ { "name": "arg0", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "test.either_helper_op_b", "operands": [ { "name": "arg0", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "test.either_op_a", "operands": [ { "name": "arg0", "type": "AnyInteger" }, { "name": "arg1", "type": "AnyInteger" }, { "name": "arg2", "type": "AnyInteger" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "test.either_op_b", "operands": [ { "name": "arg0", "type": "AnyInteger" }, { "name": "arg1", "type": "AnyInteger" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "test.either_op_c", "operands": [ { "name": "arg0", "type": "AnyInteger" }, { "name": "arg1", "type": "AnyInteger" } ], "results": [ { "name": "output", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "AnyI32Attr" } ] }, { "name": "test.elementwise_mappable", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.ellipsis", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "variadic", "type": "UnitAttr" } ], "assemblyFormat": "`(` $operands (`...` $variadic^)? `)` attr-dict `:` type($operands) `...`" }, { "name": "test.else_anchor", "operands": [ { "name": "a", "type": "Optional" } ], "assemblyFormat": "`(` (`?`) : (`` $a^ `:` type($a))? `)` attr-dict" }, { "name": "test.empty_properties", "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.fallthrough_br", "summary": "branch whose successors are constrained by predicates", "successors": [ { "name": "target", "type": "FallthroughSuccessor" }, { "name": "forwardTargets", "type": "VariadicSuccessor" } ], "assemblyFormat": "$target `forward` `[` $forwardTargets `]` attr-dict" }, { "name": "test.fill_op_not_linalg_op", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "output", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "test.float_attrs", "attributes": [ { "name": "float_attr", "type": "AnyAttr" } ] }, { "name": "test.float_elements_attr", "attributes": [ { "name": "scalar_f32_attr", "type": "RankedF32ElementsAttr<[2]>" }, { "name": "tensor_f64_attr", "type": "RankedF64ElementsAttr<[4, 8]>" } ] }, { "name": "test.fold_to_call_op", "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ] }, { "name": "test.fold_with_fold_adaptor", "operands": [ { "name": "op", "type": "I32" }, { "name": "variadic", "type": "Variadic" }, { "name": "var_of_var", "type": "VariadicOfVariadic" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "DenseI32ArrayAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$op `,` `[` $variadic `]` `,` `{` $var_of_var `}` $body attr-dict-with-keyword" }, { "name": "test.force_new_layout", "description": "A tensor operation that modifies a pre-existing value and then forces a\n specific `TestMemRefLayoutAttr` to be set during bufferization into a\n memref. In tensor world, this op does nothing encoding/layout wise. It is\n similar to TestTensorWithFutureLayoutOp, but it keeps the IR values\n \"connected\" which can be particularly useful in e.g. SCF loop's body (one\n can modify an initArg's layout and yield the new-layout value).", "operands": [ { "name": "input", "type": "Bufferization_TensorLikeTypeInterface" } ], "results": [ { "name": "output", "type": "Bufferization_TensorLikeTypeInterface" } ], "attributes": [ { "name": "layout", "type": "TestMemRefLayoutAttr" } ] }, { "name": "test.format_all_types_match_attr", "operands": [ { "name": "value2", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value1", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value1', 'value2', 'result']>" } ], "assemblyFormat": "attr-dict $value1 `,` $value2" }, { "name": "test.format_all_types_match_var", "operands": [ { "name": "value1", "type": "AnyType" }, { "name": "value2", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['value1', 'value2', 'result']>" } ], "assemblyFormat": "attr-dict $value1 `,` $value2 `:` type($value1)" }, { "name": "test.format_attr_dict_w_keyword", "attributes": [ { "name": "attr", "type": "I64Attr" }, { "name": "opt_attr", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict-with-keyword" }, { "name": "test.format_attr_op", "attributes": [ { "name": "attr", "type": "I64Attr" } ], "assemblyFormat": "$attr attr-dict" }, { "name": "test.format_buildable_type_op", "operands": [ { "name": "buildable", "type": "I64" } ], "results": [ { "name": "buildable_res", "type": "I64" } ], "assemblyFormat": "$buildable attr-dict" }, { "name": "test.format_compound_attr", "attributes": [ { "name": "compound", "type": "CompoundAttrA" } ], "assemblyFormat": "$compound attr-dict-with-keyword" }, { "name": "test.format_cpmd_nested_attr", "attributes": [ { "name": "nested", "type": "CompoundNestedOuter" } ], "assemblyFormat": "`nested` $nested attr-dict-with-keyword" }, { "name": "test.format_cpmd_nested_type", "operands": [ { "name": "nested", "type": "CompoundNestedOuterType" } ], "assemblyFormat": "$nested `nested` type($nested) attr-dict-with-keyword" }, { "name": "test.format_custom_directive_attrdict", "attributes": [ { "name": "attr", "type": "I64Attr" }, { "name": "optAttr", "type": "OptionalAttr" } ], "assemblyFormat": "custom( attr-dict )" }, { "name": "test.format_custom_directive_attributes", "attributes": [ { "name": "attr", "type": "I64Attr" }, { "name": "optAttr", "type": "OptionalAttr" } ], "assemblyFormat": "custom(\n $attr, $optAttr\n )\n attr-dict" }, { "name": "test.format_custom_directive_operands", "operands": [ { "name": "operand", "type": "I64" }, { "name": "optOperand", "type": "Optional" }, { "name": "varOperands", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom(\n $operand, $optOperand, $varOperands\n )\n attr-dict" }, { "name": "test.format_custom_directive_operands_and_types", "operands": [ { "name": "operand", "type": "AnyType" }, { "name": "optOperand", "type": "Optional" }, { "name": "varOperands", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom(\n $operand, $optOperand, $varOperands,\n type($operand), type($optOperand), type($varOperands)\n )\n attr-dict" }, { "name": "test.format_custom_directive_regions", "regions": [ { "name": "region", "type": "AnyRegion" }, { "name": "other_regions", "type": "VariadicRegion" } ], "assemblyFormat": "custom(\n $region, $other_regions\n )\n attr-dict" }, { "name": "test.format_custom_directive_results", "results": [ { "name": "result", "type": "AnyType" }, { "name": "optResult", "type": "Optional" }, { "name": "varResults", "type": "Variadic" } ], "assemblyFormat": "custom(\n type($result), type($optResult), type($varResults)\n )\n attr-dict" }, { "name": "test.format_custom_directive_results_with_type_refs", "results": [ { "name": "result", "type": "AnyType" }, { "name": "optResult", "type": "Optional" }, { "name": "varResults", "type": "Variadic" } ], "assemblyFormat": "custom(\n type($result), type($optResult), type($varResults)\n )\n custom(\n ref(type($result)), ref(type($optResult)), ref(type($varResults))\n )\n attr-dict" }, { "name": "test.format_custom_directive_spacing", "attributes": [ { "name": "attr1", "type": "StrAttr" }, { "name": "attr2", "type": "StrAttr" } ], "assemblyFormat": "custom($attr1)\n custom($attr2)\n attr-dict" }, { "name": "test.format_custom_directive_successors", "successors": [ { "name": "successor", "type": "AnySuccessor" }, { "name": "successors", "type": "VariadicSuccessor" } ], "assemblyFormat": "custom(\n $successor, $successors\n )\n attr-dict" }, { "name": "test.format_custom_directive_with_optional_operand_ref", "operands": [ { "name": "optOperand", "type": "Optional" } ], "assemblyFormat": "($optOperand^)? `:`\n custom(ref($optOperand))\n attr-dict" }, { "name": "test.format_implicit_terminator_region_a_op", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "test.format_infer_type", "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "attr-dict" }, { "name": "test.format_infer_type_all_operands_and_types", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` type(operands)" }, { "name": "test.format_infer_type_all_types", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`(` operands `)` attr-dict `:` type($args)" }, { "name": "test.format_infer_type_all_types_one_operand", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`(` $args `)` attr-dict `:` type(operands)" }, { "name": "test.format_infer_type_all_types_two_operands", "operands": [ { "name": "args0", "type": "Variadic" }, { "name": "args1", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "`(` $args0 `)` `(` $args1 `)` attr-dict `:` type(operands)" }, { "name": "test.format_infer_type_regions", "results": [ { "name": "outs", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$region attr-dict" }, { "name": "test.format_infer_type_variadic_operands", "operands": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" }, { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $a `:` type($a) `)` `(` $b `:` type($b) `)` attr-dict" }, { "name": "test.format_infer_type2", "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "attr-dict" }, { "name": "test.format_infer_variadic_type_from_non_variadic", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "operands attr-dict `:` type($result)" }, { "name": "test.format_literal_following_optional_group", "attributes": [ { "name": "type", "type": "TypeAttr" }, { "name": "value", "type": "OptionalAttr" } ], "assemblyFormat": "(`(` $value^ `)`)? `:` $type attr-dict" }, { "name": "test.format_literal_op", "assemblyFormat": "`keyword_$.` `->` `:` `,` `=` `<` `>` `(` `)` `[` `]` `` `(` ` ` `)`\n `?` `+` `*` `{` `\\n` `}` attr-dict" }, { "name": "test.format_maybe_empty_type", "operands": [ { "name": "in", "type": "TestTypeOptionalValueType" } ], "assemblyFormat": "$in `:` type($in) attr-dict" }, { "name": "test.format_multiple_variadic_operands", "operands": [ { "name": "operand0", "type": "Variadic" }, { "name": "operand1", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "` ` `(` $operand0 `)` `,` `(` $operand1 `:` type($operand1) `)` attr-dict" }, { "name": "test.format_multiple_variadic_results", "results": [ { "name": "result0", "type": "Variadic" }, { "name": "result1", "type": "Variadic" } ], "assemblyFormat": "`:` `(` type($result0) `)` `,` `(` type($result1) `)` attr-dict" }, { "name": "test.format_nested_attr", "attributes": [ { "name": "nested", "type": "CompoundAttrNested" } ], "assemblyFormat": "$nested attr-dict-with-keyword" }, { "name": "test.format_operand_a_op", "operands": [ { "name": "buildable", "type": "I64" }, { "name": "operand", "type": "AnyMemRef" } ], "assemblyFormat": "operands `:` type(operands) attr-dict" }, { "name": "test.format_operand_b_op", "operands": [ { "name": "buildable", "type": "I64" }, { "name": "operand", "type": "AnyMemRef" } ], "assemblyFormat": "operands `:` type($operand) attr-dict" }, { "name": "test.format_operand_c_op", "operands": [ { "name": "buildable", "type": "I64" }, { "name": "operand", "type": "AnyMemRef" } ], "assemblyFormat": "$buildable `,` $operand `:` type(operands) attr-dict" }, { "name": "test.format_operand_d_op", "operands": [ { "name": "buildable", "type": "I64" }, { "name": "operand", "type": "AnyMemRef" } ], "assemblyFormat": "$buildable `,` $operand `:` type($operand) attr-dict" }, { "name": "test.format_operand_e_op", "operands": [ { "name": "buildable", "type": "I64" }, { "name": "operand", "type": "AnyMemRef" } ], "assemblyFormat": "$buildable `,` $operand `:` type($buildable) `,` type($operand) attr-dict" }, { "name": "test.format_opt_attr_op_a", "attributes": [ { "name": "opt_attr", "type": "OptionalAttr" } ], "assemblyFormat": "(`(` $opt_attr^ `)` )? attr-dict" }, { "name": "test.format_opt_attr_op_b", "attributes": [ { "name": "opt_attr", "type": "OptionalAttr" } ], "assemblyFormat": "($opt_attr^)? attr-dict" }, { "name": "test.format_opt_symbol_name_attr_op", "attributes": [ { "name": "opt_attr", "type": "OptionalAttr" } ], "assemblyFormat": "($opt_attr^)? attr-dict" }, { "name": "test.format_opt_symbol_ref_attr_op", "attributes": [ { "name": "opt_attr", "type": "OptionalAttr" } ], "assemblyFormat": "($opt_attr^)? attr-dict" }, { "name": "test.format_optional_default_attrs", "attributes": [ { "name": "str", "type": "DefaultValuedStrAttr" }, { "name": "sym", "type": "DefaultValuedStrAttr" }, { "name": "e", "type": "DefaultValuedAttr" } ], "assemblyFormat": "($str^)? ($sym^)? ($e^)? attr-dict" }, { "name": "test.format_optional_default_enum_attr", "attributes": [ { "name": "e", "type": "DefaultValuedEnumAttr" } ], "assemblyFormat": "($e^)? attr-dict" }, { "name": "test.format_optional_else", "attributes": [ { "name": "isFirstBranchPresent", "type": "UnitAttr" } ], "assemblyFormat": "(`then` $isFirstBranchPresent^):(`else`)? attr-dict" }, { "name": "test.format_optional_enum_attr", "attributes": [ { "name": "attr", "type": "OptionalAttr" } ], "assemblyFormat": "($attr^)? attr-dict" }, { "name": "test.format_optional_operand_result_a_op", "operands": [ { "name": "optional", "type": "Optional" }, { "name": "variadic", "type": "Variadic" } ], "results": [ { "name": "optional_res", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $optional `:` type($optional) `)` `:` type($optional_res)\n (`[` $variadic^ `]`)? attr-dict" }, { "name": "test.format_optional_operand_result_b_op", "operands": [ { "name": "optional", "type": "Optional" }, { "name": "variadic", "type": "Variadic" } ], "results": [ { "name": "optional_res", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`(` $optional^ `:` type($optional) `)`)? `:` type($optional_res)\n (`[` $variadic^ `]`)? attr-dict" }, { "name": "test.format_optional_prop_dict", "attributes": [ { "name": "a", "type": "OptionalProp" }, { "name": "b", "type": "DefaultValuedProp" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.format_optional_result_a_op", "results": [ { "name": "optional", "type": "Optional" }, { "name": "variadic", "type": "Variadic" } ], "assemblyFormat": "(`:` type($optional)^ `->` type($variadic))? attr-dict" }, { "name": "test.format_optional_result_b_op", "results": [ { "name": "optional", "type": "Optional" }, { "name": "variadic", "type": "Variadic" } ], "assemblyFormat": "(`:` type($optional) `->` type($variadic)^)? attr-dict" }, { "name": "test.format_optional_result_c_op", "results": [ { "name": "optional", "type": "Optional" }, { "name": "variadic", "type": "Variadic" } ], "assemblyFormat": "(`:` functional-type($optional, $variadic)^)? attr-dict" }, { "name": "test.format_optional_result_d_op", "results": [ { "name": "optional", "type": "Optional" } ], "assemblyFormat": "(`:` type($optional)^)? attr-dict" }, { "name": "test.format_optional_unit_attribute", "attributes": [ { "name": "is_optional", "type": "UnitAttr" } ], "assemblyFormat": "(`is_optional` $is_optional^)? attr-dict" }, { "name": "test.format_optional_unit_attribute_no_elide", "attributes": [ { "name": "is_optional", "type": "UnitAttr" } ], "assemblyFormat": "($is_optional^)? attr-dict" }, { "name": "test.format_optional_unit_property", "attributes": [ { "name": "is_optional", "type": "UnitProp" } ], "assemblyFormat": "(`is_optional` $is_optional^)? attr-dict" }, { "name": "test.format_optional_unit_property_no_elide", "attributes": [ { "name": "is_optional", "type": "UnitProp" } ], "assemblyFormat": "($is_optional^)? attr-dict" }, { "name": "test.format_qual_cpmd_nested_attr", "attributes": [ { "name": "nested", "type": "CompoundNestedOuter" } ], "assemblyFormat": "`nested` qualified($nested) attr-dict-with-keyword" }, { "name": "test.format_qual_cpmd_nested_type", "operands": [ { "name": "nested", "type": "CompoundNestedOuterType" } ], "assemblyFormat": "$nested `nested` qualified(type($nested)) attr-dict-with-keyword" }, { "name": "test.format_region_a_op", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict" }, { "name": "test.format_region_b_op", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "$region attr-dict" }, { "name": "test.format_region_c_op", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "(`region` $region^)? attr-dict" }, { "name": "test.format_result_a_op", "results": [ { "name": "buildable_res", "type": "I64" }, { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "type($result) attr-dict" }, { "name": "test.format_result_b_op", "results": [ { "name": "buildable_res", "type": "I64" }, { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "type(results) attr-dict" }, { "name": "test.format_result_c_op", "results": [ { "name": "buildable_res", "type": "I64" }, { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "functional-type($buildable_res, $result) attr-dict" }, { "name": "test.format_successor_a_op", "successors": [ { "name": "targets", "type": "VariadicSuccessor" } ], "assemblyFormat": "$targets attr-dict" }, { "name": "test.format_symbol_name_attr_op", "attributes": [ { "name": "attr", "type": "SymbolNameAttr" } ], "assemblyFormat": "$attr attr-dict" }, { "name": "test.format_two_variadic_operands_no_buildable_type_op", "operands": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $a `:` type($a) `)` `->` `(` $b `:` type($b) `)` attr-dict" }, { "name": "test.format_types_match_attr", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "TypesMatchWith<'value', 'result', '$_self'>" } ], "assemblyFormat": "attr-dict $value" }, { "name": "test.format_types_match_context", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'value', 'result', '::mlir::TupleType::get($_ctxt, $_self)'>" } ], "assemblyFormat": "attr-dict $value `:` type($value)" }, { "name": "test.format_types_match_optional", "operands": [ { "name": "optional", "type": "Optional" } ], "results": [ { "name": "result", "type": "Optional" } ], "traits": [ { "type": "TypesMatchWith<'result', 'optional', '$_self'>" } ], "assemblyFormat": "(`(` $optional^ `:` type($result) `)`)? attr-dict" }, { "name": "test.format_types_match_var", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'value', 'result', '$_self'>" } ], "assemblyFormat": "attr-dict $value `:` type($value)" }, { "name": "test.format_types_match_variadic", "operands": [ { "name": "value", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "traits": [ { "type": "TypesMatchWith<'value', 'result', 'llvm::make_range($_self.begin(), $_self.end())'>" } ], "assemblyFormat": "attr-dict $value `:` type($value)" }, { "name": "test.format_variadic_of_variadic_operand", "operands": [ { "name": "operand", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "operand_segments", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict" }, { "name": "test.format_variadic_operand", "operands": [ { "name": "operand", "type": "Variadic" } ], "assemblyFormat": "$operand `:` type($operand) attr-dict" }, { "name": "test.format_variadic_region_a_op", "regions": [ { "name": "regions", "type": "VariadicRegion" } ], "assemblyFormat": "$regions attr-dict" }, { "name": "test.format_variadic_region_b_op", "regions": [ { "name": "regions", "type": "VariadicRegion" } ], "assemblyFormat": "($regions^ `found_regions`)? attr-dict" }, { "name": "test.format_variadic_result", "results": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "`:` type($result) attr-dict" }, { "name": "test.forward_buffer", "description": "A pure operation that takes a buffer and returns a buffer. This op does not\n have any side effects, so it cannot allocate or read a buffer from memory.\n It must return the input buffer (or a view thereof). This op purposely does\n does not implement any interface.", "operands": [ { "name": "buffer", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "result", "type": "AnyRankedOrUnrankedMemRef" } ] }, { "name": "test.functional_region_op", "results": [ { "name": "result", "type": "FunctionType" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "test.get_bytes_field_from_example", "summary": "tfrt_test.get_bytes_field_from_example operation", "description": "The tfrt_test.get_bytes_field_from_example extracts the bytes field of the\n given `key` name from a protobuf object whose format follows example.proto.\n\n Example:\n %value = tfrt_test.get_bytes_field_from_example %example, %key", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.get_int64_field_from_example", "summary": "tfrt_test.get_int64_field_from_example operation", "description": "The tfrt_test.get_int64_field_from_example extracts the int64 field of the\n given `key` name from a protobuf object whose format follows example.proto.\n\n Example:\n %value = tfrt_test.get_int64_field_from_example %example, %key", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.get_string", "summary": "tfrt_test.get_string", "description": "Get a !tfrt.string value from the given string attribute.", "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.get_string_sync", "summary": "tfrt_test.get_string_sync", "description": "Get a !tfrt.string value from the given string attribute.", "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.get_tuple_element", "description": "Test op that returns a specified element of the tuple.", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "index", "type": "I32Attr" } ] }, { "name": "test.graph_loop", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "rets", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$args $body attr-dict `:` functional-type(operands, results)" }, { "name": "test.graph_region", "summary": "operation with a graph region", "description": "Test op that defines a graph region.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "test.has_str_value", "attributes": [ { "name": "value", "type": "DefaultValuedStrAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "test.i32_enum_attr", "results": [ { "name": "val", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "SomeI32Enum{case5|case10|caseSignedMaxPlusOne|caseUnsignedMax}" } ] }, { "name": "test.i32ElementsAttr", "attributes": [ { "name": "attr", "type": "I32ElementsAttr" } ] }, { "name": "test.i64_enum_attr", "results": [ { "name": "val", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "SomeI64Enum{case5|case10|caseLarse}" } ] }, { "name": "test.if_first_operand_is_none_then_so_is_second", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ] }, { "name": "test.ignore_arg_match_dst", "operands": [ { "name": "b", "type": "AnyType" } ], "attributes": [ { "name": "f", "type": "AnyAttr" } ] }, { "name": "test.ignore_arg_match_src", "operands": [ { "name": "a", "type": "AnyType" }, { "name": "b", "type": "AnyType" }, { "name": "c", "type": "AnyType" } ], "attributes": [ { "name": "d", "type": "AnyAttr" }, { "name": "e", "type": "AnyAttr" }, { "name": "f", "type": "AnyAttr" } ] }, { "name": "test.illegal_op_a", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.illegal_op_b", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.illegal_op_c", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.illegal_op_d", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.illegal_op_e", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.illegal_op_f", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.illegal_op_g", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.increment", "operands": [ { "name": "value", "type": "InferIntRangeType" } ], "results": [ { "name": "result", "type": "InferIntRangeType" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "attr-dict $value `:` type($result)" }, { "name": "test.indexElementsAttr", "attributes": [ { "name": "attr", "type": "IndexElementsAttr" } ] }, { "name": "test.int_attrs", "attributes": [ { "name": "any_i32_attr", "type": "AnyI32Attr" }, { "name": "index_attr", "type": "IndexAttr" }, { "name": "ui32_attr", "type": "UI32Attr" }, { "name": "si32_attr", "type": "SI32Attr" } ] }, { "name": "test.int_elements_attr", "attributes": [ { "name": "any_i32_attr", "type": "AnyI32ElementsAttr" }, { "name": "i32_attr", "type": "I32ElementsAttr" } ] }, { "name": "test.int_types", "results": [ { "name": "any_i16", "type": "AnyI16" }, { "name": "si32", "type": "SI32" }, { "name": "ui64", "type": "UI64" }, { "name": "any_int", "type": "AnyInteger" } ] }, { "name": "test.interleaved_operand_attr1", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" } ] }, { "name": "test.interleaved_operand_attr2", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" } ] }, { "name": "test.internal_br", "operands": [ { "name": "successOperands", "type": "Variadic" }, { "name": "errorOperands", "type": "Variadic" } ], "successors": [ { "name": "successPath", "type": "AnySuccessor" }, { "name": "errorPath", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.isolated_graph_region", "summary": "isolated from above operation with a graph region", "description": "Test op that defines a graph region which is isolated from above.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "test.isolated_one_region_op", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "my_region", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict-with-keyword $operands $my_region `:` type($operands) `->` type($results)" }, { "name": "test.isolated_region", "summary": "isolated region operation", "description": "Test op with an isolated region, to test passthrough region arguments. Each\n argument is of index type.", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "test.isolated_regions", "regions": [ { "name": "regions", "type": "VariadicRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict-with-keyword $regions" }, { "name": "test.legal_op_a", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "status", "type": "StrAttr" } ] }, { "name": "test.legal_op_b", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.legal_op_c", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.less_than", "operands": [ { "name": "lhs", "type": "RankedTensorOf<[F32]>" }, { "name": "rhs", "type": "RankedTensorOf<[F32]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[I1]>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "test.linalg_conv_op", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "test.linalg_fill_op", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "test.loc_dst", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.loc_dst_no_res", "operands": [ { "name": "input", "type": "I32" } ] }, { "name": "test.loc_src", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "test.loc_src_no_res", "operands": [ { "name": "input", "type": "I32" } ] }, { "name": "test.loop_block", "operands": [ { "name": "init", "type": "I32" } ], "results": [ { "name": "floatResult", "type": "F32" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$init `:` functional-type($init, $floatResult) $body\n attr-dict-with-keyword" }, { "name": "test.loop_block_term", "operands": [ { "name": "nextIterArg", "type": "I32" }, { "name": "exitArg", "type": "F32" } ], "assemblyFormat": "`iter` $nextIterArg `exit` $exitArg attr-dict" }, { "name": "test.loop_types_compat", "operands": [ { "name": "init_args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "test.make_tuple", "description": "Test op that creates a tuple value from a list of values.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TupleOf<[AnyType]>" } ] }, { "name": "test.many_arguments", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" }, { "name": "input3", "type": "I32" }, { "name": "input4", "type": "I32" }, { "name": "input5", "type": "I32" }, { "name": "input6", "type": "I32" }, { "name": "input7", "type": "I32" }, { "name": "input8", "type": "I32" }, { "name": "input9", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" }, { "name": "attr3", "type": "I64Attr" }, { "name": "attr4", "type": "I64Attr" }, { "name": "attr5", "type": "I64Attr" }, { "name": "attr6", "type": "I64Attr" }, { "name": "attr7", "type": "I64Attr" }, { "name": "attr8", "type": "I64Attr" }, { "name": "attr9", "type": "I64Attr" } ] }, { "name": "test.many_regions", "summary": "operation created with move-only objects", "description": "Test op with multiple regions with a `create` function that\n takes parameters containing move-only objects.", "regions": [ { "name": "regions", "type": "VariadicRegion" } ] }, { "name": "test.match_op_attribute1", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "required_attr", "type": "I32Attr" }, { "name": "optional_attr", "type": "OptionalAttr" }, { "name": "default_valued_attr", "type": "DefaultValuedAttr" }, { "name": "more_attr", "type": "I32Attr" } ] }, { "name": "test.match_op_attribute2", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.match_op_attribute3", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "UnitAttr" } ] }, { "name": "test.match_op_attribute4", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "UnitAttr" }, { "name": "attr2", "type": "UnitAttr" } ] }, { "name": "test.merge_blocks", "summary": "merge_blocks operation", "description": "Test op with multiple blocks that are merged with Dialect Conversion", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "test.mixed_normal_variadic_operand", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "AnyTensor" }, { "name": "input3", "type": "Variadic" } ] }, { "name": "test.mixed_normal_variadic_result", "results": [ { "name": "output1", "type": "Variadic" }, { "name": "output2", "type": "AnyTensor" }, { "name": "output3", "type": "Variadic" } ] }, { "name": "test.mixed_variadic_in_out_i32", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "test.mixed_variadic_in1", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "F32" }, { "name": "input3", "type": "Variadic" } ] }, { "name": "test.mixed_variadic_in2", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "F32" }, { "name": "input3", "type": "Variadic" } ] }, { "name": "test.mixed_variadic_in3", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "Variadic" }, { "name": "input3", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ] }, { "name": "test.mixed_variadic_in4", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" } ] }, { "name": "test.mixed_variadic_in5", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" }, { "name": "input3", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" }, { "name": "pattern_name", "type": "StrAttr" } ] }, { "name": "test.mixed_variadic_in6", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "Variadic" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" } ] }, { "name": "test.mixed_variadic_optional_in7", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "Optional" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.mixed_variadic_out1", "results": [ { "name": "output1", "type": "Variadic" }, { "name": "output2", "type": "F32" }, { "name": "output3", "type": "Variadic" } ] }, { "name": "test.mixed_variadic_out2", "results": [ { "name": "output1", "type": "Variadic" }, { "name": "output2", "type": "F32" }, { "name": "output3", "type": "Variadic" } ] }, { "name": "test.mixed_variadic_out3", "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "Variadic" }, { "name": "output3", "type": "Variadic" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ] }, { "name": "test.multi_slot_alloca", "results": [ { "name": "results", "type": "Variadic>" } ], "assemblyFormat": "attr-dict `:` functional-type(operands, results)" }, { "name": "test.multi_tensor_rank_of", "operands": [ { "name": "arg0", "type": "TensorRankOf<[I8, I32, F32], [0, 1]>" } ] }, { "name": "test.native_code_call1", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "choice", "type": "BoolAttr" }, { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" } ] }, { "name": "test.native_code_call2", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "test.native_code_call3", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.native_code_call4", "operands": [ { "name": "input1", "type": "AnyType" } ], "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "I32" } ] }, { "name": "test.native_code_call5", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "I32" } ] }, { "name": "test.native_code_call6", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "I32" } ] }, { "name": "test.native_code_call7", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.nd_tensor_of", "operands": [ { "name": "arg0", "type": "0DTensorOf<[F32]>" }, { "name": "arg1", "type": "1DTensorOf<[F32]>" }, { "name": "arg2", "type": "2DTensorOf<[I16]>" }, { "name": "arg3", "type": "3DTensorOf<[I16]>" }, { "name": "arg4", "type": "4DTensorOf<[I16]>" } ] }, { "name": "test.nested_tuple_32_bit", "results": [ { "name": "result", "type": "NestedTupleOf<[I32, F32]>" } ] }, { "name": "test.never_speculatable_op", "description": "Op used to test conditional speculation. This op can never be\n speculatively executed.", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.no_str_value", "attributes": [ { "name": "value", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "test.non_negative_int_attr", "attributes": [ { "name": "i32attr", "type": "ConfinedAttr" }, { "name": "i64attr", "type": "ConfinedAttr" } ] }, { "name": "test.nvvm_requires_sm_100f", "assemblyFormat": "attr-dict" }, { "name": "test.nvvm_requires_sm_100f_or_sm_120f", "assemblyFormat": "attr-dict" }, { "name": "test.nvvm_requires_sm_103f", "assemblyFormat": "attr-dict" }, { "name": "test.nvvm_requires_sm_80", "assemblyFormat": "attr-dict" }, { "name": "test.nvvm_requires_sm_90a", "assemblyFormat": "attr-dict" }, { "name": "test.nvvm_requires_sm_90a_or_sm_100a", "assemblyFormat": "attr-dict" }, { "name": "test.nvvm_requires_sm_90a_or_sm_100f", "assemblyFormat": "attr-dict" }, { "name": "test.oilist_allowed_literal", "assemblyFormat": "oilist( `foo` | `bar` ) `buzz` attr-dict" }, { "name": "test.oilist_custom", "operands": [ { "name": "arg0", "type": "Variadic" }, { "name": "optOperand", "type": "Optional" } ], "attributes": [ { "name": "nowait", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist( `private` `(` $arg0 `:` type($arg0) `)`\n | `reduction` custom($optOperand)\n | `nowait` $nowait\n ) attr-dict" }, { "name": "test.oilist_variadic_with_parens", "operands": [ { "name": "arg0", "type": "Variadic" }, { "name": "arg1", "type": "Variadic" }, { "name": "arg2", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist( `keyword` `(` $arg0 `:` type($arg0) `)`\n | `otherKeyword` `(` $arg1 `:` type($arg1) `)`\n | `thirdKeyword` `(` $arg2 `:` type($arg2) `)`) attr-dict" }, { "name": "test.oilist_with_keywords_only", "attributes": [ { "name": "keyword", "type": "UnitAttr" }, { "name": "otherKeyword", "type": "UnitAttr" }, { "name": "diffNameUnitAttrKeyword", "type": "UnitAttr" } ], "assemblyFormat": "oilist( `keyword` $keyword\n | `otherKeyword` $otherKeyword\n | `thirdKeyword` $diffNameUnitAttrKeyword) attr-dict" }, { "name": "test.oilist_with_keywords_only_properties", "attributes": [ { "name": "keyword", "type": "UnitProp" }, { "name": "otherKeyword", "type": "UnitProp" }, { "name": "diffNameUnitPropKeyword", "type": "UnitProp" } ], "assemblyFormat": "oilist( `keyword` $keyword\n | `otherKeyword` $otherKeyword\n | `thirdKeyword` $diffNameUnitPropKeyword) attr-dict" }, { "name": "test.oilist_with_simple_args", "operands": [ { "name": "arg0", "type": "Optional" }, { "name": "arg1", "type": "Optional" }, { "name": "arg2", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "oilist( `keyword` $arg0 `:` type($arg0)\n | `otherKeyword` $arg1 `:` type($arg1)\n | `thirdKeyword` $arg2 `:` type($arg2) ) attr-dict" }, { "name": "test.one_i32_out", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.one_region_with_operands_op", "operands": [ { "name": "operands", "type": "Variadic" } ] }, { "name": "test.one_region_with_recursive_memory_effects", "description": "Op that has one region and recursive side effects. The\n RegionBranchOpInterface is not implemented on this op.", "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "test.one_result1", "results": [ { "name": "result1", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "test.one_result2", "results": [ { "name": "result1", "type": "I32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "test.one_result3", "results": [ { "name": "result1", "type": "I32" } ] }, { "name": "test.one_to_two", "results": [ { "name": "result0", "type": "AnyInteger" }, { "name": "result1", "type": "AnyInteger" } ] }, { "name": "test.one_variadic_out_one_variadic_in1", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.one_variadic_out_one_variadic_in2", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.op_a", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "I32Attr" } ] }, { "name": "test.op_b", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "I32Attr" } ] }, { "name": "test.op_c", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_commutative", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" }, { "name": "op3", "type": "I32" }, { "name": "op4", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_commutative2", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_crash_long", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_crash_short", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_d", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_e", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_f", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_funcref", "summary": "Test op with a reference to a function symbol", "description": "The \"test.op_funcref\" is a test op with a reference to a function symbol." }, { "name": "test.op_g", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_idempotent_trait", "operands": [ { "name": "op1", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.op_idempotent_trait_binary", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.op_in_place_fold", "operands": [ { "name": "op", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "OptionalAttr" } ] }, { "name": "test.op_in_place_fold_anchor", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_in_place_fold_success", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.op_in_place_self_fold", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "folded", "type": "UnitAttr" } ] }, { "name": "test.op_involution_trait_failing_operation_fold", "operands": [ { "name": "op1", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.op_involution_trait_no_operation_fold", "operands": [ { "name": "op1", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.op_involution_trait_succesful_operation_fold", "operands": [ { "name": "op1", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.op_j", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_k", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_large_commutative", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" }, { "name": "op3", "type": "I32" }, { "name": "op4", "type": "I32" }, { "name": "op5", "type": "I32" }, { "name": "op6", "type": "I32" }, { "name": "op7", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_m", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "optional_attr", "type": "OptionalAttr" } ] }, { "name": "test.op_n", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_nonnorm", "operands": [ { "name": "X", "type": "AnyMemRef" }, { "name": "Y", "type": "AnyMemRef" } ] }, { "name": "test.op_norm", "operands": [ { "name": "X", "type": "AnyMemRef" }, { "name": "Y", "type": "AnyMemRef" } ] }, { "name": "test.op_norm_ret", "operands": [ { "name": "X", "type": "AnyMemRef" } ], "results": [ { "name": "Y", "type": "AnyMemRef" }, { "name": "Z", "type": "AnyMemRef" } ] }, { "name": "test.op_o", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_optionally_implementing_interface", "attributes": [ { "name": "implementsInterface", "type": "BoolAttr" } ] }, { "name": "test.op_p", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.op_q", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.op_r", "results": [ { "name": "result", "type": "AnyInteger" } ] }, { "name": "test.op_s", "results": [ { "name": "result", "type": "AnyInteger" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ] }, { "name": "test.op_with_bit_enum", "attributes": [ { "name": "value", "type": "TestBitEnumAttr{read|write|execute}" }, { "name": "tag", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`tag` $tag^)? attr-dict" }, { "name": "test.op_with_bit_enum_prop", "attributes": [ { "name": "value1", "type": "TestBitEnumProp{read|write|execute}" }, { "name": "value2", "type": "TestBitEnumProp{read|write|execute}" } ], "assemblyFormat": "$value1 ($value2^)? attr-dict `:` `(``)`" }, { "name": "test.op_with_bit_enum_prop_named", "attributes": [ { "name": "value1", "type": "TestBitEnumPropNamed" }, { "name": "value2", "type": "TestBitEnumPropNamed" } ], "assemblyFormat": "$value1 ($value2^)? attr-dict" }, { "name": "test.op_with_bit_enum_vbar", "attributes": [ { "name": "value", "type": "TestBitEnumVerticalBarAttr{user|group|other}" }, { "name": "tag", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`tag` $tag^)? attr-dict" }, { "name": "test.op_with_data_layout", "summary": "An op that uses DataLayout implementation from the Target dialect", "regions": [ { "name": "regions", "type": "VariadicRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "test.op_with_effects_a", "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "first", "type": "FlatSymbolRefAttr" }, { "name": "second", "type": "SymbolRefAttr" }, { "name": "optional_symbol", "type": "OptionalAttr" } ] }, { "name": "test.op_with_enum", "attributes": [ { "name": "value", "type": "TestEnumAttr{first|second|third}" }, { "name": "tag", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`tag` $tag^)? attr-dict" }, { "name": "test.op_with_enum_prop", "attributes": [ { "name": "value", "type": "TestEnumProp{first|second|third}" } ], "assemblyFormat": "$value attr-dict" }, { "name": "test.op_with_enum_prop_attr_form", "attributes": [ { "name": "value", "type": "TestEnumPropAttrForm{first|second|third}" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.op_with_enum_prop_attr_form_always", "attributes": [ { "name": "value", "type": "TestEnumPropAttrFormAlways{first|second|third}" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.op_with_infer_type_adaptor_if", "operands": [ { "name": "x", "type": "AnyTensor" }, { "name": "y", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "traits": [ { "type": "InferTypeOpInterface" } ] }, { "name": "test.op_with_infer_type_if", "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "test.op_with_loc_attr", "attributes": [ { "name": "loc_attr", "type": "LocationAttr" } ], "assemblyFormat": "$loc_attr attr-dict" }, { "name": "test.op_with_memread", "results": [ { "name": "result", "type": "AnyInteger" } ] }, { "name": "test.op_with_property_predicates", "attributes": [ { "name": "scalar", "type": "NonNegativeI64Prop" }, { "name": "optional", "type": "OptionalProp" }, { "name": "defaulted", "type": "DefaultValuedProp" }, { "name": "more_constrained", "type": "ConfinedProp, between 0 and 5>" }, { "name": "array", "type": "ArrayProp" }, { "name": "non_empty_unconstrained", "type": "NonEmptyArray" }, { "name": "non_empty_constrained", "type": "NonEmptyArray" }, { "name": "non_empty_optional", "type": "OptionalProp>" }, { "name": "unconstrained", "type": "I64Prop" } ], "assemblyFormat": "attr-dict prop-dict" }, { "name": "test.op_with_refine_type_if", "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "test.op_with_region_fold", "operands": [ { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "test.op_with_region_fold_no_side_effect", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "test.op_with_region_pattern", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "test.op_with_result_shape_interface", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "test.op_with_shaped_type_infer_type_adaptor_if", "operands": [ { "name": "operand1", "type": "AnyTensor" }, { "name": "operand2", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "test.op_with_shaped_type_infer_type_if", "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "test.op_with_simple_enum_16_prop", "attributes": [ { "name": "value", "type": "TestSimpleEnum16Prop{a|b}" } ], "assemblyFormat": "$value attr-dict" }, { "name": "test.op_with_simple_enum_8_prop", "attributes": [ { "name": "value", "type": "TestSimpleEnum8Prop{a|b}" } ], "assemblyFormat": "$value attr-dict" }, { "name": "test.op_with_two_default_bit_enum_props", "attributes": [ { "name": "value1", "type": "TestBitEnumPropDefault{read|write|execute}" }, { "name": "value2", "type": "TestBitEnumVerticalBarPropDefault{user|group|other}" } ], "assemblyFormat": "($value1^)? ($value2^)? attr-dict" }, { "name": "test.op_with_two_default_enum_props", "attributes": [ { "name": "value1", "type": "TestEnumPropDefault{first|second|third}" }, { "name": "value2", "type": "TestOtherEnumPropDefault{dog|cat|fish}" } ], "assemblyFormat": "($value1^)? ($value2^)? attr-dict" }, { "name": "test.op_with_variadic_results_and_folder", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.op_x", "operands": [ { "name": "input", "type": "AnyInteger" } ], "results": [ { "name": "result", "type": "AnyInteger" } ] }, { "name": "test.op.with_dot_in_name", "assemblyFormat": "attr-dict" }, { "name": "test.operand_and_result_have_same_element_count_any_type", "operands": [ { "name": "x", "type": "AnyType" } ], "results": [ { "name": "res", "type": "AnyType" } ] }, { "name": "test.operand_rank_equals_result_size", "operands": [ { "name": "operand", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ] }, { "name": "test.operand0_and_result_have_same_element_count", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "test.operand0_and_result_have_same_element_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ], "results": [ { "name": "res", "type": "AnyType" } ] }, { "name": "test.operand0_and_result_have_same_rank", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "test.operand0_and_result_have_same_shape", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "test.operand0_and_result_have_same_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ], "results": [ { "name": "res", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['x', 'res']>" } ] }, { "name": "test.operands_and_result_have_same_rank", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "test.operands_have_same_element_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ] }, { "name": "test.operands_have_same_rank", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ] }, { "name": "test.operands_have_same_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ], "traits": [ { "type": "AllTypesMatch<['x', 'y']>" } ] }, { "name": "test.optional_custom_attr", "description": "Test using a custom directive as the optional group anchor and the first\n element to parse. It is expected to return an `OptionalParseResult`.", "attributes": [ { "name": "attr", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict (custom($attr)^) : (`bar`)?" }, { "name": "test.overridden_symbol_visibility", "summary": "operation overridden symbol visibility accessors", "attributes": [ { "name": "sym_name", "type": "StrAttr" } ] }, { "name": "test.parse_b64", "attributes": [ { "name": "b64", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "test.parse_custom_operation_name_api", "summary": "noop that exercises the parseCustomOperationName API", "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "`(` custom($name) `)` attr-dict" }, { "name": "test.parse_example_from_bytes", "summary": "tfrt_test.parse_example_from_bytes operation", "description": "The proto.parse_example_from_bytes parses a string into a protobuf object\n whose format follows example.proto.\n\n Example:\n %example = tfrt_test.parse_example_from_bytes\" %bytes", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.parse_integer_literal", "results": [ { "name": "results", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "test.parse_wrapped_keyword", "attributes": [ { "name": "keyword", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "test.partial_alias", "operands": [ { "name": "source", "type": "AnyMemRef" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "$source attr-dict `:` functional-type($source, $result)" }, { "name": "test.polyfor", "summary": "polyfor operation", "description": "Test op with multiple region arguments, each argument of index type.", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "test.positive_int_attr", "attributes": [ { "name": "i32attr", "type": "ConfinedAttr" }, { "name": "i64attr", "type": "ConfinedAttr" } ] }, { "name": "test.pretty_printed_region", "summary": "pretty_printed_region operation", "description": "Test-op can be printed either in a \"pretty\" or \"non-pretty\" way based on\n some criteria. The custom parser parsers both the versions while testing\n APIs: parseCustomOperationName & parseGenericOperationAfterOpName.", "operands": [ { "name": "input1", "type": "AnyType" }, { "name": "input2", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "test.producing_br", "operands": [ { "name": "firstOperands", "type": "Variadic" }, { "name": "secondOperands", "type": "Variadic" } ], "results": [ { "name": "dummy", "type": "I32" } ], "successors": [ { "name": "first", "type": "AnySuccessor" }, { "name": "second", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.promised_interfaces", "operands": [ { "name": "promisedType", "type": "ConfinedType]>" } ], "attributes": [ { "name": "promisedAttr", "type": "ConfinedAttr]>" } ] }, { "name": "test.prop", "operands": [ { "name": "upperInits", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "transforms", "type": "I32ElementsAttr" } ] }, { "name": "test.prop_pattern_op_1", "results": [ { "name": "results", "type": "I32" } ], "attributes": [ { "name": "tag", "type": "StringProp" }, { "name": "val", "type": "I64Prop" }, { "name": "cond", "type": "BoolProp" } ], "assemblyFormat": "$tag $val $cond attr-dict" }, { "name": "test.prop_pattern_op_2", "operands": [ { "name": "input", "type": "I32" } ], "attributes": [ { "name": "tag", "type": "StringProp" } ], "assemblyFormat": "$input $tag attr-dict" }, { "name": "test.rank_less_than_2_I8_F32_memref", "results": [ { "name": "result", "type": "MemRefRankOf<[I8, F32], [0, 1]>" } ] }, { "name": "test.ranked_int_elements_attr", "attributes": [ { "name": "vector_i32_attr", "type": "RankedI32ElementsAttr<[2]>" }, { "name": "matrix_i64_attr", "type": "RankedI64ElementsAttr<[4, 8]>" } ] }, { "name": "test.ranked_tensor_op", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ] }, { "name": "test.read_buffer", "description": "An operation that reads the buffer operand and dumps its contents.", "operands": [ { "name": "buffer", "type": "AnyRankedOrUnrankedMemRef" } ] }, { "name": "test.recursive_rewrite", "attributes": [ { "name": "depth", "type": "I64Attr" } ], "assemblyFormat": "$depth attr-dict" }, { "name": "test.recursively_speculatable_op", "description": "Op used to test conditional speculation. This op can be speculatively\n executed only if all the ops in the attached region can be.", "results": [ { "name": "result", "type": "I32" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "test.reflect_bounds", "description": "Integer range analysis will update this op to reflect inferred integer range\n of the input, so it can be checked with FileCheck\n\n Example:\n\n ```mlir\n CHECK: test.reflect_bounds {smax = 7 : index, smin = 0 : index, umax = 7 : index, umin = 0 : index}\n %1 = test.reflect_bounds %0 : index\n ```", "operands": [ { "name": "value", "type": "InferIntRangeType" } ], "results": [ { "name": "result", "type": "InferIntRangeType" } ], "attributes": [ { "name": "umin", "type": "OptionalAttr" }, { "name": "umax", "type": "OptionalAttr" }, { "name": "smin", "type": "OptionalAttr" }, { "name": "smax", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "attr-dict $value `:` type($result)" }, { "name": "test.region_buffer_based", "description": "A buffer based operation, that uses memRefs as input and output.", "operands": [ { "name": "input", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "output", "type": "AnyRankedOrUnrankedMemRef" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`in` `(` $input`:` type($input) `)` `out` `(` $output`:` type($output) `)`\n $region attr-dict" }, { "name": "test.region_if", "description": "Represents an abstract if-then-else-join pattern. In this context, the then\n and else regions jump to the join region, which finally returns to its\n parent op.", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "thenRegion", "type": "SizedRegion<1>" }, { "name": "elseRegion", "type": "AnyRegion" }, { "name": "joinRegion", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "test.region_if_yield", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$results `:` type($results) attr-dict" }, { "name": "test.region_type_changer", "operands": [ { "name": "entries", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`(` $entries `)` $body `:` functional-type($entries, $results) attr-dict" }, { "name": "test.region_types_compat", "operands": [ { "name": "entries", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "test.region_yield", "description": "This operation is used in a region and yields the corresponding type for\n that operation.", "operands": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$result `:` type($result) attr-dict" }, { "name": "test.reify_bound", "description": "Reify a bound for the given index-typed value or dimension size of a shaped\n value. \"LB\", \"EQ\" and \"UB\" bounds are supported. If `scalable` is set,\n `vscale_min` and `vscale_max` must be provided, which allows computing\n a bound in terms of \"vector.vscale\" for a given range of vscale.", "operands": [ { "name": "var", "type": "AnyType" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "OptionalAttr" }, { "name": "type", "type": "DefaultValuedAttr" }, { "name": "constant", "type": "UnitAttr" }, { "name": "allow_integer_type", "type": "UnitAttr" }, { "name": "scalable", "type": "UnitAttr" }, { "name": "vscale_min", "type": "OptionalAttr" }, { "name": "vscale_max", "type": "OptionalAttr" } ] }, { "name": "test.reify_shaped_type_using_reify_dim_of_result", "description": "Test that when resolving a single dimension of a result for an operation\n that implements `reifyDimOfResult`, which is used to get the required value.\n `reifyResultShapes` and `reifyShapeOfResult` are implemented as failures\n to ensure they are not called. The op semantics is that the first result has\n the same shape as the second operand and the second result has the same shape\n as the first operand.", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "test.reify_shaped_type_using_reify_result_shapes", "description": "Test that when resolving a single dimension of a result for an operation\n that doesnt implement `reifyShapeOfResult` nor implements `reifyDimOfResult`\n calls into the implementation of `reifyResultShapes` to get the required value.\n The op semantics is that the first result has the same shape as the second operand\n and the second result has the same shape as the first operand.", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "test.reify_shaped_type_using_reify_shape_of_result", "description": "Test that when resolving a single dimension of a result for an operation\n that doesnt implement `reifyDimOfResult` but implements `reifyShapeOfResult`, which\n is used to get the required value. `reifyResultShapes` is implemented as a failure\n (which is also the default implementation) to ensure it is not called.\n The op semantics is that the first result has the same shape as the second operand\n and the second result has the same shape as the first operand.", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "test.remapped_value_region", "summary": "remapped_value_region operation", "description": "Test op that remaps values that haven't yet been converted in Dialect\n Conversion.", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "test.resize_bilinear", "summary": "tfrt_test.resize_bilinear operation", "description": "The tfrt_test.resize_bilinear operation resizes the input tensor based on\n the given height and width. It returns a tensor with the same semantics as\n tf.compat.v1.image.resize(input, [height, width]).\n\n Example:\n %image_resized = tfrt_test.resize_bilinear %image_decoded, %new_height, %new_width", "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "test.result_has_same_type_as_attr", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "attr", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['attr', 'result']>" } ], "assemblyFormat": "$attr `->` type($result) attr-dict" }, { "name": "test.result_name_from_type", "results": [ { "name": "r", "type": "AnyType" } ] }, { "name": "test.result_name_from_type_interface", "results": [ { "name": "r", "type": "Variadic" } ] }, { "name": "test.result_type_with_trait", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.return_with_ignored_value", "operands": [ { "name": "values", "type": "Variadic" }, { "name": "unwanted_value", "type": "AnyType" } ] }, { "name": "test.rewrite", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.same_operand_and_result_element_type", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.same_operand_and_result_shape", "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "test.same_operand_and_result_type", "results": [ { "name": "result", "type": "Variadic" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.same_operand_element_type", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.same_operand_result_type", "operands": [ { "name": "operand", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.side_effect_op", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.side_effect_with_region_op", "operands": [ { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`(` $operand`)` $region attr-dict `:` type($operand) `->` type($result)" }, { "name": "test.sign", "operands": [ { "name": "operand", "type": "RankedTensorOf<[F32]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[I32]>" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "test.signless_like_variadic", "operands": [ { "name": "x", "type": "Variadic" } ] }, { "name": "test.single_no_terminator_custom_asm_op", "hasCustomAssemblyFormat": true }, { "name": "test.single_no_terminator_op", "regions": [ { "name": "my_region", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict `:` $my_region" }, { "name": "test.SingleBlockImplicitTerminator", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "test.sized_region_op", "regions": [ { "name": "my_region", "type": "SizedRegion<2>" } ] }, { "name": "test.slash_attr", "attributes": [ { "name": "attr", "type": "SlashAttr" } ] }, { "name": "test.slot_tracker", "operands": [ { "name": "source", "type": "AnyMemRef" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$source `,` $name attr-dict `:` type($source)" }, { "name": "test.source_op", "operands": [ { "name": "arg", "type": "AnyInteger" } ], "results": [ { "name": "result", "type": "AnyInteger" } ], "attributes": [ { "name": "tag", "type": "AnyI32Attr" } ] }, { "name": "test.special.op" }, { "name": "test.ssacfg_region", "summary": "operation with an SSACFG region", "description": "Test op that defines an SSACFG region.", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "regions", "type": "VariadicRegion" } ] }, { "name": "test.store_with_a_loop_region", "operands": [ { "name": "address", "type": "AnyMemRef" } ], "attributes": [ { "name": "store_before_region", "type": "BoolAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$address attr-dict-with-keyword regions `:` type($address)" }, { "name": "test.store_with_a_region", "operands": [ { "name": "address", "type": "AnyMemRef" } ], "attributes": [ { "name": "store_before_region", "type": "BoolAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$address attr-dict-with-keyword regions `:` type($address)" }, { "name": "test.store_with_a_region_terminator", "assemblyFormat": "attr-dict" }, { "name": "test.string_attr_pretty_name", "results": [ { "name": "r", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "test.string_attr_with_mixed_type", "attributes": [ { "name": "attr", "type": "AnyAttrOf<[TypedStrAttr, I64Attr]>" } ], "assemblyFormat": "$attr attr-dict" }, { "name": "test.string_attr_with_type", "attributes": [ { "name": "attr", "type": "TypedStrAttr" } ], "assemblyFormat": "$attr attr-dict" }, { "name": "test.string_elements_attr", "attributes": [ { "name": "scalar_string_attr", "type": "StringElementsAttr" } ] }, { "name": "test.switch_with_no_break", "operands": [ { "name": "arg", "type": "Index" } ], "attributes": [ { "name": "cases", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "caseRegions", "type": "VariadicRegion>" } ], "assemblyFormat": "$arg attr-dict custom($cases, $caseRegions)" }, { "name": "test.symbol", "summary": "operation which defines a new symbol", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" } ] }, { "name": "test.symbol_binding_a", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "I64Attr" } ] }, { "name": "test.symbol_binding_b", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.symbol_binding_c", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.symbol_binding_d", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "I64Attr" } ] }, { "name": "test.symbol_binding_no_result", "operands": [ { "name": "operand", "type": "I32" } ] }, { "name": "test.symbol_scope", "summary": "operation which defines a new symbol table", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "test.symbol_scope_isolated", "summary": "operation which defines a new symbol table that is IsolatedFromAbove", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "test.symbol_table_region", "summary": "operation which defines a new symbol table without a restriction on a terminator", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "test.symbol_with_result", "summary": "invalid symbol operation that produces an SSA result", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" } ] }, { "name": "test.sync_benchmark", "summary": "synchronous benchmark operation", "description": "The \"tfrt_test.sync_benchmark\" operation benchmarks the performance of an\n MLIR synchronous region by executing the given MLIR region repeatedly up\n to the `duration_secs` seconds or `max_count` times. `num_warmup_runs`\n specifies the number of warm up runs to run the given MLIR region before\n the benchmark starts.\n\n The target MLIR region can take an arbitrary number of arguments and\n should return no value. The arguments for the MLIR region are\n provided as the operands of the tfrt_test.sync_benchmark op.\n\n Example:\n // Target sync function to benchmark.\n func @fibonacci.i32() -> i32 attributes {hex.sync} {\n %0 = \"hex.constant_s.i32\"() {value = 0 : i32} : () -> i32\n %1 = \"hex.constant_s.i32\"() {value = 1 : i32} : () -> i32\n\n %2 = \"hex.add_s.i32\"(%0, %1) : (i32, i32) -> i32\n %3 = \"hex.add_s.i32\"(%1, %2) : (i32, i32) -> i32\n %4 = \"hex.add_s.i32\"(%2, %3) : (i32, i32) -> i32\n %5 = \"hex.add_s.i32\"(%3, %4) : (i32, i32) -> i32\n\n hex.return\n }\n\n tfrt_test.sync_benchmark @fibonacci.i32()\n duration_secs = 1, max_count = 100, num_warmup_runs = 10", "attributes": [ { "name": "target_fn", "type": "FlatSymbolRefAttr" }, { "name": "duration_secs", "type": "I32Attr" }, { "name": "max_count", "type": "I32Attr" }, { "name": "num_warmup_runs", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "test.takes_static_memref", "operands": [ { "name": "x", "type": "AnyStaticShapeMemRef" } ] }, { "name": "test.tblgen_build_0", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.tblgen_build_1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ] }, { "name": "test.tblgen_build_2", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.tblgen_build_3", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "resultA", "type": "Variadic" }, { "name": "resultB", "type": "Variadic" } ] }, { "name": "test.tblgen_build_4", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.tblgen_build_5", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "InferTypeOpInterface" } ] }, { "name": "test.tblgen_build_6", "operands": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.tblgen_build_7", "attributes": [ { "name": "attr0", "type": "BoolAttr" } ] }, { "name": "test.tblgen_constant", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.tensor_based", "description": "A tensor based operation, that uses a tensor as an input and results in a\n tensor again.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "`in` `(` $input`:` type($input) `)` `->` type($result) attr-dict" }, { "name": "test.tensor_with_future_layout", "description": "A tensor operation that creates a new value and then forces a specific\n `TestMemRefLayoutAttr` layout during bufferization into a memref. In tensor\n world, this op does nothing encoding/layout wise.", "results": [ { "name": "output", "type": "Bufferization_TensorLikeTypeInterface" } ], "attributes": [ { "name": "layout", "type": "TestMemRefLayoutAttr" } ] }, { "name": "test.test_cost", "summary": "tfrt_test.test_cost", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "id", "type": "I64Attr" }, { "name": "_tfrt_cost", "type": "I64Attr" } ], "assemblyFormat": "$args attr-dict `:` type($args)", "hasCustomAssemblyFormat": true }, { "name": "test.test_effects_result", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "test.three_result", "results": [ { "name": "result1", "type": "I32" }, { "name": "result2", "type": "F32" }, { "name": "result3", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "test.tiling_no_dps_op", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "test.token.any_type", "operands": [ { "name": "value", "type": "AnyType" } ], "assemblyFormat": "$value attr-dict `:` type($value)" }, { "name": "test.token.consume", "operands": [ { "name": "token", "type": "Token" } ], "assemblyFormat": "$token attr-dict" }, { "name": "test.token.consume_without_trait", "operands": [ { "name": "token", "type": "Type>" } ], "assemblyFormat": "$token attr-dict `:` type($token)" }, { "name": "test.token.produce", "results": [ { "name": "token", "type": "Token" } ], "assemblyFormat": "attr-dict" }, { "name": "test.token.produce_without_trait", "results": [ { "name": "token", "type": "Type>" } ], "assemblyFormat": "attr-dict `:` type($token)" }, { "name": "test.token.region", "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "test.token.region_without_trait", "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "test.tracked_value", "operands": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$value `,` $name attr-dict `:` type($value)" }, { "name": "test.transparent_alias", "operands": [ { "name": "source", "type": "MemRefOf<[I32]>" } ], "results": [ { "name": "result", "type": "MemRefOf<[I32]>" } ], "assemblyFormat": "$source attr-dict `:` functional-type($source, $result)" }, { "name": "test.transparent_cast_alias", "operands": [ { "name": "source", "type": "MemRefOf<[I32, F32]>" } ], "results": [ { "name": "result", "type": "MemRefOf<[I32, F32]>" } ], "assemblyFormat": "$source attr-dict `:` functional-type($source, $result)" }, { "name": "test.transparent_dual_alias", "operands": [ { "name": "source", "type": "MemRefOf<[I32]>" } ], "results": [ { "name": "result_signed", "type": "MemRefOf<[SI32]>" }, { "name": "result_unsigned", "type": "MemRefOf<[UI32]>" } ], "assemblyFormat": "$source attr-dict `:` functional-type($source, results)" }, { "name": "test.tuple_32_bit", "results": [ { "name": "result", "type": "TupleOf<[I32, F32]>" } ] }, { "name": "test.two_result", "results": [ { "name": "result1", "type": "I32" }, { "name": "result2", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "test.two_to_one", "results": [ { "name": "result", "type": "AnyInteger" } ] }, { "name": "test.type_array_attr", "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "test.type_array_attr_with_default", "attributes": [ { "name": "attr", "type": "DefaultValuedAttr, {}>" } ] }, { "name": "test.type_attr_of", "attributes": [ { "name": "type", "type": "TypeAttrOf" } ], "assemblyFormat": "attr-dict $type" }, { "name": "test.type_changer", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.type_producer", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.typed_attr", "attributes": [ { "name": "type", "type": "TypeAttr" }, { "name": "attr", "type": "AnyAttr" } ], "assemblyFormat": "attr-dict $type `=` custom(ref($type), $attr)" }, { "name": "test.types_compat_yield", "operands": [ { "name": "args", "type": "Variadic" } ], "assemblyFormat": "($args^ `:` type($args))? attr-dict" }, { "name": "test.unreifiable_dim_of_result_shape", "description": "Test handling of case where some dimension of the result cannot be\n reified. This tests the path when `reifyDimOfResult` is implemented,\n and `reifyDimOfResult` with `reifyResultShapes` are implemented as a failure.\n\n Expected that dim 0 of `result` is reifable as dim 0 of `operand`, but\n dim 1 of `result` is not reifiable.", "operands": [ { "name": "operand", "type": "2DTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "2DTensorOf<[AnyType]>" } ] }, { "name": "test.unreifiable_result_shape", "description": "Test handling of case where some dimension of the result cannot be\n reified. This tests the path when `reifyShapeOfResult` is implemented,\n but not `reifyDimOfResult` with `reifyResultShapes` implemented as a failure.\n\n Expected that dim 0 of `result` is reifable as dim 0 of `operand`, but\n dim 1 of `result` is not reifiable.", "operands": [ { "name": "operand", "type": "2DTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "2DTensorOf<[AnyType]>" } ] }, { "name": "test.unreifiable_result_shapes", "description": "Test handling of case where some dimension of the result cannot be\n reified. This tests the path when `reifyResultShapes` is implemented.\n\n Expected that dim 0 of `result` is reifable as dim 0 of `operand`, but\n dim 1 of `result` is not reifiable.", "operands": [ { "name": "operand", "type": "2DTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "2DTensorOf<[AnyType]>" } ] }, { "name": "test.using_int_property_with_worse_bytecode", "attributes": [ { "name": "value", "type": "IntPropertyWithWorseBytecode" } ] }, { "name": "test.using_property_in_custom", "attributes": [ { "name": "prop", "type": "IntArrayProp" } ], "assemblyFormat": "custom($prop) attr-dict" }, { "name": "test.using_property_in_custom_and_other", "attributes": [ { "name": "prop", "type": "IntArrayProp" }, { "name": "other", "type": "I64Prop" } ], "assemblyFormat": "custom($prop) prop-dict attr-dict" }, { "name": "test.using_property_ref_in_custom", "attributes": [ { "name": "first", "type": "IntProp" }, { "name": "second", "type": "IntProp" } ], "assemblyFormat": "custom($first) `+` custom($second, ref($first)) attr-dict" }, { "name": "test.valid_producer", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "test.value_with_bounds", "description": "Creates a value with specified [min, max] range for value bounds analysis.\n\n Example:\n\n ```mlir\n %0 = test.value_with_bounds { min = 4 : index, max = 5 : index}\n ```", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "min", "type": "IndexAttr" }, { "name": "max", "type": "IndexAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "test.variadic_args_types_split", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "str", "type": "StrAttr" } ], "assemblyFormat": "$str (`,` $args^)? attr-dict (`:` type($args)^)?" }, { "name": "test.variadic_no_terminator_op", "regions": [ { "name": "my_regions", "type": "VariadicRegion>" } ], "assemblyFormat": "attr-dict `:` $my_regions" }, { "name": "test.variadic_region_inferred", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "bodies", "type": "VariadicRegion" } ], "traits": [ { "type": "InferTypeOpInterface" } ] }, { "name": "test.variadic_rewrite_dst_op", "operands": [ { "name": "brg", "type": "AnyType" }, { "name": "crg", "type": "Variadic" }, { "name": "arg", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.variadic_rewrite_src_op", "operands": [ { "name": "arg", "type": "Variadic" }, { "name": "brg", "type": "AnyType" }, { "name": "crg", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "test.variadic_segment_prop", "operands": [ { "name": "a1", "type": "Variadic" }, { "name": "a2", "type": "Variadic" } ], "results": [ { "name": "b1", "type": "Variadic" }, { "name": "b2", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$a1 `:` $a2 `:` type($b1) `:` type($b2) prop-dict attr-dict `end`" }, { "name": "test.variadic_with_same_operand_results", "results": [ { "name": "result", "type": "AnySignlessInteger" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "test.verifiers", "operands": [ { "name": "input", "type": "I32" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "test.versionedA", "attributes": [ { "name": "dims", "type": "AnyI64Attr" }, { "name": "modifier", "type": "BoolAttr" } ] }, { "name": "test.versionedB", "attributes": [ { "name": "attribute", "type": "TestAttrParams" } ] }, { "name": "test.versionedC", "attributes": [ { "name": "attribute", "type": "AnyAttrOf<[TestAttrParams, I32ElementsAttr]>" } ] }, { "name": "test.with_array_properties", "attributes": [ { "name": "ints", "type": "ArrayProp" }, { "name": "strings", "type": "ArrayProp" }, { "name": "nested", "type": "ArrayProp>" }, { "name": "opt", "type": "OptionalProp>" }, { "name": "explicitOptions", "type": "ArrayProp>" }, { "name": "explicitUnits", "type": "ArrayProp" }, { "name": "hasDefault", "type": "DefaultValuedProp, ::llvm::ArrayRef{}, ::llvm::SmallVector{}>" } ], "assemblyFormat": "`ints` `=` $ints\n `strings` `=` $strings\n `nested` `=` $nested\n `opt` `=` $opt\n `explicitOptions` `=` $explicitOptions\n `explicitUnits` `=` $explicitUnits\n ($hasDefault^ `thats_has_default`)?\n attr-dict" }, { "name": "test.with_bounds", "description": "Creates a value with specified [min, max] range for integer range analysis.\n\n Example:\n\n ```mlir\n %0 = test.with_bounds { umin = 4 : index, umax = 5 : index, smin = 4 : index, smax = 5 : index } : index\n ```", "results": [ { "name": "fakeVal", "type": "InferIntRangeType" } ], "attributes": [ { "name": "umin", "type": "APIntAttr" }, { "name": "umax", "type": "APIntAttr" }, { "name": "smin", "type": "APIntAttr" }, { "name": "smax", "type": "APIntAttr" } ], "assemblyFormat": "attr-dict `:` type($fakeVal)" }, { "name": "test.with_bounds_region", "attributes": [ { "name": "umin", "type": "APIntAttr" }, { "name": "umax", "type": "APIntAttr" }, { "name": "smin", "type": "APIntAttr" }, { "name": "smax", "type": "APIntAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "test.with_default_valued_properties", "attributes": [ { "name": "a", "type": "DefaultValuedAttr" }, { "name": "b", "type": "DefaultValuedProp" }, { "name": "c", "type": "DefaultValuedProp, -1>" }, { "name": "unit", "type": "UnitProp" } ], "assemblyFormat": "($a^) : (`na`)?\n ($b^)?\n ($c^)?\n ($unit^)?\n attr-dict" }, { "name": "test.with_nice_properties", "attributes": [ { "name": "prop", "type": "PropertiesWithCustomPrint" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.with_optional_properties", "attributes": [ { "name": "anAttr", "type": "OptionalAttr" }, { "name": "simple", "type": "OptionalProp" }, { "name": "simplei8", "type": "OptionalProp>" }, { "name": "simpleui8", "type": "OptionalProp>" }, { "name": "nonTrivialStorage", "type": "OptionalProp" }, { "name": "hasDefault", "type": "OptionalProp>" }, { "name": "nested", "type": "OptionalProp>" }, { "name": "longSyntax", "type": "OptionalProp" }, { "name": "hasUnit", "type": "UnitProp" }, { "name": "maybeUnit", "type": "OptionalProp" } ], "assemblyFormat": "(`anAttr` `=` $anAttr^)?\n (`simple` `=` $simple^)?\n (`simplei8` `=` $simplei8^)?\n (`simpleui8` `=` $simpleui8^)?\n (`nonTrivialStorage` `=` $nonTrivialStorage^)?\n (`hasDefault` `=` $hasDefault^)?\n (`nested` `=` $nested^)?\n (`longSyntax` `=` $longSyntax^)?\n (`hasUnit` $hasUnit^)?\n (`maybeUnit` `=` $maybeUnit^)?\n attr-dict" }, { "name": "test.with_properties", "attributes": [ { "name": "a", "type": "I64Prop" }, { "name": "b", "type": "StrAttr" }, { "name": "c", "type": "StringProp" }, { "name": "flag", "type": "BoolProp" }, { "name": "array", "type": "IntArrayProp" }, { "name": "array32", "type": "IntArrayProp" } ], "assemblyFormat": "`a` `=` $a `,`\n `b` `=` $b `,`\n `c` `=` $c `,`\n `flag` `=` $flag `,`\n `array` `=` $array `,`\n `array32` `=` $array32 attr-dict" }, { "name": "test.with_properties_and_attr", "attributes": [ { "name": "lhs", "type": "I32Attr" }, { "name": "rhs", "type": "IntProp" } ], "assemblyFormat": "$lhs prop-dict attr-dict" }, { "name": "test.with_properties_and_inferred_type", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "lhs", "type": "I32Attr" }, { "name": "rhs", "type": "IntProp" }, { "name": "packed", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs prop-dict attr-dict" }, { "name": "test.with_versioned_properties", "attributes": [ { "name": "prop", "type": "VersionedProperties" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.with_wrapped_properties", "attributes": [ { "name": "prop", "type": "MyStructProperty" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.with_wrapped_properties2", "attributes": [ { "name": "prop", "type": "MyStructProperty2" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "test.without_bounds", "description": "Creates a value with uninitialized range for integer range analysis tests.\n\n Example:\n\n ```mlir\n %0 = test.without_bounds : index\n ```", "results": [ { "name": "result", "type": "InferIntRangeType" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "test.wrapping_region", "summary": "wrapping region operation", "description": "Test op wrapping another op in a region, to test calling\n parseGenericOperation from the custom parser.", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_device.cluster", "summary": "The `tf_device.cluster` op wraps containing operations in a region.", "description": "This op can be used to group operations, and captures all needed live-in values.\n\nOptional policy attribute allows to tag clusters with a policy name that was\nused to form the cluster.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "policy", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tf_device.cluster_func", "summary": "The `tf_device.cluster_func` launches a function containing the body of a\ncluster.", "description": "This op is used for outlining a cluster.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "func", "type": "FlatSymbolRefAttr" } ] }, { "name": "tf_device.launch", "summary": "The `tf_device.launch` op launches containing operations on target device.", "description": "This op captures all needed live-in values.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tf_device.launch_func", "summary": "The `tf_device.launch_func` launches a function on target device.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "func", "type": "FlatSymbolRefAttr" } ] }, { "name": "tf_device.parallel_execute", "description": "ParallelExecute op concurrently executes variadic number of regions. Regions\n must represent separate sets of instructions to execute concurrently. In\n order to represent concurrently executed regions with dependencies, multiple\n ParallelExecute ops can be used instead. As so, regions within\n ParallelExecute op must not have control/data dependencies.\n\n While explicit dependencies between regions are disallowed, ParallelExecute\n op does not prevent implicit communication between regions (e.g.\n communication via send/recvs). In this case, users of ParallelExecute op\n must provide correct control dependencies between regions to guarantee\n correctness. Regions in ParallelExecute may include Resource ops.\n\n In the case where different regions include ops access the same resource,\n the users of the ParallelExecute op must provide mechanism (via send/recvs\n or via control dependencies) to guarantee correct ordering. Sequential\n ordering of ops within a region is guaranteed. Also, sequential ordering of\n ops before/after ParallelExecute ops are guaranteed. That is, execution of\n regions inside ParallelExecute op is blocked until all inputs to all regions\n are materialized and ops following ParallelExecute op are blocked until all\n regions are executed.", "results": [ { "name": "execute_outputs", "type": "Variadic" } ], "regions": [ { "name": "regions", "type": "VariadicRegion>" } ] }, { "name": "tf_device.receive", "summary": "Rceive a value from a host.", "description": "Receive a value from the given host with the given rendezvous key.", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "src_host", "type": "StrAttr" } ], "assemblyFormat": "$key $src_host attr-dict `:` type($result)" }, { "name": "tf_device.remote_run", "summary": "The `tf_device.remote_run` op launches the containing operations on a specific\nhost.", "description": "This op captures all needed live-in values.", "operands": [ { "name": "callee_args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "host", "type": "StrAttr" }, { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$host $callee `(` $callee_args `)` attr-dict `:` functional-type ( $callee_args , $results )" }, { "name": "tf_device.replicate", "summary": "Wraps an N-way replicated computation.", "description": "The region held by this operation represents a computation that is replicated\nacross multiple devices. The number of replications is based on the `n`\nattribute. Explicit devices can be populated in the `devices` attribute, and it\nmust be a mapping of device alias to list of explicit or aliased device names\nfrom the outer scope. The device name map specifies devices on which replicated\nops inside tf_device.replicate will be executed.\n\nA tf_device.parallel_execute inside the tf_device.replicate op region may be\nused to represent computations across a larger set of devices. In that case, the\ndevice alias can be used to specify device assignment and replication of each\nconcurrent execution (i.e. region) defined by tf_device.parallel_execute op.\nThe size of each value list in the device name map must match `n`. Within a\nreplica, the execution semantics follow standard sequential behavior. Ops in the\ntf_device.replicate wrapped with a tf_device.launch will have its device set to\nthe associated replicated device from `devices` if the tf_device.launch refers\nto an aliased device name. Otherwise the device already set in tf_device.launch\nis used instead.\n\nOperands are replicated inputs and packed inputs.\n\nreplicated_inputs: each group of `n` inputs corresponds to an input for a single\nindividual replica and is mapped to a single region argument. Inside one group\nthe operands are matching in order the `devices` attribute. Each replicated\ninput must have compatible shapes and types.\npacked_inputs: each input corresponds to an input broadcasted across all\nreplicas and is mapped to a single region argument.\n\nOperands not replicated can be implicitly captured by ops in the region. Results\nare replicated each from the regions terminator.\n\nFor example:\n```\n%0 = \"tf.opA\"() : () -> tensor\n%1 = \"tf.opB\"() : () -> tensor\n%2 = \"tf.opC\"() : () -> tensor\n%3 = \"tf.opD\"() : () -> tensor\n%4 = \"tf.opE\"() : () -> tensor\n%5 = \"tf.opF\"() : () -> tensor\n%6 = \"tf.opG\"() : () -> tensor\n%7 = \"tf.opH\"() : () -> tensor\n%8 = \"tf.opI\"() : () -> tensor\n%9 = \"tf.opJ\"() : () -> tensor\n%output:8 = tf_device.replicate([%0, %1] as %input_0: tensor,\n [%2, %3] as %input_1: tensor,\n [%4, %5] as %input_2: tensor,\n [%6, %7] as %input_3: tensor,\n %8 as %input_4: tensor)\n {n = 2 : i32,\n devices = {DEVICE_ALIAS_0 = [\"/DEVICE:0\", \"/DEVICE:1\"],\n DEVICE_ALIAS_1 = [\"/DEVICE:2\", \"/DEVICE:3\"]}} {\n // Inside the region, %0, %2, %4, and %6 corresponds to\n // \"/DEVICE:0\"/\"/DEVICE:2\" and %1, %3, %5, and %7 corresponds to\n // \"/DEVICE:1\"/\"/DEVICE:3\", depending on which device alias is used.\n %k = \"tf_device.launch\"() ( {\n %9 = \"tf.opK\"(%input_0, %input_4, %9) :\n (tensor, tensor, tensor) -> tensor\n tf_device.return %9 : tensor\n }) {device = \"DEVICE_ALIAS_0\"} : () -> tensor\n %l = \"tf_device.launch\"() ( {\n %10 = \"tf.opL\"(%input_1, %input_4, %9) :\n (tensor, tensor, tensor) -> tensor\n tf_device.return %10 : tensor\n }) {device = \"DEVICE_ALIAS_1\"} : () -> tensor\n %m = \"tf_device.launch\"() ( {\n %11 = \"tf.opM\"(%input_2, %input_4, %9) :\n (tensor, tensor, tensor)\n -> tensor\n tf_device.return %11 : tensor\n }) {device = \"/DEVICE:4\"} : () -> tensor\n %n = \"tf.opN\"(%input_3, %input_4, %9) :\n (tensor, tensor, tensor)\n -> tensor\n tf_device.return %k, %l, %m, %n :\n tensor, tensor, tensor, tensor\n}\n// %output#0 corresponds to %k returned from \"/DEVICE:0\"\n// %output#1 corresponds to %k returned from \"/DEVICE:1\"\n// %output#2 corresponds to %l returned from \"/DEVICE:2\"\n// %output#3 corresponds to %l returned from \"/DEVICE:3\"\n// %output#4, %output#5 corresponds to %m and will be returned from \"/DEVICE:4\"\n// %output#6, %output#7 corresponds to %n and will have no device set\n```", "operands": [ { "name": "replicated_inputs", "type": "Variadic" }, { "name": "packed_inputs", "type": "Variadic" } ], "results": [ { "name": "replicated_outputs", "type": "Variadic" } ], "attributes": [ { "name": "n", "type": "ConfinedAttr]>" }, { "name": "devices", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_device.return", "summary": "The `tf_device.return` operation terminates and returns values from a\n`tf_device` dialect operation.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "tf_device.send", "summary": "Send a value to a host.", "description": "Send the value to the given host with the given rendezvous key.", "operands": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "dst_host", "type": "StrAttr" } ], "assemblyFormat": "$value $key $dst_host attr-dict `:` type($value)" }, { "name": "tf_executor._SwitchN", "summary": "The \"tf_executor._SwitchN\" operation takes two inputs, `data` and `index`\n and an integer attribute `num_outs` indicating the number of outputs. The\n `data` input is copied to output indicated by the `index` input. The other\n outputs are marked as dead. If one of the inputs or a control token is\n dead, then all of the outputs are marked as dead as well.", "description": "This is defined in TensorFlow as:\n\n REGISTER_OP(\"_SwitchN\")\n .Input(\"data: T\")\n .Input(\"output_index: int32\")\n .Output(\"outputs: num_outs * T\")\n .Attr(\"num_outs: int >= 1\")\n .Attr(\"T: type\")\n .SetShapeFn(SwitchNShape);\n\n For example:\n %2:6 = tf_executor.SwitchN %0, %1 of 5 : tensor\n\n Note: One additional result corresponds to the control output.", "operands": [ { "name": "data", "type": "AnyType" }, { "name": "index", "type": "TensorOf<[I32]>" }, { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control", "type": "TfeControlType" } ], "attributes": [ { "name": "num_outs", "type": "I64Attr" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.ControlTrigger", "summary": "The `tf_executor.ControlTrigger` operation is similar to a no-op except that\n it always produces a valid output even when inputs are dead.", "description": "Its primary use so far is in the scheduling of recvs, where we add\n ControlTrigger nodes and use them to trigger recvs. We allow ControlTrigger\n nodes to be enabled by dead nodes.", "operands": [ { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "control", "type": "TfeControlType" } ], "assemblyFormat": "$controlInputs attr-dict" }, { "name": "tf_executor.Enter", "summary": "The \"tf_executor.Enter\" operation forwards its input to Tensorflow while\n loop.", "description": "More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n Each tensor needs its own tf_executor.Enter to be made available inside a\n while loop.\n\n This is defined in Tensorflow as:\n\n REGISTER_OP(\"Enter\")\n .Input(\"data: T\")\n .Output(\"output: T\")\n .Attr(\"T: type\")\n .Attr(\"frame_name: string\")\n .Attr(\"is_constant: bool = false\")\n .Attr(\"parallel_iterations: int = 10\")\n\n For example:\n %res:2 = tf_executor.Enter %arg0 frame \"some/frame\" parallel_iterations 42 constant : tensor<*xf32>\n\n Note: Additional result corresponds to the control output.", "operands": [ { "name": "data", "type": "AnyType" }, { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyType" }, { "name": "control", "type": "TfeControlType" } ], "attributes": [ { "name": "frame_name", "type": "StrAttr" }, { "name": "is_constant", "type": "DefaultValuedOptionalAttr" }, { "name": "parallel_iterations", "type": "DefaultValuedOptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.Exit", "summary": "The \"tf_executor.Exit\" operation forwards a value from an while loop to its\n consumer outside of loop. Each returned tensor needs its own\n tf_executor.Exit.", "description": "More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n This is defined in Tensorflow as:\n\n REGISTER_OP(\"Exit\")\n .Input(\"data: T\")\n .Output(\"output: T\")\n .Attr(\"T: type\")\n\n For example:\n %1:2 = tf_executor.Exit %0#0 : tensor<*xi32> {T: \"tfdtype$DT_INT32\"}\n\n Note: Additional result corresponds to the control output.", "operands": [ { "name": "data", "type": "AnyType" }, { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyType" }, { "name": "control", "type": "TfeControlType" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.fetch", "summary": "The `tf_executor.fetch` operation terminates the graph and returns values;", "description": "The non-control operands of the fetch operation are returned outside of the\n graph and must match the return type of the graph.", "operands": [ { "name": "fetches", "type": "Variadic" } ], "assemblyFormat": "($fetches^ `:` type($fetches))? attr-dict" }, { "name": "tf_executor.graph", "summary": "The `tf_executor.graph` operation contains a region with a\n single block that lists the operations in a TensorFlow graph.", "description": "The operations are topologically sorted in-order (no cycles are allowed in\n the values). The execution model for operations in this block follows the\n TensorFlow executor semantics:\n 1. Operations that don’t have any transitive dependencies through the\n def/use chains may be executed in parallel\n (`tf_executor.NextIteration.Source` is the exception).\n 2. SSA values in this block can be implicitly dead. This means that every\n SSA value defined in a `tf_executor.graph` can be considered implicitly\n wrapped in a conceptual `dead_or` structure, and includes a runtime\n flag indicating if the value is dead or present.\n 3. Operations may have special case handling of dead values.\n\n The `tf_executor.graph` op only allows specific `tf_executor` dialect\n operations in its body: the `tf_executor.graph` verifier will reject any\n unknown operation. In order to execute standard `tf` dialect operations\n (like `tf.Add`) they must be wrapped in the `tf_executor.island` operation.\n\n The `tf_executor.graph` operation does not accept any operands, inputs are\n implicitly captured by the region, representing the feeds to the graph.\n\n The region attached to `tf_executor.graph` is terminated by a\n `tf_executor.fetch` operation. The operands of the terminator correspond to\n the result values (or fetches) of the `tf_executor.graph` operation. The\n behavior is undefined if any of the operands of the `tf_executor.fetch` is\n dead.", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.island", "summary": "The `tf_executor.island` operation is a wrapper for operations in other\n dialects to be nested in a `tf_executor.graph`.", "description": "The `tf_executor.graph` operation does not allow `tf` dialect operations to\n be immediately nested underneath it. The `tf_executor.island` is introduced\n as a wrapper for `tf` dialect operations: this results in a more consistent\n representation which makes analysis and transformation simpler.\n The `tf_executor.island` operation has a single region with a single block\n attached (only functional control flow is allowed). The block is terminated\n by a `tf_executor.yield` operation. The operands of the terminator\n correspond to the result values of the `tf_executor.island` operation. An\n extra result of type `!tf_executor.control` is always produced by every\n `tf_executor.island`.\n Within an island, execution semantics follow standard sequential behavior as\n expected by TF2 and by compiler analyses and transformations, and values\n can’t be dead. Other nested `tf_executor.graph` operations can be present in\n the region to re-enable the TensorFlow executor for a subsection of the\n code.\n - Initially the functional control flow operations are calling functions\n involving graphs, if `tf_executor.graph` weren’t allowed in an island,\n these operations would need to have an equivalent in the `tf_executor`\n dialect to be modelled in a graph.\n - Nesting also allows forming islands without involving inter-procedural\n analyses: any function call may involve a callee with a graph.\n The `tf_executor.island` region allows implicit capture. If any value\n captured by a `tf_executor.island` is dead, the whole region does not\n execute and every produced value is marked as dead as well.\n An arbitrary number of `tf_executor.control` operands are accepted by a\n `tf_executor.island` operation.\n If any operand or implicitly captured value are dead, the region is not\n executed and dead values are immediately returned for every result.", "operands": [ { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control", "type": "TfeControlType" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.LoopCond", "summary": "The \"tf_executor.LoopCond\" operation forwards a boolean value as loop\n condition of Tensorflow while loops.", "description": "More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n This is defined in Tensorflow as:\n\n REGISTER_OP(\"LoopCond\")\n .Input(\"input: bool\")\n .Output(\"output: bool\")\n\n For example:\n %5:2 = tf_executor.LoopCond %4#0 {name: \"while/LoopCond\"}\n\n Note: Additional result corresponds to the control output.", "operands": [ { "name": "input", "type": "TensorOf<[I1]>" }, { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TensorOf<[I1]>" }, { "name": "control", "type": "TfeControlType" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.Merge", "summary": "The \"tf_executor.Merge\" operation takes a list of input operands and returns\n a value of the operand type along with the index of the first match encountered.", "description": "More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n This is defined in TensorFlow as:\n\n REGISTER_OP(\"Merge\")\n .Input(\"inputs: N * T\")\n .Output(\"output: T\")\n .Output(\"value_index: int32\")\n\n For example:\n %2 = tf_executor.Merge %0, %1, %2, %3 : tensor<*xf32>\n\n Note: Additional result corresponds to the control output.", "operands": [ { "name": "inputs_and_control", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "value_index", "type": "TensorOf<[I32]>" }, { "name": "control", "type": "TfeControlType" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.NextIteration.Sink", "summary": "The \"tf_executor.NextIteration.Sink\" is paired with a\n \"tf_executor.NextIteration.source\" to represent NextIteration op in\n Tensorflow.", "description": "Tensorflow NextIteration operation forwards its input to the next iteration\n of a while loop. Each loop variable needs its own NextIteration op.\n\n More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n In the TF executor dialect, the NextIteration op is broken into\n tf_executor.NextIteration.sink and tf_executor.NextIteration.source because\n NextIteration is a back-edge in Tensorflow graph, which would form a data\n flow cycle if expressed naively in a basic block.\n tf_executor.NextIteration.source takes no input but returns results while\n tf_executor.NextIteration.sink takes input but doesn't return anything. When\n optimizing these ops, they are paired by token and considered as a single\n op.\n\n This is defined in Tensorflow as:\n\n REGISTER_OP(\"NextIteration\")\n .Input(\"data: T\")\n .Output(\"output: T\")\n .Attr(\"T: type\")\n\n For example:\n %value, %token, %ctl = tf_executor.NextIteration.Source : tensor<*xi32>\n tf_executor.NextIteration.sink [%token] (%value) : tensor<*xi32>\n\n Note: Additional result corresponds to the control output.", "operands": [ { "name": "token", "type": "TfeTokenType" }, { "name": "input", "type": "AnyType" }, { "name": "controlInputs", "type": "Variadic" } ], "assemblyFormat": "`[` $token `]` $input (`,` $controlInputs^)? `:` type($input) attr-dict" }, { "name": "tf_executor.NextIteration.Source", "summary": "The \"tf_executor.NextIteration.Source\" is paired with a\n \"tf_executor.NextIteration.sink\" to represent NextIteration op in\n Tensorflow.", "description": "Tensorflow NextIteration operation forwards its input to the next iteration\n of a while loop. Each loop variable needs its own NextIteration op.\n\n More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n In the TF executor dialect, the NextIteration op is broken into\n tf_executor.NextIteration.sink and tf_executor.NextIteration.source because\n NextIteration is a back-edge in Tensorflow graph, which would form a data\n flow cycle if expressed naively in a basic block.\n tf_executor.NextIteration.source takes no input but returns results while\n tf_executor.NextIteration.sink takes input but doesn't return anything. When\n optimizing these ops, they are paired by token and considered as a single\n op.\n\n This is defined in Tensorflow as:\n\n REGISTER_OP(\"NextIteration\")\n .Input(\"data: T\")\n .Output(\"output: T\")\n .Attr(\"T: type\")\n\n For example:\n %value, %token, %ctl = tf_executor.NextIteration.Source : tensor<*xi32>\n tf_executor.NextIteration.sink [%token] (%value) : tensor<*xi32>\n\n Note: Additional result corresponds to the control output.", "results": [ { "name": "output", "type": "AnyType" }, { "name": "token", "type": "TfeTokenType" }, { "name": "control", "type": "TfeControlType" } ], "assemblyFormat": "`:` type($output) attr-dict" }, { "name": "tf_executor.Switch", "summary": "The \"tf_executor.Switch\" operation takes a data operand and a boolean\n predicate condition, and returns two values matching the type of the data\n predicate.", "description": "More details can be found in Tensorflow Control Flow white paper:\n https://storage.googleapis.com/download.tensorflow.org/paper/white_paper_tf_control_flow_implementation_2017_11_1.pdf\n\n This is defined in TensorFlow as:\n\n REGISTER_OP(\"Switch\")\n .Input(\"data: T\")\n .Input(\"pred: bool\")\n .Output(\"output_false: T\")\n .Output(\"output_true: T\")\n\n For example:\n %2 = tf_executor.Switch %0, %1 : tensor<*xf32>\n\n Note: Additional result corresponds to the control output.", "operands": [ { "name": "data", "type": "AnyType" }, { "name": "predicate", "type": "TensorOf<[I1]>" }, { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "falseOutput", "type": "AnyType" }, { "name": "trueOutput", "type": "AnyType" }, { "name": "control", "type": "TfeControlType" } ], "hasCustomAssemblyFormat": true }, { "name": "tf_executor.yield", "summary": "The `tf_executor.yield` operation terminates and returns values for the\n `tf_executor.island` operation.", "operands": [ { "name": "fetches", "type": "Variadic" } ], "assemblyFormat": "($fetches^ `:` type($fetches))? attr-dict" }, { "name": "tf_framework.alloc", "summary": "allocation of tensors that uses TF Framework", "description": "Allocation of tensors during kernel execution in the Compute method.\n\n This should be used to allocate any temporary or output memref. If\n `output_index` and `input_indices` are given, attempts to forward one of\n the input tensors to the output by calling `OpKernelContext::forward_input`.\n\n If the attributes are missing or the forwarding fails, calls\n `Allocator::AllocateRaw` in tensorflow/core/framework/allocator.h.", "operands": [ { "name": "ctx", "type": "TFFramework_OpKernelContextType" }, { "name": "dyn_sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "attributes": [ { "name": "input_indices", "type": "OptionalAttr>" }, { "name": "output_index", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $ctx (`,` $dyn_sizes^ )? `)` attr-dict `:` type($result)" }, { "name": "tf_framework.assert", "summary": "Assert operation with message attribute and error code", "description": "Assert operation that propagates the error message to TF Framework.", "operands": [ { "name": "ctx", "type": "TFFramework_OpKernelContextType" }, { "name": "arg", "type": "I1" } ], "attributes": [ { "name": "error_code", "type": "TFFramework_ErrorCodeAttr{OK|CANCELLED|UNKNOWN|INVALID_ARGUMENT|DEADLINE_EXCEEDED|NOT_FOUND|ALREADY_EXISTS|PERMISSION_DENIED|UNAUTHENTICATED|RESOURCE_EXHAUSTED|FAILED_PRECONDITION|ABORTED|OUT_OF_RANGE|UNIMPLEMENTED|INTERNAL|UNAVAILABLE|DATA_LOSS}" }, { "name": "msg", "type": "StrAttr" } ], "assemblyFormat": "$ctx `,` $arg `,` $error_code `,` $msg attr-dict" }, { "name": "tf_framework.dealloc", "summary": "deallocation of tensors that uses TF Framework", "description": "Deallocation of tensors during kernel execution in the Compute method.\n\n This should be used to deallocate any temporary memref that was allocated\n with `tf_framework.alloc`.\n Corresponds to `Allocator::DeallocateRaw` in\n tensorflow/core/framework/allocator.h.", "operands": [ { "name": "ctx", "type": "TFFramework_OpKernelContextType" }, { "name": "memref", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "`(` $ctx `,` $memref `)` attr-dict `:` type($memref)" }, { "name": "tf_framework.is_valid_memref", "summary": "Op to check if the memref is valid.", "description": "The op checks if the allocation was successful so that the underlying ptr\n in the descriptor is not equal to NULL. Also, we check if the number of\n elements is not zero to support empty shapes inputs correctly.\n\n is_valid_memref(memref) = ptr(memref) != NULL || num_elements(memref) == 0", "operands": [ { "name": "arg", "type": "AnyMemRef" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $arg `)` attr-dict `:` type($arg) `->` type($result)" }, { "name": "tf_framework.jit_compile", "summary": "Invokes JIT compilation through the TF framework", "description": "The op takes an optional TF context, so that it can be added at a later\n stage in the compilation pipeline. The op's body corresponds to a function\n body and the corresponding `tf_framework.jit_compile_yield` represents the\n result value(s).", "operands": [ { "name": "ctx", "type": "Optional" } ], "results": [ { "name": "result", "type": "TFFramework_JITCallableType" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$ctx $body attr-dict" }, { "name": "tf_framework.jit_compile_from_str", "summary": "Invokes JIT compilation through the TF framework", "description": "This operation is similar to `tf_framework.jit_compile`. Instead of a body,\n the to-be-compiled function is represented as a string attribute. The string\n shall be the serialized form of a module with a single function named\n `main`.", "operands": [ { "name": "ctx", "type": "Optional" } ], "results": [ { "name": "result", "type": "TFFramework_JITCallableType" } ], "attributes": [ { "name": "code", "type": "StrAttr" }, { "name": "tileSizes", "type": "TypedArrayAttrBase" }, { "name": "unrollFactors", "type": "TypedArrayAttrBase" }, { "name": "enableFtz", "type": "BoolAttr" }, { "name": "index64Bit", "type": "BoolAttr" }, { "name": "cpuCodegen", "type": "BoolAttr" } ], "assemblyFormat": "($ctx^ `,`)? $code attr-dict" }, { "name": "tf_framework.jit_compile_yield", "summary": "Yields the results in a `tf_framework.jit_compile` op's body", "description": "See `tf_framework.jit_compile`.", "operands": [ { "name": "result", "type": "AnyTypeOf<[AnyRankedOrUnrankedMemRef, AnyTensor]>" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "tf_framework.jit_execute", "summary": "Executes a JIT-compiled function through the TF framework", "description": "The op takes an optional TF context, so that it can be added at a later\n stage in the compilation pipeline. The callable must be a JIT-compiled\n function that is the result of either `tf_framework.jit_compile` or\n `tf_framework.jit_compile_from_str`. The remaining operands must be tensor\n or memref arguments and will be forwarded to the callable function. The\n result types must match those of the callable function. Otherwise, the\n execution behavior is undefined.", "operands": [ { "name": "ctx", "type": "Optional" }, { "name": "callable", "type": "TFFramework_JITCallableType" }, { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[ AnyRankedOrUnrankedMemRef, AnyTensor ]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`ctx` `(` $ctx^ `)`)? $callable `(` $inputs `)` attr-dict\n `:` type($inputs) `->` type($result)" }, { "name": "tf_framework.null_context", "summary": "Creates a fake TF context that will be lowered to nullptr", "description": "Needed for testing", "results": [ { "name": "result", "type": "TFFramework_OpKernelContextType" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "tf_framework.null_memref", "summary": "Op to construct unranked memref with 0-rank", "description": "The op is needed to construct a throw-away result after error reporting\n happened. It constructs a ranked memref descriptor with 0-rank and\n {NULL, NULL, 0} underlying ranked descriptor of type memref.\n In ranked case it constructs a ranked memref descriptor depending on the\n result type, but sets both allocated and aligned pointers to NULL.", "results": [ { "name": "result", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "tf_framework.report_error", "summary": "Operation that propagates error message to TF Framework", "description": "Error reporting operation that corresponds to\n `OpKernelContext::CtxFailureWithWarning`.", "operands": [ { "name": "ctx", "type": "TFFramework_OpKernelContextType" } ], "attributes": [ { "name": "error_code", "type": "TFFramework_ErrorCodeAttr{OK|CANCELLED|UNKNOWN|INVALID_ARGUMENT|DEADLINE_EXCEEDED|NOT_FOUND|ALREADY_EXISTS|PERMISSION_DENIED|UNAUTHENTICATED|RESOURCE_EXHAUSTED|FAILED_PRECONDITION|ABORTED|OUT_OF_RANGE|UNIMPLEMENTED|INTERNAL|UNAVAILABLE|DATA_LOSS}" }, { "name": "msg", "type": "StrAttr" } ], "assemblyFormat": "$ctx `,` $error_code `,` $msg attr-dict" }, { "name": "tf_mlrt.allocate_futures", "summary": "Allocate futures and promsies for tensorflow tensors", "description": "Allocate futures and promsies for tensorflow tensors.\n\n $num_futures: The number of futures to be allocated.\n\n $promises: There are $num_futures promises. promises[i] shares the state with futures[i].\n $futures: There are $num_futures futures. futures[i] shares the state with promises[i].", "results": [ { "name": "promises", "type": "Variadic" }, { "name": "futures", "type": "Variadic" } ], "attributes": [ { "name": "num_futures", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "tf_mlrt.async_executeop", "summary": "The Fallback ExecuteOp for tensorflow::AsyncOpKernel", "description": "The ExecuteOp executes an operation on the specified device asynchronously.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.async_executeop.device", "summary": "The Fallback ExecuteOp for tensorflow::AsyncOpKernel", "description": "The ExecuteOp executes an operation on the specified device asynchronously.", "operands": [ { "name": "device", "type": "TFDeviceType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $device`)` `(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.async_ifrt_call", "summary": "IFRT execution op for mlrt", "description": "This op executes an IFRT program asynchronously.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "program_id", "type": "I64Attr" }, { "name": "variable_arg_indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.async_while", "summary": "Asynchronously execution of while op for tf_mlrt", "description": "cond: The boolean to control whether the first iteration should be executed.\n arguments: the last $immutable_size elements are invariants between iterations.\n results: a list of futures.\n body_fn: its input are [predicate_promise, arg0_future, arg0_promise, arg1_future, arg1_promise, ..., invariant_args] and has no returned results.", "operands": [ { "name": "cond", "type": "TFTensorType" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "body_fn", "type": "FlatSymbolRefAttr" }, { "name": "invariant_size", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$body_fn `(` $cond `,` $arguments `)` attr-dict `:` `(` type($cond) `,` type($arguments) `)` `->` `(` type(results) `)`" }, { "name": "tf_mlrt.await", "summary": "Await a tensor from a !mlrt.future", "description": "Await a tensor from a !mlrt.future.\n\n $future: A value of type !mlrt.future. The underlying value must be a tensorflow tensor.\n\n $result: a tensorflow tensor.", "operands": [ { "name": "future", "type": "MlrtFutureType" } ], "results": [ { "name": "result", "type": "TFTensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_mlrt.await_all", "summary": "Await tensors from a list of !mlrt.future", "description": "Await tensors from a list of !mlrt.future.\n\n $futures: A list of !mlrt.future. The underlying value must be tensorflow tensors.\n\n $results: A list of tensorflow tensors.", "operands": [ { "name": "futures", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$futures attr-dict `:` type($results)" }, { "name": "tf_mlrt.batch_function", "summary": "Fallback ExecuteOp specialized for tf.BatchFunction.", "description": "This kernel executes a variant tf.BatchFunction kernel that supports having\n the `f` attribute as a bytecode function.\n\n Example:\n %res = tf_mlrt.batch_function(%input, %captured_input) {\n device = \"/device:CPU:0\",\n f = @batch_function,\n node_def = \"...\"\n } : (!tf_mlrt.tensor,!tf_mlrt.tensor) -> (!tf_mlrt.tensor)\n\n Note that the trailing number indicates the number of results.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "f", "type": "SymbolRefAttr" }, { "name": "node_def", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.batch_function.device", "summary": "Fallback ExecuteOp specialized for tf.BatchFunction with custom device.", "description": "This kernel executes a variant tf.BatchFunction kernel that supports having\n the `f` attribute as a bytecode function with a custom device.\n\n Example:\n %res = tf_mlrt.batch_function.device(%custom_device, %input, %captured_input) {\n device = \"/device:CPU:0\",\n f = @batch_function,\n node_def = \"...\"\n } : (!tf_mlrt.tensor,!tf_mlrt.tensor) -> (!tf_mlrt.tensor)\n\n Note that the trailing number indicates the number of results.\n Also note that the custom device argument is not the same as the device attribute. \n The latter is just the name in which the enclosure graph is executed.", "operands": [ { "name": "custom_device", "type": "TFDeviceType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "f", "type": "SymbolRefAttr" }, { "name": "node_def", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $custom_device`)` `(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.bool_to_tensor", "summary": "Cast a boolean to a tensor.", "description": "Cast a boolean to a tensor.\n\n Example:\n %one = tf_mlrt.bool_to_tensor %src_bool", "operands": [ { "name": "src", "type": "I1" } ], "results": [ { "name": "result", "type": "TFTensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_mlrt.cancel", "summary": "Handle cancellation request.", "description": "This kernel will early terminate the program upon cancellation request (e.g. time out).", "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "tf_mlrt.constop", "summary": "The tf_mlrt ConstOp", "description": "The ConstOp creates a constant tensorflow::Tensor from serialized proto.", "results": [ { "name": "result", "type": "TFTensorType" } ], "attributes": [ { "name": "tensor_proto", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict" }, { "name": "tf_mlrt.createop", "summary": "The Fallback CreateOp", "description": "The CreateOp creates the tensorflow::OpKernel in the fallback context.", "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict" }, { "name": "tf_mlrt.executeop", "summary": "The Fallback ExecuteOp", "description": "The ExecuteOp executes an operation on the specified device.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.executeop.device", "summary": "The Fallback ExecuteOp with custom device", "description": "The ExecuteOp executes an operation on the specified device using a custom device.", "operands": [ { "name": "device", "type": "TFDeviceType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(` $device`)` `(` $args `)` attr-dict `:` functional-type($args, $results)" }, { "name": "tf_mlrt.get_resource", "summary": "get a tensor in resource array", "description": "Get a tensor in resource array.\n\n indices: the indices in the resource array.\n results: the tensor values for the corresponding indices.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict `:` type($results)" }, { "name": "tf_mlrt.ifrt_load_variable", "summary": "Loads a variable tensor as an IFRT array for mlrt", "description": "This op loads a restored variable tensor as a tensor future. It is a\n replacement of `tf.ReadVariableOp`.\n\n This op returns a scalar string tensor containing the restored variable name, which can be\n used as a key within the runtime, as well as a future for the tensor.\n\n The `tf.IfrtCall` kernel uses the output $array_key.\n Other ops executed by TFRT may make use of $tensor_future.", "operands": [ { "name": "variable", "type": "TFTensorType" } ], "results": [ { "name": "array_key", "type": "TFTensorType" }, { "name": "tensor_future", "type": "MlrtFutureType" } ], "attributes": [ { "name": "used_by_host", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "tf_mlrt.ifrt_resource_deserialize", "summary": "Deserialize resource vars.", "description": "This is the MLRT version of the IfrtResourceDeserialize op.", "operands": [ { "name": "resource_var", "type": "TFTensorType" }, { "name": "input_dir", "type": "TFTensorType" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "tf_mlrt.ifrt_restore_variable", "summary": "Restore variable tensors", "description": "This is the MLRT version of tf.IfrtRestoreVariableOp.\n\n This op restores tensors from a checkpoint asynchronously, similar to tf.RestoreV2.\n It fuses variable assignment: tensors that are consumed by tf.AssignVariableOp\n are handled internally via the $var_handles operands and do not appear in\n the results.\n\n Tensors that are consumed by other operations (e.g. tf.LookupTableImportV2)\n will be returned as results in $tensors. Consequently, the number of\n results is dynamic, containing only those tensors not assigned to variables\n but consumed directly by other operations. A restored tensor with no\n consumer will cause an error in the kernel.\n This Op is specific to MLRT runtime and is not a stable interface for\n serialization.", "operands": [ { "name": "prefix", "type": "TFTensorType" }, { "name": "tensor_names", "type": "TFTensorType" }, { "name": "shape_and_slices", "type": "TFTensorType" }, { "name": "var_handles", "type": "Variadic" } ], "results": [ { "name": "tensors", "type": "Variadic" } ], "attributes": [ { "name": "restored_dtypes", "type": "TypedArrayAttrBase" }, { "name": "truncate_in_cast", "type": "DenseBoolArrayAttr" }, { "name": "returned_tensor_names", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "tf_mlrt.map_fn", "summary": "The Parallel Map for tf_mlrt dialect", "description": "The Pmap executes body function in parallel for all ranges up to $max_iterations.\n\n The pseudo code:\n for(int i = 0; i < $max_iterations; i++) {\n body_fn(MlrtFture($tensor_list_or_flow_in[i]),\n MlrtPromise($tensor_list_or_flow_in[i+1]),\n i, i, $invariant_args);\n }\n\n return $tensor_list_or_flow_in[$max_iterations]", "operands": [ { "name": "max_iterations", "type": "TFTensorType" }, { "name": "tensor_list_or_flow_in", "type": "Variadic" }, { "name": "invariant_args", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "body_fn", "type": "FlatSymbolRefAttr" }, { "name": "num_tensor_list_or_flow_in", "type": "I32Attr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(`$max_iterations`,` $tensor_list_or_flow_in`,` $invariant_args `)` attr-dict `:` functional-type(operands, results)" }, { "name": "tf_mlrt.predicate", "summary": "Converts a fallback tensor to a bool", "description": "Note: this kernel is used for CPU tensors.\n\n Converts a fallback tensor to a bool with the following rules:\n\n - For 0D tensors, truthiness is determined by comparing against a \"zero\"\n value. For numerical types it is the obvious zero. For strings it is the\n empty string.\n\n - For >0D tensors, truthiness is determined by looking at the number of\n elements. If has zero elements, then the result is false. Otherwise the\n result is true.\n\n input: a fallback tensor representing the condition.\n device: the name of the tensorflow device that is associated with the\n input fallback tensor.\n\n output: the converted bool.", "operands": [ { "name": "input", "type": "TFTensorType" } ], "results": [ { "name": "output", "type": "I1" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$input attr-dict" }, { "name": "tf_mlrt.promise", "summary": "Set a tensor in a promise", "description": "Set a tensor in a promise.\n\n $promise: A value of type !mlrt.promise. The underlying value must be a tensorflow tensor.\n $tensor: A tensorflow tensor.", "operands": [ { "name": "promise", "type": "MlrtPromiseType" }, { "name": "tensor", "type": "TFTensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_mlrt.promise_future", "summary": "Set a tensor future in a promise", "description": "Set a tensor future in a promise.\n\n $promise: A value of type !mlrt.promise. The underlying value must be a tensorflow tensor.\n $future: A value of type !mlrt.future. Must represents a tensorflow tensor.", "operands": [ { "name": "promise", "type": "MlrtPromiseType" }, { "name": "tensor", "type": "MlrtFutureType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_mlrt.promise_return", "summary": "Set a tensor in a promise and return from a function with no output", "description": "Set a tensor in a promise and return from a function with no output.\n\n $promise: A value of type !mlrt.promise. The underlying value must be a tensorflow tensor.\n $tensor: A tensorflow tensor.", "operands": [ { "name": "promise", "type": "MlrtPromiseType" }, { "name": "tensor", "type": "TFTensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_mlrt.set_resource", "summary": "Set a tensor in resource array", "description": "Set a tensor in resource array.\n\n arg: the tensor to be set in the resource array.\n index: the index in the resource array", "operands": [ { "name": "arg", "type": "TFTensorType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_mlrt.tensor_to_int32", "summary": "Cast a Tensor to int32.", "description": "Cast a Tensor to int32.\n\n Example:\n %one = tf_mlrt.tensor_to_int32 %src_tenosr", "operands": [ { "name": "src", "type": "TFTensorType" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tf_saved_model.asset", "summary": "Represents an asset in saved model.", "description": "Represents an asset in the saved model that points to an external file. It\n is a scalar string tensor and it is passed as an argument to the session\n initializer functions.\n\n The `sym_name` represents the symbol table name used for internal IR\n references.\n\n The `filename` attribute contains the file path to the asset file and it is\n relative to saved model directory.", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "filename", "type": "StrAttr" } ] }, { "name": "tf_saved_model.global_tensor", "summary": "Represents a global tensor value.", "description": "Represents a tensor that is not bound to the lifetime of any particular\n function. Such tensors can be marked as mutable via the `is_mutable`\n attribute.\n\n These tensors are bound to the arguments of func ops via the\n `tf_saved_model.bound_input` argument attr.\n\n The `sym_name` represents the symbol table name used for internal IR\n references. The externally visible names, if any, are represented via\n a `tf_saved_model.exported_names` attribute.\n\n The `value` attribute contains the tensor's value (or initial value, in the\n case it is mutable).\n\n The `type` attribute contains the tensor's type, which for the case of\n mutable tensors might be more general than just the fixed static shape of\n the `value` attribute. For example, a global tensor might be unranked such\n as `tensor<*xf32>`, or a more complex shape such as `tensor<4x?x27xf32>`.\n The shape of `value` must be compatible with the shape of `type` in the\n sense of `tf.TensorShape` compatibility. And the element types must match.", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "value", "type": "OptionalAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" } ] }, { "name": "tf_saved_model.session_initializer", "summary": "Initializes TensorFlow session state.", "description": "The session initializer op marks one or more functions that must be called\n by an external agent exactly once to initialize TensorFlow session state,\n and this must happen before any other exported functions are called. There\n must be no more than one session initializer op in a saved model.\n\n The `initializers` represents the initialization functions. The function\n have no output and this function should be only called once.\n\n This is used, for example, to initialize hash tables stored in resources and\n accessed by resource name (rather than as resource handles or bound inputs\n which is how `global_tensor`s are referenced)", "attributes": [ { "name": "initializers", "type": "TypedArrayAttrBase" } ] }, { "name": "tf._ArrayToList", "summary": "Converts an array of tensors to a list of tensors.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf._EagerConst", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf._FusedBatchNormEx", "summary": "Internal FusedBatchNorm operation: reserved for internal use.", "description": "Do not invoke this operator directly in Python. A fusion optimization is\nexpected to create these operators.", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" }, { "name": "scale", "type": "TF_Float32Tensor" }, { "name": "offset", "type": "TF_Float32Tensor" }, { "name": "mean", "type": "TF_Float32Tensor" }, { "name": "variance", "type": "TF_Float32Tensor" }, { "name": "side_input", "type": "Variadic>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" }, { "name": "batch_mean", "type": "TF_Float32Tensor" }, { "name": "batch_variance", "type": "TF_Float32Tensor" }, { "name": "reserve_space_1", "type": "TF_Float32Tensor" }, { "name": "reserve_space_2", "type": "TF_Float32Tensor" }, { "name": "reserve_space_3", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "exponential_avg_factor", "type": "DefaultValuedOptionalAttr" }, { "name": "activation_mode", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._FusedConv2D", "summary": "Performs a convolution followed by a specified series of operations.", "description": "The inputs to the convolution are `input` and `filter`. The series of operations\nthat follows is specified by the `fused_ops` attribute, which is a list of TF op\nnames specified as strings (e.g. \"Relu\"). They are performed in order, where the\n(first) input to each op is the output of the preceding op. The first input and\nthe output of each fused_op must be of type T.\n\nCurrently supported fused_op combinations are: [X] and [X,A], where X is one of\n{\"BiasAdd\",\"FusedBatchNorm\"} and A is one of {\"Elu\",\"Relu\",\"Relu6\"}.\n\n* The first input to op X is the Conv2D result, and the additional input(s) to X\nare specified by `args`.\n* If there is an op A specified, the output of op X is the input to op A, and op\nA produces the _FusedConv2D output. Otherwise, op X produces the _FusedConv2D\noutput.\n\n*NOTE*: Do not invoke this operator directly in Python. Grappler is expected to\ncreate these operators.", "operands": [ { "name": "input", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int8, TF_Qint8]>" }, { "name": "filter", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int8, TF_Qint8]>" }, { "name": "args", "type": "Variadic" }, { "name": "host_args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int8, TF_Qint8]>" } ], "attributes": [ { "name": "num_args", "type": "ConfinedAttr]>" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" }, { "name": "filter_format", "type": "DefaultValuedOptionalAttr, \"HWIO\">" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" }, { "name": "use_cudnn_on_gpu", "type": "DefaultValuedOptionalAttr" }, { "name": "fused_ops", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "leakyrelu_alpha", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf._FusedMatMul", "summary": "Performs a MatMul followed by a specified series of operations.", "description": "The inputs to the MatMul are specified by `a` and `b`. The series of operations\nthat follows is specified by the `fused_ops` attribute, which is a list of TF op\nnames specified as strings (e.g. \"Relu\"). They are performed in order, where the\n(first) input to each op is the output of the preceding op. The first input and\nthe output of each fused_op must be of type T.\n\nCurrently supported fused_op combinations are: [\"BiasAdd\"] and [\"BiasAdd\",A],\nwhere A is one of {\"Elu\",\"Relu\",\"Relu6\"}.\n\n* The first input to BiasAdd is the MatMul result, and the additional BiasAdd\ninput is specified by `args`.\n* If there is an op A specified, the output of the BiasAdd is the input to op A,\nand op A produces the _FusedConv2D output. Otherwise, the BiasAdd produces the\n_FusedConv2D output.\n\n*NOTE*: Do not invoke this operator directly in Python. Grappler is\nexpected to create these operators.", "operands": [ { "name": "a", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" }, { "name": "b", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" }, { "name": "args", "type": "Variadic>" } ], "results": [ { "name": "product", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedOptionalAttr" }, { "name": "transpose_b", "type": "DefaultValuedOptionalAttr" }, { "name": "fused_ops", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "leakyrelu_alpha", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._HostRecv", "summary": "Receives the named tensor from send_device on recv_device.", "description": "_HostRecv produces its output on host memory whereas _Recv produces its\noutput on device memory.", "results": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "send_device", "type": "StrAttr" }, { "name": "send_device_incarnation", "type": "I64Attr" }, { "name": "recv_device", "type": "StrAttr" }, { "name": "client_terminated", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._HostSend", "summary": "Sends the named tensor from send_device to recv_device.", "description": "_HostSend requires its input on host memory whereas _Send requires its\ninput on device memory.", "operands": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "send_device", "type": "StrAttr" }, { "name": "send_device_incarnation", "type": "I64Attr" }, { "name": "recv_device", "type": "StrAttr" }, { "name": "client_terminated", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._InternalTestMustExecuteTrait_", "summary": "Internal op for testing only" }, { "name": "tf._InternalTestNonResourceValueSideEffects_", "summary": "Internal op for testing only", "operands": [ { "name": "key", "type": "TF_StrTensor" } ] }, { "name": "tf._ListToArray", "summary": "Converts a list of tensors to an array of tensors.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf._Recv", "summary": "Receives the named tensor from send_device on recv_device.", "results": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "send_device", "type": "StrAttr" }, { "name": "send_device_incarnation", "type": "I64Attr" }, { "name": "recv_device", "type": "StrAttr" }, { "name": "client_terminated", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._Send", "summary": "Sends the named tensor from send_device to recv_device.", "operands": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "send_device", "type": "StrAttr" }, { "name": "send_device_incarnation", "type": "I64Attr" }, { "name": "recv_device", "type": "StrAttr" }, { "name": "client_terminated", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._TfrtGetResource", "summary": "Get values from TFRT runtime's static resource.", "description": "Getting tensor values from TFRT runtime's static resource manager, using\n the indices that are previously set in _TfrtSetResource op.\n `shared_name` and `container` are used to store identifying information for\n resource tensors that have been hoisted. This is important for resource\n alias analysis and side effect analysis. These are empty for non-resource\n type tensors.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" }, { "name": "shared_name", "type": "TypedArrayAttrBase" }, { "name": "container", "type": "TypedArrayAttrBase" } ] }, { "name": "tf._TfrtSetResource", "summary": "Set values as TFRT runtime's static resource.", "description": "Setting a tensor value in TFRT runtime's static resource manager, using\n index as its identifier. It can be retrieved by _TfrtGetResource using the\n same index.", "operands": [ { "name": "arg", "type": "TF_Tensor" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ] }, { "name": "tf._TPUCompileMlir", "summary": "Compiles a computations for execution on one or more TPU devices.", "description": "For the internal use of the distributed TPU compiler.\n\n'mlir_module' is a serialized MLIR module with a `main` function that contains\ntarget computation.\n'dynamic_shapes' contains dynamic shapes of arguments whose shapes were not\nknown statically at TPUReplication rewrite time.\n'metadata' is a serialized TPUCompileMetadataProto describing the shapes and\ntypes of the inputs to the computation, as well as a mapping onto the TPU pod\ntopology.\n'program' output is a string key that is passed to the TPUExecute op and used to\nlook up the program in the compilation cache.", "operands": [ { "name": "dynamic_shapes", "type": "Variadic" } ], "results": [ { "name": "compilation_status", "type": "TF_StrTensor" }, { "name": "program", "type": "Variadic" } ], "attributes": [ { "name": "mlir_module", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "StrAttr" } ] }, { "name": "tf._TPUDeviceOrdinalPlaceholder", "summary": "Placeholder for a device ordinal that depends on its tf_device.replicate ancestor.", "description": "This op must have a tf_device.replicate ancestor. The ancestor replica_id and\nlogical_core attribute correspond to a TPU core. This op maps the TPU core to a\ndevice_ordinal, where the device ordinal is the index of the core relative to\nits host.\n\nThe replicate_to_island pass removes and flattens tf_device.replicate, so it\nconverts this op to the constant index of the core relative to its host.", "results": [ { "name": "device_ordinal", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "logical_core", "type": "I64Attr" } ] }, { "name": "tf._UnaryOpsComposition", "summary": "*NOTE*: Do not invoke this operator directly in Python. Graph rewrite pass is", "description": "expected to create these operators.", "operands": [ { "name": "x", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64]>" } ], "attributes": [ { "name": "op_names", "type": "TypedArrayAttrBase" } ] }, { "name": "tf._XlaCompile", "summary": "XLA Compile Op. For use by the XLA JIT only.", "description": "Compiles a TensorFlow function into an XLA LocalExecutable and returns a key\nthat _XlaRun can use to look up the LocalExecutable and execute it.", "operands": [ { "name": "constants", "type": "Variadic" }, { "name": "args", "type": "Variadic" }, { "name": "resources", "type": "Variadic" } ], "results": [ { "name": "key", "type": "TF_StrTensor" }, { "name": "compilation_successful", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "must_compile", "type": "BoolAttr" }, { "name": "function", "type": "SymbolRefAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf._XlaCompileMlirPlaceholderProgramKey", "summary": "Placeholder program key (compilation cache key) of a XLA `program`.", "description": "This op can be used when certain rewrite passes materialize ops that require a\nprogram key but the _TPUCompileMlir or _XlaCompile op has not been added yet.\nSubsequent rewrite passes must replace this op with `program` output.", "results": [ { "name": "program", "type": "TF_StrTensor" } ] }, { "name": "tf._XlaHostComputeMlir", "summary": "A pseudo-op to represent host-side computation in an XLA program.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "send_key", "type": "StrAttr" }, { "name": "recv_key", "type": "StrAttr" }, { "name": "host_mlir_module", "type": "DefaultValuedOptionalAttr" }, { "name": "manual_sharding", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._XlaRecvAtHost", "summary": "A placeholder op to receive values from a running XLA computation.", "operands": [ { "name": "dynamic_key", "type": "TF_StrTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "device_ordinal", "type": "I64Attr" }, { "name": "device_type", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._XlaRecvAtHostV2", "summary": "A placeholder op to receive values from a running XLA computation with support for a runtime device ordinal.", "operands": [ { "name": "dynamic_key", "type": "TF_StrTensor" }, { "name": "device_ordinal", "type": "TF_Int64Tensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "device_type", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._XlaRun", "summary": "XLA Run Op. For use by the XLA JIT only.", "description": "Executes a TensorFlow function previously compiled into a LocalExecutable by an\n_XlaCompile op.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "key", "type": "TF_StrTensor" } ], "results": [ { "name": "results", "type": "Variadic" } ] }, { "name": "tf._XlaSendFromHost", "summary": "A placeholder op to send values to a running XLA computation.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "dynamic_key", "type": "TF_StrTensor" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "device_ordinal", "type": "I64Attr" }, { "name": "device_type", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf._XlaSendFromHostV2", "summary": "A placeholder op to send values to a running XLA computation with support for a runtime device ordinal.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "dynamic_key", "type": "TF_StrTensor" }, { "name": "device_ordinal", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "device_type", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Abs", "summary": "Computes the absolute value of a tensor.", "description": "Given a tensor `x`, this operation returns a tensor containing the absolute\nvalue of each element in `x`. For example, if x is an input element and y is\nan output element, this operation computes \\\\(y = |x|\\\\).", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.Acos", "summary": "Computes acos of x element-wise.", "description": "Provided an input tensor, the `tf.math.acos` operation returns the inverse cosine of each element of the tensor. If `y = tf.math.cos(x)` then, `x = tf.math.acos(y)`.\n\n Input range is `[-1, 1]` and the output has a range of `[0, pi]`.", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Acosh", "summary": "Computes inverse hyperbolic cosine of x element-wise.", "description": "Given an input tensor, the function computes inverse hyperbolic cosine of every element.\nInput range is `[1, inf]`. It returns `nan` if the input lies outside the range.\n\n```python\nx = tf.constant([-2, -0.5, 1, 1.2, 200, 10000, float(\"inf\")])\ntf.math.acosh(x) ==> [nan nan 0. 0.62236255 5.9914584 9.903487 inf]\n```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Add", "summary": "Returns x + y element-wise.", "description": "*NOTE*: `Add` supports broadcasting. `AddN` does not. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\nGiven two input tensors, the `tf.add` operation computes the sum for every element in the tensor.\n\nBoth input and output have a range `(-inf, inf)`.", "operands": [ { "name": "x", "type": "TF_NumberNotQuantizedOrStrTensor" }, { "name": "y", "type": "TF_NumberNotQuantizedOrStrTensor" } ], "results": [ { "name": "z", "type": "TF_NumberNotQuantizedOrStrTensor" } ] }, { "name": "tf.AddN", "summary": "Add all input tensors element wise.", "description": "Inputs must be of same size and shape.\n\n ```python\n x = [9, 7, 10]\n tf.math.add_n(x) ==> 26\n ```", "operands": [ { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "sum", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8, TF_Variant]>" } ] }, { "name": "tf.AddV2", "summary": "Returns x + y element-wise.", "description": "*NOTE*: `Add` supports broadcasting. `AddN` does not. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.AdjustContrastv2", "summary": "Adjust the contrast of one or more images.", "description": "`images` is a tensor of at least 3 dimensions. The last 3 dimensions are\ninterpreted as `[height, width, channels]`. The other dimensions only\nrepresent a collection of images, such as `[batch, height, width, channels].`\n\nContrast is adjusted independently for each channel of each image.\n\nFor each channel, the Op first computes the mean of the image pixels in the\nchannel and then adjusts each component of each pixel to\n`(x - mean) * contrast_factor + mean`.", "operands": [ { "name": "images", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "contrast_factor", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" } ] }, { "name": "tf.AdjustHue", "summary": "Adjust the hue of one or more images.", "description": "`images` is a tensor of at least 3 dimensions. The last dimension is\ninterpreted as channels, and must be three.\n\nThe input image is considered in the RGB colorspace. Conceptually, the RGB\ncolors are first mapped into HSV. A delta is then applied all the hue values,\nand then remapped back to RGB colorspace.", "operands": [ { "name": "images", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "delta", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" } ] }, { "name": "tf.AdjustSaturation", "summary": "Adjust the saturation of one or more images.", "description": "`images` is a tensor of at least 3 dimensions. The last dimension is\ninterpreted as channels, and must be three.\n\nThe input image is considered in the RGB colorspace. Conceptually, the RGB\ncolors are first mapped into HSV. A scale is then applied all the saturation\nvalues, and then remapped back to RGB colorspace.", "operands": [ { "name": "images", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "scale", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" } ] }, { "name": "tf.All", "summary": "Computes the \"logical and\" of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TF_BoolTensor" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.AllToAll", "summary": "An Op to exchange data across TPU replicas.", "description": "On each replica, the input is split into `split_count` blocks along\n`split_dimension` and send to the other replicas given group_assignment. After\nreceiving `split_count` - 1 blocks from other replicas, we concatenate the\nblocks along `concat_dimension` as the output.\n\nFor example, suppose there are 2 TPU replicas:\nreplica 0 receives input: `[[A, B]]`\nreplica 1 receives input: `[[C, D]]`\n\ngroup_assignment=`[[0, 1]]`\nconcat_dimension=0\nsplit_dimension=1\nsplit_count=2\n\nreplica 0's output: `[[A], [C]]`\nreplica 1's output: `[[B], [D]]`", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "group_assignment", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "attributes": [ { "name": "concat_dimension", "type": "I64Attr" }, { "name": "split_dimension", "type": "I64Attr" }, { "name": "split_count", "type": "I64Attr" } ] }, { "name": "tf.Angle", "summary": "Returns the argument of a complex number.", "description": "Given a tensor `input` of complex numbers, this operation returns a tensor of\ntype `float` that is the argument of each element in `input`. All elements in\n`input` must be complex numbers of the form \\\\(a + bj\\\\), where *a*\nis the real part and *b* is the imaginary part.\n\nThe argument returned by this operation is of the form \\\\(atan2(b, a)\\\\).\n\nFor example:\n\n```\n# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.math.angle(input) ==> [2.0132, 1.056]\n```\n\n@compatibility(numpy)\nEquivalent to np.angle.\n@end_compatibility", "operands": [ { "name": "input", "type": "TensorOf<[TF_Complex128, TF_Complex64]>" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.AnonymousIterator", "summary": "A container for an iterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.AnonymousIteratorV2", "summary": "A container for an iterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.AnonymousIteratorV3", "summary": "A container for an iterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.AnonymousMemoryCache", "results": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.AnonymousMultiDeviceIterator", "summary": "A container for a multi device iterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "devices", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.AnonymousMultiDeviceIteratorV3", "summary": "A container for a multi device iterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "devices", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.AnonymousRandomSeedGenerator", "operands": [ { "name": "seed", "type": "TF_Int64Tensor" }, { "name": "seed2", "type": "TF_Int64Tensor" } ], "results": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.AnonymousSeedGenerator", "operands": [ { "name": "seed", "type": "TF_Int64Tensor" }, { "name": "seed2", "type": "TF_Int64Tensor" }, { "name": "reshuffle", "type": "TF_BoolTensor" } ], "results": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.Any", "summary": "Computes the \"logical or\" of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TF_BoolTensor" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ApproximateEqual", "summary": "Returns the truth value of abs(x-y) < tolerance element-wise.", "operands": [ { "name": "x", "type": "TF_NumberTensor" }, { "name": "y", "type": "TF_NumberTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "tolerance", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ApproxTopK", "summary": "Returns min/max k values and their indices of the input operand in an approximate manner.", "description": "See https://arxiv.org/abs/2206.14286 for the algorithm details.\nThis op is only optimized on TPU currently.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "values", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "indices", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "k", "type": "ConfinedAttr]>" }, { "name": "reduction_dimension", "type": "DefaultValuedOptionalAttr" }, { "name": "recall_target", "type": "DefaultValuedOptionalAttr" }, { "name": "is_max_k", "type": "DefaultValuedOptionalAttr" }, { "name": "reduction_input_size_override", "type": "DefaultValuedOptionalAttr" }, { "name": "aggregate_to_topk", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ArgMax", "summary": "Returns the index with the largest value across dimensions of a tensor.", "description": "Note that in case of ties the identity of the return value is not guaranteed.\n\nUsage:\n ```python\n import tensorflow as tf\n a = [1, 10, 26.9, 2.8, 166.32, 62.3]\n b = tf.math.argmax(input = a)\n c = tf.keras.backend.eval(b)\n # c = 4\n # here a[4] = 166.32 which is the largest element of a across axis 0\n ```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "dimension", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Int16, TF_Int32, TF_Int64, TF_Uint16]>" } ] }, { "name": "tf.ArgMin", "summary": "Returns the index with the smallest value across dimensions of a tensor.", "description": "Note that in case of ties the identity of the return value is not guaranteed.\n\nUsage:\n ```python\n import tensorflow as tf\n a = [1, 10, 26.9, 2.8, 166.32, 62.3]\n b = tf.math.argmin(input = a)\n c = tf.keras.backend.eval(b)\n # c = 0\n # here a[0] = 1 which is the smallest element of a across axis 0\n ```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "dimension", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.Asin", "summary": "Computes the trignometric inverse sine of x element-wise.", "description": "The `tf.math.asin` operation returns the inverse of `tf.math.sin`, such that\nif `y = tf.math.sin(x)` then, `x = tf.math.asin(y)`.\n\n**Note**: The output of `tf.math.asin` will lie within the invertible range\nof sine, i.e [-pi/2, pi/2].\n\nFor example:\n\n```python\n# Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]\nx = tf.constant([1.047, 0.785])\ny = tf.math.sin(x) # [0.8659266, 0.7068252]\n\ntf.math.asin(y) # [1.047, 0.785] = x\n```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Asinh", "summary": "Computes inverse hyperbolic sine of x element-wise.", "description": "Given an input tensor, this function computes inverse hyperbolic sine\n for every element in the tensor. Both input and output has a range of\n `[-inf, inf]`.\n\n ```python\n x = tf.constant([-float(\"inf\"), -2, -0.5, 1, 1.2, 200, 10000, float(\"inf\")])\n tf.math.asinh(x) ==> [-inf -1.4436355 -0.4812118 0.8813736 1.0159732 5.991471 9.903487 inf]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Assert", "summary": "Asserts that the given condition is true.", "description": "If `condition` evaluates to false, print the list of tensors in `data`.\n`summarize` determines how many entries of the tensors to print.", "operands": [ { "name": "condition", "type": "TF_BoolTensor" }, { "name": "data", "type": "Variadic" } ], "attributes": [ { "name": "summarize", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Assign", "summary": "Update 'ref' by assigning 'value' to it.", "description": "This operation outputs \"ref\" after the assignment is done.\nThis makes it easier to chain operations that need to use the reset value.", "operands": [ { "name": "ref", "type": "TF_Tensor" }, { "name": "value", "type": "TF_Tensor" } ], "results": [ { "name": "output_ref", "type": "TF_Tensor" } ], "attributes": [ { "name": "validate_shape", "type": "DefaultValuedOptionalAttr" }, { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.AssignAddVariableOp", "summary": "Adds a value to the current value of a variable.", "description": "Any ReadVariableOp with a control dependency on this op is guaranteed to\nsee the incremented value or a subsequent newer one.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "value", "type": "TF_Tensor" } ] }, { "name": "tf.AssignSubVariableOp", "summary": "Subtracts a value from the current value of a variable.", "description": "Any ReadVariableOp with a control dependency on this op is guaranteed to\nsee the decremented value or a subsequent newer one.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "value", "type": "TF_Tensor" } ] }, { "name": "tf.AssignVariableOp", "summary": "Assigns a new value to a variable.", "description": "Any ReadVariableOp with a control dependency on this op is guaranteed to return\nthis value or a subsequent newer value of the variable.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "value", "type": "TF_Tensor" } ], "attributes": [ { "name": "validate_shape", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.AsString", "summary": "Converts each entry in the given tensor to strings.", "description": "Supports many numeric types and boolean.\n\nFor Unicode, see the\n[https://www.tensorflow.org/text/guide/unicode](Working with Unicode text)\ntutorial.\n\nExamples:\n\n>>> tf.strings.as_string([3, 2])\n\n>>> tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy()\narray([b'3.14', b'2.72'], dtype=object)", "operands": [ { "name": "input", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Str, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8, TF_Variant]>" } ], "results": [ { "name": "output", "type": "TF_StrTensor" } ], "attributes": [ { "name": "precision", "type": "DefaultValuedOptionalAttr" }, { "name": "scientific", "type": "DefaultValuedOptionalAttr" }, { "name": "shortest", "type": "DefaultValuedOptionalAttr" }, { "name": "width", "type": "DefaultValuedOptionalAttr" }, { "name": "fill", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.AsyncIfrtCall", "summary": "Invokes a program via IFRT on a device asynchronously", "description": "This op calls an IFRT program uniquely identified by the given program id.\n Similar to `IfrtCallOp`, it performs the same work but invokes the program\n asynchronously, enabling non-blocking execution within the runtime.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "static_shapes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "program_id", "type": "I64Attr" }, { "name": "variable_arg_indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.Atan", "summary": "Computes the trignometric inverse tangent of x element-wise.", "description": "The `tf.math.atan` operation returns the inverse of `tf.math.tan`, such that\nif `y = tf.math.tan(x)` then, `x = tf.math.atan(y)`.\n\n**Note**: The output of `tf.math.atan` will lie within the invertible range\nof tan, i.e (-pi/2, pi/2).\n\nFor example:\n\n```python\n# Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]\nx = tf.constant([1.047, 0.785])\ny = tf.math.tan(x) # [1.731261, 0.99920404]\n\ntf.math.atan(y) # [1.047, 0.785] = x\n```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Atan2", "summary": "Computes arctangent of `y/x` element-wise, respecting signs of the arguments.", "description": "This is the angle \\\\( \\theta \\in [-\\pi, \\pi] \\\\) such that\n\\\\[ x = r \\cos(\\theta) \\\\]\nand\n\\\\[ y = r \\sin(\\theta) \\\\]\nwhere \\\\(r = \\sqrt{x^2 + y^2} \\\\).\n\nFor example:\n\n>>> x = [1., 1.]\n>>> y = [1., -1.]\n>>> print((tf.math.atan2(y,x) * (180 / np.pi)).numpy())\n[ 45. -45.]", "operands": [ { "name": "y", "type": "TF_FloatTensor" }, { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "z", "type": "TF_FloatTensor" } ] }, { "name": "tf.Atanh", "summary": "Computes inverse hyperbolic tangent of x element-wise.", "description": "Given an input tensor, this function computes inverse hyperbolic tangent\n for every element in the tensor. Input range is `[-1,1]` and output range is\n `[-inf, inf]`. If input is `-1`, output will be `-inf` and if the\n input is `1`, output will be `inf`. Values outside the range will have\n `nan` as output.\n\n ```python\n x = tf.constant([-float(\"inf\"), -1, -0.5, 1, 0, 0.5, 10, float(\"inf\")])\n tf.math.atanh(x) ==> [nan -inf -0.54930615 inf 0. 0.54930615 nan nan]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.AvgPool", "summary": "Performs average pooling on the input.", "description": "Each entry in `output` is the mean of the corresponding size `ksize`\nwindow in `value`.", "operands": [ { "name": "value", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.AvgPool3D", "summary": "Performs 3D average pooling on the input.", "description": "Each entry in `output` is the mean of the corresponding size `ksize` window in\n`value`.", "operands": [ { "name": "input", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" } ] }, { "name": "tf.AvgPool3DGrad", "summary": "Computes gradients of average pooling function.", "operands": [ { "name": "orig_input_shape", "type": "TF_Int32Tensor" }, { "name": "grad", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" } ] }, { "name": "tf.AvgPoolGrad", "summary": "Computes gradients of the average pooling function.", "operands": [ { "name": "orig_input_shape", "type": "TF_Int32Tensor" }, { "name": "grad", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BatchDatasetV2", "summary": "Creates a dataset that batches `batch_size` elements from `input_dataset`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "batch_size", "type": "TF_Int64Tensor" }, { "name": "drop_remainder", "type": "TF_BoolTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "parallel_copy", "type": "DefaultValuedOptionalAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BatchFunction", "summary": "Batches all the inputs tensors to the computation done by the function.", "description": "So, for example, in the following code\n\n ```python\n\n # This input will be captured.\n y = tf.placeholder_with_default(1.0, shape=[])\n\n @tf.Defun(tf.float32)\n def computation(a):\n return tf.matmul(a, a) + y\n\n b = gen_batch_ops.batch_function(\n f=computation\n in_tensors=[a],\n captured_tensors=computation.captured_inputs,\n Tout=[o.type for o in computation.definition.signature.output_arg],\n num_batch_threads=1,\n max_batch_size=10,\n batch_timeout_micros=100000, # 100ms\n allowed_batch_sizes=[3, 10],\n batching_queue=\"\")\n ```\n\nIf more than one session.run call is simultaneously trying to compute `b`\nthe values of `a` will be gathered, non-deterministically concatenated\nalong the first axis, and only one thread will run the computation.\n\nAssumes that all arguments of the function are Tensors which will be batched\nalong their first dimension.\n\nArguments that are captured, are not batched. The session.run call which does\nthe concatenation, will use the values of the captured tensors available to it.\nTherefore, typical uses of captured tensors should involve values which remain\nunchanged across session.run calls. Inference is a good example of this.\n\nSparseTensor is not supported. The return value of the decorated function\nmust be a Tensor or a list/tuple of Tensors.", "operands": [ { "name": "in_tensors", "type": "Variadic" }, { "name": "captured_tensors", "type": "Variadic" } ], "results": [ { "name": "out_tensors", "type": "Variadic" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "num_batch_threads", "type": "I64Attr" }, { "name": "max_batch_size", "type": "I64Attr" }, { "name": "batch_timeout_micros", "type": "I64Attr" }, { "name": "max_enqueued_batches", "type": "DefaultValuedOptionalAttr" }, { "name": "allowed_batch_sizes", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" }, { "name": "batching_queue", "type": "DefaultValuedOptionalAttr" }, { "name": "low_priority_max_batch_size", "type": "DefaultValuedOptionalAttr" }, { "name": "low_priority_batch_timeout_micros", "type": "DefaultValuedOptionalAttr" }, { "name": "low_priority_allowed_batch_sizes", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "low_priority_max_enqueued_batches", "type": "DefaultValuedOptionalAttr" }, { "name": "mixed_priority_policy", "type": "DefaultValuedOptionalAttr, \"low_priority_padding_with_max_batch_size\">" }, { "name": "batch_padding_policy", "type": "DefaultValuedOptionalAttr, \"PAD_UP\">" }, { "name": "enable_large_batch_splitting", "type": "DefaultValuedOptionalAttr" }, { "name": "enable_priority_aware_batch_scheduler", "type": "DefaultValuedOptionalAttr" }, { "name": "enable_priority_aware_batch_scheduler_resplit", "type": "DefaultValuedOptionalAttr" }, { "name": "enable_batching_task_lazy_cancellation", "type": "DefaultValuedOptionalAttr" }, { "name": "num_warmup_batch_threads", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.BatchMatMul", "summary": "Multiplies slices of two tensors in batches.", "description": "Multiplies all slices of `Tensor` `x` and `y` (each slice can be\nviewed as an element of a batch), and arranges the individual results\nin a single output tensor of the same batch size. Each of the\nindividual slices can optionally be adjointed (to adjoint a matrix\nmeans to transpose and conjugate it) before multiplication by setting\nthe `adj_x` or `adj_y` flag to `True`, which are by default `False`.\n\nThe input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]`\nand `[..., r_y, c_y]`.\n\nThe output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:\n\n r_o = c_x if adj_x else r_x\n c_o = r_y if adj_y else c_y\n\nIt is computed as:\n\n output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" }, { "name": "y", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "attributes": [ { "name": "adj_x", "type": "DefaultValuedOptionalAttr" }, { "name": "adj_y", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_x", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_y", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BatchMatMulV2", "summary": "Multiplies slices of two tensors in batches.", "description": "Multiplies all slices of `Tensor` `x` and `y` (each slice can be\nviewed as an element of a batch), and arranges the individual results\nin a single output tensor of the same batch size. Each of the\nindividual slices can optionally be adjointed (to adjoint a matrix\nmeans to transpose and conjugate it) before multiplication by setting\nthe `adj_x` or `adj_y` flag to `True`, which are by default `False`.\n\nThe input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]`\nand `[..., r_y, c_y]`.\n\nThe output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:\n\n r_o = c_x if adj_x else r_x\n c_o = r_y if adj_y else c_y\n\nIt is computed as:\n\n output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])\n\n*NOTE*: `BatchMatMulV2` supports broadcasting in the batch dimensions. More\nabout broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html).", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "y", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "attributes": [ { "name": "adj_x", "type": "DefaultValuedOptionalAttr" }, { "name": "adj_y", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_x", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_y", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BatchMatMulV3", "summary": "Multiplies slices of two tensors in batches.", "description": "Multiplies all slices of `Tensor` `x` and `y` (each slice can be\nviewed as an element of a batch), and arranges the individual results\nin a single output tensor of the same batch size. Each of the\nindividual slices can optionally be adjointed (to adjoint a matrix\nmeans to transpose and conjugate it) before multiplication by setting\nthe `adj_x` or `adj_y` flag to `True`, which are by default `False`.\n\nThe input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]`\nand `[..., r_y, c_y]`.\n\nThe output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:\n\n r_o = c_x if adj_x else r_x\n c_o = r_y if adj_y else c_y\n\nIt is computed as:\n\n output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])\n\n*NOTE*: `BatchMatMulV3` supports broadcasting in the batch dimensions. More\nabout broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html).", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint8 ]>" }, { "name": "y", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint8 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64 ]>" } ], "attributes": [ { "name": "adj_x", "type": "DefaultValuedOptionalAttr" }, { "name": "adj_y", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_x", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_y", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BatchNormWithGlobalNormalization", "summary": "Batch normalization.", "description": "This op is deprecated. Prefer `tf.nn.batch_normalization`.", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "m", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "v", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "beta", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "gamma", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "result", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "attributes": [ { "name": "variance_epsilon", "type": "F32Attr" }, { "name": "scale_after_normalization", "type": "BoolAttr" } ] }, { "name": "tf.BatchToSpace", "summary": "BatchToSpace for 4-D tensors of type T.", "description": "This is a legacy version of the more general BatchToSpaceND.\n\nRearranges (permutes) data from batch into blocks of spatial data, followed by\ncropping. This is the reverse transformation of SpaceToBatch. More specifically,\nthis op outputs a copy of the input tensor where values from the `batch`\ndimension are moved in spatial blocks to the `height` and `width` dimensions,\nfollowed by cropping along the `height` and `width` dimensions.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "crops", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "block_size", "type": "ConfinedAttr]>" } ] }, { "name": "tf.BatchToSpaceND", "summary": "BatchToSpace for N-D tensors of type T.", "description": "This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of shape\n`block_shape + [batch]`, interleaves these blocks back into the grid defined by\nthe spatial dimensions `[1, ..., M]`, to obtain a result with the same rank as\nthe input. The spatial dimensions of this intermediate result are then\noptionally cropped according to `crops` to produce the output. This is the\nreverse of SpaceToBatch. See below for a precise description.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "block_shape", "type": "TF_I32OrI64Tensor" }, { "name": "crops", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.BesselI0e", "summary": "Computes the Bessel i0e function of `x` element-wise.", "description": "Exponentially scaled modified Bessel function of order 0 defined as\n`bessel_i0e(x) = exp(-abs(x)) bessel_i0(x)`.\n\nThis function is faster and numerically stabler than `bessel_i0(x)`.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.BesselI1e", "summary": "Computes the Bessel i1e function of `x` element-wise.", "description": "Exponentially scaled modified Bessel function of order 0 defined as\n`bessel_i1e(x) = exp(-abs(x)) bessel_i1(x)`.\n\nThis function is faster and numerically stabler than `bessel_i1(x)`.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.Betainc", "summary": "Compute the regularized incomplete beta integral \\\\(I_x(a, b)\\\\).", "description": "The regularized incomplete beta integral is defined as:\n\n\n\\\\(I_x(a, b) = \\frac{B(x; a, b)}{B(a, b)}\\\\)\n\nwhere\n\n\n\\\\(B(x; a, b) = \\int_0^x t^{a-1} (1 - t)^{b-1} dt\\\\)\n\n\nis the incomplete beta function and \\\\(B(a, b)\\\\) is the *complete*\nbeta function.", "operands": [ { "name": "a", "type": "TF_F32OrF64Tensor" }, { "name": "b", "type": "TF_F32OrF64Tensor" }, { "name": "x", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "z", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.BiasAdd", "summary": "Adds `bias` to `value`.", "description": "This is a special case of `tf.add` where `bias` is restricted to be 1-D.\nBroadcasting is supported, so `value` may have any number of dimensions.", "operands": [ { "name": "value", "type": "TF_NumberTensor" }, { "name": "bias", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BiasAddGrad", "summary": "The backward operation for \"BiasAdd\" on the \"bias\" tensor.", "description": "It accumulates all the values from out_backprop into the feature dimension.\nFor NHWC data format, the feature dimension is the last. For NCHW data format,\nthe feature dimension is the third-to-last.", "operands": [ { "name": "out_backprop", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.BiasAddV1", "summary": "Adds `bias` to `value`.", "description": "This is a deprecated version of BiasAdd and will be soon removed.\n\nThis is a special case of `tf.add` where `bias` is restricted to be 1-D.\nBroadcasting is supported, so `value` may have any number of dimensions.", "operands": [ { "name": "value", "type": "TF_NumberTensor" }, { "name": "bias", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.Bincount", "summary": "Counts the number of occurrences of each value in an integer array.", "description": "Outputs a vector with length `size` and the same dtype as `weights`. If\n`weights` are empty, then index `i` stores the number of times the value `i` is\ncounted in `arr`. If `weights` are non-empty, then index `i` stores the sum of\nthe value in `weights` at each index where the corresponding value in `arr` is\n`i`.\n\nValues in `arr` outside of the range [0, size) are ignored.", "operands": [ { "name": "arr", "type": "TF_Int32Tensor" }, { "name": "size", "type": "TF_Int32Tensor" }, { "name": "weights", "type": "TensorOf<[ TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "bins", "type": "TensorOf<[ TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ] }, { "name": "tf.Bitcast", "summary": "Bitcasts a tensor from one type to another without copying data.", "description": "Given a tensor `input`, this operation returns a tensor that has the same buffer\ndata as `input` with datatype `type`.\n\nIf the input datatype `T` is larger than the output datatype `type` then the\nshape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)].\n\nIf `T` is smaller than `type`, the operator requires that the rightmost\ndimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from\n[..., sizeof(`type`)/sizeof(`T`)] to [...].\n\ntf.bitcast() and tf.cast() work differently when real dtype is casted as a complex dtype\n(e.g. tf.complex64 or tf.complex128) as tf.cast() make imaginary part 0 while tf.bitcast()\ngives module error.\nFor example,\n\nExample 1:\n\n>>> a = [1., 2., 3.]\n>>> equality_bitcast = tf.bitcast(a, tf.complex128)\nTraceback (most recent call last):\n...\nInvalidArgumentError: Cannot bitcast from 1 to 18 [Op:Bitcast]\n>>> equality_cast = tf.cast(a, tf.complex128)\n>>> print(equality_cast)\ntf.Tensor([1.+0.j 2.+0.j 3.+0.j], shape=(3,), dtype=complex128)\n\nExample 2:\n\n>>> tf.bitcast(tf.constant(0xffffffff, dtype=tf.uint32), tf.uint8)\n\n\nExample 3:\n\n>>> x = [1., 2., 3.]\n>>> y = [0., 2., 3.]\n>>> equality= tf.equal(x,y)\n>>> equality_cast = tf.cast(equality,tf.float32)\n>>> equality_bitcast = tf.bitcast(equality_cast,tf.uint8)\n>>> print(equality)\ntf.Tensor([False True True], shape=(3,), dtype=bool)\n>>> print(equality_cast)\ntf.Tensor([0. 1. 1.], shape=(3,), dtype=float32)\n>>> print(equality_bitcast)\ntf.Tensor(\n [[ 0 0 0 0]\n [ 0 0 128 63]\n [ 0 0 128 63]], shape=(3, 4), dtype=uint8)\n\n*NOTE*: Bitcast is implemented as a low-level cast, so machines with different\nendian orderings will give different results. A copy from input buffer to output\nbuffer is made on BE machines when types are of different sizes in order to get\nthe same casting results as on LE machines.", "operands": [ { "name": "input", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.BitwiseAnd", "summary": "Elementwise computes the bitwise AND of `x` and `y`.", "description": "The result will have those bits set, that are set in both `x` and `y`. The\ncomputation is performed on the underlying representations of `x` and `y`.\n\nFor example:\n\n```python\nimport tensorflow as tf\nfrom tensorflow.python.ops import bitwise_ops\ndtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,\n tf.uint8, tf.uint16, tf.uint32, tf.uint64]\n\nfor dtype in dtype_list:\n lhs = tf.constant([0, 5, 3, 14], dtype=dtype)\n rhs = tf.constant([5, 0, 7, 11], dtype=dtype)\n exp = tf.constant([0, 0, 3, 10], dtype=tf.float32)\n\n res = bitwise_ops.bitwise_and(lhs, rhs)\n tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE\n```", "operands": [ { "name": "x", "type": "TF_IntTensor" }, { "name": "y", "type": "TF_IntTensor" } ], "results": [ { "name": "z", "type": "TF_IntTensor" } ] }, { "name": "tf.BitwiseOr", "summary": "Elementwise computes the bitwise OR of `x` and `y`.", "description": "The result will have those bits set, that are set in `x`, `y` or both. The\ncomputation is performed on the underlying representations of `x` and `y`.\n\nFor example:\n\n```python\nimport tensorflow as tf\nfrom tensorflow.python.ops import bitwise_ops\ndtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,\n tf.uint8, tf.uint16, tf.uint32, tf.uint64]\n\nfor dtype in dtype_list:\n lhs = tf.constant([0, 5, 3, 14], dtype=dtype)\n rhs = tf.constant([5, 0, 7, 11], dtype=dtype)\n exp = tf.constant([5, 5, 7, 15], dtype=tf.float32)\n\n res = bitwise_ops.bitwise_or(lhs, rhs)\n tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE\n```", "operands": [ { "name": "x", "type": "TF_IntTensor" }, { "name": "y", "type": "TF_IntTensor" } ], "results": [ { "name": "z", "type": "TF_IntTensor" } ] }, { "name": "tf.BitwiseXor", "summary": "Elementwise computes the bitwise XOR of `x` and `y`.", "description": "The result will have those bits set, that are different in `x` and `y`. The\ncomputation is performed on the underlying representations of `x` and `y`.\n\nFor example:\n\n```python\nimport tensorflow as tf\nfrom tensorflow.python.ops import bitwise_ops\ndtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,\n tf.uint8, tf.uint16, tf.uint32, tf.uint64]\n\nfor dtype in dtype_list:\n lhs = tf.constant([0, 5, 3, 14], dtype=dtype)\n rhs = tf.constant([5, 0, 7, 11], dtype=dtype)\n exp = tf.constant([5, 5, 4, 5], dtype=tf.float32)\n\n res = bitwise_ops.bitwise_xor(lhs, rhs)\n tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE\n```", "operands": [ { "name": "x", "type": "TF_IntTensor" }, { "name": "y", "type": "TF_IntTensor" } ], "results": [ { "name": "z", "type": "TF_IntTensor" } ] }, { "name": "tf.BoostedTreesBucketize", "summary": "Bucketize each feature based on bucket boundaries.", "description": "An op that returns a list of float tensors, where each tensor represents the\nbucketized values for a single feature.", "operands": [ { "name": "float_values", "type": "Variadic" }, { "name": "bucket_boundaries", "type": "Variadic" } ], "results": [ { "name": "buckets", "type": "Variadic" } ] }, { "name": "tf.BroadcastArgs", "summary": "Return the shape of s0 op s1 with broadcast.", "description": "Given `s0` and `s1`, tensors that represent shapes, compute `r0`, the\nbroadcasted shape. `s0`, `s1` and `r0` are all integer vectors.", "operands": [ { "name": "s0", "type": "TF_I32OrI64Tensor" }, { "name": "s1", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "r0", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.BroadcastGradientArgs", "summary": "Return the reduction indices for computing gradients of s0 op s1 with broadcast.", "description": "This is typically used by gradient computations for a broadcasting operation.", "operands": [ { "name": "s0", "type": "TF_I32OrI64Tensor" }, { "name": "s1", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "r0", "type": "TF_I32OrI64Tensor" }, { "name": "r1", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.BroadcastTo", "summary": "Broadcast an array for a compatible shape.", "description": "Broadcasting is the process of making arrays to have compatible shapes\nfor arithmetic operations. Two shapes are compatible if for each\ndimension pair they are either equal or one of them is one.\n\nFor example:\n\n>>> x = tf.constant([[1, 2, 3]]) # Shape (1, 3,)\n>>> y = tf.broadcast_to(x, [2, 3])\n>>> print(y)\ntf.Tensor(\n [[1 2 3]\n [1 2 3]], shape=(2, 3), dtype=int32)\n\nIn the above example, the input Tensor with the shape of `[1, 3]`\nis broadcasted to output Tensor with shape of `[2, 3]`.\n\nWhen broadcasting, if a tensor has fewer axes than necessary its shape is\npadded on the left with ones. So this gives the same result as the previous\nexample:\n\n>>> x = tf.constant([1, 2, 3]) # Shape (3,)\n>>> y = tf.broadcast_to(x, [2, 3])\n\n\nWhen doing broadcasted operations such as multiplying a tensor\nby a scalar, broadcasting (usually) confers some time or space\nbenefit, as the broadcasted tensor is never materialized.\n\nHowever, `broadcast_to` does not carry with it any such benefits.\nThe newly-created tensor takes the full memory of the broadcasted\nshape. (In a graph context, `broadcast_to` might be fused to\nsubsequent operation and then be optimized away, however.)", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Bucketize", "summary": "Bucketizes 'input' based on 'boundaries'.", "description": "For example, if the inputs are\n boundaries = [0, 10, 100]\n input = [[-5, 10000]\n [150, 10]\n [5, 100]]\n\nthen the output will be\n output = [[0, 3]\n [3, 2]\n [1, 3]]", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "boundaries", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.CacheDatasetV2", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "filename", "type": "TF_StrTensor" }, { "name": "cache", "type": "TF_ResourceTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Case", "summary": "An n-way switch statement which calls a single branch function.", "description": "An n-way switch statement, implementing the following:\n ```\n switch (branch_index) {\n case 0:\n output = branches[0](input);\n break;\n case 1:\n output = branches[1](input);\n break;\n ...\n case [[nbranches-1]]:\n default:\n output = branches[nbranches-1](input);\n break;\n }\n ```", "operands": [ { "name": "branch_index", "type": "I32Tensor" }, { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "branches", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "is_stateless", "type": "BoolAttr" } ] }, { "name": "tf.CaseRegion", "summary": "An n-way switch statement which calls a single branch function.", "description": "An n-way switch statement, implementing the following:\n ```\n switch (branch_index) {\n case 0:\n output = branches[0](input);\n break;\n case 1:\n output = branches[1](input);\n break;\n ...\n case [[nbranches-1]]:\n default:\n output = branches[nbranches-1](input);\n break;\n }\n ```", "operands": [ { "name": "branch_index", "type": "I32Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "is_stateless", "type": "BoolAttr" } ], "regions": [ { "name": "branches", "type": "VariadicRegion>" } ] }, { "name": "tf.Cast", "summary": "Cast x of type SrcT to y of DstT.", "operands": [ { "name": "x", "type": "TF_Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" } ], "attributes": [ { "name": "Truncate", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Ceil", "summary": "Returns element-wise smallest integer not less than x.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.CheckNumerics", "summary": "Checks a tensor for NaN and Inf values.", "description": "When run, reports an `InvalidArgument` error if `tensor` has any values\nthat are not a number (NaN) or infinity (Inf). Otherwise, returns the input\ntensor.\n\nExample usage:\n\n``` python\na = tf.Variable(1.0)\ntf.debugging.check_numerics(a, message='')\n\nb = tf.Variable(np.nan)\ntry:\n tf.debugging.check_numerics(b, message='Checking b')\nexcept Exception as e:\n assert \"Checking b : Tensor had NaN values\" in e.message\n\nc = tf.Variable(np.inf)\ntry:\n tf.debugging.check_numerics(c, message='Checking c')\nexcept Exception as e:\n assert \"Checking c : Tensor had Inf values\" in e.message\n```", "operands": [ { "name": "tensor", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ] }, { "name": "tf.Cholesky", "summary": "Computes the Cholesky decomposition of one or more square matrices.", "description": "The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions\nform square matrices.\n\nThe input has to be symmetric and positive definite. Only the lower-triangular\npart of the input will be used for this operation. The upper-triangular part\nwill not be read.\n\nThe output is a tensor of the same shape as the input\ncontaining the Cholesky decompositions for all input submatrices `[..., :, :]`.\n\n**Note**: The gradient computation on GPU is faster for large matrices but\nnot for large batch dimensions when the submatrices are small. In this\ncase it might be faster to use the CPU.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ] }, { "name": "tf.ClipByValue", "summary": "Clips tensor values to a specified min and max.", "description": "Given a tensor `x`, this operation returns a tensor of the same type and\nshape as `x` with its values clipped to `clip_value_min` and `clip_value_max`.\nAny values less than `clip_value_min` are set to `clip_value_min`. Any values\ngreater than `clip_value_max` are set to `clip_value_max`.", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "clip_value_min", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "clip_value_max", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ] }, { "name": "tf.CloseSummaryWriter", "summary": "Flushes and closes the summary writer.", "description": "Also removes it from the resource manager. To reopen, use another\nCreateSummaryFileWriter op.\n\nwriter: A handle to the summary writer resource.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" } ] }, { "name": "tf.CollateTPUEmbeddingMemory", "summary": "An op that merges the string-encoded memory config protos from all hosts.", "operands": [ { "name": "memory_configs", "type": "Variadic" } ], "results": [ { "name": "merged_memory_config", "type": "TF_StrTensor" } ] }, { "name": "tf.CollectiveAllToAllV2", "summary": "Mutually exchanges multiple tensors of identical type and shape.", "description": "`is_stateless` means each op does not need control dependencies to other\ncollective ops. In this case, keys that are unique at runtime\n(e.g. `instance_key`) should be used to distinguish collective groups.", "operands": [ { "name": "input", "type": "TF_FpOrI32OrI64Tensor" }, { "name": "group_size", "type": "TF_Int32Tensor" }, { "name": "group_key", "type": "TF_Int32Tensor" }, { "name": "instance_key", "type": "TF_Int32Tensor" }, { "name": "ordering_token", "type": "Variadic" } ], "results": [ { "name": "data", "type": "TF_FpOrI32OrI64Tensor" } ], "attributes": [ { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stateless", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectiveAssignGroupV2", "summary": "Assign group keys based on group assignment.", "operands": [ { "name": "group_assignment", "type": "TF_Int32Tensor" }, { "name": "device_index", "type": "TF_Int32Tensor" }, { "name": "base_key", "type": "TF_Int32Tensor" } ], "results": [ { "name": "group_size", "type": "TF_Int32Tensor" }, { "name": "group_key", "type": "TF_Int32Tensor" } ] }, { "name": "tf.CollectiveBcastRecv", "summary": "Receives a tensor value broadcast from another device.", "results": [ { "name": "data", "type": "TensorOf<[TF_Bool, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "attributes": [ { "name": "group_size", "type": "I64Attr" }, { "name": "group_key", "type": "I64Attr" }, { "name": "instance_key", "type": "I64Attr" }, { "name": "shape", "type": "TF_ShapeAttr" }, { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectiveBcastSend", "summary": "Broadcasts a tensor value to one or more other devices.", "operands": [ { "name": "input", "type": "TensorOf<[TF_Bool, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "results": [ { "name": "data", "type": "TensorOf<[TF_Bool, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "attributes": [ { "name": "group_size", "type": "I64Attr" }, { "name": "group_key", "type": "I64Attr" }, { "name": "instance_key", "type": "I64Attr" }, { "name": "shape", "type": "TF_ShapeAttr" }, { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectiveGather", "summary": "Mutually accumulates multiple tensors of identical type and shape.", "operands": [ { "name": "input", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "results": [ { "name": "data", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "attributes": [ { "name": "group_size", "type": "I64Attr" }, { "name": "group_key", "type": "I64Attr" }, { "name": "instance_key", "type": "I64Attr" }, { "name": "shape", "type": "TF_ShapeAttr" }, { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectiveGatherV2", "summary": "Mutually accumulates multiple tensors of identical type and shape.", "description": "`is_stateless` means each op does not need control dependencies to other\ncollective ops. In this case, keys that are unique at runtime\n(e.g. `instance_key`) should be used to distinguish collective groups.", "operands": [ { "name": "input", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" }, { "name": "group_size", "type": "TF_Int32Tensor" }, { "name": "group_key", "type": "TF_Int32Tensor" }, { "name": "instance_key", "type": "TF_Int32Tensor" }, { "name": "ordering_token", "type": "Variadic" } ], "results": [ { "name": "data", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "attributes": [ { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stateless", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectivePermute", "summary": "An Op to permute tensors across replicated TPU instances.", "description": "Each instance supplies its own input.\n\nFor example, suppose there are 4 TPU instances: `[A, B, C, D]`. Passing\nsource_target_pairs=`[[0,1],[1,2],[2,3],[3,0]]` gets the outputs:\n`[D, A, B, C]`.", "operands": [ { "name": "input", "type": "TF_NumberTensor" }, { "name": "source_target_pairs", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.CollectiveReduce", "summary": "Mutually reduces multiple tensors of identical type and shape.", "operands": [ { "name": "input", "type": "TF_FpOrI32OrI64Tensor" } ], "results": [ { "name": "data", "type": "TF_FpOrI32OrI64Tensor" } ], "attributes": [ { "name": "group_size", "type": "I64Attr" }, { "name": "group_key", "type": "I64Attr" }, { "name": "instance_key", "type": "I64Attr" }, { "name": "merge_op", "type": "TF_AnyStrAttrOf<[Min, Max, Mul, Add]>" }, { "name": "final_op", "type": "TF_AnyStrAttrOf<[Id, Div]>" }, { "name": "subdiv_offsets", "type": "TypedArrayAttrBase" }, { "name": "wait_for", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectiveReduceScatterV2", "summary": "Mutually reduces multiple tensors of identical type and shape and scatters the result.", "description": "`is_stateless` means each op does not need control dependencies to other\ncollective ops. In this case, keys that are unique at runtime\n(e.g. `instance_key`) should be used to distinguish collective groups.", "operands": [ { "name": "input", "type": "TF_FpOrI32OrI64Tensor" }, { "name": "group_size", "type": "TF_Int32Tensor" }, { "name": "group_key", "type": "TF_Int32Tensor" }, { "name": "instance_key", "type": "TF_Int32Tensor" }, { "name": "ordering_token", "type": "Variadic" } ], "results": [ { "name": "data", "type": "TF_FpOrI32OrI64Tensor" } ], "attributes": [ { "name": "merge_op", "type": "TF_AnyStrAttrOf<[Min, Max, Mul, Add]>" }, { "name": "final_op", "type": "TF_AnyStrAttrOf<[Id, Div]>" }, { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stateless", "type": "DefaultValuedOptionalAttr" }, { "name": "max_subdivs_per_device", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CollectiveReduceV2", "summary": "Mutually reduces multiple tensors of identical type and shape.", "description": "`is_stateless` means each op does not need control dependencies to other\ncollective ops. In this case, keys that are unique at runtime\n(e.g. `instance_key`) should be used to distinguish collective groups.", "operands": [ { "name": "input", "type": "TF_FpOrI32OrI64Tensor" }, { "name": "group_size", "type": "TF_Int32Tensor" }, { "name": "group_key", "type": "TF_Int32Tensor" }, { "name": "instance_key", "type": "TF_Int32Tensor" }, { "name": "ordering_token", "type": "Variadic" } ], "results": [ { "name": "data", "type": "TF_FpOrI32OrI64Tensor" } ], "attributes": [ { "name": "merge_op", "type": "TF_AnyStrAttrOf<[Min, Max, Mul, Add]>" }, { "name": "final_op", "type": "TF_AnyStrAttrOf<[Id, Div]>" }, { "name": "communication_hint", "type": "DefaultValuedOptionalAttr" }, { "name": "timeout_seconds", "type": "DefaultValuedOptionalAttr" }, { "name": "is_stateless", "type": "DefaultValuedOptionalAttr" }, { "name": "max_subdivs_per_device", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Complex", "summary": "Converts two real numbers to a complex number.", "description": "Given a tensor `real` representing the real part of a complex number, and a\ntensor `imag` representing the imaginary part of a complex number, this\noperation returns complex numbers elementwise of the form \\\\(a + bj\\\\), where\n*a* represents the `real` part and *b* represents the `imag` part.\n\nThe input tensors `real` and `imag` must have the same shape.\n\nFor example:\n\n```\n# tensor 'real' is [2.25, 3.25]\n# tensor `imag` is [4.75, 5.75]\ntf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]]\n```", "operands": [ { "name": "real", "type": "TF_F32OrF64Tensor" }, { "name": "imag", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "out", "type": "TensorOf<[TF_Complex128, TF_Complex64]>" } ] }, { "name": "tf.ComplexAbs", "summary": "Computes the complex absolute value of a tensor.", "description": "Given a tensor `x` of complex numbers, this operation returns a tensor of type\n`float` or `double` that is the absolute value of each element in `x`. All\nelements in `x` must be complex numbers of the form \\\\(a + bj\\\\). The absolute\nvalue is computed as \\\\( \\sqrt{a^2 + b^2}\\\\).\n\nFor example:\n\n>>> x = tf.complex(3.0, 4.0)\n>>> print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy())\n5.0", "operands": [ { "name": "x", "type": "TensorOf<[TF_Complex128, TF_Complex64]>" } ], "results": [ { "name": "y", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.Concat", "summary": "Concatenates tensors along one dimension.", "operands": [ { "name": "concat_dim", "type": "TF_Int32Tensor" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.ConcatOffset", "summary": "Computes offsets of concat inputs within its output.", "description": "For example:\n\n>>> x = [2, 2, 7]\n>>> y = [2, 3, 7]\n>>> z = [2, 9, 7]\n>>> offsets = concat_offset(1, [x, y, z])\n>>> [[a.item() for a in list(off.numpy())] for off in offsets]\n[[0, 0, 0], [0, 2, 0], [0, 5, 0]]\n\nThis is typically used by gradient computations for a concat operation.", "operands": [ { "name": "concat_dim", "type": "TF_Int32Tensor" }, { "name": "shape", "type": "Variadic" } ], "results": [ { "name": "offset", "type": "Variadic" } ] }, { "name": "tf.ConcatV2", "summary": "Concatenates tensors along one dimension.", "operands": [ { "name": "values", "type": "Variadic" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.ConfigureAndInitializeGlobalTPU", "summary": "An op that initialize the TPU system in a multi-client set up.", "description": "Initializes global TPU system for mutli-client execution.\n\nThis op does the work of both ConfigureDistributedTpuOp and\nInitializeHostForDistributedTpuOp, and outputs the latter's result.", "results": [ { "name": "output", "type": "TF_Int32Tensor" } ] }, { "name": "tf.ConfigureDistributedTPU", "summary": "Sets up the centralized structures for a distributed TPU system.", "results": [ { "name": "topology", "type": "TF_StrTensor" } ], "attributes": [ { "name": "embedding_config", "type": "DefaultValuedOptionalAttr" }, { "name": "tpu_embedding_config", "type": "DefaultValuedOptionalAttr" }, { "name": "is_global_init", "type": "DefaultValuedOptionalAttr" }, { "name": "enable_whole_mesh_compilations", "type": "DefaultValuedOptionalAttr" }, { "name": "compilation_failure_closes_chips", "type": "DefaultValuedOptionalAttr" }, { "name": "tpu_cancellation_closes_chips", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ConfigureTPUEmbedding", "summary": "Sets up TPUEmbedding in a distributed TPU system.", "attributes": [ { "name": "config", "type": "StrAttr" } ] }, { "name": "tf.ConfigureTPUEmbeddingHost", "summary": "An op that configures the TPUEmbedding software on a host.", "operands": [ { "name": "common_config", "type": "TF_StrTensor" }, { "name": "memory_config", "type": "TF_StrTensor" } ], "results": [ { "name": "network_config", "type": "TF_StrTensor" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ] }, { "name": "tf.ConfigureTPUEmbeddingMemory", "summary": "An op that configures the TPUEmbedding software on a host.", "operands": [ { "name": "common_config", "type": "TF_StrTensor" } ], "results": [ { "name": "memory_config", "type": "TF_StrTensor" } ] }, { "name": "tf.Conj", "summary": "Returns the complex conjugate of a complex number.", "description": "Given a tensor `input` of complex numbers, this operation returns a tensor of\ncomplex numbers that are the complex conjugate of each element in `input`. The\ncomplex numbers in `input` must be of the form \\\\(a + bj\\\\), where *a* is the\nreal part and *b* is the imaginary part.\n\nThe complex conjugate returned by this operation is of the form \\\\(a - bj\\\\).\n\nFor example:\n\n```\n# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.conj(input) ==> [-2.25 - 4.75j, 3.25 - 5.75j]\n```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Complex128, TF_Complex64, TF_Variant]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Complex128, TF_Complex64, TF_Variant]>" } ] }, { "name": "tf.ConjugateTranspose", "summary": "Shuffle dimensions of x according to a permutation and conjugate the result.", "description": "The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy:\n `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]`\n `y[i,j,k,...,s,t,u] == conj(x[perm[i], perm[j], perm[k],...,perm[s], perm[t], perm[u]])`", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "perm", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" } ] }, { "name": "tf.ConnectTPUEmbeddingHosts", "summary": "An op that sets up communication between TPUEmbedding host software instances", "description": "after ConfigureTPUEmbeddingHost has been called on each host.", "operands": [ { "name": "network_configs", "type": "Variadic" } ] }, { "name": "tf.Const", "summary": "Constant tensor op", "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ] }, { "name": "tf.Conv", "category": "Layer", "summary": "Computes a N-D convolution given (N+1+batch_dims)-D `input` and (N+2)-D `filter` tensors.", "description": "General function for computing a N-D convolution. It is required that\n`1 <= N <= 3`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" }, { "name": "filter", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"CHANNELS_LAST\">" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "batch_dims", "type": "DefaultValuedOptionalAttr" }, { "name": "groups", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Conv2D", "summary": "Computes a 2-D convolution given 4-D `input` and `filter` tensors.", "description": "Given an input tensor of shape `[batch, in_height, in_width, in_channels]`\nand a filter / kernel tensor of shape\n`[filter_height, filter_width, in_channels, out_channels]`, this op\nperforms the following:\n\n1. Flattens the filter to a 2-D matrix with shape\n `[filter_height * filter_width * in_channels, output_channels]`.\n2. Extracts image patches from the input tensor to form a *virtual*\n tensor of shape `[batch, out_height, out_width,\n filter_height * filter_width * in_channels]`.\n3. For each patch, right-multiplies the filter matrix and the image patch\n vector.\n\nIn detail, with the default NHWC format,\n\n output[b, i, j, k] =\n sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] *\n filter[di, dj, q, k]\n\nMust have `strides[0] = strides[3] = 1`. For the most common case of the same\nhorizontal and vertices strides, `strides = [1, stride, stride, 1]`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" }, { "name": "filter", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "use_cudnn_on_gpu", "type": "DefaultValuedOptionalAttr" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Conv2DBackpropFilter", "summary": "Computes the gradients of convolution with respect to the filter.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "filter_sizes", "type": "TF_Int32Tensor" }, { "name": "out_backprop", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "use_cudnn_on_gpu", "type": "DefaultValuedOptionalAttr" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Conv2DBackpropFilterV2", "summary": "Computes the gradients of convolution with respect to the filter.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "filter", "type": "TF_FloatTensor" }, { "name": "out_backprop", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "use_cudnn_on_gpu", "type": "DefaultValuedOptionalAttr" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Conv2DBackpropInput", "summary": "Computes the gradients of convolution with respect to the input.", "operands": [ { "name": "input_sizes", "type": "TF_Int32Tensor" }, { "name": "filter", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" }, { "name": "out_backprop", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "use_cudnn_on_gpu", "type": "DefaultValuedOptionalAttr" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Conv2DBackpropInputV2", "summary": "Computes the gradients of convolution with respect to the input.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" }, { "name": "filter", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" }, { "name": "out_backprop", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32 ]>" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "use_cudnn_on_gpu", "type": "DefaultValuedOptionalAttr" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Conv3D", "summary": "Computes a 3-D convolution given 5-D `input` and `filter` tensors.", "description": "In signal processing, cross-correlation is a measure of similarity of\ntwo waveforms as a function of a time-lag applied to one of them. This\nis also known as a sliding dot product or sliding inner-product.\n\nOur Conv3D implements a form of cross-correlation.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "filter", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1, 1}>" } ] }, { "name": "tf.Conv3DBackpropFilter", "summary": "Computes the gradients of 3-D convolution with respect to the filter.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "filter", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "out_backprop", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64]>" } ], "attributes": [ { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1, 1}>" } ] }, { "name": "tf.Conv3DBackpropFilterV2", "summary": "Computes the gradients of 3-D convolution with respect to the filter.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "filter_sizes", "type": "TF_Int32Tensor" }, { "name": "out_backprop", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1, 1}>" } ] }, { "name": "tf.Conv3DBackpropInput", "summary": "Computes the gradients of 3-D convolution with respect to the input.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "filter", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "out_backprop", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64]>" } ], "attributes": [ { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1, 1}>" } ] }, { "name": "tf.Conv3DBackpropInputV2", "summary": "Computes the gradients of 3-D convolution with respect to the input.", "operands": [ { "name": "input_sizes", "type": "TF_I32OrI64Tensor" }, { "name": "filter", "type": "TF_FloatTensor" }, { "name": "out_backprop", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1, 1}>" } ] }, { "name": "tf.ConvertToCooTensor", "summary": "Op that converts tensors into coo format.", "description": "This op coverts the dense, sparse and ragged tensor into standard coo tensor\nformat which contains three 1D tensors.", "operands": [ { "name": "indices_or_row_splits", "type": "TF_Int32Tensor" }, { "name": "values", "type": "TF_Int32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" } ], "results": [ { "name": "row_ids", "type": "TF_Int32Tensor" }, { "name": "col_ids", "type": "TF_Int32Tensor" }, { "name": "gains", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "sample_count", "type": "ConfinedAttr]>" }, { "name": "combiner", "type": "StrAttr" } ] }, { "name": "tf.ConvertToListOfSparseCoreCooTensors", "summary": "An op which converts the sparse/ragged/dense tensor into a list of COO tensor for each SparseCore.", "operands": [ { "name": "indices_or_row_splits", "type": "TF_Int32Tensor" }, { "name": "values", "type": "TF_Int32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" } ], "results": [ { "name": "row_ids_list", "type": "Variadic" }, { "name": "col_ids_list", "type": "Variadic" }, { "name": "gains_list", "type": "Variadic" } ], "attributes": [ { "name": "sample_count", "type": "ConfinedAttr]>" }, { "name": "row_offset", "type": "ConfinedAttr]>" }, { "name": "col_offset", "type": "ConfinedAttr]>" }, { "name": "col_shift", "type": "ConfinedAttr]>" }, { "name": "num_sc_shards", "type": "ConfinedAttr]>" }, { "name": "stacked_table_sample_count", "type": "ConfinedAttr]>" }, { "name": "combiner", "type": "StrAttr" } ] }, { "name": "tf.ConvertToSparseCoreCsrWrappedCooTensorOp", "summary": "An op which converts the sorted coo tensor into sparse core CSR wrapped COO format.", "operands": [ { "name": "sorted_row_ids_list", "type": "Variadic" }, { "name": "sorted_col_ids_list", "type": "Variadic" }, { "name": "sorted_gains_list", "type": "Variadic" }, { "name": "id_counts_list", "type": "Variadic" }, { "name": "splits", "type": "TF_Int64Tensor" } ], "results": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "row_pointers_unpadded_size", "type": "TF_Int32Tensor" }, { "name": "ids_unpadded_size", "type": "TF_Int32Tensor" }, { "name": "num_minibatches_per_sc", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "sample_count_per_sc", "type": "ConfinedAttr]>" }, { "name": "num_replica", "type": "ConfinedAttr]>" }, { "name": "max_minibatches_per_sc", "type": "ConfinedAttr]>" }, { "name": "max_ids_per_chip_per_sample", "type": "ConfinedAttr]>" }, { "name": "table_vocab_size", "type": "ConfinedAttr]>" }, { "name": "feature_width", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" }, { "name": "allow_id_dropping", "type": "BoolAttr" } ] }, { "name": "tf.Cos", "summary": "Computes cos of x element-wise.", "description": "Given an input tensor, this function computes cosine of every\n element in the tensor. Input range is `(-inf, inf)` and\n output range is `[-1,1]`. If input lies outside the boundary, `nan`\n is returned.\n\n ```python\n x = tf.constant([-float(\"inf\"), -9, -0.5, 1, 1.2, 200, 10000, float(\"inf\")])\n tf.math.cos(x) ==> [nan -0.91113025 0.87758255 0.5403023 0.36235774 0.48718765 -0.95215535 nan]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Cosh", "summary": "Computes hyperbolic cosine of x element-wise.", "description": "Given an input tensor, this function computes hyperbolic cosine of every\n element in the tensor. Input range is `[-inf, inf]` and output range\n is `[1, inf]`.\n\n ```python\n x = tf.constant([-float(\"inf\"), -9, -0.5, 1, 1.2, 2, 10, float(\"inf\")])\n tf.math.cosh(x) ==> [inf 4.0515420e+03 1.1276259e+00 1.5430807e+00 1.8106556e+00 3.7621956e+00 1.1013233e+04 inf]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.CreateSummaryDbWriter", "summary": "Creates summary database writer accessible by given resource handle.", "description": "This can be used to write tensors from the execution graph directly\nto a database. Only SQLite is supported right now. This function\nwill create the schema if it doesn't exist. Entries in the Users,\nExperiments, and Runs tables will be created automatically if they\ndon't already exist.\n\nwriter: Handle to SummaryWriter resource to overwrite.\ndb_uri: For example \"file:/tmp/foo.sqlite\".\nexperiment_name: Can't contain ASCII control characters or <>. Case\n sensitive. If empty, then the Run will not be associated with any\n Experiment.\nrun_name: Can't contain ASCII control characters or <>. Case sensitive.\n If empty, then each Tag will not be associated with any Run.\nuser_name: Must be valid as both a DNS label and Linux username. If\n empty, then the Experiment will not be associated with any User.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "db_uri", "type": "TF_StrTensor" }, { "name": "experiment_name", "type": "TF_StrTensor" }, { "name": "run_name", "type": "TF_StrTensor" }, { "name": "user_name", "type": "TF_StrTensor" } ] }, { "name": "tf.CreateSummaryFileWriter", "summary": "Creates a summary file writer accessible by the given resource handle.", "description": "writer: A handle to the summary writer resource\nlogdir: Directory where the event file will be written.\nmax_queue: Size of the queue of pending events and summaries.\nflush_millis: How often, in milliseconds, to flush the pending events and\n summaries to disk.\nfilename_suffix: Every event file's name is suffixed with this suffix.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "logdir", "type": "TF_StrTensor" }, { "name": "max_queue", "type": "TF_Int32Tensor" }, { "name": "flush_millis", "type": "TF_Int32Tensor" }, { "name": "filename_suffix", "type": "TF_StrTensor" } ] }, { "name": "tf.Cross", "summary": "Compute the pairwise cross product.", "description": "`a` and `b` must be the same shape; they can either be simple 3-element vectors,\nor any shape where the innermost dimension is 3. In the latter case, each pair\nof corresponding 3-element vectors is cross-multiplied independently.", "operands": [ { "name": "a", "type": "TF_IntOrFpTensor" }, { "name": "b", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "product", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.CrossReplicaSum", "summary": "An Op to sum inputs across replicated TPU instances.", "description": "Each instance supplies its own input.\n\nFor example, suppose there are 8 TPU instances: `[A, B, C, D, E, F, G, H]`.\nPassing group_assignment=`[[0,2,4,6],[1,3,5,7]]` sets `A, C, E, G` as group 0,\nand `B, D, F, H` as group 1. Thus we get the outputs:\n`[A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Uint32 ]>" }, { "name": "group_assignment", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Uint32 ]>" } ] }, { "name": "tf.Cumprod", "summary": "Compute the cumulative product of the tensor `x` along `axis`.", "description": "By default, this op performs an inclusive cumprod, which means that the first\nelement of the input is identical to the first element of the output:\n\n```python\ntf.cumprod([a, b, c]) # => [a, a * b, a * b * c]\n```\n\nBy setting the `exclusive` kwarg to `True`, an exclusive cumprod is\nperformed instead:\n\n```python\ntf.cumprod([a, b, c], exclusive=True) # => [1, a, a * b]\n```\n\nBy setting the `reverse` kwarg to `True`, the cumprod is performed in the\nopposite direction:\n\n```python\ntf.cumprod([a, b, c], reverse=True) # => [a * b * c, b * c, c]\n```\n\nThis is more efficient than using separate `tf.reverse` ops.\n\nThe `reverse` and `exclusive` kwargs can also be combined:\n\n```python\ntf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1]\n```", "operands": [ { "name": "x", "type": "TF_NumberTensor" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "out", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "exclusive", "type": "DefaultValuedOptionalAttr" }, { "name": "reverse", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Cumsum", "summary": "Compute the cumulative sum of the tensor `x` along `axis`.", "description": "By default, this op performs an inclusive cumsum, which means that the first\nelement of the input is identical to the first element of the output:\n\n```python\ntf.cumsum([a, b, c]) # => [a, a + b, a + b + c]\n```\n\nBy setting the `exclusive` kwarg to `True`, an exclusive cumsum is\nperformed instead:\n\n```python\ntf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]\n```\n\nBy setting the `reverse` kwarg to `True`, the cumsum is performed in the\nopposite direction:\n\n```python\ntf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]\n```\n\nThis is more efficient than using separate `tf.reverse` ops.\n\nThe `reverse` and `exclusive` kwargs can also be combined:\n\n```python\ntf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]\n```", "operands": [ { "name": "x", "type": "TF_NumberTensor" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "out", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "exclusive", "type": "DefaultValuedOptionalAttr" }, { "name": "reverse", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.CumulativeLogsumexp", "summary": "Compute the cumulative product of the tensor `x` along `axis`.", "description": "By default, this op performs an inclusive cumulative log-sum-exp,\nwhich means that the first\nelement of the input is identical to the first element of the output:\n```python\ntf.math.cumulative_logsumexp([a, b, c]) # => [a, log(exp(a) + exp(b)), log(exp(a) + exp(b) + exp(c))]\n```\n\nBy setting the `exclusive` kwarg to `True`, an exclusive cumulative log-sum-exp is\nperformed instead:\n```python\ntf.cumulative_logsumexp([a, b, c], exclusive=True) # => [-inf, a, log(exp(a) * exp(b))]\n```\nNote that the neutral element of the log-sum-exp operation is `-inf`,\nhowever, for performance reasons, the minimal value representable by the\nfloating point type is used instead.\n\nBy setting the `reverse` kwarg to `True`, the cumulative log-sum-exp is performed in the\nopposite direction.", "operands": [ { "name": "x", "type": "TF_FloatTensor" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "out", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "exclusive", "type": "DefaultValuedOptionalAttr" }, { "name": "reverse", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DataFormatDimMap", "summary": "Returns the dimension index in the destination data format given the one in", "description": "the source data format.", "operands": [ { "name": "x", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "y", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "src_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dst_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DataFormatVecPermute", "summary": "Permute input tensor from `src_format` to `dst_format`.", "description": "Given source and destination format strings of length n=4 or 5, the input\ntensor must be a vector of size n or n-2, or a 2D tensor of shape\n(n, 2) or (n-2, 2).\n\nIf the first dimension of the input tensor is n-2, it is assumed that\nnon-spatial dimensions are omitted (i.e `N`, `C`).\n\nFor example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and input:\n```\n[1, 2, 3, 4]\n```\n, the output will be:\n```\n[1, 4, 2, 3]\n```\nWith `src_format` of `NDHWC`, `dst_format` of `NCDHW`, and input:\n```\n[[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]\n```\n, the output will be:\n```\n[[1, 6], [5, 10], [2, 7], [3, 8], [4, 9]]\n```\nWith `src_format` of `NHWC`, `dst_format` of `NCHW`, and input:\n```\n[1, 2]\n```\n, the output will be:\n```\n[1, 2]\n```", "operands": [ { "name": "x", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "y", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "src_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dst_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DebugIdentity", "summary": "Provides an identity mapping of the non-Ref type input tensor for debugging.", "description": "Provides an identity mapping of the non-Ref type input tensor for debugging.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "device_name", "type": "DefaultValuedOptionalAttr" }, { "name": "tensor_name", "type": "DefaultValuedOptionalAttr" }, { "name": "debug_urls", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "gated_grpc", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DebugIdentityV2", "summary": "Debug Identity V2 Op.", "description": "Provides an identity mapping from input to output, while writing the content of\nthe input tensor by calling DebugEventsWriter.\n\nThe semantics of the input tensor depends on tensor_debug_mode. In typical\nusage, the input tensor comes directly from the user computation only when\ngraph_debug_mode is FULL_TENSOR (see protobuf/debug_event.proto for a\nlist of all the possible values of graph_debug_mode). For the other debug modes,\nthe input tensor should be produced by an additional op or subgraph that\ncomputes summary information about one or more tensors.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "tfdbg_context_id", "type": "DefaultValuedOptionalAttr" }, { "name": "op_name", "type": "DefaultValuedOptionalAttr" }, { "name": "output_slot", "type": "DefaultValuedOptionalAttr" }, { "name": "tensor_debug_mode", "type": "DefaultValuedOptionalAttr" }, { "name": "debug_urls", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "circular_buffer_size", "type": "DefaultValuedOptionalAttr" }, { "name": "tfdbg_run_id", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DecodeAndCropJpeg", "summary": "Decode and Crop a JPEG-encoded image to a uint8 tensor.", "description": "The attr `channels` indicates the desired number of color channels for the\ndecoded image.\n\nAccepted values are:\n\n* 0: Use the number of channels in the JPEG-encoded image.\n* 1: output a grayscale image.\n* 3: output an RGB image.\n\nIf needed, the JPEG-encoded image is transformed to match the requested number\nof color channels.\n\nThe attr `ratio` allows downscaling the image by an integer factor during\ndecoding. Allowed values are: 1, 2, 4, and 8. This is much faster than\ndownscaling the image later.\n\n\nIt is equivalent to a combination of decode and crop, but much faster by only\ndecoding partial jpeg image.", "operands": [ { "name": "contents", "type": "TF_StrTensor" }, { "name": "crop_window", "type": "TF_Int32Tensor" } ], "results": [ { "name": "image", "type": "TF_Uint8Tensor" } ], "attributes": [ { "name": "channels", "type": "DefaultValuedOptionalAttr" }, { "name": "ratio", "type": "DefaultValuedOptionalAttr" }, { "name": "fancy_upscaling", "type": "DefaultValuedOptionalAttr" }, { "name": "try_recover_truncated", "type": "DefaultValuedOptionalAttr" }, { "name": "acceptable_fraction", "type": "DefaultValuedOptionalAttr" }, { "name": "dct_method", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DecodeGif", "summary": "Decode the frame(s) of a GIF-encoded image to a uint8 tensor.", "description": "GIF images with frame or transparency compression are not supported.\nOn Linux and MacOS systems, convert animated GIFs from compressed to\nuncompressed by running:\n\n convert $src.gif -coalesce $dst.gif\n\nThis op also supports decoding JPEGs and PNGs, though it is cleaner to use\n`tf.io.decode_image`.", "operands": [ { "name": "contents", "type": "TF_StrTensor" } ], "results": [ { "name": "image", "type": "TF_Uint8Tensor" } ] }, { "name": "tf.DecodeJpeg", "summary": "Decode a JPEG-encoded image to a uint8 tensor.", "description": "The attr `channels` indicates the desired number of color channels for the\ndecoded image.\n\nAccepted values are:\n\n* 0: Use the number of channels in the JPEG-encoded image.\n* 1: output a grayscale image.\n* 3: output an RGB image.\n\nIf needed, the JPEG-encoded image is transformed to match the requested number\nof color channels.\n\nThe attr `ratio` allows downscaling the image by an integer factor during\ndecoding. Allowed values are: 1, 2, 4, and 8. This is much faster than\ndownscaling the image later.\n\n\nThis op also supports decoding PNGs and non-animated GIFs since the interface is\nthe same, though it is cleaner to use `tf.io.decode_image`.", "operands": [ { "name": "contents", "type": "TF_StrTensor" } ], "results": [ { "name": "image", "type": "TF_Uint8Tensor" } ], "attributes": [ { "name": "channels", "type": "DefaultValuedOptionalAttr" }, { "name": "ratio", "type": "DefaultValuedOptionalAttr" }, { "name": "fancy_upscaling", "type": "DefaultValuedOptionalAttr" }, { "name": "try_recover_truncated", "type": "DefaultValuedOptionalAttr" }, { "name": "acceptable_fraction", "type": "DefaultValuedOptionalAttr" }, { "name": "dct_method", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DecodePaddedRaw", "summary": "Reinterpret the bytes of a string as a vector of numbers.", "operands": [ { "name": "input_bytes", "type": "TF_StrTensor" }, { "name": "fixed_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint8 ]>" } ], "attributes": [ { "name": "little_endian", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DecodePng", "summary": "Decode a PNG-encoded image to a uint8 or uint16 tensor.", "description": "The attr `channels` indicates the desired number of color channels for the\ndecoded image.\n\nAccepted values are:\n\n* 0: Use the number of channels in the PNG-encoded image.\n* 1: output a grayscale image.\n* 3: output an RGB image.\n* 4: output an RGBA image.\n\nIf needed, the PNG-encoded image is transformed to match the requested number\nof color channels.\n\nThis op also supports decoding JPEGs and non-animated GIFs since the interface\nis the same, though it is cleaner to use `tf.io.decode_image`.", "operands": [ { "name": "contents", "type": "TF_StrTensor" } ], "results": [ { "name": "image", "type": "TensorOf<[ TF_Uint16, TF_Uint8 ]>" } ], "attributes": [ { "name": "channels", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DeleteIterator", "summary": "A container for an iterator resource.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.DeleteMemoryCache", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.DeleteMultiDeviceIterator", "summary": "A container for an iterator resource.", "operands": [ { "name": "multi_device_iterator", "type": "TF_ResourceTensor" }, { "name": "iterators", "type": "Variadic" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.DeleteRandomSeedGenerator", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.DeleteSeedGenerator", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "deleter", "type": "TF_VariantTensor" } ] }, { "name": "tf.DepthToSpace", "summary": "DepthToSpace for tensors of type T.", "description": "Rearranges data from depth into blocks of spatial data.\nThis is the reverse transformation of SpaceToDepth. More specifically,\nthis op outputs a copy of the input tensor where values from the `depth`\ndimension are moved in spatial blocks to the `height` and `width` dimensions.\nThe attr `block_size` indicates the input block size and how the data is moved.\n\n * Chunks of data of size `block_size * block_size` from depth are rearranged\n into non-overlapping blocks of size `block_size x block_size`\n * The width of the output tensor is `input_depth * block_size`, whereas the\n height is `input_height * block_size`.\n * The Y, X coordinates within each block of the output image are determined\n by the high order component of the input channel index.\n * The depth of the input tensor must be divisible by\n `block_size * block_size`.\n\nThe `data_format` attr specifies the layout of the input and output tensors\nwith the following options:\n \"NHWC\": `[ batch, height, width, channels ]`\n \"NCHW\": `[ batch, channels, height, width ]`\n \"NCHW_VECT_C\":\n `qint8 [ batch, channels / 4, height, width, 4 ]`\n\nIt is useful to consider the operation as transforming a 6-D Tensor.\ne.g. for data_format = NHWC,\n Each element in the input tensor can be specified via 6 coordinates,\n ordered by decreasing memory layout significance as:\n n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates\n within the input image, bX, bY means coordinates\n within the output block, oC means output channels).\n The output would be the input transposed to the following layout:\n n,iY,bY,iX,bX,oC\n\nThis operation is useful for resizing the activations between convolutions\n(but keeping all data), e.g. instead of pooling. It is also useful for training\npurely convolutional models.\n\nFor example, given an input of shape `[1, 1, 1, 4]`, data_format = \"NHWC\" and\nblock_size = 2:\n\n```\nx = [[[[1, 2, 3, 4]]]]\n\n```\n\nThis operation will output a tensor of shape `[1, 2, 2, 1]`:\n\n```\n [[[[1], [2]],\n [[3], [4]]]]\n```\n\nHere, the input has a batch of 1 and each batch element has shape `[1, 1, 4]`,\nthe corresponding output will have 2x2 elements and will have a depth of\n1 channel (1 = `4 / (block_size * block_size)`).\nThe output element shape is `[2, 2, 1]`.\n\nFor an input tensor with larger depth, here of shape `[1, 1, 1, 12]`, e.g.\n\n```\nx = [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]\n```\n\nThis operation, for block size of 2, will return the following tensor of shape\n`[1, 2, 2, 3]`\n\n```\n [[[[1, 2, 3], [4, 5, 6]],\n [[7, 8, 9], [10, 11, 12]]]]\n\n```\n\nSimilarly, for the following input of shape `[1 2 2 4]`, and a block size of 2:\n\n```\nx = [[[[1, 2, 3, 4],\n [5, 6, 7, 8]],\n [[9, 10, 11, 12],\n [13, 14, 15, 16]]]]\n```\n\nthe operator will return the following tensor of shape `[1 4 4 1]`:\n\n```\nx = [[[ [1], [2], [5], [6]],\n [ [3], [4], [7], [8]],\n [ [9], [10], [13], [14]],\n [ [11], [12], [15], [16]]]]\n\n```", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "block_size", "type": "ConfinedAttr]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" } ] }, { "name": "tf.DepthwiseConv2dNative", "summary": "Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors.", "description": "Given an input tensor of shape `[batch, in_height, in_width, in_channels]`\nand a filter / kernel tensor of shape\n`[filter_height, filter_width, in_channels, channel_multiplier]`, containing\n`in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies\na different filter to each input channel (expanding from 1 channel to\n`channel_multiplier` channels for each), then concatenates the results\ntogether. Thus, the output has `in_channels * channel_multiplier` channels.\n\n```\nfor k in 0..in_channels-1\n for q in 0..channel_multiplier-1\n output[b, i, j, k * channel_multiplier + q] =\n sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *\n filter[di, dj, k, q]\n```\n\nMust have `strides[0] = strides[3] = 1`. For the most common case of the same\nhorizontal and vertices strides, `strides = [1, stride, stride, 1]`.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "filter", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.DepthwiseConv2dNativeBackpropFilter", "summary": "Computes the gradients of depthwise convolution with respect to the filter.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "filter_sizes", "type": "TF_Int32Tensor" }, { "name": "out_backprop", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.DepthwiseConv2dNativeBackpropInput", "summary": "Computes the gradients of depthwise convolution with respect to the input.", "operands": [ { "name": "input_sizes", "type": "TF_Int32Tensor" }, { "name": "filter", "type": "TF_FloatTensor" }, { "name": "out_backprop", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Dequantize", "summary": "Dequantize the 'input' tensor into a float or bfloat16 Tensor.", "description": "[min_range, max_range] are scalar floats that specify the range for\nthe output. The 'mode' attribute controls exactly which calculations are\nused to convert the float values to their quantized equivalents.\n\nIn 'MIN_COMBINED' mode, each value of the tensor will undergo the following:\n\n```\nif T == qint8: in[i] += (range(T) + 1)/ 2.0\nout[i] = min_range + (in[i]* (max_range - min_range) / range(T))\n```\nhere `range(T) = numeric_limits::max() - numeric_limits::min()`\n\n*MIN_COMBINED Mode Example*\n\nIf the input comes from a QuantizedRelu6, the output type is\nquint8 (range of 0-255) but the possible range of QuantizedRelu6 is\n0-6. The min_range and max_range values are therefore 0.0 and 6.0.\nDequantize on quint8 will take each value, cast to float, and multiply\nby 6 / 255.\nNote that if quantizedtype is qint8, the operation will additionally add\neach value by 128 prior to casting.\n\nIf the mode is 'MIN_FIRST', then this approach is used:\n\n```c++\nnum_discrete_values = 1 << (# of bits in T)\nrange_adjust = num_discrete_values / (num_discrete_values - 1)\nrange = (range_max - range_min) * range_adjust\nrange_scale = range / num_discrete_values\nconst double offset_input = static_cast(input) - lowest_quantized;\nresult = range_min + ((input - numeric_limits::min()) * range_scale)\n```\n\nIf the mode is `SCALED`, dequantization is performed by multiplying each\ninput value by a scaling_factor. (Thus an input of 0 always maps to 0.0).\n\nThe scaling_factor is determined from `min_range`, `max_range`, and\n`narrow_range` in a way that is compatible with `QuantizeAndDequantize{V2|V3}`\nand `QuantizeV2`, using the following algorithm:\n\n```c++\n\n const int min_expected_T = std::numeric_limits::min() +\n (narrow_range ? 1 : 0);\n const int max_expected_T = std::numeric_limits::max();\n const float max_expected_T = std::numeric_limits::max();\n\n const float scale_factor =\n (std::numeric_limits::min() == 0) ? (max_range / max_expected_T)\n : std::max(min_range / min_expected_T,\n max_range / max_expected_T);\n```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8]>" }, { "name": "min_range", "type": "TF_Float32Tensor" }, { "name": "max_range", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Float32]>" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedOptionalAttr, \"MIN_COMBINED\">" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" }, { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DeserializeIterator", "summary": "Converts the given variant tensor to an iterator and stores it in the given resource.", "operands": [ { "name": "resource_handle", "type": "TF_ResourceTensor" }, { "name": "serialized", "type": "TF_VariantTensor" } ] }, { "name": "tf.DeserializeSparse", "summary": "Deserialize `SparseTensor` objects.", "description": "The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where\nthe last dimension stores serialized `SparseTensor` objects and the other N\ndimensions (N >= 0) correspond to a batch. The ranks of the original\n`SparseTensor` objects must all match. When the final `SparseTensor` is\ncreated, its rank is the rank of the incoming `SparseTensor` objects plus N;\nthe sparse tensors have been concatenated along new dimensions, one for each\nbatch.\n\nThe output `SparseTensor` object's shape values for the original dimensions\nare the max across the input `SparseTensor` objects' shape values for the\ncorresponding dimensions. The new dimensions match the size of the batch.\n\nThe input `SparseTensor` objects' indices are assumed ordered in\nstandard lexicographic order. If this is not the case, after this\nstep run `SparseReorder` to restore index ordering.\n\nFor example, if the serialized input is a `[2 x 3]` matrix representing two\noriginal `SparseTensor` objects:\n\n index = [ 0]\n [10]\n [20]\n values = [1, 2, 3]\n shape = [50]\n\nand\n\n index = [ 2]\n [10]\n values = [4, 5]\n shape = [30]\n\nthen the final deserialized `SparseTensor` will be:\n\n index = [0 0]\n [0 10]\n [0 20]\n [1 2]\n [1 10]\n values = [1, 2, 3, 4, 5]\n shape = [2 50]", "operands": [ { "name": "serialized_sparse", "type": "TensorOf<[ TF_Str, TF_Variant ]>" } ], "results": [ { "name": "sparse_indices", "type": "TF_Int64Tensor" }, { "name": "sparse_values", "type": "TF_Tensor" }, { "name": "sparse_shape", "type": "TF_Int64Tensor" } ] }, { "name": "tf.DestroyResourceOp", "summary": "Deletes the resource specified by the handle.", "description": "All subsequent operations using the resource will result in a NotFound\nerror status.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "ignore_lookup_error", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.DeviceIndex", "summary": "Return the index of device the op runs.", "description": "Given a list of device names, this operation returns the index of the device\nthis op runs. The length of the list is returned in two cases:\n(1) Device does not exist in the given device list.\n(2) It is in XLA compilation.", "results": [ { "name": "index", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "device_names", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.Diag", "summary": "Returns a diagonal tensor with a given diagonal values.", "description": "Given a `diagonal`, this operation returns a tensor with the `diagonal` and\neverything else padded with zeros. The diagonal is computed as follows:\n\nAssume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of\nrank 2k with dimensions [D1,..., Dk, D1,..., Dk] where:\n\n`output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else.\n\nFor example:\n\n```\n# 'diagonal' is [1, 2, 3, 4]\ntf.diag(diagonal) ==> [[1, 0, 0, 0]\n [0, 2, 0, 0]\n [0, 0, 3, 0]\n [0, 0, 0, 4]]\n```", "operands": [ { "name": "diagonal", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ] }, { "name": "tf.DiagPart", "summary": "Returns the diagonal part of the tensor.", "description": "This operation returns a tensor with the `diagonal` part\nof the `input`. The `diagonal` part is computed as follows:\n\nAssume `input` has dimensions `[D1,..., Dk, D1,..., Dk]`, then the output is a\ntensor of rank `k` with dimensions `[D1,..., Dk]` where:\n\n`diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]`.\n\nFor example:\n\n```\n# 'input' is [[1, 0, 0, 0]\n [0, 2, 0, 0]\n [0, 0, 3, 0]\n [0, 0, 0, 4]]\n\ntf.diag_part(input) ==> [1, 2, 3, 4]\n```", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "diagonal", "type": "TensorOf<[ TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ] }, { "name": "tf.Digamma", "summary": "Computes Psi, the derivative of Lgamma (the log of the absolute value of", "description": "`Gamma(x)`), element-wise.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.DisableCopyOnRead", "summary": "Turns off the copy-on-read mode.", "description": "Turns off the copy-on-read mode of a resource variable. If the variable is not in copy-on-read mode, this op has no effect.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" } ] }, { "name": "tf.Div", "summary": "Returns x / y element-wise.", "description": "*NOTE*: `Div` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.DivNoNan", "summary": "Returns 0 if the denominator is zero.", "description": "*NOTE*: `DivNoNan` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" }, { "name": "y", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.DummyMemoryCache", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ] }, { "name": "tf.DummySeedGenerator", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ] }, { "name": "tf.DynamicEnqueueTPUEmbeddingArbitraryTensorBatch", "summary": "Eases the porting of code that uses tf.nn.embedding_lookup_sparse().", "description": "embedding_indices[i] and aggregation_weights[i] correspond\nto the ith feature.\n\nThe tensors at corresponding positions in the three input lists (sample_indices,\nembedding_indices and aggregation_weights) must have the same shape, i.e. rank 1\nwith dim_size() equal to the total number of lookups into the table described by\nthe corresponding feature.", "operands": [ { "name": "sample_indices_or_row_splits", "type": "Variadic" }, { "name": "embedding_indices", "type": "Variadic" }, { "name": "aggregation_weights", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" }, { "name": "device_ordinal", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "combiners", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.DynamicPartition", "summary": "Partitions `data` into `num_partitions` tensors using indices from `partitions`.", "description": "For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]`\nbecomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i`\nare placed in `outputs[i]` in lexicographic order of `js`, and the first\ndimension of `outputs[i]` is the number of entries in `partitions` equal to `i`.\nIn detail,\n\n```python\n outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]\n\n outputs[i] = pack([data[js, ...] for js if partitions[js] == i])\n```\n\n`data.shape` must start with `partitions.shape`.\n\nFor example:\n\n```python\n # Scalar partitions.\n partitions = 1\n num_partitions = 2\n data = [10, 20]\n outputs[0] = [] # Empty with shape [0, 2]\n outputs[1] = [[10, 20]]\n\n # Vector partitions.\n partitions = [0, 0, 1, 1, 0]\n num_partitions = 2\n data = [10, 20, 30, 40, 50]\n outputs[0] = [10, 20, 50]\n outputs[1] = [30, 40]\n```\n\nSee `dynamic_stitch` for an example on how to merge partitions back.\n\n
\n\n
\n\n\nRaises:\n * `InvalidArgumentError` in following cases:\n - If partitions is not in range `[0, num_partiions)`\n - If `partitions.shape` does not match prefix of `data.shape` argument.", "operands": [ { "name": "data", "type": "TF_Tensor" }, { "name": "partitions", "type": "TF_Int32Tensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ] }, { "name": "tf.DynamicStitch", "summary": "Interleave the values from the `data` tensors into a single tensor.", "description": "Builds a merged tensor such that\n\n```python\n merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]\n```\n\nFor example, if each `indices[m]` is scalar or vector, we have\n\n```python\n # Scalar indices:\n merged[indices[m], ...] = data[m][...]\n\n # Vector indices:\n merged[indices[m][i], ...] = data[m][i, ...]\n```\n\nEach `data[i].shape` must start with the corresponding `indices[i].shape`,\nand the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we\nmust have `data[i].shape = indices[i].shape + constant`. In terms of this\n`constant`, the output shape is\n\n merged.shape = [max(indices) + 1] + constant\n\nValues are merged in order, so if an index appears in both `indices[m][i]` and\n`indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the\nmerged result. If you do not need this guarantee, ParallelDynamicStitch might\nperform better on some devices.\n\nFor example:\n\n```python\n indices[0] = 6\n indices[1] = [4, 1]\n indices[2] = [[5, 2], [0, 3]]\n data[0] = [61, 62]\n data[1] = [[41, 42], [11, 12]]\n data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]\n merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],\n [51, 52], [61, 62]]\n```\n\nThis method can be used to merge partitions created by `dynamic_partition`\nas illustrated on the following example:\n\n```python\n # Apply function (increments x_i) on elements for which a certain condition\n # apply (x_i != -1 in this example).\n x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])\n condition_mask=tf.not_equal(x,tf.constant(-1.))\n partitioned_data = tf.dynamic_partition(\n x, tf.cast(condition_mask, tf.int32) , 2)\n partitioned_data[1] = partitioned_data[1] + 1.0\n condition_indices = tf.dynamic_partition(\n tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)\n x = tf.dynamic_stitch(condition_indices, partitioned_data)\n # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain\n # unchanged.\n```\n\n
\n\n
", "operands": [ { "name": "indices", "type": "Variadic" }, { "name": "data", "type": "Variadic" } ], "results": [ { "name": "merged", "type": "TF_Tensor" } ] }, { "name": "tf.Einsum", "summary": "Tensor contraction according to Einstein summation convention.", "description": "Implements generalized Tensor contraction and reduction. Each input Tensor must\nhave a corresponding input subscript appearing in the comma-separated left-hand\nside of the equation. The right-hand side of the equation consists of the\noutput subscript. The input subscripts and the output subscript should consist\nof zero or more named axis labels and at most one ellipsis (`...`).\n\nThe named axis labels may be any single character other than those having\nspecial meaning, namely `,.->`. The behavior of this Op is undefined if it\nreceives an ill-formatted equation; since the validation is done at\ngraph-building time, we omit format validation checks at runtime.\n\nNote: This Op is *not* intended to be called by the user; instead users should\ncall `tf.einsum` directly. It is a hidden Op used by `tf.einsum`.\n\nOperations are applied to the input(s) according to the following rules:\n\n (a) Generalized Diagonals: For input dimensions corresponding to axis labels\n appearing more than once in the same input subscript, we take the\n generalized (`k`-dimensional) diagonal.\n For example, in the equation `iii->i` with input shape `[3, 3, 3]`, the\n generalized diagonal would consist of `3` elements at indices `(0, 0, 0)`,\n `(1, 1, 1)` and `(2, 2, 2)` to create a Tensor of shape `[3]`.\n\n (b) Reduction: Axes corresponding to labels appearing only in one input\n subscript but not in the output subscript are summed over prior to Tensor\n contraction.\n For example, in the equation `ab,bc->b`, the axis labels `a` and `c` are\n the reduction axis labels.\n\n (c) Batch Dimensions: Axes corresponding to labels appearing in each of the\n input subscripts and also in the output subscript make up the batch\n dimensions in Tensor contraction. Unnamed axis labels corresponding to\n ellipsis (`...`) also correspond to batch dimensions.\n For example, for the equation denoting batch matrix multiplication,\n `bij,bjk->bik`, the axis label `b` corresponds to a batch dimension.\n\n (d) Contraction: In case of binary einsum, axes corresponding to labels\n appearing in two different inputs (and not in the output) are contracted\n against each other.\n Considering the batch matrix multiplication equation again\n (`bij,bjk->bik`), the contracted axis label is `j`.\n\n (e) Expand Diagonal: If the output subscripts contain repeated (explicit) axis\n labels, the opposite operation of (a) is applied. For example, in the\n equation `i->iii`, and input shape `[3]`, the output of shape `[3, 3, 3]`\n are all zeros, except for the (generalized) diagonal which is populated\n with values from the input.\n Note: This operation is not supported by `np.einsum` or `tf.einsum`; it is\n provided to enable computing the symbolic gradient of `tf.einsum`.\n\nThe output subscripts must contain only labels appearing in at least one of the\ninput subscripts. Furthermore, all dimensions mapping to the same axis label\nmust be equal.\n\nAny of the input and output subscripts may contain at most a single ellipsis\n(`...`). These ellipsis are mapped against dimensions not corresponding to any\nnamed axis label. If two inputs contain ellipsis, then they are broadcasted\naccording to standard NumPy broadcasting\n[rules](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html).\n\nThe broadcasted dimensions are placed in the corresponding location of the\nellipsis in the output subscript. If the broadcasted dimensions are non-empty\nand the output subscripts do not contain ellipsis, then an InvalidArgument error\nis raised.\n\n@compatibility(numpy)\nSimilar to [`numpy.einsum`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html).\n\nComparison with `numpy.einsum`:\n\n * This Op only supports unary and binary forms of `numpy.einsum`.\n * This Op does not support implicit form. (i.e. equations without `->`).\n * This Op also supports repeated indices in the output subscript, which is not\n supported by `numpy.einsum`.\n@end_compatibility", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "equation", "type": "StrAttr" } ] }, { "name": "tf.Elu", "summary": "Computes the exponential linear function.", "description": "The ELU function is defined as:\n\n * $ e ^ x - 1 $ if $ x < 0 $\n * $ x $ if $ x >= 0 $\n\nExamples:\n\n>>> tf.nn.elu(1.0)\n\n>>> tf.nn.elu(0.0)\n\n>>> tf.nn.elu(-1000.0)\n\n\nSee [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)\n](http://arxiv.org/abs/1511.07289)", "operands": [ { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "activations", "type": "TF_FloatTensor" } ] }, { "name": "tf.EluGrad", "summary": "Computes gradients for the exponential linear (Elu) operation.", "operands": [ { "name": "gradients", "type": "TF_FloatTensor" }, { "name": "outputs", "type": "TF_FloatTensor" } ], "results": [ { "name": "backprops", "type": "TF_FloatTensor" } ] }, { "name": "tf.Empty", "summary": "Creates a tensor with the given shape.\n\nThis operation creates a tensor of `shape` and `dtype`.", "operands": [ { "name": "shape", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "init", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.EmptyTensorList", "summary": "Creates and returns an empty tensor list.", "description": "All list elements must be tensors of dtype element_dtype and shape compatible\nwith element_shape.\n\nhandle: an empty tensor list.\nelement_dtype: the type of elements in the list.\nelement_shape: a shape compatible with that of elements in the list.", "operands": [ { "name": "element_shape", "type": "TF_I32OrI64Tensor" }, { "name": "max_num_elements", "type": "TF_Int32Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ] }, { "name": "tf.EncodePng", "summary": "PNG-encode an image.", "description": "`image` is a 3-D uint8 or uint16 Tensor of shape `[height, width, channels]`\nwhere `channels` is:\n\n* 1: for grayscale.\n* 2: for grayscale + alpha.\n* 3: for RGB.\n* 4: for RGBA.\n\nThe ZLIB compression level, `compression`, can be -1 for the PNG-encoder\ndefault or a value from 0 to 9. 9 is the highest compression level, generating\nthe smallest output, but is slower.", "operands": [ { "name": "image", "type": "TensorOf<[ TF_Uint16, TF_Uint8 ]>" } ], "results": [ { "name": "contents", "type": "TF_StrTensor" } ], "attributes": [ { "name": "compression", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.EnqueueTPUEmbeddingArbitraryTensorBatch", "summary": "Eases the porting of code that uses tf.nn.embedding_lookup_sparse().", "description": "embedding_indices[i] and aggregation_weights[i] correspond\nto the ith feature.\n\nThe tensors at corresponding positions in the three input lists (sample_indices,\nembedding_indices and aggregation_weights) must have the same shape, i.e. rank 1\nwith dim_size() equal to the total number of lookups into the table described by\nthe corresponding feature.", "operands": [ { "name": "sample_indices_or_row_splits", "type": "Variadic" }, { "name": "embedding_indices", "type": "Variadic" }, { "name": "aggregation_weights", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" } ], "attributes": [ { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" }, { "name": "combiners", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.EnqueueTPUEmbeddingBatch", "summary": "An op that enqueues a list of input batch tensors to TPUEmbedding.", "description": "An op that enqueues a list of input batch tensors to TPUEmbedding.", "operands": [ { "name": "batch", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" } ], "attributes": [ { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" }, { "name": "combiners", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.EnqueueTPUEmbeddingIntegerBatch", "summary": "An op that enqueues a list of input batch tensors to TPUEmbedding.", "operands": [ { "name": "batch", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" } ], "attributes": [ { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.EnqueueTPUEmbeddingRaggedTensorBatch", "summary": "Eases the porting of code that uses tf.nn.embedding_lookup().", "description": "sample_splits[i], embedding_indices[i] and aggregation_weights[i] correspond\nto the ith feature. table_ids[i] indicates which embedding table to look up ith\nfeature.\n\nThe tensors at corresponding positions in two of the input lists,\nembedding_indices and aggregation_weights, must have the same shape, i.e. rank 1\nwith dim_size() equal to the total number of lookups into the table described by\nthe corresponding feature.", "operands": [ { "name": "sample_splits", "type": "Variadic" }, { "name": "embedding_indices", "type": "Variadic" }, { "name": "aggregation_weights", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" } ], "attributes": [ { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" }, { "name": "combiners", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "table_ids", "type": "TypedArrayAttrBase" }, { "name": "max_sequence_lengths", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "num_features", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.EnqueueTPUEmbeddingSparseBatch", "summary": "An op that enqueues TPUEmbedding input indices from a SparseTensor.", "description": "This Op eases the porting of code that uses embedding_lookup_sparse(),\nalthough some Python preprocessing of the SparseTensor arguments to\nembedding_lookup_sparse() is required to produce the arguments to this Op,\nsince only a single EnqueueTPUEmbeddingSparseBatch Op is allowed per training\nstep.\n\nThe tensors at corresponding positions in the three input lists\nmust have the same shape, i.e. rank 1 with dim_size() equal to the total\nnumber of lookups into the table described by the corresponding table_id.", "operands": [ { "name": "sample_indices", "type": "Variadic" }, { "name": "embedding_indices", "type": "Variadic" }, { "name": "aggregation_weights", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" } ], "attributes": [ { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" }, { "name": "combiners", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.EnqueueTPUEmbeddingSparseTensorBatch", "summary": "Eases the porting of code that uses tf.nn.embedding_lookup_sparse().", "description": "sample_indices[i], embedding_indices[i] and aggregation_weights[i] correspond\nto the ith feature. table_ids[i] indicates which embedding table to look up ith\nfeature.\n\nThe tensors at corresponding positions in the three input lists (sample_indices,\nembedding_indices and aggregation_weights) must have the same shape, i.e. rank 1\nwith dim_size() equal to the total number of lookups into the table described by\nthe corresponding feature.", "operands": [ { "name": "sample_indices", "type": "Variadic" }, { "name": "embedding_indices", "type": "Variadic" }, { "name": "aggregation_weights", "type": "Variadic" }, { "name": "mode_override", "type": "TF_StrTensor" } ], "attributes": [ { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" }, { "name": "combiners", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "table_ids", "type": "TypedArrayAttrBase" }, { "name": "max_sequence_lengths", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "num_features", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.EnsureShape", "summary": "Ensures that the tensor's shape matches the expected shape.", "description": "Raises an error if the input tensor's shape does not match the specified shape.\nReturns the input tensor otherwise.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" } ] }, { "name": "tf.Equal", "summary": "Returns the truth value of (x == y) element-wise.", "description": "*NOTE*: `Equal` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\n```python\nx = tf.constant([2, 4])\ny = tf.constant(2)\ntf.math.equal(x, y) ==> array([True, False])\n\nx = tf.constant([2, 4])\ny = tf.constant([2, 4])\ntf.math.equal(x, y) ==> array([True, True])\n```", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "y", "type": "TF_Tensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "incompatible_shape_error", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Erf", "summary": "Computes the [Gauss error function](https://en.wikipedia.org/wiki/Error_function) of `x` element-wise. In statistics, for non-negative values of $x$, the error function has the following interpretation: for a random variable $Y$ that is normally distributed with mean 0 and variance $1/\\sqrt{2}$, $erf(x)$ is the probability that $Y$ falls in the range $[−x, x]$.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.Erfc", "summary": "Computes the complementary error function of `x` element-wise.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.Erfinv", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.ExecuteTPUEmbeddingPartitioner", "summary": "An op that executes the TPUEmbedding partitioner on the central configuration", "description": "device and computes the HBM size (in bytes) required for TPUEmbedding operation.", "results": [ { "name": "common_config", "type": "TF_StrTensor" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ] }, { "name": "tf.Exp", "summary": "Computes exponential of x element-wise. \\\\(y = e^x\\\\).", "description": "This function computes the exponential of every element in the input tensor.\n i.e. `exp(x)` or `e^(x)`, where `x` is the input tensor.\n `e` denotes Euler's number and is approximately equal to 2.718281.\n Output is positive for any real input.\n\n ```python\n x = tf.constant(2.0)\n tf.math.exp(x) ==> 7.389056\n\n x = tf.constant([2.0, 8.0])\n tf.math.exp(x) ==> array([7.389056, 2980.958], dtype=float32)\n ```\n\n For complex numbers, the exponential value is calculated as follows:\n\n ```\n e^(x+iy) = e^x * e^iy = e^x * (cos y + i sin y)\n ```\n\n Let's consider complex number 1+1j as an example.\n e^1 * (cos 1 + i sin 1) = 2.7182818284590 * (0.54030230586+0.8414709848j)\n\n ```python\n x = tf.constant(1 + 1j)\n tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.ExpandDims", "summary": "Inserts a dimension of 1 into a tensor's shape.", "description": "Given a tensor `input`, this operation inserts a dimension of 1 at the\ndimension index `axis` of `input`'s shape. The dimension index `axis` starts at\nzero; if you specify a negative number for `axis` it is counted backward from\nthe end.\n\nThis operation is useful if you want to add a batch dimension to a single\nelement. For example, if you have a single image of shape `[height, width,\nchannels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`,\nwhich will make the shape `[1, height, width, channels]`.\n\nOther examples:\n\n```\n# 't' is a tensor of shape [2]\nshape(expand_dims(t, 0)) ==> [1, 2]\nshape(expand_dims(t, 1)) ==> [2, 1]\nshape(expand_dims(t, -1)) ==> [2, 1]\n\n# 't2' is a tensor of shape [2, 3, 5]\nshape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]\nshape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]\nshape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]\n```\n\nThis operation requires that:\n\n`-1-input.dims() <= dim <= input.dims()`\n\nThis operation is related to `squeeze()`, which removes dimensions of\nsize 1.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "dim", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Expm1", "summary": "Computes `exp(x) - 1` element-wise.", "description": "i.e. `exp(x) - 1` or `e^(x) - 1`, where `x` is the input tensor.\n `e` denotes Euler's number and is approximately equal to 2.718281.\n\n ```python\n x = tf.constant(2.0)\n tf.math.expm1(x) ==> 6.389056\n\n x = tf.constant([2.0, 8.0])\n tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)\n\n x = tf.constant(1 + 1j)\n tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.ExtractImagePatches", "summary": "Extract `patches` from `images` and put them in the \"depth\" output dimension.", "operands": [ { "name": "images", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "patches", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "attributes": [ { "name": "ksizes", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "rates", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" } ] }, { "name": "tf.FakeParam", "summary": "This op is used as a placeholder in If branch functions. It doesn't provide a\n valid output when run, so must either be removed (e.g. replaced with a\n function input) or guaranteed not to be used (e.g. if mirroring an\n intermediate output needed for the gradient computation of the other branch).", "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" } ] }, { "name": "tf.FakeQuantWithMinMaxArgs", "summary": "Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same shape and type.", "description": "Quantization is called fake since the output is still in floating point.\n The API converts inputs into values within the range [min and max] and returns\n as output.\n\nAttributes\n\n* `[min; max]` define the clamping range for the `inputs` data.\n* `inputs` values are quantized into the quantization range (\n`[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]`\nwhen it is true) and then de-quantized and output as floats in `[min; max]`\ninterval.\n* `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.\n\nBefore quantization, `min` and `max` values are adjusted with the following\nlogic.\nIt is suggested to have `min <= 0 <= max`. If `0` is not in the range of values,\nthe behavior can be unexpected:\n\n* If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`.\n* If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`.\n* If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `,\n`min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`.\n\n\nExamples\n\n```python\n\ninp = tf.constant ([10.03, -10.23, 3])\nout = tf.quantization.fake_quant_with_min_max_args(inp, min=-5, max=5,\n num_bits=16)\nprint(out)\n\n# Output:\n# tf.Tensor([ 4.9999237 -5.0000763 3.0000763], shape=(3,), dtype=float32)\n```\n\nRaises:\n * InvalidArgumentError:\n - If num_bits are outside of range [2, 16].\n - If min >= max.\n * ValueError: If `inputs` are of any other type than float32.", "operands": [ { "name": "inputs", "type": "TF_Float32Tensor" } ], "results": [ { "name": "outputs", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "min", "type": "DefaultValuedOptionalAttr" }, { "name": "max", "type": "DefaultValuedOptionalAttr" }, { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FakeQuantWithMinMaxArgsGradient", "summary": "Compute gradients for a FakeQuantWithMinMaxArgs operation.", "operands": [ { "name": "gradients", "type": "TF_Float32Tensor" }, { "name": "inputs", "type": "TF_Float32Tensor" } ], "results": [ { "name": "backprops", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "min", "type": "DefaultValuedOptionalAttr" }, { "name": "max", "type": "DefaultValuedOptionalAttr" }, { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FakeQuantWithMinMaxVars", "summary": "Fake-quantize the 'inputs' tensor of type float via global float scalars", "description": "Fake-quantize the `inputs` tensor of type float via global float scalars\n`min` and `max` to `outputs` tensor of same shape as `inputs`.\n\nAttributes\n\n* `[min; max]` define the clamping range for the `inputs` data.\n* `inputs` values are quantized into the quantization range (\n`[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]`\nwhen it is true) and then de-quantized and output as floats in `[min; max]`\ninterval.\n* `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.\n\nBefore quantization, `min` and `max` values are adjusted with the following\nlogic.\nIt is suggested to have `min <= 0 <= max`. If `0` is not in the range of values,\nthe behavior can be unexpected:\n\n* If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`.\n* If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`.\n* If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `,\n`min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`.\n\nThis operation has a gradient and thus allows for training `min` and `max`\nvalues.\n\n>>> constant_input = tf.constant([[1.2, -0.3, 0.7], [2.1, 0.5, -1.0]], dtype=tf.float32)\n>>>\n>>> min_val = -0.5\n>>> max_val = 0.8\n>>> num_bits = 8\n>>> narrow_range = False #False:for the quantization range [0; 2^num_bits - 1]\n>>>\n>>> quantized_data = tf.quantization.fake_quant_with_min_max_vars(\n... inputs=constant_input, min=min_val, max=max_val, num_bits=num_bits, narrow_range=narrow_range\n... )\n>>>\n>>> print(\"Input:\\n\", constant_input.numpy())\nInput:\n[[ 1.2 -0.3 0.7]\n[ 2.1 0.5 -1. ]]\n>>> print(\"Output:\\n\", quantized_data.numpy())\nOutput:\n[[ 0.8003921 -0.3007843 0.6984313]\n[ 0.8003921 0.4996078 -0.4996078]]", "operands": [ { "name": "inputs", "type": "TF_Float32Tensor" }, { "name": "min", "type": "TF_Float32Tensor" }, { "name": "max", "type": "TF_Float32Tensor" } ], "results": [ { "name": "outputs", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FakeQuantWithMinMaxVarsGradient", "summary": "Compute gradients for a FakeQuantWithMinMaxVars operation.", "operands": [ { "name": "gradients", "type": "TF_Float32Tensor" }, { "name": "inputs", "type": "TF_Float32Tensor" }, { "name": "min", "type": "TF_Float32Tensor" }, { "name": "max", "type": "TF_Float32Tensor" } ], "results": [ { "name": "backprops_wrt_input", "type": "TF_Float32Tensor" }, { "name": "backprop_wrt_min", "type": "TF_Float32Tensor" }, { "name": "backprop_wrt_max", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FakeQuantWithMinMaxVarsPerChannel", "summary": "Fake-quantize the 'inputs' tensor of type float via per-channel floats", "description": "Fake-quantize the `inputs` tensor of type float per-channel and one of the\nshapes: `[d]`, `[b, d]` `[b, h, w, d]` via per-channel floats `min` and `max`\nof shape `[d]` to `outputs` tensor of same shape as `inputs`.\n\nAttributes\n\n* `[min; max]` define the clamping range for the `inputs` data.\n* `inputs` values are quantized into the quantization range (\n`[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]`\nwhen it is true) and then de-quantized and output as floats in `[min; max]`\ninterval.\n* `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.\n\nBefore quantization, `min` and `max` values are adjusted with the following\nlogic.\nIt is suggested to have `min <= 0 <= max`. If `0` is not in the range of values,\nthe behavior can be unexpected:\n\n* If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`.\n* If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`.\n* If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `,\n`min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`.\n\nThis operation has a gradient and thus allows for training `min` and `max`\nvalues.", "operands": [ { "name": "inputs", "type": "TF_Float32Tensor" }, { "name": "min", "type": "TF_Float32Tensor" }, { "name": "max", "type": "TF_Float32Tensor" } ], "results": [ { "name": "outputs", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FakeQuantWithMinMaxVarsPerChannelGradient", "summary": "Compute gradients for a FakeQuantWithMinMaxVarsPerChannel operation.", "operands": [ { "name": "gradients", "type": "TF_Float32Tensor" }, { "name": "inputs", "type": "TF_Float32Tensor" }, { "name": "min", "type": "TF_Float32Tensor" }, { "name": "max", "type": "TF_Float32Tensor" } ], "results": [ { "name": "backprops_wrt_input", "type": "TF_Float32Tensor" }, { "name": "backprop_wrt_min", "type": "TF_Float32Tensor" }, { "name": "backprop_wrt_max", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FFT", "summary": "Fast Fourier transform.", "description": "Computes the 1-dimensional discrete Fourier transform over the inner-most\ndimension of `input`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.FFT2D", "summary": "2D fast Fourier transform.", "description": "Computes the 2-dimensional discrete Fourier transform over the inner-most\n2 dimensions of `input`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.FFT3D", "summary": "3D fast Fourier transform.", "description": "Computes the 3-dimensional discrete Fourier transform over the inner-most 3\ndimensions of `input`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.Fill", "summary": "Creates a tensor filled with a scalar value.", "description": "This operation creates a tensor of shape `dims` and fills it with `value`.\n\nFor example:\n\n```\n# Output tensor has shape [2, 3].\nfill([2, 3], 9) ==> [[9, 9, 9]\n [9, 9, 9]]\n```\n\n`tf.fill` differs from `tf.constant` in a few ways:\n\n* `tf.fill` only supports scalar contents, whereas `tf.constant` supports\n Tensor values.\n* `tf.fill` creates an Op in the computation graph that constructs the actual\n Tensor value at runtime. This is in contrast to `tf.constant` which embeds\n the entire Tensor into the graph with a `Const` node.\n* Because `tf.fill` evaluates at graph runtime, it supports dynamic shapes\n based on other runtime Tensors, unlike `tf.constant`.", "operands": [ { "name": "dims", "type": "TF_I32OrI64Tensor" }, { "name": "value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.FinalizeDataset", "summary": "Creates a dataset by applying `tf.data.Options` to `input_dataset`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "has_captured_ref", "type": "DefaultValuedOptionalAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.FinalizeTPUEmbedding", "summary": "An op that finalizes the TPUEmbedding configuration.", "operands": [ { "name": "common_config", "type": "TF_StrTensor" }, { "name": "memory_config", "type": "TF_StrTensor" } ] }, { "name": "tf.FlatMapDataset", "summary": "Creates a dataset that applies `f` to the outputs of `input_dataset`.", "description": "Unlike MapDataset, the `f` in FlatMapDataset is expected to return a\nDataset variant, and FlatMapDataset will flatten successive results\ninto a single Dataset.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "other_arguments", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Floor", "summary": "Returns element-wise largest integer not greater than x.", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.FloorDiv", "summary": "Returns x // y element-wise.", "description": "*NOTE*: `FloorDiv` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.FloorMod", "summary": "Returns element-wise remainder of division.", "description": "This follows Python semantics in that the\nresult here is consistent with a flooring divide. E.g.\n`floor(x / y) * y + floormod(x, y) = x`, regardless of the signs of x and y.\n\n*NOTE*: `FloorMod` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.FlushSummaryWriter", "summary": "Flushes the writer's unwritten events.", "description": "writer: A handle to the summary writer resource.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" } ] }, { "name": "tf.FusedBatchNorm", "summary": "Batch normalization.", "description": "Note that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\".\nThe size of 1D Tensors matches the dimension C of the 4D Tensors.", "operands": [ { "name": "x", "type": "TF_Float32Tensor" }, { "name": "scale", "type": "TF_Float32Tensor" }, { "name": "offset", "type": "TF_Float32Tensor" }, { "name": "mean", "type": "TF_Float32Tensor" }, { "name": "variance", "type": "TF_Float32Tensor" } ], "results": [ { "name": "y", "type": "TF_Float32Tensor" }, { "name": "batch_mean", "type": "TF_Float32Tensor" }, { "name": "batch_variance", "type": "TF_Float32Tensor" }, { "name": "reserve_space_1", "type": "TF_Float32Tensor" }, { "name": "reserve_space_2", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "exponential_avg_factor", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FusedBatchNormGrad", "summary": "Gradient for batch normalization.", "description": "Note that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\".\nThe size of 1D Tensors matches the dimension C of the 4D Tensors.", "operands": [ { "name": "y_backprop", "type": "TF_Float32Tensor" }, { "name": "x", "type": "TF_Float32Tensor" }, { "name": "scale", "type": "TF_Float32Tensor" }, { "name": "reserve_space_1", "type": "TF_Float32Tensor" }, { "name": "reserve_space_2", "type": "TF_Float32Tensor" } ], "results": [ { "name": "x_backprop", "type": "TF_Float32Tensor" }, { "name": "scale_backprop", "type": "TF_Float32Tensor" }, { "name": "offset_backprop", "type": "TF_Float32Tensor" }, { "name": "reserve_space_3", "type": "TF_Float32Tensor" }, { "name": "reserve_space_4", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FusedBatchNormGradV2", "summary": "Gradient for batch normalization.", "description": "Note that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\".\nThe size of 1D Tensors matches the dimension C of the 4D Tensors.", "operands": [ { "name": "y_backprop", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "scale", "type": "TF_Float32Tensor" }, { "name": "reserve_space_1", "type": "TF_Float32Tensor" }, { "name": "reserve_space_2", "type": "TF_Float32Tensor" } ], "results": [ { "name": "x_backprop", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "scale_backprop", "type": "TF_Float32Tensor" }, { "name": "offset_backprop", "type": "TF_Float32Tensor" }, { "name": "reserve_space_3", "type": "TF_Float32Tensor" }, { "name": "reserve_space_4", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FusedBatchNormGradV3", "summary": "Gradient for batch normalization.", "description": "Note that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\".\nThe size of 1D Tensors matches the dimension C of the 4D Tensors.", "operands": [ { "name": "y_backprop", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "scale", "type": "TF_Float32Tensor" }, { "name": "reserve_space_1", "type": "TF_Float32Tensor" }, { "name": "reserve_space_2", "type": "TF_Float32Tensor" }, { "name": "reserve_space_3", "type": "TF_Float32Tensor" } ], "results": [ { "name": "x_backprop", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "scale_backprop", "type": "TF_Float32Tensor" }, { "name": "offset_backprop", "type": "TF_Float32Tensor" }, { "name": "reserve_space_4", "type": "TF_Float32Tensor" }, { "name": "reserve_space_5", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FusedBatchNormV2", "summary": "Batch normalization.", "description": "Note that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\".\nThe size of 1D Tensors matches the dimension C of the 4D Tensors.", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "scale", "type": "TF_Float32Tensor" }, { "name": "offset", "type": "TF_Float32Tensor" }, { "name": "mean", "type": "TF_Float32Tensor" }, { "name": "variance", "type": "TF_Float32Tensor" } ], "results": [ { "name": "y", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "batch_mean", "type": "TF_Float32Tensor" }, { "name": "batch_variance", "type": "TF_Float32Tensor" }, { "name": "reserve_space_1", "type": "TF_Float32Tensor" }, { "name": "reserve_space_2", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "exponential_avg_factor", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FusedBatchNormV3", "summary": "Batch normalization.", "description": "Note that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\".\nThe size of 1D Tensors matches the dimension C of the 4D Tensors.", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "scale", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "offset", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "mean", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "variance", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" } ], "results": [ { "name": "y", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "batch_mean", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "batch_variance", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "reserve_space_1", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "reserve_space_2", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" }, { "name": "reserve_space_3", "type": "TensorOf<[ TF_Bfloat16, TF_Float32 ]>" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedOptionalAttr" }, { "name": "exponential_avg_factor", "type": "DefaultValuedOptionalAttr" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" }, { "name": "is_training", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.FusedConv2DBiasActivation", "summary": "Computes a fused kernel which implements: 2-D convolution, adds side input,", "description": "with separate scaling on convolution and side inputs, then adds bias and\n applies the RELU activation function to the result. Supports both float and\n qint8 data formats. In the case of qint8, the output is clipped to [0..127].\n\n conv_input: A tensor with format as specified by `data_format` (see below).\n filter: A tensor with format depending on `data_format` as follows:\n \"NHWC\", \"NCHW\":\n `float [ filter_height, filter_width, in_channels, out_channels ]`\n \"NCHW_VECT_C\":\n `qint8 [ out_channels, in_channels, filter_height, filter_width ]`\n bias: 1-D float tensor with size matching the `out_channels` dimension of\n `filter`.\n Note: this tensor is still float, even if other inputs are qint8.\n side_input: A tensor with format as specified by `data_format` (see below).\n This tensor will be ignored and can be [] if side_input_scale == 0.\n Otherwise, the size of each dimension must match the `output` tensor.\n conv_input_scale: scalar float value to be multiplied by `conv_input`.\n (conceptually.. in reality it is applied after convolution).\n For the CPU version, this can also be a 1-D Tensor of per output-channel\n scales.\n side_input_scale: scalar float value to be multiplied by `side_input`.\n output: A tensor with format as specified by `data_format` (see below).\n The dimension sizes are determined automatically based on other inputs\n and attributes.\n T: The element data type of `conv_input`, `side_input` and `output` tensors.\n Note: must match with the `data_format`.\n Tbias: The element data type of `bias`.\n strides: 1-D tensor of length 4. The stride of the sliding window for each\n dimension of `input`. The dimension order is determined by the value of\n `data_format`, see below for details.\n Note: the stride for batch and channel dimensions must be 1.\n padding: The type of padding algorithm to use.\n data_format: A string specifying the data format of `conv_input`,\n `side_input` and `output` tensors with the following options:\n \"NHWC\": `float [ batch, height, width, channels ]`\n \"NCHW\": `float [ batch, channels, height, width ]`\n \"NCHW_VECT_C\":\n `qint8 [ batch, channels / 4, height, width, channels % 4 ]`\n Note: for \"NCHW_VECT_C\", `channels` must be a multiple of 4.\n filter_format: A string specifying the data format of `filter`,\n \"HWIO\": `float [ kernel_height, kernel_width, input_channels,\n output_channels ]`\n \"OIHW_VECT_I\":\n `qint8 [ output_channels, input_channels / 4,\n kernel_height, kernel_width, input_channels % 4 ]`\n activation_mode: The activation applied to the output.\n Must be \"Relu\" or \"None\".\n dilations: 1-D tensor of length 4. The dilation factor for each dimension\n of `input`. If set to k > 1, there will be k-1 skipped cells between\n each filter element on that dimension. The dimension order is determined\n by the value of `data_format`, see above for details. Dilations in the\n batch and depth dimensions must be 1.", "operands": [ { "name": "conv_input", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Qint8]>" }, { "name": "filter", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Qint8]>" }, { "name": "bias", "type": "TensorOf<[TF_Float16, TF_Float32]>" }, { "name": "side_input", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Qint8]>" }, { "name": "conv_input_scale", "type": "TF_Float32Tensor" }, { "name": "side_input_scale", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Qint8]>" } ], "attributes": [ { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" }, { "name": "filter_format", "type": "DefaultValuedOptionalAttr, \"HWIO\">" }, { "name": "activation_mode", "type": "DefaultValuedOptionalAttr, \"Relu\">" }, { "name": "dilations", "type": "DefaultValuedOptionalAttr, {1, 1, 1, 1}>" } ] }, { "name": "tf.Gather", "category": "Tensor", "summary": "Gather slices from `params` according to `indices`.", "description": "`indices` must be an integer tensor of any dimension (usually 0-D or 1-D).\nProduces an output tensor with shape `indices.shape + params.shape[1:]` where:\n\n```python\n # Scalar indices\n output[:, ..., :] = params[indices, :, ... :]\n\n # Vector indices\n output[i, :, ..., :] = params[indices[i], :, ... :]\n\n # Higher rank indices\n output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]\n```\n\nIf `indices` is a permutation and `len(indices) == params.shape[0]` then\nthis operation will permute `params` accordingly.\n\n`validate_indices`: DEPRECATED. If this operation is assigned to CPU, values in\n`indices` are always validated to be within range. If assigned to GPU,\nout-of-bound indices result in safe but unspecified behavior, which may include\nraising an error.\n\n
\n\n
", "operands": [ { "name": "params", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "validate_indices", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.GatherNd", "summary": "Gather slices from `params` into a Tensor with shape specified by `indices`.", "description": "`indices` is a K-dimensional integer tensor, best thought of as a\n(K-1)-dimensional tensor of indices into `params`, where each element defines a\nslice of `params`:\n\n output[\\\\(i_0, ..., i_{K-2}\\\\)] = params[indices[\\\\(i_0, ..., i_{K-2}\\\\)]]\n\nWhereas in `tf.gather` `indices` defines slices into the `axis`\ndimension of `params`, in `tf.gather_nd`, `indices` defines slices into the\nfirst `N` dimensions of `params`, where `N = indices.shape[-1]`.\n\nThe last dimension of `indices` can be at most the rank of\n`params`:\n\n indices.shape[-1] <= params.rank\n\nThe last dimension of `indices` corresponds to elements\n(if `indices.shape[-1] == params.rank`) or slices\n(if `indices.shape[-1] < params.rank`) along dimension `indices.shape[-1]`\nof `params`. The output tensor has shape\n\n indices.shape[:-1] + params.shape[indices.shape[-1]:]\n\nIf `indices` contains any out-of-bound indices, depending on\n`bad_indices_policy`, the op will either return an error or ignore the\nout-of-bound indices. `bad_indices_policy` can be one of the following values:\n1. \"\" or \"DEFAULT\": raises on CPU and ignore on GPU. This is because\n historically on CPU and GPU we handle errors in different ways, and for\n backward compatibility we keep the default behavior.\n2. \"ERROR\": raises error; GPU does not support this value.\n3. \"IGNORE\": ignore error and set the corresponding output to 0;\n supported on both CPU and GPU.\n\nSome examples below.\n\nSimple indexing into a matrix:\n\n```python\n indices = [[0, 0], [1, 1]]\n params = [['a', 'b'], ['c', 'd']]\n output = ['a', 'd']\n```\n\nSlice indexing into a matrix:\n\n```python\n indices = [[1], [0]]\n params = [['a', 'b'], ['c', 'd']]\n output = [['c', 'd'], ['a', 'b']]\n```\n\nIndexing into a 3-tensor:\n\n```python\n indices = [[1]]\n params = [[['a0', 'b0'], ['c0', 'd0']],\n [['a1', 'b1'], ['c1', 'd1']]]\n output = [[['a1', 'b1'], ['c1', 'd1']]]\n\n\n indices = [[0, 1], [1, 0]]\n params = [[['a0', 'b0'], ['c0', 'd0']],\n [['a1', 'b1'], ['c1', 'd1']]]\n output = [['c0', 'd0'], ['a1', 'b1']]\n\n\n indices = [[0, 0, 1], [1, 0, 1]]\n params = [[['a0', 'b0'], ['c0', 'd0']],\n [['a1', 'b1'], ['c1', 'd1']]]\n output = ['b0', 'b1']\n```\n\nBatched indexing into a matrix:\n\n```python\n indices = [[[0, 0]], [[0, 1]]]\n params = [['a', 'b'], ['c', 'd']]\n output = [['a'], ['b']]\n```\n\nBatched slice indexing into a matrix:\n\n```python\n indices = [[[1]], [[0]]]\n params = [['a', 'b'], ['c', 'd']]\n output = [[['c', 'd']], [['a', 'b']]]\n```\n\nBatched indexing into a 3-tensor:\n\n```python\n indices = [[[1]], [[0]]]\n params = [[['a0', 'b0'], ['c0', 'd0']],\n [['a1', 'b1'], ['c1', 'd1']]]\n output = [[[['a1', 'b1'], ['c1', 'd1']]],\n [[['a0', 'b0'], ['c0', 'd0']]]]\n\n indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]]\n params = [[['a0', 'b0'], ['c0', 'd0']],\n [['a1', 'b1'], ['c1', 'd1']]]\n output = [[['c0', 'd0'], ['a1', 'b1']],\n [['a0', 'b0'], ['c1', 'd1']]]\n\n\n indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]]\n params = [[['a0', 'b0'], ['c0', 'd0']],\n [['a1', 'b1'], ['c1', 'd1']]]\n output = [['b0', 'b1'], ['d0', 'c1']]\n```\n\nSee also `tf.gather` and `tf.batch_gather`.", "operands": [ { "name": "params", "type": "TF_Tensor" }, { "name": "indices", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.GatherV2", "summary": "Gather slices from `params` axis `axis` according to `indices`.", "description": "`indices` must be an integer tensor of any dimension (usually 0-D or 1-D).\nProduces an output tensor with shape `params.shape[:axis] +\nindices.shape[batch_dims:] + params.shape[axis + 1:]` where:\n\n```python\n # Scalar indices (output is rank(params) - 1).\n output[a_0, ..., a_n, b_0, ..., b_n] =\n params[a_0, ..., a_n, indices, b_0, ..., b_n]\n\n # Vector indices (output is rank(params)).\n output[a_0, ..., a_n, i, b_0, ..., b_n] =\n params[a_0, ..., a_n, indices[i], b_0, ..., b_n]\n\n # Higher rank indices (output is rank(params) + rank(indices) - 1).\n output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =\n params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]\n```\n\n
\n\n
\n\nNote that on CPU, if an out of bound index is found, an error is returned.\nOn GPU, if an out of bound index is found, a 0 is stored in the\ncorresponding output value.\n\nNote that on TPU, if any dimension of `params` is of size 0 then the output will\nbe the expected shape filled with zeros. On CPU and GPU an error will be\nreturned.\n\nSee also `tf.batch_gather` and `tf.gather_nd`.", "operands": [ { "name": "params", "type": "TF_Tensor" }, { "name": "indices", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "batch_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.GeneratorDataset", "summary": "Creates a dataset that invokes a function to generate elements.", "operands": [ { "name": "init_func_other_args", "type": "Variadic" }, { "name": "next_func_other_args", "type": "Variadic" }, { "name": "finalize_func_other_args", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "init_func", "type": "SymbolRefAttr" }, { "name": "next_func", "type": "SymbolRefAttr" }, { "name": "finalize_func", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.GeneratorDatasetRegion", "summary": "Regional version of GeneratorDataset", "description": "Creates a dataset that invokes its 'next' region to generate elements. Conceptually,\nwithin MLIR, we treat this op as if it fills a buffer with all the results right away,\nand those results are then passed (through the variant tensor result) to\nMakeIterator / IteratorGetNext. Note that the actual TF implementation differs: It\ngenerates the next element just in time, during IteratorGetNext.\n\ninit_extra_args: Additional arguments to pass to 'init'.\nnext_extra_args: Additional arguments to pass to 'next'. (Passed after the\n normal arguments which are from the return values of 'init'.)\nfinalize_extra_args: Additional arguments to pass to 'finalize'. (Passed after\n the normal arguments which are from the return values of 'init'.)", "operands": [ { "name": "init_func_other_args", "type": "Variadic" }, { "name": "next_func_other_args", "type": "Variadic" }, { "name": "finalize_func_other_args", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "init", "type": "SizedRegion<1>" }, { "name": "next", "type": "SizedRegion<1>" }, { "name": "finalize", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.GetMinibatchesInCsrWithPhysicalReplica", "operands": [ { "name": "program_key", "type": "TF_StrTensor" }, { "name": "row_ids", "type": "TF_Int32Tensor" }, { "name": "col_ids", "type": "TF_Int32Tensor" }, { "name": "gains", "type": "TF_Float32Tensor" }, { "name": "splits", "type": "TF_Int64Tensor" }, { "name": "id_counts", "type": "TF_Int32Tensor" } ], "results": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "row_pointers_unpadded_size", "type": "TF_Int32Tensor" }, { "name": "ids_unpadded_size", "type": "TF_Int32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "sample_count", "type": "ConfinedAttr]>" }, { "name": "num_replica", "type": "ConfinedAttr]>" }, { "name": "max_minibatches_per_sc", "type": "ConfinedAttr]>" }, { "name": "max_ids_per_chip_per_sample", "type": "ConfinedAttr]>" }, { "name": "table_vocab_size", "type": "ConfinedAttr]>" }, { "name": "feature_width", "type": "ConfinedAttr]>" }, { "name": "num_sc_per_chip", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" }, { "name": "mini_batch_in_csr", "type": "StrAttr" } ] }, { "name": "tf.GetMinibatchSplitsWithPhysicalReplica", "operands": [ { "name": "program_key", "type": "TF_StrTensor" }, { "name": "row_ids", "type": "TF_Int32Tensor" }, { "name": "col_ids", "type": "TF_Int32Tensor" }, { "name": "gains", "type": "TF_Float32Tensor" } ], "results": [ { "name": "sorted_row_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_col_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "splits", "type": "TF_Int64Tensor" }, { "name": "id_counts", "type": "TF_Int32Tensor" }, { "name": "max_ids", "type": "TF_Int32Tensor" }, { "name": "max_uniques", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "sample_count", "type": "ConfinedAttr]>" }, { "name": "num_replica", "type": "ConfinedAttr]>" }, { "name": "table_vocab_size", "type": "ConfinedAttr]>" }, { "name": "feature_width", "type": "ConfinedAttr]>" }, { "name": "num_sc_per_chip", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" }, { "name": "mini_batch_splits", "type": "StrAttr" } ] }, { "name": "tf.GetStatsFromListOfSparseCoreCooTensors", "summary": "An op which computes the max_ids/uniques for a given table.", "operands": [ { "name": "row_ids_list", "type": "Variadic" }, { "name": "col_ids_list", "type": "Variadic" }, { "name": "gains_list", "type": "Variadic" } ], "results": [ { "name": "max_ids_per_sparse_core", "type": "TF_Int32Tensor" }, { "name": "max_unique_ids_per_sparse_core", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "sample_count_list", "type": "TypedArrayAttrBase" }, { "name": "col_offset_list", "type": "TypedArrayAttrBase" }, { "name": "num_replica", "type": "ConfinedAttr]>" }, { "name": "table_vocab_size", "type": "ConfinedAttr]>" }, { "name": "feature_width", "type": "ConfinedAttr]>" }, { "name": "num_sc_per_chip", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.GlobalIterId", "summary": "Op that gets the global step id.", "description": "This op gets the step id for each loop iteration.", "results": [ { "name": "iter_id", "type": "TF_Int64Tensor" } ] }, { "name": "tf.Greater", "summary": "Returns the truth value of (x > y) element-wise.", "description": "*NOTE*: `Greater` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\nExample:\n\n```python\nx = tf.constant([5, 4, 6])\ny = tf.constant([5, 2, 5])\ntf.math.greater(x, y) ==> [False, True, True]\n\nx = tf.constant([5, 4, 6])\ny = tf.constant([5])\ntf.math.greater(x, y) ==> [False, False, True]\n```", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ] }, { "name": "tf.GreaterEqual", "summary": "Returns the truth value of (x >= y) element-wise.", "description": "*NOTE*: `GreaterEqual` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\nExample:\n\n```python\nx = tf.constant([5, 4, 6, 7])\ny = tf.constant([5, 2, 5, 10])\ntf.math.greater_equal(x, y) ==> [True, True, True, False]\n\nx = tf.constant([5, 4, 6, 7])\ny = tf.constant([5])\ntf.math.greater_equal(x, y) ==> [True, False, True, True]\n```", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ] }, { "name": "tf.HashTable", "summary": "Creates a non-initialized hash table.", "description": "This op creates a hash table, specifying the type of its keys and values.\nBefore using the table you will have to initialize it. After initialization the\ntable will be immutable.", "results": [ { "name": "table_handle", "type": "TF_StrTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" }, { "name": "use_node_name_sharing", "type": "DefaultValuedOptionalAttr" }, { "name": "key_dtype", "type": "TypeAttr" }, { "name": "value_dtype", "type": "TypeAttr" } ] }, { "name": "tf.HashTableV2", "summary": "Creates a non-initialized hash table.", "description": "This op creates a hash table, specifying the type of its keys and values.\nBefore using the table you will have to initialize it. After initialization the\ntable will be immutable.", "results": [ { "name": "table_handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" }, { "name": "use_node_name_sharing", "type": "DefaultValuedOptionalAttr" }, { "name": "key_dtype", "type": "TypeAttr" }, { "name": "value_dtype", "type": "TypeAttr" } ] }, { "name": "tf.HSVToRGB", "summary": "Convert one or more images from HSV to RGB.", "description": "Outputs a tensor of the same shape as the `images` tensor, containing the RGB\nvalue of the pixels. The output is only well defined if the value in `images`\nare in `[0,1]`.\n\nSee `rgb_to_hsv` for a description of the HSV encoding.", "operands": [ { "name": "images", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.Identity", "summary": "Return a tensor with the same shape and contents as the input tensor or value.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.IdentityN", "summary": "Returns a list of tensors with the same shapes and contents as the input", "description": "tensors.\n\nThis op can be used to override the gradient for complicated functions. For\nexample, suppose y = f(x) and we wish to apply a custom function g for backprop\nsuch that dx = g(dy). In Python,\n\n```python\nwith tf.get_default_graph().gradient_override_map(\n {'IdentityN': 'OverrideGradientWithG'}):\n y, _ = identity_n([f(x), x])\n\n@tf.RegisterGradient('OverrideGradientWithG')\ndef ApplyG(op, dy, _):\n return [None, g(dy)] # Do not backprop to f(x).\n```", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf.If", "summary": "output = cond ? then_branch(input) : else_branch(input)", "description": "output = cond ? then_branch(input) : else_branch(input)\n\ncond: A Tensor. If the tensor is a scalar of non-boolean type, the\n scalar is converted to a boolean according to the\n following rule: if the scalar is a numerical value, non-zero means\n True and zero means False; if the scalar is a string, non-empty\n means True and empty means False. If the tensor is not a scalar,\n being empty means False and being non-empty means True.\ninput: A list of input tensors.\nthen_branch: A function that takes 'inputs' and returns a list of\n tensors, whose types are the same as what else_branch returns.\nelse_branch: A function that takes 'inputs' and returns a list of\n tensors. whose types are the same as what then_branch returns.", "operands": [ { "name": "cond", "type": "TF_Tensor" }, { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "then_branch", "type": "FlatSymbolRefAttr" }, { "name": "else_branch", "type": "FlatSymbolRefAttr" }, { "name": "is_stateless", "type": "BoolAttr" } ] }, { "name": "tf.IFFT", "summary": "Inverse fast Fourier transform.", "description": "Computes the inverse 1-dimensional discrete Fourier transform over the\ninner-most dimension of `input`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.IFFT2D", "summary": "Inverse 2D fast Fourier transform.", "description": "Computes the inverse 2-dimensional discrete Fourier transform over the\ninner-most 2 dimensions of `input`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.IFFT3D", "summary": "Inverse 3D fast Fourier transform.", "description": "Computes the inverse 3-dimensional discrete Fourier transform over the\ninner-most 3 dimensions of `input`.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.IfRegion", "summary": "output = cond ? then_branch output : else_branch output", "description": "\"output = cond ? then_branch output : else_branch output\"\n\ncond: A Tensor. If the tensor is a scalar of non-boolean type, the\n scalar is converted to a boolean according to the\n following rule: if the scalar is a numerical value, non-zero means\n True and zero means False; if the scalar is a string, non-empty\n means True and empty means False. If the tensor is not a scalar,\n being empty means False and being non-empty means True.\nthen_branch: A region that computes the outputs of the op if cond = true.\n It returns a list of tensors using tf.yield (as the terminator). The\n types of these returned tensors is same as that of the else_branch\nelse_branch: A region that computes the outputs of the op if cond = false.\n It returns a list of tensors using tf.yield (as the terminator). The\n types of these returned tensors is same as that of the then_branch", "operands": [ { "name": "cond", "type": "0DTensorOf<[I1]>" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "is_stateless", "type": "BoolAttr" }, { "name": "_then_func_name", "type": "OptionalAttr" }, { "name": "_else_func_name", "type": "OptionalAttr" } ], "regions": [ { "name": "then_branch", "type": "SizedRegion<1>" }, { "name": "else_branch", "type": "SizedRegion<1>" } ] }, { "name": "tf.IfrtCall", "summary": "Invokes a program via IFRT on a device", "description": "This op calls an IFRT program uniquely identified by the given program id.\n\n During lowering from a `tf_device.cluster_func` op to a `tf.IfrtCall` op,\n the region owned by the former will be outlined to a function with a\n `tfrt_ifrt_serving.program_id` attribute. After that, the runtime ensures\n that the outlined function is compiled into an executable and is available\n for lookup from `IfrtCall` TF ops.\n\n `variable_arg_indices` is a sorted (ascending order) array and indicates which\n element of `args` is a key to a loaded array corresponding to a variable.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "static_shapes", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "program_id", "type": "I64Attr" }, { "name": "variable_arg_indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.IfrtLoadVariable", "summary": "Loads a restored variable tensor as a tensor future", "description": "This op loads a restored variable tensor as a tensor future. It is a\n replacement of `tf.ReadVariableOp`.\n\n This op returns a scalar string tensor containing the restored variable name, which \n is composed from `container_name` and `shared_name` from a `var_handle` and can be\n used as a key within the runtime, as well as a future for the tensor.\n\n The `tf.IfrtCall` kernel uses the output $array_key.\n Other ops executed by TFRT may make use of $tensor_future.", "operands": [ { "name": "variable", "type": "TF_Tensor" } ], "results": [ { "name": "array_key", "type": "TF_StrTensor" }, { "name": "tensor_future", "type": "TF_Tensor" } ], "attributes": [ { "name": "used_by_host", "type": "DefaultValuedAttr" } ] }, { "name": "tf.IfrtResourceDeserialize", "summary": "Deserialize resource vars.", "description": "This Op is a variant of IfrtResourceDeserialize for use with the\n TFRT/IFRT runtime. It is not a stable interface.", "operands": [ { "name": "resource_var", "type": "TF_ResourceTensor" }, { "name": "input_dir", "type": "TF_StrTensor" } ], "attributes": [ { "name": "require_matching_crc", "type": "DefaultValuedOptionalAttr" }, { "name": "tensor_name", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.IfrtRestoreVariableOp", "summary": "Restore variable tensors", "description": "This op restores tensors from a checkpoint asynchronously, similar to RestoreV2.\n It fuses variable assignment: tensors that are consumed by AssignVariableOp\n are handled internally via the $var_handles operands and do not appear in\n the results.\n\n Tensors that are consumed by other operations (e.g. tf.LookupTableImportV2) or\n are unused will be returned as results in $tensors. Consequently, the number of\n results is dynamic, containing only those tensors not assigned to variables.\n\n This Op is specific to TFRT + IFRT runtime and is not a stable interface for\n serialization.", "operands": [ { "name": "prefix", "type": "TF_StrTensor" }, { "name": "tensor_names", "type": "TF_StrTensor" }, { "name": "shape_and_slices", "type": "TF_StrTensor" }, { "name": "var_handles", "type": "Variadic" } ], "results": [ { "name": "tensors", "type": "Variadic" } ], "attributes": [ { "name": "restored_dtypes", "type": "TypedArrayAttrBase" }, { "name": "truncate_in_cast", "type": "DenseBoolArrayAttr" }, { "name": "returned_tensor_names", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.Igamma", "summary": "Compute the lower regularized incomplete Gamma function `P(a, x)`.", "description": "The lower regularized incomplete Gamma function is defined as:\n\n\n\\\\(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\\\\)\n\nwhere\n\n\\\\(gamma(a, x) = \\int_{0}^{x} t^{a-1} exp(-t) dt\\\\)\n\nis the lower incomplete Gamma function.\n\nNote, above `Q(a, x)` (`Igammac`) is the upper regularized complete\nGamma function.", "operands": [ { "name": "a", "type": "TF_FloatTensor" }, { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "z", "type": "TF_FloatTensor" } ] }, { "name": "tf.Igammac", "summary": "Compute the upper regularized incomplete Gamma function `Q(a, x)`.", "description": "The upper regularized incomplete Gamma function is defined as:\n\n\\\\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\\\\)\n\nwhere\n\n\\\\(Gamma(a, x) = \\int_{x}^{\\infty} t^{a-1} exp(-t) dt\\\\)\n\nis the upper incomplete Gamma function.\n\nNote, above `P(a, x)` (`Igamma`) is the lower regularized complete\nGamma function.", "operands": [ { "name": "a", "type": "TF_FloatTensor" }, { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "z", "type": "TF_FloatTensor" } ] }, { "name": "tf.IgammaGradA", "summary": "Computes the gradient of `igamma(a, x)` wrt `a`.", "operands": [ { "name": "a", "type": "TF_F32OrF64Tensor" }, { "name": "x", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "z", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.Imag", "summary": "Returns the imaginary part of a complex number.", "description": "Given a tensor `input` of complex numbers, this operation returns a tensor of\ntype `float` that is the imaginary part of each element in `input`. All\nelements in `input` must be complex numbers of the form \\\\(a + bj\\\\), where *a*\nis the real part and *b* is the imaginary part returned by this operation.\n\nFor example:\n\n```\n# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.imag(input) ==> [4.75, 5.75]\n```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Complex128, TF_Complex64]>" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.ImportEvent", "summary": "Outputs a `tf.Event` protocol buffer.", "description": "When CreateSummaryDbWriter is being used, this op can be useful for\nimporting data from event logs.\n\nwriter: A handle to a summary writer.\nevent: A string containing a binary-encoded tf.Event proto.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "event", "type": "TF_StrTensor" } ] }, { "name": "tf.InfeedDequeue", "summary": "A placeholder op for a value that will be fed into the computation.", "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" } ] }, { "name": "tf.InfeedDequeueTuple", "summary": "Fetches multiple values from infeed as an XLA tuple.", "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "_XlaSharding", "type": "OptionalAttr" }, { "name": "layouts", "type": "OptionalAttr" } ] }, { "name": "tf.InfeedEnqueueTuple", "summary": "Feeds multiple Tensor values into the computation as an XLA tuple.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "attributes": [ { "name": "dtypes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "shapes", "type": "TypedArrayAttrBase" }, { "name": "layouts", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "device_ordinal", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.InitializeTable", "summary": "Table initializer that takes two tensors for keys and values respectively.", "operands": [ { "name": "table_handle", "type": "TF_StrTensor" }, { "name": "keys", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.InitializeTableFromDataset", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "dataset", "type": "TF_VariantTensor" } ] }, { "name": "tf.InitializeTableFromTextFile", "summary": "Initializes a table from a text file.", "description": "It inserts one key-value pair into the table for each line of the file.\nThe key and value is extracted from the whole line content, elements from the\nsplit line based on `delimiter` or the line number (starting from zero).\nWhere to extract the key and value from a line is specified by `key_index` and\n`value_index`.\n\n- A value of -1 means use the line number(starting from zero), expects `int64`.\n- A value of -2 means use the whole line content, expects `string`.\n- A value >= 0 means use the index (starting at zero) of the split line based\n on `delimiter`.", "operands": [ { "name": "table_handle", "type": "TF_StrTensor" }, { "name": "filename", "type": "TF_StrTensor" } ], "attributes": [ { "name": "key_index", "type": "ConfinedAttr]>" }, { "name": "value_index", "type": "ConfinedAttr]>" }, { "name": "vocab_size", "type": "ConfinedAttr, [IntMinValue<-1>]>" }, { "name": "delimiter", "type": "DefaultValuedOptionalAttr" }, { "name": "offset", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.InitializeTableFromTextFileV2", "summary": "Initializes a table from a text file.", "description": "It inserts one key-value pair into the table for each line of the file.\nThe key and value is extracted from the whole line content, elements from the\nsplit line based on `delimiter` or the line number (starting from zero).\nWhere to extract the key and value from a line is specified by `key_index` and\n`value_index`.\n\n- A value of -1 means use the line number(starting from zero), expects `int64`.\n- A value of -2 means use the whole line content, expects `string`.\n- A value >= 0 means use the index (starting at zero) of the split line based\n on `delimiter`.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "filename", "type": "TF_StrTensor" } ], "attributes": [ { "name": "key_index", "type": "ConfinedAttr]>" }, { "name": "value_index", "type": "ConfinedAttr]>" }, { "name": "vocab_size", "type": "ConfinedAttr, [IntMinValue<-1>]>" }, { "name": "delimiter", "type": "DefaultValuedOptionalAttr" }, { "name": "offset", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.InitializeTableV2", "summary": "Table initializer that takes two tensors for keys and values respectively.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "keys", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.InplaceAdd", "summary": "Adds v into specified rows of x.", "description": "Computes y = x; y[i, :] += v; return y.", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "i", "type": "TF_Int32Tensor" }, { "name": "v", "type": "TF_Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" } ] }, { "name": "tf.InplaceUpdate", "summary": "Updates specified rows 'i' with values 'v'.", "description": "Computes `x[i, :] = v; return x`.\n\nOriginally this function is mutative however for compilation we make this\noperation create / operate on a copy of `x`.", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "i", "type": "TF_Int32Tensor" }, { "name": "v", "type": "TF_Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" } ] }, { "name": "tf.InTopKV2", "summary": "Says whether the targets are in the top `K` predictions.", "description": "This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the\nprediction for the target class is among the top `k` predictions among\nall predictions for example `i`. Note that the behavior of `InTopK` differs\nfrom the `TopK` op in its handling of ties; if multiple classes have the\nsame prediction value and straddle the top-`k` boundary, all of those\nclasses are considered to be in the top `k`.\n\nMore formally, let\n\n \\\\(predictions_i\\\\) be the predictions for all classes for example `i`,\n \\\\(targets_i\\\\) be the target class for example `i`,\n \\\\(out_i\\\\) be the output for example `i`,\n\n$$out_i = predictions_{i, targets_i} \\in TopKIncludingTies(predictions_i)$$", "operands": [ { "name": "predictions", "type": "TF_Float32Tensor" }, { "name": "targets", "type": "TF_I32OrI64Tensor" }, { "name": "k", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "precision", "type": "TF_BoolTensor" } ] }, { "name": "tf.Inv", "summary": "Computes the reciprocal of x element-wise.", "description": "I.e., \\\\(y = 1 / x\\\\).", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.Invert", "summary": "Invert (flip) each bit of supported types; for example, type `uint8` value 01010101 becomes 10101010.", "description": "Flip each bit of supported types. For example, type `int8` (decimal 2) binary 00000010 becomes (decimal -3) binary 11111101.\nThis operation is performed on each element of the tensor argument `x`.\n\nExample:\n```python\nimport tensorflow as tf\nfrom tensorflow.python.ops import bitwise_ops\n\n# flip 2 (00000010) to -3 (11111101)\ntf.assert_equal(-3, bitwise_ops.invert(2))\n\ndtype_list = [dtypes.int8, dtypes.int16, dtypes.int32, dtypes.int64,\n dtypes.uint8, dtypes.uint16, dtypes.uint32, dtypes.uint64]\n\ninputs = [0, 5, 3, 14]\nfor dtype in dtype_list:\n # Because of issues with negative numbers, let's test this indirectly.\n # 1. invert(a) and a = 0\n # 2. invert(a) or a = invert(0)\n input_tensor = tf.constant([0, 5, 3, 14], dtype=dtype)\n not_a_and_a, not_a_or_a, not_0 = [bitwise_ops.bitwise_and(\n input_tensor, bitwise_ops.invert(input_tensor)),\n bitwise_ops.bitwise_or(\n input_tensor, bitwise_ops.invert(input_tensor)),\n bitwise_ops.invert(\n tf.constant(0, dtype=dtype))]\n\n expected = tf.constant([0, 0, 0, 0], dtype=tf.float32)\n tf.assert_equal(tf.cast(not_a_and_a, tf.float32), expected)\n\n expected = tf.cast([not_0] * 4, tf.float32)\n tf.assert_equal(tf.cast(not_a_or_a, tf.float32), expected)\n\n # For unsigned dtypes let's also check the result directly.\n if dtype.is_unsigned:\n inverted = bitwise_ops.invert(input_tensor)\n expected = tf.constant([dtype.max - x for x in inputs], dtype=tf.float32)\n tf.assert_equal(tf.cast(inverted, tf.float32), tf.cast(expected, tf.float32))\n```", "operands": [ { "name": "x", "type": "TF_IntTensor" } ], "results": [ { "name": "y", "type": "TF_IntTensor" } ] }, { "name": "tf.InvertPermutation", "summary": "Computes the inverse permutation of a tensor.", "description": "This operation computes the inverse of an index permutation. It takes a 1-D\ninteger tensor `x`, which represents the indices of a zero-based array, and\nswaps each value with its index position. In other words, for an output tensor\n`y` and an input tensor `x`, this operation computes the following:\n\n`y[x[i]] = i for i in [0, 1, ..., len(x) - 1]`\n\nThe values must include 0. There can be no duplicate values or negative values.\n\nFor example:\n\n```\n# tensor `x` is [3, 4, 0, 2, 1]\ninvert_permutation(x) ==> [2, 4, 3, 0, 1]\n```", "operands": [ { "name": "x", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "y", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.IRFFT", "summary": "Inverse real-valued fast Fourier transform.", "description": "Computes the inverse 1-dimensional discrete Fourier transform of a real-valued\nsignal over the inner-most dimension of `input`.\n\nThe inner-most dimension of `input` is assumed to be the result of `RFFT`: the\n`fft_length / 2 + 1` unique components of the DFT of a real-valued signal. If\n`fft_length` is not provided, it is computed from the size of the inner-most\ndimension of `input` (`fft_length = 2 * (inner - 1)`). If the FFT length used to\ncompute `input` is odd, it should be provided since it cannot be inferred\nproperly.\n\nAlong the axis `IRFFT` is computed on, if `fft_length / 2 + 1` is smaller\nthan the corresponding dimension of `input`, the dimension is cropped. If it is\nlarger, the dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" }, { "name": "fft_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.IRFFT2D", "summary": "Inverse 2D real-valued fast Fourier transform.", "description": "Computes the inverse 2-dimensional discrete Fourier transform of a real-valued\nsignal over the inner-most 2 dimensions of `input`.\n\nThe inner-most 2 dimensions of `input` are assumed to be the result of `RFFT2D`:\nThe inner-most dimension contains the `fft_length / 2 + 1` unique components of\nthe DFT of a real-valued signal. If `fft_length` is not provided, it is computed\nfrom the size of the inner-most 2 dimensions of `input`. If the FFT length used\nto compute `input` is odd, it should be provided since it cannot be inferred\nproperly.\n\nAlong each axis `IRFFT2D` is computed on, if `fft_length` (or\n`fft_length / 2 + 1` for the inner-most dimension) is smaller than the\ncorresponding dimension of `input`, the dimension is cropped. If it is larger,\nthe dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" }, { "name": "fft_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.IRFFT3D", "summary": "Inverse 3D real-valued fast Fourier transform.", "description": "Computes the inverse 3-dimensional discrete Fourier transform of a real-valued\nsignal over the inner-most 3 dimensions of `input`.\n\nThe inner-most 3 dimensions of `input` are assumed to be the result of `RFFT3D`:\nThe inner-most dimension contains the `fft_length / 2 + 1` unique components of\nthe DFT of a real-valued signal. If `fft_length` is not provided, it is computed\nfrom the size of the inner-most 3 dimensions of `input`. If the FFT length used\nto compute `input` is odd, it should be provided since it cannot be inferred\nproperly.\n\nAlong each axis `IRFFT3D` is computed on, if `fft_length` (or\n`fft_length / 2 + 1` for the inner-most dimension) is smaller than the\ncorresponding dimension of `input`, the dimension is cropped. If it is larger,\nthe dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" }, { "name": "fft_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.IsFinite", "summary": "Returns which elements of x are finite.", "description": "@compatibility(numpy)\nEquivalent to np.isfinite\n@end_compatibility\n\nExample:\n\n```python\nx = tf.constant([5.0, 4.8, 6.8, np.inf, np.nan])\ntf.math.is_finite(x) ==> [True, True, True, False, False]\n```", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_BoolTensor" } ] }, { "name": "tf.IsInf", "summary": "Returns which elements of x are Inf.", "description": "@compatibility(numpy)\nEquivalent to np.isinf\n@end_compatibility\n\nExample:\n\n```python\nx = tf.constant([5.0, np.inf, 6.8, np.inf])\ntf.math.is_inf(x) ==> [False, True, False, True]\n```", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_BoolTensor" } ] }, { "name": "tf.IsNan", "summary": "Returns which elements of x are NaN.", "description": "@compatibility(numpy)\nEquivalent to np.isnan\n@end_compatibility\n\nExample:\n\n```python\nx = tf.constant([5.0, np.nan, 6.8, np.nan, np.inf])\ntf.math.is_nan(x) ==> [False, True, False, True, False]\n```", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_BoolTensor" } ] }, { "name": "tf.Iterator", "summary": "A container for an iterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "shared_name", "type": "StrAttr" }, { "name": "container", "type": "StrAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.IteratorFromStringHandle", "summary": "Converts the given string representing a handle to an iterator to a resource.", "operands": [ { "name": "string_handle", "type": "TF_StrTensor" } ], "results": [ { "name": "resource_handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "output_types", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "output_shapes", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.IteratorFromStringHandleV2", "operands": [ { "name": "string_handle", "type": "TF_StrTensor" } ], "results": [ { "name": "resource_handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "output_types", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "output_shapes", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.IteratorGetNext", "summary": "Gets the next output from the given iterator .", "operands": [ { "name": "iterator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "components", "type": "Variadic" } ] }, { "name": "tf.IteratorGetNextAsOptional", "summary": "Gets the next output from the given iterator as an Optional variant.", "operands": [ { "name": "iterator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "optional", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.IteratorGetNextSync", "summary": "Gets the next output from the given iterator.", "description": "This operation is a synchronous version IteratorGetNext. It should only be used\nin situations where the iterator does not block the calling thread, or where\nthe calling thread is not a member of the thread pool used to execute parallel\noperations (e.g. in eager mode).", "operands": [ { "name": "iterator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "components", "type": "Variadic" } ] }, { "name": "tf.IteratorToStringHandle", "summary": "Converts the given `resource_handle` representing an iterator to a string.", "operands": [ { "name": "resource_handle", "type": "TF_ResourceTensor" } ], "results": [ { "name": "string_handle", "type": "TF_StrTensor" } ] }, { "name": "tf.IteratorV2", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "shared_name", "type": "StrAttr" }, { "name": "container", "type": "StrAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.KthOrderStatistic", "summary": "Computes the Kth order statistic of a data set. The current", "description": "implementation uses a binary search requiring exactly 32 passes over\nthe input data. The running time is linear with respect to input\nsize. The median-of-medians algorithm is probably faster, but is\ndifficult to implement efficiently in XLA. The implementation imposes\na total ordering on floats. The ordering is consistent with the usual\npartial order. Positive NaNs are greater than positive\ninfinity. Negative NaNs are less than negative infinity. NaNs with\ndistinct payloads are treated as distinct. Subnormal numbers are\npreserved (not flushed to zero). Positive infinity is greater than all\nnumbers. Negative infinity is less than all numbers. Positive is\ngreater than negative zero. There are less than k values greater than\nthe kth order statistic. There are at least k values greater than or\nequal to the Kth order statistic. The semantics are not the same as\ntop_k_unique.", "operands": [ { "name": "input", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "k", "type": "I64Attr" } ] }, { "name": "tf.L2Loss", "summary": "L2 Loss.", "description": "Computes half the L2 norm of a tensor without the `sqrt`:\n\n output = sum(t ** 2) / 2", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.LeakyRelu", "summary": "Computes rectified linear: `max(features, features * alpha)`.", "operands": [ { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "activations", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LeakyReluGrad", "summary": "Computes rectified linear gradients for a LeakyRelu operation.", "operands": [ { "name": "gradients", "type": "TF_FloatTensor" }, { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "backprops", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "alpha", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LeftShift", "summary": "Elementwise computes the bitwise left-shift of `x` and `y`.", "description": "If `y` is negative, or greater than or equal to the width of `x` in bits the\nresult is implementation defined.\n\nExample:\n\n```python\nimport tensorflow as tf\nfrom tensorflow.python.ops import bitwise_ops\nimport numpy as np\ndtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]\n\nfor dtype in dtype_list:\n lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)\n rhs = tf.constant([5, 0, 7, 11], dtype=dtype)\n\n left_shift_result = bitwise_ops.left_shift(lhs, rhs)\n\n print(left_shift_result)\n\n# This will print:\n# tf.Tensor([ -32 -5 -128 0], shape=(4,), dtype=int8)\n# tf.Tensor([ -32 -5 -384 -28672], shape=(4,), dtype=int16)\n# tf.Tensor([ -32 -5 -384 -28672], shape=(4,), dtype=int32)\n# tf.Tensor([ -32 -5 -384 -28672], shape=(4,), dtype=int64)\n\nlhs = np.array([-2, 64, 101, 32], dtype=np.int8)\nrhs = np.array([-1, -5, -3, -14], dtype=np.int8)\nbitwise_ops.left_shift(lhs, rhs)\n# \n```", "operands": [ { "name": "x", "type": "TF_IntTensor" }, { "name": "y", "type": "TF_IntTensor" } ], "results": [ { "name": "z", "type": "TF_IntTensor" } ] }, { "name": "tf.LegacyCall", "summary": "returns `f(inputs)`, where `f` is a function.", "description": "The LegacyCall operation represents a direct call to a function that is\n within the same symbol scope as the call and is mapped to a GraphDef node\n with the function name as the op name. Unlike a PartitionedCall which\n represents asynchronously executing a function across multiple devices, a\n LegacyCall ignores specification for ops in the attached function and\n instead executes it on the device assigned to this op.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "f", "type": "FlatSymbolRefAttr" }, { "name": "_disable_call_shape_inference", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Less", "summary": "Returns the truth value of (x < y) element-wise.", "description": "*NOTE*: `Less` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\nExample:\n\n```python\nx = tf.constant([5, 4, 6])\ny = tf.constant([5])\ntf.math.less(x, y) ==> [False, True, False]\n\nx = tf.constant([5, 4, 6])\ny = tf.constant([5, 6, 7])\ntf.math.less(x, y) ==> [False, True, True]\n```", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ] }, { "name": "tf.LessEqual", "summary": "Returns the truth value of (x <= y) element-wise.", "description": "*NOTE*: `LessEqual` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\nExample:\n\n```python\nx = tf.constant([5, 4, 6])\ny = tf.constant([5])\ntf.math.less_equal(x, y) ==> [True, True, False]\n\nx = tf.constant([5, 4, 6])\ny = tf.constant([5, 6, 6])\ntf.math.less_equal(x, y) ==> [True, True, True]\n```", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ] }, { "name": "tf.Lgamma", "summary": "Computes the log of the absolute value of `Gamma(x)` element-wise.", "description": "For positive numbers, this function computes log((input - 1)!) for every element in the tensor.\n `lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539`\n\nExample:\n\n```python\nx = tf.constant([0, 0.5, 1, 4.5, -4, -5.6])\ntf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685]\n```", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.LinSpace", "summary": "Generates values in an interval.", "description": "A sequence of `num` evenly-spaced values are generated beginning at `start`.\nIf `num > 1`, the values in the sequence increase by\n`(stop - start) / (num - 1)`, so that the last one is exactly `stop`.\n\nFor example:\n\n```\ntf.linspace(10.0, 12.0, 3, name=\"linspace\") => [ 10.0 11.0 12.0]\n```", "operands": [ { "name": "start", "type": "TF_FloatTensor" }, { "name": "stop", "type": "TF_FloatTensor" }, { "name": "num", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.ListDiff", "summary": "Computes the difference between two lists of numbers or strings.", "description": "Given a list `x` and a list `y`, this operation returns a list `out` that\nrepresents all values that are in `x` but not in `y`. The returned list `out`\nis sorted in the same order that the numbers appear in `x` (duplicates are\npreserved). This operation also returns a list `idx` that represents the\nposition of each `out` element in `x`. In other words:\n\n`out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]`\n\nFor example, given this input:\n\n```\nx = [1, 2, 3, 4, 5, 6]\ny = [1, 3, 5]\n```\n\nThis operation would return:\n\n```\nout ==> [2, 4, 6]\nidx ==> [1, 3, 5]\n```", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "y", "type": "TF_Tensor" } ], "results": [ { "name": "out", "type": "TF_Tensor" }, { "name": "idx", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.LoadTPUEmbeddingAdadeltaParameters", "summary": "Load Adadelta embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "updates", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "updates", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingAdagradParameters", "summary": "Load Adagrad embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingADAMParameters", "summary": "Load ADAM embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocities", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingADAMParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocities", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingCenteredRMSPropParameters", "summary": "Load centered RMSProp embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "ms", "type": "TF_Float32Tensor" }, { "name": "mom", "type": "TF_Float32Tensor" }, { "name": "mg", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingFTRLParameters", "summary": "Load FTRL embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "linears", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "linears", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingMDLAdagradLightParameters", "summary": "Load MDL Adagrad Light embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "benefits", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingMomentumParameters", "summary": "Load Momentum embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingProximalAdagradParameters", "summary": "Load proximal Adagrad embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingProximalYogiParameters", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "v", "type": "TF_Float32Tensor" }, { "name": "m", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "v", "type": "TF_Float32Tensor" }, { "name": "m", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingRMSPropParameters", "summary": "Load RMSProp embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "ms", "type": "TF_Float32Tensor" }, { "name": "mom", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "ms", "type": "TF_Float32Tensor" }, { "name": "mom", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingStochasticGradientDescentParameters", "summary": "Load SGD embedding parameters.", "description": "An op that loads optimization parameters into HBM for embedding. Must be\npreceded by a ConfigureTPUEmbeddingHost op that sets up the correct\nembedding table configuration. For example, this op is used to install\nparameters that are loaded from a checkpoint before a training loop is\nexecuted.", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug", "operands": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Log", "summary": "Computes natural logarithm of x element-wise.", "description": "I.e., \\\\(y = \\log_e x\\\\).\n\nExample:\n\n```python\nx = tf.constant([0, 0.5, 1, 5])\ntf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438]\n```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Log1p", "summary": "Computes natural logarithm of (1 + x) element-wise.", "description": "I.e., \\\\(y = \\log_e (1 + x)\\\\).\n\nExample:\n\n```python\nx = tf.constant([0, 0.5, 1, 5])\ntf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595]\n```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.LogicalAnd", "summary": "Returns the truth value of x AND y element-wise.", "description": "*NOTE*: `LogicalAnd` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_BoolTensor" }, { "name": "y", "type": "TF_BoolTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ] }, { "name": "tf.LogicalNot", "summary": "Returns the truth value of `NOT x` element-wise.", "operands": [ { "name": "x", "type": "TF_BoolTensor" } ], "results": [ { "name": "y", "type": "TF_BoolTensor" } ] }, { "name": "tf.LogicalOr", "summary": "Returns the truth value of x OR y element-wise.", "description": "*NOTE*: `LogicalOr` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_BoolTensor" }, { "name": "y", "type": "TF_BoolTensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ] }, { "name": "tf.LogSoftmax", "summary": "Computes log softmax activations.", "description": "For each batch `i` and class `j` we have\n\n logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))", "operands": [ { "name": "logits", "type": "TF_FloatTensor" } ], "results": [ { "name": "logsoftmax", "type": "TF_FloatTensor" } ] }, { "name": "tf.LookupTableExportV2", "summary": "Outputs all keys and values in the table.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" } ], "results": [ { "name": "keys", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.LookupTableFind", "summary": "Looks up keys in a table, outputs the corresponding values.", "description": "The tensor `keys` must of the same type as the keys of the table.\nThe output `values` is of the type of the table values.\n\nThe scalar `default_value` is the value output for keys not present in the\ntable. It must also be of the same type as the table values.", "operands": [ { "name": "table_handle", "type": "TF_StrTensor" }, { "name": "keys", "type": "TF_Tensor" }, { "name": "default_value", "type": "TF_Tensor" } ], "results": [ { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.LookupTableFindV2", "summary": "Looks up keys in a table, outputs the corresponding values.", "description": "The tensor `keys` must of the same type as the keys of the table.\nThe output `values` is of the type of the table values.\n\nThe scalar `default_value` is the value output for keys not present in the\ntable. It must also be of the same type as the table values.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "keys", "type": "TF_Tensor" }, { "name": "default_value", "type": "TF_Tensor" } ], "results": [ { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.LookupTableImportV2", "summary": "Replaces the contents of the table with the specified keys and values.", "description": "The tensor `keys` must be of the same type as the keys of the table.\nThe tensor `values` must be of the type of the table values.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "keys", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.LookupTableInsertV2", "summary": "Updates the table to associates keys with values.", "description": "The tensor `keys` must be of the same type as the keys of the table.\nThe tensor `values` must be of the type of the table values.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "keys", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.LookupTableRemoveV2", "summary": "Removes keys and its associated values from a table.", "description": "The tensor `keys` must of the same type as the keys of the table. Keys not\nalready in the table are silently ignored.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" }, { "name": "keys", "type": "TF_Tensor" } ] }, { "name": "tf.LookupTableSize", "summary": "Computes the number of elements in the given table.", "operands": [ { "name": "table_handle", "type": "TF_StrTensor" } ], "results": [ { "name": "size", "type": "TF_Int64Tensor" } ] }, { "name": "tf.LookupTableSizeV2", "summary": "Computes the number of elements in the given table.", "operands": [ { "name": "table_handle", "type": "TF_ResourceTensor" } ], "results": [ { "name": "size", "type": "TF_Int64Tensor" } ] }, { "name": "tf.LowerBound", "summary": "Applies lower_bound(sorted_search_values, values) along each row.", "description": "Each set of rows with the same index in (sorted_inputs, values) is treated\nindependently. The resulting row is the equivalent of calling\n`np.searchsorted(sorted_inputs, values, side='left')`.\n\nThe result is not a global index to the entire\n`Tensor`, but rather just the index in the last dimension.\n\nA 2-D example:\n sorted_sequence = [[0, 3, 9, 9, 10],\n [1, 2, 3, 4, 5]]\n values = [[2, 4, 9],\n [0, 2, 6]]\n\n result = LowerBound(sorted_sequence, values)\n\n result == [[1, 2, 2],\n [0, 1, 5]]", "operands": [ { "name": "sorted_inputs", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.LRN", "summary": "Local Response Normalization.", "description": "The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last\ndimension), and each vector is normalized independently. Within a given vector,\neach component is divided by the weighted, squared sum of inputs within\n`depth_radius`. In detail,\n\n sqr_sum[a, b, c, d] =\n sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)\n output = input / (bias + alpha * sqr_sum) ** beta\n\nFor details, see [Krizhevsky et al., ImageNet classification with deep\nconvolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" } ], "attributes": [ { "name": "depth_radius", "type": "DefaultValuedOptionalAttr" }, { "name": "bias", "type": "DefaultValuedOptionalAttr" }, { "name": "alpha", "type": "DefaultValuedOptionalAttr" }, { "name": "beta", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.LRNGrad", "summary": "Gradients for Local Response Normalization.", "operands": [ { "name": "input_grads", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "input_image", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "output_image", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "attributes": [ { "name": "depth_radius", "type": "DefaultValuedOptionalAttr" }, { "name": "bias", "type": "DefaultValuedOptionalAttr" }, { "name": "alpha", "type": "DefaultValuedOptionalAttr" }, { "name": "beta", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MakeIterator", "summary": "Makes a new iterator from the given `dataset` and stores it in `iterator`.", "description": "This operation may be executed multiple times. Each execution will reset the\niterator in `iterator` to the first element of `dataset`.", "operands": [ { "name": "dataset", "type": "TF_VariantTensor" }, { "name": "iterator", "type": "TF_ResourceTensor" } ] }, { "name": "tf.MakeUnique", "summary": "Make all elements in the non-Batch dimension unique, but \\\"close\\\" to", "description": "their initial value. Never returns a sub-normal number. Never returns\nzero. The sign of each input element is always identical to the sign\nof the corresponding output element. Behavior for infinite elements is\nundefined. Behavior for subnormal elements is undefined.", "operands": [ { "name": "input", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TF_Float32Tensor" } ] }, { "name": "tf.MapAndBatchDataset", "summary": "Creates a dataset that fuses mapping with batching.", "description": "Creates a dataset that applies `f` to the outputs of `input_dataset` and then\nbatches `batch_size` of them.\n\nUnlike a \"MapDataset\", which applies `f` sequentially, this dataset invokes up\nto `batch_size * num_parallel_batches` copies of `f` in parallel.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "other_arguments", "type": "Variadic" }, { "name": "batch_size", "type": "TF_Int64Tensor" }, { "name": "num_parallel_calls", "type": "TF_Int64Tensor" }, { "name": "drop_remainder", "type": "TF_BoolTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "preserve_cardinality", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MapDataset", "summary": "Creates a dataset that applies `f` to the outputs of `input_dataset`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "other_arguments", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "use_inter_op_parallelism", "type": "DefaultValuedOptionalAttr" }, { "name": "preserve_cardinality", "type": "DefaultValuedOptionalAttr" }, { "name": "force_synchronous", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MatMul", "summary": "Multiply the matrix \"a\" by the matrix \"b\".", "description": "The inputs must be two-dimensional matrices and the inner dimension of\n\"a\" (after being transposed if transpose_a is true) must match the\nouter dimension of \"b\" (after being transposed if transposed_b is\ntrue).\n\n*Note*: The default kernel implementation for MatMul on GPUs uses\ncublas.", "operands": [ { "name": "a", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "b", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "product", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedOptionalAttr" }, { "name": "transpose_b", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_a", "type": "DefaultValuedOptionalAttr" }, { "name": "grad_b", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MatrixBandPart", "summary": "Copy a tensor setting everything outside a central band in each innermost matrix to zero.", "description": "The `band` part is computed as follows:\nAssume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a\ntensor with the same shape where\n\n`band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]`.\n\nThe indicator function\n\n`in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) &&\n (num_upper < 0 || (n-m) <= num_upper)`.\n\nFor example:\n\n```\n# if 'input' is [[ 0, 1, 2, 3]\n# [-1, 0, 1, 2]\n# [-2, -1, 0, 1]\n# [-3, -2, -1, 0]],\n\ntf.linalg.band_part(input, 1, -1) ==> [[ 0, 1, 2, 3]\n [-1, 0, 1, 2]\n [ 0, -1, 0, 1]\n [ 0, 0, -1, 0]],\n\ntf.linalg.band_part(input, 2, 1) ==> [[ 0, 1, 0, 0]\n [-1, 0, 1, 0]\n [-2, -1, 0, 1]\n [ 0, -2, -1, 0]]\n```\n\nUseful special cases:\n\n```\n tf.linalg.band_part(input, 0, -1) ==> Upper triangular part.\n tf.linalg.band_part(input, -1, 0) ==> Lower triangular part.\n tf.linalg.band_part(input, 0, 0) ==> Diagonal.\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "num_lower", "type": "TF_I32OrI64Tensor" }, { "name": "num_upper", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "band", "type": "TF_Tensor" } ] }, { "name": "tf.MatrixDiag", "summary": "Returns a batched diagonal tensor with a given batched diagonal values.", "description": "Given a `diagonal`, this operation returns a tensor with the `diagonal` and\neverything else padded with zeros. The diagonal is computed as follows:\n\nAssume `diagonal` has `k` dimensions `[I, J, K, ..., N]`, then the output is a\ntensor of rank `k+1` with dimensions [I, J, K, ..., N, N]` where:\n\n`output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]`.\n\nFor example:\n\n```\n# 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]\n\nand diagonal.shape = (2, 4)\n\ntf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0]\n [0, 2, 0, 0]\n [0, 0, 3, 0]\n [0, 0, 0, 4]],\n [[5, 0, 0, 0]\n [0, 6, 0, 0]\n [0, 0, 7, 0]\n [0, 0, 0, 8]]]\n\nwhich has shape (2, 4, 4)\n```", "operands": [ { "name": "diagonal", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.MatrixDiagPartV3", "summary": "Returns the batched diagonal part of a batched tensor.", "description": "Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched\n`input`.\n\nAssume `input` has `r` dimensions `[I, J, ..., L, M, N]`.\nLet `max_diag_len` be the maximum length among all diagonals to be extracted,\n`max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))`\nLet `num_diags` be the number of diagonals to extract,\n`num_diags = k[1] - k[0] + 1`.\n\nIf `num_diags == 1`, the output tensor is of rank `r - 1` with shape\n`[I, J, ..., L, max_diag_len]` and values:\n\n```\ndiagonal[i, j, ..., l, n]\n = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,\n padding_value ; otherwise.\n```\nwhere `y = max(-k[1], 0)`, `x = max(k[1], 0)`.\n\nOtherwise, the output tensor has rank `r` with dimensions\n`[I, J, ..., L, num_diags, max_diag_len]` with values:\n\n```\ndiagonal[i, j, ..., l, m, n]\n = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,\n padding_value ; otherwise.\n```\nwhere `d = k[1] - m`, `y = max(-d, 0) - offset`, and `x = max(d, 0) - offset`.\n\n`offset` is zero except when the alignment of the diagonal is to the right.\n```\noffset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}\n and `d >= 0`) or\n (`align` in {LEFT_RIGHT, RIGHT_RIGHT}\n and `d <= 0`)\n 0 ; otherwise\n```\nwhere `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`.\n\nThe input must be at least a matrix.\n\nFor example:\n\n```\ninput = np.array([[[1, 2, 3, 4], # Input shape: (2, 3, 4)\n [5, 6, 7, 8],\n [9, 8, 7, 6]],\n [[5, 4, 3, 2],\n [1, 2, 3, 4],\n [5, 6, 7, 8]]])\n\n# A main diagonal from each batch.\ntf.matrix_diag_part(input) ==> [[1, 6, 7], # Output shape: (2, 3)\n [5, 2, 7]]\n\n# A superdiagonal from each batch.\ntf.matrix_diag_part(input, k = 1)\n ==> [[2, 7, 6], # Output shape: (2, 3)\n [4, 3, 8]]\n\n# A band from each batch.\ntf.matrix_diag_part(input, k = (-1, 2))\n ==> [[[0, 3, 8], # Output shape: (2, 4, 3)\n [2, 7, 6],\n [1, 6, 7],\n [5, 8, 0]],\n [[0, 3, 4],\n [4, 3, 8],\n [5, 2, 7],\n [1, 6, 0]]]\n\n# LEFT_RIGHT alignment.\ntf.matrix_diag_part(input, k = (-1, 2), align=\"LEFT_RIGHT\")\n ==> [[[3, 8, 0], # Output shape: (2, 4, 3)\n [2, 7, 6],\n [1, 6, 7],\n [0, 5, 8]],\n [[3, 4, 0],\n [4, 3, 8],\n [5, 2, 7],\n [0, 1, 6]]]\n\n# max_diag_len can be shorter than the main diagonal.\ntf.matrix_diag_part(input, k = (-2, -1))\n ==> [[[5, 8],\n [9, 0]],\n [[1, 6],\n [5, 0]]]\n\n# padding_value = 9\ntf.matrix_diag_part(input, k = (1, 3), padding_value = 9)\n ==> [[[9, 9, 4], # Output shape: (2, 3, 3)\n [9, 3, 8],\n [2, 7, 6]],\n [[9, 9, 2],\n [9, 3, 4],\n [4, 3, 8]]]\n\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "k", "type": "TF_Int32Tensor" }, { "name": "padding_value", "type": "TF_Tensor" } ], "results": [ { "name": "diagonal", "type": "TF_Tensor" } ], "attributes": [ { "name": "align", "type": "DefaultValuedOptionalAttr, \"RIGHT_LEFT\">" } ] }, { "name": "tf.MatrixDiagV2", "summary": "Returns a batched diagonal tensor with given batched diagonal values.", "description": "Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th\ndiagonals of a matrix, with everything else padded with `padding`. `num_rows`\nand `num_cols` specify the dimension of the innermost matrix of the output. If\nboth are not specified, the op assumes the innermost matrix is square and infers\nits size from `k` and the innermost dimension of `diagonal`. If only one of them\nis specified, the op assumes the unspecified value is the smallest possible\nbased on other criteria.\n\nLet `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has\nrank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one\ndiagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank\n`r` with shape `[I, J, ..., L, num_rows, num_cols]`.\n\nThe second innermost dimension of `diagonal` has double meaning.\nWhen `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size\n[I, J, ..., M], and the output tensor is:\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper\n padding_value ; otherwise\n```\n\nOtherwise, `M` is treated as the number of diagonals for the matrix in the\nsame batch (`M = k[1]-k[0]+1`), and the output tensor is:\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]\n padding_value ; otherwise\n```\nwhere `d = n - m`, `diag_index = k[1] - d`, and `index_in_diag = n - max(d, 0)`.\n\nFor example:\n\n```\n# The main diagonal.\ndiagonal = np.array([[1, 2, 3, 4], # Input shape: (2, 4)\n [5, 6, 7, 8]])\ntf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0], # Output shape: (2, 4, 4)\n [0, 2, 0, 0],\n [0, 0, 3, 0],\n [0, 0, 0, 4]],\n [[5, 0, 0, 0],\n [0, 6, 0, 0],\n [0, 0, 7, 0],\n [0, 0, 0, 8]]]\n\n# A superdiagonal (per batch).\ndiagonal = np.array([[1, 2, 3], # Input shape: (2, 3)\n [4, 5, 6]])\ntf.matrix_diag(diagonal, k = 1)\n ==> [[[0, 1, 0, 0], # Output shape: (2, 4, 4)\n [0, 0, 2, 0],\n [0, 0, 0, 3],\n [0, 0, 0, 0]],\n [[0, 4, 0, 0],\n [0, 0, 5, 0],\n [0, 0, 0, 6],\n [0, 0, 0, 0]]]\n\n# A band of diagonals.\ndiagonals = np.array([[[1, 2, 3], # Input shape: (2, 2, 3)\n [4, 5, 0]],\n [[6, 7, 9],\n [9, 1, 0]]])\ntf.matrix_diag(diagonals, k = (-1, 0))\n ==> [[[1, 0, 0], # Output shape: (2, 3, 3)\n [4, 2, 0],\n [0, 5, 3]],\n [[6, 0, 0],\n [9, 7, 0],\n [0, 1, 9]]]\n\n# Rectangular matrix.\ndiagonal = np.array([1, 2]) # Input shape: (2)\ntf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)\n ==> [[0, 0, 0, 0], # Output shape: (3, 4)\n [1, 0, 0, 0],\n [0, 2, 0, 0]]\n\n# Rectangular matrix with inferred num_cols and padding_value = 9.\ntf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)\n ==> [[9, 9], # Output shape: (3, 2)\n [1, 9],\n [9, 2]]\n```", "operands": [ { "name": "diagonal", "type": "TF_Tensor" }, { "name": "k", "type": "TF_Int32Tensor" }, { "name": "num_rows", "type": "TF_Int32Tensor" }, { "name": "num_cols", "type": "TF_Int32Tensor" }, { "name": "padding_value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.MatrixDiagV3", "summary": "Returns a batched diagonal tensor with given batched diagonal values.", "description": "Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th\ndiagonals of a matrix, with everything else padded with `padding`. `num_rows`\nand `num_cols` specify the dimension of the innermost matrix of the output. If\nboth are not specified, the op assumes the innermost matrix is square and infers\nits size from `k` and the innermost dimension of `diagonal`. If only one of them\nis specified, the op assumes the unspecified value is the smallest possible\nbased on other criteria.\n\nLet `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has\nrank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one\ndiagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank\n`r` with shape `[I, J, ..., L, num_rows, num_cols]`.\n\nThe second innermost dimension of `diagonal` has double meaning.\nWhen `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size\n[I, J, ..., M], and the output tensor is:\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper\n padding_value ; otherwise\n```\n\nOtherwise, `M` is treated as the number of diagonals for the matrix in the\nsame batch (`M = k[1]-k[0]+1`), and the output tensor is:\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]\n padding_value ; otherwise\n```\nwhere `d = n - m`, `diag_index = [k] - d`, and\n`index_in_diag = n - max(d, 0) + offset`.\n\n`offset` is zero except when the alignment of the diagonal is to the right.\n```\noffset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}\n and `d >= 0`) or\n (`align` in {LEFT_RIGHT, RIGHT_RIGHT}\n and `d <= 0`)\n 0 ; otherwise\n```\nwhere `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`.\n\nFor example:\n\n```\n# The main diagonal.\ndiagonal = np.array([[1, 2, 3, 4], # Input shape: (2, 4)\n [5, 6, 7, 8]])\ntf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0], # Output shape: (2, 4, 4)\n [0, 2, 0, 0],\n [0, 0, 3, 0],\n [0, 0, 0, 4]],\n [[5, 0, 0, 0],\n [0, 6, 0, 0],\n [0, 0, 7, 0],\n [0, 0, 0, 8]]]\n\n# A superdiagonal (per batch).\ndiagonal = np.array([[1, 2, 3], # Input shape: (2, 3)\n [4, 5, 6]])\ntf.matrix_diag(diagonal, k = 1)\n ==> [[[0, 1, 0, 0], # Output shape: (2, 4, 4)\n [0, 0, 2, 0],\n [0, 0, 0, 3],\n [0, 0, 0, 0]],\n [[0, 4, 0, 0],\n [0, 0, 5, 0],\n [0, 0, 0, 6],\n [0, 0, 0, 0]]]\n\n# A tridiagonal band (per batch).\ndiagonals = np.array([[[0, 8, 9], # Input shape: (2, 2, 3)\n [1, 2, 3],\n [4, 5, 0]],\n [[0, 2, 3],\n [6, 7, 9],\n [9, 1, 0]]])\ntf.matrix_diag(diagonals, k = (-1, 1))\n ==> [[[1, 8, 0], # Output shape: (2, 3, 3)\n [4, 2, 9],\n [0, 5, 3]],\n [[6, 2, 0],\n [9, 7, 3],\n [0, 1, 9]]]\n\n# LEFT_RIGHT alignment.\ndiagonals = np.array([[[8, 9, 0], # Input shape: (2, 2, 3)\n [1, 2, 3],\n [0, 4, 5]],\n [[2, 3, 0],\n [6, 7, 9],\n [0, 9, 1]]])\ntf.matrix_diag(diagonals, k = (-1, 1), align=\"LEFT_RIGHT\")\n ==> [[[1, 8, 0], # Output shape: (2, 3, 3)\n [4, 2, 9],\n [0, 5, 3]],\n [[6, 2, 0],\n [9, 7, 3],\n [0, 1, 9]]]\n\n# Rectangular matrix.\ndiagonal = np.array([1, 2]) # Input shape: (2)\ntf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)\n ==> [[0, 0, 0, 0], # Output shape: (3, 4)\n [1, 0, 0, 0],\n [0, 2, 0, 0]]\n\n# Rectangular matrix with inferred num_cols and padding_value = 9.\ntf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)\n ==> [[9, 9], # Output shape: (3, 2)\n [1, 9],\n [9, 2]]\n\n```", "operands": [ { "name": "diagonal", "type": "TF_Tensor" }, { "name": "k", "type": "TF_Int32Tensor" }, { "name": "num_rows", "type": "TF_Int32Tensor" }, { "name": "num_cols", "type": "TF_Int32Tensor" }, { "name": "padding_value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "align", "type": "DefaultValuedOptionalAttr, \"RIGHT_LEFT\">" } ] }, { "name": "tf.MatrixInverse", "summary": "Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes).", "description": "The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions\nform square matrices. The output is a tensor of the same shape as the input\ncontaining the inverse for all input submatrices `[..., :, :]`.\n\nThe op uses LU decomposition with partial pivoting to compute the inverses.\n\nIf a matrix is not invertible there is no guarantee what the op does. It\nmay detect the condition and raise an exception or it may simply return a\ngarbage result.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "adjoint", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MatrixSetDiag", "summary": "Returns a batched matrix tensor with new batched diagonal values.", "description": "Given `input` and `diagonal`, this operation returns a tensor with the\nsame shape and values as `input`, except for the main diagonal of the\ninnermost matrices. These will be overwritten by the values in `diagonal`.\n\nThe output is computed as follows:\n\nAssume `input` has `k+1` dimensions `[I, J, K, ..., M, N]` and `diagonal` has\n`k` dimensions `[I, J, K, ..., min(M, N)]`. Then the output is a\ntensor of rank `k+1` with dimensions `[I, J, K, ..., M, N]` where:\n\n * `output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n]` for `m == n`.\n * `output[i, j, k, ..., m, n] = input[i, j, k, ..., m, n]` for `m != n`.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "diagonal", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.MatrixSetDiagV2", "summary": "Returns a batched matrix tensor with new batched diagonal values.", "description": "Given `input` and `diagonal`, this operation returns a tensor with the\nsame shape and values as `input`, except for the specified diagonals of the\ninnermost matrices. These will be overwritten by the values in `diagonal`.\n\n`input` has `r+1` dimensions `[I, J, ..., L, M, N]`. When `k` is scalar or\n`k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`.\nOtherwise, it has `r+1` dimensions `[I, J, ..., L, num_diags, max_diag_len]`.\n`num_diags` is the number of diagonals, `num_diags = k[1] - k[0] + 1`.\n`max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`,\n`max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))`\n\nThe output is a tensor of rank `k+1` with dimensions `[I, J, ..., L, M, N]`.\nIf `k` is scalar or `k[0] == k[1]`:\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]\n input[i, j, ..., l, m, n] ; otherwise\n```\n\nOtherwise,\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]\n input[i, j, ..., l, m, n] ; otherwise\n```\nwhere `d = n - m`, `diag_index = k[1] - d`, and `index_in_diag = n - max(d, 0)`.\n\nFor example:\n\n```\n# The main diagonal.\ninput = np.array([[[7, 7, 7, 7], # Input shape: (2, 3, 4)\n [7, 7, 7, 7],\n [7, 7, 7, 7]],\n [[7, 7, 7, 7],\n [7, 7, 7, 7],\n [7, 7, 7, 7]]])\ndiagonal = np.array([[1, 2, 3], # Diagonal shape: (2, 3)\n [4, 5, 6]])\ntf.matrix_set_diag(diagonal) ==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)\n [7, 2, 7, 7],\n [7, 7, 3, 7]],\n [[4, 7, 7, 7],\n [7, 5, 7, 7],\n [7, 7, 6, 7]]]\n\n# A superdiagonal (per batch).\ntf.matrix_set_diag(diagonal, k = 1)\n ==> [[[7, 1, 7, 7], # Output shape: (2, 3, 4)\n [7, 7, 2, 7],\n [7, 7, 7, 3]],\n [[7, 4, 7, 7],\n [7, 7, 5, 7],\n [7, 7, 7, 6]]]\n\n# A band of diagonals.\ndiagonals = np.array([[[1, 2, 3], # Diagonal shape: (2, 2, 3)\n [4, 5, 0]],\n [[6, 1, 2],\n [3, 4, 0]]])\ntf.matrix_set_diag(diagonals, k = (-1, 0))\n ==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)\n [4, 2, 7, 7],\n [0, 5, 3, 7]],\n [[6, 7, 7, 7],\n [3, 1, 7, 7],\n [7, 4, 2, 7]]]\n\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "diagonal", "type": "TF_Tensor" }, { "name": "k", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.MatrixSetDiagV3", "summary": "Returns a batched matrix tensor with new batched diagonal values.", "description": "Given `input` and `diagonal`, this operation returns a tensor with the\nsame shape and values as `input`, except for the specified diagonals of the\ninnermost matrices. These will be overwritten by the values in `diagonal`.\n\n`input` has `r+1` dimensions `[I, J, ..., L, M, N]`. When `k` is scalar or\n`k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`.\nOtherwise, it has `r+1` dimensions `[I, J, ..., L, num_diags, max_diag_len]`.\n`num_diags` is the number of diagonals, `num_diags = k[1] - k[0] + 1`.\n`max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`,\n`max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))`\n\nThe output is a tensor of rank `k+1` with dimensions `[I, J, ..., L, M, N]`.\nIf `k` is scalar or `k[0] == k[1]`:\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]\n input[i, j, ..., l, m, n] ; otherwise\n```\n\nOtherwise,\n\n```\noutput[i, j, ..., l, m, n]\n = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]\n input[i, j, ..., l, m, n] ; otherwise\n```\nwhere `d = n - m`, `diag_index = k[1] - d`, and\n`index_in_diag = n - max(d, 0) + offset`.\n\n`offset` is zero except when the alignment of the diagonal is to the right.\n```\noffset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}\n and `d >= 0`) or\n (`align` in {LEFT_RIGHT, RIGHT_RIGHT}\n and `d <= 0`)\n 0 ; otherwise\n```\nwhere `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`.\n\nFor example:\n\n```\n# The main diagonal.\ninput = np.array([[[7, 7, 7, 7], # Input shape: (2, 3, 4)\n [7, 7, 7, 7],\n [7, 7, 7, 7]],\n [[7, 7, 7, 7],\n [7, 7, 7, 7],\n [7, 7, 7, 7]]])\ndiagonal = np.array([[1, 2, 3], # Diagonal shape: (2, 3)\n [4, 5, 6]])\ntf.matrix_set_diag(input, diagonal)\n ==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)\n [7, 2, 7, 7],\n [7, 7, 3, 7]],\n [[4, 7, 7, 7],\n [7, 5, 7, 7],\n [7, 7, 6, 7]]]\n\n# A superdiagonal (per batch).\ntf.matrix_set_diag(input, diagonal, k = 1)\n ==> [[[7, 1, 7, 7], # Output shape: (2, 3, 4)\n [7, 7, 2, 7],\n [7, 7, 7, 3]],\n [[7, 4, 7, 7],\n [7, 7, 5, 7],\n [7, 7, 7, 6]]]\n\n# A band of diagonals.\ndiagonals = np.array([[[0, 9, 1], # Diagonal shape: (2, 4, 3)\n [6, 5, 8],\n [1, 2, 3],\n [4, 5, 0]],\n [[0, 1, 2],\n [5, 6, 4],\n [6, 1, 2],\n [3, 4, 0]]])\ntf.matrix_set_diag(input, diagonals, k = (-1, 2))\n ==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4)\n [4, 2, 5, 1],\n [7, 5, 3, 8]],\n [[6, 5, 1, 7],\n [3, 1, 6, 2],\n [7, 4, 2, 4]]]\n\n# LEFT_RIGHT alignment.\ndiagonals = np.array([[[9, 1, 0], # Diagonal shape: (2, 4, 3)\n [6, 5, 8],\n [1, 2, 3],\n [0, 4, 5]],\n [[1, 2, 0],\n [5, 6, 4],\n [6, 1, 2],\n [0, 3, 4]]])\ntf.matrix_set_diag(input, diagonals, k = (-1, 2), align=\"LEFT_RIGHT\")\n ==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4)\n [4, 2, 5, 1],\n [7, 5, 3, 8]],\n [[6, 5, 1, 7],\n [3, 1, 6, 2],\n [7, 4, 2, 4]]]\n\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "diagonal", "type": "TF_Tensor" }, { "name": "k", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "align", "type": "DefaultValuedOptionalAttr, \"RIGHT_LEFT\">" } ] }, { "name": "tf.MatrixSolve", "summary": "Solves systems of linear equations.", "description": "`Matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions\nform square matrices. `Rhs` is a tensor of shape `[..., M, K]`. The `output` is\na tensor shape `[..., M, K]`. If `adjoint` is `False` then each output matrix\nsatisfies `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`.\nIf `adjoint` is `True` then each output matrix satisfies\n`adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]`.", "operands": [ { "name": "matrix", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "rhs", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "adjoint", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MatrixTriangularSolve", "summary": "Solves systems of linear equations with upper or lower triangular matrices by backsubstitution.", "description": "`matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions form\nsquare matrices. If `lower` is `True` then the strictly upper triangular part\nof each inner-most matrix is assumed to be zero and not accessed.\nIf `lower` is False then the strictly lower triangular part of each inner-most\nmatrix is assumed to be zero and not accessed.\n`rhs` is a tensor of shape `[..., M, N]`.\n\nThe output is a tensor of shape `[..., M, N]`. If `adjoint` is\n`True` then the innermost matrices in `output` satisfy matrix equations\n`matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`.\nIf `adjoint` is `False` then the strictly then the innermost matrices in\n`output` satisfy matrix equations\n`adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]`.\n\nNote, the batch shapes for the inputs only need to broadcast.\n\nExample:\n```python\n\na = tf.constant([[3, 0, 0, 0],\n [2, 1, 0, 0],\n [1, 0, 1, 0],\n [1, 1, 1, 1]], dtype=tf.float32)\n\nb = tf.constant([[4],\n [2],\n [4],\n [2]], dtype=tf.float32)\n\nx = tf.linalg.triangular_solve(a, b, lower=True)\nx\n# \n\n# in python3 one can use `a@x`\ntf.matmul(a, x)\n# \n```", "operands": [ { "name": "matrix", "type": "TF_FpOrComplexTensor" }, { "name": "rhs", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "output", "type": "TF_FpOrComplexTensor" } ], "attributes": [ { "name": "lower", "type": "DefaultValuedOptionalAttr" }, { "name": "adjoint", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Max", "summary": "Computes the maximum of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Maximum", "summary": "Returns the max of x and y (i.e. x > y ? x : y) element-wise.", "description": "*NOTE*: `Maximum` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.MaxPool", "summary": "Performs max pooling on the input.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint8, TF_Uint16, TF_Uint8 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint8, TF_Uint16, TF_Uint8 ]>" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" } ] }, { "name": "tf.MaxPool3D", "summary": "Performs 3D max pooling on the input.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" } ] }, { "name": "tf.MaxPool3DGrad", "summary": "Computes gradients of 3D max pooling function.", "operands": [ { "name": "orig_input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "orig_output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" }, { "name": "grad", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32]>" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" } ] }, { "name": "tf.MaxPool3DGradGrad", "summary": "Computes second-order gradients of the maxpooling function.", "operands": [ { "name": "orig_input", "type": "TF_IntOrFpTensor" }, { "name": "orig_output", "type": "TF_IntOrFpTensor" }, { "name": "grad", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<5>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NDHWC\">" } ] }, { "name": "tf.MaxPoolGrad", "summary": "Computes gradients of the maxpooling function.", "operands": [ { "name": "orig_input", "type": "TF_IntOrFpTensor" }, { "name": "orig_output", "type": "TF_IntOrFpTensor" }, { "name": "grad", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID, EXPLICIT]>" }, { "name": "explicit_paddings", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MaxPoolGradGrad", "summary": "Computes second-order gradients of the maxpooling function.", "operands": [ { "name": "orig_input", "type": "TF_IntOrFpTensor" }, { "name": "orig_output", "type": "TF_IntOrFpTensor" }, { "name": "grad", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ], "attributes": [ { "name": "ksize", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "strides", "type": "ConfinedAttr, [ArrayMinCount<4>]>" }, { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MaxPoolGradGradV2", "summary": "Computes second-order gradients of the maxpooling function.", "operands": [ { "name": "orig_input", "type": "TF_IntOrFpTensor" }, { "name": "orig_output", "type": "TF_IntOrFpTensor" }, { "name": "grad", "type": "TF_IntOrFpTensor" }, { "name": "ksize", "type": "TF_Int32Tensor" }, { "name": "strides", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ], "attributes": [ { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MaxPoolGradV2", "summary": "Computes gradients of the maxpooling function.", "operands": [ { "name": "orig_input", "type": "TF_IntOrFpTensor" }, { "name": "orig_output", "type": "TF_IntOrFpTensor" }, { "name": "grad", "type": "TF_IntOrFpTensor" }, { "name": "ksize", "type": "TF_Int32Tensor" }, { "name": "strides", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ], "attributes": [ { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MaxPoolV2", "summary": "Performs max pooling on the input.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint8, TF_Uint16, TF_Uint8 ]>" }, { "name": "ksize", "type": "TF_Int32Tensor" }, { "name": "strides", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint8, TF_Uint16, TF_Uint8 ]>" } ], "attributes": [ { "name": "padding", "type": "TF_AnyStrAttrOf<[SAME, VALID]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" } ] }, { "name": "tf.Mean", "summary": "Computes the mean of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TF_NumberTensor" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MergeSummary", "summary": "Merges summaries.", "description": "This op creates a\n[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)\nprotocol buffer that contains the union of all the values in the input\nsummaries.\n\nWhen the Op is run, it reports an `InvalidArgument` error if multiple values\nin the summaries to merge use the same tag.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "summary", "type": "TF_StrTensor" } ] }, { "name": "tf.MergeV2Checkpoints", "summary": "V2 format specific: merges the metadata files of sharded checkpoints. The", "description": "result is one logical checkpoint, with one physical metadata file and renamed\ndata files.\n\nIntended for \"grouping\" multiple checkpoints in a sharded checkpoint setup.\n\nIf delete_old_dirs is true, attempts to delete recursively the dirname of each\npath in the input checkpoint_prefixes. This is useful when those paths are non\nuser-facing temporary locations.\n\nIf allow_missing_files is true, merges the checkpoint prefixes as long as\nat least one file exists. Otherwise, if no files exist, an error will be thrown.\nThe default value for allow_missing_files is false.", "operands": [ { "name": "checkpoint_prefixes", "type": "TF_StrTensor" }, { "name": "destination_prefix", "type": "TF_StrTensor" } ], "attributes": [ { "name": "delete_old_dirs", "type": "DefaultValuedOptionalAttr" }, { "name": "allow_missing_files", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Min", "summary": "Computes the minimum of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Minimum", "summary": "Returns the min of x and y (i.e. x < y ? x : y) element-wise.", "description": "*NOTE*: `Minimum` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_IntOrFpTensor" }, { "name": "y", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "z", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.MirrorPad", "summary": "Pads a tensor with mirrored values.", "description": "This operation pads a `input` with mirrored values according to the `paddings`\nyou specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is\nthe rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates\nhow many values to add before the contents of `input` in that dimension, and\n`paddings[D, 1]` indicates how many values to add after the contents of `input`\nin that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater\nthan `input.dim_size(D)` (or `input.dim_size(D) - 1`) if `copy_border` is true\n(if false, respectively).\n\nThe padded size of each dimension D of the output is:\n\n`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`\n\nFor example:\n\n```\n# 't' is [[1, 2, 3], [4, 5, 6]].\n# 'paddings' is [[1, 1]], [2, 2]].\n# 'mode' is SYMMETRIC.\n# rank of 't' is 2.\npad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]\n [2, 1, 1, 2, 3, 3, 2]\n [5, 4, 4, 5, 6, 6, 5]\n [5, 4, 4, 5, 6, 6, 5]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "paddings", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "mode", "type": "TF_AnyStrAttrOf<[REFLECT, SYMMETRIC]>" } ] }, { "name": "tf.MirrorPadGrad", "summary": "Gradient op for `MirrorPad` op. This op folds a mirror-padded tensor.", "description": "This operation folds the padded areas of `input` by `MirrorPad` according to the\n`paddings` you specify. `paddings` must be the same as `paddings` argument\ngiven to the corresponding `MirrorPad` op.\n\nThe folded size of each dimension D of the output is:\n\n`input.dim_size(D) - paddings(D, 0) - paddings(D, 1)`\n\nFor example:\n\n```\n# 't' is [[1, 2, 3], [4, 5, 6], [7, 8, 9]].\n# 'paddings' is [[0, 1]], [0, 1]].\n# 'mode' is SYMMETRIC.\n# rank of 't' is 2.\npad(t, paddings) ==> [[ 1, 5]\n [11, 28]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "paddings", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "mode", "type": "TF_AnyStrAttrOf<[REFLECT, SYMMETRIC]>" } ] }, { "name": "tf.MlirLocalVarOp", "summary": "Creates a handle to an in-scope variable.", "description": "Used by internal passes for temporary representation of local state, which will\nbe eventually removed.", "results": [ { "name": "resource", "type": "TF_ResourceTensor" } ] }, { "name": "tf.MlirPassthroughOp", "summary": "Wraps an arbitrary MLIR computation expressed as a module with a main() function.", "description": "This operation does not have an associated kernel and is not intended to be\nexecuted in a regular TensorFlow session. Instead it is intended to be used for\ntesting or for special case where a user intends to pass custom MLIR computation\nthrough a TensorFlow graph with the intent of having custom tooling processing\nit downstream (when targeting a different environment, like TensorFlow lite for\nexample).\nThe MLIR module is expected to have a main() function that will be used as an\nentry point. The inputs to the operations will be passed as argument to the\nmain() function and the returned values of the main function mapped to the\noutputs.\nExample usage:\n\n```\nimport tensorflow as tf\nfrom tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op\n\nmlir_module = '''python\nfunc @main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {\n %add = \"magic.op\"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>\n return %ret : tensor<10x10xf32>\n}\n'''\n\n@tf.function\ndef foo(x, y):\n return mlir_passthrough_op([x, y], mlir_module, Toutputs=[tf.float32])\n\ngraph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def()\n```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "mlir_module", "type": "StrAttr" } ] }, { "name": "tf.Mod", "summary": "Returns element-wise remainder of division. This emulates C semantics in that", "description": "the result here is consistent with a truncating divide. E.g.\n`tf.truncatediv(x, y) * y + truncate_mod(x, y) = x`.\n\n*NOTE*: `Mod` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_FpOrI32OrI64Tensor" }, { "name": "y", "type": "TF_FpOrI32OrI64Tensor" } ], "results": [ { "name": "z", "type": "TF_FpOrI32OrI64Tensor" } ] }, { "name": "tf.ModelDataset", "summary": "Identity transformation that models performance.", "description": "Identity transformation that models performance.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "algorithm", "type": "DefaultValuedOptionalAttr" }, { "name": "cpu_budget", "type": "DefaultValuedOptionalAttr" }, { "name": "ram_budget", "type": "DefaultValuedOptionalAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.Mul", "summary": "Returns x * y element-wise.", "description": "*NOTE*: `Multiply` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.MulNoNan", "summary": "Returns x * y element-wise. Returns zero if y is zero, even if x if infinite or NaN.", "description": "*NOTE*: `MulNoNan` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" }, { "name": "y", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.MultiDeviceIterator", "summary": "Creates a MultiDeviceIterator resource.", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "devices", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "shared_name", "type": "StrAttr" }, { "name": "container", "type": "StrAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" } ] }, { "name": "tf.MultiDeviceIteratorFromStringHandle", "summary": "Generates a MultiDeviceIterator resource from its provided string handle.", "operands": [ { "name": "string_handle", "type": "TF_StrTensor" } ], "results": [ { "name": "multi_device_iterator", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "output_types", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "output_shapes", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.MultiDeviceIteratorGetNextFromShard", "summary": "Gets next element for the provided shard number.", "operands": [ { "name": "multi_device_iterator", "type": "TF_ResourceTensor" }, { "name": "shard_num", "type": "TF_Int32Tensor" }, { "name": "incarnation_id", "type": "TF_Int64Tensor" } ], "results": [ { "name": "components", "type": "Variadic" } ] }, { "name": "tf.MultiDeviceIteratorInit", "summary": "Initializes the multi device iterator with the given dataset.", "operands": [ { "name": "dataset", "type": "TF_VariantTensor" }, { "name": "multi_device_iterator", "type": "TF_ResourceTensor" }, { "name": "max_buffer_size", "type": "TF_Int64Tensor" } ], "results": [ { "name": "incarnation_id", "type": "TF_Int64Tensor" } ] }, { "name": "tf.MultiDeviceIteratorToStringHandle", "summary": "Produces a string handle for the given MultiDeviceIterator.", "operands": [ { "name": "multi_device_iterator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "string_handle", "type": "TF_StrTensor" } ] }, { "name": "tf.Multinomial", "summary": "Draws samples from a multinomial distribution.", "operands": [ { "name": "logits", "type": "TF_IntOrFpTensor" }, { "name": "num_samples", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MutableDenseHashTableV2", "summary": "Creates an empty hash table that uses tensors as the backing store.", "description": "It uses \"open addressing\" with quadratic reprobing to resolve\ncollisions.\n\nThis op creates a mutable hash table, specifying the type of its keys and\nvalues. Each value must be a scalar. Data can be inserted into the table using\nthe insert operations. It does not support the initialization operation.", "operands": [ { "name": "empty_key", "type": "TF_Tensor" }, { "name": "deleted_key", "type": "TF_Tensor" } ], "results": [ { "name": "table_handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" }, { "name": "use_node_name_sharing", "type": "DefaultValuedOptionalAttr" }, { "name": "value_dtype", "type": "TypeAttr" }, { "name": "value_shape", "type": "DefaultValuedOptionalAttr({})>" }, { "name": "initial_num_buckets", "type": "DefaultValuedOptionalAttr" }, { "name": "max_load_factor", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.MutableHashTableOfTensorsV2", "summary": "Creates an empty hash table.", "description": "This op creates a mutable hash table, specifying the type of its keys and\nvalues. Each value must be a vector. Data can be inserted into the table using\nthe insert operations. It does not support the initialization operation.", "results": [ { "name": "table_handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" }, { "name": "use_node_name_sharing", "type": "DefaultValuedOptionalAttr" }, { "name": "key_dtype", "type": "TypeAttr" }, { "name": "value_dtype", "type": "TypeAttr" }, { "name": "value_shape", "type": "DefaultValuedOptionalAttr({})>" } ] }, { "name": "tf.MutableHashTableV2", "summary": "Creates an empty hash table.", "description": "This op creates a mutable hash table, specifying the type of its keys and\nvalues. Each value must be a scalar. Data can be inserted into the table using\nthe insert operations. It does not support the initialization operation.", "results": [ { "name": "table_handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" }, { "name": "use_node_name_sharing", "type": "DefaultValuedOptionalAttr" }, { "name": "key_dtype", "type": "TypeAttr" }, { "name": "value_dtype", "type": "TypeAttr" } ] }, { "name": "tf.NcclAllReduce", "summary": "Outputs a tensor containing the reduction across all input tensors.", "description": "Outputs a tensor containing the reduction across all input tensors passed to ops\nwithin the same `shared_name.\n\nThe graph should be constructed so if one op runs with shared_name value `c`,\nthen `num_devices` ops will run with shared_name value `c`. Failure to do so\nwill cause the graph execution to fail to complete.\n\ninput: the input to the reduction\ndata: the value of the reduction across all `num_devices` devices.\nreduction: the reduction operation to perform.\nnum_devices: The number of devices participating in this reduction.\nshared_name: Identifier that shared between ops of the same reduction.", "operands": [ { "name": "input", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "results": [ { "name": "data", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "attributes": [ { "name": "reduction", "type": "TF_AnyStrAttrOf<[min, max, prod, sum]>" }, { "name": "num_devices", "type": "I64Attr" }, { "name": "shared_name", "type": "StrAttr" } ] }, { "name": "tf.Ndtri", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.Neg", "summary": "Computes numerical negative value element-wise.", "description": "I.e., \\\\(y = -x\\\\).", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.NextAfter", "summary": "Returns the next representable value of `x1` in the direction of `x2`, element-wise.", "description": "This operation returns the same result as the C++ std::nextafter function.\n\nIt can also return a subnormal number.\n\n@compatibility(cpp)\nEquivalent to C++ std::nextafter function.\n@end_compatibility", "operands": [ { "name": "x1", "type": "TF_F32OrF64Tensor" }, { "name": "x2", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.NonMaxSuppressionV3", "summary": "Greedily selects a subset of bounding boxes in descending order of score,", "description": "pruning away boxes that have high intersection-over-union (IOU) overlap\nwith previously selected boxes. Bounding boxes with score less than\n`score_threshold` are removed. Bounding boxes are supplied as\n[y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any\ndiagonal pair of box corners and the coordinates can be provided as normalized\n(i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm\nis agnostic to where the origin is in the coordinate system and more\ngenerally is invariant to orthogonal transformations and translations\nof the coordinate system; thus translating or reflections of the coordinate\nsystem result in the same boxes being selected by the algorithm.\nThe output of this operation is a set of integers indexing into the input\ncollection of bounding boxes representing the selected boxes. The bounding\nbox coordinates corresponding to the selected indices can then be obtained\nusing the `tf.gather operation`. For example:\n selected_indices = tf.image.non_max_suppression_v2(\n boxes, scores, max_output_size, iou_threshold, score_threshold)\n selected_boxes = tf.gather(boxes, selected_indices)", "operands": [ { "name": "boxes", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "scores", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "max_output_size", "type": "TF_Int32Tensor" }, { "name": "iou_threshold", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "score_threshold", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "selected_indices", "type": "TF_Int32Tensor" } ] }, { "name": "tf.NonMaxSuppressionV4", "summary": "Greedily selects a subset of bounding boxes in descending order of score,", "description": "pruning away boxes that have high intersection-over-union (IOU) overlap\nwith previously selected boxes. Bounding boxes with score less than\n`score_threshold` are removed. Bounding boxes are supplied as\n[y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any\ndiagonal pair of box corners and the coordinates can be provided as normalized\n(i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm\nis agnostic to where the origin is in the coordinate system and more\ngenerally is invariant to orthogonal transformations and translations\nof the coordinate system; thus translating or reflections of the coordinate\nsystem result in the same boxes being selected by the algorithm.\nThe output of this operation is a set of integers indexing into the input\ncollection of bounding boxes representing the selected boxes. The bounding\nbox coordinates corresponding to the selected indices can then be obtained\nusing the `tf.gather operation`. For example:\n selected_indices = tf.image.non_max_suppression_v2(\n boxes, scores, max_output_size, iou_threshold, score_threshold)\n selected_boxes = tf.gather(boxes, selected_indices)", "operands": [ { "name": "boxes", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "scores", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "max_output_size", "type": "TF_Int32Tensor" }, { "name": "iou_threshold", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "score_threshold", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "selected_indices", "type": "TF_Int32Tensor" }, { "name": "valid_outputs", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "pad_to_max_output_size", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.NonMaxSuppressionV5", "summary": "Greedily selects a subset of bounding boxes in descending order of score,", "description": "pruning away boxes that have high intersection-over-union (IOU) overlap\nwith previously selected boxes. Bounding boxes with score less than\n`score_threshold` are removed. Bounding boxes are supplied as\n[y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any\ndiagonal pair of box corners and the coordinates can be provided as normalized\n(i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm\nis agnostic to where the origin is in the coordinate system and more\ngenerally is invariant to orthogonal transformations and translations\nof the coordinate system; thus translating or reflections of the coordinate\nsystem result in the same boxes being selected by the algorithm.\nThe output of this operation is a set of integers indexing into the input\ncollection of bounding boxes representing the selected boxes. The bounding\nbox coordinates corresponding to the selected indices can then be obtained\nusing the `tf.gather operation`. For example:\n selected_indices = tf.image.non_max_suppression_v2(\n boxes, scores, max_output_size, iou_threshold, score_threshold)\n selected_boxes = tf.gather(boxes, selected_indices)\nThis op also supports a Soft-NMS (with Gaussian weighting) mode (c.f.\nBodla et al, https://arxiv.org/abs/1704.04503) where boxes reduce the score\nof other overlapping boxes instead of directly causing them to be pruned.\nTo enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be\nlarger than 0.", "operands": [ { "name": "boxes", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "scores", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "max_output_size", "type": "TF_Int32Tensor" }, { "name": "iou_threshold", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "score_threshold", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "soft_nms_sigma", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" } ], "results": [ { "name": "selected_indices", "type": "TF_Int32Tensor" }, { "name": "selected_scores", "type": "TensorOf<[ TF_Float16, TF_Float32 ]>" }, { "name": "valid_outputs", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "pad_to_max_output_size", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.NoOp", "summary": "Does nothing. Only useful as a placeholder for control edges." }, { "name": "tf.NotEqual", "summary": "Returns the truth value of (x != y) element-wise.", "description": "*NOTE*: `NotEqual` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "y", "type": "TF_Tensor" } ], "results": [ { "name": "z", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "incompatible_shape_error", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.OneHot", "summary": "Returns a one-hot tensor.", "description": "The locations represented by indices in `indices` take value `on_value`,\nwhile all other locations take value `off_value`.\n\nIf the input `indices` is rank `N`, the output will have rank `N+1`,\nThe new axis is created at dimension `axis` (default: the new axis is\nappended at the end).\n\nIf `indices` is a scalar the output shape will be a vector of length `depth`.\n\nIf `indices` is a vector of length `features`, the output shape will be:\n```\n features x depth if axis == -1\n depth x features if axis == 0\n```\n\nIf `indices` is a matrix (batch) with shape `[batch, features]`,\nthe output shape will be:\n```\n batch x features x depth if axis == -1\n batch x depth x features if axis == 1\n depth x batch x features if axis == 0\n```\n\n\nExamples\n=========\n\nSuppose that\n```\n indices = [0, 2, -1, 1]\n depth = 3\n on_value = 5.0\n off_value = 0.0\n axis = -1\n```\n\nThen output is `[4 x 3]`:\n```\noutput =\n [5.0 0.0 0.0] // one_hot(0)\n [0.0 0.0 5.0] // one_hot(2)\n [0.0 0.0 0.0] // one_hot(-1)\n [0.0 5.0 0.0] // one_hot(1)\n```\n\nSuppose that\n```\n indices = [0, 2, -1, 1]\n depth = 3\n on_value = 0.0\n off_value = 3.0\n axis = 0\n```\n\nThen output is `[3 x 4]`:\n```\noutput =\n [0.0 3.0 3.0 3.0]\n [3.0 3.0 3.0 0.0]\n [3.0 3.0 3.0 3.0]\n [3.0 0.0 3.0 3.0]\n// ^ one_hot(0)\n// ^ one_hot(2)\n// ^ one_hot(-1)\n// ^ one_hot(1)\n```\n\nSuppose that\n```\n indices = [[0, 2], [1, -1]]\n depth = 3\n on_value = 1.0\n off_value = 0.0\n axis = -1\n```\n\nThen output is `[2 x 2 x 3]`:\n```\noutput =\n [\n [1.0, 0.0, 0.0] // one_hot(0)\n [0.0, 0.0, 1.0] // one_hot(2)\n ][\n [0.0, 1.0, 0.0] // one_hot(1)\n [0.0, 0.0, 0.0] // one_hot(-1)\n ]\n```", "operands": [ { "name": "indices", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Int8, TF_Uint8 ]>" }, { "name": "depth", "type": "TF_Int32Tensor" }, { "name": "on_value", "type": "TF_Tensor" }, { "name": "off_value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.OneShotIterator", "summary": "Makes a \"one-shot\" iterator that can be iterated only once.", "description": "A one-shot iterator bundles the logic for defining the dataset and\nthe state of the iterator in a single op, which allows simple input\npipelines to be defined without an additional initialization\n(\"MakeIterator\") step.\n\nOne-shot iterators have the following limitations:\n\n* They do not support parameterization: all logic for creating the underlying\n dataset must be bundled in the `dataset_factory` function.\n* They are not resettable. Once a one-shot iterator reaches the end of its\n underlying dataset, subsequent \"IteratorGetNext\" operations on that\n iterator will always produce an `OutOfRange` error.\n\nFor greater flexibility, use \"Iterator\" and \"MakeIterator\" to define\nan iterator using an arbitrary subgraph, which may capture tensors\n(including fed values) as parameters, and which may be reset multiple\ntimes by rerunning \"MakeIterator\".", "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "dataset_factory", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.OnesLike", "summary": "Returns a tensor of ones with the same shape and type as x.", "operands": [ { "name": "x", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "y", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ] }, { "name": "tf.OptimizeDatasetV2", "summary": "Creates a dataset by applying related optimizations to `input_dataset`.", "description": "Creates a dataset by applying related optimizations to `input_dataset`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "optimizations_enabled", "type": "TF_StrTensor" }, { "name": "optimizations_disabled", "type": "TF_StrTensor" }, { "name": "optimizations_default", "type": "TF_StrTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "optimization_configs", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.OptionalFromValue", "summary": "Constructs an Optional variant from a tuple of tensors.", "operands": [ { "name": "components", "type": "Variadic" } ], "results": [ { "name": "optional", "type": "TF_VariantTensor" } ] }, { "name": "tf.OptionalGetValue", "summary": "Returns the value stored in an Optional variant or raises an error if none exists.", "operands": [ { "name": "optional", "type": "TF_VariantTensor" } ], "results": [ { "name": "components", "type": "Variadic" } ] }, { "name": "tf.OptionalHasValue", "summary": "Returns true if and only if the given Optional variant has a value.", "operands": [ { "name": "optional", "type": "TF_VariantTensor" } ], "results": [ { "name": "has_value", "type": "TF_BoolTensor" } ] }, { "name": "tf.OptionalNone", "summary": "Creates an Optional variant with no value.", "results": [ { "name": "optional", "type": "TF_VariantTensor" } ] }, { "name": "tf.OutfeedEnqueue", "summary": "Enqueue a Tensor on the computation outfeed.", "operands": [ { "name": "input", "type": "TF_Tensor" } ] }, { "name": "tf.OutfeedEnqueueTuple", "summary": "Enqueue multiple Tensor values on the computation outfeed.", "operands": [ { "name": "inputs", "type": "Variadic" } ] }, { "name": "tf.Pack", "summary": "Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor.", "description": "Packs the `N` tensors in `values` into a tensor with rank one higher than each\ntensor in `values`, by packing them along the `axis` dimension.\nGiven a list of tensors of shape `(A, B, C)`;\n\nif `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`.\nif `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`.\nEtc.\n\nFor example:\n\n```\n# 'x' is [1, 4]\n# 'y' is [2, 5]\n# 'z' is [3, 6]\npack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.\npack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]\n```\n\nThis is the opposite of `unpack`.", "operands": [ { "name": "values", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Pad", "category": "Transform", "summary": "Pads a tensor with zeros.", "description": "This operation pads a `input` with zeros according to the `paddings` you\nspecify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the\nrank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates\nhow many zeros to add before the contents of `input` in that dimension, and\n`paddings[D, 1]` indicates how many zeros to add after the contents of `input`\nin that dimension.\n\nThe padded size of each dimension D of the output is:\n\n`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`\n\nFor example:\n\n```\n# 't' is [[1, 1], [2, 2]]\n# 'paddings' is [[1, 1], [2, 2]]\n# rank of 't' is 2\npad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]\n [0, 0, 1, 1, 0, 0]\n [0, 0, 2, 2, 0, 0]\n [0, 0, 0, 0, 0, 0]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "paddings", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.PadV2", "summary": "Pads a tensor.", "description": "This operation pads `input` according to the `paddings` and `constant_values`\nyou specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is\nthe rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates\nhow many padding values to add before the contents of `input` in that dimension,\nand `paddings[D, 1]` indicates how many padding values to add after the contents\nof `input` in that dimension. `constant_values` is a scalar tensor of the same\ntype as `input` that indicates the value to use for padding `input`.\n\nThe padded size of each dimension D of the output is:\n\n`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`\n\nFor example:\n\n```\n# 't' is [[1, 1], [2, 2]]\n# 'paddings' is [[1, 1], [2, 2]]\n# 'constant_values' is 0\n# rank of 't' is 2\npad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]\n [0, 0, 1, 1, 0, 0]\n [0, 0, 2, 2, 0, 0]\n [0, 0, 0, 0, 0, 0]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "paddings", "type": "TF_I32OrI64Tensor" }, { "name": "constant_values", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.ParallelDynamicStitch", "summary": "Interleave the values from the `data` tensors into a single tensor.", "description": "Builds a merged tensor such that\n\n```python\n merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]\n```\n\nFor example, if each `indices[m]` is scalar or vector, we have\n\n```python\n # Scalar indices:\n merged[indices[m], ...] = data[m][...]\n\n # Vector indices:\n merged[indices[m][i], ...] = data[m][i, ...]\n```\n\nEach `data[i].shape` must start with the corresponding `indices[i].shape`,\nand the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we\nmust have `data[i].shape = indices[i].shape + constant`. In terms of this\n`constant`, the output shape is\n\n merged.shape = [max(indices)] + constant\n\nValues may be merged in parallel, so if an index appears in both `indices[m][i]`\nand `indices[n][j]`, the result may be invalid. This differs from the normal\nDynamicStitch operator that defines the behavior in that case.\n\nFor example:\n\n```python\n indices[0] = 6\n indices[1] = [4, 1]\n indices[2] = [[5, 2], [0, 3]]\n data[0] = [61, 62]\n data[1] = [[41, 42], [11, 12]]\n data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]\n merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],\n [51, 52], [61, 62]]\n```\n\nThis method can be used to merge partitions created by `dynamic_partition`\nas illustrated on the following example:\n\n```python\n # Apply function (increments x_i) on elements for which a certain condition\n # apply (x_i != -1 in this example).\n x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])\n condition_mask=tf.not_equal(x,tf.constant(-1.))\n partitioned_data = tf.dynamic_partition(\n x, tf.cast(condition_mask, tf.int32) , 2)\n partitioned_data[1] = partitioned_data[1] + 1.0\n condition_indices = tf.dynamic_partition(\n tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)\n x = tf.dynamic_stitch(condition_indices, partitioned_data)\n # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain\n # unchanged.\n```\n\n
\n\n
", "operands": [ { "name": "indices", "type": "Variadic" }, { "name": "data", "type": "Variadic" } ], "results": [ { "name": "merged", "type": "TF_Tensor" } ] }, { "name": "tf.ParallelMapDataset", "summary": "Creates a dataset that applies `f` to the outputs of `input_dataset`.", "description": "Unlike a \"MapDataset\", which applies `f` sequentially, this dataset invokes up\nto `num_parallel_calls` copies of `f` in parallel.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "other_arguments", "type": "Variadic" }, { "name": "num_parallel_calls", "type": "TF_Int32Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "use_inter_op_parallelism", "type": "DefaultValuedOptionalAttr" }, { "name": "sloppy", "type": "DefaultValuedOptionalAttr" }, { "name": "preserve_cardinality", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ParallelMapDatasetV2", "summary": "Creates a dataset that applies `f` to the outputs of `input_dataset`.", "description": "Unlike a \"MapDataset\", which applies `f` sequentially, this dataset invokes up\nto `num_parallel_calls` copies of `f` in parallel.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "other_arguments", "type": "Variadic" }, { "name": "num_parallel_calls", "type": "TF_Int64Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "use_inter_op_parallelism", "type": "DefaultValuedOptionalAttr" }, { "name": "deterministic", "type": "DefaultValuedOptionalAttr" }, { "name": "preserve_cardinality", "type": "DefaultValuedOptionalAttr" }, { "name": "use_unbounded_threadpool", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ParameterizedTruncatedNormal", "summary": "Outputs random values from a normal distribution. The parameters may each be a", "description": "scalar which applies to the entire output, or a vector of length shape[0] which\nstores the parameters for each batch.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "means", "type": "TF_FloatTensor" }, { "name": "stdevs", "type": "TF_FloatTensor" }, { "name": "minvals", "type": "TF_FloatTensor" }, { "name": "maxvals", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ParseExample", "summary": "Transforms a vector of tf.Example protos (as strings) into typed tensors.", "operands": [ { "name": "serialized", "type": "TF_StrTensor" }, { "name": "names", "type": "TF_StrTensor" }, { "name": "sparse_keys", "type": "Variadic" }, { "name": "dense_keys", "type": "Variadic" }, { "name": "dense_defaults", "type": "Variadic>" } ], "results": [ { "name": "sparse_indices", "type": "Variadic" }, { "name": "sparse_values", "type": "Variadic>" }, { "name": "sparse_shapes", "type": "Variadic" }, { "name": "dense_values", "type": "Variadic>" } ], "attributes": [ { "name": "dense_shapes", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.ParseExampleV2", "summary": "Transforms a vector of tf.Example protos (as strings) into typed tensors.", "operands": [ { "name": "serialized", "type": "TF_StrTensor" }, { "name": "names", "type": "TF_StrTensor" }, { "name": "sparse_keys", "type": "TF_StrTensor" }, { "name": "dense_keys", "type": "TF_StrTensor" }, { "name": "ragged_keys", "type": "TF_StrTensor" }, { "name": "dense_defaults", "type": "Variadic>" } ], "results": [ { "name": "sparse_indices", "type": "Variadic" }, { "name": "sparse_values", "type": "Variadic>" }, { "name": "sparse_shapes", "type": "Variadic" }, { "name": "dense_values", "type": "Variadic>" }, { "name": "ragged_values", "type": "Variadic>" }, { "name": "ragged_row_splits", "type": "Variadic>" } ], "attributes": [ { "name": "num_sparse", "type": "ConfinedAttr]>" }, { "name": "dense_shapes", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.PartitionedCall", "summary": "returns `f(inputs)`, where `f`'s body is placed and partitioned.", "description": "Asynchronously executes a function, potentially across multiple devices but\nwithin a single process. The kernel places and partitions a given function's\nunderlying graph, and executes each of the partitioned subgraphs as a function.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "f", "type": "SymbolRefAttr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" }, { "name": "config_proto", "type": "DefaultValuedOptionalAttr" }, { "name": "executor_type", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Placeholder", "summary": "Placeholder op", "description": "Inserts a placeholder for a tensor that will be always fed.", "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.PlaceholderWithDefault", "summary": "Placeholder op", "description": "A placeholder op that passes through input when its output is not fed.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Polygamma", "summary": "Compute the polygamma function \\\\(\\psi^{(n)}(x)\\\\).", "description": "The polygamma function is defined as:\n\n\n\\\\(\\psi^{(a)}(x) = \\frac{d^a}{dx^a} \\psi(x)\\\\)\n\nwhere \\\\(\\psi(x)\\\\) is the digamma function.\nThe polygamma function is defined only for non-negative integer orders \\\\a\\\\.", "operands": [ { "name": "a", "type": "TF_F32OrF64Tensor" }, { "name": "x", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "z", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.PopulationCount", "summary": "Computes element-wise population count (a.k.a. popcount, bitsum, bitcount).", "description": "For each entry in `x`, calculates the number of `1` (on) bits in the binary\nrepresentation of that entry.\n\n**NOTE**: It is more efficient to first `tf.bitcast` your tensors into\n`int32` or `int64` and perform the bitcount on the result, than to feed in\n8- or 16-bit inputs and then aggregate the resulting counts.", "operands": [ { "name": "x", "type": "TF_IntTensor" } ], "results": [ { "name": "y", "type": "TF_Uint8Tensor" } ] }, { "name": "tf.PostProcessPrediction", "summary": "Performs post-processing on prediction inputs. This op has no tensor outputs.", "description": "Send an rpc to the external service that builds rpc payload based on prediction result.", "operands": [ { "name": "steps", "type": "TF_Int64Tensor" }, { "name": "gaia_id", "type": "TF_Int64Tensor" }, { "name": "video_id", "type": "TF_Uint64Tensor" }, { "name": "timestamp", "type": "TF_Int64Tensor" }, { "name": "predicted_probability", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "op_config", "type": "StrAttr" } ] }, { "name": "tf.Pow", "summary": "Computes the power of one value to another.", "description": "Given a tensor `x` and a tensor `y`, this operation computes \\\\(x^y\\\\) for\ncorresponding elements in `x` and `y`. For example:\n\n```\n# tensor 'x' is [[2, 2]], [3, 3]]\n# tensor 'y' is [[8, 16], [2, 3]]\ntf.pow(x, y) ==> [[256, 65536], [9, 27]]\n```", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.PrefetchDataset", "summary": "Creates a dataset that asynchronously prefetches elements from `input_dataset`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "buffer_size", "type": "TF_Int64Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "slack_period", "type": "DefaultValuedOptionalAttr" }, { "name": "legacy_autotune", "type": "DefaultValuedOptionalAttr" }, { "name": "buffer_size_min", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.PreventGradient", "summary": "An identity op that triggers an error if a gradient is requested.", "description": "When executed in a graph, this op outputs its input tensor as-is.\n\nWhen building ops to compute gradients, the TensorFlow gradient system\nwill return an error when trying to lookup the gradient of this op,\nbecause no gradient must ever be registered for this function. This\nop exists to prevent subtle bugs from silently returning unimplemented\ngradients in some corner cases.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "message", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Print", "summary": "Prints a list of tensors.", "description": "Passes `input` through to `output` and prints `data` when evaluating.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "data", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "message", "type": "DefaultValuedOptionalAttr" }, { "name": "first_n", "type": "DefaultValuedOptionalAttr" }, { "name": "summarize", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.PrintV2", "summary": "Prints a string scalar.", "description": "Prints a string scalar to the desired output_stream.", "operands": [ { "name": "input", "type": "TF_StrTensor" } ], "attributes": [ { "name": "output_stream", "type": "DefaultValuedOptionalAttr" }, { "name": "end", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Prod", "summary": "Computes the product of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TF_NumberTensor" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.PwStreamResults", "summary": "Streams results back to the controller", "description": "This op is a TensorFlow op that represents \"streamed outputs\", where\n intermediate results can be returned immediately without waiting for the\n entire signature computation to complete.\n\n This op takes `args` with their `names` (their cardinality must match) and\n sends the given argument tensors back to the serving controller. This\n triggers a controller-side stream callback (see `ScopedStreamCallback`).\n\n In addition to the listed attributes, this op has two \"hidden\" attributes\n that do not exist in SavedModel but are dynamically populated by the serving\n runtime:\n\n * `_controller_address`: Address of the remote instance to which tensors\n will be sent via e.g. RPC.\n * `_callback_id`: Identifier for the callback to be called from the\n controller. See `ScopedStreamCallback`.", "operands": [ { "name": "args", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.Qr", "summary": "Computes the QR decompositions of one or more matrices.", "description": "Computes the QR decomposition of each inner matrix in `tensor` such that\n`tensor[..., :, :] = q[..., :, :] * r[..., :,:])`\n\nCurrently, the gradient for the QR decomposition is well-defined only when\nthe first `P` columns of the inner matrix are linearly independent, where\n`P` is the minimum of `M` and `N`, the 2 inner-most dimmensions of `tensor`.\n\n```python\n# a is a tensor.\n# q is a tensor of orthonormal matrices.\n# r is a tensor of upper triangular matrices.\nq, r = qr(a)\nq_full, r_full = qr(a, full_matrices=True)\n```", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "q", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "r", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "full_matrices", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.QuantizeAndDequantize", "summary": "Use QuantizeAndDequantizeV2 instead.", "operands": [ { "name": "input", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "signed_input", "type": "DefaultValuedOptionalAttr" }, { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "range_given", "type": "DefaultValuedOptionalAttr" }, { "name": "input_min", "type": "DefaultValuedOptionalAttr" }, { "name": "input_max", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.QuantizeAndDequantizeV2", "summary": "Quantizes then dequantizes a tensor.", "description": "This op simulates the precision loss from the quantized forward pass by:\n\n1. Quantizing the tensor to fixed point numbers, which should match the target\n quantization method when it is used in inference.\n2. Dequantizing it back to floating point numbers for the following ops, most\n likely matmul.\n\nThere are different ways to quantize. This version uses only scaling, so 0.0\nmaps to 0.\n\nFrom the specified 'num_bits' in the quantized output type, it determines\nminimum and maximum representable quantized values.\n\ne.g.\n\n* [-128, 127] for signed, num_bits = 8, or\n* [0, 255] for unsigned, num_bits = 8.\n\nIf range_given == False, the initial input_min, input_max will be determined\nautomatically as the minimum and maximum values in the input tensor, otherwise\nthe specified values of input_min, input_max are used.\n\nNote: If the input_min, input_max are specified, they do not need to equal the\nactual minimum and maximum values in the tensor. e.g. in some cases it may be\nbeneficial to specify these values such that the low probability extremes of the\ninput distribution are clipped.\n\nThis op determines the maximum scale_factor that would map the initial\n[input_min, input_max] range to a range that lies within the representable\nquantized range.\n\nIt determines the scale from one of input_min and input_max, then updates the\nother one to maximize the representable range.\n\ne.g.\n\n* if the output is signed, num_bits = 8, [input_min, input_max] = [-10.0,\n 5.0]: it would use a scale_factor of -128 / -10.0 = 12.8 In this case, it\n would update input_max to be 127 / 12.8 = 9.921875\n* if the output is signed, num_bits = 8, [input_min, input_max] = [-10.0,\n 10.0]: it would use a scale_factor of 127 / 10.0 = 12.7 In this case, it\n would update input_min to be 128.0 / 12.7 = -10.07874\n* if the output is unsigned, input_min is forced to be 0, and only the\n specified input_max is used.\n\nAfter determining the scale_factor and updating the input range, it applies the\nfollowing to each value in the 'input' tensor.\n\noutput = round(clamp(value, input_min, input_max) * scale_factor) / scale_factor.\n\nThe above round function rounds the value based on the given round_mode.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "input_min", "type": "TF_FloatTensor" }, { "name": "input_max", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "signed_input", "type": "DefaultValuedOptionalAttr" }, { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "range_given", "type": "DefaultValuedOptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedOptionalAttr, \"HALF_TO_EVEN\">" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" }, { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.QuantizeAndDequantizeV3", "summary": "Quantizes then dequantizes a tensor.", "description": "This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a\ntensor, so its value can change during training.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "input_min", "type": "TF_FloatTensor" }, { "name": "input_max", "type": "TF_FloatTensor" }, { "name": "num_bits", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "signed_input", "type": "DefaultValuedOptionalAttr" }, { "name": "range_given", "type": "DefaultValuedOptionalAttr" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" }, { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.QuantizeAndDequantizeV4", "summary": "Quantizes then dequantizes a tensor.", "description": "This is almost identical to QuantizeAndDequantizeV2, except that it returns a\ngradient of 1 for inputs that are within the quantization range, or 0 otherwise.", "operands": [ { "name": "input", "type": "TF_FloatTensor" }, { "name": "input_min", "type": "TF_FloatTensor" }, { "name": "input_max", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "signed_input", "type": "DefaultValuedOptionalAttr" }, { "name": "num_bits", "type": "DefaultValuedOptionalAttr" }, { "name": "range_given", "type": "DefaultValuedOptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedOptionalAttr, \"HALF_TO_EVEN\">" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" }, { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.QuantizeV2", "summary": "Quantize the 'input' tensor of type float to 'output' tensor of type 'T'.", "description": "[min_range, max_range] are scalar floats that specify the range for\nthe 'input' data. The 'mode' attribute controls exactly which calculations are\nused to convert the float values to their quantized equivalents. The\n'round_mode' attribute controls which rounding tie-breaking algorithm is used\nwhen rounding float values to their quantized equivalents.\n\nIn 'MIN_COMBINED' mode, each value of the tensor will undergo the following:\n\n```\nout[i] = (in[i] - min_range) * range(T) / (max_range - min_range)\nif T == qint8: out[i] -= (range(T) + 1) / 2.0\n```\n\nhere `range(T) = numeric_limits::max() - numeric_limits::min()`\n\n*MIN_COMBINED Mode Example*\n\nAssume the input is type float and has a possible range of [0.0, 6.0] and the\noutput type is quint8 ([0, 255]). The min_range and max_range values should be\nspecified as 0.0 and 6.0. Quantizing from float to quint8 will multiply each\nvalue of the input by 255/6 and cast to quint8.\n\nIf the output type was qint8 ([-128, 127]), the operation will additionally\nsubtract each value by 128 prior to casting, so that the range of values aligns\nwith the range of qint8.\n\nIf the mode is 'MIN_FIRST', then this approach is used:\n\n```\nnum_discrete_values = 1 << (# of bits in T)\nrange_adjust = num_discrete_values / (num_discrete_values - 1)\nrange = (range_max - range_min) * range_adjust\nrange_scale = num_discrete_values / range\nquantized = round(input * range_scale) - round(range_min * range_scale) +\n numeric_limits::min()\nquantized = max(quantized, numeric_limits::min())\nquantized = min(quantized, numeric_limits::max())\n```\n\nThe biggest difference between this and MIN_COMBINED is that the minimum range\nis rounded first, before it's subtracted from the rounded value. With\nMIN_COMBINED, a small bias is introduced where repeated iterations of quantizing\nand dequantizing will introduce a larger and larger error.\n\n*SCALED mode Example*\n\n`SCALED` mode matches the quantization approach used in\n`QuantizeAndDequantize{V2|V3}`.\n\nIf the mode is `SCALED`, the quantization is performed by multiplying each\ninput value by a scaling_factor.\nThe scaling_factor is determined from `min_range` and `max_range` to be as large\nas possible such that the range from `min_range` to `max_range` is representable\nwithin values of type T.\n\n```c++\n\n const int min_T = std::numeric_limits::min();\n const int max_T = std::numeric_limits::max();\n const float max_float = std::numeric_limits::max();\n\n const float scale_factor_from_min_side =\n (min_T * min_range > 0) ? min_T / min_range : max_float;\n const float scale_factor_from_max_side =\n (max_T * max_range > 0) ? max_T / max_range : max_float;\n\n const float scale_factor = std::min(scale_factor_from_min_side,\n scale_factor_from_max_side);\n```\n\nWe next use the scale_factor to adjust min_range and max_range as follows:\n\n```c++\n min_range = min_T / scale_factor;\n max_range = max_T / scale_factor;\n```\n\n\ne.g. if T = qint8, and initially min_range = -10, and max_range = 9, we would\ncompare -128/-10.0 = 12.8 to 127/9.0 = 14.11, and set scaling_factor = 12.8\nIn this case, min_range would remain -10, but max_range would be adjusted to\n127 / 12.8 = 9.921875\n\nSo we will quantize input values in the range (-10, 9.921875) to (-128, 127).\n\nThe input tensor can now be quantized by clipping values to the range\n`min_range` to `max_range`, then multiplying by scale_factor as follows:\n\n```c++\nresult = round(min(max_range, max(min_range, input)) * scale_factor)\n```\n\nThe adjusted `min_range` and `max_range` are returned as outputs 2 and 3 of\nthis operation. These outputs should be used as the range for any further\ncalculations.\n\n\n*narrow_range (bool) attribute*\n\nIf true, we do not use the minimum quantized value.\ni.e. for int8 the quantized output, it would be restricted to the range\n-127..127 instead of the full -128..127 range.\nThis is provided for compatibility with certain inference backends.\n(Only applies to SCALED mode)\n\n\n*axis (int) attribute*\n\nAn optional `axis` attribute can specify a dimension index of the input tensor,\nsuch that quantization ranges will be calculated and applied separately for each\nslice of the tensor along that dimension. This is useful for per-channel\nquantization.\n\nIf axis is specified, min_range and max_range\n\nif `axis`=None, per-tensor quantization is performed as normal.\n\n\n*ensure_minimum_range (float) attribute*\n\nEnsures the minimum quantization range is at least this value.\nThe legacy default value for this is 0.01, but it is strongly suggested to\nset it to 0 for new uses.", "operands": [ { "name": "input", "type": "TF_Float32Tensor" }, { "name": "min_range", "type": "TF_Float32Tensor" }, { "name": "max_range", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8 ]>" }, { "name": "output_min", "type": "TF_Float32Tensor" }, { "name": "output_max", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "mode", "type": "DefaultValuedOptionalAttr, \"MIN_COMBINED\">" }, { "name": "round_mode", "type": "DefaultValuedOptionalAttr, \"HALF_AWAY_FROM_ZERO\">" }, { "name": "narrow_range", "type": "DefaultValuedOptionalAttr" }, { "name": "axis", "type": "DefaultValuedOptionalAttr" }, { "name": "ensure_minimum_range", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.QueueDequeueV2", "summary": "Dequeues a tuple of one or more tensors from the given queue.", "description": "This operation has k outputs, where k is the number of components\nin the tuples stored in the given queue, and output i is the ith\ncomponent of the dequeued tuple.\n\nN.B. If the queue is empty, this operation will block until an element\nhas been dequeued (or 'timeout_ms' elapses, if specified).", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "results": [ { "name": "components", "type": "Variadic" } ], "attributes": [ { "name": "timeout_ms", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RaggedGather", "summary": "Gather ragged slices from `params` axis `0` according to `indices`.", "description": "Outputs a `RaggedTensor` output composed from `output_dense_values` and\n`output_nested_splits`, such that:\n\n```python\noutput.shape = indices.shape + params.shape[1:]\noutput.ragged_rank = indices.shape.ndims + params.ragged_rank\noutput[i...j, d0...dn] = params[indices[i...j], d0...dn]\n```\n\nwhere\n\n* `params =\n ragged.from_nested_row_splits(params_dense_values, params_nested_splits)`\n provides the values that should be gathered.\n* `indices` ia a dense tensor with dtype `int32` or `int64`, indicating which\n values should be gathered.\n* `output =\n ragged.from_nested_row_splits(output_dense_values, output_nested_splits)`\n is the output tensor.\n\n(Note: This c++ op is used to implement the higher-level python\n`tf.ragged.gather` op, which also supports ragged indices.)", "operands": [ { "name": "params_nested_splits", "type": "Variadic" }, { "name": "params_dense_values", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output_nested_splits", "type": "Variadic" }, { "name": "output_dense_values", "type": "TF_Tensor" } ] }, { "name": "tf.RaggedRange", "summary": "Returns a `RaggedTensor` containing the specified sequences of numbers.", "description": "Returns a `RaggedTensor` `result` composed from `rt_dense_values` and\n`rt_nested_splits`, such that\n`result[i] = range(starts[i], limits[i], deltas[i])`.\n\n```python\n(rt_nested_splits, rt_dense_values) = ragged_range(\n starts=[2, 5, 8], limits=[3, 5, 12], deltas=1)\nresult = tf.ragged.from_row_splits(rt_dense_values, rt_nested_splits)\nprint(result)\n\n```\n\nThe input tensors `starts`, `limits`, and `deltas` may be scalars or vectors.\nThe vector inputs must all have the same size. Scalar inputs are broadcast\nto match the size of the vector inputs.", "operands": [ { "name": "starts", "type": "TensorOf<[ TF_Bfloat16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" }, { "name": "limits", "type": "TensorOf<[ TF_Bfloat16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" }, { "name": "deltas", "type": "TensorOf<[ TF_Bfloat16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "rt_nested_splits", "type": "TF_I32OrI64Tensor" }, { "name": "rt_dense_values", "type": "TensorOf<[ TF_Bfloat16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ] }, { "name": "tf.RandomGamma", "summary": "Outputs random values from the Gamma distribution(s) described by alpha.", "description": "This op uses the algorithm by Marsaglia et al. to acquire samples via\ntransformation-rejection from pairs of uniform and normal random variables.\nSee http://dl.acm.org/citation.cfm?id=358414", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "alpha", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RandomGammaGrad", "summary": "Computes the derivative of a Gamma random sample w.r.t. `alpha`.", "operands": [ { "name": "alpha", "type": "TF_F32OrF64Tensor" }, { "name": "sample", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.RandomPoisson", "summary": "Use RandomPoissonV2 instead.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "rate", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Float64]>" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RandomPoissonV2", "summary": "Outputs random values from the Poisson distribution(s) described by rate.", "description": "This op uses two algorithms, depending on rate. If rate >= 10, then\nthe algorithm by Hormann is used to acquire samples via\ntransformation-rejection.\nSee http://www.sciencedirect.com/science/article/pii/0167668793909974.\n\nOtherwise, Knuth's algorithm is used to acquire samples via multiplying uniform\nrandom variables.\nSee Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer\nProgramming, Volume 2. Addison Wesley", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "rate", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RandomShuffle", "summary": "Randomly shuffles a tensor along its first dimension.", "description": "The tensor is shuffled along dimension 0, such that each `value[j]` is mapped\n to one and only one `output[i]`. For example, a mapping that might occur for a\n 3x2 tensor is:\n\n```\n[[1, 2], [[5, 6],\n [3, 4], ==> [1, 2],\n [5, 6]] [3, 4]]\n```", "operands": [ { "name": "value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RandomStandardNormal", "summary": "Outputs random values from a normal distribution.", "description": "The generated values will have mean 0 and standard deviation 1.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RandomUniform", "summary": "Outputs random values from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[0, 1)`. The\nlower bound 0 is included in the range, while the upper bound 1 is excluded.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RandomUniformInt", "summary": "Outputs random integers from a uniform distribution.", "description": "The generated values are uniform integers in the range `[minval, maxval)`.\nThe lower bound `minval` is included in the range, while the upper bound\n`maxval` is excluded.\n\nThe random integers are slightly biased unless `maxval - minval` is an exact\npower of two. The bias is small for values of `maxval - minval` significantly\nsmaller than the range of the output (either `2^32` or `2^64`).", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "minval", "type": "TF_I32OrI64Tensor" }, { "name": "maxval", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Range", "summary": "Creates a sequence of numbers.", "description": "This operation creates a sequence of numbers that begins at `start` and\nextends by increments of `delta` up to but not including `limit`.\n\nFor example:\n\n```\n# 'start' is 3\n# 'limit' is 18\n# 'delta' is 3\ntf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]\n```", "operands": [ { "name": "start", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64 ]>" }, { "name": "limit", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64 ]>" }, { "name": "delta", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64 ]>" } ] }, { "name": "tf.RangeDataset", "summary": "Creates a dataset with a range of values. Corresponds to python's xrange.", "operands": [ { "name": "start", "type": "TF_Int64Tensor" }, { "name": "stop", "type": "TF_Int64Tensor" }, { "name": "step", "type": "TF_Int64Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" }, { "name": "replicate_on_split", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Rank", "summary": "Returns the rank of a tensor.", "description": "This operation returns an integer representing the rank of `input`.\n\nFor example:\n\n```\n# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]\n# shape of tensor 't' is [2, 2, 3]\nrank(t) ==> 3\n```\n\n**Note**: The rank of a tensor is not the same as the rank of a matrix. The rank\nof a tensor is the number of indices required to uniquely select each element\nof the tensor. Rank is also known as \"order\", \"degree\", or \"ndims.\"", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Int32Tensor" } ] }, { "name": "tf.ReadFile", "summary": "Reads and outputs the entire contents of the input filename.", "operands": [ { "name": "filename", "type": "TF_StrTensor" } ], "results": [ { "name": "contents", "type": "TF_StrTensor" } ] }, { "name": "tf.ReadVariableOp", "summary": "Reads the value of a variable.", "description": "The tensor returned by this operation is immutable.\n\nThe value returned by this operation is guaranteed to be influenced by all the\nwrites on which this operation depends directly or indirectly, and to not be\ninfluenced by any of the writes which depend directly or indirectly on this\noperation.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" } ], "results": [ { "name": "value", "type": "TF_Tensor" } ] }, { "name": "tf.Real", "summary": "Returns the real part of a complex number.", "description": "Given a tensor `input` of complex numbers, this operation returns a tensor of\ntype `float` that is the real part of each element in `input`. All elements in\n`input` must be complex numbers of the form \\\\(a + bj\\\\), where *a* is the real\n part returned by this operation and *b* is the imaginary part.\n\nFor example:\n\n```\n# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.real(input) ==> [-2.25, 3.25]\n```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Complex128, TF_Complex64]>" } ], "results": [ { "name": "output", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tf.RealDiv", "summary": "Returns x / y element-wise for real types.", "description": "If `x` and `y` are reals, this will return the floating-point division.\n\n*NOTE*: `Div` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.Reciprocal", "summary": "Computes the reciprocal of x element-wise.", "description": "I.e., \\\\(y = 1 / x\\\\).", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.ReciprocalGrad", "summary": "Computes the gradient for the inverse of `x` wrt its input.", "description": "Specifically, `grad = -dy * y*y`, where `y = 1/x`, and `dy`\nis the corresponding input gradient.", "operands": [ { "name": "y", "type": "TF_FpOrComplexTensor" }, { "name": "dy", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.RecordEventMetricForTensor", "summary": "Records an event to a streamz RecordEventMetric (i.e. distribution) for all the", "description": "values of the input tensors. The streamz can be found at\n/video/youtube/discovery/tensorflow/ops/streamz/events.", "operands": [ { "name": "value", "type": "TF_Tensor" } ], "attributes": [ { "name": "label", "type": "StrAttr" } ] }, { "name": "tf.Recv", "summary": "Receives the named tensor from send_device on recv_device.", "results": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "send_device", "type": "StrAttr" }, { "name": "send_device_incarnation", "type": "I64Attr" }, { "name": "recv_device", "type": "StrAttr" }, { "name": "client_terminated", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RecvTPUEmbeddingActivations", "summary": "An op that receives embedding activations on the TPU.", "description": "The TPU system performs the embedding lookups and aggregations specified by\nthe arguments to TPUEmbeddingEnqueue(Integer/Sparse/SparseTensor)Batch. The\nresults of these aggregations are visible to the Tensorflow Graph as the\noutputs of a RecvTPUEmbeddingActivations op. This op returns a list containing\none Tensor of activations per table specified in the model. There can be at\nmost one RecvTPUEmbeddingActivations op in the TPU graph.", "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ] }, { "name": "tf.ReduceDataset", "summary": "Reduces the input dataset to a singleton using a reduce function.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "initial_state", "type": "Variadic" }, { "name": "other_arguments", "type": "Variadic" } ], "results": [ { "name": "components", "type": "Variadic" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" }, { "name": "Tstate", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "Targuments", "type": "ConfinedAttr, [ArrayMinCount<0>]>" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "use_inter_op_parallelism", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ReduceJoin", "summary": "Joins a string Tensor across the given dimensions.", "description": "Computes the string join across dimensions in the given string Tensor of shape\n`[\\\\(d_0, d_1, ..., d_{n-1}\\\\)]`. Returns a new Tensor created by joining the input\nstrings with the given separator (default: empty string). Negative indices are\ncounted backwards from the end, with `-1` being equivalent to `n - 1`. If\nindices are not specified, joins across all dimensions beginning from `n - 1`\nthrough `0`.\n\nFor example:\n\n```python\n# tensor `a` is [[\"a\", \"b\"], [\"c\", \"d\"]]\ntf.reduce_join(a, 0) ==> [\"ac\", \"bd\"]\ntf.reduce_join(a, 1) ==> [\"ab\", \"cd\"]\ntf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> [\"ac\", \"bd\"]\ntf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> [\"ab\", \"cd\"]\ntf.reduce_join(a, 0, keep_dims=True) ==> [[\"ac\", \"bd\"]]\ntf.reduce_join(a, 1, keep_dims=True) ==> [[\"ab\"], [\"cd\"]]\ntf.reduce_join(a, 0, separator=\".\") ==> [\"a.c\", \"b.d\"]\ntf.reduce_join(a, [0, 1]) ==> \"acbd\"\ntf.reduce_join(a, [1, 0]) ==> \"abcd\"\ntf.reduce_join(a, []) ==> [[\"a\", \"b\"], [\"c\", \"d\"]]\ntf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> \"abcd\"\n```", "operands": [ { "name": "inputs", "type": "TF_StrTensor" }, { "name": "reduction_indices", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_StrTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" }, { "name": "separator", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Relu", "category": "Activation", "summary": "Computes rectified linear: `max(features, 0)`.", "description": "See: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)\nExample usage:\n>>> tf.nn.relu([-2., 0., 3.]).numpy()\narray([0., 0., 3.], dtype=float32)", "operands": [ { "name": "features", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "activations", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.Relu6", "summary": "Computes rectified linear 6: `min(max(features, 0), 6)`.", "operands": [ { "name": "features", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "activations", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.Relu6Grad", "summary": "Computes rectified linear 6 gradients for a Relu6 operation.", "operands": [ { "name": "gradients", "type": "TF_IntOrFpTensor" }, { "name": "features", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "backprops", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.ReluGrad", "summary": "Computes rectified linear gradients for a Relu operation.", "operands": [ { "name": "gradients", "type": "TF_IntOrFpTensor" }, { "name": "features", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "backprops", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.RemoteCall", "summary": "Runs function `f` on a remote device indicated by `target`.", "operands": [ { "name": "target", "type": "TF_StrTensor" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" } ] }, { "name": "tf.RepeatDataset", "summary": "Creates a dataset that emits the outputs of `input_dataset` `count` times.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "count", "type": "TF_Int64Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Reshape", "category": "Shape", "summary": "Reshapes a tensor.", "description": "Given `tensor`, this operation returns a tensor that has the same values\nas `tensor` with shape `shape`.\n\nIf one component of 1-D tensor `shape` is the special value -1, the size of that\ndimension is computed so that the total size remains constant. In particular, a\n`shape` of `[-1]` flattens into 1-D. At most one component of `shape` may be\nunknown.\n\nThe `shape` must be 1-D and the operation returns a tensor with shape\n`shape` filled with the values of `tensor`. In this case, the number of elements\nimplied by `shape` must be the same as the number of elements in `tensor`.\n\nIt is an error if `shape` is not 1-D.\n\nFor example:\n\n```\n# tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]\n# tensor 't' has shape [9]\nreshape(t, [3, 3]) ==> [[1, 2, 3],\n [4, 5, 6],\n [7, 8, 9]]\n\n# tensor 't' is [[[1, 1], [2, 2]],\n# [[3, 3], [4, 4]]]\n# tensor 't' has shape [2, 2, 2]\nreshape(t, [2, 4]) ==> [[1, 1, 2, 2],\n [3, 3, 4, 4]]\n\n# tensor 't' is [[[1, 1, 1],\n# [2, 2, 2]],\n# [[3, 3, 3],\n# [4, 4, 4]],\n# [[5, 5, 5],\n# [6, 6, 6]]]\n# tensor 't' has shape [3, 2, 3]\n# pass '[-1]' to flatten 't'\nreshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]\n\n# -1 can also be used to infer the shape\n\n# -1 is inferred to be 9:\nreshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],\n [4, 4, 4, 5, 5, 5, 6, 6, 6]]\n# -1 is inferred to be 2:\nreshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],\n [4, 4, 4, 5, 5, 5, 6, 6, 6]]\n# -1 is inferred to be 3:\nreshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],\n [2, 2, 2],\n [3, 3, 3]],\n [[4, 4, 4],\n [5, 5, 5],\n [6, 6, 6]]]\n\n# tensor 't' is [7]\n# shape `[]` reshapes to a scalar\nreshape(t, []) ==> 7\n```", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.ResizeBilinear", "summary": "Resize `images` to `size` using bilinear interpolation.", "description": "Input images can be of different types but output images are always float.", "operands": [ { "name": "images", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint8 ]>" }, { "name": "size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "resized_images", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "align_corners", "type": "DefaultValuedOptionalAttr" }, { "name": "half_pixel_centers", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResizeBilinearGrad", "summary": "Computes the gradient of bilinear interpolation.", "operands": [ { "name": "grads", "type": "TF_Float32Tensor" }, { "name": "original_image", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "align_corners", "type": "DefaultValuedOptionalAttr" }, { "name": "half_pixel_centers", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResizeNearestNeighbor", "summary": "Resize `images` to `size` using nearest neighbor interpolation.", "operands": [ { "name": "images", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint8 ]>" }, { "name": "size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "resized_images", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint8 ]>" } ], "attributes": [ { "name": "align_corners", "type": "DefaultValuedOptionalAttr" }, { "name": "half_pixel_centers", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResizeNearestNeighborGrad", "summary": "Computes the gradient of nearest neighbor interpolation.", "operands": [ { "name": "grads", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int8, TF_Uint8 ]>" }, { "name": "size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int8, TF_Uint8 ]>" } ], "attributes": [ { "name": "align_corners", "type": "DefaultValuedOptionalAttr" }, { "name": "half_pixel_centers", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAdadelta", "summary": "Update '*var' according to the adadelta scheme.", "description": "accum = rho() * accum + (1 - rho()) * grad.square();\nupdate = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad;\nupdate_accum = rho() * update_accum + (1 - rho()) * update.square();\nvar -= update;", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "accum_update", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "rho", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAdagrad", "summary": "Update '*var' according to the adagrad scheme.", "description": "accum += grad * grad\nvar -= lr * grad * (1 / sqrt(accum))", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "update_slots", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAdagradDA", "summary": "Update '*var' according to the proximal adagrad scheme.", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "gradient_accumulator", "type": "TF_ResourceTensor" }, { "name": "gradient_squared_accumulator", "type": "TF_ResourceTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "l1", "type": "TF_NumberTensor" }, { "name": "l2", "type": "TF_NumberTensor" }, { "name": "global_step", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAdagradV2", "summary": "Update '*var' according to the adagrad scheme.", "description": "accum += grad * grad\nvar -= lr * grad * (1 / (sqrt(accum) + epsilon))", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "update_slots", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAdam", "summary": "Update '*var' according to the Adam algorithm.", "description": "$$\\text{lr}_t := \\mathrm{lr} \\cdot \\frac{\\sqrt{1 - \\beta_2^t}}{1 - \\beta_1^t}$$\n$$m_t := \\beta_1 \\cdot m_{t-1} + (1 - \\beta_1) \\cdot g$$\n$$v_t := \\beta_2 \\cdot v_{t-1} + (1 - \\beta_2) \\cdot g^2$$\n$$\\text{var} := \\begin{cases} \\text{var} - (m_t \\beta_1 + g \\cdot (1 - \\beta_1))\\cdot\\text{lr}_t/(\\sqrt{v_t} + \\epsilon), &\\text{if use_nesterov}\\\\\\\\ \\text{var} - m_t \\cdot \\text{lr}_t /(\\sqrt{v_t} + \\epsilon), &\\text{otherwise} \\end{cases}$$", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "m", "type": "TF_ResourceTensor" }, { "name": "v", "type": "TF_ResourceTensor" }, { "name": "beta1_power", "type": "TF_NumberTensor" }, { "name": "beta2_power", "type": "TF_NumberTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "beta1", "type": "TF_NumberTensor" }, { "name": "beta2", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "use_nesterov", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAdaMax", "summary": "Update '*var' according to the AdaMax algorithm.", "description": "m_t <- beta1 * m_{t-1} + (1 - beta1) * g\nv_t <- max(beta2 * v_{t-1}, abs(g))\nvariable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon)", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "m", "type": "TF_ResourceTensor" }, { "name": "v", "type": "TF_ResourceTensor" }, { "name": "beta1_power", "type": "TF_NumberTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "beta1", "type": "TF_NumberTensor" }, { "name": "beta2", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyAddSign", "summary": "Update '*var' according to the AddSign update.", "description": "m_t <- beta1 * m_{t-1} + (1 - beta1) * g\nupdate <- (alpha + sign_decay * sign(g) *sign(m)) * g\nvariable <- variable - lr_t * update", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "m", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "alpha", "type": "TF_NumberTensor" }, { "name": "sign_decay", "type": "TF_NumberTensor" }, { "name": "beta", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyCenteredRMSProp", "summary": "Update '*var' according to the centered RMSProp algorithm.", "description": "The centered RMSProp algorithm uses an estimate of the centered second moment\n(i.e., the variance) for normalization, as opposed to regular RMSProp, which\nuses the (uncentered) second moment. This often helps with training, but is\nslightly more expensive in terms of computation and memory.\n\nNote that in dense implementation of this algorithm, mg, ms, and mom will\nupdate even if the grad is zero, but in this sparse implementation, mg, ms,\nand mom will not update in iterations during which the grad is zero.\n\nmean_square = decay * mean_square + (1-decay) * gradient ** 2\nmean_grad = decay * mean_grad + (1-decay) * gradient\n\nDelta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2)\n\nmg <- rho * mg_{t-1} + (1-rho) * grad\nms <- rho * ms_{t-1} + (1-rho) * grad * grad\nmom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon)\nvar <- var - mom", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "mg", "type": "TF_ResourceTensor" }, { "name": "ms", "type": "TF_ResourceTensor" }, { "name": "mom", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "rho", "type": "TF_NumberTensor" }, { "name": "momentum", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyFtrl", "summary": "Update '*var' according to the Ftrl-proximal scheme.", "description": "accum_new = accum + grad * grad\nlinear += grad - (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var\nquadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2\nvar = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0\naccum = accum_new", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "linear", "type": "TF_ResourceTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "l1", "type": "TF_NumberTensor" }, { "name": "l2", "type": "TF_NumberTensor" }, { "name": "lr_power", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "multiply_linear_by_lr", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyFtrlV2", "summary": "Update '*var' according to the Ftrl-proximal scheme.", "description": "accum_new = accum + grad * grad\ngrad_with_shrinkage = grad + 2 * l2_shrinkage * var\nlinear += grad_with_shrinkage +\n (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var\nquadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2\nvar = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0\naccum = accum_new", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "linear", "type": "TF_ResourceTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "l1", "type": "TF_NumberTensor" }, { "name": "l2", "type": "TF_NumberTensor" }, { "name": "l2_shrinkage", "type": "TF_NumberTensor" }, { "name": "lr_power", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "multiply_linear_by_lr", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyGradientDescent", "summary": "Update '*var' by subtracting 'alpha' * 'delta' from it.", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "alpha", "type": "TF_NumberTensor" }, { "name": "delta", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyKerasMomentum", "summary": "Update '*var' according to the momentum scheme.", "description": "Set use_nesterov = True if you want to use Nesterov momentum.\n\naccum = accum * momentum - lr * grad\nvar += accum", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "momentum", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "use_nesterov", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyMomentum", "summary": "Update '*var' according to the momentum scheme.", "description": "Set use_nesterov = True if you want to use Nesterov momentum.\n\naccum = accum * momentum + grad\nvar -= lr * accum", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "momentum", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "use_nesterov", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyPowerSign", "summary": "Update '*var' according to the AddSign update.", "description": "m_t <- beta1 * m_{t-1} + (1 - beta1) * g\nupdate <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g\nvariable <- variable - lr_t * update", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "m", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "logbase", "type": "TF_NumberTensor" }, { "name": "sign_decay", "type": "TF_NumberTensor" }, { "name": "beta", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyProximalAdagrad", "summary": "Update '*var' and '*accum' according to FOBOS with Adagrad learning rate.", "description": "accum += grad * grad\nprox_v = var - lr * grad * (1 / sqrt(accum))\nvar = sign(prox_v)/(1+lr*l2) * max{|prox_v|-lr*l1,0}", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "l1", "type": "TF_NumberTensor" }, { "name": "l2", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyProximalGradientDescent", "summary": "Update '*var' as FOBOS algorithm with fixed learning rate.", "description": "prox_v = var - alpha * delta\nvar = sign(prox_v)/(1+alpha*l2) * max{|prox_v|-alpha*l1,0}", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "alpha", "type": "TF_NumberTensor" }, { "name": "l1", "type": "TF_NumberTensor" }, { "name": "l2", "type": "TF_NumberTensor" }, { "name": "delta", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceApplyRMSProp", "summary": "Update '*var' according to the RMSProp algorithm.", "description": "Note that in dense implementation of this algorithm, ms and mom will\nupdate even if the grad is zero, but in this sparse implementation, ms\nand mom will not update in iterations during which the grad is zero.\n\nmean_square = decay * mean_square + (1-decay) * gradient ** 2\nDelta = learning_rate * gradient / sqrt(mean_square + epsilon)\n\nms <- rho * ms_{t-1} + (1-rho) * grad * grad\nmom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)\nvar <- var - mom", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "ms", "type": "TF_ResourceTensor" }, { "name": "mom", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "rho", "type": "TF_NumberTensor" }, { "name": "momentum", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceGather", "summary": "Gather slices from the variable pointed to by `resource` according to `indices`.", "description": "`indices` must be an integer tensor of any dimension (usually 0-D or 1-D).\nProduces an output tensor with shape `indices.shape + params.shape[1:]` where:\n\n```python\n # Scalar indices\n output[:, ..., :] = params[indices, :, ... :]\n\n # Vector indices\n output[i, :, ..., :] = params[indices[i], :, ... :]\n\n # Higher rank indices\n output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]\n```", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "batch_dims", "type": "DefaultValuedOptionalAttr" }, { "name": "validate_indices", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceGatherNd", "summary": "GatherNd on a resource.", "description": "This op reads the variable referenced by the first argument, and\nthen performs a GatherNd operation on it.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.ResourceScatterAdd", "summary": "Adds sparse updates to the variable referenced by `resource`.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] += updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] += updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions add.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n
\n\n
", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_NumberTensor" } ] }, { "name": "tf.ResourceScatterDiv", "summary": "Divides sparse updates into the variable referenced by `resource`.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] /= updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] /= updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions multiply.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n
\n\n
", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_NumberTensor" } ] }, { "name": "tf.ResourceScatterMax", "summary": "Reduces sparse updates into the variable referenced by `resource` using the `max` operation.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] = max(ref[indices, ...], updates[...])\n\n # Vector indices (for each i)\n ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions are combined.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n
\n\n
", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_NumberTensor" } ] }, { "name": "tf.ResourceScatterMin", "summary": "Reduces sparse updates into the variable referenced by `resource` using the `min` operation.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] = min(ref[indices, ...], updates[...])\n\n # Vector indices (for each i)\n ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions are combined.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n
\n\n
", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_NumberTensor" } ] }, { "name": "tf.ResourceScatterMul", "summary": "Multiplies sparse updates into the variable referenced by `resource`.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] *= updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] *= updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions multiply.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n
\n\n
", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_NumberTensor" } ] }, { "name": "tf.ResourceScatterNdAdd", "summary": "Applies sparse addition to individual values or slices in a Variable.", "description": "`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.\n\n`indices` must be integer tensor, containing indices into `ref`.\nIt must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.\n\nThe innermost dimension of `indices` (with length `K`) corresponds to\nindices into elements (if `K = P`) or slices (if `K < P`) along the `K`th\ndimension of `ref`.\n\n`updates` is `Tensor` of rank `Q-1+P-K` with shape:\n\n```\n[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]\n```\n\nFor example, say we want to add 4 scattered elements to a rank-1 tensor to\n8 elements. In Python, that addition would look like this:\n\n```python\nref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)\nindices = tf.constant([[4], [3], [1], [7]])\nupdates = tf.constant([9, 10, 11, 12])\nadd = tf.scatter_nd_add(ref, indices, updates)\nwith tf.Session() as sess:\n print sess.run(add)\n```\n\nThe resulting update to ref would look like this:\n\n [1, 13, 3, 14, 14, 6, 7, 20]\n\nSee `tf.scatter_nd` for more details about how to make updates to\nslices.", "operands": [ { "name": "ref", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceScatterNdSub", "summary": "Applies sparse subtraction to individual values or slices in a Variable.", "description": "`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.\n\n`indices` must be integer tensor, containing indices into `ref`.\nIt must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.\n\nThe innermost dimension of `indices` (with length `K`) corresponds to\nindices into elements (if `K = P`) or slices (if `K < P`) along the `K`th\ndimension of `ref`.\n\n`updates` is `Tensor` of rank `Q-1+P-K` with shape:\n\n```\n[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]\n```\n\nFor example, say we want to subtract 4 scattered elements from a rank-1 tensor\nwith 8 elements. In Python, that subtraction would look like this:\n\n```python\nref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)\nindices = tf.constant([[4], [3], [1], [7]])\nupdates = tf.constant([9, 10, 11, 12])\nsub = tf.scatter_nd_sub(ref, indices, updates)\nwith tf.Session() as sess:\n print sess.run(sub)\n```\n\nThe resulting update to ref would look like this:\n\n [1, -9, 3, -6, -4, 6, 7, -4]\n\nSee `tf.scatter_nd` for more details about how to make updates to\nslices.", "operands": [ { "name": "ref", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceScatterNdUpdate", "summary": "Applies sparse `updates` to individual values or slices within a given", "description": "variable according to `indices`.\n\n`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.\n\n`indices` must be integer tensor, containing indices into `ref`.\nIt must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.\n\nThe innermost dimension of `indices` (with length `K`) corresponds to\nindices into elements (if `K = P`) or slices (if `K < P`) along the `K`th\ndimension of `ref`.\n\n`updates` is `Tensor` of rank `Q-1+P-K` with shape:\n\n```\n[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].\n```\n\nFor example, say we want to update 4 scattered elements to a rank-1 tensor to\n8 elements. In Python, that update would look like this:\n\n```python\n ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])\n indices = tf.constant([[4], [3], [1] ,[7]])\n updates = tf.constant([9, 10, 11, 12])\n update = tf.scatter_nd_update(ref, indices, updates)\n with tf.Session() as sess:\n print sess.run(update)\n```\n\nThe resulting update to ref would look like this:\n\n [1, 11, 3, 10, 9, 6, 7, 12]\n\nSee `tf.scatter_nd` for more details about how to make updates to\nslices.", "operands": [ { "name": "ref", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceScatterSub", "summary": "Subtracts sparse updates from the variable referenced by `resource`.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] -= updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] -= updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions add.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n
\n\n
", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_NumberTensor" } ] }, { "name": "tf.ResourceScatterUpdate", "summary": "Assigns sparse updates to the variable referenced by `resource`.", "description": "This operation computes\n\n # Scalar indices\n ref[indices, ...] = updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] = updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ] }, { "name": "tf.ResourceSparseApplyAdagrad", "summary": "Update relevant entries in '*var' and '*accum' according to the adagrad scheme.", "description": "That is for rows we have grad for, we update var and accum as follows:\naccum += grad * grad\nvar -= lr * grad * (1 / sqrt(accum))", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "update_slots", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceSparseApplyAdagradV2", "summary": "Update relevant entries in '*var' and '*accum' according to the adagrad scheme.", "description": "That is for rows we have grad for, we update var and accum as follows:\naccum += grad * grad\nvar -= lr * grad * (1 / sqrt(accum))", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "epsilon", "type": "TF_NumberTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "update_slots", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceSparseApplyFtrl", "summary": "Update relevant entries in '*var' according to the Ftrl-proximal scheme.", "description": "That is for rows we have grad for, we update var, accum and linear as follows:\naccum_new = accum + grad * grad\nlinear += grad - (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var\nquadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2\nvar = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0\naccum = accum_new", "operands": [ { "name": "var", "type": "TF_ResourceTensor" }, { "name": "accum", "type": "TF_ResourceTensor" }, { "name": "linear", "type": "TF_ResourceTensor" }, { "name": "grad", "type": "TF_NumberTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "lr", "type": "TF_NumberTensor" }, { "name": "l1", "type": "TF_NumberTensor" }, { "name": "l2", "type": "TF_NumberTensor" }, { "name": "lr_power", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "use_locking", "type": "DefaultValuedOptionalAttr" }, { "name": "multiply_linear_by_lr", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ResourceStridedSliceAssign", "summary": "Assign `value` to the sliced l-value reference of `ref`.", "description": "The values of `value` are assigned to the positions in the variable\n`ref` that are selected by the slice parameters. The slice parameters\n`begin, `end`, `strides`, etc. work exactly as in `StridedSlice`.\n\nNOTE this op currently does not support broadcasting and so `value`'s\nshape must be exactly the shape produced by the slice of `ref`.", "operands": [ { "name": "ref", "type": "TF_ResourceTensor" }, { "name": "begin", "type": "TF_I32OrI64Tensor" }, { "name": "end", "type": "TF_I32OrI64Tensor" }, { "name": "strides", "type": "TF_I32OrI64Tensor" }, { "name": "value", "type": "TF_Tensor" } ], "attributes": [ { "name": "begin_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "end_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "ellipsis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "new_axis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "shrink_axis_mask", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Restore", "summary": "Restores a tensor from checkpoint files.", "description": "Reads a tensor stored in one or several files. If there are several files (for\ninstance because a tensor was saved as slices), `file_pattern` may contain\nwildcard symbols (`*` and `?`) in the filename portion only, not in the\ndirectory portion.\n\nIf a `file_pattern` matches several files, `preferred_shard` can be used to hint\nin which file the requested tensor is likely to be found. This op will first\nopen the file at index `preferred_shard` in the list of matching files and try\nto restore tensors from that file. Only if some tensors or tensor slices are\nnot found in that first file, then the Op opens all the files. Setting\n`preferred_shard` to match the value passed as the `shard` input\nof a matching `Save` Op may speed up Restore. This attribute only affects\nperformance, not correctness. The default value -1 means files are processed in\norder.\n\nSee also `RestoreSlice`.", "operands": [ { "name": "file_pattern", "type": "TF_StrTensor" }, { "name": "tensor_name", "type": "TF_StrTensor" } ], "results": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "preferred_shard", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RestoreV2", "summary": "Restores tensors from a V2 checkpoint.", "description": "For backward compatibility with the V1 format, this Op currently allows\nrestoring from a V1 checkpoint as well:\n - This Op first attempts to find the V2 index file pointed to by \"prefix\", and\n if found proceed to read it as a V2 checkpoint;\n - Otherwise the V1 read path is invoked.\nRelying on this behavior is not recommended, as the ability to fall back to read\nV1 might be deprecated and eventually removed.\n\nBy default, restores the named tensors in full. If the caller wishes to restore\nspecific slices of stored tensors, \"shape_and_slices\" should be non-empty\nstrings and correspondingly well-formed.\n\nCallers must ensure all the named tensors are indeed stored in the checkpoint.", "operands": [ { "name": "prefix", "type": "TF_StrTensor" }, { "name": "tensor_names", "type": "TF_StrTensor" }, { "name": "shape_and_slices", "type": "TF_StrTensor" } ], "results": [ { "name": "tensors", "type": "Variadic" } ] }, { "name": "tf.RetrieveTPUEmbeddingAdadeltaParameters", "summary": "Retrieve Adadelta embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "updates", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "updates", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingAdagradParameters", "summary": "Retrieve Adagrad embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingADAMParameters", "summary": "Retrieve ADAM embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocities", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocities", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingCenteredRMSPropParameters", "summary": "Retrieve centered RMSProp embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "ms", "type": "TF_Float32Tensor" }, { "name": "mom", "type": "TF_Float32Tensor" }, { "name": "mg", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingFTRLParameters", "summary": "Retrieve FTRL embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "linears", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "linears", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingMDLAdagradLightParameters", "summary": "Retrieve MDL Adagrad Light embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "benefits", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingMomentumParameters", "summary": "Retrieve Momentum embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingProximalAdagradParameters", "summary": "Retrieve proximal Adagrad embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "accumulators", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingProximalYogiParameters", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "v", "type": "TF_Float32Tensor" }, { "name": "m", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "v", "type": "TF_Float32Tensor" }, { "name": "m", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingRMSPropParameters", "summary": "Retrieve RMSProp embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "ms", "type": "TF_Float32Tensor" }, { "name": "mom", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "ms", "type": "TF_Float32Tensor" }, { "name": "mom", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters", "summary": "Retrieve SGD embedding parameters.", "description": "An op that retrieves optimization parameters from embedding to host\nmemory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up\nthe correct embedding table configuration. For example, this op is\nused to retrieve updated parameters before saving a checkpoint.", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug", "results": [ { "name": "parameters", "type": "TF_Float32Tensor" }, { "name": "gradient_accumulators", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "DefaultValuedOptionalAttr" }, { "name": "table_name", "type": "DefaultValuedOptionalAttr" }, { "name": "num_shards", "type": "I64Attr" }, { "name": "shard_id", "type": "I64Attr" }, { "name": "config", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Reverse", "summary": "Reverses specific dimensions of a tensor.", "description": "Given a `tensor`, and a `bool` tensor `dims` representing the dimensions\nof `tensor`, this operation reverses each dimension i of `tensor` where\n`dims[i]` is `True`.\n\n`tensor` can have up to 8 dimensions. The number of dimensions\nof `tensor` must equal the number of elements in `dims`. In other words:\n\n`rank(tensor) = size(dims)`\n\nFor example:\n\n```\n# tensor 't' is [[[[ 0, 1, 2, 3],\n# [ 4, 5, 6, 7],\n# [ 8, 9, 10, 11]],\n# [[12, 13, 14, 15],\n# [16, 17, 18, 19],\n# [20, 21, 22, 23]]]]\n# tensor 't' shape is [1, 2, 3, 4]\n\n# 'dims' is [False, False, False, True]\nreverse(t, dims) ==> [[[[ 3, 2, 1, 0],\n [ 7, 6, 5, 4],\n [ 11, 10, 9, 8]],\n [[15, 14, 13, 12],\n [19, 18, 17, 16],\n [23, 22, 21, 20]]]]\n\n# 'dims' is [False, True, False, False]\nreverse(t, dims) ==> [[[[12, 13, 14, 15],\n [16, 17, 18, 19],\n [20, 21, 22, 23]\n [[ 0, 1, 2, 3],\n [ 4, 5, 6, 7],\n [ 8, 9, 10, 11]]]]\n\n# 'dims' is [False, False, True, False]\nreverse(t, dims) ==> [[[[8, 9, 10, 11],\n [4, 5, 6, 7],\n [0, 1, 2, 3]]\n [[20, 21, 22, 23],\n [16, 17, 18, 19],\n [12, 13, 14, 15]]]]\n```", "operands": [ { "name": "tensor", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Str, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "dims", "type": "TF_BoolTensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Str, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ] }, { "name": "tf.ReverseSequence", "summary": "Reverses variable length slices.", "description": "This op first slices `input` along the dimension `batch_dim`, and for each\nslice `i`, reverses the first `seq_lengths[i]` elements along\nthe dimension `seq_dim`.\n\nThe elements of `seq_lengths` must obey `seq_lengths[i] <= input.dims[seq_dim]`,\nand `seq_lengths` must be a vector of length `input.dims[batch_dim]`.\n\nThe output slice `i` along dimension `batch_dim` is then given by input\nslice `i`, with the first `seq_lengths[i]` slices along dimension\n`seq_dim` reversed.\n\nFor example:\n\n```\n# Given this:\nbatch_dim = 0\nseq_dim = 1\ninput.dims = (4, 8, ...)\nseq_lengths = [7, 2, 3, 5]\n\n# then slices of input are reversed on seq_dim, but only up to seq_lengths:\noutput[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...]\noutput[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...]\noutput[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...]\noutput[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...]\n\n# while entries past seq_lens are copied through:\noutput[0, 7:, :, ...] = input[0, 7:, :, ...]\noutput[1, 2:, :, ...] = input[1, 2:, :, ...]\noutput[2, 3:, :, ...] = input[2, 3:, :, ...]\noutput[3, 2:, :, ...] = input[3, 2:, :, ...]\n```\n\nIn contrast, if:\n\n```\n# Given this:\nbatch_dim = 2\nseq_dim = 0\ninput.dims = (8, ?, 4, ...)\nseq_lengths = [7, 2, 3, 5]\n\n# then slices of input are reversed on seq_dim, but only up to seq_lengths:\noutput[0:7, :, 0, :, ...] = input[7:0:-1, :, 0, :, ...]\noutput[0:2, :, 1, :, ...] = input[2:0:-1, :, 1, :, ...]\noutput[0:3, :, 2, :, ...] = input[3:0:-1, :, 2, :, ...]\noutput[0:5, :, 3, :, ...] = input[5:0:-1, :, 3, :, ...]\n\n# while entries past seq_lens are copied through:\noutput[7:, :, 0, :, ...] = input[7:, :, 0, :, ...]\noutput[2:, :, 1, :, ...] = input[2:, :, 1, :, ...]\noutput[3:, :, 2, :, ...] = input[3:, :, 2, :, ...]\noutput[2:, :, 3, :, ...] = input[2:, :, 3, :, ...]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "seq_lengths", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "seq_dim", "type": "I64Attr" }, { "name": "batch_dim", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ReverseV2", "summary": "Reverses specific dimensions of a tensor.", "description": "Given a `tensor`, and a `int32` tensor `axis` representing the set of\ndimensions of `tensor` to reverse. This operation reverses each dimension\n`i` for which there exists `j` s.t. `axis[j] == i`.\n\n`tensor` can have up to 8 dimensions. The number of dimensions specified\nin `axis` may be 0 or more entries. If an index is specified more than\nonce, a InvalidArgument error is raised.\n\nFor example:\n\n```\n# tensor 't' is [[[[ 0, 1, 2, 3],\n# [ 4, 5, 6, 7],\n# [ 8, 9, 10, 11]],\n# [[12, 13, 14, 15],\n# [16, 17, 18, 19],\n# [20, 21, 22, 23]]]]\n# tensor 't' shape is [1, 2, 3, 4]\n\n# 'dims' is [3] or 'dims' is [-1]\nreverse(t, dims) ==> [[[[ 3, 2, 1, 0],\n [ 7, 6, 5, 4],\n [ 11, 10, 9, 8]],\n [[15, 14, 13, 12],\n [19, 18, 17, 16],\n [23, 22, 21, 20]]]]\n\n# 'dims' is '[1]' (or 'dims' is '[-3]')\nreverse(t, dims) ==> [[[[12, 13, 14, 15],\n [16, 17, 18, 19],\n [20, 21, 22, 23]\n [[ 0, 1, 2, 3],\n [ 4, 5, 6, 7],\n [ 8, 9, 10, 11]]]]\n\n# 'dims' is '[2]' (or 'dims' is '[-2]')\nreverse(t, dims) ==> [[[[8, 9, 10, 11],\n [4, 5, 6, 7],\n [0, 1, 2, 3]]\n [[20, 21, 22, 23],\n [16, 17, 18, 19],\n [12, 13, 14, 15]]]]\n```", "operands": [ { "name": "tensor", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Str, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Str, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ] }, { "name": "tf.RFFT", "summary": "Real-valued fast Fourier transform.", "description": "Computes the 1-dimensional discrete Fourier transform of a real-valued signal\nover the inner-most dimension of `input`.\n\nSince the DFT of a real signal is Hermitian-symmetric, `RFFT` only returns the\n`fft_length / 2 + 1` unique components of the FFT: the zero-frequency term,\nfollowed by the `fft_length / 2` positive-frequency terms.\n\nAlong the axis `RFFT` is computed on, if `fft_length` is smaller than the\ncorresponding dimension of `input`, the dimension is cropped. If it is larger,\nthe dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TF_F32OrF64Tensor" }, { "name": "fft_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.RFFT2D", "summary": "2D real-valued fast Fourier transform.", "description": "Computes the 2-dimensional discrete Fourier transform of a real-valued signal\nover the inner-most 2 dimensions of `input`.\n\nSince the DFT of a real signal is Hermitian-symmetric, `RFFT2D` only returns the\n`fft_length / 2 + 1` unique components of the FFT for the inner-most dimension\nof `output`: the zero-frequency term, followed by the `fft_length / 2`\npositive-frequency terms.\n\nAlong each axis `RFFT2D` is computed on, if `fft_length` is smaller than the\ncorresponding dimension of `input`, the dimension is cropped. If it is larger,\nthe dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TF_F32OrF64Tensor" }, { "name": "fft_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.RFFT3D", "summary": "3D real-valued fast Fourier transform.", "description": "Computes the 3-dimensional discrete Fourier transform of a real-valued signal\nover the inner-most 3 dimensions of `input`.\n\nSince the DFT of a real signal is Hermitian-symmetric, `RFFT3D` only returns the\n`fft_length / 2 + 1` unique components of the FFT for the inner-most dimension\nof `output`: the zero-frequency term, followed by the `fft_length / 2`\npositive-frequency terms.\n\nAlong each axis `RFFT3D` is computed on, if `fft_length` is smaller than the\ncorresponding dimension of `input`, the dimension is cropped. If it is larger,\nthe dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TF_F32OrF64Tensor" }, { "name": "fft_length", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64 ]>" } ] }, { "name": "tf.RGBToHSV", "summary": "Converts one or more images from RGB to HSV.", "description": "Outputs a tensor of the same shape as the `images` tensor, containing the HSV\nvalue of the pixels. The output is only well defined if the value in `images`\nare in `[0,1]`.\n\n`output[..., 0]` contains hue, `output[..., 1]` contains saturation, and\n`output[..., 2]` contains value. All HSV values are in `[0,1]`. A hue of 0\ncorresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue.\n\nUsage Example:\n\n>>> blue_image = tf.stack([\n... tf.zeros([5,5]),\n... tf.zeros([5,5]),\n... tf.ones([5,5])],\n... axis=-1)\n>>> blue_hsv_image = tf.image.rgb_to_hsv(blue_image)\n>>> blue_hsv_image[0,0].numpy()\narray([0.6666667, 1. , 1. ], dtype=float32)", "operands": [ { "name": "images", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.RightShift", "summary": "Elementwise computes the bitwise right-shift of `x` and `y`.", "description": "Performs a logical shift for unsigned integer types, and an arithmetic shift\nfor signed integer types.\n\nIf `y` is negative, or greater than or equal to than the width of `x` in bits\nthe result is implementation defined.\n\nExample:\n\n```python\nimport tensorflow as tf\nfrom tensorflow.python.ops import bitwise_ops\nimport numpy as np\ndtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]\n\nfor dtype in dtype_list:\n lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)\n rhs = tf.constant([5, 0, 7, 11], dtype=dtype)\n\n right_shift_result = bitwise_ops.right_shift(lhs, rhs)\n\n print(right_shift_result)\n\n# This will print:\n# tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int8)\n# tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int16)\n# tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int32)\n# tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int64)\n\nlhs = np.array([-2, 64, 101, 32], dtype=np.int8)\nrhs = np.array([-1, -5, -3, -14], dtype=np.int8)\nbitwise_ops.right_shift(lhs, rhs)\n# \n```", "operands": [ { "name": "x", "type": "TF_IntTensor" }, { "name": "y", "type": "TF_IntTensor" } ], "results": [ { "name": "z", "type": "TF_IntTensor" } ] }, { "name": "tf.Rint", "summary": "Returns element-wise integer closest to x.", "description": "If the result is midway between two representable values,\nthe even representable is chosen.\nFor example:\n\n```\nrint(-1.5) ==> -2.0\nrint(0.5000001) ==> 1.0\nrint([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) ==> [-2., -2., -0., 0., 2., 2., 2.]\n```", "operands": [ { "name": "x", "type": "TF_FloatTensor" } ], "results": [ { "name": "y", "type": "TF_FloatTensor" } ] }, { "name": "tf.RiscAdd", "summary": "Returns x + y element-wise.", "description": "*NOTE*: `RiscAdd` does not supports broadcasting.\n\nGiven two input tensors, the `tf.risc_add` operation computes the sum for every element in the tensor.\n\nBoth input and output have a range `(-inf, inf)`.", "operands": [ { "name": "x", "type": "TF_FloatTensor" }, { "name": "y", "type": "TF_FloatTensor" } ], "results": [ { "name": "z", "type": "TF_FloatTensor" } ] }, { "name": "tf.RiscDot", "operands": [ { "name": "a", "type": "TF_FloatTensor" }, { "name": "b", "type": "TF_FloatTensor" } ], "results": [ { "name": "product", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedOptionalAttr" }, { "name": "transpose_b", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.RngReadAndSkip", "summary": "Advance the counter of a counter-based RNG.", "description": "The state of the RNG after\n`rng_read_and_skip(n)` will be the same as that after `uniform([n])`\n(or any other distribution). The actual increment added to the\ncounter is an unspecified implementation choice.\n\nIn the case that the input algorithm is RNG_ALG_AUTO_SELECT, the counter in the state needs to be of size int64[2], the current maximal counter size among algorithms. In this case, this op will manage the counter as if it is an 128-bit integer with layout [lower_64bits, higher_64bits]. If an algorithm needs less than 128 bits for the counter, it should use the left portion of the int64[2]. In this way, the int64[2] is compatible with all current RNG algorithms (Philox, ThreeFry and xla::RandomAlgorithm::RNG_DEFAULT). Downstream RNG ops can thus use this counter with any RNG algorithm.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "alg", "type": "TF_Int32Tensor" }, { "name": "delta", "type": "TF_Uint64Tensor" } ], "results": [ { "name": "value", "type": "TF_Int64Tensor" } ] }, { "name": "tf.Roll", "summary": "Rolls the elements of a tensor along an axis.", "description": "The elements are shifted positively (towards larger indices) by the offset of\n`shift` along the dimension of `axis`. Negative `shift` values will shift\nelements in the opposite direction. Elements that roll passed the last position\nwill wrap around to the first and vice versa. Multiple shifts along multiple\naxes may be specified.\n\nFor example:\n\n```\n# 't' is [0, 1, 2, 3, 4]\nroll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]\n\n# shifting along multiple dimensions\n# 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]\nroll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]\n\n# shifting along the same axis multiple times\n# 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]\nroll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "shift", "type": "TF_I32OrI64Tensor" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Round", "summary": "Rounds the values of a tensor to the nearest integer, element-wise.", "description": "Rounds half to even. Also known as bankers rounding. If you want to round\naccording to the current system rounding mode use std::cint.", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.Rsqrt", "summary": "Computes reciprocal of square root of x element-wise.", "description": "I.e., \\\\(y = 1 / \\sqrt{x}\\\\).", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.RsqrtGrad", "summary": "Computes the gradient for the rsqrt of `x` wrt its input.", "description": "Specifically, `grad = dy * -0.5 * y^3`, where `y = rsqrt(x)`, and `dy`\nis the corresponding input gradient.", "operands": [ { "name": "y", "type": "TF_FpOrComplexTensor" }, { "name": "dy", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Save", "summary": "Saves the input tensors to disk.", "description": "The size of `tensor_names` must match the number of tensors in `data`. `data[i]`\nis written to `filename` with name `tensor_names[i]`.\n\nSee also `SaveSlices`.", "operands": [ { "name": "filename", "type": "TF_StrTensor" }, { "name": "tensor_names", "type": "TF_StrTensor" }, { "name": "data", "type": "Variadic" } ] }, { "name": "tf.SaveSlices", "summary": "Saves input tensors slices to disk.", "description": "This is like `Save` except that tensors can be listed in the saved file as being\na slice of a larger tensor. `shapes_and_slices` specifies the shape of the\nlarger tensor and the slice that this tensor covers. `shapes_and_slices` must\nhave as many elements as `tensor_names`.\n\nElements of the `shapes_and_slices` input must either be:\n\n* The empty string, in which case the corresponding tensor is\n saved normally.\n* A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the\n `dimI` are the dimensions of the larger tensor and `slice-spec`\n specifies what part is covered by the tensor to save.\n\n`slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1`\nwhere each `sliceI` is either:\n\n* The string `-` meaning that the slice covers all indices of this dimension\n* `start,length` where `start` and `length` are integers. In that\n case the slice covers `length` indices starting at `start`.\n\nSee also `Save`.", "operands": [ { "name": "filename", "type": "TF_StrTensor" }, { "name": "tensor_names", "type": "TF_StrTensor" }, { "name": "shapes_and_slices", "type": "TF_StrTensor" }, { "name": "data", "type": "Variadic" } ] }, { "name": "tf.SaveV2", "summary": "Saves tensors in V2 checkpoint format.", "description": "By default, saves the named tensors in full. If the caller wishes to save\nspecific slices of full tensors, \"shape_and_slices\" should be non-empty strings\nand correspondingly well-formed.", "operands": [ { "name": "prefix", "type": "TF_StrTensor" }, { "name": "tensor_names", "type": "TF_StrTensor" }, { "name": "shape_and_slices", "type": "TF_StrTensor" }, { "name": "tensors", "type": "Variadic" } ] }, { "name": "tf.ScatterNd", "summary": "Scatters `updates` into a tensor of shape `shape` according to `indices`.", "description": "Scatter sparse `updates` according to individual values at the specified\n`indices`. This op returns an output tensor with the `shape` you specify. This\nop is the inverse of the `tf.gather_nd` operator which extracts values or slices\nfrom a given tensor.\n\nThis operation is similar to `tf.tensor_scatter_nd_add`, except that the tensor\nis zero-initialized. Calling `tf.scatter_nd(indices, updates, shape)`\nis identical to calling\n`tf.tensor_scatter_nd_add(tf.zeros(shape, updates.dtype), indices, updates)`\n\nIf `indices` contains duplicates, the associated `updates` are accumulated\n(summed) into the output tensor.\n\n**WARNING**: For floating-point data types, the output may be nondeterministic.\nThis is because the order in which the updates are applied is nondeterministic\nand when floating-point numbers are added in different orders the resulting\nnumerical approximation error can be slightly different. However, the output\nwill be deterministic if op determinism is enabled via\n`tf.config.experimental.enable_op_determinism`.\n\n`indices` is an integer tensor containing indices into the output tensor. The\nlast dimension of `indices` can be at most the rank of `shape`:\n\n indices.shape[-1] <= shape.rank\n\nThe last dimension of `indices` corresponds to indices of elements\n(if `indices.shape[-1] = shape.rank`) or slices\n(if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of\n`shape`.\n\n`updates` is a tensor with shape:\n\n indices.shape[:-1] + shape[indices.shape[-1]:]\n\nThe simplest form of the scatter op is to insert individual elements in\na tensor by index. Consider an example where you want to insert 4 scattered\nelements in a rank-1 tensor with 8 elements.\n\n
\n\n
\n\nIn Python, this scatter operation would look like this:\n\n```python\n indices = tf.constant([[4], [3], [1], [7]])\n updates = tf.constant([9, 10, 11, 12])\n shape = tf.constant([8])\n scatter = tf.scatter_nd(indices, updates, shape)\n print(scatter)\n```\n\nThe resulting tensor would look like this:\n\n [0, 11, 0, 10, 9, 0, 0, 12]\n\nYou can also insert entire slices of a higher rank tensor all at once. For\nexample, you can insert two slices in the first dimension of a rank-3 tensor\nwith two matrices of new values.\n\n
\n\n
\n\nIn Python, this scatter operation would look like this:\n\n```python\n indices = tf.constant([[1], [3]])\n updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],\n [7, 7, 7, 7], [8, 8, 8, 8]],\n [[5, 5, 5, 5], [6, 6, 6, 6],\n [7, 7, 7, 7], [8, 8, 8, 8]]])\n shape = tf.constant([4, 4, 4])\n scatter = tf.scatter_nd(indices, updates, shape)\n print(scatter)\n```\n\nThe resulting tensor would look like this:\n\n [[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],\n [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],\n [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],\n [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]\n\nIf `indices` contains any out-of-bound indices, depending on\n`bad_indices_policy`, the op will either return an error or ignore the\nout-of-bound indices. `bad_indices_policy` can be one of the following values:\n1. \"\" or \"DEFAULT\": raises on CPU and ignore on GPU. This is because\n historically on CPU and GPU we handle errors in different ways, and for\n backward compatibility we keep the default behavior.\n2. \"ERROR\": raises error; GPU does not support this value.\n3. \"IGNORE\": ignore the bad indices; supported on both CPU and GPU.", "operands": [ { "name": "indices", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" }, { "name": "updates", "type": "TF_Tensor" }, { "name": "shape", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SegmentMax", "summary": "Computes the maximum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\max_j(data_j)\\\\) where `max` is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the max is empty for a given segment ID `i`, `output[i] = 0`.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as the same as a smaller following index.\n\n
\n\n
\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> tf.math.segment_max(c, tf.constant([0, 0, 1])).numpy()\narray([[4, 3, 3, 4],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.SegmentMaxV2", "summary": "Computes the maximum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\max_j(data_j)\\\\) where `max` is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the maximum is empty for a given segment ID `i`, it outputs the smallest\npossible value for the specific numeric type,\n`output[i] = numeric_limits::lowest()`.\n\nNote: That this op is currently only supported with jit_compile=True.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as the same as a smaller following index.\n\nThe only difference with SegmentMax is the additional input `num_segments`.\nThis helps in evaluating the output shape in compile time.\n`num_segments` should be consistent with segment_ids.\ne.g. Max(segment_ids) should be equal to `num_segments` - 1 for a 1-d segment_ids\nWith inconsistent num_segments, the op still runs. only difference is,\nthe output takes the size of num_segments irrespective of size of segment_ids and data.\nfor num_segments less than expected output size, the last elements are ignored\nfor num_segments more than the expected output size, last elements are assigned\nsmallest possible value for the specific numeric type.\n\nFor example:\n\n>>> @tf.function(jit_compile=True)\n... def test(c):\n... return tf.raw_ops.SegmentMaxV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2)\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> test(c).numpy()\narray([[4, 3, 3, 4],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.SegmentMean", "summary": "Computes the mean along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\frac{\\sum_j data_j}{N}\\\\) where `mean` is\nover `j` such that `segment_ids[j] == i` and `N` is the total number of\nvalues summed.\n\nIf the mean is empty for a given segment ID `i`, `output[i] = 0`.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as a smaller following index when computing the numerator\nof the mean.\n\n
\n\n
\n\nFor example:\n\n>>> c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> tf.math.segment_mean(c, tf.constant([0, 0, 1])).numpy()\narray([[2.5, 2.5, 2.5, 2.5],\n [5., 6., 7., 8.]], dtype=float32)", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.SegmentMin", "summary": "Computes the minimum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\min_j(data_j)\\\\) where `min` is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the min is empty for a given segment ID `i`, `output[i] = 0`.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as the same as a smaller following index.\n\n
\n\n
\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> tf.math.segment_min(c, tf.constant([0, 0, 1])).numpy()\narray([[1, 2, 2, 1],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.SegmentMinV2", "summary": "Computes the minimum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\min_j(data_j)\\\\) where `min` is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the minimum is empty for a given segment ID `i`, it outputs the largest\npossible value for the specific numeric type,\n`output[i] = numeric_limits::max()`.\n\nNote: That this op is currently only supported with jit_compile=True.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as the same as a smaller following index.\n\nThe only difference with SegmentMin is the additional input `num_segments`.\nThis helps in evaluating the output shape in compile time.\n`num_segments` should be consistent with segment_ids.\ne.g. Max(segment_ids) should be equal to `num_segments` - 1 for a 1-d segment_ids\nWith inconsistent num_segments, the op still runs. only difference is,\nthe output takes the size of num_segments irrespective of size of segment_ids and data.\nfor num_segments less than expected output size, the last elements are ignored\nfor num_segments more than the expected output size, last elements are assigned\nthe largest possible value for the specific numeric type.\n\nFor example:\n\n>>> @tf.function(jit_compile=True)\n... def test(c):\n... return tf.raw_ops.SegmentMinV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2)\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> test(c).numpy()\narray([[1, 2, 2, 1],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.SegmentProd", "summary": "Computes the product along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\prod_j data_j\\\\) where the product is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the product is empty for a given segment ID `i`, `output[i] = 1`.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as the same as a smaller following index.\n\n
\n\n
\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> tf.math.segment_prod(c, tf.constant([0, 0, 1])).numpy()\narray([[4, 6, 6, 4],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.SegmentProdV2", "summary": "Computes the product along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\prod_j data_j\\\\) where the product is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the product is empty for a given segment ID `i`, `output[i] = 1`.\n\nNote: That this op is currently only supported with jit_compile=True.\n\nThe only difference with SegmentProd is the additional input `num_segments`.\nThis helps in evaluating the output shape in compile time.\n`num_segments` should be consistent with segment_ids.\ne.g. Max(segment_ids) - 1 should be equal to `num_segments` for a 1-d segment_ids\nWith inconsistent num_segments, the op still runs. only difference is,\nthe output takes the size of num_segments irrespective of size of segment_ids and data.\nfor num_segments less than expected output size, the last elements are ignored\nfor num_segments more than the expected output size, last elements are assigned 1.\n\nFor example:\n\n>>> @tf.function(jit_compile=True)\n... def test(c):\n... return tf.raw_ops.SegmentProdV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2)\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> test(c).numpy()\narray([[4, 6, 6, 4],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.SegmentSum", "summary": "Computes the sum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\sum_j data_j\\\\) where sum is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the sum is empty for a given segment ID `i`, `output[i] = 0`.\n\nCaution: On CPU, values in `segment_ids` are always validated to be sorted,\nand an error is thrown for indices that are not increasing. On GPU, this\ndoes not throw an error for unsorted indices. On GPU, out-of-order indices\nresult in safe but unspecified behavior, which may include treating\nout-of-order indices as the same as a smaller following index.\n\n
\n\n
\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])\n>>> tf.math.segment_sum(c, tf.constant([0, 0, 1])).numpy()\narray([[5, 5, 5, 5],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.SegmentSumV2", "summary": "Computes the sum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\sum_j data_j\\\\) where sum is over `j` such\nthat `segment_ids[j] == i`.\n\nIf the sum is empty for a given segment ID `i`, `output[i] = 0`.\n\nNote that this op is currently only supported with jit_compile=True.\n", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.Select", "summary": "Selects elements from `x` or `y`, depending on `condition`.", "description": "The `x`, and `y` tensors must all have the same shape, and the\noutput will also have that shape.\n\nThe `condition` tensor must be a scalar if `x` and `y` are scalars.\nIf `x` and `y` are vectors or higher rank, then `condition` must be either a\nscalar, a vector with size matching the first dimension of `x`, or must have\nthe same shape as `x`.\n\nThe `condition` tensor acts as a mask that chooses, based on the value at each\nelement, whether the corresponding element / row in the output should be\ntaken from `x` (if true) or `y` (if false).\n\nIf `condition` is a vector and `x` and `y` are higher rank matrices, then\nit chooses which row (outer dimension) to copy from `x` and `y`.\nIf `condition` has the same shape as `x` and `y`, then it chooses which\nelement to copy from `x` and `y`.\n\nFor example:\n\n```python\n# 'condition' tensor is [[True, False]\n# [False, True]]\n# 't' is [[1, 2],\n# [3, 4]]\n# 'e' is [[5, 6],\n# [7, 8]]\nselect(condition, t, e) # => [[1, 6], [7, 4]]\n\n\n# 'condition' tensor is [True, False]\n# 't' is [[1, 2],\n# [3, 4]]\n# 'e' is [[5, 6],\n# [7, 8]]\nselect(condition, t, e) ==> [[1, 2],\n [7, 8]]\n\n```", "operands": [ { "name": "condition", "type": "TF_BoolTensor" }, { "name": "then_value", "type": "TF_Tensor" }, { "name": "else_value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.SelectV2", "operands": [ { "name": "condition", "type": "TF_BoolTensor" }, { "name": "then_value", "type": "TF_Tensor" }, { "name": "else_value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.SelfAdjointEigV2", "summary": "Computes the eigen decomposition of one or more square self-adjoint matrices.", "description": "Computes the eigenvalues and (optionally) eigenvectors of each inner matrix in\n`input` such that `input[..., :, :] = v[..., :, :] * diag(e[..., :])`. The eigenvalues\nare sorted in non-decreasing order.\n\n```python\n# a is a tensor.\n# e is a tensor of eigenvalues.\n# v is a tensor of eigenvectors.\ne, v = self_adjoint_eig(a)\ne = self_adjoint_eig(a, compute_v=False)\n```", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "e", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "v", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "compute_v", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Selu", "summary": "Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)`", "description": "if < 0, `scale * features` otherwise.\n\nTo be used together with\n`initializer = tf.variance_scaling_initializer(factor=1.0, mode='FAN_IN')`.\nFor correct dropout, use `tf.contrib.nn.alpha_dropout`.\n\nSee [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)", "operands": [ { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "activations", "type": "TF_FloatTensor" } ] }, { "name": "tf.SeluGrad", "summary": "Computes gradients for the scaled exponential linear (Selu) operation.", "operands": [ { "name": "gradients", "type": "TF_FloatTensor" }, { "name": "outputs", "type": "TF_FloatTensor" } ], "results": [ { "name": "backprops", "type": "TF_FloatTensor" } ] }, { "name": "tf.Send", "summary": "Sends the named tensor from send_device to recv_device.", "operands": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "send_device", "type": "StrAttr" }, { "name": "send_device_incarnation", "type": "I64Attr" }, { "name": "recv_device", "type": "StrAttr" }, { "name": "client_terminated", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SendTPUEmbeddingGradients", "summary": "Performs gradient updates of embedding tables.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "learning_rates", "type": "Variadic" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.SerializeIterator", "summary": "Converts the given `resource_handle` representing an iterator to a variant tensor.", "operands": [ { "name": "resource_handle", "type": "TF_ResourceTensor" } ], "results": [ { "name": "serialized", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "external_state_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SerializeSparse", "summary": "Serialize a `SparseTensor` into a `[3]` `Tensor` object.", "operands": [ { "name": "sparse_indices", "type": "TF_Int64Tensor" }, { "name": "sparse_values", "type": "TF_Tensor" }, { "name": "sparse_shape", "type": "TF_Int64Tensor" } ], "results": [ { "name": "serialized_sparse", "type": "TensorOf<[TF_Str, TF_Variant]>" } ] }, { "name": "tf.SetStaticDimensionBounds", "summary": "Op used to indicate to the compiler and runtime the static bounds of a tensor.", "description": "The information passed through this op can possibly be used by the compiler and\nruntime to perform certain optimizations such as more efficient DMAs. The\nbounds passed via this op should be considered advisory only, and depending on\nthe implementation, might do nothing and simply be an identity\n\n`input`: The tensor that has dynamic dimensions.\n`static_shape`: The static shape of the tensor, corresponds to the maximum bounds of each dimension.\n`output` is the input tensor with no changes done to it.\n\nExample usage:\n\ndef tpu_call(args):\n def model_fn(args):\n # do something with dynamic tensor\n\n @function.Defun(capture_resource_var_by_value=False)\n def tpu_subgraph():\n return tf.tpu.rewrite(model_fn, args)\n\n return tf.raw_ops.TPUPartitionedCall(\n args=tpu_subgraph.captured_inputs,\n Tout=[o.type for o in tpu_subgraph.definition.signature.output_arg],\n f=tpu_subgraph,\n device_ordinal=[0])\n\nstatic_shape = tf.placeholder(tf.int32, shape=([3]), name='static_size')\n\nw = tf.Variable(tf.constant([[1.0], [2.0], [3.0]]), name='w')\n\nw_dyn = tf.SetDynamicDimensionBounds(w, static_size])\ntpu_call([w_dyn])", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "static_shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Shape", "category": "Shape", "summary": "Returns the shape of a tensor.", "description": "This operation returns a 1-D integer tensor representing the shape of `input`.\n\nFor example:\n\n```\n# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]\nshape(t) ==> [2, 2, 3]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ], "attributes": [ { "name": "use32Bit", "type": "BoolAttr" } ] }, { "name": "tf.ShapeN", "summary": "Returns shape of tensors.", "description": "This operation returns N 1-D integer tensors representing shape of `input[i]s`.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf.ShardedFilename", "summary": "Generate a sharded filename. The filename is printf formatted as", "description": "%s-%05d-of-%05d, basename, shard, num_shards.", "operands": [ { "name": "basename", "type": "TF_StrTensor" }, { "name": "shard", "type": "TF_Int32Tensor" }, { "name": "num_shards", "type": "TF_Int32Tensor" } ], "results": [ { "name": "filename", "type": "TF_StrTensor" } ] }, { "name": "tf.ShuffleAndRepeatDatasetV2", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "buffer_size", "type": "TF_Int64Tensor" }, { "name": "seed", "type": "TF_Int64Tensor" }, { "name": "seed2", "type": "TF_Int64Tensor" }, { "name": "count", "type": "TF_Int64Tensor" }, { "name": "seed_generator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "reshuffle_each_iteration", "type": "DefaultValuedOptionalAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ShuffleDatasetV2", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "buffer_size", "type": "TF_Int64Tensor" }, { "name": "seed_generator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ShuffleDatasetV3", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "buffer_size", "type": "TF_Int64Tensor" }, { "name": "seed", "type": "TF_Int64Tensor" }, { "name": "seed2", "type": "TF_Int64Tensor" }, { "name": "seed_generator", "type": "TF_ResourceTensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "reshuffle_each_iteration", "type": "DefaultValuedOptionalAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.ShutdownDistributedTPU", "summary": "Shuts down a running distributed TPU system.", "description": "The op returns an error if no system is running." }, { "name": "tf.ShutdownTPUSystem", "summary": "An op that shuts down the TPU system.", "results": [ { "name": "success", "type": "TF_BoolTensor" } ] }, { "name": "tf.Sigmoid", "category": "Activation", "summary": "Computes sigmoid of `x` element-wise.", "description": "Specifically, `y = 1 / (1 + exp(-x))`.", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.SigmoidGrad", "summary": "Computes the gradient of the sigmoid of `x` wrt its input.", "description": "Specifically, `grad = dy * y * (1 - y)`, where `y = sigmoid(x)`, and\n`dy` is the corresponding input gradient.", "operands": [ { "name": "y", "type": "TF_FpOrComplexTensor" }, { "name": "dy", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Sign", "summary": "Returns an element-wise indication of the sign of a number.", "description": "`y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`.\n\nFor complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.\n\nExample usage:\n>>> tf.math.sign([0., 2., -3.])\n", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8]>" } ] }, { "name": "tf.Sin", "summary": "Computes sine of x element-wise.", "description": "Given an input tensor, this function computes sine of every\n element in the tensor. Input range is `(-inf, inf)` and\n output range is `[-1,1]`.\n\n ```python\n x = tf.constant([-float(\"inf\"), -9, -0.5, 1, 1.2, 200, 10, float(\"inf\")])\n tf.math.sin(x) ==> [nan -0.4121185 -0.47942555 0.84147096 0.9320391 -0.87329733 -0.54402107 nan]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Sinh", "summary": "Computes hyperbolic sine of x element-wise.", "description": "Given an input tensor, this function computes hyperbolic sine of every\n element in the tensor. Input range is `[-inf,inf]` and output range\n is `[-inf,inf]`.\n\n ```python\n x = tf.constant([-float(\"inf\"), -9, -0.5, 1, 1.2, 2, 10, float(\"inf\")])\n tf.math.sinh(x) ==> [-inf -4.0515420e+03 -5.2109528e-01 1.1752012e+00 1.5094614e+00 3.6268604e+00 1.1013232e+04 inf]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Size", "category": "Shape", "summary": "Returns the size of a tensor.", "description": "This operation returns an integer representing the number of elements in\n`input`.\n\nFor example:\n\n```\n# 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]\nsize(t) ==> 12\n```", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.Slice", "category": "Tensor", "summary": "Return a slice from 'input'.", "description": "The output tensor is a tensor with dimensions described by 'size'\nwhose values are extracted from 'input' starting at the offsets in\n'begin'.\n\n*Requirements*:\n 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n)", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "begin", "type": "TF_I32OrI64Tensor" }, { "name": "size", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Snapshot", "summary": "Returns a copy of the input tensor.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Softmax", "category": "Activation", "summary": "Computes softmax activations.", "description": "For each batch `i` and class `j` we have\n\n $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$", "operands": [ { "name": "logits", "type": "TF_FloatTensor" } ], "results": [ { "name": "softmax", "type": "TF_FloatTensor" } ] }, { "name": "tf.SoftmaxCrossEntropyWithLogits", "summary": "Computes softmax cross entropy cost and gradients to backpropagate.", "description": "Inputs are the logits, not probabilities.", "operands": [ { "name": "features", "type": "TF_FloatTensor" }, { "name": "labels", "type": "TF_FloatTensor" } ], "results": [ { "name": "loss", "type": "TF_FloatTensor" }, { "name": "backprop", "type": "TF_FloatTensor" } ] }, { "name": "tf.Softplus", "operands": [ { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "activations", "type": "TF_FloatTensor" } ] }, { "name": "tf.SoftplusGrad", "summary": "Computes softplus gradients for a softplus operation.", "operands": [ { "name": "gradients", "type": "TF_FloatTensor" }, { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "backprops", "type": "TF_FloatTensor" } ] }, { "name": "tf.Softsign", "summary": "Computes softsign: `features / (abs(features) + 1)`.", "operands": [ { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "activations", "type": "TF_FloatTensor" } ] }, { "name": "tf.SoftsignGrad", "summary": "Computes softsign gradients for a softsign operation.", "operands": [ { "name": "gradients", "type": "TF_FloatTensor" }, { "name": "features", "type": "TF_FloatTensor" } ], "results": [ { "name": "backprops", "type": "TF_FloatTensor" } ] }, { "name": "tf.SortListOfSparseCoreCooTensors", "summary": "An op which sorts each COO tensors in the list by which SparseCore the id will go to. This op should be used along with the ConvertToSparseCoreCsrWrappedCooTensorOp.", "operands": [ { "name": "row_ids_list", "type": "Variadic" }, { "name": "col_ids_list", "type": "Variadic" }, { "name": "gains_list", "type": "Variadic" } ], "results": [ { "name": "sorted_row_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_col_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "id_counts", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "sample_count_list", "type": "TypedArrayAttrBase" }, { "name": "col_offset_list", "type": "TypedArrayAttrBase" }, { "name": "num_replica", "type": "ConfinedAttr]>" }, { "name": "table_vocab_size", "type": "ConfinedAttr]>" }, { "name": "feature_width", "type": "ConfinedAttr]>" }, { "name": "num_sc_per_chip", "type": "ConfinedAttr]>" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.SpaceToBatch", "summary": "SpaceToBatch for 4-D tensors of type T.", "description": "This is a legacy version of the more general SpaceToBatchND.\n\nZero-pads and then rearranges (permutes) blocks of spatial data into batch.\nMore specifically, this op outputs a copy of the input tensor where values from\nthe `height` and `width` dimensions are moved to the `batch` dimension. After\nthe zero-padding, both `height` and `width` of the input must be divisible by the\nblock size.\n\nThe attr `block_size` must be greater than one. It indicates the block size.\n\n * Non-overlapping blocks of size `block_size x block size` in the height and\n width dimensions are rearranged into the batch dimension at each location.\n * The batch of the output tensor is `batch * block_size * block_size`.\n * Both height_pad and width_pad must be divisible by block_size.\n\nThe shape of the output will be:\n\n [batch*block_size*block_size, height_pad/block_size, width_pad/block_size,\n depth]\n\nSome examples:\n\n(1) For the following input of shape `[1, 2, 2, 1]` and block_size of 2:\n\n```\nx = [[[[1], [2]], [[3], [4]]]]\n```\n\nThe output tensor has shape `[4, 1, 1, 1]` and value:\n\n```\n[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]\n```\n\n(2) For the following input of shape `[1, 2, 2, 3]` and block_size of 2:\n\n```\nx = [[[[1, 2, 3], [4, 5, 6]],\n [[7, 8, 9], [10, 11, 12]]]]\n```\n\nThe output tensor has shape `[4, 1, 1, 3]` and value:\n\n```\n[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]\n```\n\n(3) For the following input of shape `[1, 4, 4, 1]` and block_size of 2:\n\n```\nx = [[[[1], [2], [3], [4]],\n [[5], [6], [7], [8]],\n [[9], [10], [11], [12]],\n [[13], [14], [15], [16]]]]\n```\n\nThe output tensor has shape `[4, 2, 2, 1]` and value:\n\n```\nx = [[[[1], [3]], [[9], [11]]],\n [[[2], [4]], [[10], [12]]],\n [[[5], [7]], [[13], [15]]],\n [[[6], [8]], [[14], [16]]]]\n```\n\n(4) For the following input of shape `[2, 2, 4, 1]` and block_size of 2:\n\n```\nx = [[[[1], [2], [3], [4]],\n [[5], [6], [7], [8]]],\n [[[9], [10], [11], [12]],\n [[13], [14], [15], [16]]]]\n```\n\nThe output tensor has shape `[8, 1, 2, 1]` and value:\n\n```\nx = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],\n [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]\n```\n\nAmong others, this operation is useful for reducing atrous convolution into\nregular convolution.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "paddings", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "block_size", "type": "ConfinedAttr]>" } ] }, { "name": "tf.SpaceToBatchND", "summary": "SpaceToBatch for N-D tensors of type T.", "description": "This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into a\ngrid of blocks of shape `block_shape`, and interleaves these blocks with the\n\"batch\" dimension (0) such that in the output, the spatial dimensions\n`[1, ..., M]` correspond to the position within the grid, and the batch\ndimension combines both the position within a spatial block and the original\nbatch position. Prior to division into blocks, the spatial dimensions of the\ninput are optionally zero padded according to `paddings`. See below for a\nprecise description.\n\nThis operation is equivalent to the following steps:\n\n1. Zero-pad the start and end of dimensions `[1, ..., M]` of the\n input according to `paddings` to produce `padded` of shape `padded_shape`.\n\n2. Reshape `padded` to `reshaped_padded` of shape:\n\n [batch] +\n [padded_shape[1] / block_shape[0],\n block_shape[0],\n ...,\n padded_shape[M] / block_shape[M-1],\n block_shape[M-1]] +\n remaining_shape\n\n3. Permute dimensions of `reshaped_padded` to produce\n `permuted_reshaped_padded` of shape:\n\n block_shape +\n [batch] +\n [padded_shape[1] / block_shape[0],\n ...,\n padded_shape[M] / block_shape[M-1]] +\n remaining_shape\n\n4. Reshape `permuted_reshaped_padded` to flatten `block_shape` into the batch\n dimension, producing an output tensor of shape:\n\n [batch * prod(block_shape)] +\n [padded_shape[1] / block_shape[0],\n ...,\n padded_shape[M] / block_shape[M-1]] +\n remaining_shape\n\nSome examples:\n\n(1) For the following input of shape `[1, 2, 2, 1]`, `block_shape = [2, 2]`, and\n `paddings = [[0, 0], [0, 0]]`:\n\n```\nx = [[[[1], [2]], [[3], [4]]]]\n```\n\nThe output tensor has shape `[4, 1, 1, 1]` and value:\n\n```\n[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]\n```\n\n(2) For the following input of shape `[1, 2, 2, 3]`, `block_shape = [2, 2]`, and\n `paddings = [[0, 0], [0, 0]]`:\n\n```\nx = [[[[1, 2, 3], [4, 5, 6]],\n [[7, 8, 9], [10, 11, 12]]]]\n```\n\nThe output tensor has shape `[4, 1, 1, 3]` and value:\n\n```\n[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]\n```\n\n(3) For the following input of shape `[1, 4, 4, 1]`, `block_shape = [2, 2]`, and\n `paddings = [[0, 0], [0, 0]]`:\n\n```\nx = [[[[1], [2], [3], [4]],\n [[5], [6], [7], [8]],\n [[9], [10], [11], [12]],\n [[13], [14], [15], [16]]]]\n```\n\nThe output tensor has shape `[4, 2, 2, 1]` and value:\n\n```\nx = [[[[1], [3]], [[9], [11]]],\n [[[2], [4]], [[10], [12]]],\n [[[5], [7]], [[13], [15]]],\n [[[6], [8]], [[14], [16]]]]\n```\n\n(4) For the following input of shape `[2, 2, 4, 1]`, block_shape = `[2, 2]`, and\n paddings = `[[0, 0], [2, 0]]`:\n\n```\nx = [[[[1], [2], [3], [4]],\n [[5], [6], [7], [8]]],\n [[[9], [10], [11], [12]],\n [[13], [14], [15], [16]]]]\n```\n\nThe output tensor has shape `[8, 1, 3, 1]` and value:\n\n```\nx = [[[[0], [1], [3]]], [[[0], [9], [11]]],\n [[[0], [2], [4]]], [[[0], [10], [12]]],\n [[[0], [5], [7]]], [[[0], [13], [15]]],\n [[[0], [6], [8]]], [[[0], [14], [16]]]]\n```\n\nAmong others, this operation is useful for reducing atrous convolution into\nregular convolution.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "block_shape", "type": "TF_I32OrI64Tensor" }, { "name": "paddings", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.SpaceToDepth", "summary": "SpaceToDepth for tensors of type T.", "description": "Rearranges blocks of spatial data, into depth. More specifically,\nthis op outputs a copy of the input tensor where values from the `height`\nand `width` dimensions are moved to the `depth` dimension.\nThe attr `block_size` indicates the input block size.\n\n * Non-overlapping blocks of size `block_size x block size` are rearranged\n into depth at each location.\n * The depth of the output tensor is `block_size * block_size * input_depth`.\n * The Y, X coordinates within each block of the input become the high order\n component of the output channel index.\n * The input tensor's height and width must be divisible by block_size.\n\nThe `data_format` attr specifies the layout of the input and output tensors\nwith the following options:\n \"NHWC\": `[ batch, height, width, channels ]`\n \"NCHW\": `[ batch, channels, height, width ]`\n \"NCHW_VECT_C\":\n `qint8 [ batch, channels / 4, height, width, 4 ]`\n\nIt is useful to consider the operation as transforming a 6-D Tensor.\ne.g. for data_format = NHWC,\n Each element in the input tensor can be specified via 6 coordinates,\n ordered by decreasing memory layout significance as:\n n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates\n within the output image, bX, bY means coordinates\n within the input block, iC means input channels).\n The output would be a transpose to the following layout:\n n,oY,oX,bY,bX,iC\n\nThis operation is useful for resizing the activations between convolutions\n(but keeping all data), e.g. instead of pooling. It is also useful for training\npurely convolutional models.\n\nFor example, given an input of shape `[1, 2, 2, 1]`, data_format = \"NHWC\" and\nblock_size = 2:\n\n```\nx = [[[[1], [2]],\n [[3], [4]]]]\n```\n\nThis operation will output a tensor of shape `[1, 1, 1, 4]`:\n\n```\n[[[[1, 2, 3, 4]]]]\n```\n\nHere, the input has a batch of 1 and each batch element has shape `[2, 2, 1]`,\nthe corresponding output will have a single element (i.e. width and height are\nboth 1) and will have a depth of 4 channels (1 * block_size * block_size).\nThe output element shape is `[1, 1, 4]`.\n\nFor an input tensor with larger depth, here of shape `[1, 2, 2, 3]`, e.g.\n\n```\nx = [[[[1, 2, 3], [4, 5, 6]],\n [[7, 8, 9], [10, 11, 12]]]]\n```\n\nThis operation, for block_size of 2, will return the following tensor of shape\n`[1, 1, 1, 12]`\n\n```\n[[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]\n```\n\nSimilarly, for the following input of shape `[1 4 4 1]`, and a block size of 2:\n\n```\nx = [[[[1], [2], [5], [6]],\n [[3], [4], [7], [8]],\n [[9], [10], [13], [14]],\n [[11], [12], [15], [16]]]]\n```\n\nthe operator will return the following tensor of shape `[1 2 2 4]`:\n\n```\nx = [[[[1, 2, 3, 4],\n [5, 6, 7, 8]],\n [[9, 10, 11, 12],\n [13, 14, 15, 16]]]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "block_size", "type": "ConfinedAttr]>" }, { "name": "data_format", "type": "DefaultValuedOptionalAttr, \"NHWC\">" } ] }, { "name": "tf.SparseAdd", "summary": "Adds two `SparseTensor` objects to produce another `SparseTensor`.", "description": "The input `SparseTensor` objects' indices are assumed ordered in standard\nlexicographic order. If this is not the case, before this step run\n`SparseReorder` to restore index ordering.\n\nBy default, if two values sum to zero at some index, the output `SparseTensor`\nwould still include that particular location in its index, storing a zero in the\ncorresponding value slot. To override this, callers can specify `thresh`,\nindicating that if the sum has a magnitude strictly smaller than `thresh`, its\ncorresponding value and index would then not be included. In particular,\n`thresh == 0` (default) means everything is kept and actual thresholding happens\nonly for a positive value.\n\nIn the following shapes, `nnz` is the count after taking `thresh` into account.", "operands": [ { "name": "a_indices", "type": "TF_Int64Tensor" }, { "name": "a_values", "type": "TF_NumberTensor" }, { "name": "a_shape", "type": "TF_Int64Tensor" }, { "name": "b_indices", "type": "TF_Int64Tensor" }, { "name": "b_values", "type": "TF_NumberTensor" }, { "name": "b_shape", "type": "TF_Int64Tensor" }, { "name": "thresh", "type": "TF_IntOrFpTensor" } ], "results": [ { "name": "sum_indices", "type": "TF_Int64Tensor" }, { "name": "sum_values", "type": "TF_NumberTensor" }, { "name": "sum_shape", "type": "TF_Int64Tensor" } ] }, { "name": "tf.SparseFillEmptyRows", "summary": "Fills empty rows in the input 2-D `SparseTensor` with a default value.", "description": "The input `SparseTensor` is represented via the tuple of inputs\n(`indices`, `values`, `dense_shape`). The output `SparseTensor` has the\nsame `dense_shape` but with indices `output_indices` and values\n`output_values`.\n\nThis op inserts a single entry for every row that doesn't have any values.\nThe index is created as `[row, 0, ..., 0]` and the inserted value\nis `default_value`.\n\nFor example, suppose `sp_input` has shape `[5, 6]` and non-empty values:\n\n [0, 1]: a\n [0, 3]: b\n [2, 0]: c\n [3, 1]: d\n\nRows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values:\n\n [0, 1]: a\n [0, 3]: b\n [1, 0]: default_value\n [2, 0]: c\n [3, 1]: d\n [4, 0]: default_value\n\nThe output `SparseTensor` will be in row-major order and will have the\nsame shape as the input.\n\nThis op also returns an indicator vector shaped `[dense_shape[0]]` such that\n\n empty_row_indicator[i] = True iff row i was an empty row.\n\nAnd a reverse index map vector shaped `[indices.shape[0]]` that is used during\nbackpropagation,\n\n reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]", "operands": [ { "name": "indices", "type": "TF_Int64Tensor" }, { "name": "values", "type": "TF_Tensor" }, { "name": "dense_shape", "type": "TF_Int64Tensor" }, { "name": "default_value", "type": "TF_Tensor" } ], "results": [ { "name": "output_indices", "type": "TF_Int64Tensor" }, { "name": "output_values", "type": "TF_Tensor" }, { "name": "empty_row_indicator", "type": "TF_BoolTensor" }, { "name": "reverse_index_map", "type": "TF_Int64Tensor" } ] }, { "name": "tf.SparseMatMul", "summary": "Multiply matrix \"a\" by matrix \"b\".", "description": "The inputs must be two-dimensional matrices and the inner dimension of \"a\" must\nmatch the outer dimension of \"b\". Both \"a\" and \"b\" must be `Tensor`s not\n`SparseTensor`s. This op is optimized for the case where at least one of \"a\" or\n\"b\" is sparse, in the sense that they have a large proportion of zero values.\nThe breakeven for using this versus a dense matrix multiply on one platform was\n30% zero values in the sparse matrix.\n\nThe gradient computation of this operation will only take advantage of sparsity\nin the input gradient when that gradient comes from a Relu.", "operands": [ { "name": "a", "type": "TensorOf<[TF_Bfloat16, TF_Float32]>" }, { "name": "b", "type": "TensorOf<[TF_Bfloat16, TF_Float32]>" } ], "results": [ { "name": "product", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedOptionalAttr" }, { "name": "transpose_b", "type": "DefaultValuedOptionalAttr" }, { "name": "a_is_sparse", "type": "DefaultValuedOptionalAttr" }, { "name": "b_is_sparse", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseReduceSum", "summary": "Computes the sum of elements across dimensions of a SparseTensor.", "description": "This Op takes a SparseTensor and is the sparse counterpart to\n`tf.reduce_sum()`. In particular, this Op also returns a dense `Tensor`\ninstead of a sparse one.\n\nReduces `sp_input` along the dimensions given in `reduction_axes`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained\nwith length 1.\n\nIf `reduction_axes` has no entries, all dimensions are reduced, and a tensor\nwith a single element is returned. Additionally, the axes can be negative,\nwhich are interpreted according to the indexing rules in Python.", "operands": [ { "name": "input_indices", "type": "TF_Int64Tensor" }, { "name": "input_values", "type": "TF_NumberTensor" }, { "name": "input_shape", "type": "TF_Int64Tensor" }, { "name": "reduction_axes", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseReshape", "summary": "Reshapes a SparseTensor to represent values in a new dense shape.", "description": "This operation has the same semantics as reshape on the represented dense\ntensor. The `input_indices` are recomputed based on the requested `new_shape`.\n\nIf one component of `new_shape` is the special value -1, the size of that\ndimension is computed so that the total dense size remains constant. At\nmost one component of `new_shape` can be -1. The number of dense elements\nimplied by `new_shape` must be the same as the number of dense elements\noriginally implied by `input_shape`.\n\nReshaping does not affect the order of values in the SparseTensor.\n\nIf the input tensor has rank `R_in` and `N` non-empty values, and `new_shape`\nhas length `R_out`, then `input_indices` has shape `[N, R_in]`,\n`input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and\n`output_shape` has length `R_out`.", "operands": [ { "name": "input_indices", "type": "TF_Int64Tensor" }, { "name": "input_shape", "type": "TF_Int64Tensor" }, { "name": "new_shape", "type": "TF_Int64Tensor" } ], "results": [ { "name": "output_indices", "type": "TF_Int64Tensor" }, { "name": "output_shape", "type": "TF_Int64Tensor" } ] }, { "name": "tf.SparseSegmentMean", "summary": "Computes the mean along sparse segments of a tensor.", "description": "See `tf.sparse.segment_sum` for usage examples.\n\nLike `SegmentMean`, but `segment_ids` can have rank less than `data`'s first\ndimension, selecting a subset of dimension 0, specified by `indices`.", "operands": [ { "name": "data", "type": "TF_FloatTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "sparse_gradient", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseSegmentMeanGrad", "summary": "Computes gradients for SparseSegmentMean.", "description": "Returns tensor \"output\" with same shape as grad, except for dimension 0 whose\nvalue is output_dim0.", "operands": [ { "name": "grad", "type": "TF_FloatTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "output_dim0", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.SparseSegmentMeanWithNumSegments", "summary": "Computes the mean along sparse segments of a tensor.", "description": "Like `SparseSegmentMean`, but allows missing ids in `segment_ids`. If an id is\nmissing, the `output` tensor at that position will be zeroed.\n\nRead\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.", "operands": [ { "name": "data", "type": "TF_FloatTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "sparse_gradient", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseSegmentSqrtN", "summary": "Computes the sum along sparse segments of a tensor divided by the sqrt of N.", "description": "N is the size of the segment being reduced.\n\nSee `tf.sparse.segment_sum` for usage examples.", "operands": [ { "name": "data", "type": "TF_FloatTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "sparse_gradient", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseSegmentSqrtNGrad", "summary": "Computes gradients for SparseSegmentSqrtN.", "description": "Returns tensor \"output\" with same shape as grad, except for dimension 0 whose\nvalue is output_dim0.", "operands": [ { "name": "grad", "type": "TF_FloatTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "output_dim0", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.SparseSegmentSqrtNWithNumSegments", "summary": "Computes the sum along sparse segments of a tensor divided by the sqrt of N.", "description": "N is the size of the segment being reduced.\n\nLike `SparseSegmentSqrtN`, but allows missing ids in `segment_ids`. If an id is\nmissing, the `output` tensor at that position will be zeroed.\n\nRead\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.", "operands": [ { "name": "data", "type": "TF_FloatTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "sparse_gradient", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseSegmentSum", "summary": "Computes the sum along sparse segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nLike `SegmentSum`, but `segment_ids` can have rank less than `data`'s first\ndimension, selecting a subset of dimension 0, specified by `indices`.\n\nFor example:\n\n```python\nc = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])\n\n# Select two rows, one segment.\ntf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))\n# => [[0 0 0 0]]\n\n# Select two rows, two segment.\ntf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))\n# => [[ 1 2 3 4]\n# [-1 -2 -3 -4]]\n\n# Select all rows, two segments.\ntf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))\n# => [[0 0 0 0]\n# [5 6 7 8]]\n\n# Which is equivalent to:\ntf.segment_sum(c, tf.constant([0, 0, 1]))\n```", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ], "attributes": [ { "name": "sparse_gradient", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseSoftmaxCrossEntropyWithLogits", "summary": "Computes softmax cross entropy cost and gradients to backpropagate.", "description": "Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept\na matrix of label probabilities, but rather a single label per row\nof features. This label is considered to have probability 1.0 for the\ngiven row.\n\nInputs are the logits, not probabilities.", "operands": [ { "name": "features", "type": "TF_FloatTensor" }, { "name": "labels", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "loss", "type": "TF_FloatTensor" }, { "name": "backprop", "type": "TF_FloatTensor" } ] }, { "name": "tf.SparseTensorDenseMatMul", "summary": "Multiply SparseTensor (of rank 2) \"A\" by dense matrix \"B\".", "description": "No validity checking is performed on the indices of A. However, the following\ninput format is recommended for optimal behavior:\n\nif adjoint_a == false:\n A should be sorted in lexicographically increasing order. Use SparseReorder\n if you're not sure.\nif adjoint_a == true:\n A should be sorted in order of increasing dimension 1 (i.e., \"column major\"\n order instead of \"row major\" order).", "operands": [ { "name": "a_indices", "type": "TF_I32OrI64Tensor" }, { "name": "a_values", "type": "TF_Tensor" }, { "name": "a_shape", "type": "TF_Int64Tensor" }, { "name": "b", "type": "TF_Tensor" } ], "results": [ { "name": "product", "type": "TF_Tensor" } ], "attributes": [ { "name": "adjoint_a", "type": "DefaultValuedOptionalAttr" }, { "name": "adjoint_b", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SparseToDense", "summary": "Converts a sparse representation into a dense tensor.", "description": "Builds an array `dense` with shape `output_shape` such that\n\n```\n# If sparse_indices is scalar\ndense[i] = (i == sparse_indices ? sparse_values : default_value)\n\n# If sparse_indices is a vector, then for each i\ndense[sparse_indices[i]] = sparse_values[i]\n\n# If sparse_indices is an n by d matrix, then for each i in [0, n)\ndense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]\n```\n\nAll other values in `dense` are set to `default_value`. If `sparse_values` is a\nscalar, all sparse indices are set to this single value.\n\nIndices should be sorted in lexicographic order, and indices must not\ncontain any repeats. If `validate_indices` is true, these properties\nare checked during execution.", "operands": [ { "name": "sparse_indices", "type": "TF_I32OrI64Tensor" }, { "name": "output_shape", "type": "TF_I32OrI64Tensor" }, { "name": "sparse_values", "type": "TF_Tensor" }, { "name": "default_value", "type": "TF_Tensor" } ], "results": [ { "name": "dense", "type": "TF_Tensor" } ], "attributes": [ { "name": "validate_indices", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Split", "summary": "Splits a tensor into `num_split` tensors along one dimension.", "operands": [ { "name": "split_dim", "type": "TF_Int32Tensor" }, { "name": "value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf.SplitV", "summary": "Splits a tensor into `num_split` tensors along one dimension.", "operands": [ { "name": "value", "type": "TF_Tensor" }, { "name": "size_splits", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Int8 ]>" }, { "name": "split_dim", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf.Sqrt", "summary": "Computes square root of x element-wise.", "description": "I.e., \\\\(y = \\sqrt{x} = x^{1/2}\\\\).", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.SqrtGrad", "summary": "Computes the gradient for the sqrt of `x` wrt its input.", "description": "Specifically, `grad = dy * 0.5 / y`, where `y = sqrt(x)`, and `dy`\nis the corresponding input gradient.", "operands": [ { "name": "y", "type": "TF_FpOrComplexTensor" }, { "name": "dy", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Square", "summary": "Computes square of x element-wise.", "description": "I.e., \\\\(y = x * x = x^2\\\\).", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.SquaredDifference", "summary": "Returns conj(x - y)(x - y) element-wise.", "description": "*NOTE*: `SquaredDifference` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64]>" } ] }, { "name": "tf.Squeeze", "summary": "Removes dimensions of size 1 from the shape of a tensor.", "description": "Given a tensor `input`, this operation returns a tensor of the same type with\nall dimensions of size 1 removed. If you don't want to remove all size 1\ndimensions, you can remove specific size 1 dimensions by specifying\n`axis`.\n\nFor example:\n\n```\n# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]\nshape(squeeze(t)) ==> [2, 3]\n```\n\nOr, to remove specific size 1 dimensions:\n\n```\n# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]\nshape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "squeeze_dims", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.StackCloseV2", "summary": "Delete the stack from its resource container.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" } ] }, { "name": "tf.StackPopV2", "summary": "Pop the element at the top of the stack.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "results": [ { "name": "elem", "type": "TF_Tensor" } ] }, { "name": "tf.StackPushV2", "summary": "Push an element onto the stack.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "elem", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "swap_memory", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.StackV2", "summary": "A stack that produces elements in first-in last-out order.", "operands": [ { "name": "max_size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "handle", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "elem_type", "type": "TypeAttr" }, { "name": "stack_name", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.StatefulPartitionedCall", "summary": "returns `f(inputs)`, where `f`'s body is placed and partitioned.", "description": "Asynchronously executes a function, potentially across multiple devices but\nwithin a single process. The kernel places and partitions a given function's\nunderlying graph, and executes each of the partitioned subgraphs as a function.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "f", "type": "FlatSymbolRefAttr" }, { "name": "config", "type": "StrAttr" }, { "name": "config_proto", "type": "StrAttr" }, { "name": "executor_type", "type": "StrAttr" } ] }, { "name": "tf.StatefulStandardNormalV2", "summary": "Outputs random values from a normal distribution.", "description": "The generated values will have mean 0 and standard deviation 1.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "algorithm", "type": "TF_Int64Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatefulTruncatedNormal", "summary": "Outputs random values from a truncated normal distribution.", "description": "The generated values follow a normal distribution with mean 0 and standard\ndeviation 1, except that values whose magnitude is more than 2 standard\ndeviations from the mean are dropped and re-picked.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "algorithm", "type": "TF_Int64Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatefulUniform", "summary": "Outputs random values from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[0, 1)`. The\nlower bound 0 is included in the range, while the upper bound 1 is excluded.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "algorithm", "type": "TF_Int64Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatefulUniformFullInt", "summary": "Outputs random integers from a uniform distribution.", "description": "The generated values are uniform integers covering the whole range of `dtype`.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "algorithm", "type": "TF_Int64Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Int32, TF_Int64, TF_Uint32, TF_Uint64]>" } ] }, { "name": "tf.StatefulUniformInt", "summary": "Outputs random integers from a uniform distribution.", "description": "The generated values are uniform integers in the range `[minval, maxval)`.\nThe lower bound `minval` is included in the range, while the upper bound\n`maxval` is excluded.\n\nThe random integers are slightly biased unless `maxval - minval` is an exact\npower of two. The bias is small for values of `maxval - minval` significantly\nsmaller than the range of the output (either `2^32` or `2^64`).", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" }, { "name": "algorithm", "type": "TF_Int64Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "minval", "type": "TensorOf<[TF_Int32, TF_Int64, TF_Uint32, TF_Uint64]>" }, { "name": "maxval", "type": "TensorOf<[TF_Int32, TF_Int64, TF_Uint32, TF_Uint64]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Int32, TF_Int64, TF_Uint32, TF_Uint64]>" } ] }, { "name": "tf.StatelessMultinomial", "summary": "Draws samples from a multinomial distribution.", "operands": [ { "name": "logits", "type": "TF_IntOrFpTensor" }, { "name": "num_samples", "type": "TF_Int32Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.StatelessParameterizedTruncatedNormal", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" }, { "name": "means", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "stddevs", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "minvals", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "maxvals", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ] }, { "name": "tf.StatelessRandomBinomial", "summary": "Outputs deterministic pseudorandom random numbers from a binomial distribution.", "description": "Outputs random values from a binomial distribution.\n\nThe outputs are a deterministic function of `shape`, `seed`, `counts`, and `probs`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" }, { "name": "counts", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" }, { "name": "probs", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ] }, { "name": "tf.StatelessRandomGammaV2", "summary": "Outputs deterministic pseudorandom random numbers from a gamma distribution.", "description": "Outputs random values from a gamma distribution.\n\nThe outputs are a deterministic function of `shape`, `seed`, and `alpha`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" }, { "name": "alpha", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64 ]>" } ] }, { "name": "tf.StatelessRandomGetAlg", "summary": "Picks the best counter-based RNG algorithm based on device.", "description": "This op picks the best counter-based RNG algorithm based on device.", "results": [ { "name": "alg", "type": "TF_Int32Tensor" } ] }, { "name": "tf.StatelessRandomGetKeyCounter", "summary": "Scrambles seed into key and counter, using the best algorithm based on device.", "description": "This op scrambles a shape-[2] seed into a key and a counter, both needed by counter-based RNG algorithms. The scrambing uses the best algorithm based on device. The scrambling is opaque but approximately satisfies the property that different seed results in different key/counter pair (which will in turn result in different random numbers).", "operands": [ { "name": "seed", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" } ] }, { "name": "tf.StatelessRandomGetKeyCounterAlg", "summary": "Picks the best algorithm based on device, and scrambles seed into key and counter.", "description": "This op picks the best counter-based RNG algorithm based on device, and scrambles a shape-[2] seed into a key and a counter, both needed by the counter-based algorithm. The scrambling is opaque but approximately satisfies the property that different seed results in different key/counter pair (which will in turn result in different random numbers).", "operands": [ { "name": "seed", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" }, { "name": "alg", "type": "TF_Int32Tensor" } ] }, { "name": "tf.StatelessRandomNormal", "summary": "Outputs deterministic pseudorandom values from a normal distribution.", "description": "The generated values will have mean 0 and standard deviation 1.\n\nThe outputs are a deterministic function of `shape` and `seed`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatelessRandomNormalV2", "summary": "Outputs deterministic pseudorandom values from a normal distribution.", "description": "The generated values will have mean 0 and standard deviation 1.\n\nThe outputs are a deterministic function of `shape`, `key`, `counter` and `alg`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" }, { "name": "alg", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatelessRandomPoisson", "summary": "Outputs deterministic pseudorandom random numbers from a Poisson distribution.", "description": "Outputs random values from a Poisson distribution.\n\nThe outputs are a deterministic function of `shape`, `seed`, and `lam`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" }, { "name": "lam", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Float16, TF_Float32, TF_Float64, TF_Int32, TF_Int64 ]>" } ] }, { "name": "tf.StatelessRandomUniform", "summary": "Outputs deterministic pseudorandom random values from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[0, 1)`. The\nlower bound 0 is included in the range, while the upper bound 1 is excluded.\n\nThe outputs are a deterministic function of `shape` and `seed`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatelessRandomUniformFullInt", "summary": "Outputs deterministic pseudorandom random integers from a uniform distribution.", "description": "The generated values are uniform integers covering the whole range of `dtype`.\n\nThe outputs are a deterministic function of `shape` and `seed`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Uint32, TF_Uint64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Uint32, TF_Uint64 ]>" } ] }, { "name": "tf.StatelessRandomUniformFullIntV2", "summary": "Outputs deterministic pseudorandom random integers from a uniform distribution.", "description": "The generated values are uniform integers covering the whole range of `dtype`.\n\nThe outputs are a deterministic function of `shape`, `key`, `counter` and `alg`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" }, { "name": "alg", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Uint32, TF_Uint64 ]>" } ] }, { "name": "tf.StatelessRandomUniformInt", "summary": "Outputs deterministic pseudorandom random integers from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[minval, maxval)`.\n\nThe outputs are a deterministic function of `shape`, `seed`, `minval`, and `maxval`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" }, { "name": "minval", "type": "TF_I32OrI64Tensor" }, { "name": "maxval", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.StatelessRandomUniformIntV2", "summary": "Outputs deterministic pseudorandom random integers from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[minval, maxval)`.\n\nThe outputs are a deterministic function of `shape`, `key`, `counter`, `alg`, `minval` and `maxval`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" }, { "name": "alg", "type": "TF_Int32Tensor" }, { "name": "minval", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Uint32, TF_Uint64 ]>" }, { "name": "maxval", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Uint32, TF_Uint64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Int32, TF_Int64, TF_Uint32, TF_Uint64 ]>" } ] }, { "name": "tf.StatelessRandomUniformV2", "summary": "Outputs deterministic pseudorandom random values from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[0, 1)`. The\nlower bound 0 is included in the range, while the upper bound 1 is excluded.\n\nThe outputs are a deterministic function of `shape`, `key`, `counter` and `alg`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" }, { "name": "alg", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatelessTruncatedNormal", "summary": "Outputs deterministic pseudorandom values from a truncated normal distribution.", "description": "The generated values follow a normal distribution with mean 0 and standard\ndeviation 1, except that values whose magnitude is more than 2 standard\ndeviations from the mean are dropped and re-picked.\n\nThe outputs are a deterministic function of `shape` and `seed`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "seed", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StatelessTruncatedNormalV2", "summary": "Outputs deterministic pseudorandom values from a truncated normal distribution.", "description": "The generated values follow a normal distribution with mean 0 and standard\ndeviation 1, except that values whose magnitude is more than 2 standard\ndeviations from the mean are dropped and re-picked.\n\nThe outputs are a deterministic function of `shape`, `key`, `counter` and `alg`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "key", "type": "TF_Uint64Tensor" }, { "name": "counter", "type": "TF_Uint64Tensor" }, { "name": "alg", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ] }, { "name": "tf.StaticRegexFullMatch", "summary": "Check if the input matches the regex pattern.", "description": "The input is a string tensor of any shape. The pattern is the\nregular expression to be matched with every element of the input tensor.\nThe boolean values (True or False) of the output tensor indicate\nif the input matches the regex pattern provided.\n\nThe pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax)", "operands": [ { "name": "input", "type": "TF_StrTensor" } ], "results": [ { "name": "output", "type": "TF_BoolTensor" } ], "attributes": [ { "name": "pattern", "type": "StrAttr" } ] }, { "name": "tf.StopGradient", "summary": "Stops gradient computation.", "description": "When executed in a graph, this op outputs its input tensor as-is.\n\nWhen building ops to compute gradients, this op prevents the contribution of\nits inputs to be taken into account. Normally, the gradient generator adds ops\nto a graph to compute the derivatives of a specified 'loss' by recursively\nfinding out inputs that contributed to its computation. If you insert this op\nin the graph it inputs are masked from the gradient generator. They are not\ntaken into account for computing gradients.\n\nThis is useful any time you want to compute a value with TensorFlow but need\nto pretend that the value was a constant. For example, the softmax function\nfor a vector x can be written as\n\n```python\n\n def softmax(x):\n numerator = tf.exp(x)\n denominator = tf.reduce_sum(numerator)\n return numerator / denominator\n```\n\nThis however is susceptible to overflow if the values in x are large. An\nalternative more stable way is to subtract the maximum of x from each of the\nvalues.\n\n```python\n\n def stable_softmax(x):\n z = x - tf.reduce_max(x)\n numerator = tf.exp(z)\n denominator = tf.reduce_sum(numerator)\n return numerator / denominator\n```\n\nHowever, when we backprop through the softmax to x, we dont want to backprop\nthrough the `tf.reduce_max(x)` (if the max values are not unique then the\ngradient could flow to the wrong input) calculation and treat that as a\nconstant. Therefore, we should write this out as\n\n```python\n\n def stable_softmax(x):\n z = x - tf.stop_gradient(tf.reduce_max(x))\n numerator = tf.exp(z)\n denominator = tf.reduce_sum(numerator)\n return numerator / denominator\n```\n\nSome other examples include:\n\n* The *EM* algorithm where the *M-step* should not involve backpropagation\n through the output of the *E-step*.\n* Contrastive divergence training of Boltzmann machines where, when\n differentiating the energy function, the training must not backpropagate\n through the graph that generated the samples from the model.\n* Adversarial training, where no backprop should happen through the adversarial\n example generation process.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.StoreMinibatchStatisticsInFdo", "summary": "Store the number of IDs and unique IDs in an FDO table.", "operands": [ { "name": "program_key", "type": "TF_StrTensor" }, { "name": "max_ids", "type": "TF_Int32Tensor" }, { "name": "max_uniques", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "sample_count", "type": "ConfinedAttr]>" }, { "name": "num_replica", "type": "ConfinedAttr]>" }, { "name": "feature_width", "type": "ConfinedAttr]>" }, { "name": "num_sc_per_chip", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" }, { "name": "mini_batch_splits", "type": "StrAttr" } ] }, { "name": "tf.StridedSlice", "summary": "Return a strided slice from `input`.", "description": "Note, most python users will want to use the Python `Tensor.__getitem__`\nor `Variable.__getitem__` rather than this op directly.\n\nThe goal of this op is to produce a new tensor with a subset of\nthe elements from the `n` dimensional `input` tensor. The subset is chosen using\na sequence of `m` sparse range specifications encoded into the arguments\nof this function. Note, in some cases\n`m` could be equal to `n`, but this need not be the case. Each\nrange specification entry can be one of the following:\n\n- An ellipsis (...). Ellipses are used to imply zero or more\n dimensions of full-dimension selection and are produced using\n `ellipsis_mask`. For example, `foo[...]` is the identity slice.\n\n- A new axis. This is used to insert a new shape=1 dimension and is\n produced using `new_axis_mask`. For example, `foo[:, ...]` where\n `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor.\n\n\n- A range `begin:end:stride`. This is used to specify how much to choose from\n a given dimension. `stride` can be any integer but 0. `begin` is an integer\n which represents the index of the first value to select while `end` represents\n the index of the last value to select. The number of values selected in each\n dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`.\n `begin` and `end` can be negative where `-1` is the last element, `-2` is\n the second to last. `begin_mask` controls whether to replace the explicitly\n given `begin` with an implicit effective value of `0` if `stride > 0` and\n `-1` if `stride < 0`. `end_mask` is analogous but produces the number\n required to create the largest open interval. For example, given a shape\n `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do\n not assume this is equivalent to `foo[0:-1]` which has an effective `begin`\n and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the\n first dimension of a tensor while dropping the last two (in the original\n order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`.\n\n- A single index. This is used to keep only elements that have a given\n index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a\n shape `(6,)` tensor. This is encoded in `begin` and `end` and\n `shrink_axis_mask`.\n\nEach conceptual range specification is encoded in the op's argument. This\nencoding is best understand by considering a non-trivial example. In\nparticular,\n`foo[1, 2:4, None, ..., :-3:-1, :]` will be encoded as\n\n```\nbegin = [1, 2, x, x, 0, x] # x denotes don't care (usually 0)\nend = [2, 4, x, x, -3, x]\nstrides = [1, 1, x, x, -1, 1]\nbegin_mask = 1<<4 | 1<<5 = 48\nend_mask = 1<<5 = 32\nellipsis_mask = 1<<3 = 8\nnew_axis_mask = 1<<2 = 4\nshrink_axis_mask = 1<<0 = 1\n```\n\nIn this case if `foo.shape` is (5, 5, 5, 5, 5, 5) the final shape of\nthe slice becomes (2, 1, 5, 5, 2, 5).\nLet us walk step by step through each argument specification.\n\n1. The first argument in the example slice is turned into `begin = 1` and\n`end = begin + 1 = 2`. To disambiguate from the original spec `2:4` we\nalso set the appropriate bit in `shrink_axis_mask`.\n\n2. `2:4` is contributes 2, 4, 1 to begin, end, and stride. All masks have\nzero bits contributed.\n\n3. None is a synonym for `tf.newaxis`. This means insert a dimension of size 1\ndimension in the final shape. Dummy values are contributed to begin,\nend and stride, while the new_axis_mask bit is set.\n\n4. `...` grab the full ranges from as many dimensions as needed to\nfully specify a slice for every dimension of the input shape.\n\n5. `:-3:-1` shows the use of negative indices. A negative index `i` associated\nwith a dimension that has shape `s` is converted to a positive index\n`s + i`. So `-1` becomes `s-1` (i.e. the last element). This conversion\nis done internally so begin, end and strides receive x, -3, and -1.\nThe appropriate begin_mask bit is set to indicate the start range is the\nfull range (ignoring the x).\n\n6. `:` indicates that the entire contents of the corresponding dimension\nis selected. This is equivalent to `::` or `0::1`. begin, end, and strides\nreceive 0, 0, and 1, respectively. The appropriate bits in `begin_mask` and\n`end_mask` are also set.\n\n*Requirements*:\n `0 != strides[i] for i in [0, m)`\n `ellipsis_mask must be a power of two (only one ellipsis)`", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "begin", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" }, { "name": "end", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" }, { "name": "strides", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "begin_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "end_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "ellipsis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "new_axis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "shrink_axis_mask", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.StridedSliceGrad", "summary": "Returns the gradient of `StridedSlice`.", "description": "Since `StridedSlice` cuts out pieces of its `input` which is size\n`shape`, its gradient will have the same shape (which is passed here\nas `shape`). The gradient will be zero in any element that the slice\ndoes not select.\n\nArguments are the same as StridedSliceGrad with the exception that\n`dy` is the input gradient to be propagated and `shape` is the\nshape of `StridedSlice`'s `input`.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" }, { "name": "begin", "type": "TF_I32OrI64Tensor" }, { "name": "end", "type": "TF_I32OrI64Tensor" }, { "name": "strides", "type": "TF_I32OrI64Tensor" }, { "name": "dy", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "begin_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "end_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "ellipsis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "new_axis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "shrink_axis_mask", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.StringFormat", "summary": "Formats a string template using a list of tensors.", "description": "Formats a string template using a list of tensors, pretty-printing tensor summaries.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_StrTensor" } ], "attributes": [ { "name": "strtemplate", "type": "DefaultValuedStrAttr" }, { "name": "placeholder", "type": "DefaultValuedStrAttr" }, { "name": "summarize", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.StringJoin", "summary": "Joins the strings in the given list of string tensors into one tensor;", "description": "with the given separator (default is an empty separator).\n\nExamples:\n\n>>> s = [\"hello\", \"world\", \"tensorflow\"]\n>>> tf.strings.join(s, \" \")\n", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_StrTensor" } ], "attributes": [ { "name": "separator", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.StringStrip", "summary": "Strip leading and trailing whitespaces from the Tensor.", "description": "Examples:\n\n>>> tf.strings.strip([\"\\nTensorFlow\", \" The python library \"]).numpy()\narray([b'TensorFlow', b'The python library'], dtype=object)", "operands": [ { "name": "input", "type": "TF_StrTensor" } ], "results": [ { "name": "output", "type": "TF_StrTensor" } ] }, { "name": "tf.StringToHashBucketFast", "summary": "Converts each string in the input Tensor to its hash mod by a number of buckets.", "description": "The hash function is deterministic on the content of the string within the\nprocess and will never change. However, it is not suitable for cryptography.\nThis function may be used when CPU time is scarce and inputs are trusted or\nunimportant. There is a risk of adversaries constructing inputs that all hash\nto the same bucket. To prevent this problem, use a strong hash function with\n`tf.string_to_hash_bucket_strong`.\n\nExamples:\n\n>>> tf.strings.to_hash_bucket_fast([\"Hello\", \"TensorFlow\", \"2.x\"], 3).numpy()\narray([0, 2, 2])", "operands": [ { "name": "input", "type": "TF_StrTensor" } ], "results": [ { "name": "output", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "num_buckets", "type": "ConfinedAttr]>" } ] }, { "name": "tf.Sub", "summary": "Returns x - y element-wise.", "description": "*NOTE*: `Subtract` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.Sum", "summary": "Computes the sum of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TF_NumberTensor" }, { "name": "reduction_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SummaryWriter", "summary": "Returns a handle to be used to access a summary writer.", "description": "The summary writer is an in-graph resource which can be used by ops to write\nsummaries to event files.\n\nwriter: the summary writer resource. Scalar handle.", "results": [ { "name": "writer", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "shared_name", "type": "StrAttr" }, { "name": "container", "type": "StrAttr" } ] }, { "name": "tf.Svd", "summary": "Computes the singular value decompositions of one or more matrices.", "description": "Computes the SVD of each inner matrix in `input` such that\n`input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])`\n\n```python\n# a is a tensor containing a batch of matrices.\n# s is a tensor of singular values for each matrix.\n# u is the tensor containing the left singular vectors for each matrix.\n# v is the tensor containing the right singular vectors for each matrix.\ns, u, v = svd(a)\ns, _, _ = svd(a, compute_uv=False)\n```", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "s", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "u", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" }, { "name": "v", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "compute_uv", "type": "DefaultValuedOptionalAttr" }, { "name": "full_matrices", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.SymbolicGradient", "summary": "Computes the gradient function for function f via backpropagation.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "f", "type": "SymbolRefAttr" } ] }, { "name": "tf.TakeDataset", "summary": "Creates a dataset that contains `count` elements from the `input_dataset`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "count", "type": "TF_Int64Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TakeWhileDataset", "summary": "Creates a dataset that stops iteration when predicate` is false.", "description": "The `predicate` function must return a scalar boolean and accept the\nfollowing arguments:\n\n* One tensor for each component of an element of `input_dataset`.\n* One tensor for each value in `other_arguments`.", "operands": [ { "name": "input_dataset", "type": "TF_VariantTensor" }, { "name": "other_arguments", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "predicate", "type": "SymbolRefAttr" }, { "name": "output_types", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Tan", "summary": "Computes tan of x element-wise.", "description": "Given an input tensor, this function computes tangent of every\n element in the tensor. Input range is `(-inf, inf)` and\n output range is `(-inf, inf)`. If input lies outside the boundary, `nan`\n is returned.\n\n ```python\n x = tf.constant([-float(\"inf\"), -9, -0.5, 1, 1.2, 200, 10000, float(\"inf\")])\n tf.math.tan(x) ==> [nan 0.45231566 -0.5463025 1.5574077 2.572152 -1.7925274 0.32097113 nan]\n ```", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Tanh", "category": "Activation", "summary": "Computes hyperbolic tangent of `x` element-wise.", "description": "Given an input tensor, this function computes hyperbolic tangent of every\n element in the tensor. Input range is `[-inf, inf]` and\n output range is `[-1,1]`.\n\n >>> x = tf.constant([-float(\"inf\"), -5, -0.5, 1, 1.2, 2, 3, float(\"inf\")])\n >>> tf.math.tanh(x)\n ", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "y", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.TanhGrad", "summary": "Computes the gradient for the tanh of `x` wrt its input.", "description": "Specifically, `grad = dy * (1 - y*y)`, where `y = tanh(x)`, and `dy`\nis the corresponding input gradient.", "operands": [ { "name": "y", "type": "TF_FpOrComplexTensor" }, { "name": "dy", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.TensorArrayCloseV3", "summary": "Delete the TensorArray from its resource container.", "description": "This enables the user to close and release the resource in the middle\nof a step/run.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" } ] }, { "name": "tf.TensorArrayConcatV3", "summary": "Concat the elements from the TensorArray into value `value`.", "description": "Takes `T` elements of shapes\n\n ```\n (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...)\n ```\n\nand concatenates them into a Tensor of shape:\n\n ```\n (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)\n ```\n\nAll elements must have the same shape (excepting the first dimension).", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "value", "type": "TF_Tensor" }, { "name": "lengths", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "element_shape_except0", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorArrayGatherV3", "summary": "Gather specific elements from the TensorArray into output `value`.", "description": "All elements selected by `indices` must have the same shape.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "value", "type": "TF_Tensor" } ], "attributes": [ { "name": "element_shape", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorArrayGradV3", "summary": "Creates a TensorArray for storing the gradients of values in the given handle.", "description": "If the given TensorArray gradient already exists, returns a reference to it.\n\nLocks the size of the original TensorArray by disabling its dynamic size flag.\n\n**A note about the input flow_in:**\n\nThe handle flow_in forces the execution of the gradient lookup to occur\nonly after certain other operations have occurred. For example, when\nthe forward TensorArray is dynamically sized, writes to this TensorArray\nmay resize the object. The gradient TensorArray is statically sized based\non the size of the forward TensorArray when this operation executes.\nFurthermore, the size of the forward TensorArray is frozen by this call.\nAs a result, the flow is used to ensure that the call to generate the gradient\nTensorArray only happens after all writes are executed.\n\nIn the case of dynamically sized TensorArrays, gradient computation should\nonly be performed on read operations that have themselves been chained via\nflow to occur only after all writes have executed. That way the final size\nof the forward TensorArray is known when this operation is called.\n\n**A note about the source attribute:**\n\nTensorArray gradient calls use an accumulator TensorArray object. If\nmultiple gradients are calculated and run in the same session, the multiple\ngradient nodes may accidentally flow through the same accumulator TensorArray.\nThis double counts and generally breaks the TensorArray gradient flow.\n\nThe solution is to identify which gradient call this particular\nTensorArray gradient is being called in. This is performed by identifying\na unique string (e.g. \"gradients\", \"gradients_1\", ...) from the input\ngradient Tensor's name. This string is used as a suffix when creating\nthe TensorArray gradient object here (the attribute `source`).\n\nThe attribute `source` is added as a suffix to the forward TensorArray's\nname when performing the creation / lookup, so that each separate gradient\ncalculation gets its own TensorArray accumulator.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "grad_handle", "type": "TF_ResourceTensor" }, { "name": "flow_out", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "source", "type": "StrAttr" } ] }, { "name": "tf.TensorArrayReadV3", "summary": "Read an element from the TensorArray into output `value`.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "index", "type": "TF_Int32Tensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "value", "type": "TF_Tensor" } ] }, { "name": "tf.TensorArrayScatterV3", "summary": "Scatter the data from the input value into specific TensorArray elements.", "description": "`indices` must be a vector, its length must match the first dim of `value`.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "value", "type": "TF_Tensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "flow_out", "type": "TF_Float32Tensor" } ] }, { "name": "tf.TensorArraySizeV3", "summary": "Get the current size of the TensorArray.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "size", "type": "TF_Int32Tensor" } ] }, { "name": "tf.TensorArraySplitV3", "summary": "Split the data from the input value into TensorArray elements.", "description": "Assuming that `lengths` takes on values\n\n ```\n (n0, n1, ..., n(T-1))\n ```\n\nand that `value` has shape\n\n ```\n (n0 + n1 + ... + n(T-1) x d0 x d1 x ...),\n ```\n\nthis splits values into a TensorArray with T tensors.\n\nTensorArray index t will be the subtensor of values with starting position\n\n ```\n (n0 + n1 + ... + n(t-1), 0, 0, ...)\n ```\n\nand having size\n\n ```\n nt x d0 x d1 x ...\n ```", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "value", "type": "TF_Tensor" }, { "name": "lengths", "type": "TF_Int64Tensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "flow_out", "type": "TF_Float32Tensor" } ] }, { "name": "tf.TensorArrayV3", "summary": "An array of Tensors of given size.", "description": "Write data via Write and read via Read or Pack.", "operands": [ { "name": "size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "flow", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "dtype", "type": "TypeAttr" }, { "name": "element_shape", "type": "DefaultValuedOptionalAttr" }, { "name": "dynamic_size", "type": "DefaultValuedOptionalAttr" }, { "name": "clear_after_read", "type": "DefaultValuedOptionalAttr" }, { "name": "identical_element_shapes", "type": "DefaultValuedOptionalAttr" }, { "name": "tensor_array_name", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorArrayWriteV3", "summary": "Push an element onto the tensor_array.", "operands": [ { "name": "handle", "type": "TF_ResourceTensor" }, { "name": "index", "type": "TF_Int32Tensor" }, { "name": "value", "type": "TF_Tensor" }, { "name": "flow_in", "type": "TF_Float32Tensor" } ], "results": [ { "name": "flow_out", "type": "TF_Float32Tensor" } ] }, { "name": "tf.TensorListConcatV2", "summary": "Concats all tensors in the list along the 0th dimension.", "description": "Requires that all tensors have the same shape except the first dimension.\n\ninput_handle: The input list.\nelement_shape: The shape of the uninitialized elements in the list. If the first\n dimension is not -1, it is assumed that all list elements have the same\n leading dim.\nleading_dims: The list of leading dims of uninitialized list elements. Used if\n the leading dim of input_handle.element_shape or the element_shape input arg\n is not already set.\ntensor: The concated result.\nlengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient.", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "element_shape", "type": "TF_I32OrI64Tensor" }, { "name": "leading_dims", "type": "TF_Int64Tensor" } ], "results": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "lengths", "type": "TF_Int64Tensor" } ] }, { "name": "tf.TensorListElementShape", "summary": "The shape of the elements of the given list, as a tensor.", "description": "input_handle: the list\n element_shape: the shape of elements of the list", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" } ], "results": [ { "name": "element_shape", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.TensorListFromTensor", "summary": "Creates a TensorList which, when stacked, has the value of `tensor`.", "description": "Each tensor in the result list corresponds to one row of the input tensor.\n\ntensor: The input tensor.\noutput_handle: The list.", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "element_shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output_handle", "type": "TF_VariantTensor" } ] }, { "name": "tf.TensorListGather", "summary": "Creates a Tensor by indexing into the TensorList.", "description": "Each row in the produced Tensor corresponds to the element in the TensorList\nspecified by the given index (see `tf.gather`).\n\ninput_handle: The input tensor list.\nindices: The indices used to index into the list.\nvalues: The tensor.", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "element_shape", "type": "TF_Int32Tensor" } ], "results": [ { "name": "values", "type": "TF_Tensor" } ] }, { "name": "tf.TensorListGetItem", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "index", "type": "TF_Int32Tensor" }, { "name": "element_shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "item", "type": "TF_Tensor" } ] }, { "name": "tf.TensorListLength", "summary": "Returns the number of tensors in the input tensor list.", "description": "input_handle: the input list\nlength: the number of tensors in the list", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" } ], "results": [ { "name": "length", "type": "TF_Int32Tensor" } ] }, { "name": "tf.TensorListPopBack", "summary": "Returns the last element of the input list as well as a list with all but that element.", "description": "Fails if the list is empty.\n\ninput_handle: the input list\ntensor: the withdrawn last element of the list\nelement_dtype: the type of elements in the list\nelement_shape: the shape of the output tensor", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "element_shape", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output_handle", "type": "TF_VariantTensor" }, { "name": "tensor", "type": "TF_Tensor" } ] }, { "name": "tf.TensorListPushBack", "summary": "Returns a list which has the passed-in `Tensor` as last element and the other elements of the given list in `input_handle`.", "description": "tensor: The tensor to put on the list.\ninput_handle: The old list.\noutput_handle: A list with the elements of the old list followed by tensor.\nelement_dtype: the type of elements in the list.\nelement_shape: a shape compatible with that of elements in the list.", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "tensor", "type": "TF_Tensor" } ], "results": [ { "name": "output_handle", "type": "TF_VariantTensor" } ] }, { "name": "tf.TensorListReserve", "summary": "List of the given size with empty elements.", "description": "element_shape: the shape of the future elements of the list\nnum_elements: the number of elements to reserve\nhandle: the output list\nelement_dtype: the desired type of elements in the list.", "operands": [ { "name": "element_shape", "type": "TF_I32OrI64Tensor" }, { "name": "num_elements", "type": "TF_Int32Tensor" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ] }, { "name": "tf.TensorListResize", "summary": "Resizes the list.", "description": "input_handle: the input list\nsize: size of the output list", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output_handle", "type": "TF_VariantTensor" } ] }, { "name": "tf.TensorListScatterIntoExistingList", "summary": "Scatters tensor at indices in an input list.", "description": "Each member of the TensorList corresponds to one row of the input tensor,\nspecified by the given index (see `tf.gather`).\n\ninput_handle: The list to scatter into.\ntensor: The input tensor.\nindices: The indices used to index into the list.\noutput_handle: The TensorList.", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "tensor", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output_handle", "type": "TF_VariantTensor" } ] }, { "name": "tf.TensorListSetItem", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "index", "type": "TF_Int32Tensor" }, { "name": "item", "type": "TF_Tensor" } ], "results": [ { "name": "output_handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "resize_if_index_out_of_bounds", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorListStack", "summary": "Stacks all tensors in the list.", "description": "Requires that all tensors have the same shape.\n\ninput_handle: the input list\ntensor: the gathered result\nnum_elements: optional. If not -1, the number of elements in the list.", "operands": [ { "name": "input_handle", "type": "TF_VariantTensor" }, { "name": "element_shape", "type": "TF_Int32Tensor" } ], "results": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "num_elements", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorScatterAdd", "summary": "Adds sparse `updates` to an existing tensor according to `indices`.", "description": "This operation creates a new tensor by adding sparse `updates` to the passed\nin `tensor`.\nThis operation is very similar to `tf.compat.v1.scatter_nd_add`, except that the\nupdates are added onto an existing tensor (as opposed to a variable). If the\nmemory for the existing tensor cannot be re-used, a copy is made and updated.\n\n`indices` is an integer tensor containing indices into a new tensor of shape\n`tensor.shape`. The last dimension of `indices` can be at most the rank of\n`tensor.shape`:\n\n```\nindices.shape[-1] <= tensor.shape.rank\n```\n\nThe last dimension of `indices` corresponds to indices into elements\n(if `indices.shape[-1] = tensor.shape.rank`) or slices\n(if `indices.shape[-1] < tensor.shape.rank`) along dimension\n`indices.shape[-1]` of `tensor.shape`. `updates` is a tensor with shape\n\n```\nindices.shape[:-1] + tensor.shape[indices.shape[-1]:]\n```\n\nThe simplest form of `tensor_scatter_nd_add` is to add individual elements to a\ntensor by index. For example, say we want to add 4 elements in a rank-1\ntensor with 8 elements.\n\nIn Python, this scatter add operation would look like this:\n\n>>> indices = tf.constant([[4], [3], [1], [7]])\n>>> updates = tf.constant([9, 10, 11, 12])\n>>> tensor = tf.ones([8], dtype=tf.int32)\n>>> updated = tf.tensor_scatter_nd_add(tensor, indices, updates)\n>>> updated\n\n\nWe can also, insert entire slices of a higher rank tensor all at once. For\nexample, if we wanted to insert two slices in the first dimension of a\nrank-3 tensor with two matrices of new values.\n\nIn Python, this scatter add operation would look like this:\n\n>>> indices = tf.constant([[0], [2]])\n>>> updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],\n... [7, 7, 7, 7], [8, 8, 8, 8]],\n... [[5, 5, 5, 5], [6, 6, 6, 6],\n... [7, 7, 7, 7], [8, 8, 8, 8]]])\n>>> tensor = tf.ones([4, 4, 4],dtype=tf.int32)\n>>> updated = tf.tensor_scatter_nd_add(tensor, indices, updates)\n>>> updated\n\n\n\nIf `indices` contains any out-of-bound indices, depending on\n`bad_indices_policy`, the op will either return an error or ignore the\nout-of-bound indices. `bad_indices_policy` can be one of the following values:\n1. \"\" or \"DEFAULT\": raises on CPU and ignore on GPU. This is because\n historically on CPU and GPU we handle errors in different ways, and for\n backward compatibility we keep the default behavior.\n2. \"ERROR\": raises error; GPU does not support this value.\n3. \"IGNORE\": ignore the bad indices; supported on both CPU and GPU.", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorScatterMax", "summary": "Apply a sparse update to a tensor taking the element-wise maximum.", "description": "Returns a new tensor copied from `tensor` whose values are element-wise maximum between\ntensor and updates according to the indices.\n\n>>> tensor = [0, 0, 0, 0, 0, 0, 0, 0]\n>>> indices = [[1], [4], [5]]\n>>> updates = [1, -1, 1]\n>>> tf.tensor_scatter_nd_max(tensor, indices, updates).numpy()\narray([0, 1, 0, 0, 0, 1, 0, 0], dtype=int32)\n\nRefer to `tf.tensor_scatter_nd_update` for more details.", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorScatterMin", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorScatterSub", "summary": "Subtracts sparse `updates` from an existing tensor according to `indices`.", "description": "This operation creates a new tensor by subtracting sparse `updates` from the\npassed in `tensor`.\nThis operation is very similar to `tf.scatter_nd_sub`, except that the updates\nare subtracted from an existing tensor (as opposed to a variable). If the memory\nfor the existing tensor cannot be re-used, a copy is made and updated.\n\n`indices` is an integer tensor containing indices into a new tensor of shape\n`shape`. The last dimension of `indices` can be at most the rank of `shape`:\n\n indices.shape[-1] <= shape.rank\n\nThe last dimension of `indices` corresponds to indices into elements\n(if `indices.shape[-1] = shape.rank`) or slices\n(if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of\n`shape`. `updates` is a tensor with shape\n\n indices.shape[:-1] + shape[indices.shape[-1]:]\n\nThe simplest form of tensor_scatter_sub is to subtract individual elements\nfrom a tensor by index. For example, say we want to insert 4 scattered elements\nin a rank-1 tensor with 8 elements.\n\nIn Python, this scatter subtract operation would look like this:\n\n```python\n indices = tf.constant([[4], [3], [1], [7]])\n updates = tf.constant([9, 10, 11, 12])\n tensor = tf.ones([8], dtype=tf.int32)\n updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)\n print(updated)\n```\n\nThe resulting tensor would look like this:\n\n [1, -10, 1, -9, -8, 1, 1, -11]\n\nWe can also, insert entire slices of a higher rank tensor all at once. For\nexample, if we wanted to insert two slices in the first dimension of a\nrank-3 tensor with two matrices of new values.\n\nIn Python, this scatter add operation would look like this:\n\n```python\n indices = tf.constant([[0], [2]])\n updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],\n [7, 7, 7, 7], [8, 8, 8, 8]],\n [[5, 5, 5, 5], [6, 6, 6, 6],\n [7, 7, 7, 7], [8, 8, 8, 8]]])\n tensor = tf.ones([4, 4, 4],dtype=tf.int32)\n updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)\n print(updated)\n```\n\nThe resulting tensor would look like this:\n\n [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],\n [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],\n [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],\n [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]\n\nNote that on CPU, if an out of bound index is found, an error is returned.\nOn GPU, if an out of bound index is found, the index is ignored.", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorScatterUpdate", "summary": "Scatter `updates` into an existing tensor according to `indices`.", "description": "This operation creates a new tensor by applying sparse `updates` to the passed\nin `tensor`.\nThis operation is very similar to `tf.scatter_nd`, except that the updates are\nscattered onto an existing tensor (as opposed to a zero-tensor). If the memory\nfor the existing tensor cannot be re-used, a copy is made and updated.\n\nIf `indices` contains duplicates, then we pick the last update for the index.\n\n**WARNING**: There are some GPU specific semantics for this operation.\n- If an out of bound index is found, the index is ignored.\n- The order in which updates are applied is nondeterministic, so the output\nwill be nondeterministic if `indices` contains duplicates.\n\n`indices` is an integer tensor containing indices into a new tensor of shape\n`shape`.\n\n* `indices` must have at least 2 axes: `(num_updates, index_depth)`.\n* The last axis of `indices` is how deep to index into `tensor` so this index\n depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim`\n\nif `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements.\nif `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input\n`tensor`.\n\nEach `update` has a rank of `tensor.rank - indices.shape[-1]`.\nThe overall shape of `updates` is:\n\n```\nindices.shape[:-1] + tensor.shape[indices.shape[-1]:]\n```\n\nIf `indices` contains any out-of-bound indices, depending on\n`bad_indices_policy`, the op will either return an error or ignore the\nout-of-bound indices. `bad_indices_policy` can be one of the following values:\n1. \"\" or \"DEFAULT\": raises on CPU and ignore on GPU. This is because\n historically on CPU and GPU we handle errors in different ways, and for\n backward compatibility we keep the default behavior.\n2. \"ERROR\": raises error; GPU does not support this value.\n3. \"IGNORE\": ignore the bad indices; supported on both CPU and GPU.\n\nFor usage examples see the python [tf.tensor_scatter_nd_update](\nhttps://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function", "operands": [ { "name": "tensor", "type": "TF_Tensor" }, { "name": "indices", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64, TF_Uint16 ]>" }, { "name": "updates", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "bad_indices_policy", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorSliceDataset", "summary": "Creates a dataset that emits each dim-0 slice of `components` once.", "operands": [ { "name": "components", "type": "Variadic" } ], "results": [ { "name": "handle", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "output_shapes", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "is_files", "type": "DefaultValuedOptionalAttr" }, { "name": "metadata", "type": "DefaultValuedOptionalAttr" }, { "name": "replicate_on_split", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TensorStridedSliceUpdate", "summary": "Assign `value` to the sliced l-value reference of `input`.", "description": "The values of `value` are assigned to the positions in the tensor `input` that\nare selected by the slice parameters. The slice parameters `begin` `end`\n`strides` etc. work exactly as in `StridedSlice`.\n\nNOTE this op currently does not support broadcasting and so `value`'s shape\nmust be exactly the shape produced by the slice of `input`.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "begin", "type": "TF_I32OrI64Tensor" }, { "name": "end", "type": "TF_I32OrI64Tensor" }, { "name": "strides", "type": "TF_I32OrI64Tensor" }, { "name": "value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "begin_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "end_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "ellipsis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "new_axis_mask", "type": "DefaultValuedOptionalAttr" }, { "name": "shrink_axis_mask", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Tile", "summary": "Constructs a tensor by tiling a given tensor.", "description": "This operation creates a new tensor by replicating `input` `multiples` times.\nThe output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements,\nand the values of `input` are replicated `multiples[i]` times along the 'i'th\ndimension. For example, tiling `[a b c d]` by `[2]` produces\n`[a b c d a b c d]`.\n\n>>> a = tf.constant([[1,2,3],[4,5,6]], tf.int32)\n>>> b = tf.constant([1,2], tf.int32)\n>>> tf.tile(a, b)\n\n>>> c = tf.constant([2,1], tf.int32)\n>>> tf.tile(a, c)\n\n>>> d = tf.constant([2,2], tf.int32)\n>>> tf.tile(a, d)\n", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "multiples", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.Timestamp", "summary": "Provides the time since epoch in seconds.", "description": "Returns the timestamp as a `float64` for seconds since the Unix epoch.\n\nCommon usages include:\n* Logging\n* Providing a random number seed\n* Debugging graph execution\n* Generating timing information, mainly through comparison of timestamps\n\nNote: In graph mode, the timestamp is computed when the op is executed,\nnot when it is added to the graph. In eager mode, the timestamp is computed\nwhen the op is eagerly executed.", "results": [ { "name": "ts", "type": "TF_Float64Tensor" } ] }, { "name": "tf.ToBool", "summary": "Converts a tensor to a scalar predicate.", "description": "Converts a tensor to a scalar predicate with the following rules:\n\n- For 0D tensors, truthiness is determined by comparing against a \"zero\"\n value. For numerical types it is the obvious zero. For strings it is the\n empty string.\n\n- For >0D tensors, truthiness is determined by looking at the number of\n elements. If has zero elements, then the result is false. Otherwise the\n result is true.\n\nThis matches the behavior of If and While for determining if a tensor counts\nas true/false for a branch condition.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "I1Tensor" } ] }, { "name": "tf.TopKUnique", "summary": "Returns the TopK unique values in the array in sorted order.", "description": "The running time is proportional to the product of K and the input\nsize. Sorting the whole array is more efficient for sufficiently large\nvalues of K. The median-of-medians algorithm is probably faster, but\ndifficult to implement efficiently in XLA. If there are fewer than K\nunique numbers (not NANs), the results are padded with negative\ninfinity. NaNs are never returned. Subnormal numbers are flushed to\nzero. If an element appears at multiple indices, the highest index is\nreturned. If a TopK element never appears in the input due to padding\nvalues, the indices are padded with negative one. If a padding value\nappears in the input and padding is needed, the highest index of the\npadding value will be returned. The semantics are not the same as\nkth_order_statistic.", "operands": [ { "name": "input", "type": "TF_Float32Tensor" } ], "results": [ { "name": "topk", "type": "TF_Float32Tensor" }, { "name": "topk_indices", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "k", "type": "I64Attr" } ] }, { "name": "tf.TopKV2", "summary": "Finds values and indices of the `k` largest elements for the last dimension.", "description": "If the input is a vector (rank-1), finds the `k` largest entries in the vector\nand outputs their values and indices as vectors. Thus `values[j]` is the\n`j`-th largest entry in `input`, and its index is `indices[j]`.\n\nFor matrices (resp. higher rank input), computes the top `k` entries in each\nrow (resp. vector along the last dimension). Thus,\n\n values.shape = indices.shape = input.shape[:-1] + [k]\n\nIf two elements are equal, the lower-index element appears first.", "operands": [ { "name": "input", "type": "TF_IntOrFpTensor" }, { "name": "k", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" } ], "results": [ { "name": "values", "type": "TF_IntOrFpTensor" }, { "name": "indices", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" } ], "attributes": [ { "name": "sorted", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TopKWithUnique", "summary": "Returns the TopK values in the array in sorted order.", "description": "This is a combination of MakeUnique and TopKUnique. The returned top-K will\nhave its lower bits replaced by iota, thus it will be close to the original\nvalue but not exactly the same. The running time is proportional to the product\nof K and the input size. NaNs are never returned. Subnormal numbers are flushed\nto zero.", "operands": [ { "name": "input", "type": "TF_Float32Tensor" } ], "results": [ { "name": "topk", "type": "TF_Float32Tensor" }, { "name": "topk_indices", "type": "TF_Int32Tensor" } ], "attributes": [ { "name": "k", "type": "I64Attr" } ] }, { "name": "tf.TPUAnnotateTensorsWithDynamicShape", "summary": "Placeholder op which takes the output of TPUCopyWithDynamicShapeOp and pass\nthem to the following tpu ops.", "description": "This op serves as an annotation for the dynamic shaped tensor and will be\nremoved during the bridge rewrite.", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "tpu_tensors", "type": "Variadic" } ] }, { "name": "tf.TPUCompilationResult", "summary": "Returns the result of a TPU compilation.", "description": "This operation returns the result of a TPU compilation as a serialized\nCompilationResultProto, which holds a status and an error message if an error\noccurred during compilation.", "results": [ { "name": "output", "type": "TF_StrTensor" } ] }, { "name": "tf.TPUCompileMlirAndExecute", "summary": "Op that compiles a computation in MLIR into a TPU program, and loads and executes it on a TPU device.", "description": "For the internal use of the TPU compiler.\n\n'static_shapes' are tensors specifying the maximum dimension sizes for the tensors specified in `dynamic_operands`.\n'args' are inputs to the TPU computation.\n'operands_with_static_shape' are the indices of the operands that have a maximal static shape specified.\n'mlir_module' is a serialized MLIR module with a `main` function that contains\ntarget computation.\n'metadata' is a serialized TPUCompileMetadataProto describing the shapes and\ntypes of the inputs to the computation, as well as a mapping onto the TPU pod\ntopology.\n'producer_name' is a string describing the name of the framework that add support for running this portion of the model on TPUs.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "static_shapes", "type": "Variadic" } ], "results": [ { "name": "rendezvous_key_base", "type": "TF_Tensor" }, { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "operands_with_static_shape", "type": "OptionalAttr>" }, { "name": "mlir_module", "type": "DefaultValuedStrAttr" }, { "name": "metadata", "type": "StrAttr" }, { "name": "producer_name", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.TPUCompileSucceededAssert", "summary": "Asserts that compilation succeeded.", "description": "This op produces no output and closes the device during failure to ensure all\npending device interactions fail.\n\n'compilation_status' is a serialized CompilationResultProto.", "operands": [ { "name": "compilation_status", "type": "TF_StrTensor" } ] }, { "name": "tf.TPUCopyWithDynamicShape", "summary": "Op that copies host tensors to device with bounded dynamic shape support.", "description": "This op copies the padded tensor on cpu to TPU without the padded data. `tensors`\nis a list of cpu tensors with padded data. `unpadded_sizes` is a list of shape\ntensors which describes unpadded size of each dimension for each cpu tensor.\nThe size of the `unpadded_sizes` should be the same as `tensors`. They are both\non host. `tpu_tensors` are list of tpu device tensors without the padded data.\n`tpu_tensors` also has the same size of the `tensors` and the shapes of\n`tpu_tensors` are determined by the `unpadded_sizes`.", "operands": [ { "name": "tensors", "type": "Variadic" }, { "name": "unpadded_sizes", "type": "Variadic" } ], "results": [ { "name": "tpu_tensors", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.TPUCopyWithLayout", "summary": "Op that copies host tensor to device with specified layout.", "description": "For internal use only.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "layout", "type": "TF_Int64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.TPUDummyInput", "summary": "Generates a zero-valued tensor for use as a dummy input to a TPU.", "description": "For the internal use of the TF2XLA bridge in the XLA Broadcast pass. This op", "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Float32]>" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" } ] }, { "name": "tf.TPUEmbeddingActivations", "summary": "An op enabling differentiation of TPU Embeddings.", "description": "This op simply returns its first input, which is assumed to have been sliced\nfrom the Tensors returned by TPUEmbeddingDequeueActivations. The presence of\nthis op, and its first argument being a trainable Variable, enables automatic\ndifferentiation of graphs containing embeddings via the TPU Embedding Python\nlibraries.", "operands": [ { "name": "embedding_variable", "type": "TF_Float32Tensor" }, { "name": "sliced_activations", "type": "TF_Float32Tensor" } ], "results": [ { "name": "output", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "table_id", "type": "ConfinedAttr]>" }, { "name": "lookup_id", "type": "ConfinedAttr]>" } ] }, { "name": "tf.TPUExecute", "summary": "Op that loads and executes a TPU program on a TPU device.", "description": "For the internal use of the distributed TPU compiler.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "key", "type": "TF_StrTensor" } ], "results": [ { "name": "results", "type": "Variadic" } ] }, { "name": "tf.TPUExecuteAndUpdateVariables", "summary": "Op that executes a program with optional in-place variable updates.", "description": "It (optionally) reads device variables, loads and executes a TPU program on a\nTPU device, and then (optionally) in-place updates variables using the program\noutputs, as specified in attributes device_var_reads_indices (program input\nindices from directly reading variables) and device_var_updates_indices (program\noutput indices used to update variables, -1 means no-update/read-only). Such\nprogram outputs are consumed by these variables will not appear in the op\noutput. For the internal use of the distributed TPU compiler.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "key", "type": "TF_StrTensor" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device_var_reads_indices", "type": "TypedArrayAttrBase" }, { "name": "device_var_updates_indices", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.TPUGetLayoutOp", "summary": "Op that retrieves the layout of an input or output determined by TPUCompile.", "description": "For internal use only.", "operands": [ { "name": "cache_key", "type": "TF_StrTensor" } ], "results": [ { "name": "layout", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "index", "type": "I64Attr" }, { "name": "is_output", "type": "BoolAttr" } ] }, { "name": "tf.TPUOrdinalSelector", "summary": "A TPU core selector Op.", "description": "This Op produces a set of TPU cores (for warm-up) or a single TPU core\n(for regular inference) to execute the TPU program on. The output is\nconsumed by TPUPartitionedCall.", "results": [ { "name": "device_ordinals", "type": "TF_Int32Tensor" } ] }, { "name": "tf.TPUPartitionedCall", "summary": "Calls a function placed on a specified TPU device.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "device_ordinal", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "f", "type": "SymbolRefAttr" }, { "name": "autotuner_thresh", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TPUPartitionedInput", "summary": "An op that groups a list of partitioned inputs together. This op", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "partition_dim", "type": "DefaultValuedOptionalAttr" }, { "name": "_XlaSharding", "type": "OptionalAttr" }, { "name": "_XlaShardingV2", "type": "OptionalAttr" } ] }, { "name": "tf.TPUPartitionedInputV2", "summary": "An op that groups a list of partitioned inputs together. Supports ND sharding.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "partition_dims", "type": "TypedArrayAttrBase" }, { "name": "is_packed", "type": "DefaultValuedOptionalAttr" }, { "name": "_XlaSharding", "type": "OptionalAttr" }, { "name": "_XlaShardingV2", "type": "OptionalAttr" } ] }, { "name": "tf.TPUPartitionedOutput", "summary": "An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned", "description": "outputs outside the XLA computation.", "operands": [ { "name": "inputs", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "partition_dim", "type": "DefaultValuedOptionalAttr" }, { "name": "_XlaSharding", "type": "OptionalAttr" }, { "name": "_XlaShardingV2", "type": "OptionalAttr" } ] }, { "name": "tf.TPUPartitionedOutputV2", "summary": "An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned", "description": "outputs outside the XLA computation. Supports ND sharding.", "operands": [ { "name": "inputs", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "partition_dims", "type": "TypedArrayAttrBase" }, { "name": "_XlaSharding", "type": "OptionalAttr" }, { "name": "_XlaShardingV2", "type": "OptionalAttr" } ] }, { "name": "tf.TPUReplicatedInput", "summary": "Connects N inputs to an N-way replicated TPU computation.", "description": "This operation holds a replicated input to a `tpu.replicate()` computation subgraph.\nEach replicated input has the same shape and type alongside the output.\n\nFor example:\n```\n%a = \"tf.opA\"()\n%b = \"tf.opB\"()\n%replicated_input = \"tf.TPUReplicatedInput\"(%a, %b)\n%computation = \"tf.Computation\"(%replicated_input)\n```\nThe above computation has a replicated input of two replicas.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "is_mirrored_variable", "type": "DefaultValuedOptionalAttr" }, { "name": "index", "type": "DefaultValuedOptionalAttr" }, { "name": "is_packed", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TPUReplicatedOutput", "summary": "Connects N outputs from an N-way replicated TPU computation.", "description": "This operation holds a replicated output from a `tpu.replicate()` computation subgraph.\nEach replicated output has the same shape and type alongside the input.\n\nFor example:\n```\n%computation = \"tf.Computation\"()\n%replicated_output:2 = \"tf.TPUReplicatedOutput\"(%computation)\n```\nThe above computation has a replicated output of two replicas.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ] }, { "name": "tf.TPUReplicateMetadata", "summary": "Metadata indicating how the TPU computation should be replicated.", "description": "This operation holds the metadata common to operations of a `tpu.replicate()` computation subgraph.", "attributes": [ { "name": "num_replicas", "type": "ConfinedAttr]>" }, { "name": "num_cores_per_replica", "type": "DefaultValuedOptionalAttr" }, { "name": "topology", "type": "DefaultValuedOptionalAttr" }, { "name": "use_tpu", "type": "DefaultValuedOptionalAttr" }, { "name": "device_assignment", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "computation_shape", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "host_compute_core", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "padding_map", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "step_marker_location", "type": "DefaultValuedOptionalAttr" }, { "name": "allow_soft_placement", "type": "DefaultValuedOptionalAttr" }, { "name": "use_spmd_for_xla_partitioning", "type": "DefaultValuedOptionalAttr" }, { "name": "use_shardy_partitioner", "type": "DefaultValuedOptionalAttr" }, { "name": "tpu_compile_options_proto", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TPUReshardVariables", "summary": "Op that reshards on-device TPU variables to specified state.", "description": "Op that reshards on-device TPU variables to specified state. Internal use only.\n\nThe sharding state is represented as the key of the compilation that generated\nthe sharding/unsharding programs along with the main program. new_format_key\nspecifies the desired state, and format_state_var is the current state of the\nvariables.", "operands": [ { "name": "vars", "type": "Variadic" }, { "name": "new_format_key", "type": "TF_StrTensor" }, { "name": "format_state_var", "type": "TF_ResourceTensor" } ] }, { "name": "tf.TPURoundRobin", "summary": "Round-robin load balancing on TPU cores.", "description": "A load balancing op that round-robins among TPU cores.\n\nThis op round-robins between the integers in [0, NumTPUCoresVisiblePerHost]. It\nis useful for interfacing with TensorFlow ops that take as input a TPU core on\nwhich to execute computations, such as `TPUPartitionedCall`.\n\ndevice_ordinal: An integer in [0, NumTPUCoresVisiblePerHost].", "results": [ { "name": "device_ordinal", "type": "TF_Int32Tensor" } ] }, { "name": "tf.Transpose", "category": "Transform", "summary": "Shuffle dimensions of x according to a permutation.", "description": "The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy:\n `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]`", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "perm", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" } ] }, { "name": "tf.TridiagonalMatMul", "summary": "Calculate product with tridiagonal matrix.", "description": "Calculates product of two matrices, where left matrix is a tridiagonal matrix.", "operands": [ { "name": "superdiag", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" }, { "name": "maindiag", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" }, { "name": "subdiag", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" }, { "name": "rhs", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" } ] }, { "name": "tf.TridiagonalSolve", "summary": "Solves tridiagonal systems of equations.", "description": "Solves tridiagonal systems of equations.\n Supports batch dimensions and multiple right-hand sides per each left-hand\n side.\n On CPU, solution is computed via Gaussian elimination with or without partial\n pivoting, depending on `partial_pivoting` attribute. On GPU, Nvidia's cuSPARSE\n library is used: https://docs.nvidia.com/cuda/cusparse/index.html#gtsv\n Partial pivoting is not yet supported by XLA backends.", "operands": [ { "name": "diagonals", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" }, { "name": "rhs", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Complex128, TF_Complex64, TF_Float32, TF_Float64 ]>" } ], "attributes": [ { "name": "partial_pivoting", "type": "DefaultValuedOptionalAttr" }, { "name": "perturb_singular", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TruncateDiv", "summary": "Returns x / y element-wise, rounded towards zero.", "description": "Truncation designates that negative numbers will round fractional quantities\ntoward zero. I.e. -7 / 5 = -1. This matches C semantics but it is different\nthan Python semantics. See `FloorDiv` for a division function that matches\nPython Semantics.\n\n*NOTE*: `TruncateDiv` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" }, { "name": "y", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "z", "type": "TensorOf<[TF_Bfloat16, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.TruncatedNormal", "summary": "Outputs random values from a truncated normal distribution.", "description": "The generated values follow a normal distribution with mean 0 and standard\ndeviation 1, except that values whose magnitude is more than 2 standard\ndeviations from the mean are dropped and re-picked.", "operands": [ { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.TruncateMod", "summary": "Returns element-wise remainder of division. This emulates C semantics in that", "description": "the result here is consistent with a truncating divide. E.g. `truncate(x / y) *\ny + truncate_mod(x, y) = x`.\n\n*NOTE*: `TruncateMod` supports broadcasting. More about broadcasting\n[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)", "operands": [ { "name": "x", "type": "TF_FpOrI32OrI64Tensor" }, { "name": "y", "type": "TF_FpOrI32OrI64Tensor" } ], "results": [ { "name": "z", "type": "TF_FpOrI32OrI64Tensor" } ] }, { "name": "tf.UncompressElement", "summary": "Uncompresses a compressed dataset element.", "operands": [ { "name": "compressed", "type": "TF_VariantTensor" } ], "results": [ { "name": "components", "type": "Variadic" } ] }, { "name": "tf.UniformDequantize", "summary": "Perform dequantization on the quantized Tensor `input`.", "description": "Given quantized `input` which was quantized using `scales` and `zero_points`, performs dequantization using the formula:\ndequantized_data = (quantized_data - zero_point) * scale.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Qint32, TF_Qint8, TF_Quint8 ]>" }, { "name": "scales", "type": "TF_Float32Tensor" }, { "name": "zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "quantization_min_val", "type": "I64Attr" }, { "name": "quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantize", "summary": "Perform quantization on Tensor `input`.", "description": "Given `input`, `scales` and `zero_points`, performs quantization using the formula:\nquantized_data = floor(input_data * (1.0f / scale) + 0.5f) + zero_point", "operands": [ { "name": "input", "type": "TF_Float32Tensor" }, { "name": "scales", "type": "TF_Float32Tensor" }, { "name": "zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Qint32, TF_Qint8, TF_Quint8 ]>" } ], "attributes": [ { "name": "quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "quantization_min_val", "type": "I64Attr" }, { "name": "quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantizedAdd", "summary": "Perform quantized add of quantized Tensor `lhs` and quantized Tensor `rhs` to make quantized `output`.", "description": "Given quantized `lhs` and quantized `rhs`, performs quantized add on `lhs` and `rhs` to make quantized `output`.\n\n`UniformQuantizedAdd` follows Numpy broadcasting rules.\nThe two input array shapes are compared element-wise.\nStarting with the trailing dimensions, the two dimensions either have to be equal or one of them needs to be 1.\n\n`lhs` and `rhs` must be quantized Tensor, where data value is quantized using the formula:\n```\nquantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val)\n```\n`output` is also quantized, using the same formula.\n\nIf `lhs` and `output` is both per-axis quantized, the quantization axis must match.\nAlso, if `rhs` and `output` is both per-axis quantized, the quantization axis must match.\n*Match* means the axis must match when adding, regarding the broadcasting.\ni.e. For both operands `lhs` and `rhs`,\nif `operand.quantization_axis` >= 0 and `output.quantization_axis` >= 0,\n`operand.dims` - `operand.quantization_axis` must be equal to `output.dims` - `output.quantization_axis`.", "operands": [ { "name": "lhs", "type": "TF_Qint32Tensor" }, { "name": "rhs", "type": "TF_Qint32Tensor" }, { "name": "lhs_scales", "type": "TF_Float32Tensor" }, { "name": "lhs_zero_points", "type": "TF_Int32Tensor" }, { "name": "rhs_scales", "type": "TF_Float32Tensor" }, { "name": "rhs_zero_points", "type": "TF_Int32Tensor" }, { "name": "output_scales", "type": "TF_Float32Tensor" }, { "name": "output_zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Qint32Tensor" } ], "attributes": [ { "name": "lhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "lhs_quantization_min_val", "type": "I64Attr" }, { "name": "lhs_quantization_max_val", "type": "I64Attr" }, { "name": "rhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "rhs_quantization_min_val", "type": "I64Attr" }, { "name": "rhs_quantization_max_val", "type": "I64Attr" }, { "name": "output_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "output_quantization_min_val", "type": "I64Attr" }, { "name": "output_quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantizedClipByValue", "summary": "Perform clip by value on the quantized Tensor `operand`.", "description": "Given quantized `operand` which was quantized using `scales` and `zero_points`, performs clip by value using `min` and `max` values.\nIf quantization_axis is -1 (per-tensor quantized), the entire operand is clipped using scalar min, max.\nOtherwise (per-channel quantized), the clipping is also done per-channel.", "operands": [ { "name": "operand", "type": "TF_Qint32Tensor" }, { "name": "min", "type": "TF_Qint32Tensor" }, { "name": "max", "type": "TF_Qint32Tensor" }, { "name": "scales", "type": "TF_Float32Tensor" }, { "name": "zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Qint32Tensor" } ], "attributes": [ { "name": "quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "quantization_min_val", "type": "I64Attr" }, { "name": "quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantizedConvolution", "summary": "Perform quantized convolution of quantized Tensor `lhs` and quantized Tensor `rhs`. to make quantized `output`.", "description": "Given quantized `lhs` and quantized `rhs`, performs quantized dot on `lhs` and `rhs` to make quantized `output`.\n\n`lhs` and `rhs` must be Tensors of same rank, and meet following shape conditions.\n- `lhs_feature` % `feature_group_count` == 0\n- `lhs_feature` % `rhs_input_feature` == 0\n- `lhs_feature` / `feature_group_count` == `rhs_input_feature`\n- `rhs_output_feature` % `feature_group_count` == 0\n- `lhs_batch` % `batch_group_count` == 0\n- `rhs_output_feature` % `batch_group_count` == 0\n\n`lhs` and `rhs` must be quantized Tensor, where data value is quantized using the formula:\n```\nquantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val)\n```\n`output` is also quantized, using the same formula.\nIf `rhs` is per-tensor quantized, `output` must be also per-tensor quantized.", "operands": [ { "name": "lhs", "type": "TF_Qint8Tensor" }, { "name": "rhs", "type": "TF_Qint8Tensor" }, { "name": "lhs_scales", "type": "TF_Float32Tensor" }, { "name": "lhs_zero_points", "type": "TF_Int32Tensor" }, { "name": "rhs_scales", "type": "TF_Float32Tensor" }, { "name": "rhs_zero_points", "type": "TF_Int32Tensor" }, { "name": "output_scales", "type": "TF_Float32Tensor" }, { "name": "output_zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Qint32Tensor" } ], "attributes": [ { "name": "window_strides", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "padding", "type": "StrAttr" }, { "name": "explicit_padding", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "lhs_dilation", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "rhs_dilation", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "batch_group_count", "type": "DefaultValuedOptionalAttr" }, { "name": "feature_group_count", "type": "DefaultValuedOptionalAttr" }, { "name": "dimension_numbers", "type": "DefaultValuedOptionalAttr" }, { "name": "lhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "lhs_quantization_min_val", "type": "I64Attr" }, { "name": "lhs_quantization_max_val", "type": "I64Attr" }, { "name": "rhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "rhs_quantization_min_val", "type": "I64Attr" }, { "name": "rhs_quantization_max_val", "type": "I64Attr" }, { "name": "output_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "output_quantization_min_val", "type": "I64Attr" }, { "name": "output_quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantizedConvolutionHybrid", "summary": "Perform hybrid quantized convolution of float Tensor `lhs` and quantized Tensor `rhs`.", "description": "Given float `lhs` and quantized `rhs`, internally performs quantization on `lhs`,\nand then performs quantized convolution on quantized `lhs` and `rhs`.\n\nThe internal quantization on `lhs` is a quantization to `Trhs`, dynamic range,\nper-batch (per-axis along axis `dimension_numbers.input_batch_dimension`), asymmetric,\nand not narrow range (the range is [Trhs_MIN, Trhs_MAX]).\n\n`lhs` and `rhs` must be Tensors of same rank, and meet following shape conditions.\n- lhs_feature % feature_group_count == 0\n- lhs_feature % rhs_input_feature == 0\n- lhs_feature / feature_group_count == rhs_input_feature\n- rhs_output_feature % feature_group_count == 0\n- lhs_batch % batch_group_count == 0\n- rhs_output_feature % batch_group_count == 0\n\n`rhs` must be quantized Tensor, where its data value is quantized using the formula:\nquantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val).", "operands": [ { "name": "lhs", "type": "TF_Float32Tensor" }, { "name": "rhs", "type": "TF_Qint8Tensor" }, { "name": "rhs_scales", "type": "TF_Float32Tensor" }, { "name": "rhs_zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "window_strides", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "padding", "type": "StrAttr" }, { "name": "explicit_padding", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "lhs_dilation", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "rhs_dilation", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "batch_group_count", "type": "DefaultValuedOptionalAttr" }, { "name": "feature_group_count", "type": "DefaultValuedOptionalAttr" }, { "name": "dimension_numbers", "type": "DefaultValuedOptionalAttr" }, { "name": "rhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "rhs_quantization_min_val", "type": "I64Attr" }, { "name": "rhs_quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantizedDot", "summary": "Perform quantized dot of quantized Tensor `lhs` and quantized Tensor `rhs` to make quantized `output`.", "description": "Given quantized `lhs` and quantized `rhs`, performs quantized dot on `lhs` and `rhs` to make quantized `output`.\n`lhs` and `rhs` must be 2D Tensors and the lhs.dim_size(1) must match rhs.dim_size(0).\n`lhs` and `rhs` must be quantized Tensor, where data value is quantized using the formula:\nquantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val).\n`output` is also quantized, using the same formula.\nIf `rhs` is per-tensor quantized, `output` must be also per-tensor quantized.", "operands": [ { "name": "lhs", "type": "TF_Qint8Tensor" }, { "name": "rhs", "type": "TF_Qint8Tensor" }, { "name": "lhs_scales", "type": "TF_Float32Tensor" }, { "name": "lhs_zero_points", "type": "TF_Int32Tensor" }, { "name": "rhs_scales", "type": "TF_Float32Tensor" }, { "name": "rhs_zero_points", "type": "TF_Int32Tensor" }, { "name": "output_scales", "type": "TF_Float32Tensor" }, { "name": "output_zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Qint32Tensor" } ], "attributes": [ { "name": "lhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "lhs_quantization_min_val", "type": "I64Attr" }, { "name": "lhs_quantization_max_val", "type": "I64Attr" }, { "name": "rhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "rhs_quantization_min_val", "type": "I64Attr" }, { "name": "rhs_quantization_max_val", "type": "I64Attr" }, { "name": "output_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "output_quantization_min_val", "type": "I64Attr" }, { "name": "output_quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformQuantizedDotHybrid", "summary": "Perform hybrid quantized dot of float Tensor `lhs` and quantized Tensor `rhs`.", "description": "Given float `lhs` and quantized `rhs`, internally performs quantization on `lhs`, and then performs quantized dot on quantized lhs and `rhs`.\nThe internal quantization on `lhs` is a quantization to qint8, dynamic range, per-batch (per-axis along axis 0), asymmetric, and not narrow range (the range is [-128, 127]).\n`lhs` and `rhs` must be 2D Tensors and the lhs.dim_size(1) must match rhs.dim_size(0).\n`rhs` must be quantized Tensor, where its data value is quantized using the formula:\nquantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val).", "operands": [ { "name": "lhs", "type": "TF_Float32Tensor" }, { "name": "rhs", "type": "TF_Qint8Tensor" }, { "name": "rhs_scales", "type": "TF_Float32Tensor" }, { "name": "rhs_zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "rhs_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "rhs_quantization_min_val", "type": "I64Attr" }, { "name": "rhs_quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.UniformRequantize", "summary": "Given quantized tensor `input`, requantize it with new quantization parameters.", "description": "Given quantized tensor `input`, which was quantized using {input_scales, input_zero_points, input_quantization_axis, input_quantization_min_val, input_quantization_max_val},\nrequantize it to a tensor, which is quantized using {output_scales, output_zero_points, output_quantization_axis, output_quantization_min_val, output_quantization_max_val}.\nThe requantization is done by using the formula:\noutput_quantized_data = clip(\n (input_quantized_data - input_zero_point) * (input_scale / output_scale) + output_zero_point,\n output_quantization_min_val,\n output_quantization_max_val)\n\nPer-tensor and per-axis quantization supported cases are followings:\n* per-tensor -> per-tensor\n* per-tensor -> per-axis\n* per-axis -> per-axis where input_quantization_axis equals output_quantization_axis.\ni.e. At least one among input_quantization_axis and output_quantization_axis must be -1, or two must be equal.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Qint32, TF_Qint8 ]>" }, { "name": "input_scales", "type": "TF_Float32Tensor" }, { "name": "input_zero_points", "type": "TF_Int32Tensor" }, { "name": "output_scales", "type": "TF_Float32Tensor" }, { "name": "output_zero_points", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[ TF_Qint32, TF_Qint8 ]>" } ], "attributes": [ { "name": "input_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "input_quantization_min_val", "type": "I64Attr" }, { "name": "input_quantization_max_val", "type": "I64Attr" }, { "name": "output_quantization_axis", "type": "DefaultValuedOptionalAttr" }, { "name": "output_quantization_min_val", "type": "I64Attr" }, { "name": "output_quantization_max_val", "type": "I64Attr" } ] }, { "name": "tf.Unique", "summary": "Finds unique elements in a 1-D tensor.", "description": "This operation returns a tensor `y` containing all of the unique elements of `x`\nsorted in the same order that they occur in `x`; `x` does not need to be sorted.\nThis operation also returns a tensor `idx` the same size as `x` that contains\nthe index of each value of `x` in the unique output `y`. In other words:\n\n`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`\n\nExamples:\n\n```\n# tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]\ny, idx = unique(x)\ny ==> [1, 2, 4, 7, 8]\nidx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]\n```\n\n```\n# tensor 'x' is [4, 5, 1, 2, 3, 3, 4, 5]\ny, idx = unique(x)\ny ==> [4, 5, 1, 2, 3]\nidx ==> [0, 1, 2, 3, 4, 4, 0, 1]\n```", "operands": [ { "name": "x", "type": "TF_Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" }, { "name": "idx", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.UniqueV2", "summary": "Finds unique elements along an axis of a tensor.", "description": "This operation either returns a tensor `y` containing unique elements\nalong the `axis` of a tensor. The returned unique elements is sorted\nin the same order as they occur along `axis` in `x`.\nThis operation also returns a tensor `idx` that is the same size as\nthe number of the elements in `x` along the `axis` dimension. It\ncontains the index in the unique output `y`.\nIn other words, for an `1-D` tensor `x` with `axis = None:\n\n`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`\n\nFor example:\n\n```\n# tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]\ny, idx = unique(x)\ny ==> [1, 2, 4, 7, 8]\nidx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]\n```\n\nFor an `2-D` tensor `x` with `axis = 0`:\n\n```\n# tensor 'x' is [[1, 0, 0],\n# [1, 0, 0],\n# [2, 0, 0]]\ny, idx = unique(x, axis=0)\ny ==> [[1, 0, 0],\n [2, 0, 0]]\nidx ==> [0, 0, 1]\n```\n\nFor an `2-D` tensor `x` with `axis = 1`:\n\n```\n# tensor 'x' is [[1, 0, 0],\n# [1, 0, 0],\n# [2, 0, 0]]\ny, idx = unique(x, axis=1)\ny ==> [[1, 0],\n [1, 0],\n [2, 0]]\nidx ==> [0, 1, 1]\n```", "operands": [ { "name": "x", "type": "TF_Tensor" }, { "name": "axis", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" }, { "name": "idx", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.Unpack", "summary": "Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors.", "description": "Unpacks `num` tensors from `value` by chipping it along the `axis` dimension.\nFor example, given a tensor of shape `(A, B, C, D)`;\n\nIf `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]`\n and each tensor in `output` will have shape `(B, C, D)`. (Note that the\n dimension unpacked along is gone, unlike `split`).\n\nIf `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]`\n and each tensor in `output` will have shape `(A, C, D)`.\nEtc.\n\nThis is the opposite of `pack`.", "operands": [ { "name": "value", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.UnsortedSegmentMax", "summary": "Computes the maximum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nThis operator is similar to `tf.math.unsorted_segment_sum`,\nInstead of computing the sum over segments, it computes the maximum such that:\n\n\\\\(output_i = \\max_{j...} data[j...]\\\\) where max is over tuples `j...` such\nthat `segment_ids[j...] == i`.\n\nIf the maximum is empty for a given segment ID `i`, it outputs the smallest\npossible value for the specific numeric type,\n`output[i] = numeric_limits::lowest()`.\n\nIf the given segment ID `i` is negative, then the corresponding value is\ndropped, and will not be included in the result.\n\nCaution: On CPU, values in `segment_ids` are always validated to be less than\n`num_segments`, and an error is thrown for out-of-bound indices. On GPU, this\ndoes not throw an error for out-of-bound indices. On Gpu, out-of-bound indices\nresult in safe but unspecified behavior, which may include ignoring\nout-of-bound indices or outputting a tensor with a 0 stored in the first\ndimension of its shape if `num_segments` is 0.\n\n
\n\n
\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])\n>>> tf.math.unsorted_segment_max(c, tf.constant([0, 1, 0]), num_segments=2).numpy()\narray([[4, 3, 3, 4],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.UnsortedSegmentMin", "summary": "Computes the minimum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nThis operator is similar to `tf.math.unsorted_segment_sum`,\nInstead of computing the sum over segments, it computes the minimum such that:\n\n\\\\(output_i = \\min_{j...} data_[j...]\\\\) where min is over tuples `j...` such\nthat `segment_ids[j...] == i`.\n\nIf the minimum is empty for a given segment ID `i`, it outputs the largest\npossible value for the specific numeric type,\n`output[i] = numeric_limits::max()`.\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])\n>>> tf.math.unsorted_segment_min(c, tf.constant([0, 1, 0]), num_segments=2).numpy()\narray([[1, 2, 2, 1],\n [5, 6, 7, 8]], dtype=int32)\n\nIf the given segment ID `i` is negative, then the corresponding value is\ndropped, and will not be included in the result.\n\nCaution: On CPU, values in `segment_ids` are always validated to be less than\n`num_segments`, and an error is thrown for out-of-bound indices. On GPU, this\ndoes not throw an error for out-of-bound indices. On Gpu, out-of-bound indices\nresult in safe but unspecified behavior, which may include ignoring\nout-of-bound indices or outputting a tensor with a 0 stored in the first\ndimension of its shape if `num_segments` is 0.", "operands": [ { "name": "data", "type": "TF_IntOrFpTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.UnsortedSegmentProd", "summary": "Computes the product along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nThis operator is similar to `tf.math.unsorted_segment_sum`,\nInstead of computing the sum over segments, it computes the product of all\nentries belonging to a segment such that:\n\n\\\\(output_i = \\prod_{j...} data[j...]\\\\) where the product is over tuples\n`j...` such that `segment_ids[j...] == i`.\n\nFor example:\n\n>>> c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])\n>>> tf.math.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2).numpy()\narray([[4, 6, 6, 4],\n [5, 6, 7, 8]], dtype=int32)\n\nIf there is no entry for a given segment ID `i`, it outputs 1.\n\nIf the given segment ID `i` is negative, then the corresponding value is\ndropped, and will not be included in the result.\nCaution: On CPU, values in `segment_ids` are always validated to be less than\n`num_segments`, and an error is thrown for out-of-bound indices. On GPU, this\ndoes not throw an error for out-of-bound indices. On Gpu, out-of-bound indices\nresult in safe but unspecified behavior, which may include ignoring\nout-of-bound indices or outputting a tensor with a 0 stored in the first\ndimension of its shape if `num_segments` is 0.", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TF_I32OrI64Tensor" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.UnsortedSegmentSum", "summary": "Computes the sum along segments of a tensor.", "description": "Read\n[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output[i] = \\sum_{j...} data[j...]\\\\) where the sum is over tuples `j...` such\nthat `segment_ids[j...] == i`. Unlike `SegmentSum`, `segment_ids`\nneed not be sorted and need not cover all values in the full\nrange of valid values.\n\nIf the sum is empty for a given segment ID `i`, `output[i] = 0`.\nIf the given segment ID `i` is negative, the value is dropped and will not be\nadded to the sum of the segment.\n\n`num_segments` should equal the number of distinct segment IDs.\n\nCaution: On CPU, values in `segment_ids` are always validated to be less than\n`num_segments`, and an error is thrown for out-of-bound indices. On GPU, this\ndoes not throw an error for out-of-bound indices. On Gpu, out-of-bound indices\nresult in safe but unspecified behavior, which may include ignoring\nout-of-bound indices or outputting a tensor with a 0 stored in the first\ndimension of its shape if `num_segments` is 0.\n\n
\n\n
\n\n>>> c = [[1,2,3,4], [5,6,7,8], [4,3,2,1]]\n>>> tf.math.unsorted_segment_sum(c, [0, 1, 0], num_segments=2).numpy()\narray([[5, 5, 5, 5],\n [5, 6, 7, 8]], dtype=int32)", "operands": [ { "name": "data", "type": "TF_NumberTensor" }, { "name": "segment_ids", "type": "TensorOf<[ TF_Int16, TF_Int32, TF_Int64 ]>" }, { "name": "num_segments", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ] }, { "name": "tf.UpperBound", "summary": "Applies upper_bound(sorted_search_values, values) along each row.", "description": "Each set of rows with the same index in (sorted_inputs, values) is treated\nindependently. The resulting row is the equivalent of calling\n`np.searchsorted(sorted_inputs, values, side='right')`.\n\nThe result is not a global index to the entire\n`Tensor`, but rather just the index in the last dimension.\n\nA 2-D example:\n sorted_sequence = [[0, 3, 9, 9, 10],\n [1, 2, 3, 4, 5]]\n values = [[2, 4, 9],\n [0, 2, 6]]\n\n result = UpperBound(sorted_sequence, values)\n\n result == [[1, 2, 4],\n [0, 2, 5]]", "operands": [ { "name": "sorted_inputs", "type": "TF_Tensor" }, { "name": "values", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.VarHandleOp", "summary": "Creates a handle to a Variable resource from its name.", "description": "container: the container this variable is placed in.\nshared_name: the name by which this variable is referred to.\ndtype and shape: attributes representing the data type and shape held in the\n variable.\n\nExample:\n resource_variable_ops.var_handle_op(\n dtype=dtypes.int32, shape=[8, 16], container=\"foo\", shared_name=\"bar\")\n returns a handle for a variable with name \"bar\" in container \"foo\", and the\n variable holds a tensor of shape [8, 16] and dtype int32.", "results": [ { "name": "resource", "type": "TF_ResourceTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedStrAttr" }, { "name": "shared_name", "type": "DefaultValuedStrAttr" } ] }, { "name": "tf.Variable", "summary": "Use VariableV2 instead.", "results": [ { "name": "ref", "type": "TF_Tensor" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" }, { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.VariableShape", "summary": "Returns the shape of the variable pointed to by `resource`.", "description": "This operation returns a 1-D integer tensor representing the shape of `input`.\n\nFor example:\n\n```\n# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]\nshape(t) ==> [2, 2, 3]\n```", "operands": [ { "name": "input", "type": "TF_ResourceTensor" } ], "results": [ { "name": "output", "type": "TF_I32OrI64Tensor" } ] }, { "name": "tf.VariableV2", "summary": "Holds state in the form of a tensor that persists across steps.", "description": "Outputs a ref to the tensor state so it may be read or modified.\nTODO(zhifengc/mrry): Adds a pointer to a more detail document\nabout sharing states in tensorflow.", "results": [ { "name": "ref", "type": "TF_Tensor" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" }, { "name": "container", "type": "DefaultValuedOptionalAttr" }, { "name": "shared_name", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.VarIsInitializedOp", "summary": "Checks whether a resource handle-based variable has been initialized.", "operands": [ { "name": "resource", "type": "TF_ResourceTensor" } ], "results": [ { "name": "is_initialized", "type": "TF_BoolTensor" } ] }, { "name": "tf.Where", "summary": "Returns locations of nonzero / true values in a tensor.", "description": "This operation returns the coordinates of true elements in `condition`. The\ncoordinates are returned in a 2-D tensor where the first dimension (rows)\nrepresents the number of true elements, and the second dimension (columns)\nrepresents the coordinates of the true elements. Keep in mind, the shape of\nthe output tensor can vary depending on how many true values there are in\n`condition`. Indices are output in row-major order.\n\nFor example:\n\n```\n# 'input' tensor is [[True, False]\n# [True, False]]\n# 'input' has two true values, so output has two coordinates.\n# 'input' has rank of 2, so coordinates have two indices.\nwhere(input) ==> [[0, 0],\n [1, 0]]\n\n# `condition` tensor is [[[True, False]\n# [True, False]]\n# [[False, True]\n# [False, True]]\n# [[False, False]\n# [False, True]]]\n# 'input' has 5 true values, so output has 5 coordinates.\n# 'input' has rank of 3, so coordinates have three indices.\nwhere(input) ==> [[0, 0, 0],\n [0, 1, 0],\n [1, 0, 1],\n [1, 1, 1],\n [2, 1, 1]]\n\n# `condition` tensor is [[[1.5, 0.0]\n# [-0.5, 0.0]]\n# [[0.0, 0.25]\n# [0.0, 0.75]]\n# [[0.0, 0.0]\n# [0.0, 0.01]]]\n# 'input' has 5 nonzero values, so output has 5 coordinates.\n# 'input' has rank of 3, so coordinates have three indices.\nwhere(input) ==> [[0, 0, 0],\n [0, 1, 0],\n [1, 0, 1],\n [1, 1, 1],\n [2, 1, 1]]\n\n# `condition` tensor is [[[1.5 + 0.0j, 0.0 + 0.0j]\n# [0.0 + 0.5j, 0.0 + 0.0j]]\n# [[0.0 + 0.0j, 0.25 + 1.5j]\n# [0.0 + 0.0j, 0.75 + 0.0j]]\n# [[0.0 + 0.0j, 0.0 + 0.0j]\n# [0.0 + 0.0j, 0.01 + 0.0j]]]\n# 'input' has 5 nonzero magnitude values, so output has 5 coordinates.\n# 'input' has rank of 3, so coordinates have three indices.\nwhere(input) ==> [[0, 0, 0],\n [0, 1, 0],\n [1, 0, 1],\n [1, 1, 1],\n [2, 1, 1]]\n```", "operands": [ { "name": "input", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "results": [ { "name": "index", "type": "TF_Int64Tensor" } ] }, { "name": "tf.While", "summary": "output = input; While (Cond(output)) { output = Body(output) }", "description": "output = input; While (Cond(output)) { output = Body(output) }\n\ninput: A list of input tensors whose types are T.\noutput: A list of output tensors whose types are T.\ncond: A function that takes 'input' and returns a tensor. If the tensor is\n a scalar of non-boolean, the scalar is converted to a boolean\n according to the following rule: if the scalar is a numerical\n value, non-zero means True and zero means False; if the scalar is\n a string, non-empty means True and empty means False. If the\n tensor is not a scalar, non-emptiness means True and False\n otherwise.\nbody: A function that takes a list of tensors and returns another\n list of tensors. Both lists have the same types as specified\n by T.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "cond", "type": "FlatSymbolRefAttr" }, { "name": "body", "type": "FlatSymbolRefAttr" }, { "name": "parallel_iterations", "type": "ConfinedAttr, [IntMinValue<1>]>" }, { "name": "is_stateless", "type": "BoolAttr" }, { "name": "shape_invariant", "type": "UnitAttr" } ] }, { "name": "tf.WhileRegion", "summary": "while operation", "description": "The tf.WhileRegion op represents a while loop using 2 regions and a set of\n iteration variables. The iteration variables maintained by this Op have the\n same types as the inputs. The Op executes a while loop described by the\n following pseudo code:\n\n ```\n func WhileRegionOp(inputs) {\n iteration_vars = inputs;\n while (cond(iteration_vars)) {\n iteration_vars = body(iteration_vars);\n }\n return iteration_vars;\n }\n ```\n\n `cond` is the condition region and `body` is the body region. Both these\n regions accept the current value of the iteration variables as inputs.\n\n The condition region yields a tensor which, if false, will exit the loop.\n It can also, optionally and additionally, yield the iteration variables, which\n must be unchanged.\n\n The body region always has to yield the (possibly updated) iteration variables.\n\n The iteration variables are initialized to the Op input, and the results of the\n tf.WhileRegion op are the final values of the iteration variables.\n\n This implies that the operand and result types for tf.WhileRegion should be\n the same. Note that the condition and body regions can implicitly capture\n loop invariant values directly. In canonical form, iteration variables that\n pass through the loop body unmodified are converted to implicitly captured\n references to their values outside the loop.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "parallel_iterations", "type": "ConfinedAttr, [IntMinValue<1>]>" }, { "name": "is_stateless", "type": "BoolAttr" }, { "name": "shape_invariant", "type": "UnitAttr" } ], "regions": [ { "name": "cond", "type": "SizedRegion<1>" }, { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tf.WriteAudioSummary", "summary": "Writes a `Summary` protocol buffer with audio.", "description": "The summary has up to `max_outputs` summary values containing audio. The\naudio is built from `tensor` which must be 3-D with shape `[batch_size,\nframes, channels]` or 2-D with shape `[batch_size, frames]`. The values are\nassumed to be in the range of `[-1.0, 1.0]` with a sample rate of `sample_rate`.\n\nThe `tag` argument is a scalar `Tensor` of type `string`. It is used to\nbuild the `tag` of the summary values:\n\n* If `max_outputs` is 1, the summary value tag is '*tag*/audio'.\n* If `max_outputs` is greater than 1, the summary value tags are\n generated sequentially as '*tag*/audio/0', '*tag*/audio/1', etc.\n\nwriter: A handle to a summary writer.\nstep: The step to write the summary for.\ntag: Scalar. Used to build the `tag` attribute of the summary values.\ntensor: 2-D of shape `[batch_size, frames]`.\nsample_rate: The sample rate of the signal in hertz.\nmax_outputs: Max number of batch elements to generate audio for.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tag", "type": "TF_StrTensor" }, { "name": "tensor", "type": "TF_Float32Tensor" }, { "name": "sample_rate", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_outputs", "type": "ConfinedAttr, [IntMinValue<1>]>" } ] }, { "name": "tf.WriteGraphSummary", "summary": "Writes a `GraphDef` protocol buffer to a `SummaryWriter`.", "description": "writer: Handle of `SummaryWriter`.\nstep: The step to write the summary for.\ntensor: A scalar string of the serialized tf.GraphDef proto.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tensor", "type": "TF_StrTensor" } ] }, { "name": "tf.WriteHistogramSummary", "summary": "Writes a histogram summary.", "description": "The generated\n[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)\nhas one summary value containing a histogram for `values`.\n\nThis op reports an `InvalidArgument` error if any value is not finite.\n\nwriter: A handle to a summary writer.\nstep: The step to write the summary for.\ntag: Scalar. Tag to use for the `Summary.Value`.\nvalues: Any shape. Values to use to build the histogram.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tag", "type": "TF_StrTensor" }, { "name": "values", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.WriteImageSummary", "summary": "Writes a `Summary` protocol buffer with images.", "description": "The summary has up to `max_images` summary values containing images. The\nimages are built from `tensor` which must be 4-D with shape `[batch_size,\nheight, width, channels]` and where `channels` can be:\n\n* 1: `tensor` is interpreted as Grayscale.\n* 3: `tensor` is interpreted as RGB.\n* 4: `tensor` is interpreted as RGBA.\n\nThe images have the same number of channels as the input tensor. For float\ninput, the values are normalized one image at a time to fit in the range\n`[0, 255]`. `uint8` values are unchanged. The op uses two different\nnormalization algorithms:\n\n* If the input values are all positive, they are rescaled so the largest one\n is 255.\n\n* If any input value is negative, the values are shifted so input value 0.0\n is at 127. They are then rescaled so that either the smallest value is 0,\n or the largest one is 255.\n\nThe `tag` argument is a scalar `Tensor` of type `string`. It is used to\nbuild the `tag` of the summary values:\n\n* If `max_images` is 1, the summary value tag is '*tag*/image'.\n* If `max_images` is greater than 1, the summary value tags are\n generated sequentially as '*tag*/image/0', '*tag*/image/1', etc.\n\nThe `bad_color` argument is the color to use in the generated images for\nnon-finite input values. It is a `unit8` 1-D tensor of length `channels`.\nEach element must be in the range `[0, 255]` (It represents the value of a\npixel in the output image). Non-finite values in the input tensor are\nreplaced by this tensor in the output image. The default value is the color\nred.\n\nwriter: A handle to a summary writer.\nstep: The step to write the summary for.\ntag: Scalar. Used to build the `tag` attribute of the summary values.\ntensor: 4-D of shape `[batch_size, height, width, channels]` where\n `channels` is 1, 3, or 4.\nmax_images: Max number of batch elements to generate images for.\nbad_color: Color to use for pixels with non-finite values.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tag", "type": "TF_StrTensor" }, { "name": "tensor", "type": "TensorOf<[TF_Float16, TF_Float32, TF_Uint8]>" }, { "name": "bad_color", "type": "TF_Uint8Tensor" } ], "attributes": [ { "name": "max_images", "type": "ConfinedAttr, [IntMinValue<1>]>" } ] }, { "name": "tf.WriteRawProtoSummary", "summary": "Writes a `Summary` protocol buffer with serialized string `Summary` protocol buffers.", "description": "writer: A handle to a summary writer.\nstep: The step to write the summary for.\ntensor: A tensor holding one or more serialized `Summary` protobufs to write.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tensor", "type": "TF_StrTensor" } ] }, { "name": "tf.WriteScalarSummary", "summary": "Writes a `Summary` protocol buffer with scalar values.", "description": "The input `tag` and `value` must have the scalars.\n\nwriter: A handle to a summary writer.\nstep: The step to write the summary for.\ntag: Tag for the summary.\nvalue: Value for the summary.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tag", "type": "TF_StrTensor" }, { "name": "value", "type": "TF_IntOrFpTensor" } ] }, { "name": "tf.WriteSummary", "summary": "Outputs a `Summary` protocol buffer with a tensor.", "description": "writer: A handle to a summary writer.\nstep: The step to write the summary for.\ntensor: A tensor to serialize.\ntag: The summary's tag.\nsummary_metadata: Serialized SummaryMetadata protocol buffer containing\n plugin-related metadata for this summary.", "operands": [ { "name": "writer", "type": "TF_ResourceTensor" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "tensor", "type": "TF_Tensor" }, { "name": "tag", "type": "TF_StrTensor" }, { "name": "summary_metadata", "type": "TF_StrTensor" } ] }, { "name": "tf.WriteTrainingPredictions", "summary": "Writes the given predictions into a RecordIO file using a previously", "description": "initialized global TrainingPredictionWriter. The predictions are transformed\ninto a PredictionData proto before they are written to the file.", "operands": [ { "name": "keys", "type": "TF_StrTensor" }, { "name": "predictions_list", "type": "Variadic" }, { "name": "step", "type": "TF_Int64Tensor" }, { "name": "timestamp_usec", "type": "TF_Int64Tensor" } ], "attributes": [ { "name": "prediction_names", "type": "TypedArrayAttrBase" }, { "name": "training", "type": "BoolAttr" }, { "name": "file_path", "type": "StrAttr" }, { "name": "write_vector_predictions", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.Xdivy", "summary": "Returns 0 if x == 0, and x / y otherwise, elementwise.", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" }, { "name": "y", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.XlaAllReduce", "summary": "Wraps the XLA AllReduce operator", "description": "documented at https://www.tensorflow.org/xla/operation_semantics#allreduce.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Int32, TF_Uint32 ]>" }, { "name": "group_assignment", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Int32, TF_Uint32]>" } ], "attributes": [ { "name": "reduce_op", "type": "TF_AnyStrAttrOf<[Min, Max, Mul, Add, Mean]>" }, { "name": "mode", "type": "TF_AnyStrAttrOf<[CrossReplica, CrossReplicaAndPartition]>" } ] }, { "name": "tf.XlaBroadcastHelper", "summary": "Helper operator for performing XLA-style broadcasts", "description": "Broadcasts `lhs` and `rhs` to the same rank, by adding size 1 dimensions to\nwhichever of `lhs` and `rhs` has the lower rank, using XLA's broadcasting rules\nfor binary operators.", "operands": [ { "name": "lhs", "type": "TF_NumberTensor" }, { "name": "rhs", "type": "TF_NumberTensor" }, { "name": "broadcast_dims", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "lhs_output", "type": "TF_NumberTensor" }, { "name": "rhs_output", "type": "TF_NumberTensor" } ] }, { "name": "tf.XlaCallModule", "summary": "Invokes a StableHLO module.", "description": "This op is used with JAX native serialization in a TensorFlow context with\nstability guarantees.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "version", "type": "I64Attr" }, { "name": "module", "type": "StrAttr" }, { "name": "Sout", "type": "TypedArrayAttrBase" }, { "name": "dim_args_spec", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "platforms", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "function_list", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "has_token_input_output", "type": "DefaultValuedOptionalAttr" }, { "name": "disabled_checks", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "use_shardy_partitioner", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.XlaClusterOutput", "summary": "Operator that connects the output of an XLA computation to other consumer graph nodes.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "outputs", "type": "TF_Tensor" } ] }, { "name": "tf.XlaConcatND", "summary": "Concats input tensor across all dimensions.", "description": "An op which merges slices the input tensor based on the given num_splits\nattribute, strips paddings optionally, and returns the merged tensor without\npaddings.\n\nThis op may be generated via the TPU bridge.\n\nFor example, with `input` tensor:\n```\n[[0, 1],\n [4, 5]]\n[[2, 3],\n [6, 7]]\n[[8, 9],\n [12, 13]]\n[[10, 11],\n [14, 15]]\n```\n`num_splits`:\n```\n[2, 2]\n```\nand `paddings`:\n```\n[1, 1]\n```\nthe expected `outputs` is:\n```\n[[0, 1, 2],\n [4, 5, 6],\n [8, 9, 10]]\n```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "num_concats", "type": "TypedArrayAttrBase" }, { "name": "paddings", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.XlaConv", "summary": "Wraps the XLA ConvGeneralDilated operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution\n.", "operands": [ { "name": "lhs", "type": "TF_NumberTensor" }, { "name": "rhs", "type": "TF_NumberTensor" }, { "name": "window_strides", "type": "TF_I32OrI64Tensor" }, { "name": "padding", "type": "TF_I32OrI64Tensor" }, { "name": "lhs_dilation", "type": "TF_I32OrI64Tensor" }, { "name": "rhs_dilation", "type": "TF_I32OrI64Tensor" }, { "name": "feature_group_count", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "StrAttr" }, { "name": "precision_config", "type": "StrAttr" } ] }, { "name": "tf.XlaConvV2", "summary": "Wraps the XLA ConvGeneralDilated operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution\n.", "operands": [ { "name": "lhs", "type": "TF_NumberTensor" }, { "name": "rhs", "type": "TF_NumberTensor" }, { "name": "window_strides", "type": "TF_I32OrI64Tensor" }, { "name": "padding", "type": "TF_I32OrI64Tensor" }, { "name": "lhs_dilation", "type": "TF_I32OrI64Tensor" }, { "name": "rhs_dilation", "type": "TF_I32OrI64Tensor" }, { "name": "feature_group_count", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "StrAttr" }, { "name": "precision_config", "type": "StrAttr" }, { "name": "batch_group_count", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.XlaCustomCallV2", "summary": "Emits an HLO `CustomCall` operation with multiple outputs.", "description": "As opposed to `XlaCustomCall`, this operation supports multiple outputs.\n\nSee `CustomCall` specification at\n https://tensorflow.org/xla/operation_semantics#customcall,\nand `mhlo.custom_call` specification at\n https://tensorflow.org/mlir/hlo_ops#mhlocustom_call_mlirmhlocustomcallop.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "call_target_name", "type": "StrAttr" }, { "name": "backend_config", "type": "StrAttr" }, { "name": "has_side_effect", "type": "BoolAttr" }, { "name": "result_shapes", "type": "TypedArrayAttrBase" } ] }, { "name": "tf.XlaDot", "summary": "Wraps the XLA DotGeneral operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral\n.", "operands": [ { "name": "lhs", "type": "TF_NumberTensor" }, { "name": "rhs", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "StrAttr" }, { "name": "precision_config", "type": "StrAttr" } ] }, { "name": "tf.XlaDotV2", "summary": "Wraps the XLA DotGeneral operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral\n.", "operands": [ { "name": "lhs", "type": "TF_NumberTensor" }, { "name": "rhs", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "dimension_numbers", "type": "StrAttr" }, { "name": "precision_config", "type": "StrAttr" } ] }, { "name": "tf.XlaDynamicSlice", "summary": "Wraps the XLA DynamicSlice operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice\n.\n\nDynamicSlice extracts a sub-array from the input array at dynamic\nstart_indices. The size of the slice in each dimension is passed in\nsize_indices, which specify the end point of exclusive slice intervals in each\ndimension -- [start, start + size). The shape of start_indices must have rank 1,\nwith dimension size equal to the rank of operand.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "start_indices", "type": "TF_I32OrI64Tensor" }, { "name": "size_indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.XlaDynamicUpdateSlice", "summary": "Wraps the XLA DynamicUpdateSlice operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#dynamicupdateslice\n.\n\nXlaDynamicUpdateSlice generates a result which is the value of the `input`\noperand, with a slice update overwritten at `indices`. The shape of `update`\ndetermines the shape of the sub-array of the result which is updated. The shape\nof indices must be rank == 1, with dimension size equal to the rank of `input`.\n\nHandling of out-of-bounds slice indices is implementation-defined.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "update", "type": "TF_Tensor" }, { "name": "indices", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.XlaEinsum", "summary": "An op which supports basic einsum op with 2 inputs and 1 output.", "description": "This op has better TPU performance since it doesn't have explicitly reshape and\ntranspose operations as tf.einsum does.", "operands": [ { "name": "a", "type": "TensorOf<[TF_Bfloat16, TF_Complex64, TF_Float32]>" }, { "name": "b", "type": "TensorOf<[TF_Bfloat16, TF_Complex64, TF_Float32]>" } ], "results": [ { "name": "product", "type": "TensorOf<[TF_Bfloat16, TF_Complex64, TF_Float32]>" } ], "attributes": [ { "name": "equation", "type": "StrAttr" } ] }, { "name": "tf.XlaGather", "summary": "Wraps the XLA Gather operator documented at", "description": "https://www.tensorflow.org/xla/operation_semantics#gather", "operands": [ { "name": "operand", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "start_indices", "type": "TF_I32OrI64Tensor" }, { "name": "slice_sizes", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "attributes": [ { "name": "dimension_numbers", "type": "StrAttr" }, { "name": "indices_are_sorted", "type": "BoolAttr" } ] }, { "name": "tf.XlaHostCompute", "summary": "A pseudo-op to represent host-side computation in an XLA program.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "ancestors", "type": "TypedArrayAttrBase" }, { "name": "shapes", "type": "TypedArrayAttrBase" }, { "name": "shape_inference_graph", "type": "OptionalAttr" }, { "name": "key", "type": "StrAttr" }, { "name": "send_key", "type": "DefaultValuedStrAttr" }, { "name": "recv_key", "type": "DefaultValuedStrAttr" }, { "name": "cost_estimate_ns", "type": "DefaultValuedOptionalAttr" }, { "name": "tpu_core", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tf.XlaKeyValueSort", "summary": "Wraps the XLA Sort operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#sort\n.\n\nSorts a tensor. Currently only sorts in ascending order are supported.", "operands": [ { "name": "keys", "type": "TF_IntOrFpTensor" }, { "name": "values", "type": "TF_Tensor" } ], "results": [ { "name": "sorted_keys", "type": "TF_IntOrFpTensor" }, { "name": "sorted_values", "type": "TF_Tensor" } ] }, { "name": "tf.XlaLaunch", "summary": "XLA Launch Op. For use by the XLA JIT only.", "operands": [ { "name": "constants", "type": "Variadic" }, { "name": "args", "type": "Variadic" }, { "name": "resources", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "function", "type": "SymbolRefAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.XlaLaunchV2", "summary": "XLA Launch Op. For use by the XLA JIT only.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "constants", "type": "TypedArrayAttrBase" }, { "name": "resources", "type": "TypedArrayAttrBase" }, { "name": "function", "type": "SymbolRefAttr" } ] }, { "name": "tf.XlaLocalSparseDenseMatmul", "summary": "Performs embedding lookup on SparseCore for a single table.", "operands": [ { "name": "embedding_ids", "type": "TF_Int32Tensor" }, { "name": "sample_ids", "type": "TF_Int32Tensor" }, { "name": "embedding_table", "type": "TF_Tensor" } ], "results": [ { "name": "result", "type": "TF_Tensor" } ], "attributes": [ { "name": "sum_valency", "type": "ConfinedAttr]>" }, { "name": "num_tables", "type": "ConfinedAttr]>" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "T", "type": "TypeAttr" } ] }, { "name": "tf.XlaOptimizationBarrier", "summary": "Wraps the XLA OptimizationBarrier operator.", "description": "Documented at https://www.tensorflow.org/xla/operation_semantics#optimizationbarrier.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tf.XlaPad", "summary": "Wraps the XLA Pad operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#pad\n.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "padding_value", "type": "TF_Tensor" }, { "name": "padding_low", "type": "TF_I32OrI64Tensor" }, { "name": "padding_high", "type": "TF_I32OrI64Tensor" }, { "name": "padding_interior", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.XlaRecv", "summary": "Receives the named tensor from another XLA computation. Wraps the XLA Recv", "description": "operator documented at\n https://www.tensorflow.org/performance/xla/operation_semantics#recv .", "results": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" }, { "name": "shape", "type": "TF_ShapeAttr" } ] }, { "name": "tf.XlaRecvFromHost", "summary": "An op to receive a tensor from the host.", "description": "output: the tensor that will be received from the host.\nToutput: element type for output.\nshape: shape for output.\nkey: A unique identifier for this region used to match up host transfers.", "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "shape", "type": "TF_ShapeAttr" }, { "name": "key", "type": "StrAttr" } ] }, { "name": "tf.XlaRecvTPUEmbeddingActivations", "summary": "An op that receives embedding activations on the TPU.", "description": "The TPU system performs the embedding lookups and aggregations. The results of\nthese aggregations are visible to the Tensorflow Graph as the outputs of a\nXlaRecvTPUEmbeddingActivations Op. This op returns a list containing one\nTensor of activations per table specified in the model.", "operands": [ { "name": "deduplication_data", "type": "TF_VariantTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ] }, { "name": "tf.XlaRecvTPUEmbeddingDeduplicationData", "summary": "Receives deduplication data (indices and weights) from the embedding core.", "description": "The deduplication data is a Tensor with type=DT_VARIANT. The tensor itself is an\nXLA nested tuple containing N elements (where N is the ratio of the number of\nembedding to tensor cores per TPU chip). Each element of the nested tuple is a\ntuple of rank 1 tensors. Each tensor either contains indices (DT_UINT32) for\nembedding lookup on the TensorCore or weights (DT_FLOAT) to apply to the output\nof the embedding lookup operation.", "results": [ { "name": "output", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ] }, { "name": "tf.XlaReduce", "summary": "Wraps the XLA Reduce operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#reduce .", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "init_value", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "attributes": [ { "name": "dimensions_to_reduce", "type": "TypedArrayAttrBase" }, { "name": "reducer", "type": "SymbolRefAttr" } ] }, { "name": "tf.XlaReducePrecision", "summary": "Wraps the XLA ReducePrecision operator", "description": "documented at https://www.tensorflow.org/xla/operation_semantics#reduceprecision.", "operands": [ { "name": "operand", "type": "TF_FloatTensor" } ], "results": [ { "name": "output", "type": "TF_FloatTensor" } ], "attributes": [ { "name": "exponent_bits", "type": "I64Attr" }, { "name": "mantissa_bits", "type": "I64Attr" } ] }, { "name": "tf.XlaReduceScatter", "summary": "Wraps the XLA ReduceScatter operator", "description": "documented at https://www.tensorflow.org/xla/operation_semantics#reducescatter.", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Float16, TF_Float32, TF_Int32, TF_Uint32 ]>" }, { "name": "group_assignment", "type": "TF_Int32Tensor" }, { "name": "scatter_dimension", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Int32, TF_Uint32]>" } ], "attributes": [ { "name": "reduce_op", "type": "TF_AnyStrAttrOf<[Min, Max, Mul, Add, Mean]>" } ] }, { "name": "tf.XlaReduceWindow", "summary": "Wraps the XLA ReduceWindow operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow .", "operands": [ { "name": "input", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "init_value", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "window_dimensions", "type": "TF_I32OrI64Tensor" }, { "name": "window_strides", "type": "TF_I32OrI64Tensor" }, { "name": "base_dilations", "type": "TF_I32OrI64Tensor" }, { "name": "window_dilations", "type": "TF_I32OrI64Tensor" }, { "name": "padding", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "attributes": [ { "name": "computation", "type": "SymbolRefAttr" } ] }, { "name": "tf.XlaRemoveDynamicDimensionSize", "summary": "Inverse of XlaSetDynamicDimensionSize.", "description": "Make an xla bounded dynamic dimension into a static dimension. The bound of the\nsize of dimension `dim_index` becomes the static dimension size.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "dim_index", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.XlaReplicaId", "summary": "Replica ID.", "results": [ { "name": "id", "type": "TF_Int32Tensor" } ] }, { "name": "tf.XlaRngBitGenerator", "summary": "Stateless PRNG bit generator.", "description": "Wraps the XLA RngBitGenerator operator, documented at\n https://www.tensorflow.org/performance/xla/operation_semantics#rngbitgenerator.", "operands": [ { "name": "algorithm", "type": "TF_Int32Tensor" }, { "name": "initial_state", "type": "TF_Uint64Tensor" }, { "name": "shape", "type": "TF_I32OrI64Tensor" } ], "results": [ { "name": "output_key", "type": "TF_Uint64Tensor" }, { "name": "output", "type": "TensorOf<[TF_Int32, TF_Int64, TF_Int8, TF_Uint32, TF_Uint64, TF_Uint8]>" } ] }, { "name": "tf.XlaScatter", "summary": "Wraps the XLA Scatter operator documented at", "description": "https://www.tensorflow.org/xla/operation_semantics#scatter.", "operands": [ { "name": "operand", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" }, { "name": "scatter_indices", "type": "TF_I32OrI64Tensor" }, { "name": "updates", "type": "TensorOf<[ TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8 ]>" } ], "results": [ { "name": "output", "type": "TensorOf<[TF_Bfloat16, TF_Bool, TF_Complex128, TF_Complex64, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Int8, TF_Qint16, TF_Qint32, TF_Qint8, TF_Quint16, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>" } ], "attributes": [ { "name": "update_computation", "type": "SymbolRefAttr" }, { "name": "dimension_numbers", "type": "StrAttr" }, { "name": "indices_are_sorted", "type": "BoolAttr" } ] }, { "name": "tf.XlaSelectAndScatter", "summary": "Wraps the XLA SelectAndScatter operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#selectandscatter\n.", "operands": [ { "name": "operand", "type": "TF_NumberTensor" }, { "name": "window_dimensions", "type": "TF_I32OrI64Tensor" }, { "name": "window_strides", "type": "TF_I32OrI64Tensor" }, { "name": "padding", "type": "TF_I32OrI64Tensor" }, { "name": "source", "type": "TF_NumberTensor" }, { "name": "init_value", "type": "TF_NumberTensor" } ], "results": [ { "name": "output", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "select", "type": "SymbolRefAttr" }, { "name": "scatter", "type": "SymbolRefAttr" } ] }, { "name": "tf.XlaSelfAdjointEig", "summary": "Computes the eigen decomposition of a batch of self-adjoint matrices", "description": "(Note: Only real inputs are supported).\n\nComputes the eigenvalues and eigenvectors of the innermost N-by-N matrices in\ntensor such that tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i], for\ni=0...N-1.", "operands": [ { "name": "a", "type": "TF_NumberTensor" } ], "results": [ { "name": "w", "type": "TF_NumberTensor" }, { "name": "v", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "lower", "type": "BoolAttr" }, { "name": "max_iter", "type": "I64Attr" }, { "name": "epsilon", "type": "F32Attr" } ] }, { "name": "tf.XlaSend", "summary": "Sends the named tensor to another XLA computation. Wraps the XLA Send operator", "description": "documented at\n https://www.tensorflow.org/performance/xla/operation_semantics#send .", "operands": [ { "name": "tensor", "type": "TF_Tensor" } ], "attributes": [ { "name": "tensor_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSendToHost", "summary": "An op to send a tensor to the host.", "description": "input: the tensor that will be sent to the host.\nTinput: element type for input.\nkey: A unique identifier for this region used to match up host transfers.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "attributes": [ { "name": "key", "type": "StrAttr" } ] }, { "name": "tf.XlaSendTPUEmbeddingGradients", "summary": "An op that performs gradient updates of embedding tables.", "description": "The gradients argument is a TensorList having the same length and shapes as the\nreturn value of XlaRecvTPUEmbeddingActivations, but contains gradients of the\nmodel's loss with respect to the embedding activations. The embedding tables are\nupdated from these gradients via the optimizer specified in the\nTPUEmbeddingConfiguration proto given to tpu.initialize_system.", "operands": [ { "name": "gradients", "type": "Variadic" }, { "name": "learning_rates", "type": "Variadic" }, { "name": "deduplication_data", "type": "TF_VariantTensor" } ], "attributes": [ { "name": "config", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.XlaSetBound", "summary": "Set a bound for the given input value as a hint to Xla compiler,", "description": "returns the same value.", "operands": [ { "name": "input", "type": "TF_Int32Tensor" }, { "name": "bound", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Int32Tensor" } ] }, { "name": "tf.XlaSetDynamicDimensionSize", "summary": "Make a static dimension into a xla bounded dynamic dimension.", "description": "The current static dimension size will become the bound and the second\n operand becomes the dynamic size of the dimension.", "operands": [ { "name": "input", "type": "TF_Tensor" }, { "name": "dim_index", "type": "TF_Int32Tensor" }, { "name": "size", "type": "TF_Int32Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.XlaSharding", "summary": "An op which shards the input based on the given sharding attribute.\n\nSince TF runtime still relies on V1 sharding but the compiler requires V2\nSharding to support the new partitioner Shardy, when the op can reach both the\ncompiler and the runtime, we record V1 sharding attribute in _XlaSharding and V2\nsharding attribute in _XlaShardingV2, and verify that they are equivalent when\nthey both exist and _XlaShardingV2 is used.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "sharding", "type": "DefaultValuedStrAttr" }, { "name": "_XlaSharding", "type": "OptionalAttr" }, { "name": "_XlaShardingV2", "type": "OptionalAttr" } ] }, { "name": "tf.XlaSort", "summary": "Wraps the XLA Sort operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#sort\n.\n\nSorts a tensor. Currently only sorts in ascending order are supported.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ] }, { "name": "tf.XlaSparseActivationsUnstack", "summary": "XlaSparseActivationsUnstackOp attempts to fuse transpose, relayout,\n conversion, stacking and optionally interleaving of the embedding\n activations, while also offloading this work to SparseCore.\n\n The op assumes its operand is in SparseCore layout.\n The output is a tuple of tensors in TensorCore layout.", "operands": [ { "name": "stacked_activations", "type": "TF_Tensor" } ], "results": [ { "name": "unstacked_embedding_activations", "type": "Variadic" } ], "attributes": [ { "name": "num_tables", "type": "ConfinedAttr]>" }, { "name": "sample_counts", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "features", "type": "ConfinedAttr, [ArrayMinCount<1>]>" }, { "name": "interleaved", "type": "BoolAttr" } ] }, { "name": "tf.XlaSparseCoreAdagrad", "summary": "aaa", "operands": [ { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "gradient", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "feature_width", "type": "I64Attr" } ] }, { "name": "tf.XlaSparseCoreAdagradMomentum", "summary": "aaa", "operands": [ { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "gradient", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "beta_1", "type": "TF_Float32Tensor" }, { "name": "epsilon", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "momentum", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_momentum", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "feature_width", "type": "I64Attr" }, { "name": "use_nesterov", "type": "BoolAttr" }, { "name": "beta_2", "type": "F32Attr" }, { "name": "exponent", "type": "F32Attr" } ] }, { "name": "tf.XlaSparseCoreAdam", "summary": "aaa", "operands": [ { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "gradient", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "momentum", "type": "TF_Float32Tensor" }, { "name": "velocity", "type": "TF_Float32Tensor" }, { "name": "beta_1", "type": "TF_Float32Tensor" }, { "name": "beta_2", "type": "TF_Float32Tensor" }, { "name": "epsilon", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_velocity", "type": "TF_Float32Tensor" }, { "name": "updated_momentum", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "feature_width", "type": "I64Attr" }, { "name": "use_sum_inside_sqrt", "type": "BoolAttr" } ] }, { "name": "tf.XlaSparseCoreFtrl", "summary": "aaa", "operands": [ { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "linear", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "gradient", "type": "TF_Float32Tensor" }, { "name": "beta", "type": "TF_Float32Tensor" }, { "name": "learning_rate_power", "type": "TF_Float32Tensor" }, { "name": "l2_regularization_strength", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_linear", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "feature_width", "type": "I64Attr" }, { "name": "multiply_linear_by_learning_rate", "type": "BoolAttr" }, { "name": "l1_regularization_strength", "type": "F32Attr" } ] }, { "name": "tf.XlaSparseCoreSgd", "summary": "aaa", "operands": [ { "name": "indices", "type": "TF_Int32Tensor" }, { "name": "gradient", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "feature_width", "type": "I64Attr" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput", "summary": "This op back-propagates the activation gradients to the embedding table and the combiner weights.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" }, { "name": "preserved_weights", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "combiner_weights_learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_weights", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "combiner_table_vjp_computation", "type": "SymbolRefAttr" }, { "name": "combiner_weights_vjp_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput", "summary": "This op back-propagates the activation gradients to the embedding table and the combiner weights.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" }, { "name": "preserved_weights", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "combiner_weights_learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_momenta", "type": "TF_Float32Tensor" }, { "name": "updated_weights", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "use_nesterov", "type": "BoolAttr" }, { "name": "exponent", "type": "F32Attr" }, { "name": "beta1", "type": "F32Attr" }, { "name": "beta2", "type": "F32Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "combiner_table_vjp_computation", "type": "SymbolRefAttr" }, { "name": "combiner_weights_vjp_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput", "summary": "This op back-propagates the activation gradients to the embedding table and the combiner weights.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" }, { "name": "preserved_weights", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "combiner_weights_learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocity", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_momenta", "type": "TF_Float32Tensor" }, { "name": "updated_velocity", "type": "TF_Float32Tensor" }, { "name": "updated_weights", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "use_sum_inside_sqrt", "type": "BoolAttr" }, { "name": "beta1", "type": "F32Attr" }, { "name": "beta2", "type": "F32Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "combiner_table_vjp_computation", "type": "SymbolRefAttr" }, { "name": "combiner_weights_vjp_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput", "summary": "This op back-propagates the activation gradients to the embedding table and the combiner weights.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" }, { "name": "preserved_weights", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "tables", "type": "Variadic" }, { "name": "hyperparameters", "type": "Variadic" }, { "name": "combiner_weights_learning_rate", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_tables", "type": "Variadic" }, { "name": "updated_weights", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "combiner_table_vjp_computation", "type": "SymbolRefAttr" }, { "name": "combiner_weights_vjp_computation", "type": "SymbolRefAttr" }, { "name": "optimizer_custom_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput", "summary": "This op back-propagates the activation gradients to the embedding table and the combiner weights.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" }, { "name": "preserved_weights", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "combiner_weights_learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "linear", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_linear", "type": "TF_Float32Tensor" }, { "name": "updated_weights", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "multiply_linear_by_learning_rate", "type": "BoolAttr" }, { "name": "beta", "type": "F32Attr" }, { "name": "learning_rate_power", "type": "F32Attr" }, { "name": "l1_regularization_strength", "type": "F32Attr" }, { "name": "l2_regularization_strength", "type": "F32Attr" }, { "name": "combiner_table_vjp_computation", "type": "SymbolRefAttr" }, { "name": "combiner_weights_vjp_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput", "summary": "This op back-propagates the activation gradients to the embedding table and the combiner weights.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" }, { "name": "preserved_weights", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "combiner_weights_learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_weights", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "combiner_table_vjp_computation", "type": "SymbolRefAttr" }, { "name": "combiner_weights_vjp_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput", "summary": "This op looks up the embedding vectors on SparseCores and performs the given combiner computation on TensorCores.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_pos_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "weights", "type": "TF_Float32Tensor" } ], "results": [ { "name": "activations", "type": "TF_Float32Tensor" }, { "name": "preserved_valencies", "type": "TF_Int32Tensor" }, { "name": "preserved_vectors", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "input_size", "type": "ConfinedAttr]>" }, { "name": "max_valency", "type": "ConfinedAttr]>" }, { "name": "num_weights", "type": "ConfinedAttr]>" }, { "name": "quantization_config_low", "type": "OptionalAttr" }, { "name": "quantization_config_high", "type": "OptionalAttr" }, { "name": "quantization_config_num_buckets", "type": "OptionalAttr" }, { "name": "combiner_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithAdagradAndCsrInput", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize", "summary": "A XLA op which performs the Adagrad optimizer update for the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_momenta", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "use_nesterov", "type": "BoolAttr" }, { "name": "exponent", "type": "F32Attr" }, { "name": "beta1", "type": "F32Attr" }, { "name": "beta2", "type": "F32Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize", "summary": "A XLA op which performs the Adagrad momentumoptimizer update for the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_momenta", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "use_nesterov", "type": "BoolAttr" }, { "name": "exponent", "type": "F32Attr" }, { "name": "beta1", "type": "F32Attr" }, { "name": "beta2", "type": "F32Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithAdamAndCsrInput", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocity", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_momenta", "type": "TF_Float32Tensor" }, { "name": "updated_velocity", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "use_sum_inside_sqrt", "type": "BoolAttr" }, { "name": "beta1", "type": "F32Attr" }, { "name": "beta2", "type": "F32Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize", "summary": "A XLA op which performs the Adam optimizer update for the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "momenta", "type": "TF_Float32Tensor" }, { "name": "velocity", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_momenta", "type": "TF_Float32Tensor" }, { "name": "updated_velocity", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "use_sum_inside_sqrt", "type": "BoolAttr" }, { "name": "beta1", "type": "F32Attr" }, { "name": "beta2", "type": "F32Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithCsrInput", "summary": "A XLA op which performs the custom optimizer per-row update for the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "tables", "type": "Variadic" }, { "name": "hyperparameters", "type": "Variadic" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_tables", "type": "Variadic" } ], "attributes": [ { "name": "custom_computation", "type": "SymbolRefAttr" }, { "name": "table_name", "type": "StrAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithFtrlAndCsrInput", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "linear", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_linear", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "multiply_linear_by_learning_rate", "type": "BoolAttr" }, { "name": "beta", "type": "F32Attr" }, { "name": "learning_rate_power", "type": "F32Attr" }, { "name": "l1_regularization_strength", "type": "F32Attr" }, { "name": "l2_regularization_strength", "type": "F32Attr" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize", "summary": "A XLA op which performs the Ftrl optimizer update for the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "accumulator", "type": "TF_Float32Tensor" }, { "name": "linear", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" }, { "name": "updated_accumulator", "type": "TF_Float32Tensor" }, { "name": "updated_linear", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "multiply_linear_by_learning_rate", "type": "BoolAttr" }, { "name": "beta", "type": "F32Attr" }, { "name": "learning_rate_power", "type": "F32Attr" }, { "name": "l1_regularization_strength", "type": "F32Attr" }, { "name": "l2_regularization_strength", "type": "F32Attr" }, { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithSgdAndCsrInput", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize", "summary": "A XLA op which performs the SGD optimizer update for the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "activation_gradients", "type": "TF_Float32Tensor" }, { "name": "learning_rate", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "updated_embedding_table", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "clip_weight_min", "type": "F32Attr" }, { "name": "clip_weight_max", "type": "F32Attr" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulWithCsrInput", "summary": "aaa", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "activations", "type": "TF_Tensor" } ], "attributes": [ { "name": "input_size", "type": "ConfinedAttr]>" }, { "name": "quantization_config_low", "type": "OptionalAttr" }, { "name": "quantization_config_high", "type": "OptionalAttr" }, { "name": "quantization_config_num_buckets", "type": "OptionalAttr" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseDenseMatmulWithStaticBufferSize", "summary": "A XLA op which performs the dense-sparse matrix multiplication.", "operands": [ { "name": "row_pointers", "type": "TF_Int32Tensor" }, { "name": "sorted_sample_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_token_ids", "type": "TF_Int32Tensor" }, { "name": "sorted_gains", "type": "TF_Float32Tensor" }, { "name": "embedding_table", "type": "TF_Float32Tensor" }, { "name": "num_minibatches_per_physical_sparse_core", "type": "TF_Int32Tensor" } ], "results": [ { "name": "activations", "type": "TF_Float32Tensor" } ], "attributes": [ { "name": "input_size", "type": "ConfinedAttr]>" }, { "name": "quantization_config_low", "type": "OptionalAttr" }, { "name": "quantization_config_high", "type": "OptionalAttr" }, { "name": "quantization_config_num_buckets", "type": "OptionalAttr" }, { "name": "max_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "max_unique_ids_per_sparse_core", "type": "ConfinedAttr]>" }, { "name": "table_name", "type": "StrAttr" } ] }, { "name": "tf.XlaSparseGradientsStack", "summary": "XlaSparseGradientsStackOp attempts to fuse transpose, relayout, conversion,\n unstacking and optionally interleaving of the embedding gradients, while\n also offloading this work to SparseCore.\n\n The op assumes its operands are in TensoreCore layout.\n The output is in SparseCore layout.", "operands": [ { "name": "unstacked_gradients", "type": "Variadic" } ], "results": [ { "name": "stacked_gradients", "type": "TF_Tensor" } ], "attributes": [ { "name": "num_tables", "type": "ConfinedAttr]>" }, { "name": "interleaved", "type": "BoolAttr" } ] }, { "name": "tf.XlaSplitND", "summary": "Splits input tensor across all dimensions.", "description": "An op which slices the input tensor based on the given num_splits attribute,\npads slices optionally, and returned the slices. Slices are returned in\nrow-major order.\n\nThis op may be generated via the TPU bridge.\n\nFor example, with `input` tensor:\n```\n[[0, 1, 2],\n [3, 4, 5],\n [6, 7, 8]]\n```\n`num_splits`:\n```\n[2, 2]\n```\nand `paddings`:\n```\n[1, 1]\n```\nthe expected `outputs` is:\n```\n[[0, 1],\n [3, 4]]\n[[2, 0],\n [5, 0]]\n[[6, 7],\n [0, 0]]\n[[8, 0],\n [0, 0]]\n```", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "num_splits", "type": "TypedArrayAttrBase" }, { "name": "paddings", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.XlaSpmdFullToShardShape", "summary": "An op used by XLA SPMD partitioner to switch from automatic partitioning to", "description": "manual partitioning. It annotates the input (full-shape, to be automatically\npartitioned) with the same sharding used by manual partitioning, and outputs a\nshard-shaped tensor to be consumed by later manually-partitioned ops. If the\nshape is not evenly partitionable, the padding region will be masked with 0s.\nThe conversion can happen partially in subgroups, by specifying the dim\nattribute, where only that dim will be converted.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "manual_sharding", "type": "StrAttr" }, { "name": "dim", "type": "DefaultValuedOptionalAttr" }, { "name": "unspecified_dims", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.XlaSpmdShardToFullShape", "summary": "An op used by XLA SPMD partitioner to switch from manual partitioning to", "description": "automatic partitioning. It converts the shard-shaped, manually partitioned input\ninto full-shaped tensor to be partitioned automatically with the same sharding\nused by manual partitioning. The conversion can happen partially in subgroups,\nby specifying the dim attribute, where only that dim will be converted.", "operands": [ { "name": "input", "type": "TF_Tensor" } ], "results": [ { "name": "output", "type": "TF_Tensor" } ], "attributes": [ { "name": "manual_sharding", "type": "StrAttr" }, { "name": "full_shape", "type": "TF_ShapeAttr" }, { "name": "dim", "type": "DefaultValuedOptionalAttr" }, { "name": "unspecified_dims", "type": "DefaultValuedOptionalAttr, {}>" } ] }, { "name": "tf.XlaSvd", "summary": "Computes the eigen decomposition of a batch of self-adjoint matrices", "description": "(Note: Only real inputs are supported).\n\nComputes the eigenvalues and eigenvectors of the innermost M-by-N matrices in\ntensor such that tensor[...,:,:] = u[..., :, :] * Diag(s[..., :]) * Transpose(v[...,:,:]).", "operands": [ { "name": "a", "type": "TF_NumberTensor" } ], "results": [ { "name": "s", "type": "TF_NumberTensor" }, { "name": "u", "type": "TF_NumberTensor" }, { "name": "v", "type": "TF_NumberTensor" } ], "attributes": [ { "name": "max_iter", "type": "I64Attr" }, { "name": "epsilon", "type": "F32Attr" }, { "name": "precision_config", "type": "StrAttr" } ] }, { "name": "tf.XlaVariadicReduce", "summary": "Wraps the variadic XLA Reduce operator.", "description": "Semantics are documented at\n https://www.tensorflow.org/performance/xla/operation_semantics#variadic_reduce.\n\nThis version is limited to operands of the same dtype.\nXlaVariadicReduceV2 is a version that supports heterogeneous operands.", "operands": [ { "name": "input", "type": "Variadic>" }, { "name": "init_value", "type": "Variadic>" } ], "results": [ { "name": "output", "type": "Variadic>" } ], "attributes": [ { "name": "dimensions_to_reduce", "type": "TypedArrayAttrBase" }, { "name": "reducer", "type": "SymbolRefAttr" } ] }, { "name": "tf.XlaVariadicReduceV2", "summary": "Wraps the variadic XLA Reduce operator.", "description": "Semantics are documented at\n https://www.tensorflow.org/performance/xla/operation_semantics#variadic_reduce.\n\nThis is an expanded version of XlaVariadicReduce, with support for\noperands of different dtypes, and improved shape inference.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "dimensions_to_reduce", "type": "TypedArrayAttrBase" }, { "name": "reducer", "type": "SymbolRefAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "tf.XlaVariadicSort", "summary": "Wraps the XLA Sort operator, documented at", "description": "https://www.tensorflow.org/performance/xla/operation_semantics#sort\n.\n\nSorts one or more tensors, with support for custom comparator, dimension, and\nis_stable attributes.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "dimension", "type": "TF_Int32Tensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "comparator", "type": "SymbolRefAttr" }, { "name": "is_stable", "type": "BoolAttr" } ] }, { "name": "tf.Xlog1py", "summary": "Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise.", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" }, { "name": "y", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Xlogy", "summary": "Returns 0 if x == 0, and x * log(y) otherwise, elementwise.", "operands": [ { "name": "x", "type": "TF_FpOrComplexTensor" }, { "name": "y", "type": "TF_FpOrComplexTensor" } ], "results": [ { "name": "z", "type": "TF_FpOrComplexTensor" } ] }, { "name": "tf.Yield", "summary": "Yield operation", "description": "The \"yield\" operation represents a return operation within the conditional\n and body of structured control flow (e.g., if and while). The operation\n takes a variable number of operands and produces no results. The number and\n types of inputs must match the signature of the operation that contains the\n region." }, { "name": "tf.ZerosLike", "summary": "Returns a tensor of zeros with the same shape and type as x.", "operands": [ { "name": "x", "type": "TF_Tensor" } ], "results": [ { "name": "y", "type": "TF_Tensor" } ] }, { "name": "tf.Zeta", "summary": "Compute the Hurwitz zeta function \\\\(\\zeta(x, q)\\\\).", "description": "The Hurwitz zeta function is defined as:\n\n\n\\\\(\\zeta(x, q) = \\sum_{n=0}^{\\infty} (q + n)^{-x}\\\\)", "operands": [ { "name": "x", "type": "TF_F32OrF64Tensor" }, { "name": "q", "type": "TF_F32OrF64Tensor" } ], "results": [ { "name": "z", "type": "TF_F32OrF64Tensor" } ] }, { "name": "tfd.convert_tft_to_dht", "summary": "convert TF tensor to TFRT DHT tensor operation", "description": "The \"tfd.convert_tft_to_dht\" operation converts a TF tensor to a TFRT\n DenseHostTensor.\n\n It takes as input a TF Tensor and an input chain, and returns a converted\n TFRT DHT tensor and an output chain.\n\n Example:\n %dht, %c0 = \"tfd.convert_tft_to_dht\"(%tft, %c)\n : (!tfd.tf_tensor, !tfrt.chain) -> (!dht.host_tensor, !tfrt.chain)", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ] }, { "name": "tfd.delegate_kernel", "summary": "delegate kernel operation", "description": "The \"tfd.delegate_kernel\" operation takes an input chain, and arbitrary\n number of input arguments, and runs a specified TF op via TFE C API. It\n returns an output chain and variable number of outputs from the TF op.\n\n The input arguments and attributes are passed to the TF op. The outputs are\n outputs of the TF op.\n\n Note that `_name` is a required attribute specifying the TF op to run.\n TFRT attributes are sorted alphabetically, passed in as positional\n attributes to the TFRT kernel, rather than as named attributes.\n\n Example:\n To run \"tf.MatMul\" op, which has two boolean attributes,\n 1. Set _name = \"MatMul\"\n 2. For each TF attribute, split it into two attributes, one for name of\n the TF attribute, and the other for the type and value of the\n attribute value. Attribute value is a string with the format of\n \"type$val\", where type can be \"bool\", \"string\", \"tfdtype\", \"tfshape\",\n \"tftensor\".\n The value serialization format can be found in attr_util.h.\n\n %out_c, %out_tensor = \"tfd.delegate_kernel\"(\n %in_c, %in1_tensor, %in2_tensor) {\n _name = \"MatMul\",\n attr1_name = \"transpose_a\", attr1_value = \"bool$false\",\n attr2_name = \"transpose_b\", attr2_value = \"bool$false\"\n } : (!tfrt.chain, !tfd.tf_tensor, !tfd.tf_tensor) -> (\n !tfrt.chain, !tfd.tf_tensor)", "results": [ { "name": "result0", "type": "TFRT_ChainType" }, { "name": "result1", "type": "Variadic" } ] }, { "name": "tfd.init_eager_context", "summary": "eager context initialization operation", "description": "The \"tfd.init_eager_context\" operation takes an input chain, creates and\n initializes the TF EagerContext and returns an output chain.\n\n Example:\n %c1 = \"tfd.init_eager_context\"(%c0): (!tfrt.chain) -> !tfrt.chain", "results": [ { "name": "result", "type": "TFRT_ChainType" } ] }, { "name": "tfd.move_dht_to_tft", "summary": "convert TFRT DHT tensor to DHT tensor operation", "description": "The \"tfd.move_dht_to_tft\" operation moves a TFRT tensor into a TF Tensor.\n\n It takes as input a TFRT Tensor and an input chain, and returns a TF tensor\n with the same underlying buffer and an output chain.\n\n Example:\n %dht, %c0 = \"tfd.convert_tft_to_dht\"(%tft, %c)\n : (!tfd.tf_tensor, !tfrt.chain) -> (!dht.host_tensor, !tfrt.chain)", "results": [ { "name": "result0", "type": "TfTensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ] }, { "name": "tfd.print_tft", "summary": "print TF tensor operation", "description": "The \"tfd.print_tft\" operation prints the input TF tensor. It takes an input\n TF tensor to be printed and an input chain, and returns an output chain.\n\n Example:\n %c1 = \"tfd.print_tft\"(%t, %c) : (!tfd.tf_tensor, !tfrt.chain) -> !tfrt.chain", "results": [ { "name": "result", "type": "TFRT_ChainType" } ] }, { "name": "tfg.Case", "summary": "A case operation, in functional form", "operands": [ { "name": "branch_index", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "branches", "type": "TypedArrayAttrBase" }, { "name": "Tin", "type": "OptionalAttr>" }, { "name": "Tout", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.CaseRegion", "summary": "A case op with graph regions.", "description": "A `Case` operation in region form. `Case` takes one data operand, an index,\n and executes the region corresponding to that index. The execution of any\n of its regions is blocked on the operation's control operands.\n\n The regions have no block arguments; everything that escapes the scope is an\n implicit capture. All regions return values of the same types which are\n compatible with the result types of the `Case` operation.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes in arrays. There are never region argument attributes, and\n the number of result attributes must match the number of data results.", "operands": [ { "name": "branch_index", "type": "I32Tensor" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "branch_attrs", "type": "OptionalAttr>" }, { "name": "region_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "branches", "type": "VariadicRegion>" } ], "defaultDialect": "tfg", "assemblyFormat": "$branch_index (` ` `[` $ctls^ `]`)?\n $branches\n attr-dict `:` functional-type($branch_index, $outs)" }, { "name": "tfg.condition", "summary": "TF graph terminator op for while-loop condition regions.", "description": "The `condition` operation is a special terminator for the condition region\n of while loops. Its only purpose is to support reasoning about region\n control-flow by forwarding the arguments to the condition region to the body\n region or back to the parent operation's results.\n\n The `condition` operation accepts one `cond` data input, which if true, will\n cause the execution to branch to the loop body, and if false, will cause the\n execution to return to the parent operation.\n\n There must be the same number of arguments `args` as there are operands and\n results in the parent `While` loop.", "operands": [ { "name": "cond", "type": "I1Tensor" }, { "name": "args", "type": "Variadic" }, { "name": "ctls", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$cond `:` type($cond) (` ` `(` $args^ `)`)?\n (`[` $ctls^ `]`)? attr-dict (`:` type($args)^)?" }, { "name": "tfg.For", "summary": "A functional for-loop operation.", "operands": [ { "name": "start", "type": "TFGraph_OpaqueTensorOr" }, { "name": "limit", "type": "TFGraph_OpaqueTensorOr" }, { "name": "delta", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "body", "type": "TFType_FuncAttr" }, { "name": "T", "type": "OptionalAttr>" } ] }, { "name": "tfg.ForRegion", "description": "A `For` operation in region form. The operation takes three scalar `i32`\n operands: a lower bound, an upper bound, and a step. As well, it takes N\n operands and produces N results of the same types. The loop body region has\n a scalar `i32` block argument and its corresponding control token and N data\n block arguments of the same types as the N data operands and N results. The\n scalar `i32` block argument is the current loop index.\n\n The operation is blocked on its control operands. The execution enters the\n loop body, which must return N data results. The values are either fed into\n the next iteration of the body or taken as the operation's results.\n\n For the body region, the operation contains optional \"call\" attributes and\n region attributes. The number of argument attributes must match the number\n of data operands and the number of result attributes must match the number\n of data results.\n\n Values can be propagated through the loop bodies as iteration variables,\n but the regions allow implicitly captured values as well.", "operands": [ { "name": "start", "type": "I32Tensor" }, { "name": "limit", "type": "I32Tensor" }, { "name": "delta", "type": "I32Tensor" }, { "name": "init", "type": "Variadic" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "body_attrs", "type": "OptionalAttr" }, { "name": "region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "body_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`(` $init^ `)`)? (`[` $ctls^ `]`)?\n `from` $start `to` $limit `by` $delta\n $body_region\n attr-dict `:` `(` type($start) `,` type($limit) `,` type($delta)\n (`,` type($init)^)? `)` (`->` `(` type($outs)^ `)`)?" }, { "name": "tfg.func", "summary": "Define a function as modeled by FunctionDef.", "description": "This operation is modeling a function definition, corresponding to the\n FunctionDef proto. It defines a region `body` which contains an unordered\n list of nodes forming a TensorFlow graph.\n The body still has a return operation as terminator which must always be\n the last operation.\n\n A function can be generic if it specifies the `generic` attribute. Such\n function is akin to a C++ template: it need \"instantiation attributes\" to be\n specified at each call site in order to make it into a concrete function,\n see `tensorflow::InstantiateFunction()` for more info.", "attributes": [ { "name": "generic", "type": "UnitAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr" }, { "name": "res_attrs", "type": "OptionalAttr" }, { "name": "description", "type": "OptionalAttr" }, { "name": "is_stateful", "type": "UnitAttr" }, { "name": "gradient", "type": "OptionalAttr" }, { "name": "resource_arg_unique_ids_keys", "type": "OptionalAttr" }, { "name": "resource_arg_unique_ids_values", "type": "OptionalAttr" }, { "name": "control_output", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "defaultDialect": "tfg", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfg.get_result", "summary": "Extract a value out of an opaque tensor in a generic Function.", "description": "The `get_result` operation exists in generic functions before instantiation,\n when the number of output per node isn't known yet. In generic function\n nodes define a single SSA value which is then \"unpacked\" by name using this\n operation.\n Example:\n\n ```mlir\n %Switch, %ctl_1 = tfg.Switch(%G_z, %G_z) name = \"cond/Switch\"\n %s_true = tfg.get_result %Switch \"output_true” : 0\n %s_false = tfg.get_result %Switch \"output_false” : 0\n ```", "operands": [ { "name": "value", "type": "OpaqueTensorType" } ], "results": [ { "name": "result", "type": "OpaqueTensorType" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "number", "type": "I32Attr" } ], "assemblyFormat": "`(` $value `)` $name `:` $number attr-dict-with-keyword" }, { "name": "tfg.graph", "summary": "Define a flat graph of operations", "description": "This operation is modeling a unordered list of nodes forming a TensorFlow\n graph. This corresponds to the GraphDef proto definition minus the\n FunctionDefLibrary.", "attributes": [ { "name": "version", "type": "TFType_VersionAttr" } ], "regions": [ { "name": "nodes", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "qualified($version) attr-dict-with-keyword $nodes" }, { "name": "tfg.If", "summary": "An if operation, in functional form.", "operands": [ { "name": "cond", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "then_branch", "type": "TFType_FuncAttr" }, { "name": "else_branch", "type": "TFType_FuncAttr" }, { "name": "Tcond", "type": "OptionalAttr" }, { "name": "Tin", "type": "OptionalAttr>" }, { "name": "Tout", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.IfRegion", "summary": "An if-then-else op with graph regions.", "description": "An `If` operation in region form. `If` takes on data operand, which if true,\n executes the `then` region, otherwise the `else` region. The execution of\n either region is blocked on the operation's control operands.\n\n The regions have no block arguments; everything that escapes the scope is an\n implicit capture. Both regions return values of the same types which are\n compatible with the result types of the `If` operation.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes. There are never region argument attributes, and the\n number of result attributes must match the number of data results.", "operands": [ { "name": "cond", "type": "I1Tensor" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "then_attrs", "type": "OptionalAttr" }, { "name": "else_attrs", "type": "OptionalAttr" }, { "name": "then_region_attrs", "type": "OptionalAttr" }, { "name": "else_region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "then_region", "type": "SizedRegion<1>" }, { "name": "else_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "assemblyFormat": "$cond (` ` `[` $ctls^ `]`)? `then`\n $then_region\n `else`\n $else_region\n attr-dict `:` functional-type($cond, $outs)" }, { "name": "tfg.return", "summary": "Return values from a Function.", "description": "The `return` operation represents a return operation within a function.\n The operation takes variable number of operands and produces no results.\n The operand number must match the signature of the function that contains\n the operation. The types of the input to the call must be compatible with\n the function signature in terms of shape and matching the element type, and\n similarly for the function results,", "attributes": [ { "name": "control_ret_attrs", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "tfg.StatefulCase", "summary": "A stateful case operation, in functional form", "operands": [ { "name": "branch_index", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "branches", "type": "TypedArrayAttrBase" }, { "name": "Tin", "type": "OptionalAttr>" }, { "name": "Tout", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.StatefulCaseRegion", "summary": "A stateful case op with graph regions.", "description": "A `Case` operation in region form. `Case` takes one data operand, an index,\n and executes the region corresponding to that index. The execution of any\n of its regions is blocked on the operation's control operands.\n\n The regions have no block arguments; everything that escapes the scope is an\n implicit capture. All regions return values of the same types which are\n compatible with the result types of the `Case` operation.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes in arrays. There are never region argument attributes, and\n the number of result attributes must match the number of data results.", "operands": [ { "name": "branch_index", "type": "I32Tensor" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "branch_attrs", "type": "OptionalAttr>" }, { "name": "region_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "branches", "type": "VariadicRegion>" } ], "defaultDialect": "tfg", "assemblyFormat": "$branch_index (` ` `[` $ctls^ `]`)?\n $branches\n attr-dict `:` functional-type($branch_index, $outs)" }, { "name": "tfg.StatefulIf", "summary": "A stateful if operation, in functional form.", "operands": [ { "name": "cond", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "then_branch", "type": "TFType_FuncAttr" }, { "name": "else_branch", "type": "TFType_FuncAttr" }, { "name": "Tcond", "type": "OptionalAttr" }, { "name": "Tin", "type": "OptionalAttr>" }, { "name": "Tout", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.StatefulIfRegion", "summary": "A stateful if-then-else op with graph regions.", "description": "An `If` operation in region form. `If` takes on data operand, which if true,\n executes the `then` region, otherwise the `else` region. The execution of\n either region is blocked on the operation's control operands.\n\n The regions have no block arguments; everything that escapes the scope is an\n implicit capture. Both regions return values of the same types which are\n compatible with the result types of the `If` operation.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes. There are never region argument attributes, and the\n number of result attributes must match the number of data results.", "operands": [ { "name": "cond", "type": "I1Tensor" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "then_attrs", "type": "OptionalAttr" }, { "name": "else_attrs", "type": "OptionalAttr" }, { "name": "then_region_attrs", "type": "OptionalAttr" }, { "name": "else_region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "then_region", "type": "SizedRegion<1>" }, { "name": "else_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "assemblyFormat": "$cond (` ` `[` $ctls^ `]`)? `then`\n $then_region\n `else`\n $else_region\n attr-dict `:` functional-type($cond, $outs)" }, { "name": "tfg.StatefulWhile", "summary": "A functional stateful while loop operation.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "cond", "type": "TFType_FuncAttr" }, { "name": "body", "type": "TFType_FuncAttr" }, { "name": "parallel_iterations", "type": "I64Attr" }, { "name": "T", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.StatefulWhileRegion", "summary": "A stateful region-based while loop operation.", "description": "A `While` operation in region form. The operation takes N operands and\n produces N results of the same types. Each region has N data block arguments\n and N corresponding control tokens.\n\n The entry into the condition region is blocked on the operation's control\n operands. The operation always executes the condition region at least once\n with the arguments as the operation's data operands. If the condition region\n returns `true`, the body region is executed with the arguments provided to\n the condition region. The body region will branch back to the condition\n region with N results. If `false`, the condition region will branch back to\n the parent `While` operation with the argument values as results.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes. The number of argument attributes must match the number\n of data operands and the number of result attributes must match the number\n of data results.\n\n Values can be propagated through the loop bodies as iteration variables,\n but the regions allow implicitly captured values as well.", "operands": [ { "name": "init", "type": "Variadic" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "parallel_iterations", "type": "I64Attr" }, { "name": "cond_attrs", "type": "OptionalAttr" }, { "name": "body_attrs", "type": "OptionalAttr" }, { "name": "cond_region_attrs", "type": "OptionalAttr" }, { "name": "body_region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "cond_region", "type": "SizedRegion<1>" }, { "name": "body_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`(` $init^ `)`)? (`[` $ctls^ `]`)?\n $cond_region\n `do`\n $body_region\n attr-dict (`:` functional-type($init, $outs)^)?" }, { "name": "tfg.StatelessCase", "summary": "A stateless case operation, in functional form", "operands": [ { "name": "branch_index", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "branches", "type": "TypedArrayAttrBase" }, { "name": "Tin", "type": "OptionalAttr>" }, { "name": "Tout", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.StatelessCaseRegion", "summary": "A stateless case op with graph regions.", "description": "A `Case` operation in region form. `Case` takes one data operand, an index,\n and executes the region corresponding to that index. The execution of any\n of its regions is blocked on the operation's control operands.\n\n The regions have no block arguments; everything that escapes the scope is an\n implicit capture. All regions return values of the same types which are\n compatible with the result types of the `Case` operation.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes in arrays. There are never region argument attributes, and\n the number of result attributes must match the number of data results.", "operands": [ { "name": "branch_index", "type": "I32Tensor" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "branch_attrs", "type": "OptionalAttr>" }, { "name": "region_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "branches", "type": "VariadicRegion>" } ], "defaultDialect": "tfg", "assemblyFormat": "$branch_index (` ` `[` $ctls^ `]`)?\n $branches\n attr-dict `:` functional-type($branch_index, $outs)" }, { "name": "tfg.StatelessIf", "summary": "A stateless if operation, in functional form.", "operands": [ { "name": "cond", "type": "TFGraph_OpaqueTensorOr" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "then_branch", "type": "TFType_FuncAttr" }, { "name": "else_branch", "type": "TFType_FuncAttr" }, { "name": "Tcond", "type": "OptionalAttr" }, { "name": "Tin", "type": "OptionalAttr>" }, { "name": "Tout", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.StatelessIfRegion", "summary": "A stateless if-then-else op with graph regions.", "description": "An `If` operation in region form. `If` takes on data operand, which if true,\n executes the `then` region, otherwise the `else` region. The execution of\n either region is blocked on the operation's control operands.\n\n The regions have no block arguments; everything that escapes the scope is an\n implicit capture. Both regions return values of the same types which are\n compatible with the result types of the `If` operation.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes. There are never region argument attributes, and the\n number of result attributes must match the number of data results.", "operands": [ { "name": "cond", "type": "I1Tensor" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "then_attrs", "type": "OptionalAttr" }, { "name": "else_attrs", "type": "OptionalAttr" }, { "name": "then_region_attrs", "type": "OptionalAttr" }, { "name": "else_region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "then_region", "type": "SizedRegion<1>" }, { "name": "else_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "assemblyFormat": "$cond (` ` `[` $ctls^ `]`)? `then`\n $then_region\n `else`\n $else_region\n attr-dict `:` functional-type($cond, $outs)" }, { "name": "tfg.StatelessWhile", "summary": "A functional stateless while loop operation.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "cond", "type": "TFType_FuncAttr" }, { "name": "body", "type": "TFType_FuncAttr" }, { "name": "parallel_iterations", "type": "I64Attr" }, { "name": "T", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.StatelessWhileRegion", "summary": "A stateless region-based while loop operation.", "description": "A `While` operation in region form. The operation takes N operands and\n produces N results of the same types. Each region has N data block arguments\n and N corresponding control tokens.\n\n The entry into the condition region is blocked on the operation's control\n operands. The operation always executes the condition region at least once\n with the arguments as the operation's data operands. If the condition region\n returns `true`, the body region is executed with the arguments provided to\n the condition region. The body region will branch back to the condition\n region with N results. If `false`, the condition region will branch back to\n the parent `While` operation with the argument values as results.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes. The number of argument attributes must match the number\n of data operands and the number of result attributes must match the number\n of data results.\n\n Values can be propagated through the loop bodies as iteration variables,\n but the regions allow implicitly captured values as well.", "operands": [ { "name": "init", "type": "Variadic" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "parallel_iterations", "type": "I64Attr" }, { "name": "cond_attrs", "type": "OptionalAttr" }, { "name": "body_attrs", "type": "OptionalAttr" }, { "name": "cond_region_attrs", "type": "OptionalAttr" }, { "name": "body_region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "cond_region", "type": "SizedRegion<1>" }, { "name": "body_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`(` $init^ `)`)? (`[` $ctls^ `]`)?\n $cond_region\n `do`\n $body_region\n attr-dict (`:` functional-type($init, $outs)^)?" }, { "name": "tfg.While", "summary": "A functional while loop operation.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "cond", "type": "TFType_FuncAttr" }, { "name": "body", "type": "TFType_FuncAttr" }, { "name": "parallel_iterations", "type": "I64Attr" }, { "name": "T", "type": "OptionalAttr>" }, { "name": "output_shapes", "type": "OptionalAttr>" } ] }, { "name": "tfg.WhileRegion", "summary": "A region-based while loop operation.", "description": "A `While` operation in region form. The operation takes N operands and\n produces N results of the same types. Each region has N data block arguments\n and N corresponding control tokens.\n\n The entry into the condition region is blocked on the operation's control\n operands. The operation always executes the condition region at least once\n with the arguments as the operation's data operands. If the condition region\n returns `true`, the body region is executed with the arguments provided to\n the condition region. The body region will branch back to the condition\n region with N results. If `false`, the condition region will branch back to\n the parent `While` operation with the argument values as results.\n\n For each region, the operation contains optional \"call\" attributes and\n region attributes. The number of argument attributes must match the number\n of data operands and the number of result attributes must match the number\n of data results.\n\n Values can be propagated through the loop bodies as iteration variables,\n but the regions allow implicitly captured values as well.", "operands": [ { "name": "init", "type": "Variadic" }, { "name": "ctls", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" }, { "name": "ctl", "type": "ControlType" } ], "attributes": [ { "name": "parallel_iterations", "type": "I64Attr" }, { "name": "cond_attrs", "type": "OptionalAttr" }, { "name": "body_attrs", "type": "OptionalAttr" }, { "name": "cond_region_attrs", "type": "OptionalAttr" }, { "name": "body_region_attrs", "type": "OptionalAttr" } ], "regions": [ { "name": "cond_region", "type": "SizedRegion<1>" }, { "name": "body_region", "type": "SizedRegion<1>" } ], "defaultDialect": "tfg", "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`(` $init^ `)`)? (`[` $ctls^ `]`)?\n $cond_region\n `do`\n $body_region\n attr-dict (`:` functional-type($init, $outs)^)?" }, { "name": "tfg.yield", "summary": "TF graph terminator for control-flow regions.", "description": "The `yield` operation is the terminator for control-flow regions. The\n operation takes data operands and control results. All data operands are\n inputs for successor regions. Typically, this means that the number of\n data operands matches the number of results of the parent operation.\n\n The semantics of function calls in TensorFlow mean that the region \"returns\"\n data operands as they become available so that users can start executing\n immediately. All functional control-flow operations behave as multi-device\n function calls, which means that the control result of the parent operation\n depends on the control operands of the `yield`.", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "ctls", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`(` $args^ `)`)? (`[` $ctls^ `]`)? attr-dict\n (`:` type($args)^)?" }, { "name": "tfl.abs", "summary": "Absolute value operator", "description": "Given a tensor `x`, this operation returns a tensor containing the absolute\nvalue of each element in `x`. For example, if x is an input element and y is\nan output element, this operation computes \\\\(y = |x|\\\\).", "operands": [ { "name": "x", "type": "TFL_TensorOf<[I16, I32, F32, QI8, QI16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[I16, I32, F32, QI8, QI16]>" } ] }, { "name": "tfl.add", "summary": "Addition operator", "description": "Element-wise addition operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, F16, I16, I32, I64, QI8, QUI8, QI16]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, F16, I16, I32, I64, QI8, QUI8, QI16]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I16, I32, I64, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.add_n", "summary": "add_n operator", "description": "Adds all input tensors element-wise.", "operands": [ { "name": "inputs", "type": "TFL_VariadicTensorOf<[F32, I32]>" } ], "results": [ { "name": "sum", "type": "TFL_TensorOf<[F32, I32]>" } ] }, { "name": "tfl.arg_max", "summary": "ArgMax operator", "description": "Returns the index with the largest value across dimensions of a tensor.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[I1, F32, I32, I8, UI8, QI8, QUI8]>" }, { "name": "dim", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_I32OrI64Tensor" } ] }, { "name": "tfl.arg_min", "summary": "ArgMin operator", "description": "Returns the index with the smallest value across dimensions of a tensor.\n a = [1, 10, 26.9, 2.8, 166.32, 62.3]\n b = tf.math.argmin(input = a)\n c = tf.keras.backend.eval(b)", "operands": [ { "name": "input", "type": "TFL_TensorOf<[I1, F32, I32, I8, UI8, QI8, QUI8]>" }, { "name": "dim", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_I32OrI64Tensor" } ] }, { "name": "tfl.assign_variable", "summary": "Assigns a new value to a variable.", "description": "Any ReadVariableOp with a control dependency on this op is guaranteed to return\nthis value or a subsequent newer value of the variable.", "operands": [ { "name": "resource_id", "type": "TFL_ResourceTensor" }, { "name": "value", "type": "TFL_TensorOf<[F32, F64, I1, UI8, I8, QI8, QUI8, I32, I64, QI16, Complex>, Complex>]>" } ] }, { "name": "tfl.atan2", "summary": "Atan2 operation", "description": "The \"atan2\" operation computes the arctangent of y/x element-wise,\n respecting signs of the arguments.", "operands": [ { "name": "y", "type": "TFL_TensorOf<[F32, F64]>" }, { "name": "x", "type": "TFL_TensorOf<[F32, F64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F64]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "tfl.average_pool_2d", "summary": "Average_pool_2d operator", "description": "Performs average-pooling operation on input.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "filter_height", "type": "I32Attr" }, { "name": "filter_width", "type": "I32Attr" }, { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_h", "type": "I32Attr" }, { "name": "stride_w", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" } ] }, { "name": "tfl.basic_lstm", "summary": "The basic lstm operator", "description": "basic LSTM Cell Operator.", "operands": [ { "name": "data_input", "type": "TFL_TensorOf<[F32, QUI8]>" }, { "name": "prev_activ_input", "type": "TFL_TensorOf<[F32, QUI8]>" }, { "name": "weights_input", "type": "TFL_TensorOf<[F32, QUI8]>" }, { "name": "biases_input", "type": "TFL_TensorOf<[F32, QI32]>" }, { "name": "prev_state_input", "type": "TFL_TensorOf<[F32, QI16]>" } ], "results": [ { "name": "activ_output", "type": "TFL_2DTensorOf<[F32, QUI8]>" }, { "name": "state_output", "type": "TFL_2DTensorOf<[F32, QUI16]>" }, { "name": "concat_temp", "type": "TFL_2DTensorOf<[F32, QUI8]>" }, { "name": "activ_temp", "type": "TFL_2DTensorOf<[F32, QUI16]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "DefaultValuedStrAttr" }, { "name": "cell_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "proj_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "kernel_type", "type": "ConfinedAttr, [TFL_LSTMKernelTypeEqualsTo]>" } ] }, { "name": "tfl.batch_matmul", "category": "Layer", "summary": "Batch Matrix Multiply Operator", "description": "Performs a batched matrix multiplication on the inputs. Follows the\nconventions of TensorFlow BatchMatMulV2, with support for unknown dimensions\nin the batch dimensions and broadcasting.\n\n Inputs:\n `inputs[0]`: required: input LHS\n `inputs[1]`: required: input RHS\n `adjoint_lhs`: optional: Transpose LHS (default false)\n `adjoint_rhs`: optional: Transpose RHS (default false)", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, F16, QI8, QI16, I8]>" }, { "name": "y", "type": "TFL_TensorOf<[F32, F16, QI8, QI16, I8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, QI8, QI16, I32]>" } ], "attributes": [ { "name": "adj_x", "type": "DefaultValuedOptionalAttr" }, { "name": "adj_y", "type": "DefaultValuedOptionalAttr" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" } ] }, { "name": "tfl.batch_to_space_nd", "summary": "BatchToSpaceNd operator", "description": "This operation reshapes the \"batch\" dimension 0 into space dimensions.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I8, I32, I64, UI8, QI8, QUI8, QI16]>" }, { "name": "block_shape", "type": "TFL_TensorOf<[I32]>" }, { "name": "indices", "type": "TFL_TensorOf<[I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I16, I32, I64, UI8, QI8, QUI8, QI16]>" } ] }, { "name": "tfl.bidirectional_sequence_lstm", "summary": "Bidirectional sequence lstm operator", "description": "Bidirectional lstm is essentially two lstms, one running forward & the\n other running backward. And the output is the concatenation of the two\n lstms.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_input_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_input_to_forget_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_input_to_cell_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_input_to_output_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_recurrent_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_recurrent_to_forget_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_recurrent_to_cell_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_recurrent_to_output_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "fw_cell_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_cell_to_forget_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_cell_to_output_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_input_gate_bias", "type": "TFL_TensorOfOrNone<[F32]>" }, { "name": "fw_forget_gate_bias", "type": "TFL_TensorOf<[F32]>" }, { "name": "fw_cell_bias", "type": "TFL_TensorOf<[F32]>" }, { "name": "fw_output_gate_bias", "type": "TFL_TensorOf<[F32]>" }, { "name": "fw_projection_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_projection_bias", "type": "TFL_TensorOfOrNone<[F32]>" }, { "name": "bw_input_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_input_to_forget_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "bw_input_to_cell_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "bw_input_to_output_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "bw_recurrent_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_recurrent_to_forget_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "bw_recurrent_to_cell_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "bw_recurrent_to_output_weights", "type": "TFL_TensorOf<[F32, I8]>" }, { "name": "bw_cell_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_cell_to_forget_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_cell_to_output_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_input_gate_bias", "type": "TFL_TensorOfOrNone<[F32]>" }, { "name": "bw_forget_gate_bias", "type": "TFL_TensorOf<[F32]>" }, { "name": "bw_cell_bias", "type": "TFL_TensorOf<[F32]>" }, { "name": "bw_output_gate_bias", "type": "TFL_TensorOf<[F32]>" }, { "name": "bw_projection_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_projection_bias", "type": "TFL_TensorOfOrNone<[F32]>" }, { "name": "fw_input_activation_state", "type": "TFL_StatefulTensor" }, { "name": "fw_input_cell_state", "type": "TFL_StatefulTensor" }, { "name": "bw_input_activation_state", "type": "TFL_StatefulTensor" }, { "name": "bw_input_cell_state", "type": "TFL_StatefulTensor" }, { "name": "aux_input", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_aux_input_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_aux_input_to_forget_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_aux_input_to_cell_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "fw_aux_input_to_output_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_aux_input_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_aux_input_to_forget_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_aux_input_to_cell_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" }, { "name": "bw_aux_input_to_output_weights", "type": "TFL_TensorOfOrNone<[F32, I8]>" } ], "results": [ { "name": "fw_output", "type": "AnyTensor" }, { "name": "bw_output", "type": "AnyTensor" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "cell_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "proj_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "merge_outputs", "type": "BoolAttr" }, { "name": "time_major", "type": "BoolAttr" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" } ] }, { "name": "tfl.bitcast", "summary": "Bitcast operator", "description": "Bitcasts a tensor from one type to another.", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tfl.bitwise_xor", "summary": "Bitwise Xor operator", "description": "Elementwise computes the bitwise XOR of `lhs` and `rhs`.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[I8, UI8, I16, UI16, I32, UI32]>" }, { "name": "rhs", "type": "TFL_TensorOf<[I8, UI8, I16, UI16, I32, UI32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I8, UI8, I16, UI16, I32, UI32]>" } ] }, { "name": "tfl.broadcast_args", "summary": "Return the shape of s0 op s1 with broadcast.", "description": "Given `s0` and `s1`, tensors that represent shapes, compute `r0`, the\nbroadcasted shape. `s0`, `s1` and `r0` are all integer vectors.", "operands": [ { "name": "s0", "type": "TFL_I32OrI64Tensor" }, { "name": "s1", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "r0", "type": "TFL_I32OrI64Tensor" } ] }, { "name": "tfl.broadcast_to", "summary": "Broadcast an array for a compatible shape.", "description": "Broadcasting is the process of making arrays to have compatible shapes\nfor arithmetic operations. Two shapes are compatible if for each\ndimension pair they are either equal or one of them is one. When trying\nto broadcast a Tensor to a shape, it starts with the trailing dimensions,\nand works its way forward.\n\nFor example,\n\n>>> x = tf.constant([1, 2, 3])\n>>> y = tf.broadcast_to(x, [3, 3])\n>>> print(y)\ntf.Tensor(\n [[1 2 3]\n [1 2 3]\n [1 2 3]], shape=(3, 3), dtype=int32)\n\nIn the above example, the input Tensor with the shape of `[1, 3]`\nis broadcasted to output Tensor with shape of `[3, 3]`.\n\nWhen doing broadcasted operations such as multiplying a tensor\nby a scalar, broadcasting (usually) confers some time or space\nbenefit, as the broadcasted tensor is never materialized.\n\nHowever, `broadcast_to` does not carry with it any such benefits.\nThe newly-created tensor takes the full memory of the broadcasted\nshape. (In a graph context, `broadcast_to` might be fused to\nsubsequent operation and then be optimized away, however.)", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I1, TFL_I4, I8, QI8, UI8, UI32, QUI8, I16, QI16, I64, Complex>]>" }, { "name": "shape", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I1, TFL_I4, I8, QI8, UI8, UI32, QUI8, I16, QI16, I64, Complex>]>" } ] }, { "name": "tfl.bucketize", "summary": "Bucketizes 'input' based on 'boundaries'.", "description": "Example:\n\nIf the inputs are `boundaries = [0, 10, 100]` and\n`input = [[-5, 10000][150, 10][5, 100]]`,\nthen the output will be `output = [[0, 3][3, 2][1, 3]]`.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F64, I32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I32]>" } ], "attributes": [ { "name": "boundaries", "type": "TypedArrayAttrBase" } ] }, { "name": "tfl.call_once", "summary": "Invokes an initialization function", "description": "This operation invokes the given initialization function for the session\ninitializer in tf saved model dialect.", "attributes": [ { "name": "session_init_function", "type": "StrAttr" } ] }, { "name": "tfl.cast", "summary": "Cast operator", "description": "Casts input from input type to output type.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F16, BF16, F32, F64, I1, TFL_I2, TFL_I4, UI<4>, I16, UI16, I32, UI32, I64, TFL_Quint8, UI8, I8, Complex>]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F16, BF16, F32, F64, I1, TFL_I2, TFL_I4, UI<4>, I16, UI16, I32, UI32, I64, TFL_Quint8, UI8, I8, Complex>]>" } ] }, { "name": "tfl.ceil", "summary": "Ceil operator", "description": "Returns element-wise ceil value of the input.", "operands": [ { "name": "x", "type": "TFL_FpTensor" } ], "results": [ { "name": "y", "type": "TFL_FpTensor" } ] }, { "name": "tfl.complex_abs", "summary": "Computes the complex absolute value of a tensor.", "description": "Given a tensor `x` of complex numbers, this operation returns a tensor of type\n`float` or `double` that is the absolute value of each element in `x`. All\nelements in `x` must be complex numbers of the form \\\\(a + bj\\\\). The absolute\nvalue is computed as \\\\( \\sqrt{a^2 + b^2}\\\\).", "operands": [ { "name": "input", "type": "TFL_TensorOf<[Complex>, Complex>]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F64]>" } ] }, { "name": "tfl.concatenation", "summary": "Concatenation operator", "description": "Concatenates tensors along one dimension", "operands": [ { "name": "values", "type": "TFL_VariadicTensorOf<[F32, F16, I64, I32, I16, QI4, I8, QI8, QUI8, UI8, UI32, I1]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I64, I32, I16, QI4, I8, QI8, QUI8, UI8, UI32, I1]>" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" } ] }, { "name": "tfl.control_node", "summary": "The `TFL.control_node` operation wraps single-block operations in order to attach control edges.", "description": "This is used to wrap regions and attach control dependencies to them. Typically,\n this will happen in one of the last steps before emitting the flatbuffer model\n in order to enable optimizations that rely on a fixed order of operations (such\n as rematerialization.)\n The flatbuffer exporter will unwrap the wrapped region and annotate the generated\n model with metadata such that any runtime reorderings will respect the order\n given by the control dependencies.", "operands": [ { "name": "controlInputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control", "type": "TFL_Control" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.conv_2d", "category": "Layer", "summary": "Convolution operator", "description": "Performs convolution operation on inputs.\n\n Inputs:\n `inputs[0]`: required: the input activation tensor\n `inputs[1]`: required: the filter weight tensor\n `inputs[2]`: optional: the bias tensor", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" }, { "name": "filter", "type": "TFL_TensorOf<[F32, QI4, QI8, QUI8]>" }, { "name": "bias", "type": "TFL_1DTensorOfOrNone<[F32, I32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "dilation_h_factor", "type": "I32Attr" }, { "name": "dilation_w_factor", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_h", "type": "I32Attr" }, { "name": "stride_w", "type": "I32Attr" } ] }, { "name": "tfl.conv_3d", "summary": "Convolution 3D operator", "description": "Performs convolution operation on 3D inputs.\n Inputs:\n `inputs[0]`: required: the input activation tensor\n `inputs[1]`: required: the filter weight tensor\n `inputs[2]`: optional: the bias tensor", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32]>" }, { "name": "filter", "type": "TFL_TensorOf<[F32]>" }, { "name": "bias", "type": "TFL_TensorOfOrNone<[F32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32]>" } ], "attributes": [ { "name": "dilation_d_factor", "type": "I32Attr" }, { "name": "dilation_h_factor", "type": "I32Attr" }, { "name": "dilation_w_factor", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_d", "type": "I32Attr" }, { "name": "stride_h", "type": "I32Attr" }, { "name": "stride_w", "type": "I32Attr" } ] }, { "name": "tfl.conv_3d_transpose", "summary": "Transposed Convolution 3D operator", "description": "Performs transposed convolution operation on 3D inputs.\n Inputs:\n `inputs[0]`: required: the shape of output tensor\n `inputs[1]`: required: the filter weight tensor\n `inputs[2]`: required: the input activation tensor\n `inputs[3]`: optional: the bias tensor", "operands": [ { "name": "output_shape", "type": "TFL_I32Tensor" }, { "name": "filter", "type": "TFL_TensorOf<[F32]>" }, { "name": "input", "type": "TFL_TensorOf<[F32]>" }, { "name": "bias", "type": "TFL_TensorOfOrNone<[F32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32]>" } ], "attributes": [ { "name": "dilation_d_factor", "type": "I32Attr" }, { "name": "dilation_h_factor", "type": "I32Attr" }, { "name": "dilation_w_factor", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_d", "type": "I32Attr" }, { "name": "stride_h", "type": "I32Attr" }, { "name": "stride_w", "type": "I32Attr" } ] }, { "name": "tfl.cos", "summary": "Cosine operator", "description": "Computes element-wise Cosine of input", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, F16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, F16]>" } ] }, { "name": "tfl.cumsum", "summary": "Cumsum operator", "description": "Compute the cumulative sum of the tensor x along axis.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64]>" }, { "name": "axis", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64]>" } ], "attributes": [ { "name": "exclusive", "type": "DefaultValuedOptionalAttr" }, { "name": "reverse", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.custom", "summary": "Custom op", "description": "A generic op for any TFLite custom operation.\n\n input: A list of inputs in the original op.\n custom_code: A string used to identify which exactly this op is, which\n corresponds to operator_codes.custom_code in the flatbuffer.\n custom_option: a holder to save the op attributes in bytes fashion.\n output: A list of outputs in the original op.", "operands": [ { "name": "input", "type": "Variadic>" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "custom_code", "type": "StrAttr" }, { "name": "custom_option", "type": "TFL_ConstBytesAttr" } ] }, { "name": "tfl.custom_tf", "summary": "Wrapper Op for TF custom ops.", "description": "A wrapper op around any Custom TF op. These includes ops defined using\n custom_opdefs or linked which are not defined in TF dialect.\n This Op just wraps the custom op inside a region.\n Note #1, this Op will not include TF Lite custom ops defined using CustomOp.\n Note #2, this op is just internal representation inside the converter and\n are not exposed/exported when the model is exported to Flatbuffer.", "operands": [ { "name": "input", "type": "Variadic>" } ], "results": [ { "name": "output", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "tfl.densify", "summary": "Densify operator", "description": "Converts sparse tensor to dense format.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8]>" } ] }, { "name": "tfl.depth_to_space", "summary": "DepthToSpace operator", "description": "Rearranges data from depth into blocks of spatial data.\n This is the reverse transformation of SpaceToDepth. More specifically,\n this op outputs a copy of the input tensor where values from the `depth`\n dimension are moved in spatial blocks to the `height` and `width`\n dimensions. The attr `block_size` indicates the input block size and how\n the data is moved.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I8, I32, I64, TFL_Quint8, UI8, QI8, QUI8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8, I32, I64, TFL_Quint8, UI8, QI8, QUI8]>" } ], "attributes": [ { "name": "block_size", "type": "ConfinedAttr" } ] }, { "name": "tfl.depthwise_conv_2d", "summary": "Depthwise-separable convolution operator", "description": "Performs convolution operation on inputs.\n\n Inputs:\n `inputs[0]`: required: the input activation tensor\n `inputs[1]`: required: the filter weight tensor\n `inputs[2]`: optional: the bias tensor", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" }, { "name": "filter", "type": "TFL_TensorOf<[F32, QI4, QI8, QUI8]>" }, { "name": "bias", "type": "TFL_1DTensorOfOrNone<[F32, I32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "dilation_h_factor", "type": "I32Attr" }, { "name": "dilation_w_factor", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_h", "type": "I32Attr" }, { "name": "stride_w", "type": "I32Attr" }, { "name": "depth_multiplier", "type": "I32Attr" } ] }, { "name": "tfl.dequantize", "summary": "Dequantize operator", "description": "Converts quantized array of integers to floating-points according to the\n quantization parameters.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[QI2, QI4, QUI4, QI8, QUI8, QI16, F16]>" } ], "results": [ { "name": "output", "type": "TFL_FpTensor" } ] }, { "name": "tfl.dilate", "summary": "Dilation operator", "description": "Extends a tensor by adding new elements between the existing ones.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[I8, I16, I32, I64, UI8, UI16, UI32, UI64, F32, F64]>" }, { "name": "dilations", "type": "TFL_TensorOf<[I32]>" }, { "name": "padding_value", "type": "TFL_0DTensorOf<[I8, I16, I32, I64, UI8, UI16, UI32, UI64, F32, F64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I8, I16, I32, I64, UI8, UI16, UI32, UI64, F32, F64]>" } ] }, { "name": "tfl.div", "summary": "Division operator", "description": "Element-wise division operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, F16, I32, QUI8, QI8, QI16]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, F16, I32, QUI8, QI8, QI16]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, QUI8, QI8, QI16]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.dynamic_update_slice", "summary": "DynamicUpdateSlice.", "description": "DynamicUpdateSlice op that have the same semantics with XLA\n DynamicUpdateSlice.\n Generates a result which is the value of the input array\n operand, with a slice update overwritten at start_indices.\n\n See https://www.tensorflow.org/xla/operation_semantics#dynamicupdateslice.", "operands": [ { "name": "operand", "type": "TFL_TensorOf<[I1, TFL_I4, QI4, QI8, I8, I16, I32, I64, F32, F16]>" }, { "name": "update", "type": "TFL_TensorOf<[I1, TFL_I4, QI4, QI8, I8, I16, I32, I64, F32, F16]>" }, { "name": "start_indices", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I1, TFL_I4, QI4, QI8, I8, I16, I32, I64, F32, F16]>" } ] }, { "name": "tfl.elu", "summary": "Exponential Linear Unit operator", "description": "Computes the exponential linear\n f(x) -> exp(x) - 1 for x < 0, x for x >= 0.\n element-wise.", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, I8]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, I8]>" } ] }, { "name": "tfl.embedding_lookup", "summary": "Embedding lookup operator", "description": "Looks up ids in a list of embedding tensors.", "operands": [ { "name": "lookup", "type": "TFL_TensorOf<[I32]>" }, { "name": "value", "type": "TFL_TensorOf<[F32, I8, UI8, QI8, QUI8, QI4, QI2]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8, UI8]>" } ] }, { "name": "tfl.equal", "summary": "Equal operator", "description": "Returns the truth element of x == y element-wise", "operands": [ { "name": "x", "type": "TFL_TensorOf<[I1, F32, I16, I32, I64, QI8, QUI8, QI16, UI8, TFL_Str]>" }, { "name": "y", "type": "TFL_TensorOf<[I1, F32, I16, I32, I64, QI8, QUI8, QI16, UI8, TFL_Str]>" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ] }, { "name": "tfl.exp", "summary": "Natural exponentiation operator", "description": "Performs element-wise natural exponentiation operation on input.", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, F16, QI8, QI16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, F16, QI8, QI16]>" } ] }, { "name": "tfl.expand_dims", "summary": "Inserts a dimension of 1 into a tensor's shape.", "description": "Given a tensor `input`, this operation inserts a dimension of 1 at the\ndimension index `axis` of `input`'s shape. The dimension index `axis` starts at\nzero; if you specify a negative number for `axis` it is counted backward from\nthe end.\n\nThis operation is useful if you want to add a batch dimension to a single\nelement. For example, if you have a single image of shape `[height, width,\nchannels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`,\nwhich will make the shape `[1, height, width, channels]`.\n\nOther examples:\n\n```\n# 't' is a tensor of shape [2]\nshape(expand_dims(t, 0)) ==> [1, 2]\nshape(expand_dims(t, 1)) ==> [2, 1]\nshape(expand_dims(t, -1)) ==> [2, 1]\n\n# 't2' is a tensor of shape [2, 3, 5]\nshape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]\nshape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]\nshape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]\n```\n\nThis operation requires that:\n\n`-1-input.dims() <= dim <= input.dims()`\n\nThis operation is related to `squeeze()`, which removes dimensions of\nsize 1.", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "dim", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tfl.external_const", "summary": "External const op.", "description": "External const op that can hold :\n - `buffer_index` which points to a constant in the flatbuffer.\n - `external_buffer` which contains metadata for external buffer outside flatbuffer.", "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "buffer_index", "type": "OptionalAttr" }, { "name": "external_buffer", "type": "OptionalAttr" } ] }, { "name": "tfl.fake_quant", "summary": "FakeQuant operator", "description": "Fake-quantize the 'inputs' tensor of type float via float scalars min and\n max to 'outputs' tensor of same shape as inputs.", "operands": [ { "name": "input", "type": "TFL_FpTensor" } ], "results": [ { "name": "output", "type": "TFL_FpTensor" } ], "attributes": [ { "name": "min", "type": "F32Attr" }, { "name": "max", "type": "F32Attr" }, { "name": "num_bits", "type": "ConfinedAttr, IntMaxValue<16>]>" }, { "name": "narrow_range", "type": "ConfinedAttr" } ] }, { "name": "tfl.fill", "summary": "Fill the tensor with given value.", "description": "Fill the tensor with given value.", "operands": [ { "name": "dims", "type": "TFL_I32OrI64Tensor" }, { "name": "input", "type": "TFL_TensorOf<[F32, F16, I32, I64, I1, QI8, QI16, TFL_Str]>" } ], "results": [ { "name": "result", "type": "TFL_TensorOf<[F32, F16, I32, I64, I1, QI8, QI16, TFL_Str]>" } ] }, { "name": "tfl.floor", "summary": "Floor operator", "description": "Returns element-wise floor value of the input.", "operands": [ { "name": "x", "type": "TFL_FpTensor" } ], "results": [ { "name": "y", "type": "TFL_FpTensor" } ] }, { "name": "tfl.floor_div", "summary": "Floor div operator", "description": "Element-wise floor div operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I8, I16, I32]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I8, I16, I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8, I16, I32]>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.floor_mod", "summary": "Division reminder", "description": "Element-wise division reminder operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[I8, I16, I32, I64, F32]>" }, { "name": "rhs", "type": "TFL_TensorOf<[I8, I16, I32, I64, F32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I8, I16, I32, I64, F32]>" } ] }, { "name": "tfl.fully_connected", "category": "Layer", "summary": "Fully connected op", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8, QI16, QUI16]>" }, { "name": "filter", "type": "TFL_TensorOf<[F32, F16, QI2, QI4, QI8, QUI8, QI16]>" }, { "name": "bias", "type": "TFL_TensorOfOrNone<[F32, F16, QI32, QUI32]>" } ], "results": [ { "name": "output", "type": "TFL_VariadicTensorOf<[F32, F16, QI8, QUI8, QI16, QUI16]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "weights_format", "type": "TFL_FullyConnectedOptionsWeightFormatAttr" }, { "name": "keep_num_dims", "type": "BoolAttr" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" } ] }, { "name": "tfl.gather", "category": "Tensor", "summary": "Gather operator", "description": "Gather slices from `params` axis `axis` according to `indices`.", "operands": [ { "name": "params", "type": "TFL_TensorOf<[F32, I1, TFL_I4, I8, I16, I32, I64, TFL_Str, UI8, QI8, QUI8, QI16]>" }, { "name": "indices", "type": "TFL_TensorOf<[I16, I32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I1, TFL_I4, I8, I16, I32, I64, TFL_Str, UI8, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "batch_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.gather_nd", "summary": "Gather_nd operator", "description": "Gather slices from `params` into a Tensor with shape specified by `indices`.", "operands": [ { "name": "params", "type": "TFL_TensorOf<[F32, I1, I8, I16, I64, I32, UI8, QI8, TFL_Str]>" }, { "name": "indices", "type": "TFL_TensorOf<[I16, I32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I1, I8, I16, I64, I32, UI8, QI8, TFL_Str]>" } ] }, { "name": "tfl.gelu", "summary": "GELU activation function.", "description": "Computes GELU activation function element-wise.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8]>" } ], "attributes": [ { "name": "approximate", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.greater", "summary": "Greater operator", "description": "Element-wise greater operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I32, I64, QUI8, QI8, TFL_Quint8]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I32, I64, QUI8, QI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.greater_equal", "summary": "Greater_equal operator", "description": "Element-wise greater_equal operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I16, I32, I64, QUI8, QI8]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I16, I32, I64, QUI8, QI8]>" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.hard_swish", "summary": "Hardswish activation function.", "description": "Computes hard-swish activation function\n f(x) -> (x * relu6(x+3))/6\n element-wise.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ] }, { "name": "tfl.hashtable", "summary": "Creates a non-initialized hash table.", "description": "This op creates a hash table, specifying the type of its keys and values.\nBefore using the table you will have to initialize it. After initialization the\ntable will be immutable.", "results": [ { "name": "out", "type": "TFL_ResourceTensor" } ], "attributes": [ { "name": "table_id", "type": "I32Attr" }, { "name": "key_dtype", "type": "TypeAttr" }, { "name": "value_dtype", "type": "TypeAttr" } ] }, { "name": "tfl.hashtable_find", "summary": "Looks up keys in a table, outputs the corresponding values.", "description": "The tensor `keys` must of the same type as the keys of the table.\nThe output `values` is of the type of the table values.\n\nThe scalar `default_value` is the value output for keys not present in the\ntable. It must also be of the same type as the table values.", "operands": [ { "name": "hash_table", "type": "TFL_ResourceTensor" }, { "name": "keys", "type": "TFL_TensorOf<[I32, TFL_Str, I64]>" }, { "name": "default_value", "type": "TFL_TensorOf<[F32, I32, TFL_Str, I64]>" } ], "results": [ { "name": "out", "type": "TFL_TensorOf<[F32, I32, TFL_Str, I64]>" } ] }, { "name": "tfl.hashtable_import", "summary": "Replaces the contents of the table with the specified keys and values.", "description": "The tensor `keys` must be of the same type as the keys of the table.\nThe tensor `values` must be of the type of the table values.", "operands": [ { "name": "hash_table", "type": "TFL_ResourceTensor" }, { "name": "keys", "type": "TFL_TensorOf<[I32, TFL_Str, I64]>" }, { "name": "values", "type": "TFL_TensorOf<[F32, I32, TFL_Str, I64]>" } ] }, { "name": "tfl.hashtable_size", "summary": "Computes the number of elements in the given table.", "operands": [ { "name": "hash_table", "type": "TFL_ResourceTensor" } ], "results": [ { "name": "out", "type": "TFL_I64Tensor" } ] }, { "name": "tfl.if", "summary": "if-then-else operation", "description": "The `tfl.if` operation represents an if-then-else construct for\n conditionally executing two regions of code. The operand to an if operation\n is a boolean value. For example:\n\n ```mlir\n tfl.if %b {\n ...\n } else {\n ...\n }\n ```\n\n `tfl.if` may also return results that are defined in its regions. The\n values defined are determined by which execution path is taken.\n\n Example:\n\n ```mlir\n %x, %y = tfl.if %b -> (tensor, tensor) {\n %x_true = ...\n %y_true = ...\n tfl.yield %x_true, %y_true : tensor, tensor\n } else {\n %x_false = ...\n %y_false = ...\n tfl.yield %x_false, %y_false : tensor, tensor\n }\n ```\n\n `tfl.if` regions are always terminated with \"tfl.yield\". If \"tfl.if\"\n defines no values, the \"tfl.yield\" can be left out, and will be inserted\n implicitly. Otherwise, it must be explicit.\n Also, if \"tfl.if\" defines one or more values, the 'else' block cannot be\n omitted.\n\n Example:\n\n ```mlir\n tfl.if %b {\n ...\n }\n ```", "operands": [ { "name": "cond", "type": "TFL_BoolTensor" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "then_region", "type": "SizedRegion<1>" }, { "name": "else_region", "type": "AnyRegion" } ] }, { "name": "tfl.imag", "summary": "Returns the imaginary part of a complex number.", "description": "Given a tensor `input` of complex numbers, this operation returns a tensor of\ntype `float` that is the imaginary part of each element in `input`. All\nelements in `input` must be complex numbers of the form \\\\(a + bj\\\\), where *a*\nis the real part and *b* is the imaginary part returned by this operation.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[Complex>, Complex>]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F64]>" } ] }, { "name": "tfl.l2_normalization", "summary": "L2 Normalize Operator", "description": "L2Normalization Op", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QUI8, QI8, QUI16, QI16, I8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QUI8, QI8, QUI16, QI16, I8]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" } ] }, { "name": "tfl.leaky_relu", "summary": "Leaky Relu operator", "description": "Element-wise Leaky ReLU operator\n x -> x >= 0 ? x : (alpha * x)", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QUI8, QI8, TFL_Quint8, QI16]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QUI8, QI8, TFL_Quint8, QI16]>" } ], "attributes": [ { "name": "alpha", "type": "F32Attr" } ] }, { "name": "tfl.less", "summary": "Less operator", "description": "Element-wise less operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I16, I32, I64, QUI8, QI8, TFL_Quint8]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I16, I32, I64, QUI8, QI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.less_equal", "summary": "Less_equal operator", "description": "Element-wise less_equal operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8]>" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.local_response_normalization", "summary": "Local Response Normalization.", "description": "The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last\ndimension), and each vector is normalized independently. Within a given vector,\neach component is divided by the weighted, squared sum of inputs within\n`depth_radius`. In detail,\n\n sqr_sum[a, b, c, d] =\n sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)\n output = input / (bias + alpha * sqr_sum) ** beta\n\nFor details, see [Krizhevsky et al., ImageNet classification with deep\nconvolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).", "operands": [ { "name": "input", "type": "TFL_FpTensor" } ], "results": [ { "name": "output", "type": "TFL_FpTensor" } ], "attributes": [ { "name": "radius", "type": "I32Attr" }, { "name": "bias", "type": "F32Attr" }, { "name": "alpha", "type": "F32Attr" }, { "name": "beta", "type": "F32Attr" } ] }, { "name": "tfl.log", "summary": "Natural logarithm operator", "description": "Performs element-wise natural logarithm operation on input.", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QI8]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QI8]>" } ] }, { "name": "tfl.log_softmax", "summary": "Log softmax operator", "description": "Computes element-wise log softmax activations with the following formula\n\n input - log(reduce_sum(exp(input), dim))", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QUI8, QI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QUI8, QI8, TFL_Quint8]>" } ] }, { "name": "tfl.logical_and", "summary": "Logical AND operator", "description": "Element-wise logical AND operation.", "operands": [ { "name": "lhs", "type": "TFL_BoolTensor" }, { "name": "rhs", "type": "TFL_BoolTensor" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.logical_not", "summary": "Logical NOT operator", "description": "Element-wise logical NOT operation.", "operands": [ { "name": "lhs", "type": "TFL_BoolTensor" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "tfl.logical_or", "summary": "Logical OR operator", "description": "Element-wise logical OR operation.", "operands": [ { "name": "lhs", "type": "TFL_BoolTensor" }, { "name": "rhs", "type": "TFL_BoolTensor" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.logistic", "summary": "Logistic operator", "description": "Computes element-wise Sigmoid of input", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16, TFL_Quint8]>" } ] }, { "name": "tfl.lstm", "summary": "The full lstm operator", "description": "Long short-term memory unit (LSTM) recurrent network layer.\nThe default non-peephole implementation is based on:\nhttp://deeplearning.cs.cmu.edu/pdfs/Hochreiter97_lstm.pdf\nS. Hochreiter and J. Schmidhuber. 'Long Short-Term Memory'. Neural Computation,\n9(8):1735-1780, 1997.\nThe peephole implementation is based on:\nhttps://research.google.com/pubs/archive/43905.pdf\nHasim Sak, Andrew Senior, and Francoise Beaufays. 'Long short-term memory\nrecurrent neural network architectures for large scale acoustic modeling.'\nINTERSPEECH, 2014.\nThe coupling of input and forget gate (CIFG) is based on:\nhttp://arxiv.org/pdf/1503.04069.pdf\nGreff et al. 'LSTM: A Search Space Odyssey'\nThe layer normalization is based on:\nhttps://arxiv.org/pdf/1607.06450.pdf\nBa et al. 'Layer Normalization'", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI8, QI16]>" }, { "name": "input_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "input_to_forget_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "input_to_cell_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "input_to_output_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "recurrent_to_forget_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_cell_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_output_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "cell_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, QI8, QI16]>" }, { "name": "cell_to_forget_weights", "type": "TFL_TensorOfOrNone<[F32, QI8, QI16]>" }, { "name": "cell_to_output_weights", "type": "TFL_TensorOfOrNone<[F32, QI8, QI16]>" }, { "name": "input_gate_bias", "type": "TFL_TensorOfOrNone<[F32, QI32]>" }, { "name": "forget_gate_bias", "type": "TFL_TensorOf<[F32, QI32]>" }, { "name": "cell_bias", "type": "TFL_TensorOf<[F32, QI32]>" }, { "name": "output_gate_bias", "type": "TFL_TensorOf<[F32, QI32]>" }, { "name": "projection_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "projection_bias", "type": "TFL_TensorOfOrNone<[F32, QI32]>" }, { "name": "input_activation_state", "type": "TFL_StatefulTensor" }, { "name": "input_cell_state", "type": "TFL_StatefulTensor" }, { "name": "input_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI16]>" }, { "name": "forget_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI16]>" }, { "name": "cell_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI16]>" }, { "name": "output_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI16]>" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "cell_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "proj_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "kernel_type", "type": "ConfinedAttr, [TFL_LSTMKernelTypeEqualsTo]>" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" }, { "name": "input_to_input_intermediate", "type": "OptionalAttr" }, { "name": "input_to_forget_intermediate", "type": "OptionalAttr" }, { "name": "input_to_cell_intermediate", "type": "OptionalAttr" }, { "name": "input_to_output_intermediate", "type": "OptionalAttr" }, { "name": "effective_hidden_scale_intermediate", "type": "OptionalAttr" } ], "regions": [ { "name": "internal", "type": "AnyRegion" } ] }, { "name": "tfl.matrix_diag", "summary": "Returns a tensor with the provided diagonal and everything else padded with zeros.", "description": "Given a diagonal, returns a tensor with the diagonal and everything else padded with zeros.\n Assume diagonal has k dimensions `[I, J, K, ..., N]`, then the output is a tensor of rank `k+1`\n with dimensions `[I, J, K, ..., N, N]` where:\n `output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n].`", "operands": [ { "name": "diagonal", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QUI8, QI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QUI8, QI8, TFL_Quint8]>" } ] }, { "name": "tfl.matrix_set_diag", "summary": "Returns a batched matrix tensor with new batched diagonal values.", "description": "Given `input` and `diagonal`, this operation returns a tensor with the\nsame shape and values as `input`, except for the main diagonal of the\ninnermost matrices. These will be overwritten by the values in `diagonal`.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QI8, QI16, QUI8, TFL_Quint8]>" }, { "name": "diagonal", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QI8, QI16, QUI8, TFL_Quint8]>" } ], "results": [ { "name": "result", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QI8, QI16, QUI8, TFL_Quint8]>" } ] }, { "name": "tfl.max_pool_2d", "summary": "Max Pool 2D op", "description": "Performs max pool 2D on input.\n\n Inputs:\n `inputs[0]`: required: the input tensor", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QUI8, QI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QUI8, QI8, QI16, TFL_Quint8]>" } ], "attributes": [ { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_w", "type": "I32Attr" }, { "name": "stride_h", "type": "I32Attr" }, { "name": "filter_width", "type": "I32Attr" }, { "name": "filter_height", "type": "I32Attr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" } ] }, { "name": "tfl.maximum", "summary": "Max operator", "description": "Element-wise max operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, F16, TFL_Int32Or64, QI8, QUI8, QI16]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, F16, TFL_Int32Or64, QI8, QUI8, QI16]>" } ], "results": [ { "name": "max", "type": "TFL_TensorOf<[F32, F16, TFL_Int32Or64, QI8, QUI8, QI16]>" } ] }, { "name": "tfl.mean", "summary": "Mean operator", "description": "Computes the mean of elements across dimensions of a tensor.\n Reduces input_tensor along the dimensions given in axis.\n Unless keepdims is true, the rank of the tensor is reduced by 1 for\n each entry in axis. If keepdims is true, the reduced dimensions are retained\n with length 1.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, UI8, QI16]>" }, { "name": "axis", "type": "TFL_TensorOf<[I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, UI8, QI16]>" } ], "attributes": [ { "name": "keep_dims", "type": "BoolAttr" } ] }, { "name": "tfl.minimum", "summary": "Min operator", "description": "Element-wise min operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, TFL_Int32Or64, QI8, QUI8, QI16]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, TFL_Int32Or64, QI8, QUI8, QI16]>" } ], "results": [ { "name": "min", "type": "TFL_TensorOf<[F32, TFL_Int32Or64, QI8, QUI8, QI16]>" } ] }, { "name": "tfl.mirror_pad", "summary": "MirrorPad Operator. Pads a tensor with mirrored values.", "description": "This operation pads a input with mirrored values according to the paddings\n you specify. paddings is an integer tensor with shape [n, 2],\n where n is the rank of input.\n For each dimension D of input, paddings[D, 0] indicates how many values\n to add before the contents of input in that dimension,\n and paddings[D, 1] indicates how many values to add after the contents of\n input in that dimension.\n\n Both paddings[D, 0] and paddings[D, 1] must be no greater than\n input.dim_size(D) (or input.dim_size(D) - 1)\n if copy_border is true (if false, respectively).\n\n The padded size of each dimension D of the output is:\n\n paddings(D, 0) + input.dim_size(D) + paddings(D, 1)", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64, I8, UI8, QI8, QUI8, QI16]>" }, { "name": "pad", "type": "TFL_TensorOf<[I32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, I8, UI8, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "mode", "type": "TFL_MirrorPaddingAttr{REFLECT|SYMMETRIC}" } ] }, { "name": "tfl.mul", "summary": "Multiplication operator", "description": "Element-wise multiplication operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, F16, I32, UI32, I64, QI8, QUI8, QI16, I16, Complex>]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, F16, I32, UI32, I64, QI8, QUI8, QI16, I16, Complex>]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, UI32, I64, QI8, QUI8, QI16, I16, Complex>]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.multinomial", "summary": "Draws samples from a categorical distribution.", "description": "The generated values will have a categorical distribution based on the `logits`\nor unnormalized log-probabilities provided for all classes.", "operands": [ { "name": "logits", "type": "TFL_FpTensor" }, { "name": "num_samples", "type": "TFL_I32Tensor" } ], "results": [ { "name": "out", "type": "TFL_TensorOf<[I32, I64]>" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.neg", "summary": "Negation operator", "description": "Computes element-wise negation of input", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, I32, I64]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, I32, I64]>" } ] }, { "name": "tfl.no_value", "summary": "constant representing no value.", "description": "No value constant op.", "results": [ { "name": "none_val", "type": "NoneType" } ], "attributes": [ { "name": "value", "type": "UnitAttr" } ] }, { "name": "tfl.non_max_suppression_v4", "summary": "Greedily selects a subset of bounding boxes in descending order of score,", "description": "pruning away boxes that have high intersection-over-union (IOU) overlap\nwith previously selected boxes. Bounding boxes with score less than\n`score_threshold` are removed. Bounding boxes are supplied as\n[y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any\ndiagonal pair of box corners and the coordinates can be provided as normalized\n(i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm\nis agnostic to where the origin is in the coordinate system and more\ngenerally is invariant to orthogonal transformations and translations\nof the coordinate system; thus translating or reflections of the coordinate\nsystem result in the same boxes being selected by the algorithm.\nThe output of this operation is a set of integers indexing into the input\ncollection of bounding boxes representing the selected boxes. The bounding\nbox coordinates corresponding to the selected indices can then be obtained\nusing the `tf.gather operation`. For example:\n selected_indices = tf.image.non_max_suppression_v2(\n boxes, scores, max_output_size, iou_threshold, score_threshold)\n selected_boxes = tf.gather(boxes, selected_indices)", "operands": [ { "name": "boxes", "type": "TFL_FpTensor" }, { "name": "scores", "type": "TFL_FpTensor" }, { "name": "max_output_size", "type": "TFL_I32Tensor" }, { "name": "iou_threshold", "type": "TFL_FpTensor" }, { "name": "score_threshold", "type": "TFL_FpTensor" } ], "results": [ { "name": "selected_indices", "type": "TFL_I32Tensor" }, { "name": "valid_outputs", "type": "TFL_I32Tensor" } ] }, { "name": "tfl.non_max_suppression_v5", "summary": "Greedily selects a subset of bounding boxes in descending order of score,", "description": "pruning away boxes that have high intersection-over-union (IOU) overlap\nwith previously selected boxes. Bounding boxes with score less than\n`score_threshold` are removed. Bounding boxes are supplied as\n[y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any\ndiagonal pair of box corners and the coordinates can be provided as normalized\n(i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm\nis agnostic to where the origin is in the coordinate system and more\ngenerally is invariant to orthogonal transformations and translations\nof the coordinate system; thus translating or reflections of the coordinate\nsystem result in the same boxes being selected by the algorithm.\nThe output of this operation is a set of integers indexing into the input\ncollection of bounding boxes representing the selected boxes. The bounding\nbox coordinates corresponding to the selected indices can then be obtained\nusing the `tf.gather operation`. For example:\n selected_indices = tf.image.non_max_suppression_v2(\n boxes, scores, max_output_size, iou_threshold, score_threshold)\n selected_boxes = tf.gather(boxes, selected_indices)\nThis op also supports a Soft-NMS (with Gaussian weighting) mode (c.f.\nBodla et al, https://arxiv.org/abs/1704.04503) where boxes reduce the score\nof other overlapping boxes instead of directly causing them to be pruned.\nTo enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be\nlarger than 0.", "operands": [ { "name": "boxes", "type": "TFL_FpTensor" }, { "name": "scores", "type": "TFL_FpTensor" }, { "name": "max_output_size", "type": "TFL_I32Tensor" }, { "name": "iou_threshold", "type": "TFL_FpTensor" }, { "name": "score_threshold", "type": "TFL_FpTensor" }, { "name": "soft_nms_sigma", "type": "TFL_FpTensor" } ], "results": [ { "name": "selected_indices", "type": "TFL_I32Tensor" }, { "name": "selected_scores", "type": "TFL_FpTensor" }, { "name": "valid_outputs", "type": "TFL_I32Tensor" } ] }, { "name": "tfl.not_equal", "summary": "Not_equal operator", "description": "Element-wise not_equal operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[I1, F32, I32, I64, QUI8, QI8, QI16, TFL_Quint8, TFL_Str]>" }, { "name": "rhs", "type": "TFL_TensorOf<[I1, F32, I32, I64, QUI8, QI8, QI16, TFL_Quint8, TFL_Str]>" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.NumericVerify", "summary": "Verifies the numericals of the two operands", "description": "The NumericVerify op is a debugging op to verify the numericals of the two\n activations. It is a custom op in TFLite.\n If log_if_failed is true, the NumericVerify op calculates statistics on\n differences between float and quantized activations, output\n logs, set differences to the output tensors, and throws an error if errors\n above tolerance exist. If log_if_failed = false, then it doesn't care about\n errors.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[QI8, QUI8, QI16, F16, TFL_Quint8]>" }, { "name": "ref", "type": "TFL_TensorOf<[F32]>" } ], "results": [ { "name": "output", "type": "TFL_FpTensor" } ], "attributes": [ { "name": "tolerance", "type": "DefaultValuedOptionalAttr" }, { "name": "log_if_failed", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.one_hot", "summary": "OneHot operator", "description": "Returns a one-hot tensor.The locations represented by indices in `indices`\n take value `on_value`, while all other locations take value `off_value`.\n\n If the input `indices` is rank `N`, the output will have rank `N+1`,\n The new axis is created at dimension `axis` (default: the new axis is\n appended at the end).", "operands": [ { "name": "indices", "type": "TFL_TensorOf<[I32, I64]>" }, { "name": "depth", "type": "TFL_I32Tensor" }, { "name": "on_value", "type": "TFL_TensorOf<[F32, I32, I64, I1, I8, UI8]>" }, { "name": "off_value", "type": "TFL_TensorOf<[F32, I32, I64, I1, I8, UI8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, I1, I8, UI8]>" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ] }, { "name": "tfl.pack", "summary": "Packs a list of tensors along a dimension into one tensor", "description": "Packs a list of `values_count` rank-`R` tensors into one rank-`(R+1)`\n tensor.\n\n Packs the `values_count` tensors in `values` into a tensor with rank one\n higher than each tensor in `values`, by packing them along the `axis`\n dimension.\n\n Given a list of tensors of shape `(A, B, C)`;\n\n if `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`.\n if `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`.\n Etc.\n\n For example:\n\n ```\n # 'x' is [1, 4]\n # 'y' is [2, 5]\n # 'z' is [3, 6]\n pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.\n pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]\n ```\n\n This is the opposite of `unpack`.", "operands": [ { "name": "values", "type": "TFL_VariadicTensorOf<[F32, I8, I16, I32, I64, UI8, UI32, QI8, QUI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, UI32, QI8, QUI8, QI16, TFL_Quint8]>" } ], "attributes": [ { "name": "values_count", "type": "ConfinedAttr" }, { "name": "axis", "type": "I32Attr" } ] }, { "name": "tfl.pad", "category": "Transform", "summary": "Padding operator", "description": "This operation pads a `input` with zeros according to the `paddings` you\n specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is\n the rank of `input`. For each dimension D of `input`, `paddings[D, 0]`\n indicates how many zeros to add before the contents of `input` in that\n dimension, and `paddings[D, 1]` indicates how many zeros to add after the\n contents of `input` in that dimension.\n\n The padded size of each dimension D of the output is:\n\n `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`\n\n For example:\n\n ```\n # 't' is [[1, 1], [2, 2]]\n # 'paddings' is [[1, 1], [2, 2]]\n # rank of 't' is 2\n pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]\n [0, 0, 1, 1, 0, 0]\n [0, 0, 2, 2, 0, 0]\n [0, 0, 0, 0, 0, 0]]\n ```", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I1, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "padding", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I1, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" } ] }, { "name": "tfl.padv2", "summary": "Padding operator v2", "description": "This operation pads a `input` according to the `paddings` and\n `constant_values` you specify. `paddings` is an integer tensor with shape\n `[Dn, 2]`, where n is the rank of `input`. For each dimension D of `input`,\n `paddings[D, 0]` indicates how many zeros to add before the contents of\n `input` in that dimension, and `paddings[D, 1]` indicates how many zeros to\n add after the contents of `input` in that dimension. `constant_values` is a\n scalar tensor of the same type as `input` that indicates the value to use\n for padding `input`.\n\n The padded size of each dimension D of the output is:\n\n `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`\n\n For example:\n\n ```\n # 't' is [[1, 1], [2, 2]]\n # 'paddings' is [[1, 1], [2, 2]]\n # rank of 't' is 2\n pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]\n [0, 0, 1, 1, 0, 0]\n [0, 0, 2, 2, 0, 0]\n [0, 0, 0, 0, 0, 0]]\n ```", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I1, I32, I64, UI8, QI8, QUI8, TFL_Quint8]>" }, { "name": "padding", "type": "TFL_I32OrI64Tensor" }, { "name": "constant_values", "type": "TFL_TensorOf<[F32, I1, I32, I64, UI8, QI8, QUI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I1, I32, I64, UI8, QI8, QUI8, TFL_Quint8]>" } ] }, { "name": "tfl.poly_call", "summary": "Poly call", "description": "Have multiple function bodies for the same computation. This allows a\n program compiler/interpreter to choose one of the available options to\n execute the program based on which one is most suitable for the target\n backend.\n\n input: A list of input tensors whose types are T.\n output: A list of output tensors whose types are T.\n\n call: Multiple regions, each of which encapsulates the same semantic\n computation but in different forms.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "regions": [ { "name": "calls", "type": "VariadicRegion>" } ] }, { "name": "tfl.pow", "summary": "Power operator", "description": "Element-wise power operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I32]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32]>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.prelu", "summary": "Parameterized Relu operator", "description": "Parameterized Relu operator\n x -> x >= 0 ? x : (alpha * x)\n where alpha is a trainable tensor.\n input and alpha should be the same size as input or be broadcastable.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI8, QUI8, TFL_Quint8]>" }, { "name": "alpha", "type": "TFL_TensorOf<[F32, QI8, QUI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8, QUI8, TFL_Quint8]>" } ] }, { "name": "tfl.pseudo_const", "summary": "Constant pseudo op.", "description": "Represents a constant value in TensorFlow Lite dialect. This is not an\n actual operation and it will be lowered to buffer instead.\n\n The op is allowed to have all the same type of attributes as tf.Const does\n (e.g., opaque TF attributes are allowed).", "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ] }, { "name": "tfl.pseudo_qconst", "summary": "Quantized constant pseudo op", "description": "Represents a quantized constant value in TensorFlow Lite dialect. This is\n not an actual operation and it will be lowered to buffer instead. The\n quantization parameters are stored as a type attribute in this constant.", "results": [ { "name": "output", "type": "TFL_TensorOf<[QUI8, QI8, QUI4, QI16, QUI16, TFL_Quint8]>" } ], "attributes": [ { "name": "qtype", "type": "TensorTypeAttr" }, { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ] }, { "name": "tfl.pseudo_sparse_const", "summary": "Sparse constant pseudo op.", "description": "Represents a sparse constant value in TensorFlow Lite dialect. This is not\n an actual operation and it will be lowered to buffer instead.", "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" }, { "name": "s_param", "type": "SparsityParameterAttr" }, { "name": "compressed_data", "type": "ElementsAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ] }, { "name": "tfl.pseudo_sparse_qconst", "summary": "Sparse quantized constant pseudo op", "description": "Represents a sparse quantized constant value in TensorFlow Lite dialect.\n This is not an actual operation and it will be lowered to buffer instead.\n The quantization parameters are stored as a type attribute in this constant.", "results": [ { "name": "output", "type": "TFL_TensorOf<[QUI8, QI8, QUI4, QI16, QUI16, TFL_Quint8]>" } ], "attributes": [ { "name": "qtype", "type": "TensorTypeAttr" }, { "name": "value", "type": "ElementsAttr" }, { "name": "s_param", "type": "SparsityParameterAttr" }, { "name": "compressed_data", "type": "ElementsAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ] }, { "name": "tfl.quantize", "summary": "Quantize operator", "description": "Converts floating point tensors to quantized integer tensors according to\n the quantization parameters defined in the type attribute.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI4, QUI4, QI8, QUI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[QI4, QUI4, QI8, QUI8, QI16, TFL_Quint8]>" } ], "attributes": [ { "name": "qtype", "type": "TensorTypeAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ] }, { "name": "tfl.random_standard_normal", "summary": "Outputs random values from a normal distribution.", "description": "The generated values will have mean 0 and standard deviation 1.", "operands": [ { "name": "shape", "type": "TFL_I32Tensor" } ], "results": [ { "name": "out", "type": "TFL_TensorOf<[F32]>" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.random_uniform", "summary": "Outputs random values from a uniform distribution.", "description": "The generated values follow a uniform distribution in the range `[0, 1)`. The\nlower bound 0 is included in the range, while the upper bound 1 is excluded.", "operands": [ { "name": "shape", "type": "TFL_I32Tensor" } ], "results": [ { "name": "out", "type": "TFL_TensorOf<[F32]>" } ], "attributes": [ { "name": "seed", "type": "DefaultValuedOptionalAttr" }, { "name": "seed2", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.range", "summary": "Range operator", "description": "Returns a 1D tensor defined by a sequence from `start` to `limit` with\n a given `delta`.", "operands": [ { "name": "start", "type": "TFL_TensorOf<[I32, F32, I64]>" }, { "name": "limit", "type": "TFL_TensorOf<[I32, F32, I64]>" }, { "name": "delta", "type": "TFL_TensorOf<[I32, F32, I64]>" } ], "results": [ { "name": "result", "type": "TFL_TensorOf<[I32, F32, I64]>" } ] }, { "name": "tfl.rank", "summary": "Rank operator.", "description": "Returns the rank of a tensor.", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "TFL_IntTensor" } ] }, { "name": "tfl.read_variable", "summary": "Reads variable value.", "description": "Read variable data identified by 'resource_id'.", "operands": [ { "name": "resource_id", "type": "TFL_ResourceTensor" } ], "results": [ { "name": "result", "type": "TFL_TensorOf<[F32, F64, I1, UI8, I8, QI8, QUI8, I32, I64, QI16, Complex>, Complex>]>" } ] }, { "name": "tfl.real", "summary": "Returns the real part of a complex number.", "description": "Given a tensor `input` of complex numbers, this operation returns a tensor of\ntype `float` that is the real part of each element in `input`. All elements in\n`input` must be complex numbers of the form \\\\(a + bj\\\\), where *a* is the real\n part returned by this operation and *b* is the imaginary part.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[Complex>, Complex>]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F64]>" } ] }, { "name": "tfl.reduce_all", "summary": "Computes the \"logical and\" of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TFL_BoolTensor" }, { "name": "reduction_indices", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.reduce_any", "summary": "Computes the \"logical or\" of elements across dimensions of a tensor.", "description": "Reduces `input` along the dimensions given in `axis`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`axis`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1.", "operands": [ { "name": "input", "type": "TFL_BoolTensor" }, { "name": "reduction_indices", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_BoolTensor" } ], "attributes": [ { "name": "keep_dims", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.reduce_max", "summary": "Max-reduction operator", "description": "Computes the max reduction along the specified axes", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "axes", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" } ], "attributes": [ { "name": "keep_dims", "type": "BoolAttr" } ] }, { "name": "tfl.reduce_min", "summary": "Min-reduction operator", "description": "Computes the min reduction along the specified axes", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "axes", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" } ], "attributes": [ { "name": "keep_dims", "type": "BoolAttr" } ] }, { "name": "tfl.reduce_prod", "summary": "Prod-reduction operator", "description": "Computes the product along the specified axes", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "axes", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" } ], "attributes": [ { "name": "keep_dims", "type": "BoolAttr" } ] }, { "name": "tfl.relu", "category": "Activation", "summary": "Relu operator", "description": "Element-wise Relu operator\n x -> max(0, x)", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QUI8, QI8, QI16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QUI8, QI8, QI16]>" } ] }, { "name": "tfl.relu_0_to_1", "summary": "Relu0To1 operator", "description": "Element-wise Relu0To1 operator\n x -> max(0, min(1, x))", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ] }, { "name": "tfl.relu_n1_to_1", "summary": "Relu1 operator", "description": "Element-wise Relu1 operator\n x -> max(-1, min(1, x))", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ] }, { "name": "tfl.relu6", "summary": "Relu6 operator", "description": "Element-wise Relu6 operator\n x -> max(0, min(6, x))", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QUI8, QI8]>" } ] }, { "name": "tfl.reshape", "category": "Shape", "summary": "Reshape operator", "description": "Produces a tensor with the same values but different static shape defined\n by the output type.", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "shape", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tfl.resize_bilinear", "summary": "ResizeBilinear Op", "description": "Resize `images` to `size` using bilinear interpolation.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, TFL_Quint8, QUI8, QI8, QI16]>" }, { "name": "size", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, TFL_Quint8, QUI8, QI8, QI16]>" } ], "attributes": [ { "name": "align_corners", "type": "BoolAttr" }, { "name": "half_pixel_centers", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.resize_nearest_neighbor", "summary": "ResizeNearestNeighbor Op", "description": "Resize `images` to `size` using nearest neighbor interpolation.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, TFL_Quint8, QUI8, QI8, QI16]>" }, { "name": "size", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, TFL_Quint8, QUI8, QI8, QI16]>" } ], "attributes": [ { "name": "align_corners", "type": "BoolAttr" }, { "name": "half_pixel_centers", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "tfl.reverse_sequence", "summary": "Reverses variable length slices.", "description": "This op first slices `input` along the dimension `batch_dim`, and for each\nslice `i`, reverses the first `seq_lengths[i]` elements along\nthe dimension `seq_dim`.\n\nThe elements of `seq_lengths` must obey `seq_lengths[i] <= input.dims[seq_dim]`,\nand `seq_lengths` must be a vector of length `input.dims[batch_dim]`.\n\nThe output slice `i` along dimension `batch_dim` is then given by input\nslice `i`, with the first `seq_lengths[i]` slices along dimension\n`seq_dim` reversed.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64, QI16, QUI8, TFL_Quint8]>" }, { "name": "seq_lengths", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, QI16, QUI8, TFL_Quint8]>" } ], "attributes": [ { "name": "seq_dim", "type": "ConfinedAttr" }, { "name": "batch_dim", "type": "ConfinedAttr" } ] }, { "name": "tfl.reverse_v2", "category": "Transform", "summary": "ReverseV2 Operator", "description": "Reverses specific dimensions of a tensor.\n\n Given a tensor, and a int32/int64 tensor axis representing the set\n of dimensions of tensor to reverse.\n This operation reverses each dimension i for\n which there exists j s.t. axis[j] == i.\n\n Args:\n tensor: A Tensor. Must be one of the following types:\n uint8, int8, int16, int32, int64, float32, bool Up to 8-D.\n\n axis: A Tensor. Must be one of the following types: int32, int64.\n with only 1 element which is the axis index.\n TODO: Add support for multiple elements.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, UI8, I16, I32, I64, QI16, QUI8, QI8, TFL_Quint8, I1]>" }, { "name": "axis", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, UI8, I16, I32, I64, QI16, QUI8, QI8, TFL_Quint8, I1]>" } ] }, { "name": "tfl.rfft2d", "summary": "2D real-valued fast Fourier transform.", "description": "Computes the 2-dimensional discrete Fourier transform of a real-valued signal\nover the inner-most 2 dimensions of `input`.\n\nSince the DFT of a real signal is Hermitian-symmetric, `RFFT2D` only returns the\n`fft_length / 2 + 1` unique components of the FFT for the inner-most dimension\nof `output`: the zero-frequency term, followed by the `fft_length / 2`\npositive-frequency terms.\n\nAlong each axis `RFFT2D` is computed on, if `fft_length` is smaller than the\ncorresponding dimension of `input`, the dimension is cropped. If it is larger,\nthe dimension is padded with zeros.", "operands": [ { "name": "input", "type": "TFL_FpTensor" }, { "name": "fft_length", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_Complex64Tensor" } ] }, { "name": "tfl.right_shift", "summary": "Right Shift operator", "description": "Elementwise computes the bitwise right-shift of `lhs` by `rhs`.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[I8, UI8, I16, UI16, I32, UI32]>" }, { "name": "rhs", "type": "TFL_TensorOf<[I8, UI8, I16, UI16, I32, UI32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I8, UI8, I16, UI16, I32, UI32]>" } ] }, { "name": "tfl.round", "summary": "Round operator", "description": "Rounds the values of a tensor to the nearest integer, element-wise.", "operands": [ { "name": "x", "type": "TFL_FpTensor" } ], "results": [ { "name": "y", "type": "TFL_FpTensor" } ] }, { "name": "tfl.rsqrt", "summary": "Reciprocal of square root operator", "description": "Computes element-wise reverse square root of input", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QI8, QI16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QI8, QI16]>" } ] }, { "name": "tfl.scatter_nd", "summary": "Scatter_nd operator", "description": "Scatter `updates` into a new tensor according to `indices`", "operands": [ { "name": "indices", "type": "TFL_TensorOf<[I32]>" }, { "name": "updates", "type": "TFL_TensorOf<[F32, I8, I64, I32, UI8, I1]>" }, { "name": "shape", "type": "TFL_1DTensorOf<[I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I8, I64, I32, UI8, I1]>" } ] }, { "name": "tfl.segment_sum", "summary": "SegmentSum operator", "description": "Computes the sum along segments of a tensor.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32]>" }, { "name": "segment_ids", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32]>" } ] }, { "name": "tfl.select", "summary": "Select operator", "description": "Select values of 'x' if the corresponding value of 'condition' is true or\n the value of 'y' if false. There are valid condition input sizes:\n\n 1. Either the same shape (in which case the select is elementwise), or\n 2. condition must be Rank 1 and match over the first dimension.", "operands": [ { "name": "condition", "type": "TFL_BoolTensor" }, { "name": "x", "type": "TFL_TensorOf<[F32, I1, I8, I16, I32, I64, UI32, QI8, QUI8, QI16, TFL_Quint8]>" }, { "name": "y", "type": "TFL_TensorOf<[F32, I1, I8, I16, I32, I64, UI32, QI8, QUI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I1, I8, I16, I32, I64, UI32, QI8, QUI8, QI16, TFL_Quint8]>" } ] }, { "name": "tfl.select_v2", "summary": "SelectV2 operator", "description": "Select values of 'x' if the corresponding value of 'condition' is true or\n the value of 'y' if false. There are valid condition input sizes:\n\n 1. Either the same shape (in which case the select is elementwise), or\n 2. Broadcastable shapes between 'condition', 'x' and 'y'.", "operands": [ { "name": "condition", "type": "TFL_BoolTensor" }, { "name": "x", "type": "TFL_TensorOf<[F32, F16, I1, I8, I16, I32, I64, UI32, QI8, QUI8, QI16, TFL_Quint8]>" }, { "name": "y", "type": "TFL_TensorOf<[F32, F16, I1, I8, I16, I32, I64, UI32, QI8, QUI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I1, I8, I16, I32, I64, UI32, QI8, QUI8, QI16, TFL_Quint8]>" } ] }, { "name": "tfl.shape", "summary": "Shape operator", "description": "Returns the shape of a tensor.", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I32, I64]>" } ] }, { "name": "tfl.sign", "summary": "Sign operation", "description": "Returns NaN if x is NaN, 0 if x is 0, -1 if x < 0 and 1 if x > 0.", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, F64, I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F64, I32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "tfl.sin", "summary": "Sine operator", "description": "Computes element-wise Sine of input", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, F16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, F16]>" } ] }, { "name": "tfl.slice", "category": "Tensor", "summary": "Return a slice from 'input'.", "description": "The output tensor is a tensor with dimensions described by 'size'\nwhose values are extracted from 'input' starting at the offsets in\n'begin'.\n\n`begin` is zero-based; `size` is one-based. If size[i] is -1, all remaining\nelements in dimension i are included in the slice. In other words, this is\nequivalent to setting:\n size[i] = input.dim_size(i) - begin[i]\n\n*Requirements*:\n 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n)", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI4, I8, UI8, UI32, I1, TFL_Str, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "begin", "type": "TFL_I32OrI64Tensor" }, { "name": "size", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI4, I8, UI8, UI32, I1, TFL_Str, QI8, QUI8, TFL_Quint8, QI16]>" } ] }, { "name": "tfl.softmax", "category": "Activation", "summary": "Softmax operator", "description": "Computes element-wise softmax activations with the following formula\n\n exp(input * beta) / tf.reduce_sum(exp(input * beta), dim)", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8, TFL_Quint8, QI16]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8, TFL_Quint8, QI16]>" } ], "attributes": [ { "name": "beta", "type": "F32Attr" } ] }, { "name": "tfl.space_to_batch_nd", "summary": "SpaceToBatchNd operator", "description": "This operation reshapes space dimensions into the \"batch\" dimension 0", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "block_shape", "type": "TFL_I32Tensor" }, { "name": "paddings", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" } ] }, { "name": "tfl.space_to_depth", "summary": "SpaceToDepth operator", "description": "Rearranges blocks of spatial data, into depth. More specifically,\n this op outputs a copy of the input tensor where values from the `height`\n and `width` dimensions are moved to the `depth` dimension.\n `block_size` indicates the input block size.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, I64, QI8, QUI8, TFL_Quint8]>" } ], "attributes": [ { "name": "block_size", "type": "ConfinedAttr" } ] }, { "name": "tfl.sparse_to_dense", "summary": "Converts a sparse representation into a dense tensor.", "description": "Builds an array `dense` with shape `output_shape` such that\n\n```\n# If sparse_indices is scalar\ndense[i] = (i == sparse_indices ? sparse_values : default_value)\n\n# If sparse_indices is a vector, then for each i\ndense[sparse_indices[i]] = sparse_values[i]\n\n# If sparse_indices is an n by d matrix, then for each i in [0, n)\ndense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]\n```\n\nAll other values in `dense` are set to `default_value`. If `sparse_values` is a\nscalar, all sparse indices are set to this single value.\n\nIndices should be sorted in lexicographic order, and indices must not\ncontain any repeats. If `validate_indices` is true, these properties\nare checked during execution.", "operands": [ { "name": "sparse_indices", "type": "TFL_I32OrI64Tensor" }, { "name": "output_shape", "type": "TFL_I32OrI64Tensor" }, { "name": "sparse_values", "type": "TFL_TensorOf<[I32, I64, I8, QI8, UI8, QUI8, TFL_Quint8, F32]>" }, { "name": "default_value", "type": "TFL_TensorOf<[I32, I64, I8, QI8, UI8, QUI8, TFL_Quint8, F32]>" } ], "results": [ { "name": "dense", "type": "TFL_TensorOf<[I32, I64, I8, QI8, UI8, QUI8, TFL_Quint8, F32]>" } ] }, { "name": "tfl.split", "category": "Tensor", "summary": "Splits a tensor into `num_split` tensors along one dimension.", "description": "Splits the `value` tensor along `split_dim` into a number of sub-tensors\n with same shape as the original one, except for `split_dim`. Same as\n tf.Split.", "operands": [ { "name": "split_dim", "type": "TFL_TensorOf<[I32]>" }, { "name": "value", "type": "TFL_TensorOf<[F32, I16, I32, I8, UI8, QI8, QUI8, QI16]>" } ], "results": [ { "name": "outputs", "type": "TFL_VariadicTensorOf<[F32, I16, I32, I8, UI8, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "num_splits", "type": "ConfinedAttr" } ] }, { "name": "tfl.split_v", "summary": "Splits a tensor into `num_split` tensors along one dimension.", "description": "Splits the `value` tensor along `split_dim` into a number of sub-tensors\n with same shape as the original one, except for `split_dim`. The grouping\n of the resultant sub-tensors is decided by `size-splits`. Same as tf.SplitV.", "operands": [ { "name": "value", "type": "TFL_TensorOf<[F32, I16, I32, I64, I8, UI8, QI8, QUI8, QI16]>" }, { "name": "size_splits", "type": "TFL_1DTensorOf<[I32], [I32]>" }, { "name": "split_dim", "type": "TFL_0DTensorOf<[I32], [I32]>" } ], "results": [ { "name": "outputs", "type": "TFL_VariadicTensorOf<[F32, I16, I32, I64, I8, UI8, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "num_splits", "type": "ConfinedAttr" } ] }, { "name": "tfl.sqrt", "summary": "Square root operator", "description": "Computes element-wise Square root of input", "operands": [ { "name": "x", "type": "TFL_TensorOf<[F32, QI8, QI16]>" } ], "results": [ { "name": "y", "type": "TFL_TensorOf<[F32, QI8, QI16]>" } ] }, { "name": "tfl.square", "summary": "Square operator", "description": "Computes element-wise Square of input", "operands": [ { "name": "x", "type": "TFL_FpTensor" } ], "results": [ { "name": "y", "type": "TFL_FpTensor" } ] }, { "name": "tfl.squared_difference", "summary": "Squared difference operator", "description": "Element-wise squared difference operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, I32, QI8]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, I32, QI8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32, QI8]>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.squeeze", "summary": "Removes dimensions of size 1 from the shape of a tensor.", "description": "Given a tensor `input`, this operation returns a tensor of the same type with\nall dimensions of size 1 removed. If you don't want to remove all size 1\ndimensions, you can remove specific size 1 dimensions by specifying\n`squeeze_dims`.\n\nFor example:\n\n```\n# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]\nshape(squeeze(t)) ==> [2, 3]\n```\n\nOr, to remove specific size 1 dimensions:\n\n```\n# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]\nshape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]\n```", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "squeeze_dims", "type": "ConfinedAttr, {}>, [TFL_ArrayMaxCount<8>]>" } ] }, { "name": "tfl.strided_slice", "summary": "StridedSlice Op", "description": "Return a strided slice from `input`.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, I32, I64, I8, UI8, UI32, QI8, QUI8, I1, I16, QI16, TFL_Quint8, TFL_Str]>" }, { "name": "begin", "type": "TFL_I32Tensor" }, { "name": "end", "type": "TFL_I32Tensor" }, { "name": "strides", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, I64, I8, UI8, UI32, QI8, QUI8, I1, I16, QI16, TFL_Quint8, TFL_Str]>" } ], "attributes": [ { "name": "begin_mask", "type": "I32Attr" }, { "name": "end_mask", "type": "I32Attr" }, { "name": "ellipsis_mask", "type": "I32Attr" }, { "name": "new_axis_mask", "type": "I32Attr" }, { "name": "shrink_axis_mask", "type": "I32Attr" }, { "name": "offset", "type": "BoolAttr" } ] }, { "name": "tfl.sub", "summary": "Subtraction operator", "description": "Element-wise subtraction operation.", "operands": [ { "name": "lhs", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, QI16]>" }, { "name": "rhs", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, QI16]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tfl.sum", "summary": "Sum operator", "description": "Computes the sum reduction along the specified axes", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" }, { "name": "axes", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, I32, I64, QI8, QUI8, TFL_Quint8, QI16]>" } ], "attributes": [ { "name": "keep_dims", "type": "BoolAttr" } ] }, { "name": "tfl.svdf", "summary": "Single value decomposition filter operator", "description": "The SVDF op is a decomposition of a densely connected op into low rank\n filters.\n For details: https://research.google.com/pubs/pub43813.html\n https://arxiv.org/abs/1812.02802", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "feature_weights", "type": "TFL_TensorOf<[F32, QI8, QUI8]>" }, { "name": "time_weights", "type": "TFL_TensorOf<[F32, QI16]>" }, { "name": "input_gate_bias", "type": "TFL_TensorOfOrNone<[F32, QI32]>" }, { "name": "activation_state", "type": "TFL_StatefulTensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8]>" } ], "attributes": [ { "name": "rank", "type": "ConfinedAttr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" } ] }, { "name": "tfl.tanh", "category": "Activation", "summary": "Hyperbolic tangent operator", "description": "Computes element-wise Hyperbolic tangent of input", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8, QI16, TFL_Quint8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, F16, QI8, QUI8, QI16, TFL_Quint8]>" } ] }, { "name": "tfl.tile", "summary": "Tile operator.", "description": "Constructs a tensor by tiling a given tensor.\n\n This operation creates a new tensor by replicating input\n multiples times. The output tensor's i'th dimension has\n input.dims(i) * multiples[i] elements, and the values of input\n are replicated multiples[i] times along the 'i'th dimension.\n For example, tiling [a b c d] by [2] produces [a b c d a b c d].", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I1, I32, I64, UI8, QI8, QUI8, TFL_Str]>" }, { "name": "multiples", "type": "TFL_I32OrI64Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I1, I32, I64, UI8, QI8, QUI8, TFL_Str]>" } ] }, { "name": "tfl.topk_v2", "summary": "TopK operator", "description": "Returns the top `k` largest element along each last dimensional slice of\n `input` and the indices of values within the last dimension of the input\n tensor.\n\n Results are always sorted in the descending order.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QI8, QUI8]>" }, { "name": "k", "type": "TFL_TensorOf<[I16, I32]>" } ], "results": [ { "name": "values", "type": "TFL_TensorOf<[F32, I8, I16, I32, I64, UI8, QI8, QUI8]>" }, { "name": "indices", "type": "TFL_TensorOf<[I16, I32]>" } ] }, { "name": "tfl.transpose", "category": "Transform", "summary": "Transpose operator", "description": "Returns the Transpose of x", "operands": [ { "name": "input", "type": "TFL_TensorOf<[I32, F32, F16, I8, UI8, QI8, QUI8, TFL_I4, QI4, TFL_Quint8, I1, I64, QI16]>" }, { "name": "perm", "type": "TFL_TensorOf<[I32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I32, F32, F16, I8, UI8, QI8, QUI8, TFL_I4, QI4, TFL_Quint8, I1, I64, QI16]>" } ] }, { "name": "tfl.transpose_conv", "summary": "Transpose convolution operator", "description": "Performs transpose convolution operation on input.", "operands": [ { "name": "output_shape", "type": "TFL_I32Tensor" }, { "name": "weights", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" }, { "name": "input", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" }, { "name": "bias", "type": "TFL_TensorOfOrNone<[F32, QI32, I64]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8, QUI8, QI16]>" } ], "attributes": [ { "name": "padding", "type": "TFL_PaddingAttr" }, { "name": "stride_h", "type": "ConfinedAttr" }, { "name": "stride_w", "type": "ConfinedAttr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" } ] }, { "name": "tfl.unidirectional_sequence_lstm", "summary": "Unidirectional sequence lstm operator", "description": "A recurrent neural network specified by an LSTM cell. This Op supports\n unrolling the input along the time or batch dimensions, and\n implements the following operation for\n each element in the sequence s = 1...sequence_length:\n outputs[s] = state = activation(LSTMOp(inputs[s]))\n\n where LSTMOp is LSTM TF Lite Op and the “activation” is the function passed\n as the “fused_activation_function” argument (if not “NONE”).", "operands": [ { "name": "input", "type": "TFL_FpTensor" }, { "name": "input_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "input_to_forget_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "input_to_cell_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "input_to_output_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "recurrent_to_forget_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_cell_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_output_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "cell_to_input_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "cell_to_forget_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "cell_to_output_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "input_gate_bias", "type": "TFL_TensorOfOrNone<[F32]>" }, { "name": "forget_gate_bias", "type": "TFL_FpTensor" }, { "name": "cell_bias", "type": "TFL_FpTensor" }, { "name": "output_gate_bias", "type": "TFL_FpTensor" }, { "name": "projection_weights", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "projection_bias", "type": "TFL_TensorOfOrNone<[F32]>" }, { "name": "input_activation_state", "type": "TFL_StatefulTensor" }, { "name": "input_cell_state", "type": "TFL_StatefulTensor" }, { "name": "input_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "forget_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "cell_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI8]>" }, { "name": "output_layer_norm_coefficients", "type": "TFL_TensorOfOrNone<[F32, QI8]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, QI8]>" } ], "attributes": [ { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "cell_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "proj_clip", "type": "ConfinedAttr, [TFL_FloatNonNegative]>" }, { "name": "time_major", "type": "BoolAttr" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" }, { "name": "diagonal_recurrent_tensors", "type": "OptionalAttr" }, { "name": "input_to_input_intermediate", "type": "OptionalAttr" }, { "name": "input_to_forget_intermediate", "type": "OptionalAttr" }, { "name": "input_to_cell_intermediate", "type": "OptionalAttr" }, { "name": "input_to_output_intermediate", "type": "OptionalAttr" }, { "name": "effective_hidden_scale_intermediate", "type": "OptionalAttr" } ] }, { "name": "tfl.unidirectional_sequence_rnn", "summary": "Unidirectional sequence rnn operator", "description": "A recurrent neural network specified by an RNN cell. This Op takes in input\n in a format {batch_size, seq_len, input_size} or\n {seq_len, batch_size, input_size} if it's time-majored.\n\n It implements the following operation for\n each element in the sequence s = 1...sequence_length:\n outputs[s] = state = activation(RNNOp(inputs[s]))\n\n where RNNOp is RNNOp TF Lite Op and the “activation” is the function passed\n as the “fused_activation_function” argument (if not “NONE”).", "operands": [ { "name": "input", "type": "TFL_FpTensor" }, { "name": "input_to_input_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "recurrent_to_input_weights", "type": "TFL_TensorOf<[F32, QI8]>" }, { "name": "input_gate_bias", "type": "TFL_FpTensor" }, { "name": "hidden_state", "type": "TFL_StatefulTensor" } ], "results": [ { "name": "output", "type": "TFL_FpTensor" } ], "attributes": [ { "name": "time_major", "type": "BoolAttr" }, { "name": "fused_activation_function", "type": "TFL_AFAttr" }, { "name": "asymmetric_quantize_inputs", "type": "OptionalAttr" } ] }, { "name": "tfl.unique", "summary": "Unique Op.", "description": "This operation returns a tensor `output` containing all of the unique elements\nof `input` sorted in the same order that they occur in `input`. This operation\nalso returns a tensor `idx` the same size as `x` that contains the index of each\nvalue of `input` in the unique output `output`. In other words:", "operands": [ { "name": "input", "type": "TFL_TensorOf<[I8, QI8, UI8, QUI8, I16, QI16, I32, I64, F32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I8, QI8, UI8, QUI8, I16, QI16, I32, I64, F32]>" }, { "name": "idx", "type": "TFL_I32OrI64Tensor" } ] }, { "name": "tfl.unpack", "summary": "Unpacks a tensor along a dimension into multiple tensors", "description": "Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors.\n\n Unpacks `num` tensors from `value` by chipping it along the `axis` dimension.\n For example, given a tensor of shape `(A, B, C, D)`;\n\n If `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]`\n and each tensor in `output` will have shape `(B, C, D)`. (Note that the\n dimension unpacked along is gone, unlike `split`).\n\n If `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]`\n and each tensor in `output` will have shape `(A, C, D)`.\n Etc.\n\n This is the opposite of `pack`.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, F16, BF16, I1, I8, UI8, I32, QI8, QUI8, I16, QI16]>" } ], "results": [ { "name": "outputs", "type": "TFL_VariadicTensorOf<[F32, F16, BF16, I1, I8, UI8, I32, QI8, QUI8, I16, QI16]>" } ], "attributes": [ { "name": "num", "type": "ConfinedAttr" }, { "name": "axis", "type": "I32Attr" } ] }, { "name": "tfl.unsorted_segment_max", "summary": "UnsortedSegmentMax operator", "description": "Computes the maximum value along segments of a tensor such that\n output[i] = max(data[j....]) where segment_ids[j...] = i\n if the maximum is empty for a given segment ID i,\n it outputs the smallest possible value for the specific numeric type,\n output[i] = numeric_limits::lowest().\n Note the values of segment_ids are always validated to be less than\n num_segments and an error is thrown for out-of-bound indices.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32]>" }, { "name": "segment_ids", "type": "TFL_I32Tensor" }, { "name": "num_segments", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32]>" } ] }, { "name": "tfl.unsorted_segment_min", "summary": "UnsortedSegmentMin operator", "description": "Computes the minimum value along segments of a tensor such that\n output[i] = min(data[j....]) where segment_ids[j...] = i\n if the minimum is empty for a given segment ID i,\n it outputs the largest possible value for the specific numeric type,\n output[i] = numeric_limits::max().\n Note the values of segment_ids are always validated to be less than\n num_segments and an error is thrown for out-of-bound indices.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32]>" }, { "name": "segment_ids", "type": "TFL_I32Tensor" }, { "name": "num_segments", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32]>" } ] }, { "name": "tfl.unsorted_segment_prod", "summary": "UnsortedSegmentProd operator", "description": "Computes the product along segments of a tensor.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32]>" }, { "name": "segment_ids", "type": "TFL_I32Tensor" }, { "name": "num_segments", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32]>" } ] }, { "name": "tfl.unsorted_segment_sum", "summary": "UnsortedSegmentSum operator", "description": "From a tensor segmentation, computes the `output` resulting from\n summing together elements mapped to the same segment_id. I.e. `output[i]` is\n equal to the tensor sum of all elements from the input tensor mapped to\n segment_id `i`. If no tensors are mapped to a particular included\n segment_id, the output at that indice will be a zero tensor with the\n appropriate shape. Note the values of segment_ids are always validated to be\n less than num_segments and an error is thrown for out-of-bound indices", "operands": [ { "name": "input", "type": "TFL_TensorOf<[F32, I32]>" }, { "name": "segment_ids", "type": "TFL_I32Tensor" }, { "name": "num_segments", "type": "TFL_I32Tensor" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[F32, I32]>" } ] }, { "name": "tfl.var_handle", "summary": "Returns a handle to a variable resource from its name.", "description": "Returns a handle for a variable resource from its name.\n container: the container this variable is placed in.\n shared_name: the name by which this variable is referred to.", "results": [ { "name": "resource_handle", "type": "TFL_ResourceTensor" } ], "attributes": [ { "name": "container", "type": "DefaultValuedStrAttr" }, { "name": "shared_name", "type": "DefaultValuedStrAttr" } ] }, { "name": "tfl.where", "summary": "Returns locations of nonzero / true values in a tensor.", "description": "This operation returns the coordinates of true elements in `condition`. The\ncoordinates are returned in a 2-D tensor where the first dimension (rows)\nrepresents the number of true elements, and the second dimension (columns)\nrepresents the coordinates of the true elements. Keep in mind, the shape of\nthe output tensor can vary depending on how many true values there are in\n`condition`. Indices are output in row-major order.", "operands": [ { "name": "condition", "type": "TFL_TensorOf<[I1, F32, TFL_Int32Or64, I8, UI8, UI32]>" } ], "results": [ { "name": "index", "type": "TFL_I64Tensor" } ] }, { "name": "tfl.while", "summary": "While loop", "description": "output = input; while (cond(output)) { output = body(output) }\n\n While loop where all values are passes through arguments with implicit\n capture.\n\n input: A list of input tensors whose types are T.\n output: A list of output tensors whose types are T.\n cond: A region that takes 'input' and returns a boolean scalar tensor.\n body: A region that takes a list of tensors and returns another\n list of tensors. Both lists have the same types.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "is_stateless", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "cond", "type": "SizedRegion<1>" }, { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tfl.yield", "summary": "Yield operation", "description": "The \"yield\" operation represents a return operation within the conditional\n and body of structured control flow (e.g., while), and a terminator for ControlNodeOp.\n The operation takes a variable number of operands and produces no results.\n The operand number and types must match the signature of the region that contains the operation." }, { "name": "tfl.zeros_like", "summary": "ZerosLike operator", "description": "Returns a tensor of zeros with the same shape and type as the input tensor.", "operands": [ { "name": "input", "type": "TFL_TensorOf<[I64, I32, F32]>" } ], "results": [ { "name": "output", "type": "TFL_TensorOf<[I64, I32, F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "tfr.build_list", "description": "The `build_list` operation builds a tensor list from a list of tensors, or\n an tfr.attr from a list of scalars.\n\n Example:\n\n ```mlir\n %3 = tfr.build_list(%2, %1, %0) :\n (tfr.tensor, tfr.tensor, tfr.tensor) -> tfr.tensor_list\n %3 = tfr.build_list(%2, %1, %0) : (i32, i32, i32) -> tfr.attr\n ```", "operands": [ { "name": "tensors", "type": "Variadic" } ], "results": [ { "name": "out", "type": "TFR_allowedListResultType" } ] }, { "name": "tfr.call", "description": "The `call` operation represents a direct call to a function that is within\n the same symbol scope as the callee. The operands and result types of the\n call must match the specified function type. The callee is encoded as a\n symbol reference attribute named \"callee\".\n\n Example:\n\n ```mlir\n %2 = tfr.call @my_add(%0, %1) : (tfr.tensor, f32) -> tfr.tensor_list\n ```\n\n Note that the operands of the `call` operation can only be with tfr.tensor,\n tfr.tensor_list, tfr.attr and mlir float and integer types. The results of\n the `call` operation can only be with tfr.tensor and tfr.tensor_list types.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $args `)` attr-dict `:` functional-type($args, results)" }, { "name": "tfr.cast", "description": "The `cast` operation converts the operand with built-in tensor type to\n tfr.tensor type, or vice versa.\n\n Example:\n\n ```mlir\n %1 = tfr.cast(%0) : tensor -> !tfr.tensor\n %3 = tfr.cast(%1) : !tfr.tensor -> tensor\n ```", "operands": [ { "name": "arg", "type": "TFR_singleTensorType" } ], "results": [ { "name": "out", "type": "TFR_singleTensorType" } ] }, { "name": "tfr.constant", "description": "The `attr` operation stores TF op's attribute, which doesn't support\n arithmetic operations.\n\n Example:\n\n ```mlir\n %1 = \"tfr.constant\"() { value: i32 } : () -> !tfr.attr\n %2 = \"tfr.constant\"() { value: [i32, f32] } : () -> !tfr.attr\n %3 = tfr.constant [i32, f32] -> !tfr.attr\n %4 = tfr.constant f32 -> !tfr.attr\n ```", "results": [ { "name": "out", "type": "TFR_AttrType" } ], "attributes": [ { "name": "value", "type": "TFR_allowedConstValues" } ], "assemblyFormat": "$value attr-dict `->` type($out)" }, { "name": "tfr.constant_tensor", "description": "The `constant_tensor` operation converts the operand with non-built-in\n tensor type to built-in tensor type or tfr.tensor type. If it is built-in\n tensor type, the shape shouldn't be changed during the conversion.\n\n Example:\n\n ```mlir\n %1 = tfr.constant_tensor(%0) : f32 -> tensor\n %3 = tfr.constant_tensor(%2) : vector<1xf32> -> tensor<1xf32>\n ```", "operands": [ { "name": "arg", "type": "TFR_AllAttrTypes" } ], "results": [ { "name": "out", "type": "TFR_singleTensorType" } ] }, { "name": "tfr.equal", "description": "The `equal` operation compares the values of the tfr.attr type arguments.\n The operation returns an i1 boolean indicating if the two values are the\n same.\n Example:\n\n ```mlir\n %x = tfr.equal %lhs, %rhs -> i1\n %x = \"tfr.equal\"(%lhs, %rhs) : (!tfr.attr, !tfr.attr) -> i1\n ```", "operands": [ { "name": "lhs", "type": "TFR_AttrType" }, { "name": "rhs", "type": "TFR_AttrType" } ], "results": [ { "name": "result", "type": "BoolLike" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `->` type($result)" }, { "name": "tfr.func", "summary": "TFR Function defines a composition of other ops", "description": "Defines a function that can be used to decompose an TF function call to\n the invocation of a set of other TF ops.\n\n Syntax:\n\n ```\n op ::= `tfr.func` visibility? symbol-ref-id `(` argument-list `)` (`->`\n function-result-list)? function-attributes? region\n ```\n\n Example:\n\n ```mlir\n tfr.func @foo(%arg0: !tfr.tensor, %arg1: !tfr.tensor_list,\n %arg2: int {tfr.name=\"T\", tfr.default=1})\n attributes {qux: \"quux\"} {\n tfr.return\n }\n ```\n\n Note the arguments are ordered by the following rule:\n tfr.tensor > tfr.tensor_list > tfr.attr/i32/...,\n and only one trfr.tensor_list argument is allowed.", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_name", "type": "StrAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "VariadicRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfr.get_element", "description": "The `get_element` operation extracts one tfr.tensor element from a\n tfr.tensor_list.\n\n Example:\n\n ```mlir\n %2 = tfr.get_element %1[%0] : (tfr.tensor, index) -> tfr.tensor\n ```", "operands": [ { "name": "tensor_list", "type": "TFR_TensorListType" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "out", "type": "TFR_TensorType" } ], "assemblyFormat": "$tensor_list `[` $index `]` attr-dict `:`\n `(` type($tensor_list) `,` type($index) `)` `->` type($out)" }, { "name": "tfr.get_element_type", "description": "The `get_element_type` operation gets the element type of a tfr.tensor and\n returns !tfr.attr.\n\n Example:\n\n ```mlir\n %1 = \"tfr.get_element_type\"(%0) : !tfr.tensor -> !tfr.attr\n %1 = tfr.get_element_type %0 -> !tfr.attr\n ```", "operands": [ { "name": "arg", "type": "TFR_TensorType" } ], "results": [ { "name": "out", "type": "TFR_AttrType" } ], "assemblyFormat": "$arg attr-dict `->` type($out)" }, { "name": "tfr.get_length", "description": "The `get_length` operation returns the number of tensors for a\n tfr.tensor_list.\n\n Example:\n\n ```mlir\n %2 = tfr.get_length(%1) : tfr.tensor -> index\n %2 = tfr.get_length %1 -> index\n ```", "operands": [ { "name": "tensor_list", "type": "TFR_TensorListType" } ], "results": [ { "name": "out", "type": "Index" } ], "assemblyFormat": "$tensor_list attr-dict `->` type($out)" }, { "name": "tfr.get_shape", "description": "The `get_shape` operation gets the shape of a tfr.tensor and returns\n !shape.shape type.\n\n Example:\n\n ```mlir\n %1 = \"tfr.get_shape\"(%0) : !tfr.tensor -> !shape.shape\n %1 = tfr.get_shape %0 -> !shape.shape\n ```", "operands": [ { "name": "arg", "type": "TFR_TensorType" } ], "results": [ { "name": "out", "type": "Shape_ShapeType" } ], "assemblyFormat": "$arg attr-dict `->` type($out)" }, { "name": "tfr.quant_act_range", "description": "The `quant_act_range` returns the a pair of integers to indicate the fixed\n range for the fused activation `act` with the quantization defined by the\n `scale` and `zero point`. Currently, the allowed activations are\n `NONE`, `RELU`, `RELU6` and `RELU_N1_TO_1`.\n\n Example:\n\n ```mlir\n %3, %4 = tfr.quant_act_range(%2, %1, %0) :\n (tfr.attr, float, i64) -> (tfr.tensor, tfr.tensor)\n ```", "operands": [ { "name": "act", "type": "TFR_AttrType" }, { "name": "scale", "type": "F32" }, { "name": "zp", "type": "I64" } ], "results": [ { "name": "min", "type": "TFR_TensorType" }, { "name": "max", "type": "TFR_TensorType" } ], "assemblyFormat": "`(` $act `,` $scale `,` $zp `)` attr-dict `:` functional-type(operands, results)" }, { "name": "tfr.quant_qparam", "description": "The `quant_qparam` returns the quantization parameter of the input\n tensors.\n\n Example:\n\n ```mlir\n %3 = tfr.quant_qparam(%0) : (tfr.tensor) -> (float, tfr.tensor)\n ```", "operands": [ { "name": "input", "type": "TFR_TensorType" } ], "results": [ { "name": "scale", "type": "TFR_TensorType" }, { "name": "zp", "type": "TFR_TensorType" } ], "assemblyFormat": "`(` $input `)` attr-dict `:` functional-type($input, results)" }, { "name": "tfr.quant_raw_data", "description": "The `quant_raw_data` removes the quantization parameter from the intput\n tensor(s).\n\n Example:\n\n ```mlir\n %3 = tfr.quant_raw_data(%0) : (tfr.tensor) -> (tfr.tensor)\n ```", "operands": [ { "name": "input", "type": "TFR_AllTensorTypes" } ], "results": [ { "name": "output", "type": "TFR_AllTensorTypes" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "`(` $input `)` attr-dict `:` functional-type($input, results)" }, { "name": "tfr.quant_rescale", "description": "The `quant_rescale` rescales the elements of the integer tensor by the\n floating-point rescale factor. This op needs to be legalized to the preferred\n operations of the backends.\n\n Example:\n\n ```mlir\n %3 = tfr.quant_rescale(%2, %1, %0) :\n (tfr.tensor, tfr.tensor, i64) -> (tfr.tensor)\n ```", "operands": [ { "name": "input", "type": "TFR_TensorType" }, { "name": "scale", "type": "TFR_TensorType" }, { "name": "zp", "type": "I64" } ], "results": [ { "name": "output", "type": "TFR_TensorType" } ], "assemblyFormat": "`(` $input `,` $scale `,` $zp `)` attr-dict `:` functional-type(operands, results)" }, { "name": "tfr.quant_scale_factor", "description": "The `quant_scale_factor` computes the effective scale factor according to the\n output scale and input scales.\n\n Example:\n\n ```mlir\n %3 = tfr.quant_scale_factor(%0) : (f32, tfr.tensor_list) -> (tfr.tensor)\n ```", "operands": [ { "name": "out_scale", "type": "F32" }, { "name": "in_scales", "type": "TFR_TensorListType" } ], "results": [ { "name": "scale_factor", "type": "TFR_TensorType" } ], "assemblyFormat": "`(` $out_scale `,` $in_scales `)` attr-dict `:` functional-type(operands, results)" }, { "name": "tfr.return", "description": "A terminator operation for regions that appear in the body of `tfr.func`\n functions. The operands to the `tfr.return` are the result values returned\n by an invocation of the `tfr.func`.\n\n Note that only the tfr.tensor and tfr.tensor_list can be returned.", "operands": [ { "name": "arguments", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($arguments^ `:` type($arguments))?" }, { "name": "tfrt_dht.allocate_buffer", "summary": "tfrt_dht.allocate_buffer operation", "description": "An operation that creates an buffer.\n It takes in the size of the buffer in bytes and the alignment in bytes and\n outputs a buffer of that size.\n\n Example:\n %size = tfrt.constant.i64 164\n %alignment = tfrt.constant.i64 8\n %buf = tfrt_dht.allocate %size, %alignment", "results": [ { "name": "result", "type": "HostBufferType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.bool.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.bool.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.bool.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.bool.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.bool.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex128.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex128.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex128.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex128.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex128.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex64.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex64.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex64.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex64.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.complex64.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.f32.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.f32.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.f32.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.f32.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.f32.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i32.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i32.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i32.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i32.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i32.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i64.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i64.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i64.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i64.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.i64.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui16.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui16.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui16.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui16.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui16.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui32.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui32.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui32.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui32.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui32.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui64.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui64.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui64.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui64.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui64.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui8.0", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui8.1", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui8.2", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui8.3", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.create_uninitialized_tensor.ui8.4", "summary": "tfrt_dht.create_uninitialized_tensor operation", "description": "An operation that creates an uninitialized tensor.\n It takes a shape attribute and outputs a tensor as output.\n\n Example:\n %2 = tfrt_dht.create_uninitialized_tensor.i32.0 []\n %3 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]", "results": [ { "name": "result", "type": "TensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$shape attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.bool", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.complex128", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.complex64", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.f32", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.i32", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.i64", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.ui16", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.ui32", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.ui64", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.fill_tensor_with_constant.ui8", "summary": "tfrt_dht.fill_tensor_with_constant operation", "description": "An operation that fills an input tensor with a value. It takes an input\n tensor and a chain as inputs and a constant value attribute, and outputs a\n chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "operands $value attr-dict" }, { "name": "tfrt_dht.get_buffer", "summary": "tfrt_dht.get_buffer operation", "description": "tfrt_dht.get_buffer returns the HostBuffer that backs the given dense host\n tensor.\n\n Example:\n %t = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]\n %ch1 = tfrt.new.chain\n %buf, %ch2 = tfrt_dht.get_buffer %t, %ch1", "results": [ { "name": "result0", "type": "HostBufferType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.get_buffer_slice", "summary": "tfrt_dht.get_buffer_slice operation", "description": "An operation that gets a slice of a buffer.\n It takes in the parent buffer and the size and offset of the new buffer. It\n returns a buffer that points to the data allocated by the parent buffer.\n\n Example:\n %parent_buf = tfrt_dht.allocate %parent_size, %alignment\n %offset = tfrt.constant.i64 0\n %size = tfrt.constant.i64 64\n %buf_a = tfrt_dht.get_buffer_slice %parent_buf, %offset, %size", "results": [ { "name": "result", "type": "HostBufferType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.get_tensor_shape", "summary": "tfrt_dht.get_tensor_shape operation", "description": "An operation that returns the shape of the dense host tensor.\n\n Example:\n %0 = tfrt_dht.get_tensor_shape %t", "results": [ { "name": "result", "type": "TS_Shape" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.bool", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.complex128", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.complex64", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.f32", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.i32", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.i64", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.ui16", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.ui32", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.ui64", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.make_tensor.ui8", "summary": "tfrt_dht.make_tensor operation", "description": "An operation that creates a tensor from the given shape and buffer.\n Created tensor shares the memory with the given buffer.\n\n The size of the buffer must match the size needed to hold the tensor,\n i.e. the number of elements, of requested dtype, in the given shape.\n\n Example:\n %ch0 = tfrt.new.chain\n %cuda_host_buf, %ch1 = cuda.mem.allocate_host %size, %alignment, %ch0\n %tensor, %ch2 = tfrt_dht.make_tensor.f32 %cuda_host_buf, %shape, %ch0", "results": [ { "name": "result0", "type": "TensorType" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.print_buffer", "summary": "tfrt_dht.print_buffer operation", "description": "An operation that prints a buffer.\n\n Example:\n %chain1 = tfrt_dht.print_buffer %buffer, %chain0", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.print_tensor", "summary": "tfrt_dht.print_tensor operation", "description": "An operation that prints a tensor. It takes a tensor and chain as input and\n outputs a chain.\n\n Example:\n %3 = tfrt_dht.print_tensor %1, %2", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.bool", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.complex128", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.complex64", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.f32", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.i32", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.i64", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.ui16", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.ui32", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.ui64", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.set_tensor_with_constant_values.ui8", "summary": "tfrt_dht.set_tensor_with_constant_values operation", "description": "An operation that sets an input tensor with given values. It takes an input\n tensor and a chain as inputs and a list of values as attribute (for complex\n element type, real and complex values are interleaved, resulting in twice\n the number of values overall). This operation outputs a chain.\n\n Example:\n %1 = tfrt.new.chain\n %2 = tfrt_dht.create_uninitialized_tensor.i32.2 [1 : i32, 2 : i32]\n %3 = tfrt_dht.set_tensor_with_constant_values.i32 %2, %1 [8 : i32, 9 : i32]\n %4 = tfrt_dht.create_uninitialized_tensor.complex64.2 [1 : i32, 2 : i32]\n %5 = tfrt_dht.set_tensor_with_constant_values.complex64 %2, %1\n [8.000e+00 : f32, 0.000e+00 : f32, 9.000e+00 : f32, 0.000e+00 : f32]", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "values", "type": "ArrayAttr" } ], "assemblyFormat": "operands $values attr-dict" }, { "name": "tfrt_dht.tensor_equal.bool", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.complex128", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.complex64", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.f32", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.i32", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.i64", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.ui16", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.ui32", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.ui64", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_dht.tensor_equal.ui8", "summary": "tfrt_dht.tensor_equal operation", "description": "An operation that checks if two input tensors are equal. It takes two input\n tensors and a chain as inputs and outputs an i1 result and a chain output.\n\n The chain output value is needed to prevent write-after-read hazard.\n\n Example:\n %4, %5 = tfrt_dht.tensor_equal.i32 %1, %2, %3", "results": [ { "name": "result0", "type": "I1" }, { "name": "result1", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_fallback_async.batch_function", "summary": "Fallback ExecuteOp specialized for tf.BatchFunction.", "description": "This kernel executes a variant tf.BatchFunction kernel that supports having\n the `f` attribute as a BEF function.\n\n Example:\n %res = tfrt_fallback_async.batch_function device(\"/CPU:0\") @f(%input, %captured_input) {\n num_batch_threads = 1,\n max_batch_size = 4,\n allowed_batch_sizes = [2 , 4],\n batch_timeout_micros = 50,\n container = \"container\",\n shared_name = \"shared_name\",\n batching_queue = \"batching_queue\",\n enable_large_batch_splitting = false,\n Tin = [f32],\n Tcaptured = [f32],\n Tout = [f32]} : 1\n\n Note that the trailing number indicates the number of results.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "f", "type": "SymbolRefAttr" }, { "name": "op_attrs", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_fallback_async.const_dense_tensor", "summary": "Create a constant dense tensorflow tensor.", "description": "ConstDenseTensorOp creates a constant dense tensorflow tensor.\n\n Example:\n %tensor = tfrt_fallback_async.const_dense_tensor dense<[0, 1, 2]> : tensor<3xi32>", "results": [ { "name": "result", "type": "TFTensorType" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict" }, { "name": "tfrt_fallback_async.const_string_tensor", "summary": "Create a constant string tensorflow tensor.", "description": "ConstStringTensorOp creates a constant string tensorflow tensor.\n\n Example:\n %tensor = tfrt_fallback_async.const_string_tensor {shape = [1, 2], value = [\"const\", \"string\"]}\n\n Note: if the entries in `value` are all the same, we can just keep one copy.\n In other words, the following two lines are effectively the same.\n %tensor = tfrt_fallback_async.const_string_tensor {shape = [1, 2], value = [\"string\", \"string\"]}\n %tensor = tfrt_fallback_async.const_string_tensor {shape = [1, 2], value = [\"string\"]}", "results": [ { "name": "result", "type": "TFTensorType" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "value", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict" }, { "name": "tfrt_fallback_async.const_tensor_proto", "summary": "Create a tensorflow tensor from serialized tensor proto", "description": "Create a tensorflow tensor from serilaized tensor proto.\n\n Example:\n %tensor = tfrt_fallback_async.const_tensor_proto \"\"", "results": [ { "name": "result", "type": "TFTensorType" } ], "attributes": [ { "name": "serialized_tensor_proto", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$serialized_tensor_proto attr-dict" }, { "name": "tfrt_fallback_async.copy_if_small", "summary": "Copy the CPU fallback tensor if it is small", "description": "This kernel performs deep copy on the input tensor if it is small, to avoid\n atomic contention on its refcount.\n\n Note that this kernel always create a new AsyncValue for each result to\n avoid atomic contention on AsyncValue's refcount.", "operands": [ { "name": "operand", "type": "TFTensorType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$operand attr-dict `:` `(` type($operand) `)` `->` `(` type($results) `)`" }, { "name": "tfrt_fallback_async.corert_tensorhandle_to_fallback_tensor", "summary": "Convert corert tensorhandle to fallback tensor", "description": "Convert the corert tensorhandle to the fallback tensor.\n\n args: a list of corert tensorhandles.\n device: the name of the tensorflow device that is associated with the\n output fallback tensor.\n\n results: the converted fallback tensors.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` `(` type($args) `)` `->` `(` type($results) `)`" }, { "name": "tfrt_fallback_async.createop", "summary": "The Fallback CreateOp", "description": "The CreateOp creates the tensorflow::OpKernel in the fallback context.\n\n op_key: The unique key to identify this op.\n num_args: The number of inputs.\n device: The tensorflow device. eg. \"/CPU:0\"\n op_attrs: The tensorflow attributes excluding the func attrs.\n op_func_attrs: The func attrs.\n op_name: The tensorflow op name. eg. \"tf.AddV2\"\n\n Example:\n %out_ch = tfrt_fallback_async.createop(%in_ch) key(0) device(\"/CPU:0\")\n \"some.op\"() {attr1 = value, attr2 = value2} {f_attr1 = \"fn1\", f_attr2 = \"fn2\"} num_args(1)", "operands": [ { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "num_args", "type": "I64Attr" }, { "name": "device", "type": "StrAttr" }, { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_key", "type": "I64Attr" }, { "name": "op_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_fallback_async.executeop", "summary": "The Fallback ExecuteOp", "description": "The ExecuteOp executes an operation on the specified device.\n\n Example:\n %res = tfrt_fallback_async.executeop key(0) cost(100) device(\"/CPU:0\") \"some.op\"(%arg) : 1\n\n Note that the trailing number indicates the number of results.\n\n The func attrs and op attrs are placed in two separate regions.\n\n Example:\n %res = tfrt_fallback_async.executeop key(0) device(\"/CPU:0\") \"some.op\"(%arg)\n {attr1 = value, attr2 = value2} {f_attr1 = \"fn1\", f_attr2 = \"fn2\"} : 1\n\n Note that in this case, the first bracket contains op attributes other than\n function attributes, and the second braket contains function attributes,\n which represent function names.\n\n Refer to b/172597167 for approaches considered for supporting function\n attributes.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_key", "type": "I64Attr" }, { "name": "op_name", "type": "StrAttr" }, { "name": "_tfrt_cost", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_fallback_async.executeop.allocator", "summary": "The Fallback ExecuteOp with custom allocator", "description": "Similar to ExecuteOp but takes a custom allocator for allocating output tensors.", "operands": [ { "name": "allocator", "type": "TFAllocatorType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_key", "type": "I64Attr" }, { "name": "op_name", "type": "StrAttr" }, { "name": "_tfrt_cost", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_fallback_async.executeop.seq", "summary": "The sequenced version of Fallback ExecuteOp", "description": "The ExecuteOpSeq executes an operation on the specified device, similar to\n ExecuteOp. In addition, it takes an in_op_chain and produces an out_op_chain\n that can be used to sequence op executions. ExecuteOpSeq is nonstrict on\n in_op_chain.\n\n Example:\n %op_ch_out, %res = tfrt_fallback_async.executeop.seq(%op_ch_in)\n key(0) cost(100) device(\"/CPU:0\") \"some.op\"(%arg) : 1\n\n Note that the trailing number indicates the number of results.\n\n The func attrs and op attrs are placed in two separate regions.\n\n Example:\n %op_ch_out, %res = tfrt_fallback_async.executeop.seq(%op_ch_in)\n key(0) cost(100) device(\"/CPU:0\") \"some.op\"(%arg)\n {fn = function_1} {attr1 = value, attr2 = value2} : 1\n\n Note that in this case, the first braket contains op attributes other than\n function attributes, and the second braket contains function attributes,\n which represent function names.\n\n Refer to b/172597167 for approaches considered for supporting function\n attributes.", "operands": [ { "name": "in_op_chain", "type": "TFRT_ChainType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "out_op_chain", "type": "TFRT_ChainType" }, { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_key", "type": "I64Attr" }, { "name": "op_name", "type": "StrAttr" }, { "name": "_tfrt_cost", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_fallback_async.executeop.seq.allocator", "summary": "The sequenced version of Fallback ExecuteOp with custom allocator", "description": "Similar to ExecuteOpSeq but takes a custom allocator for allocating output tensors.\n\n Example:\n %op_ch_out, %res = tfrt_fallback_async.executeop.seq.allocator(%op_ch_in, %allocator)\n key(0) cost(100) device(\"/CPU:0\") \"some.op\"(%arg) : 1", "operands": [ { "name": "in_op_chain", "type": "TFRT_ChainType" }, { "name": "allocator", "type": "TFAllocatorType" }, { "name": "args", "type": "Variadic" } ], "results": [ { "name": "out_op_chain", "type": "TFRT_ChainType" }, { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "op_attrs", "type": "ArrayAttr" }, { "name": "op_func_attrs", "type": "ArrayAttr" }, { "name": "op_key", "type": "I64Attr" }, { "name": "op_name", "type": "StrAttr" }, { "name": "_tfrt_cost", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_fallback_async.fallback_tensor_to_corert_tensorhandle", "summary": "Convert fallback tensor to corert tensorhandle", "description": "Convert the fallback tensor to corert tensorhandle.\n\n args: a list of fallback tensors.\n device: the name of the tensorflow device that is associated with the\n input fallback tensors.\n\n results: the converted corert tensorhandles.", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` `(` type($args) `)` `->` `(` type($results) `)`" }, { "name": "tfrt_fallback_async.get_resource", "summary": "get a tensor in resource array", "description": "Get a tensor in resource array.\n\n indices: the indices in the resource array.\n results: the tensor values for the corresponding indices.\n\n in_ch and out_ch are for control dependencies.", "operands": [ { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" }, { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` `(` type($in_ch) `)` `->` `(` type($out_ch) `,` type($results) `)`" }, { "name": "tfrt_fallback_async.predicate", "summary": "Converts a fallback tensor to a bool", "description": "Note: this kernel is used for CPU tensors.\n\n Converts a fallback tensor to a bool with the following rules:\n\n - For 0D tensors, truthiness is determined by comparing against a \"zero\"\n value. For numerical types it is the obvious zero. For strings it is the\n empty string.\n\n - For >0D tensors, truthiness is determined by looking at the number of\n elements. If has zero elements, then the result is false. Otherwise the\n result is true.\n\n input: a fallback tensor representing the condition.\n device: the name of the tensorflow device that is associated with the\n input fallback tensor.\n\n output: the converted bool.", "operands": [ { "name": "input", "type": "TFTensorType" } ], "results": [ { "name": "output", "type": "I1" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$input attr-dict" }, { "name": "tfrt_fallback_async.set_resource", "summary": "Set a tensor in resource array", "description": "Set a tensor in resource array.\n\n arg: the tensor to be set in the resource array.\n index: the index in the resource array\n\n in_ch and out_ch are for control dependencies.", "operands": [ { "name": "in_ch", "type": "TFRT_ChainType" }, { "name": "arg", "type": "TFTensorType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "device", "type": "StrAttr" }, { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_fallback_sync.convert_dht_to_fallback_tensor", "summary": "convert a DHT to a fallback tensor", "description": "Convert a TFRT DHT to a fallback tensor.\n\n dht: the input DHT.\n fallback_tensor: The output fallback tensor", "operands": [ { "name": "dht", "type": "TensorType" } ], "results": [ { "name": "fallback_tensor", "type": "TFTensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` type($fallback_tensor)" }, { "name": "tfrt_fallback_sync.convert_fallback_tensor_to_dht", "summary": "convert fallback tensor to a DHT", "description": "Convert a fallback tensor to a TFRT DHT.\n\n fallback_tensor: The input fallback tensor\n dht: the output DHT.", "operands": [ { "name": "fallback_tensor", "type": "TFTensorType" } ], "results": [ { "name": "dht", "type": "TensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` type($dht)" }, { "name": "tfrt_fallback_sync.convert_sht_to_fallback_tensor", "summary": "convert a SHT to a fallback tensor", "description": "Convert a TFRT SHT to a fallback tensor.\n\n sht: the input SHT.\n fallback_tensor: The output fallback tensor", "operands": [ { "name": "sht", "type": "TensorType" } ], "results": [ { "name": "fallback_tensor", "type": "TFTensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict `:` type($fallback_tensor)" }, { "name": "tfrt_fallback_sync.createop", "summary": "The Fallback CreateOp", "description": "The CreateOp creates the tensorflow::OpKernel in the fallback context.\n\n op_key: The unique key to identify this op.\n num_args: The number of inputs.\n device: The tensorflow device. eg. \"/CPU:0\"\n op_attrs: The tensorflow attributes excluding the func attrs.\n op_name: The tensorflow op name. eg. \"tf.AddV2\"\n\n Example:\n tfrt_fallback_sync.createop() key(0) device(\"/CPU:0\")\n \"some.op\"() {attr1 = value, attr2 = value2} {f_attr1 = \"fn1\", f_attr2 = \"fn2\"} num_args(1)", "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict" }, { "name": "tfrt_fallback_sync.executeop", "summary": "The Fallback Sync ExecuteOp", "description": "The ExecuteOp executes an operation on the specified device.\n\n Example:\n %res = tfrt_fallback_sync.executeop \"some.op\"(%arg) : 1\n\n Note that the trailing number indicates the number of results.", "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "node_def", "type": "StrAttr" }, { "name": "op_key", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "`(`operands`)` attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_fallback_sync.get_resource", "summary": "get a tensor in resource array", "description": "Get a tensor in resource array.\n\n indices: the indices in the resource array.\n results: the tensor values for the corresponding indices.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict `:` type($results)" }, { "name": "tfrt_fallback_sync.get_resource_dht", "summary": "get a DHT in resource array", "description": "Get a tensor in resource array.\n\n indices: the indices in the resource array.\n results: the tensor values for the corresponding indices.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict `:` type($results)" }, { "name": "tfrt_fallback_sync.get_sparse_matrix_resource", "summary": "get a sparse matrix from resource array", "description": "Get a sparse matrix from resource array.\n\n indices: the indices in the resource array.\n results: the tensor values for the corresponding indices.", "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "indices", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict `:` type($results)" }, { "name": "tfrt_fallback_sync.set_resource", "summary": "Set a tensor in resource array", "description": "Set a tensor in resource array.\n\n arg: the tensor to be set in the resource array.\n index: the index in the resource array", "operands": [ { "name": "arg", "type": "TFTensorType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_fallback_sync.set_resource_dht", "summary": "Set a DHT in resource array", "description": "Set a DHT in resource array.\n\n arg: the tensor to be set in the resource array.\n index: the index in the resource array", "operands": [ { "name": "arg", "type": "TensorType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_fallback_sync.set_sparse_matrix_resource", "summary": "Set a Sparse matrix in resource array", "description": "Set a sparse matrix in resource array.\n\n arg: the matrix to be set in the resource array.\n index: the index in the resource array", "operands": [ { "name": "arg", "type": "TFTensorType" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tfrt_tensor.bitcast", "summary": "tensor bitcast operation", "description": "Bitcast a tensor from one type to another type of equivalent element width.\n If both are ranked, then the rank should be the same and static dimensions\n should match.\n\n Example:\n\n ```mlir\n // Bitcast from unsigned to signed or signless integer.\n %2 = tensor.bitcast %1 : tensor<4xui32> to tensor<4xi32>\n ```", "operands": [ { "name": "source", "type": "TensorOf<[AnySignlessInteger, AnyUnsignedInteger, AnySignedInteger, AnyFloat]>" } ], "results": [ { "name": "dest", "type": "TensorOf<[AnySignlessInteger, AnyUnsignedInteger, AnySignedInteger, AnyFloat]>" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "tfrt_tensor.cast", "summary": "tensor cast operation", "description": "Convert a tensor from one type to an equivalent type without changing any\n data elements. The source and destination types must both be tensor types\n with the same element type. If both are ranked, then the rank should be the\n same and static dimensions should match. The operation is invalid if\n converting to a mismatching constant dimension.\n\n Example:\n\n ```mlir\n // Convert from unknown rank to rank 2 with unknown dimension sizes.\n %2 = tensor.cast %1 : tensor<*xf32> to tensor\n\n // Convert to a type with more known dimensions.\n %3 = tensor.cast %2 : tensor to tensor<4x?xf32>\n\n // Discard static dimension and rank information.\n %4 = tensor.cast %3 : tensor<4x?xf32> to tensor\n %5 = tensor.cast %4 : tensor to tensor<*xf32>\n ```", "operands": [ { "name": "source", "type": "AnyTensor" } ], "results": [ { "name": "dest", "type": "AnyTensor" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($dest)" }, { "name": "tfrt_tensor.collapse_shape", "summary": "operation to produce a tensor with a smaller rank", "description": "The `tensor.collapse_shape` op produces a new tensor of lower (or equal)\n rank whose dimension sizes are a reassociation of the original `src` dimensions.\n\n A reassociation is defined as a continuous grouping of dimensions and is\n represented by an array of DenseI64ArrayAttr attribute. The reassociation\n maps are applied to the operand shape to obtain the result shape.\n\n\n Example:\n\n ```mlir\n // Dimension collapse (i, j) -> i' and k -> k'\n %b = tensor.collapse_shape %a [[0, 1], [2]]\n : tensor into tensor\n ```", "operands": [ { "name": "src", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "reassociation", "type": "TypedArrayAttrBase>" } ], "assemblyFormat": "$src $reassociation attr-dict `:` type($src) `into` type($result)" }, { "name": "tfrt_tensor.concat", "summary": "tensor concatenation operation", "description": "The \"concat\" operation constructs a tensor out of a variadic list of input\n tensors, concatenated along a static dimension number. All inputs and the\n result type must share the same rank.\n\n `dim` specifies the dimension along which to concatenate. The size of the\n concatenated dimension in the result must be equal to the sum of the sizes\n of the inputs along that dimension. All other dimensions in both the inputs\n and result must be the same size.\n\n Example:\n\n ```mlir\n %0 = tensor.concat dim(0) %0, %1, %2 :\n (tensor<3x6xf32>, tensor<3x6xf32>, tensor<1x6xf32) -> tensor<7x6xf32>\n\n // Dynamic + dynamic -> static\n %0 = tensor.concat dim(1) %0, %1, %2 :\n (tensor<3x?xf32>, tensor<3x2xf32>, tensor<3x?xf32) -> tensor<3x10xf32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" } ], "assemblyFormat": "`dim` `(` $dim `)` $inputs attr-dict\n `:` functional-type(operands, results)" }, { "name": "tfrt_tensor.dim", "summary": "dimension index operation", "description": "The `tensor.dim` operation takes a tensor and a dimension operand of type\n `index`. It returns the size of the requested dimension of the given\n tensor. If the dimension index is out of bounds, the behavior is undefined.\n\n The specified tensor type is that of the first operand.\n\n Example:\n\n ```mlir\n // Always returns 4, can be constant folded:\n %c0 = arith.constant 0 : index\n %x = tensor.dim %A, %c0 : tensor<4x?xf32>\n\n // Return the dynamic dimension of %A.\n %c1 = arith.constant 1 : index\n %y = tensor.dim %A, %c1 : tensor<4x?xf32>\n\n // Equivalent generic form:\n %x = \"tensor.dim\"(%A, %c0) : (tensor<4x?xf32>, index) -> index\n %y = \"tensor.dim\"(%A, %c1) : (tensor<4x?xf32>, index) -> index\n ```", "operands": [ { "name": "source", "type": "AnyNon0RankedOrUnrankedTensor" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "attr-dict $source `,` $index `:` type($source)" }, { "name": "tfrt_tensor.empty", "summary": "empty tensor operation", "description": "`tensor.empty` is an operation that defines a tensor of a particular shape.\n The shape could be dynamic or static. The contents of the tensor are\n unspecified and the only purpose of the op result is to materialize the\n specified shape in IR and make it available to other transformations.\n\n `tensor.empty` is useful in transformations that expect destination style\n ops. I.e., ops that implement `DestinationStyleOpInterface`. Ops that are\n not in destination style can be made compatible with such transformations\n with a `tensor.empty` destination.\n\n Note: This op can be lowered to a `bufferization.alloc_tensor`, at which\n point it turns into an explicit buffer allocation.", "operands": [ { "name": "dynamicSizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "`(`$dynamicSizes`)` attr-dict `:` type($result)" }, { "name": "tfrt_tensor.expand_shape", "summary": "operation to produce a tensor with a higher rank", "description": "The `tensor.expand_shape` op produces a tensor of higher (or equal)\n rank than the operand `src` whose dimension sizes are a reassociation of\n `src`.\n\n A reassociation is defined as a continuous grouping of dimensions and is\n represented with an array of DenseI64ArrayAttr attribute. The reassociation\n maps applied to the result tensor with the higher rank must result in the\n operand tensor with the smaller rank.\n\n The representation for the output shape supports a partially-static\n specification via attributes specified through the `static_output_shape`\n argument. A special sentinel value `ShapedType::kDynamic` encodes that the\n corresponding entry has a dynamic value. There must be exactly as many SSA\n inputs in `output_shape` as there are `ShapedType::kDynamic` entries in\n `static_output_shape`.\n\n Example:\n\n ```mlir\n // Dimension expansion i -> (i', j') and (k) -> (k')\n %b = tensor.expand_shape %a [[0, 1], [2]] output_shape [%sz0, %sz1, 32]\n : tensor into tensor\n ```", "operands": [ { "name": "src", "type": "AnyTensor" }, { "name": "output_shape", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "attributes": [ { "name": "reassociation", "type": "TypedArrayAttrBase>" }, { "name": "static_output_shape", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$src $reassociation `output_shape`\n custom($output_shape, $static_output_shape) attr-dict `:`\n type($src) `into` type($result)" }, { "name": "tfrt_tensor.extract", "summary": "element extraction operation", "description": "The `tensor.extract` op reads a ranked tensor and returns one element as\n specified by the given indices. The result of the op is a value with the\n same type as the elements of the tensor. The arity of indices must match\n the rank of the accessed value. All indices should all be of `index` type.\n\n Example:\n\n ```mlir\n %4 = tensor.extract %t[%1, %2] : tensor<4x4xi32>\n %5 = tensor.extract %rt[%1, %2] : tensor\n ```", "operands": [ { "name": "tensor", "type": "AnyRankedTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$tensor `[` $indices `]` attr-dict `:` type($tensor)" }, { "name": "tfrt_tensor.extract_slice", "summary": "extract slice operation", "description": "The \"extract_slice\" operation extract a tensor from another tensor as\n specified by the operation's offsets, sizes and strides arguments.\n\n The extract_slice operation supports the following arguments:\n\n * source: the \"base\" tensor from which to extract a slice.\n * offsets: tensor-rank number of offsets into the \"base\" tensor from which\n to extract the slice.\n * sizes: tensor-rank number of sizes which specify the sizes of the result\n tensor type.\n * strides: tensor-rank number of strides specifying subsampling in each\n dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value ShapedType::kDynamic encodes that the corresponding entry has\n a dynamic value.\n\n After buffer allocation, the \"extract_slice\" op is expected to lower into a\n memref.subview op.\n\n An extract_slice operation may additionally reduce the rank of the resulting\n tensor by removing dimensions that are statically known to be of size 1.\n This rank-reduction behavior is not required by the op semantics: this\n flexibility allows to progressively drop unit dimensions while lowering\n between different flavors of ops on that operate on tensors.\n\n #### Verification vs Inference in the rank-reduced case\n\n Note that there may be multiple ways to infer a resulting rank-reduced type.\n e.g. 1x6x1 could potentially rank-reduce to either 1x6 or 6x1 2-D shapes.\n\n To disambiguate, the inference helpers `inferCanonicalRankReducedResultType`\n only drop the first unit dimensions, in order:\n e.g. 1x6x1 rank-reduced to 2-D will infer the 6x1 2-D shape, but not 1x6.\n\n Verification however has access to result type and does not need to infer.\n The verifier calls `isRankReducedType(getSource(), getResult())` to\n determine whether the result type is rank-reduced from the source type.\n This computes a so-called rank-reduction mask, consisting of dropped unit\n dims, to map the rank-reduced type to the source type by dropping ones:\n e.g. 1x6 is a rank-reduced version of 1x6x1 by mask {2}\n 6x1 is a rank-reduced version of 1x6x1 by mask {0}\n 1x2x1x4 is a rank-reduced version of 1x1x2x1x1x4x1 by mask {1, 4, 6}\n (remaining common 1 dimensions are matched eagerly)\n\n Example:\n\n ```mlir\n // Rank-reducing extract_slice.\n %1 = tensor.extract_slice %0[0, 0, 0][1, 16, 4][1, 1, 1] :\n tensor<8x16x4xf32> to tensor<16x4xf32>\n %3 = tensor.extract_slice %2[%o0, 4, %o2][1, %sz1, 1][1, %st1, 1] :\n tensor<8x16x4xf32> to tensor<1x?xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$source ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `to` type($result)" }, { "name": "tfrt_tensor.from_elements", "summary": "tensor from elements operation.", "description": "Create a N-D tensor from a range of same-type arguments. The number of\n provided `elements` should equal to the number of the elements in the\n result type. The `elements` correspond to a flattened tensor.\n\n Example:\n\n ```mlir\n tensor.from_elements %a, %b, %c, %d, %e, %f : tensor<2x3xindex>\n ```\n\n will result in a tensor\n\n [[%a, %b, %c]\n [%d, %e, %f]]", "operands": [ { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyStaticShapeTensor" } ], "assemblyFormat": "$elements attr-dict `:` type($result)" }, { "name": "tfrt_tensor.gather", "summary": "gather a subset of a tensor at specified indices", "description": "The `gather` operation extracts a subset of the elements from a `source`\n tensor at the given indices.\n\n In its most general form, the tensor of indices specifies all the coordinates\n of every element to extract (i.e. COO format, without the payload).\n The indices are expected to be confined to coordinate values that fit the\n range of the `source` tensor, otherwise the behavior is undefined.\n\n The leading dimensions of the index tensor give the result tensor its leading\n dimensions. The trailing dimensions of the result tensor are obtained from\n the source tensor by omitting the dimensions specified in `gather_dims`\n (rank-reducing semantics) or setting them to `1` (rank-preserving semantics)\n (see examples).\n The trailing dimension of the index tensor contains the coordinates and is\n expected to have its size equal to the number of dimensions being gathered.\n This convention allows an idiomatic specification and lowering of \"gathering\n multiple N-D slices from the source tensor\".\n\n Note: in the examples below, we separate out the indexing part of the tensor\n type by a whitespace for readability purposes.\n\n Example:\n\n ```mlir\n // For each 1x2 triple of coordinates in %indices, extract the\n // element (i.e. 0-D subset) at the coordinates triple in %source.\n //\n %out = tensor.gather %source[%indices] gather_dims([0, 1, 2]) :\n (tensor<4x4x4xf32>, tensor<1x2x 3xindex>) -> tensor<1x2x 1x1x1xf32>\n\n // Note: result type may be further rank-reduced to tensor<1x2x f32>.\n ```\n\n A slice variant is provided to allow specifying whole slices of the source\n tensor.\n\n Example:\n\n ```mlir\n // For each 5x6 singleton of coordinates in %indices, extract the 2-D\n // slice %source[*, %indices[...]:%indices[...] + 1, *] with the indices\n // corresponding to the `gather_dims` attribute specified by %indices.\n //\n %out = tensor.gather %source[%indices] gather_dims([1]) :\n (tensor<3x4x5xf32>, tensor<6x7x 1xindex>) -> tensor<6x7x 3x1x5xf32>\n\n // Note: result type may be further rank-reduced to tensor<6x7x 3x5xf32>.\n ```\n\n The dimensions specified in the gather_dims attribute are ones for which the\n result tensor has size `1`.\n I.e. if the source type is `axbxcxd` and the coordinates are [1, 3], then\n the shape suffix is `ax1xcx1`.\n Gather also allows rank-reducing semantics where the shape `ax1xcx1` can be\n further simplified to `axc`.\n\n The elemental type of the indices tensor can be any integer type.\n In the absence of target-specific or problem specific information the default\n type one should use is `index`.\n\n This operation does not support unranked tensors.\n\n An optional `unique` unit attribute may be specified to indicate that the\n coordinates in `indices` are statically guaranteed to be unique at runtime.\n Incorrectly setting the `unique` attribute when the coordinates are not truly\n unique is undefined behavior.\n\n Only full slices are meant to be supported by this op, if one desires\n partial slices (e.g. strided windows) one should compose this op with other\n tensor ops (e.g. tensor.extract_slice). This is to avoid a slippery slope of\n complexity that would make the op unusable in practice.\n\n At the tensor-level, the index tensor is specified in an AoS form (i.e.\n coordinate tuple is the most minor). It is the responsibility of further\n lowerings and bufferization to implement various concrete layouts.\n\n Note: As currently specified, the operation must lower to an abstraction that\n performs copies to the output tensor. This is because the buffer type system\n is currently not rich enough to allow multiple non-contiguous views in the\n same type. This is visible more clearly in a notional buffer version of the\n op:\n\n ```mlir\n // memref is a contiguous buffer of ?x4x1 elements.\n // gather from random source slices must copy to the contiguous output.\n %out = memref.gather %source[%indices] gather_dims([1]) :\n (memref<4x4xf32>, memref) -> memref\n\n // Nested buffer support would allow gather to directly index into the\n // source buffer (i.e. represent a jagged view into the source).\n %out = memref.gather %source[%indices] gather_dims([1]) :\n (memref<4x4xf32>, memref) -> memref>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "indices", "type": "RankedTensorOf<[AnySignlessIntegerOrIndex]>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "gather_dims", "type": "DenseI64ArrayAttr" }, { "name": "unique", "type": "UnitAttr" } ], "assemblyFormat": "$source `[` $indices `]`\n `gather_dims` `(` $gather_dims `)`\n (`unique` $unique^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "tfrt_tensor.generate", "summary": "Creates a dynamically sized tensor from elements", "description": "This operation creates a dynamically sized tensor with elements of any type.\n It expects one index operand per dynamic extent of the result tensor.\n\n The body region defines the tensor's elements. It takes index operands as\n its region arguments that span the index space. The element at the given\n position is yielded with the `yield` operation (see `YieldOp`). There is\n no defined ordering to the invocations of the body. It is conceptually\n a \"parallel map\" operation.\n\n Example:\n\n ```mlir\n %tnsr = tensor.generate %m, %n {\n ^bb0(%i : index, %j : index, %k : index):\n ...\n yield %elem : f32\n } : tensor\n ```", "operands": [ { "name": "dynamicExtents", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$dynamicExtents $body attr-dict `:` type($result)" }, { "name": "tfrt_tensor.insert", "summary": "element insertion operation", "description": "The `tensor.insert` op inserts a scalar into a ranked tensor `dest` as\n specified by the operation's indices.\n\n It returns a copy of `dest` with the indexed position updated to the value\n of `scalar`.\n\n The arity of `indices `must match the rank of the tensor `dest`. All\n indices should be of `index` type.\n\n Example:\n\n ```mlir\n %4 = tensor.insert %t into %dest[%1, %2] : tensor<4x4xi32>\n %5 = tensor.insert %rt into %dest[%1, %2] : tensor\n ```", "operands": [ { "name": "scalar", "type": "AnyType" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "$scalar `into` $dest `[` $indices `]` attr-dict `:` type($dest)" }, { "name": "tfrt_tensor.insert_slice", "summary": "insert_slice operation", "description": "The \"insert_slice\" operation insert a tensor `source` into another\n tensor `dest` as specified by the operation's offsets, sizes and strides\n arguments.\n\n It returns a copy of `dest` with the proper slice updated with the value\n of `source`.\n\n The insert_slice operation supports the following arguments:\n\n * source: the tensor that is inserted.\n * dest: the tensor into which the source tensor is inserted.\n * offsets: tensor-rank number of offsets into the `dest` tensor into which\n the slice is inserted.\n * sizes: tensor-rank number of sizes which specify the sizes of the source\n tensor type.\n * strides: tensor-rank number of strides that specify subsampling in each\n dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value ShapedType::kDynamic encodes that the corresponding entry has\n a dynamic value.\n\n After buffer allocation, the \"insert_slice\" op is expected to lower into a\n memref.subview op.\n\n An insert_slice operation may additionally specify insertion into a tensor\n of higher rank than the source tensor, along dimensions that are statically\n known to be of size 1.\n This rank-altering behavior is not required by the op semantics: this\n flexibility allows to progressively drop unit dimensions while lowering\n between different flavors of ops on that operate on tensors.\n The rank-altering behavior of tensor.insert_slice matches the rank-reducing\n behavior of tensor.extract_slice.\n\n #### Verification in the rank-reduced case\n\n The same verification discussion and mechanisms apply as for ExtractSliceOp.\n Unlike ExtractSliceOp however, there is no need for a specific inference.\n\n Example:\n\n ```mlir\n // Rank-altering insert_slice.\n %1 = tensor.insert_slice %t into %0[0, 0, 0][1, 16, 4][1, 1, 1] :\n tensor<16x4xf32> into tensor<8x16x4xf32>\n %3 = tensor.insert_slice %tt into %2[%o0, 4, %o2][1, %sz1, 1][1, %st1, 1] :\n tensor<1x?xf32> into tensor<8x16x4xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$source `into` $dest ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `into` type($dest)" }, { "name": "tfrt_tensor.pad", "summary": "tensor pad operation", "description": "`tensor.pad` is an operation that pads the `source` tensor\n with given `low` and `high` padding config.\n\n The PadOp operation supports the following arguments:\n\n * source: the \"base\" tensor on which to pad.\n * low: A list contains the padding along the start of each\n dimension, i.e., how many padded values are prepended\n to the beginning of the tensor in each dimension.\n * high: A list contains the padding along the end of each\n dimension, i.e., how many padded values are appended\n to the end of the tensor in each dimension.\n * nofold: indicates that the operation should not be folded when source and\n result types are equal.\n\n The result tensor dimensions are `low[i]` + `dim[i]` + `high[i]` for each\n dimension `i`. The number of elements of `low` and `high` must match the\n rank of the input tensor. They can be either a constant or a dynamic value.\n\n The region of the `tensor.pad` operation returns the value to use\n for the padding. The arguments of the region represent the index\n of the source being accessed. There should be as many arguments as\n the rank of the `source` tensor. The value `yield`-ed by the\n region is used as the value of the view at the given position.\n\n If `nofold` is set, the padding operation will not be folded away even\n if the source type and the padded type have the same static shape. This can\n be used, e.g., for packing or promotion to faster memory.\n\n Example 1: add 3 zeros to the beginning and 5 zeros to the end of a 1D\n tensor.\n\n ```mlir\n %arg0 = ... : tensor<10xi32>\n %c0_i32 = arith.constant 0 : i32\n %padded = tensor.pad %arg0 low[3] high[5] {\n ^bb0(%arg1: index):\n tensor.yield %c0_i32 : i32\n } : tensor<10xi32> to tensor<18xi32>\n ```\n\n Example 2: add 1 value to the beginning of dimension 0, 2 values to the end\n of dimension 0, 2 values to the start of dimension 1, and 3 values to the\n end of dimension 1.\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %0 low[1, 2] high[2, 3] {\n ^bb0(%arg0 : index, %arg1 : index):\n tensor.yield %pad_value : f32\n } : tensor to tensor\n ```\n\n Example 3:\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %arg0 low[2, %arg1, 3, 3] high[3, 3, %arg1, 2] {\n ^bb0(%arg2: index, %arg3: index, %arg4: index, %arg5: index):\n tensor.yield %pad_value : f32\n } : tensor<1x2x2x?xf32> to tensor<6x?x?x?xf32>\n ```\n\n Example 4:\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %arg0 low[0, 0] high[%ub0, %ub1] {\n ^bb0(%arg1: index, %arg2: index):\n tensor.yield %pad_value : f32\n } : tensor<2x3xf32> to tensor\n ```\n\n Example 5: Force a padded value to be always exist with `nofold`, even\n though the padding config specifies that no new elements will be added to\n the tensor.\n\n ```mlir\n %pad_value = ... : f32\n %0 = tensor.pad %arg0 nofold low[0, 0] high[0, 0] {\n ^bb0(%arg1: index, %arg2: index):\n tensor.yield %pad_value : f32\n } : tensor<2x3xf32> to tensor<2x3xf32>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "low", "type": "Variadic" }, { "name": "high", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_low", "type": "DenseI64ArrayAttr" }, { "name": "static_high", "type": "DenseI64ArrayAttr" }, { "name": "nofold", "type": "UnitAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "$source\n (`nofold` $nofold^)?\n `low` `` custom($low, $static_low)\n `high` `` custom($high, $static_high)\n $region attr-dict `:` type($source) `to` type($result)" }, { "name": "tfrt_tensor.parallel_insert_slice", "summary": "Specify the tensor slice update of a single thread of a parent\n InParallelOpInterface op.", "description": "The `parallel_insert_slice` yields a subset tensor value to its parent\n InParallelOpInterface. These subset tensor values are aggregated to\n in some unspecified order into a full tensor value returned by the parent\n parallel iterating op.\n The `parallel_insert_slice` is one such op allowed in the\n InParallelOpInterface op.\n\n Conflicting writes result in undefined semantics, in that the indices written\n to by multiple parallel updates might contain data from any of the updates,\n or even a malformed bit pattern.\n\n If an index is updated exactly once, the value contained at that index\n in the resulting tensor will be equal to the value at a corresponding index\n of a slice that was used for the updated. If an index is not updated at all,\n its value will be equal to the one in the original tensor.\n\n This op does not create a new value, which allows maintaining a clean\n separation between the subset and full tensor.\n\n Note that we cannot mark this operation as pure (Pures), even\n though it has no side effects, because it will get DCEd during\n canonicalization.\n\n The parallel_insert_slice operation supports the following arguments:\n\n * source: the tensor that is inserted.\n * dest: the tensor into which the source tensor is inserted.\n * offsets: tensor-rank number of offsets into the `dest` tensor into which\n the slice is inserted.\n * sizes: tensor-rank number of sizes which specify the sizes of the source\n tensor type.\n * strides: tensor-rank number of strides that specify subsampling in each\n dimension.\n\n The representation based on offsets, sizes and strides support a\n partially-static specification via attributes specified through the\n `static_offsets`, `static_sizes` and `static_strides` arguments. A special\n sentinel value ShapedType::kDynamic encodes that the corresponding entry has\n a dynamic value.\n\n After buffer allocation, the \"parallel_insert_slice\" op is expected to lower\n into a memref.subview op.\n\n A parallel_insert_slice operation may additionally specify insertion into a\n tensor of higher rank than the source tensor, along dimensions that are\n statically known to be of size 1.\n This rank-altering behavior is not required by the op semantics: this\n flexibility allows to progressively drop unit dimensions while lowering\n between different flavors of ops on that operate on tensors.\n The rank-altering behavior of tensor.parallel_insert_slice matches the\n rank-reducing behavior of tensor.insert_slice and tensor.extract_slice.\n\n #### Verification in the rank-reduced case\n\n The same verification discussion and mechanisms apply as for ExtractSliceOp.\n Unlike ExtractSliceOp however, there is no need for a specific inference.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$source `into` $dest ``\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($source) `into` type($dest)" }, { "name": "tfrt_tensor.rank", "summary": "rank operation", "description": "The `tensor.rank` operation takes a tensor operand and returns its rank.\n\n Example:\n\n ```mlir\n %0 = tensor.rank %arg0 : tensor<*xf32>\n %1 = tensor.rank %arg1 : tensor\n ```", "operands": [ { "name": "tensor", "type": "AnyTensor" } ], "assemblyFormat": "$tensor attr-dict `:` type($tensor)" }, { "name": "tfrt_tensor.reshape", "summary": "tensor reshape operation", "description": "The `reshape` operation converts a tensor from one type to an equivalent\n type with a provided shape. The source and destination types are compatible\n if both have the same element type, same number of elements. The following\n combinations are possible:\n\n a. Source type is ranked or unranked. Shape argument has static size.\n Result type is ranked.\n\n ```mlir\n // Reshape statically-shaped tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor<4x1xf32>, tensor<1xi32>) -> tensor<4xf32>\n %dst0 = tensor.reshape %src(%shape0)\n : (tensor<4x1xf32>, tensor<2xi32>) -> tensor<2x2xf32>\n // Flatten unranked tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor<*xf32>, tensor<1xi32>) -> tensor\n ```\n\n b. Source type is ranked or unranked. Shape argument has dynamic size.\n Result type is unranked.\n\n ```mlir\n // Reshape dynamically-shaped 1D tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor, tensor) -> tensor<*xf32>\n // Reshape unranked tensor.\n %dst = tensor.reshape %src(%shape)\n : (tensor<*xf32>, tensor) -> tensor<*xf32>\n ```", "operands": [ { "name": "source", "type": "AnyTensor" }, { "name": "shape", "type": "TensorRankOf<[AnySignlessInteger, Index], [1]>" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "assemblyFormat": "$source `(` $shape `)` attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_tensor.scatter", "summary": "scatter a tensor into a destination tensor at specified indices", "description": "The `scatter` operation inserts a `source` tensor into a `dest` tensor at\n the given indices.\n\n In its most general form, the tensor of indices specifies all the coordinates\n of every element to insert (i.e. COO format, without the payload).\n The indices are expected to be confined to coordinate values that fit the\n range of the `dest` tensor, otherwise the behavior is undefined.\n\n The leading dimensions of the index tensor must match that of the dest\n tensor. The trailing dimensions of the dest tensor must match those of the\n source tensor by omitting the dimensions specified in scatter_dims\n (rank-reducing semantics) or setting them to `1` (rank-preserving semantics)\n (see examples).\n This convention allows an idiomatic specification and lowering of\n \"scattering multiple N-D slices into the dest tensor\".\n The result type must match the type of the dest tensor.\n\n Note: in the examples below, we separate out the indexing part of the tensor\n type by a whitespace for readability purposes.\n\n Example:\n\n ```mlir\n // For each 1x2 triple of coordinates in %indices, insert the\n // element (i.e. 0-D subset) at the coordinates triple in %dest.\n //\n %out = tensor.scatter %source into %dest[%indices]\n scatter_dims([0, 1, 2]) unique :\n (tensor<1x2x 1x1x1xf32>, tensor<4x4x4xf32>, tensor<1x2x 3xindex>)\n -> tensor<4x4x4xf32>\n\n // Note: source type may be further rank-reduced to tensor<1x2x f32>.\n ```\n\n A slice variant is provided to allow specifying insertion of whole tensor\n slices into the `dest` tensor.\n\n Example:\n\n ```mlir\n // For each 3 singleton of coordinates in %indices, insert the 2-D\n // slice into %dest[*, %indices[...]:%indices[...] + 1, *] with the\n // indices corresponding to the scatter_dims attribute specified by\n // %indices.\n //\n %out = tensor.scatter %source into %dest[%indices] scatter_dims([1]) unique :\n (tensor<3x 4x1x6xf32>, tensor<4x5x6xf32>, tensor<3x 1xindex>)\n -> tensor<4x5x6xf32>\n ```\n\n The dimensions specified in the scatter_dims attribute are ones for which the\n source tensor has size `1`.\n I.e. if the dest type is `axbxcxd` and the coordinates are [1, 3], then\n the source type suffix is `ax1xcx1`.\n Scatter also allows rank-reducing semantics where the shape `ax1xcx1` can be\n further simplified to `axc`.\n\n The elemental type of the indices tensor can be any integer type.\n In the absence of target-specific or problem specific information the default\n type one should use is `index`.\n\n This operation does not support unranked tensors.\n\n A `unique` unit attribute must be be specified to indicate that the\n coordinates are statically guaranteed to be unique at runtime. If coordinates\n are not truly unique at runtime, the behavior is undefined.\n\n Only full slices are meant to be supported by this op, if one desires\n partial slices (e.g. strided windows) one should compose this op with other\n tensor ops (e.g. tensor.insert_slice). This is to avoid a slippery slope of\n complexity that would make the op unusable in practice.\n\n At the tensor-level, the index tensor is specified in an AoS form (i.e.\n coordinate tuple is the most minor). It is the responsibility of further\n lowerings and bufferization to implement various concrete layouts.\n\n Note: As currently specified, the operation must lower to an abstraction that\n performs copies to the output tensor. This is because the buffer type system\n is currently not rich enough to allow multiple non-contiguous views in the\n same type. This is visible more clearly in a notional buffer version of the\n op:\n\n ```mlir\n // memref is a contiguous buffer of ?x4 elements, scatter into\n // random dest slices must copy to the contiguous dest.\n //\n some_side_effecting_op_writing_into %source, ...: memref<3x 4xf32>\n memref.scatter %source into %dest[%indices] scatter_dims([1]) unique :\n (memref<3x 4xf32>, memref, memref)\n\n // Nested buffer support in the producing op would allow writing directly\n // into the dest buffer.\n %v = some_nested_buffer_view_op %dest[%indices] scatter_dims([1]) unique :\n memref>\n some_side_effecting_op_writing_into %v, ...: memref>\n ```", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "dest", "type": "AnyRankedTensor" }, { "name": "indices", "type": "RankedTensorOf<[AnySignlessIntegerOrIndex]>" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scatter_dims", "type": "DenseI64ArrayAttr" }, { "name": "unique", "type": "UnitAttr" } ], "assemblyFormat": "$source `into` $dest `[` $indices `]`\n `scatter_dims` `(` $scatter_dims `)`\n (`unique` $unique^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "tfrt_tensor.splat", "summary": "tensor splat or broadcast operation", "description": "Broadcast the operand to all elements of the result tensor.\n\n An additional argument of type `index` must be provided for each dynamic\n dimension present in the result type.\n\n Example for a statically shaped tensor:\n\n ```mlir\n %s = arith.constant 1.0 : f32\n %t = tensor.splat %s : tensor<8x16xf32>\n ```\n\n Example for a tensor containing dynamic dimensions:\n\n ```mlir\n // Broadcasts %s to a 3D dynamically shaped tensor, with %m and %n binding\n // to dimensions 0 and 2 of the resulting tensor, respectively.\n %m = arith.constant 10 : index\n %n = arith.constant 30 : index\n %t = tensor.splat %s[%m, %n] : tensor\n ```", "operands": [ { "name": "input", "type": "AnyType" }, { "name": "dynamicSizes", "type": "Variadic" } ], "results": [ { "name": "aggregate", "type": "AnyRankedTensor" } ], "assemblyFormat": "$input (`[` $dynamicSizes^ `]`)? attr-dict `:` type($aggregate)" }, { "name": "tfrt_tensor.yield", "summary": "Yield a value from a region", "description": "This operation is used to yield a single value from a within a region. It\n is used to create dynamically sized tensors\n (see `tensor.generate` and `tensor.pad` ops).", "operands": [ { "name": "value", "type": "AnyType" } ], "assemblyFormat": "$value attr-dict `:` type($value)" }, { "name": "tfrt_test.addi", "operands": [ { "name": "op1", "type": "AnyTypeOf<[I32, TestI32]>" }, { "name": "op2", "type": "AnyTypeOf<[I32, TestI32]>" } ] }, { "name": "tfrt_test.affine_scope", "summary": "affine scope operation", "description": "Test op that defines a new affine scope.", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.all_attr_constraint_of1", "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "tfrt_test.all_attr_constraint_of2", "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "tfrt_test.alloc_with_multiple_results", "results": [ { "name": "index", "type": "Index" }, { "name": "memref", "type": "AnyMemRef" } ], "assemblyFormat": "attr-dict `:` type($index) `,` type($memref)" }, { "name": "tfrt_test.alloca_scope_region", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "tfrt_test.always_speculatable_op", "description": "Op used to test conditional speculation. This op can always be\n speculatively executed.", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "tfrt_test.another_three_result", "results": [ { "name": "result1", "type": "I32" }, { "name": "result2", "type": "F32" }, { "name": "result3", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "tfrt_test.another_two_result", "results": [ { "name": "result1", "type": "F32" }, { "name": "result2", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "tfrt_test.any_attr_of_i32_str", "attributes": [ { "name": "attr", "type": "AnyAttrOf<[I32Attr, StrAttr]>" } ] }, { "name": "tfrt_test.any_cond", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ] }, { "name": "tfrt_test.arg_and_res_have_fixed_element_types", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "tfrt_test.array_of_attr_op", "attributes": [ { "name": "a", "type": "TestArrayOfUglyAttrs" }, { "name": "b", "type": "TestArrayOfInts" }, { "name": "c", "type": "TestArrayOfEnums" } ], "assemblyFormat": "`a` `=` $a `,` `b` `=` $b `,` `c` `=` $c attr-dict" }, { "name": "tfrt_test.asm_interface_op", "results": [ { "name": "first", "type": "AnyType" }, { "name": "middle_results", "type": "Variadic" } ] }, { "name": "tfrt_test.attr_sized_operands", "operands": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" }, { "name": "c", "type": "I32" }, { "name": "d", "type": "Variadic" } ] }, { "name": "tfrt_test.attr_sized_results", "results": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" }, { "name": "c", "type": "I32" }, { "name": "d", "type": "Variadic" } ] }, { "name": "tfrt_test.attr_sized_results_compile_test", "results": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "I32" }, { "name": "c", "type": "Optional" } ] }, { "name": "tfrt_test.attr_with_trait", "attributes": [ { "name": "attr", "type": "AnyAttr" } ] }, { "name": "tfrt_test.benchmark", "summary": "benchmark operation", "description": "The \"tfrt_test.benchmark\" operation benchmarks the performance of an MLIR\n region by executing the given MLIR region repeatedly up to the\n `duratino_secs` seconds or `max_count` times. `num_warmup_runs` specifies\n the number of warm up runs to run the given MLIR region before the\n benchmark starts.\n\n The target MLIR region can take an arbitrary number of arguments and\n should return exactly one value. The arguments for the MLIR region are\n provided as the operands of the tfrt_test.benchmark op.\n\n Example:\n tfrt_test.benchmark \"add.i32\"(%c : i32, %d : f32) max_count = 100, duration_secs = 1 {\n // code for benchmarking\n ...\n }\n\n tfrt_test.benchmark \"add.i32\"(%c : i32)\n duration_secs = 1,\n max_count = 100,\n num_warmup_runs = 10 {\n // The MLIR code to be benchmarked goes here.\n // The following code benchmarks the tfrt.add.i32 kernel.\n %x = tfrt.add.i32 %c, %c\n // The benchmarked function needs to return exactly one value.\n tfrt.return %x : i32\n }", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "attributes": [ { "name": "duration_secs", "type": "I32Attr" }, { "name": "max_count", "type": "I32Attr" }, { "name": "name", "type": "StrAttr" }, { "name": "num_warmup_runs", "type": "DefaultValuedOptionalAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.block_argument_name_from_type", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "tfrt_test.block_argument_name_from_type_interface", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "tfrt_test.block_names", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword" }, { "name": "tfrt_test.br", "operands": [ { "name": "targetOperands", "type": "Variadic" } ], "successors": [ { "name": "target" } ] }, { "name": "tfrt_test.buffer_based", "description": "A buffer based operation, that uses memRefs as input and output.", "operands": [ { "name": "input", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "output", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "`in` `(` $input`:` type($input) `)` `out` `(` $output`:` type($output) `)`\n attr-dict" }, { "name": "tfrt_test.call", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "tfrt_test.call_and_store", "operands": [ { "name": "address", "type": "AnyMemRef" }, { "name": "callee_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "store_before_call", "type": "BoolAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $callee_operands `)` `,` $address attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.call_on_device", "operands": [ { "name": "forwarded_operands", "type": "Variadic" }, { "name": "non_forwarded_device_operand", "type": "AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $forwarded_operands `)` `,` $non_forwarded_device_operand attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.call_with_segments", "summary": "test call op with segmented args", "operands": [ { "name": "prefix", "type": "Variadic" }, { "name": "args", "type": "Variadic" }, { "name": "suffix", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee `(` $prefix `:` type($prefix) `)`\n `(` $args `:` type($args) `)`\n `(` $suffix `:` type($suffix) `)` attr-dict" }, { "name": "tfrt_test.compare", "description": "Compare `lhs` and `rhs`. A remark is emitted which indicates whether the\n specified comparison operator was proven to hold. The remark also indicates\n whether the opposite comparison operator was proven to hold.\n\n `var_operands` must have exactly two operands: one for the LHS operand and\n one for the RHS operand. If `lhs_map` is specified, as many operands as\n `lhs_map` has inputs are expected instead of the first operand. If `rhs_map`\n is specified, as many operands as `rhs_map` has inputs are expected instead\n of the second operand.", "operands": [ { "name": "var_operands", "type": "Variadic" } ], "attributes": [ { "name": "cmp", "type": "DefaultValuedAttr" }, { "name": "lhs_map", "type": "OptionalAttr" }, { "name": "rhs_map", "type": "OptionalAttr" }, { "name": "compose", "type": "UnitAttr" } ] }, { "name": "tfrt_test.conditionally_speculatable_op", "description": "Op used to test conditional speculation. This op can be speculatively\n executed if the input to it is an `arith.constant`.", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ] }, { "name": "tfrt_test.confined_dense_array_attr", "attributes": [ { "name": "emptyattr", "type": "ConfinedAttr]>" }, { "name": "i32attr", "type": "ConfinedAttr]>" }, { "name": "i64attr", "type": "ConfinedAttr]>" } ] }, { "name": "tfrt_test.confined_non_negative_attr", "attributes": [ { "name": "i8attr", "type": "ConfinedAttr]>" }, { "name": "i16attr", "type": "ConfinedAttr]>" }, { "name": "i32attr", "type": "ConfinedAttr]>" }, { "name": "i64attr", "type": "ConfinedAttr]>" }, { "name": "f32attr", "type": "ConfinedAttr]>" }, { "name": "f64attr", "type": "ConfinedAttr]>" }, { "name": "emptyattr", "type": "ConfinedAttr]>" } ] }, { "name": "tfrt_test.confined_strictly_positive_attr", "attributes": [ { "name": "i8attr", "type": "ConfinedAttr]>" }, { "name": "i16attr", "type": "ConfinedAttr]>" }, { "name": "i32attr", "type": "ConfinedAttr]>" }, { "name": "i64attr", "type": "ConfinedAttr]>" }, { "name": "f32attr", "type": "ConfinedAttr]>" }, { "name": "f64attr", "type": "ConfinedAttr]>" }, { "name": "emptyattr", "type": "ConfinedAttr]>" } ] }, { "name": "tfrt_test.constant", "attributes": [ { "name": "value", "type": "AnyAttr" } ] }, { "name": "tfrt_test.conv_op_not_linalg_op", "operands": [ { "name": "image", "type": "AnyType" }, { "name": "filter", "type": "AnyType" }, { "name": "output", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.conversion_call_op", "operands": [ { "name": "arg_operands", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "SymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ] }, { "name": "tfrt_test.conversion_func_op", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.convert_block_args", "operands": [ { "name": "val", "type": "Optional" } ], "attributes": [ { "name": "is_legal", "type": "UnitAttr" }, { "name": "replace_with_operand", "type": "UnitAttr" }, { "name": "duplicate", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$val\n (`is_legal` $is_legal^)?\n (`duplicate` $duplicate^)?\n (`replace_with_operand` $replace_with_operand^)?\n $body attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.copy", "description": "Represents a copy operation.", "operands": [ { "name": "source", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "target", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "`(` $source `,` $target `)` `:` `(` type($source) `,` type($target) `)`\n attr-dict" }, { "name": "tfrt_test.count3.i32", "summary": "tfrt_test.count3 operation", "description": "An operation that takes one input x and returns x+1, x+2, x+3 as the\n result.\n\n Example:\n %1, %2, %3 = test.count3.i32 %0", "results": [ { "name": "result0", "type": "I32" }, { "name": "result1", "type": "I32" }, { "name": "result2", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.count3.i64", "summary": "tfrt_test.count3 operation", "description": "An operation that takes one input x and returns x+1, x+2, x+3 as the\n result.\n\n Example:\n %1, %2, %3 = test.count3.i32 %0", "results": [ { "name": "result0", "type": "I64" }, { "name": "result1", "type": "I64" }, { "name": "result2", "type": "I64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.create_memref_op", "results": [ { "name": "output", "type": "Bufferization_BufferLikeTypeInterface" } ] }, { "name": "tfrt_test.create_tensor_op", "results": [ { "name": "output", "type": "Bufferization_TensorLikeTypeInterface" } ] }, { "name": "tfrt_test.cse_of_single_block_op", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict `inputs` `(` $inputs `)`\n $region `:` type($inputs) `->` type($outputs)" }, { "name": "tfrt_test.custom_dimension_list_attr", "description": "Test printing/parsing of dimension list attribute.", "attributes": [ { "name": "dimension_list", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "`dimension_list` `=` custom($dimension_list)\n attr-dict" }, { "name": "tfrt_test.custom_result_name", "operands": [ { "name": "optional", "type": "Variadic" } ], "results": [ { "name": "r", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ] }, { "name": "tfrt_test.data_layout_query", "summary": "A token op recognized by data layout query test pass", "description": "The data layout query pass pattern-matches this op and attaches to it an\n array attribute containing the result of data layout query of the result\n type of this op.", "results": [ { "name": "res", "type": "AnyType" } ] }, { "name": "tfrt_test.decode_jpeg", "summary": "tfrt_test.decode_jpeg operation", "description": "The \"tfrt_test.decode_jpeg\" operation decodes Jpeg-formatted binary and\n returns a tensor with the same semantics as tf.image.decode_jpeg(image_encoded, channels=3).\n\n Example:\n %image_decoded = tfrt_test.decode_jpeg %image_encoded", "results": [ { "name": "result", "type": "TensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.default_dialect", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "regions attr-dict-with-keyword", "defaultDialect": "test" }, { "name": "tfrt_test.default_value_print", "operands": [ { "name": "operand", "type": "I32" } ], "attributes": [ { "name": "value_with_default", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict $operand" }, { "name": "tfrt_test.dense_array_attr", "attributes": [ { "name": "i1attr", "type": "DenseBoolArrayAttr" }, { "name": "i8attr", "type": "DenseI8ArrayAttr" }, { "name": "i16attr", "type": "DenseI16ArrayAttr" }, { "name": "i32attr", "type": "DenseI32ArrayAttr" }, { "name": "i64attr", "type": "DenseI64ArrayAttr" }, { "name": "f32attr", "type": "DenseF32ArrayAttr" }, { "name": "f64attr", "type": "DenseF64ArrayAttr" }, { "name": "emptyattr", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "`i1attr` `=` $i1attr `i8attr` `=` $i8attr `i16attr` `=` $i16attr\n `i32attr` `=` $i32attr `i64attr` `=` $i64attr `f32attr` `=` $f32attr\n `f64attr` `=` $f64attr `emptyattr` `=` $emptyattr attr-dict" }, { "name": "tfrt_test.derived_type_attr", "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tfrt_test.destination_style_op", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" }, { "name": "other_operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n (`outs` `(` $outputs^ `:` type($outputs) `)`)?\n (`(` $other_operands^ `:` type($other_operands) `)`)?\n (`->` type($results)^)?" }, { "name": "tfrt_test.do.async", "summary": "do.async operation", "description": "The \"tfrt_test.do.async\" operation allows its body to be executed\n asynchronously. It has one region which represents the body.\n\n The body region takes an arbitrary number of arguments and may return\n arbitrary number of return values, using a `tfrt.return` operation at the\n end of the region.\n\n Example:\n\n tfrt_test.do.async () -> () {\n tfrt.return\n }\n\n %res = tfrt_test.do.async () -> (i32) {\n %val = tfrt.constant.i32 1\n tfrt.return %val\n }\n\n %res1, %res2 = tfrt_test.do.async %val1, %val2 : (i32, f32) -> (i32, f32) {\n tfrt.return %val1, val2 : i32, f32\n }", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.dummy_memref_op", "operands": [ { "name": "input", "type": "Bufferization_BufferLikeTypeInterface" } ], "results": [ { "name": "output", "type": "Bufferization_BufferLikeTypeInterface" } ] }, { "name": "tfrt_test.dummy_op_with_region_ref", "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$body attr-dict custom(ref($body))" }, { "name": "tfrt_test.dummy_op_with_successor_ref", "successors": [ { "name": "successor" } ], "assemblyFormat": "$successor attr-dict custom(ref($successor))" }, { "name": "tfrt_test.dummy_tensor_op", "operands": [ { "name": "input", "type": "Bufferization_TensorLikeTypeInterface" } ], "results": [ { "name": "output", "type": "Bufferization_TensorLikeTypeInterface" } ] }, { "name": "tfrt_test.either_helper_op_a", "operands": [ { "name": "arg0", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.either_helper_op_b", "operands": [ { "name": "arg0", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.either_op_a", "operands": [ { "name": "arg0", "type": "AnyInteger" }, { "name": "arg1", "type": "AnyInteger" }, { "name": "arg2", "type": "AnyInteger" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.either_op_b", "operands": [ { "name": "arg0", "type": "AnyInteger" }, { "name": "arg1", "type": "AnyInteger" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.either_op_c", "operands": [ { "name": "arg0", "type": "AnyInteger" }, { "name": "arg1", "type": "AnyInteger" } ], "results": [ { "name": "output", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "AnyI32Attr" } ] }, { "name": "tfrt_test.empty_properties", "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt_test.fill_op_not_linalg_op", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "output", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.float_attrs", "attributes": [ { "name": "float_attr", "type": "AnyAttr" } ] }, { "name": "tfrt_test.float_elements_attr", "attributes": [ { "name": "scalar_f32_attr", "type": "RankedF32ElementsAttr<[2]>" }, { "name": "tensor_f64_attr", "type": "RankedF64ElementsAttr<[4, 8]>" } ] }, { "name": "tfrt_test.fold_to_call_op", "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ] }, { "name": "tfrt_test.fold_with_fold_adaptor", "operands": [ { "name": "op", "type": "I32" }, { "name": "variadic", "type": "Variadic" }, { "name": "var_of_var", "type": "VariadicOfVariadic" } ], "results": [ { "name": "res", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "DenseI32ArrayAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$op `,` `[` $variadic `]` `,` `{` $var_of_var `}` $body attr-dict-with-keyword" }, { "name": "tfrt_test.forward_buffer", "description": "A pure operation that takes a buffer and returns a buffer. This op does not\n have any side effects, so it cannot allocate or read a buffer from memory.\n It must return the input buffer (or a view thereof). This op purposely does\n does not implement any interface.", "operands": [ { "name": "buffer", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "result", "type": "AnyRankedOrUnrankedMemRef" } ] }, { "name": "tfrt_test.functional_region_op", "attributes": [ { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "tfrt_test.get_bytes_field_from_example", "summary": "tfrt_test.get_bytes_field_from_example operation", "description": "The tfrt_test.get_bytes_field_from_example extracts the bytes field of the\n given `key` name from a protobuf object whose format follows example.proto.\n\n Example:\n %value = tfrt_test.get_bytes_field_from_example %example, %key", "results": [ { "name": "result", "type": "TFRT_StringType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.get_int64_field_from_example", "summary": "tfrt_test.get_int64_field_from_example operation", "description": "The tfrt_test.get_int64_field_from_example extracts the int64 field of the\n given `key` name from a protobuf object whose format follows example.proto.\n\n Example:\n %value = tfrt_test.get_int64_field_from_example %example, %key", "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.get_string", "summary": "tfrt_test.get_string", "description": "Get a !tfrt.string value from the given string attribute.", "results": [ { "name": "result", "type": "TFRT_StringType" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.get_string_sync", "summary": "tfrt_test.get_string_sync", "description": "Get a !tfrt.string value from the given string attribute.", "results": [ { "name": "result", "type": "TFRT_StringType" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.get_tuple_element", "description": "Test op that returns a specified element of the tuple.", "attributes": [ { "name": "index", "type": "I32Attr" } ] }, { "name": "tfrt_test.graph_loop", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "rets", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$args $body attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.graph_region", "summary": "operation with a graph region", "description": "Test op that defines a graph region.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "tfrt_test.has_str_value", "attributes": [ { "name": "value", "type": "DefaultValuedStrAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.i32_enum_attr", "results": [ { "name": "val", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "SomeI32Enum{case5|case10|caseSignedMaxPlusOne|caseUnsignedMax}" } ] }, { "name": "tfrt_test.i32ElementsAttr", "attributes": [ { "name": "attr", "type": "I32ElementsAttr" } ] }, { "name": "tfrt_test.i64_enum_attr", "results": [ { "name": "val", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "SomeI64Enum{case5|case10|caseLarse}" } ] }, { "name": "tfrt_test.if_first_operand_is_none_then_so_is_second", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ] }, { "name": "tfrt_test.ignore_arg_match_dst", "operands": [ { "name": "b", "type": "AnyType" } ], "attributes": [ { "name": "f", "type": "AnyAttr" } ] }, { "name": "tfrt_test.ignore_arg_match_src", "operands": [ { "name": "a", "type": "AnyType" }, { "name": "b", "type": "AnyType" }, { "name": "c", "type": "AnyType" } ], "attributes": [ { "name": "d", "type": "AnyAttr" }, { "name": "e", "type": "AnyAttr" }, { "name": "f", "type": "AnyAttr" } ] }, { "name": "tfrt_test.increment", "operands": [ { "name": "value", "type": "InferIntRangeType" } ], "results": [ { "name": "result", "type": "InferIntRangeType" } ], "assemblyFormat": "attr-dict $value `:` type($result)" }, { "name": "tfrt_test.indexElementsAttr", "attributes": [ { "name": "attr", "type": "IndexElementsAttr" } ] }, { "name": "tfrt_test.int_attrs", "attributes": [ { "name": "any_i32_attr", "type": "AnyI32Attr" }, { "name": "index_attr", "type": "IndexAttr" }, { "name": "ui32_attr", "type": "UI32Attr" }, { "name": "si32_attr", "type": "SI32Attr" } ] }, { "name": "tfrt_test.int_elements_attr", "attributes": [ { "name": "any_i32_attr", "type": "AnyI32ElementsAttr" }, { "name": "i32_attr", "type": "I32ElementsAttr" } ] }, { "name": "tfrt_test.int_types", "results": [ { "name": "any_i16", "type": "AnyI16" }, { "name": "si32", "type": "SI32" }, { "name": "ui64", "type": "UI64" }, { "name": "any_int", "type": "AnyInteger" } ] }, { "name": "tfrt_test.interleaved_operand_attr1", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" } ] }, { "name": "tfrt_test.interleaved_operand_attr2", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" } ] }, { "name": "tfrt_test.internal_br", "operands": [ { "name": "successOperands", "type": "Variadic" }, { "name": "errorOperands", "type": "Variadic" } ], "successors": [ { "name": "successPath" }, { "name": "errorPath" } ] }, { "name": "tfrt_test.isolated_graph_region", "summary": "isolated from above operation with a graph region", "description": "Test op that defines a graph region which is isolated from above.", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "tfrt_test.isolated_one_region_op", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "my_region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $operands $my_region `:` type($operands) `->` type($results)" }, { "name": "tfrt_test.isolated_region", "summary": "isolated region operation", "description": "Test op with an isolated region, to test passthrough region arguments. Each\n argument is of index type.", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.isolated_regions", "regions": [ { "name": "regions", "type": "VariadicRegion" } ], "assemblyFormat": "attr-dict-with-keyword $regions" }, { "name": "tfrt_test.legal_op_a", "attributes": [ { "name": "status", "type": "StrAttr" } ] }, { "name": "tfrt_test.less_than", "operands": [ { "name": "lhs", "type": "RankedTensorOf<[F32]>" }, { "name": "rhs", "type": "RankedTensorOf<[F32]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[I1]>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.linalg_conv_op", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "tfrt_test.linalg_fill_op", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "tfrt_test.loc_dst", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.loc_dst_no_res", "operands": [ { "name": "input", "type": "I32" } ] }, { "name": "tfrt_test.loc_src", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.loc_src_no_res", "operands": [ { "name": "input", "type": "I32" } ] }, { "name": "tfrt_test.loop_block", "operands": [ { "name": "init", "type": "I32" } ], "results": [ { "name": "floatResult", "type": "F32" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$init `:` functional-type($init, $floatResult) $body\n attr-dict-with-keyword" }, { "name": "tfrt_test.loop_block_term", "operands": [ { "name": "nextIterArg", "type": "I32" }, { "name": "exitArg", "type": "F32" } ], "assemblyFormat": "`iter` $nextIterArg `exit` $exitArg attr-dict" }, { "name": "tfrt_test.make_tuple", "description": "Test op that creates a tuple value from a list of values.", "operands": [ { "name": "inputs", "type": "Variadic" } ] }, { "name": "tfrt_test.many_arguments", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" }, { "name": "input3", "type": "I32" }, { "name": "input4", "type": "I32" }, { "name": "input5", "type": "I32" }, { "name": "input6", "type": "I32" }, { "name": "input7", "type": "I32" }, { "name": "input8", "type": "I32" }, { "name": "input9", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" }, { "name": "attr3", "type": "I64Attr" }, { "name": "attr4", "type": "I64Attr" }, { "name": "attr5", "type": "I64Attr" }, { "name": "attr6", "type": "I64Attr" }, { "name": "attr7", "type": "I64Attr" }, { "name": "attr8", "type": "I64Attr" }, { "name": "attr9", "type": "I64Attr" } ] }, { "name": "tfrt_test.many_regions", "summary": "operation created with move-only objects", "description": "Test op with multiple regions with a `create` function that\n takes parameters containing move-only objects.", "regions": [ { "name": "regions", "type": "VariadicRegion" } ] }, { "name": "tfrt_test.match_op_attribute1", "attributes": [ { "name": "required_attr", "type": "I32Attr" }, { "name": "optional_attr", "type": "OptionalAttr" }, { "name": "default_valued_attr", "type": "DefaultValuedAttr" }, { "name": "more_attr", "type": "I32Attr" } ] }, { "name": "tfrt_test.match_op_attribute3", "attributes": [ { "name": "attr", "type": "UnitAttr" } ] }, { "name": "tfrt_test.match_op_attribute4", "attributes": [ { "name": "attr1", "type": "UnitAttr" }, { "name": "attr2", "type": "UnitAttr" } ] }, { "name": "tfrt_test.merge_blocks", "summary": "merge_blocks operation", "description": "Test op with multiple blocks that are merged with Dialect Conversion", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "tfrt_test.mixed_normal_variadic_operand", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "AnyTensor" }, { "name": "input3", "type": "Variadic" } ] }, { "name": "tfrt_test.mixed_normal_variadic_result", "results": [ { "name": "output1", "type": "Variadic" }, { "name": "output2", "type": "AnyTensor" }, { "name": "output3", "type": "Variadic" } ] }, { "name": "tfrt_test.mixed_variadic_in_out_i32", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "output", "type": "I32" } ] }, { "name": "tfrt_test.mixed_variadic_in1", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "F32" }, { "name": "input3", "type": "Variadic" } ] }, { "name": "tfrt_test.mixed_variadic_in2", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "F32" }, { "name": "input3", "type": "Variadic" } ] }, { "name": "tfrt_test.mixed_variadic_in3", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "Variadic" }, { "name": "input3", "type": "Variadic" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ] }, { "name": "tfrt_test.mixed_variadic_in4", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" } ] }, { "name": "tfrt_test.mixed_variadic_in5", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" }, { "name": "input3", "type": "I32" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" }, { "name": "pattern_name", "type": "StrAttr" } ] }, { "name": "tfrt_test.mixed_variadic_in6", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "Variadic" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" } ] }, { "name": "tfrt_test.mixed_variadic_optional_in7", "operands": [ { "name": "input1", "type": "Variadic" }, { "name": "input2", "type": "Optional" } ], "attributes": [ { "name": "attr1", "type": "I32Attr" } ] }, { "name": "tfrt_test.mixed_variadic_out1", "results": [ { "name": "output1", "type": "Variadic" }, { "name": "output2", "type": "F32" }, { "name": "output3", "type": "Variadic" } ] }, { "name": "tfrt_test.mixed_variadic_out2", "results": [ { "name": "output1", "type": "Variadic" }, { "name": "output2", "type": "F32" }, { "name": "output3", "type": "Variadic" } ] }, { "name": "tfrt_test.mixed_variadic_out3", "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "Variadic" }, { "name": "output3", "type": "Variadic" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ] }, { "name": "tfrt_test.multi_slot_alloca", "results": [ { "name": "results", "type": "Variadic>" } ], "assemblyFormat": "attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.multi_tensor_rank_of", "operands": [ { "name": "arg0", "type": "TensorRankOf<[I8, I32, F32], [0, 1]>" } ] }, { "name": "tfrt_test.native_code_call1", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "choice", "type": "BoolAttr" }, { "name": "attr1", "type": "I64Attr" }, { "name": "attr2", "type": "I64Attr" } ] }, { "name": "tfrt_test.native_code_call2", "operands": [ { "name": "input", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "tfrt_test.native_code_call3", "operands": [ { "name": "input", "type": "I32" } ] }, { "name": "tfrt_test.native_code_call4", "operands": [ { "name": "input1", "type": "AnyType" } ], "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "I32" } ] }, { "name": "tfrt_test.native_code_call5", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "I32" } ] }, { "name": "tfrt_test.native_code_call6", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "results": [ { "name": "output1", "type": "I32" }, { "name": "output2", "type": "I32" } ] }, { "name": "tfrt_test.native_code_call7", "operands": [ { "name": "input", "type": "I32" } ] }, { "name": "tfrt_test.nd_tensor_of", "operands": [ { "name": "arg0", "type": "0DTensorOf<[F32]>" }, { "name": "arg1", "type": "1DTensorOf<[F32]>" }, { "name": "arg2", "type": "2DTensorOf<[I16]>" }, { "name": "arg3", "type": "3DTensorOf<[I16]>" }, { "name": "arg4", "type": "4DTensorOf<[I16]>" } ] }, { "name": "tfrt_test.never_speculatable_op", "description": "Op used to test conditional speculation. This op can never be\n speculatively executed.", "results": [ { "name": "result", "type": "I32" } ] }, { "name": "tfrt_test.no_str_value", "attributes": [ { "name": "value", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.non_negative_int_attr", "attributes": [ { "name": "i32attr", "type": "ConfinedAttr" }, { "name": "i64attr", "type": "ConfinedAttr" } ] }, { "name": "tfrt_test.nvvm_requires_sm_80", "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.nvvm_requires_sm_90a", "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.nvvm_requires_sm_90a_or_sm_100a", "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.one_region_with_operands_op", "operands": [ { "name": "operands", "type": "Variadic" } ] }, { "name": "tfrt_test.one_region_with_recursive_memory_effects", "description": "Op that has one region and recursive side effects. The\n RegionBranchOpInterface is not implemented on this op.", "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.one_result1", "results": [ { "name": "result1", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "tfrt_test.one_result2", "results": [ { "name": "result1", "type": "I32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "tfrt_test.one_result3", "results": [ { "name": "result1", "type": "I32" } ] }, { "name": "tfrt_test.op_a", "attributes": [ { "name": "attr", "type": "I32Attr" } ] }, { "name": "tfrt_test.op_b", "attributes": [ { "name": "attr", "type": "I32Attr" } ] }, { "name": "tfrt_test.op_commutative", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" }, { "name": "op3", "type": "I32" }, { "name": "op4", "type": "I32" } ] }, { "name": "tfrt_test.op_commutative2", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" } ] }, { "name": "tfrt_test.op_funcref", "summary": "Test op with a reference to a function symbol", "description": "The \"test.op_funcref\" is a test op with a reference to a function symbol." }, { "name": "tfrt_test.op_idempotent_trait", "operands": [ { "name": "op1", "type": "I32" } ] }, { "name": "tfrt_test.op_idempotent_trait_binary", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" } ] }, { "name": "tfrt_test.op_in_place_fold", "operands": [ { "name": "op", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "OptionalAttr" } ] }, { "name": "tfrt_test.op_in_place_self_fold", "attributes": [ { "name": "folded", "type": "UnitAttr" } ] }, { "name": "tfrt_test.op_involution_trait_failing_operation_fold", "operands": [ { "name": "op1", "type": "I32" } ] }, { "name": "tfrt_test.op_involution_trait_no_operation_fold", "operands": [ { "name": "op1", "type": "I32" } ] }, { "name": "tfrt_test.op_involution_trait_succesful_operation_fold", "operands": [ { "name": "op1", "type": "I32" } ] }, { "name": "tfrt_test.op_large_commutative", "operands": [ { "name": "op1", "type": "I32" }, { "name": "op2", "type": "I32" }, { "name": "op3", "type": "I32" }, { "name": "op4", "type": "I32" }, { "name": "op5", "type": "I32" }, { "name": "op6", "type": "I32" }, { "name": "op7", "type": "I32" } ] }, { "name": "tfrt_test.op_m", "attributes": [ { "name": "optional_attr", "type": "OptionalAttr" } ] }, { "name": "tfrt_test.op_nonnorm", "operands": [ { "name": "X", "type": "AnyMemRef" }, { "name": "Y", "type": "AnyMemRef" } ] }, { "name": "tfrt_test.op_norm", "operands": [ { "name": "X", "type": "AnyMemRef" }, { "name": "Y", "type": "AnyMemRef" } ] }, { "name": "tfrt_test.op_norm_ret", "operands": [ { "name": "X", "type": "AnyMemRef" } ], "results": [ { "name": "Y", "type": "AnyMemRef" }, { "name": "Z", "type": "AnyMemRef" } ] }, { "name": "tfrt_test.op_optionally_implementing_interface", "attributes": [ { "name": "implementsInterface", "type": "BoolAttr" } ] }, { "name": "tfrt_test.op_s", "attributes": [ { "name": "value", "type": "AnyAttr" } ] }, { "name": "tfrt_test.op_with_bit_enum", "attributes": [ { "name": "value", "type": "TestBitEnumAttr{read|write|execute}" }, { "name": "tag", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`tag` $tag^)? attr-dict" }, { "name": "tfrt_test.op_with_bit_enum_prop", "attributes": [ { "name": "value1", "type": "TestBitEnumProp{read|write|execute}" }, { "name": "value2", "type": "TestBitEnumProp{read|write|execute}" } ], "assemblyFormat": "$value1 ($value2^)? attr-dict `:` `(``)`" }, { "name": "tfrt_test.op_with_bit_enum_prop_named", "attributes": [ { "name": "value1", "type": "TestBitEnumPropNamed" }, { "name": "value2", "type": "TestBitEnumPropNamed" } ], "assemblyFormat": "$value1 ($value2^)? attr-dict" }, { "name": "tfrt_test.op_with_bit_enum_vbar", "attributes": [ { "name": "value", "type": "TestBitEnumVerticalBarAttr{user|group|other}" }, { "name": "tag", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`tag` $tag^)? attr-dict" }, { "name": "tfrt_test.op_with_data_layout", "summary": "An op that uses DataLayout implementation from the Target dialect", "regions": [ { "name": "regions", "type": "VariadicRegion" } ] }, { "name": "tfrt_test.op_with_effects_a", "operands": [ { "name": "optional_symbol", "type": "OptionalAttr" } ], "attributes": [ { "name": "first", "type": "FlatSymbolRefAttr" }, { "name": "second", "type": "SymbolRefAttr" } ] }, { "name": "tfrt_test.op_with_enum", "attributes": [ { "name": "value", "type": "TestEnumAttr{first|second|third}" }, { "name": "tag", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`tag` $tag^)? attr-dict" }, { "name": "tfrt_test.op_with_enum_prop", "attributes": [ { "name": "value", "type": "TestEnumProp{first|second|third}" } ], "assemblyFormat": "$value attr-dict" }, { "name": "tfrt_test.op_with_enum_prop_attr_form", "attributes": [ { "name": "value", "type": "TestEnumPropAttrForm{first|second|third}" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt_test.op_with_enum_prop_attr_form_always", "attributes": [ { "name": "value", "type": "TestEnumPropAttrFormAlways{first|second|third}" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt_test.op_with_infer_type_adaptor_if", "operands": [ { "name": "x", "type": "AnyTensor" }, { "name": "y", "type": "AnyTensor" } ] }, { "name": "tfrt_test.op_with_loc_attr", "attributes": [ { "name": "loc_attr", "type": "LocationAttr" } ], "assemblyFormat": "$loc_attr attr-dict" }, { "name": "tfrt_test.op_with_property_predicates", "attributes": [ { "name": "scalar", "type": "NonNegativeI64Prop" }, { "name": "optional", "type": "OptionalProp" }, { "name": "defaulted", "type": "DefaultValuedProp" }, { "name": "more_constrained", "type": "ConfinedProp, between 0 and 5>" }, { "name": "array", "type": "ArrayProp" }, { "name": "non_empty_unconstrained", "type": "NonEmptyArray" }, { "name": "non_empty_constrained", "type": "NonEmptyArray" }, { "name": "non_empty_optional", "type": "OptionalProp>" }, { "name": "unconstrained", "type": "I64Prop" } ], "assemblyFormat": "attr-dict prop-dict" }, { "name": "tfrt_test.op_with_region_fold", "operands": [ { "name": "operand", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.op_with_region_fold_no_side_effect", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.op_with_region_pattern", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.op_with_result_shape_interface", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.op_with_shaped_type_infer_type_adaptor_if", "operands": [ { "name": "operand1", "type": "AnyTensor" }, { "name": "operand2", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "tfrt_test.op_x", "operands": [ { "name": "input", "type": "AnyInteger" } ] }, { "name": "tfrt_test.operand_rank_equals_result_size", "operands": [ { "name": "operand", "type": "AnyShaped" } ], "results": [ { "name": "result", "type": "AnyShaped" } ] }, { "name": "tfrt_test.operand0_and_result_have_same_element_count", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "tfrt_test.operand0_and_result_have_same_element_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ], "results": [ { "name": "res", "type": "AnyType" } ] }, { "name": "tfrt_test.operand0_and_result_have_same_rank", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "tfrt_test.operand0_and_result_have_same_shape", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "tfrt_test.operand0_and_result_have_same_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ], "results": [ { "name": "res", "type": "AnyType" } ] }, { "name": "tfrt_test.operands_and_result_have_same_rank", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ], "results": [ { "name": "res", "type": "AnyShaped" } ] }, { "name": "tfrt_test.operands_have_same_element_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ] }, { "name": "tfrt_test.operands_have_same_rank", "operands": [ { "name": "x", "type": "AnyShaped" }, { "name": "y", "type": "AnyShaped" } ] }, { "name": "tfrt_test.operands_have_same_type", "operands": [ { "name": "x", "type": "AnyType" }, { "name": "y", "type": "AnyType" } ] }, { "name": "tfrt_test.optional_custom_attr", "description": "Test using a custom directive as the optional group anchor and the first\n element to parse. It is expected to return an `OptionalParseResult`.", "attributes": [ { "name": "attr", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict (custom($attr)^) : (`bar`)?" }, { "name": "tfrt_test.overridden_symbol_visibility", "summary": "operation overridden symbol visibility accessors", "attributes": [ { "name": "sym_name", "type": "StrAttr" } ] }, { "name": "tfrt_test.parse_b64", "attributes": [ { "name": "b64", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.parse_example_from_bytes", "summary": "tfrt_test.parse_example_from_bytes operation", "description": "The proto.parse_example_from_bytes parses a string into a protobuf object\n whose format follows example.proto.\n\n Example:\n %example = tfrt_test.parse_example_from_bytes\" %bytes", "results": [ { "name": "result", "type": "ProtoExampleType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.parse_integer_literal", "results": [ { "name": "results", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.parse_wrapped_keyword", "attributes": [ { "name": "keyword", "type": "StrAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.positive_int_attr", "attributes": [ { "name": "i32attr", "type": "ConfinedAttr" }, { "name": "i64attr", "type": "ConfinedAttr" } ] }, { "name": "tfrt_test.producing_br", "operands": [ { "name": "firstOperands", "type": "Variadic" }, { "name": "secondOperands", "type": "Variadic" } ], "results": [ { "name": "dummy", "type": "I32" } ], "successors": [ { "name": "first" }, { "name": "second" } ] }, { "name": "tfrt_test.promised_interfaces", "operands": [ { "name": "promisedType", "type": "ConfinedType]>" } ], "attributes": [ { "name": "promisedAttr", "type": "ConfinedAttr]>" } ] }, { "name": "tfrt_test.prop", "operands": [ { "name": "upperInits", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "transforms", "type": "I32ElementsAttr" } ] }, { "name": "tfrt_test.prop_pattern_op_1", "results": [ { "name": "results", "type": "I32" } ], "attributes": [ { "name": "tag", "type": "StringProp" }, { "name": "val", "type": "I64Prop" }, { "name": "cond", "type": "BoolProp" } ], "assemblyFormat": "$tag $val $cond attr-dict" }, { "name": "tfrt_test.prop_pattern_op_2", "operands": [ { "name": "input", "type": "I32" } ], "attributes": [ { "name": "tag", "type": "StringProp" } ], "assemblyFormat": "$input $tag attr-dict" }, { "name": "tfrt_test.ranked_int_elements_attr", "attributes": [ { "name": "vector_i32_attr", "type": "RankedI32ElementsAttr<[2]>" }, { "name": "matrix_i64_attr", "type": "RankedI64ElementsAttr<[4, 8]>" } ] }, { "name": "tfrt_test.ranked_tensor_op", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.read_buffer", "description": "An operation that reads the buffer operand and dumps its contents.", "operands": [ { "name": "buffer", "type": "AnyRankedOrUnrankedMemRef" } ] }, { "name": "tfrt_test.recursive_rewrite", "attributes": [ { "name": "depth", "type": "I64Attr" } ], "assemblyFormat": "$depth attr-dict" }, { "name": "tfrt_test.recursively_speculatable_op", "description": "Op used to test conditional speculation. This op can be speculatively\n executed only if all the ops in the attached region can be.", "results": [ { "name": "result", "type": "I32" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.reflect_bounds", "description": "Integer range analysis will update this op to reflect inferred integer range\n of the input, so it can be checked with FileCheck\n\n Example:\n\n ```mlir\n CHECK: test.reflect_bounds {smax = 7 : index, smin = 0 : index, umax = 7 : index, umin = 0 : index}\n %1 = test.reflect_bounds %0 : index\n ```", "operands": [ { "name": "value", "type": "InferIntRangeType" } ], "results": [ { "name": "result", "type": "InferIntRangeType" } ], "attributes": [ { "name": "umin", "type": "OptionalAttr" }, { "name": "umax", "type": "OptionalAttr" }, { "name": "smin", "type": "OptionalAttr" }, { "name": "smax", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict $value `:` type($result)" }, { "name": "tfrt_test.region_buffer_based", "description": "A buffer based operation, that uses memRefs as input and output.", "operands": [ { "name": "input", "type": "AnyRankedOrUnrankedMemRef" }, { "name": "output", "type": "AnyRankedOrUnrankedMemRef" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`in` `(` $input`:` type($input) `)` `out` `(` $output`:` type($output) `)`\n $region attr-dict" }, { "name": "tfrt_test.region_if", "description": "Represents an abstract if-then-else-join pattern. In this context, the then\n and else regions jump to the join region, which finally returns to its\n parent op.", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "thenRegion", "type": "SizedRegion<1>" }, { "name": "elseRegion", "type": "AnyRegion" }, { "name": "joinRegion", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.region_if_yield", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$results `:` type($results) attr-dict" }, { "name": "tfrt_test.region_yield", "description": "This operation is used in a region and yields the corresponding type for\n that operation.", "operands": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$result `:` type($result) attr-dict" }, { "name": "tfrt_test.reify_bound", "description": "Reify a bound for the given index-typed value or dimension size of a shaped\n value. \"LB\", \"EQ\" and \"UB\" bounds are supported. If `scalable` is set,\n `vscale_min` and `vscale_max` must be provided, which allows computing\n a bound in terms of \"vector.vscale\" for a given range of vscale.", "operands": [ { "name": "var", "type": "AnyType" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "OptionalAttr" }, { "name": "type", "type": "DefaultValuedAttr" }, { "name": "constant", "type": "UnitAttr" }, { "name": "scalable", "type": "UnitAttr" }, { "name": "vscale_min", "type": "OptionalAttr" }, { "name": "vscale_max", "type": "OptionalAttr" } ] }, { "name": "tfrt_test.reify_shaped_type_using_reify_dim_of_result", "description": "Test that when resolving a single dimension of a result for an operation\n that implements `reifyDimOfResult`, which is used to get the required value.\n `reifyResultShapes` and `reifyShapeOfResult` are implemented as failures\n to ensure they are not called. The op semantics is that the first result has\n the same shape as the second operand and the second result has the same shape\n as the first operand.", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.reify_shaped_type_using_reify_result_shapes", "description": "Test that when resolving a single dimension of a result for an operation\n that doesnt implement `reifyShapeOfResult` nor implements `reifyDimOfResult`\n calls into the implementation of `reifyResultShapes` to get the required value.\n The op semantics is that the first result has the same shape as the second operand\n and the second result has the same shape as the first operand.", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.reify_shaped_type_using_reify_shape_of_result", "description": "Test that when resolving a single dimension of a result for an operation\n that doesnt implement `reifyDimOfResult` but implements `reifyShapeOfResult`, which\n is used to get the required value. `reifyResultShapes` is implemented as a failure\n (which is also the default implementation) to ensure it is not called.\n The op semantics is that the first result has the same shape as the second operand\n and the second result has the same shape as the first operand.", "operands": [ { "name": "operand1", "type": "AnyRankedTensor" }, { "name": "operand2", "type": "AnyRankedTensor" } ], "results": [ { "name": "result1", "type": "AnyRankedTensor" }, { "name": "result2", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.remapped_value_region", "summary": "remapped_value_region operation", "description": "Test op that remaps values that haven't yet been converted in Dialect\n Conversion.", "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.resize_bilinear", "summary": "tfrt_test.resize_bilinear operation", "description": "The tfrt_test.resize_bilinear operation resizes the input tensor based on\n the given height and width. It returns a tensor with the same semantics as\n tf.compat.v1.image.resize(input, [height, width]).\n\n Example:\n %image_resized = tfrt_test.resize_bilinear %image_decoded, %new_height, %new_width", "results": [ { "name": "result", "type": "TensorType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.result_has_same_type_as_attr", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "attr", "type": "TypedAttrInterface" } ], "assemblyFormat": "$attr `->` type($result) attr-dict" }, { "name": "tfrt_test.result_name_from_type", "results": [ { "name": "r", "type": "AnyType" } ] }, { "name": "tfrt_test.result_name_from_type_interface", "results": [ { "name": "r", "type": "Variadic" } ] }, { "name": "tfrt_test.same_operand_result_type", "operands": [ { "name": "operand", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "AnyTensor" } ] }, { "name": "tfrt_test.side_effect_op", "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "tfrt_test.side_effect_with_region_op", "operands": [ { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "`(` $operand`)` $region attr-dict `:` type($operand) `->` type($result)" }, { "name": "tfrt_test.sign", "operands": [ { "name": "operand", "type": "RankedTensorOf<[F32]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[SI32]>" } ], "assemblyFormat": "$operand attr-dict `:` functional-type(operands, results)" }, { "name": "tfrt_test.signless_like_variadic", "operands": [ { "name": "x", "type": "Variadic" } ] }, { "name": "tfrt_test.single_no_terminator_custom_asm_op", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.single_no_terminator_op", "regions": [ { "name": "my_region", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict `:` $my_region" }, { "name": "tfrt_test.SingleBlockImplicitTerminator", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.sized_region_op", "regions": [ { "name": "my_region", "type": "SizedRegion<2>" } ] }, { "name": "tfrt_test.slash_attr", "attributes": [ { "name": "attr", "type": "SlashAttr" } ] }, { "name": "tfrt_test.source_op", "operands": [ { "name": "arg", "type": "AnyInteger" } ], "attributes": [ { "name": "tag", "type": "AnyI32Attr" } ] }, { "name": "tfrt_test.ssacfg_region", "summary": "operation with an SSACFG region", "description": "Test op that defines an SSACFG region.", "regions": [ { "name": "regions", "type": "VariadicRegion" } ] }, { "name": "tfrt_test.store_with_a_loop_region", "operands": [ { "name": "address", "type": "AnyMemRef" } ], "attributes": [ { "name": "store_before_region", "type": "BoolAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$address attr-dict-with-keyword regions `:` type($address)" }, { "name": "tfrt_test.store_with_a_region", "operands": [ { "name": "address", "type": "AnyMemRef" } ], "attributes": [ { "name": "store_before_region", "type": "BoolAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "$address attr-dict-with-keyword regions `:` type($address)" }, { "name": "tfrt_test.store_with_a_region_terminator", "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.string_attr_pretty_name", "results": [ { "name": "r", "type": "Variadic" } ], "attributes": [ { "name": "names", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.string_attr_with_mixed_type", "attributes": [ { "name": "attr", "type": "AnyAttrOf<[TypedStrAttr, I64Attr]>" } ], "assemblyFormat": "$attr attr-dict" }, { "name": "tfrt_test.string_attr_with_type", "attributes": [ { "name": "attr", "type": "TypedStrAttr" } ], "assemblyFormat": "$attr attr-dict" }, { "name": "tfrt_test.string_elements_attr", "attributes": [ { "name": "scalar_string_attr", "type": "StringElementsAttr" } ] }, { "name": "tfrt_test.switch_with_no_break", "operands": [ { "name": "arg", "type": "Index" } ], "attributes": [ { "name": "cases", "type": "DenseI64ArrayAttr" } ], "regions": [ { "name": "caseRegions", "type": "VariadicRegion>" } ], "assemblyFormat": "$arg attr-dict custom($cases, $caseRegions)" }, { "name": "tfrt_test.symbol", "summary": "operation which defines a new symbol", "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" } ] }, { "name": "tfrt_test.symbol_binding_a", "operands": [ { "name": "operand", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "I64Attr" } ] }, { "name": "tfrt_test.symbol_binding_b", "operands": [ { "name": "operand", "type": "I32" } ] }, { "name": "tfrt_test.symbol_binding_c", "operands": [ { "name": "operand", "type": "I32" } ] }, { "name": "tfrt_test.symbol_binding_d", "operands": [ { "name": "input1", "type": "I32" }, { "name": "input2", "type": "I32" } ], "attributes": [ { "name": "attr", "type": "I64Attr" } ] }, { "name": "tfrt_test.symbol_binding_no_result", "operands": [ { "name": "operand", "type": "I32" } ] }, { "name": "tfrt_test.symbol_scope", "summary": "operation which defines a new symbol table", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.symbol_scope_isolated", "summary": "operation which defines a new symbol table that is IsolatedFromAbove", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.symbol_table_region", "summary": "operation which defines a new symbol table without a restriction on a terminator", "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.symbol_with_result", "summary": "invalid symbol operation that produces an SSA result", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "sym_name", "type": "StrAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" } ] }, { "name": "tfrt_test.sync_benchmark", "summary": "synchronous benchmark operation", "description": "The \"tfrt_test.sync_benchmark\" operation benchmarks the performance of an\n MLIR synchronous region by executing the given MLIR region repeatedly up\n to the `duration_secs` seconds or `max_count` times. `num_warmup_runs`\n specifies the number of warm up runs to run the given MLIR region before\n the benchmark starts.\n\n The target MLIR region can take an arbitrary number of arguments and\n should return no value. The arguments for the MLIR region are\n provided as the operands of the tfrt_test.sync_benchmark op.\n\n Example:\n // Target sync function to benchmark.\n func @fibonacci.i32() -> i32 attributes {hex.sync} {\n %0 = \"hex.constant_s.i32\"() {value = 0 : i32} : () -> i32\n %1 = \"hex.constant_s.i32\"() {value = 1 : i32} : () -> i32\n\n %2 = \"hex.add_s.i32\"(%0, %1) : (i32, i32) -> i32\n %3 = \"hex.add_s.i32\"(%1, %2) : (i32, i32) -> i32\n %4 = \"hex.add_s.i32\"(%2, %3) : (i32, i32) -> i32\n %5 = \"hex.add_s.i32\"(%3, %4) : (i32, i32) -> i32\n\n hex.return\n }\n\n tfrt_test.sync_benchmark @fibonacci.i32()\n duration_secs = 1, max_count = 100, num_warmup_runs = 10", "attributes": [ { "name": "target_fn", "type": "FlatSymbolRefAttr" }, { "name": "duration_secs", "type": "I32Attr" }, { "name": "max_count", "type": "I32Attr" }, { "name": "num_warmup_runs", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.takes_static_memref", "operands": [ { "name": "x", "type": "AnyStaticShapeMemRef" } ] }, { "name": "tfrt_test.tblgen_build_0", "operands": [ { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "tfrt_test.tblgen_build_1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ] }, { "name": "tfrt_test.tblgen_build_2", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "tfrt_test.tblgen_build_3", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "resultA", "type": "Variadic" }, { "name": "resultB", "type": "Variadic" } ] }, { "name": "tfrt_test.tblgen_build_4", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ] }, { "name": "tfrt_test.tblgen_build_5", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ] }, { "name": "tfrt_test.tblgen_build_6", "operands": [ { "name": "a", "type": "Variadic" }, { "name": "b", "type": "Variadic" } ], "results": [ { "name": "result", "type": "F32" } ] }, { "name": "tfrt_test.tblgen_build_7", "attributes": [ { "name": "attr0", "type": "BoolAttr" } ] }, { "name": "tfrt_test.tensor_based", "description": "A tensor based operation, that uses a tensor as an input and results in a\n tensor again.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "`in` `(` $input`:` type($input) `)` `->` type($result) attr-dict" }, { "name": "tfrt_test.test_cost", "summary": "tfrt_test.test_cost", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "id", "type": "I64Attr" }, { "name": "_tfrt_cost", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$args attr-dict `:` type($args)", "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.three_result", "results": [ { "name": "result1", "type": "I32" }, { "name": "result2", "type": "F32" }, { "name": "result3", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "tfrt_test.tiling_no_dps_op", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "tfrt_test.two_result", "results": [ { "name": "result1", "type": "I32" }, { "name": "result2", "type": "F32" } ], "attributes": [ { "name": "kind", "type": "MultiResultOpEnum{kind1|kind2|kind3|kind4|kind5|kind6}" } ] }, { "name": "tfrt_test.type_array_attr", "attributes": [ { "name": "attr", "type": "TypedArrayAttrBase" } ] }, { "name": "tfrt_test.type_array_attr_with_default", "attributes": [ { "name": "attr", "type": "DefaultValuedAttr, {}>" } ] }, { "name": "tfrt_test.type_attr_of", "attributes": [ { "name": "type", "type": "TypeAttrOf" } ], "assemblyFormat": "attr-dict $type" }, { "name": "tfrt_test.typed_attr", "attributes": [ { "name": "type", "type": "TypeAttr" }, { "name": "attr", "type": "AnyAttr" } ], "assemblyFormat": "attr-dict $type `=` custom(ref($type), $attr)" }, { "name": "tfrt_test.unreifiable_dim_of_result_shape", "description": "Test handling of case where some dimension of the result cannot be\n reified. This tests the path when `reifyDimOfResult` is implemented,\n and `reifyDimOfResult` with `reifyResultShapes` are implemented as a failure.\n\n Expected that dim 0 of `result` is reifable as dim 0 of `operand`, but\n dim 1 of `result` is not reifiable.", "operands": [ { "name": "operand", "type": "2DTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "2DTensorOf<[AnyType]>" } ] }, { "name": "tfrt_test.unreifiable_result_shape", "description": "Test handling of case where some dimension of the result cannot be\n reified. This tests the path when `reifyShapeOfResult` is implemented,\n but not `reifyDimOfResult` with `reifyResultShapes` implemented as a failure.\n\n Expected that dim 0 of `result` is reifable as dim 0 of `operand`, but\n dim 1 of `result` is not reifiable.", "operands": [ { "name": "operand", "type": "2DTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "2DTensorOf<[AnyType]>" } ] }, { "name": "tfrt_test.unreifiable_result_shapes", "description": "Test handling of case where some dimension of the result cannot be\n reified. This tests the path when `reifyResultShapes` is implemented.\n\n Expected that dim 0 of `result` is reifable as dim 0 of `operand`, but\n dim 1 of `result` is not reifiable.", "operands": [ { "name": "operand", "type": "2DTensorOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "2DTensorOf<[AnyType]>" } ] }, { "name": "tfrt_test.using_int_property_with_worse_bytecode", "attributes": [ { "name": "value", "type": "IntPropertyWithWorseBytecode" } ] }, { "name": "tfrt_test.using_property_in_custom", "attributes": [ { "name": "prop", "type": "IntArrayProp" } ], "assemblyFormat": "custom($prop) attr-dict" }, { "name": "tfrt_test.using_property_in_custom_and_other", "attributes": [ { "name": "prop", "type": "IntArrayProp" }, { "name": "other", "type": "I64Prop" } ], "assemblyFormat": "custom($prop) prop-dict attr-dict" }, { "name": "tfrt_test.using_property_ref_in_custom", "attributes": [ { "name": "first", "type": "IntProp" }, { "name": "second", "type": "IntProp" } ], "assemblyFormat": "custom($first) `+` custom($second, ref($first)) attr-dict" }, { "name": "tfrt_test.value_with_bounds", "description": "Creates a value with specified [min, max] range for value bounds analysis.\n\n Example:\n\n ```mlir\n %0 = test.value_with_bounds { min = 4 : index, max = 5 : index}\n ```", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "min", "type": "IndexAttr" }, { "name": "max", "type": "IndexAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "tfrt_test.variadic_no_terminator_op", "regions": [ { "name": "my_regions", "type": "VariadicRegion>" } ], "assemblyFormat": "attr-dict `:` $my_regions" }, { "name": "tfrt_test.variadic_region_inferred", "regions": [ { "name": "bodies", "type": "VariadicRegion" } ] }, { "name": "tfrt_test.variadic_rewrite_dst_op", "operands": [ { "name": "brg", "type": "AnyType" }, { "name": "crg", "type": "Variadic" }, { "name": "arg", "type": "Variadic" } ] }, { "name": "tfrt_test.variadic_rewrite_src_op", "operands": [ { "name": "arg", "type": "Variadic" }, { "name": "brg", "type": "AnyType" }, { "name": "crg", "type": "Variadic" } ] }, { "name": "tfrt_test.variadic_segment_prop", "operands": [ { "name": "a1", "type": "Variadic" }, { "name": "a2", "type": "Variadic" } ], "results": [ { "name": "b1", "type": "Variadic" }, { "name": "b2", "type": "Variadic" } ], "assemblyFormat": "$a1 `:` $a2 `:` type($b1) `:` type($b2) prop-dict attr-dict `end`" }, { "name": "tfrt_test.variadic_with_same_operand_results", "results": [ { "name": "result", "type": "AnySignlessInteger" } ] }, { "name": "tfrt_test.verifiers", "operands": [ { "name": "input", "type": "I32" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "tfrt_test.versionedA", "attributes": [ { "name": "dims", "type": "AnyI64Attr" }, { "name": "modifier", "type": "BoolAttr" } ] }, { "name": "tfrt_test.versionedB", "attributes": [ { "name": "attribute", "type": "TestAttrParams" } ] }, { "name": "tfrt_test.versionedC", "attributes": [ { "name": "attribute", "type": "AnyAttrOf<[TestAttrParams, I32ElementsAttr]>" } ] }, { "name": "tfrt_test.with_array_properties", "attributes": [ { "name": "ints", "type": "ArrayProp" }, { "name": "strings", "type": "ArrayProp" }, { "name": "nested", "type": "ArrayProp>" }, { "name": "opt", "type": "OptionalProp>" }, { "name": "explicitOptions", "type": "ArrayProp>" }, { "name": "explicitUnits", "type": "ArrayProp" }, { "name": "hasDefault", "type": "DefaultValuedProp, ::llvm::ArrayRef{}, ::llvm::SmallVector{}>" } ], "assemblyFormat": "`ints` `=` $ints\n `strings` `=` $strings\n `nested` `=` $nested\n `opt` `=` $opt\n `explicitOptions` `=` $explicitOptions\n `explicitUnits` `=` $explicitUnits\n ($hasDefault^ `thats_has_default`)?\n attr-dict" }, { "name": "tfrt_test.with_bounds", "description": "Creates a value with specified [min, max] range for integer range analysis.\n\n Example:\n\n ```mlir\n %0 = test.with_bounds { umin = 4 : index, umax = 5 : index, smin = 4 : index, smax = 5 : index } : index\n ```", "results": [ { "name": "fakeVal", "type": "InferIntRangeType" } ], "attributes": [ { "name": "umin", "type": "APIntAttr" }, { "name": "umax", "type": "APIntAttr" }, { "name": "smin", "type": "APIntAttr" }, { "name": "smax", "type": "APIntAttr" } ], "assemblyFormat": "attr-dict `:` type($fakeVal)" }, { "name": "tfrt_test.with_bounds_region", "attributes": [ { "name": "umin", "type": "APIntAttr" }, { "name": "umax", "type": "APIntAttr" }, { "name": "smin", "type": "APIntAttr" }, { "name": "smax", "type": "APIntAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt_test.with_default_valued_properties", "attributes": [ { "name": "a", "type": "DefaultValuedAttr" }, { "name": "b", "type": "DefaultValuedProp" }, { "name": "c", "type": "DefaultValuedProp, -1>" }, { "name": "unit", "type": "UnitProp" } ], "assemblyFormat": "($a^) : (`na`)?\n ($b^)?\n ($c^)?\n ($unit^)?\n attr-dict" }, { "name": "tfrt_test.with_nice_properties", "attributes": [ { "name": "prop", "type": "PropertiesWithCustomPrint" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt_test.with_optional_properties", "attributes": [ { "name": "anAttr", "type": "OptionalAttr" }, { "name": "simple", "type": "OptionalProp" }, { "name": "simplei8", "type": "OptionalProp>" }, { "name": "simpleui8", "type": "OptionalProp>" }, { "name": "nonTrivialStorage", "type": "OptionalProp" }, { "name": "hasDefault", "type": "OptionalProp>" }, { "name": "nested", "type": "OptionalProp>" }, { "name": "longSyntax", "type": "OptionalProp" }, { "name": "hasUnit", "type": "UnitProp" }, { "name": "maybeUnit", "type": "OptionalProp" } ], "assemblyFormat": "(`anAttr` `=` $anAttr^)?\n (`simple` `=` $simple^)?\n (`simplei8` `=` $simplei8^)?\n (`simpleui8` `=` $simpleui8^)?\n (`nonTrivialStorage` `=` $nonTrivialStorage^)?\n (`hasDefault` `=` $hasDefault^)?\n (`nested` `=` $nested^)?\n (`longSyntax` `=` $longSyntax^)?\n (`hasUnit` $hasUnit^)?\n (`maybeUnit` `=` $maybeUnit^)?\n attr-dict" }, { "name": "tfrt_test.with_properties", "attributes": [ { "name": "a", "type": "I64Prop" }, { "name": "b", "type": "StrAttr" }, { "name": "c", "type": "StringProp" }, { "name": "flag", "type": "BoolProp" }, { "name": "array", "type": "IntArrayProp" }, { "name": "array32", "type": "IntArrayProp" } ], "assemblyFormat": "`a` `=` $a `,`\n `b` `=` $b `,`\n `c` `=` $c `,`\n `flag` `=` $flag `,`\n `array` `=` $array `,`\n `array32` `=` $array32 attr-dict" }, { "name": "tfrt_test.with_properties_and_attr", "attributes": [ { "name": "lhs", "type": "I32Attr" }, { "name": "rhs", "type": "IntProp" } ], "assemblyFormat": "$lhs prop-dict attr-dict" }, { "name": "tfrt_test.with_properties_and_inferred_type", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "lhs", "type": "I32Attr" }, { "name": "rhs", "type": "IntProp" }, { "name": "packed", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs prop-dict attr-dict" }, { "name": "tfrt_test.with_versioned_properties", "attributes": [ { "name": "prop", "type": "VersionedProperties" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt_test.with_wrapped_properties", "attributes": [ { "name": "prop", "type": "MyStructProperty" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt_test.with_wrapped_properties2", "attributes": [ { "name": "prop", "type": "MyStructProperty2" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "tfrt.add.f32", "summary": "tfrt.add operation", "description": "An operation that takes two inputs and returns their sum as the result.\n\n Example:\n %2 = tfrt.add.i32 %0, %1", "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.add.f64", "summary": "tfrt.add operation", "description": "An operation that takes two inputs and returns their sum as the result.\n\n Example:\n %2 = tfrt.add.i32 %0, %1", "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.add.i32", "summary": "tfrt.add operation", "description": "An operation that takes two inputs and returns their sum as the result.\n\n Example:\n %2 = tfrt.add.i32 %0, %1", "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.add.i64", "summary": "tfrt.add operation", "description": "An operation that takes two inputs and returns their sum as the result.\n\n Example:\n %2 = tfrt.add.i32 %0, %1", "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.and.i1", "summary": "tfrt.and operation", "description": "An operation that takes two inputs and returns their conjunction as the\n result.\n\n Example:\n %2 = tfrt.and.i1 %0, %1", "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.call", "summary": "host executor call operation", "description": "The \"tfrt.call\" operation represents a direct call to a function. The\n operands and result types of the call must match the specified function\n type. The callee is encoded as a function attribute named \"callee\".\n\n %2 = tfrt.call @my_add(%0, %1) : (f32, f32) -> f32", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt.case", "summary": "An n-way switch statement which calls a single branch function.", "description": "An n-way switch statement, implementing the following:\n ```\n switch (branch_index) {\n case 0:\n outputs = branches[0](inputs);\n break;\n case 1:\n outputs = branches[1](inputs);\n break;\n ...\n case [[nbranches-1]]:\n default:\n outputs = branches[nbranches-1](inputs);\n break;\n }\n ```\n Example: %res = tfrt.case %branch_idx [@branch0, @branch1] (%arg0, %arg1) : (i32, i32) -> (i32)", "operands": [ { "name": "branch_index", "type": "I32" }, { "name": "branch_operands", "type": "Variadic" } ], "results": [ { "name": "branch_outputs", "type": "Variadic" } ], "attributes": [ { "name": "branches", "type": "ArrayAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$branch_index $branches `(` $branch_operands `)` attr-dict `:` `(` type($branch_operands) `)` `->` `(` type($branch_outputs) `)`", "hasCustomAssemblyFormat": true }, { "name": "tfrt.cond", "summary": "conditional operation", "description": "The \"tfrt.cond\" operation takes an i1 condition, a 'true' function and a\n 'false' function. If the condition is true, the 'true' function is called\n and the \"tfrt.cond\" operation returns the results of that function, otherwise\n the \"false\" function is called and its values are returned.\n\n The 'true' and 'false' functions must have the same signature, but they may\n take an arbitrary number of arguments and return values with the same types\n as the op return types. Both functions are encoded as function attribute,\n named true_fn and false_fn. The a_ and b_ prefix prevent reordering by BEF\n since BEF orders attribute by name alphabetically.\n\n This operation is safe to use as a 'nonstrict' op, which dispatches its body\n whenever the condition and any dependent arguments are resolved.\n\n Example:\n\n %res = tfrt.cond %cond @true_fn @false_fn (%x, %y) : (i32, f32) -> (i32)", "operands": [ { "name": "cond", "type": "I1" }, { "name": "fn_operands", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "a_true_fn", "type": "FlatSymbolRefAttr" }, { "name": "b_false_fn", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$cond $a_true_fn $b_false_fn `(` $fn_operands `)` attr-dict `:` `(` type($fn_operands) `)` `->` `(` type($outputs) `)`", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant_s.f16", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "F16" } ], "attributes": [ { "name": "value", "type": "F16Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant_s.f32", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "F32" } ], "attributes": [ { "name": "value", "type": "F32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant_s.f64", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "F64" } ], "attributes": [ { "name": "value", "type": "F64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant_s.i64", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "I64" } ], "attributes": [ { "name": "value", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.bf16", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "BF16" } ], "attributes": [ { "name": "value", "type": "BF16Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.complex128", "summary": "host executor complex constant value constructor", "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "real", "type": "F64Attr" }, { "name": "imaginary", "type": "F64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$real `,` $imaginary attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.complex64", "summary": "host executor complex constant value constructor", "results": [ { "name": "result", "type": "Complex" } ], "attributes": [ { "name": "real", "type": "F32Attr" }, { "name": "imaginary", "type": "F32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$real `,` $imaginary attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.f16", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "F16" } ], "attributes": [ { "name": "value", "type": "F16Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.f32", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "F32" } ], "attributes": [ { "name": "value", "type": "F32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.f64", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "F64" } ], "attributes": [ { "name": "value", "type": "F64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.i1", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "value", "type": "I1Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.i32", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "value", "type": "I32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.i64", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "I64" } ], "attributes": [ { "name": "value", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.ui32", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "UI32" } ], "attributes": [ { "name": "value", "type": "UI32Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.constant.ui64", "summary": "host executor constant value constructor", "results": [ { "name": "result", "type": "UI64" } ], "attributes": [ { "name": "value", "type": "UI64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.div.i32", "summary": "tfrt.div operation", "description": "An operation that takes two inputs and returns their quotient and remainder\n as the result.\n\n Example:\n %2, %3 = tfrt.div.i32 %0, %1", "results": [ { "name": "result0", "type": "I32" }, { "name": "result1", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.div.i64", "summary": "tfrt.div operation", "description": "An operation that takes two inputs and returns their quotient and remainder\n as the result.\n\n Example:\n %2, %3 = tfrt.div.i32 %0, %1", "results": [ { "name": "result0", "type": "I64" }, { "name": "result1", "type": "I64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.equal.i32", "summary": "tfrt.equal operation", "description": "An operation that takes two inputs and returns their equality as the\n result.\n\n Example:\n %2 = tfrt.equal.i32 %0, %1", "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.equal.i64", "summary": "tfrt.equal operation", "description": "An operation that takes two inputs and returns their equality as the\n result.\n\n Example:\n %2 = tfrt.equal.i32 %0, %1", "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.get_device", "summary": "Get the device object from the given device name", "description": "Get the device object from the given device name.\n\n Example:\n %result = tfrt.get_device %chain { device_name=\"GPU:0\" }", "operands": [ { "name": "chain_in", "type": "TFRT_ChainType" } ], "results": [ { "name": "result", "type": "TFRT_DeviceType" } ], "attributes": [ { "name": "device_name", "type": "StrAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.if", "summary": "if operation", "description": "The \"tfrt.if\" operation takes an i1 condition, a 'then' body and an 'else'\n body. If the condition is true, the 'then' body is run and the \"tfrt.if\"\n operation returns the results of that region, otherwise the \"else\" body is\n run and its values are returned.\n\n The body regions must have the same signature, but they may take an\n arbitrary number of arguments and return values with the same types as the\n op return types, using a 'tfrt.return' operation at the end of the\n region. The initial values are specified as operands of \"tfrt.if\" (along\n with the condition), and the types of the values are specified with a\n function type.\n\n This operation is safe to use as a 'nonstrict' op, which dispatches its body\n whenever the condition and any dependent arguments are resolved.\n\n Example:\n\n %res = tfrt.if %cond, %x, %y : (i32, f32) -> i32 {\n %v1 = \"use\"(%x, %y) : (i32, f32) -> i32\n tfrt.return %v1 : i32\n } else {\n %v2 = \"abuse\"(%x, %y) : (i32, f32) -> i32\n tfrt.return %v2 : i32\n }", "operands": [ { "name": "cond", "type": "I1" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "then_region", "type": "SizedRegion<1>" }, { "name": "else_region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt.merge.chains", "summary": "host executor merge chain", "description": "The \"tfrt.merge.chains\" operation merges variadic number of inputs and\n outputs a single !tfrt.chain output.\n\n Example:\n\n %c1 = tfrt.new.chain\n %c2 = tfrt.new.chain\n %c3 = tfrt.new.chain\n %merged_c = tfrt.merge.chains %c1, %c2, %c3", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$inputs attr-dict `:` type($inputs)", "hasCustomAssemblyFormat": true }, { "name": "tfrt.mul_s.i32", "summary": "tfrt.mul operation", "description": "An operation that takes two inputs and returns their product.\n\n Example:\n %2 = tfrt.mul.i32 %0, %1", "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.mul_s.i64", "summary": "tfrt.mul operation", "description": "An operation that takes two inputs and returns their product.\n\n Example:\n %2 = tfrt.mul.i32 %0, %1", "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.mul.i32", "summary": "tfrt.mul operation", "description": "An operation that takes two inputs and returns their product.\n\n Example:\n %2 = tfrt.mul.i32 %0, %1", "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.mul.i64", "summary": "tfrt.mul operation", "description": "An operation that takes two inputs and returns their product.\n\n Example:\n %2 = tfrt.mul.i32 %0, %1", "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.new.chain", "summary": "host executor chain constructor", "description": "The \"tfrt.new.chain\" operation returns a !tfrt.chain value, which can be fed\n into a side-effecting operation that does not depend on anything.\n For example:\n\n func @foo() {\n ...\n %x = tfrt.new.chain\n \"side.effecting.thing\"(%x) : (!tfrt.chain) -> ()\n }", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.once", "summary": "once operation", "description": "Calls 'function' exactly once and stores the result in the resource context.\n Subsequent calls return the same result without calling the function again.\n\n Example:\n\n func @once(%arg0 : int32) -> i32 {\n tfrt.return %arg0 : i32\n }\n\n // %1 always has the same value as %0 of the first execution.\n %1 = tfrt.once @once(%0)", "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "function", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$function `(` operands `)` attr-dict\n `:` `(` type(operands) `)` `->` `(` type(results) `)`", "hasCustomAssemblyFormat": true }, { "name": "tfrt.parallel_call.i32", "summary": "parallel_call.i32 operation", "description": "The \"tfrt.parallel_call.i32\" is an alternative to \"tfrt.parallel_for.i32\" with\n a parallel region defined as a standalone function.\n\n Example:\n\n func @compute(%start : i32, %end : i32, %val : !my_type) -> !tfrt.chain {\n ...\n }\n\n %from = tfrt.constant.i32 0\n %to = tfrt.constant.i32 100\n %block_size = tfrt.constant.i32 10\n\n %val = ... : !my.type\n\n %done = tfrt.parallel_call.i32 %from to %to fixed %block_size\n @compute(%val) : !my.type", "operands": [ { "name": "start", "type": "I32" }, { "name": "end", "type": "I32" }, { "name": "block_size", "type": "I32" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt.parallel_for.i32", "summary": "parallel_for.i32 operation", "description": "The \"tfrt.parallel_for.i32\" operation is a parallel for loop that executes\n its body function for non overlapping sub ranges. It has one region which\n represents the loop body function (see host_context/parallel_for.h C++\n equivalent).\n\n The body region takes an arbitrary number of arguments and must return a\n single chain value using a 'tfrt.return' operation at the end of the region\n if it completes asynchronously. If the body region completes synchronously\n it must have empty returns (`tfrt.return` without operands).\n\n Inside the loop region `%start` and `%end` values are bound to the parallel\n block start and end offsets (see example below).\n\n This is a TFRT counterpart of the native C++ ParallelFor operation defined\n in: `host_context/parallel_for.h`.\n\n Example:\n\n %from = tfrt.constant.i32 0\n %to = tfrt.constant.i32 100\n %block_size = tfrt.constant.i32 10\n\n %val = ... : !my.type\n\n %done = tfrt.parallel_for.i32 %from to %to fixed %block_size,\n %val : !my.type {\n // Possible values for [%start, %end) are: [0, 10), [10, 20), ...\n \"use\"(%start, %end, %val) : (i32, i32, !my.type) -> ()\n\n // Async regions must return a chain to signal completion.\n tfrt.return %chain : !tfrt.chain\n\n // Sync regions must have an empty return.\n tfrt.return\n }", "operands": [ { "name": "start", "type": "I32" }, { "name": "end", "type": "I32" }, { "name": "block_size", "type": "I32" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt.print.f32", "summary": "tfrt.print operation", "description": "An operation takes a number input and a chain input.\n It prints the number to stdout and returns a chain output.\n The chain input must be the second operand.\n\n Example:\n %2 = tfrt.print.i32 %0, %1", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.print.f64", "summary": "tfrt.print operation", "description": "An operation takes a number input and a chain input.\n It prints the number to stdout and returns a chain output.\n The chain input must be the second operand.\n\n Example:\n %2 = tfrt.print.i32 %0, %1", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.print.i1", "summary": "tfrt.print operation", "description": "An operation takes a number input and a chain input.\n It prints the number to stdout and returns a chain output.\n The chain input must be the second operand.\n\n Example:\n %2 = tfrt.print.i32 %0, %1", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.print.i32", "summary": "tfrt.print operation", "description": "An operation takes a number input and a chain input.\n It prints the number to stdout and returns a chain output.\n The chain input must be the second operand.\n\n Example:\n %2 = tfrt.print.i32 %0, %1", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.print.i64", "summary": "tfrt.print operation", "description": "An operation takes a number input and a chain input.\n It prints the number to stdout and returns a chain output.\n The chain input must be the second operand.\n\n Example:\n %2 = tfrt.print.i32 %0, %1", "results": [ { "name": "result", "type": "TFRT_ChainType" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "operands attr-dict", "hasCustomAssemblyFormat": true }, { "name": "tfrt.repeat.i32", "summary": "repeat.i32 operation", "description": "The \"tfrt.repeat.i32\" operation is a repeat loop that executes its body N\n times, where N is a 32-bit value specified by its first operand. It has one\n region which represents the loop body.\n\n The body region takes an arbitrary number of arguments and must return\n values with the same types, using a 'tfrt.return' operation at the end of the\n region. The initial values for the loop are specified as operands (along\n with the trip count), and the types of the loop values are specified with a\n type list. The operation returns the results of the final iteration.\n\n This operation is safe to use as a 'nonstrict' op, which dispatches its body\n whenever dependent arguments are resolved.\n\n Example:\n\n %res1, %res2 = tfrt.repeat.i32 %i, %loopval1, %loopval2 : i32, f32 {\n \"use\"(%loopval1, %loopval2) : (i32, f32) -> ()\n ...\n tfrt.return %loopval1, %loopval2 : i32, f32\n }", "operands": [ { "name": "trip_count", "type": "I32" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt.return", "summary": "host executor return operation", "description": "The \"tfrt.return\" operation represents a return operation within a function.\n The operation takes variable number of operands and produces no results.\n The operand number and types must match the signature of the function\n that contains the operation. For example:\n\n func @foo() : (i32, f8) {\n ...\n tfrt.return %0, %1 : i32, f8", "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tfrt.while", "summary": "while operation", "description": "cond: The boolean to control whether the first iteration should be\n executed.\n operands: The arguments to the first iteration.\n results: The results of the last iteration. The number and types of results\n are the same as the number and types of operands.\n body_fn: The body function that takes the arguments and returns the results\n and an I1 value to indicate whether next iteration should be executed.\n parallel_iterations: The max number of iterations that can be dispatched in parallel.\n\n The pseudo code:\n\n while(cond) {\n results, cond = body_fn(operands)\n operands = results\n }\n return results", "operands": [ { "name": "cond", "type": "I1" }, { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "body_fn", "type": "FlatSymbolRefAttr" }, { "name": "parallel_iterations", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$cond $body_fn `(` $arguments `)` attr-dict `parallel_iterations` `(` $parallel_iterations `)` `:` `(` type($arguments) `)` `->` `(` type(results) `)`", "hasCustomAssemblyFormat": true }, { "name": "thlo.concatenate", "summary": "Destination-style twin for `mhlo.concatenate`", "description": "tHLO ConcatenateOp composes a tensor or a memref from multiple tensors or\n memrefs.\n\n Example:\n ```\n %concat = thlo.concatenate\n ins(%T1 : tensor<100x?xf32>, %T2 : tensor<300x?xf32>)\n outs(%init : tensor<400x?xf32>)\n dimension = 0\n ```\n\n See https://www.tensorflow.org/xla/operation_semantics#concatenate", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "thlo.dynamic_broadcast_in_dim", "summary": "Destination-style twin for `mhlo.dynamic_broadcast_in_dim`", "description": "tHLO DynamicBroadcastInDimOp specifies a map how to broadcast input\n dimensions. It also supports broadcasting size-1 dimensions.\n\n Example:\n ```\n %dyn_bcast = thlo.dynamic_broadcast_in_dim\n ins(%input : tensor)\n outs(%init : tensor)\n broadcast_dimensions = [0, 2]\n ```\n\n See https://www.tensorflow.org/xla/operation_semantics#broadcastindim", "operands": [ { "name": "operand", "type": "TensorOrMemref" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "DenseI64ArrayAttr" }, { "name": "known_expanding_dimensions", "type": "OptionalAttr" }, { "name": "known_nonexpanding_dimensions", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "thlo.gather", "summary": "Destination-style twin for `mhlo.gather`", "description": "tHLO GatherOp corresponds to the canonicalized mHLO GatherOp, i.e.\n\n - start_indices is a two-dimensional tensor.\n - index_vector_dim is 1\n - offset_dims is [1, 2, ...]\n - collapsed_slice_dims is []\n - start_index_map is range(start_indices.shape[1])\n\n Example:\n ```\n %gathered = thlo.gather\n ins(%input : tensor<100xf32>, %indices : tensor<42x1xindex>)\n outs(%init : tensor<42xf32>)\n ```\n\n See https://www.tensorflow.org/xla/operation_semantics#gather.", "operands": [ { "name": "operand", "type": "TensorOrMemref" }, { "name": "start_indices", "type": "TensorOrMemrefOf<[Index]>" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "thlo.reverse", "summary": "Destination-style twin for the `mhlo.reverse`", "description": "Reverses the specified dimensions of `input` according to the given\n `dimensions`.\n\n See https://www.tensorflow.org/xla/operation_semantics#rev_reverse.", "operands": [ { "name": "input", "type": "TensorOrMemref" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "TensorOrMemref" } ], "attributes": [ { "name": "reverse_dimensions", "type": "DenseI64ArrayAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "thlo.scatter", "summary": "Destination-style twin for `mhlo.scatter`", "description": "tHLO ScatterOp corresponds to the canonicalized mHLO ScatterOp, i.e.\n\n - update_window_dims is range(1, rank(update_window_dims))\n - inserted_window_dims is []\n - scatter_dims_to_operand_dims is range(0, rank(indices))\n - index_vector_dim is rank(indices) - 1\n\n At the moment, the variadic case is not supported.\n\n Example:\n ```\n %scattered = thlo.scatter\n ins(%indices : tensor<2x2xindex>, %input : tensor<2x1x3xf32>)\n outs(%init : tensor<3x3xf32>)\n (%arg3: f32, %arg4: f32) {\n %0 = arith.addf %arg3, %arg4 : f32\n thlo.yield %0 : f32\n }\n ```\n\n See https://www.tensorflow.org/xla/operation_semantics#scatter.", "operands": [ { "name": "indices", "type": "TensorOrMemrefOf<[Index]>" }, { "name": "updates", "type": "TensorOrMemref" }, { "name": "init", "type": "TensorOrMemref" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "update_computation", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "thlo.sort", "summary": "Destination-style twin for the `mhlo.sort`", "description": "Sorts the given `operands` along the given `dimension` using the given\n `comparator`.\n\n Example:\n ```\n %sorted1, %sorted2 = thlo.sort\n ins(%input1: tensor, %input2: tensor)\n outs(%init1: tensor, %init2: tensor)\n dimension = 0\n is_stable = true\n (%lhs0: f32, %rhs0: f32, %lhs1: i32, %rhs1: i32) {\n %0 = arith.cmpf ogt, %lhs0, %rhs0 : f32\n thlo.yield %0 : i1\n }\n ```\n\n See https://www.tensorflow.org/xla/operation_semantics#sort.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "IndexAttr" }, { "name": "is_stable", "type": "BoolAttr" } ], "regions": [ { "name": "comparator", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "thlo.yield", "summary": "Yield operation for tHLO ops with regions.", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "attr-dict $values `:` type($values)" }, { "name": "tile.abs", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.acos", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.acosh", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.add", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.argsort", "summary": "tensor sort index operation", "operands": [ { "name": "tensor", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[I32, SI32]>" } ], "attributes": [ { "name": "axis", "type": "IndexAttr" }, { "name": "direction", "type": "SortDirection{asc|desc}" } ], "assemblyFormat": "$direction $tensor `[` $axis `]` attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.asin", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.asinh", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.assign", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.atan", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.atanh", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.bit_and", "operands": [ { "name": "lhs", "type": "EltwiseInteger" }, { "name": "rhs", "type": "EltwiseInteger" } ], "results": [ { "name": "result", "type": "EltwiseInteger" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.bit_not", "operands": [ { "name": "operand", "type": "EltwiseInteger" } ], "results": [ { "name": "result", "type": "EltwiseInteger" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.bit_or", "operands": [ { "name": "lhs", "type": "EltwiseInteger" }, { "name": "rhs", "type": "EltwiseInteger" } ], "results": [ { "name": "result", "type": "EltwiseInteger" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.bit_shl", "operands": [ { "name": "lhs", "type": "EltwiseInteger" }, { "name": "rhs", "type": "EltwiseInteger" } ], "results": [ { "name": "result", "type": "EltwiseInteger" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.bit_shr", "operands": [ { "name": "lhs", "type": "EltwiseInteger" }, { "name": "rhs", "type": "EltwiseInteger" } ], "results": [ { "name": "result", "type": "EltwiseInteger" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.bit_xor", "operands": [ { "name": "lhs", "type": "EltwiseInteger" }, { "name": "rhs", "type": "EltwiseInteger" } ], "results": [ { "name": "result", "type": "EltwiseInteger" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.cast", "summary": "cast operation", "operands": [ { "name": "tensor", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$tensor attr-dict `:` functional-type($tensor, $result)" }, { "name": "tile.ceil", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.cmp_eq", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.cmp_ge", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.cmp_gt", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.cmp_le", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.cmp_lt", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.cmp_ne", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.constant", "summary": "constant", "results": [ { "name": "result", "type": "EltwiseAny" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` type($result)" }, { "name": "tile.contract", "operands": [ { "name": "init", "type": "EltwiseAny" }, { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[AnyScalar]>" } ], "attributes": [ { "name": "agg", "type": "AggregationKind{assign|add|max|min|mul}" }, { "name": "combo", "type": "CombinationKind{none|add|cond|eq|mul}" }, { "name": "sink", "type": "AffineMapAttr" }, { "name": "srcs", "type": "TypedArrayAttrBase" }, { "name": "cons", "type": "OptionalAttr" }, { "name": "shape", "type": "OptionalAttr" }, { "name": "lowerBounds", "type": "OptionalAttr" }, { "name": "upperBounds", "type": "OptionalAttr" }, { "name": "name", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tile.cos", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.cosh", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.div", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.erf", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.exp", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.floor", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.gather", "summary": "special gather operation", "operands": [ { "name": "tensor", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" }, { "name": "indices", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "interpolationMode", "type": "DefaultValuedAttr" }, { "name": "nearestMode", "type": "DefaultValuedAttr" }, { "name": "cubeCoeff", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedAttr" }, { "name": "batchDims", "type": "DefaultValuedAttr" }, { "name": "OutOfBoundsMode", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$tensor $indices attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.ident", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.index", "summary": "tensor index lookup operation", "results": [ { "name": "result", "type": "EltwiseIndex" } ], "attributes": [ { "name": "axis", "type": "IndexAttr" } ], "assemblyFormat": "$axis attr-dict `:` type($result)" }, { "name": "tile.log", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.logical_and", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.logical_not", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.logical_or", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.logical_xor", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseBool" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.max", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.min", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.mod", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.mul", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.neg", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.pow", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.pragma", "summary": "pragma operation", "operands": [ { "name": "tensor", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "op", "type": "StrAttr" }, { "name": "attrs", "type": "DictionaryAttr" } ], "traits": [ { "type": "AllTypesMatch<['tensor', 'result']>" } ], "assemblyFormat": "$tensor $op $attrs attr-dict `:` type($tensor)" }, { "name": "tile.prng", "summary": "pseudorandom number generator", "operands": [ { "name": "state", "type": "RankedTensorOf<[I32, UI32]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[AnyFloat]>" }, { "name": "new_state", "type": "RankedTensorOf<[I32, UI32]>" } ], "assemblyFormat": "$state attr-dict `:` functional-type($state, results)" }, { "name": "tile.relu", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.reshape", "summary": "tensor reshape operation", "operands": [ { "name": "tensor", "type": "RankedTensorOf<[AnyScalar]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[AnyScalar]>" } ], "assemblyFormat": "$tensor attr-dict `:` functional-type($tensor, $result)" }, { "name": "tile.round", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.scatter", "summary": "special scatter operation", "operands": [ { "name": "data", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" }, { "name": "indices", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" }, { "name": "updates", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[AnyInteger, AnyScalar]>" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$data $indices $updates attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.select", "summary": "conditional selection", "operands": [ { "name": "cond", "type": "EltwiseBool" }, { "name": "tcase", "type": "EltwiseAny" }, { "name": "fcase", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$cond `,` $tcase `,` $fcase attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.shape", "summary": "tensor shape operation", "operands": [ { "name": "tensor", "type": "RankedTensorOf<[AnyScalar]>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[SI32]>" } ], "assemblyFormat": "$tensor attr-dict `:` functional-type($tensor, $result)" }, { "name": "tile.sign", "operands": [ { "name": "operand", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.sin", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.sinh", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.sqrt", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.sub", "operands": [ { "name": "lhs", "type": "EltwiseAny" }, { "name": "rhs", "type": "EltwiseAny" } ], "results": [ { "name": "result", "type": "EltwiseAny" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` functional-type(operands, $result)" }, { "name": "tile.tan", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tile.tanh", "operands": [ { "name": "operand", "type": "EltwiseFloat" } ], "results": [ { "name": "result", "type": "EltwiseFloat" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $result)" }, { "name": "tm_tensor.attention", "summary": "Attention operator", "description": "This operator takes in 3 to 4 tensors: query(Q), key(K), value(V), and an\n optional mask(M) to compute the attention. These tensors must take on shapes\n BxMxK1 for Q, BxK2xK1 for K, BxK2xN for V, and BxMxK2 for M. For all these\n shapes, B represents the batch dimension, M represents sequence length, N\n represents head dimension, and K1 and K2 are hidden dimensions.\n Attention is defined as matmul(softmax(matmul(Q, transpose(K))+M), V) and\n has shape BxMxN. This also performs scaling based on the optional attribute\n value, or through a default scale of 1/sqrt(head_dim).\n Usually, this operator also performs masking and dropout, but we leave that\n out of the current implementation.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "scale", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `ins` `(` $inputs `:` type($inputs) `)`\n `outs` `(` $outputs `:` type($outputs) `)`\n (`->` type($result)^)?" }, { "name": "tm_tensor.scan", "summary": "Scan operator", "description": "Computes the inclusive/exclusive scan along a given dimension.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" }, { "name": "inclusive", "type": "BoolAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`dimension` `(` $dimension `)`\n `inclusive` `(` $inclusive `)`\n attr-dict\n `ins` `(` $inputs `:` type($inputs) `)`\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "tm_tensor.scatter", "summary": "Scatter operator", "description": "Based on XLA operation semantics, takes two `inputs` (`update` and\n `indices`) and `outputs` value (`original`). The operation updates\n the value at the slices specified by `indices` by combining the\n current value with the value in `updates` using the computation\n specified in `region`. The `region` specifies a binary operation\n of signature (T, T) -> T, where `T` is the element-type of\n `updates` (and `original`). The first argument correspond the\n value to be updated (i.e. from `updates`), and the second the\n current value (i.e. value from `original`).\n\n The `indices` is a 2D tensor/memref type. The first dim is the number of\n updates, and the second dim is index depth. The index depth should always be\n static.\n\n The first dim of `updates` and `indices` is identical, since they represent\n the number of updates.\n\n The rank of the `original`/`result` is at least\n `index_depth + rank(%updates) - 1`. The first `index_depth` indices are\n derived from `indices` and the shape of update value has the last\n rank(%original) - index_depth values match %(originals) last dimensions,\n with the previous dims extending from the index offsets.\n\n The unique_indices attribute carries the information whether all the indices\n are unique. If there are repeated indices, the first iteration loop will be\n marked as reduction.\n\n The shapes definition follows tensorflow operations execept that it force\n batch dims to be 1D. See more information in\n https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension_map", "type": "DenseI64ArrayAttr" }, { "name": "unique_indices", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict `unique_indices` `(` $unique_indices `)`\n (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "tm_tensor.sort", "summary": "Sort operator", "description": "Based on XLA operation semantics, sorts the given `operands` at the given\n `dimension` with the given `comparator`.\n\n See https://www.tensorflow.org/xla/operation_semantics#sort.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n (`ins` `(` $inputs^ `:` type($inputs) `)`)?\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "tm_tensor.topk", "summary": "Top-K operator", "description": "A Top-K operation for N-D tensors. Reduces the target dimension from the input\n size N down to K elements based on the supplied binary region.\n\n Accepts an N-D tensor input consisting of values and an optioanl N-D tensor\n for indices of those values (i32 type). If input indices aren't provided, the\n index mapping is inferred based on the k dim. Both input values/indices\n tensors and output values/indicies tensors must have the same shape. Top-K is\n computed along the target dimension (from dimension()). Returns two output\n tensors of values and the indicies of Top-K results. The output dimensions\n must match the input save for the dimension that is reduced to K results.\n\n Region accepts lhs=[next N input] and rhs=[exiting K output] and yeilds an\n i1. If true, the two values are swapped:\n - For Top-K compoarision: >\n - For Min-K comparision: <\n Note: when the two values are equal, the first occurence is always selected.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" } ], "regions": [ { "name": "region", "type": "AnyRegion" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "attr-dict\n `dimension` `(` $dimension `)`\n `ins` `(` $inputs `:` type($inputs) `)`\n `outs` `(` $outputs `:` type($outputs) `)`\n $region (`->` type($results)^)?" }, { "name": "tm_tensor.yield", "summary": "TMTensor yield op", "description": "`tm_tensor.yield` is a special terminator operation for blocks inside\n regions in `tm_tensor` ops.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "top.A16Gather", "summary": "Quantized gather operator for embedding lookup", "description": "Gather operation with quantized weights, designed for embedding lookup in LLMs.\n Performs: output[..., dim] = dequant(weight[indices[...], :])\n\n The weight tensor is stored in quantized format (INT8 or packed INT4),\n with per-group scale and zero-point for dequantization.\n Similar to Gather, but with quantized weight table instead of float input.\n\n Currently only axis=0 is supported (runtime assertion).\n keepdims controls whether the gathered axis dimension is retained (as size 1)\n in the output. Default is false (axis dimension replaced by indices shape).", "operands": [ { "name": "weight", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" }, { "name": "scale", "type": "AnyTensor" }, { "name": "zp", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "DefaultValuedAttr" } ] }, { "name": "top.A16MatMul", "summary": "w8a16 / w4a16 matmul operator", "description": "The special matrix multiplication designed for LLM Linear Layer.\n Weight is saved in int8 with f16 per-channel quant scale.\n\n y_f16 = x_f16 x (quantized_w.to(f16) * scale_f16)", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensor" }, { "name": "scale", "type": "AnyTensor" }, { "name": "zp", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "right_transpose", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "DefaultValuedAttr" }, { "name": "dq_type", "type": "DefaultValuedAttr" } ] }, { "name": "top.Abs", "summary": "Abs operator", "description": "1.Op Introduction\n computes the absolute value of each element in the input tensor.\n\n 2.Math formula\n ```math\n output = abs(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.AdaptiveAvgPool", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n {output}(N_i, C_j, p, q) = pool(input(N_i, C_j, start_h, start_w), kernel_size)\n ```\n start_h and start_w are the starting indices for the pooling window in the height and width dimensions.\n pool can be any pooling function (max pooling, average pooling) applied over the region defined by the kernel size.\n N is a batch size, C denotes a number of channels,\n Shape:\n - Input: (N, C_{in}, H_{in}, W_{in})\n - Output: (N, C_{out}, H_{out}, W_{out})\n ```math\n H_{output} = {H_{in} + {padding}[0] + {padding}[2] - {kernel_shape}[0]} / {stride}[0] + 1\n ```\n ```math\n W_{output} = {W_{in} + {padding}[1] + {padding}[3] - {kernel_shape}[1]} / {stride}[1] + 1\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n auto_pad: It can be set to different modes (e.g., SAME, VALID) to automatically calculate the necessary padding based on\n the input size,kernel size, and stride.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "output_size", "type": "TypedArrayAttrBase" } ] }, { "name": "top.Add", "summary": "add operator", "description": "1.Op Introduction\n Elementwise addition of input1 and input2. Axis of size 1 will be broadcast,\n as necessary.\n\n 2.Math formula\n ```math\n output = ReLU((input1 + input2; dim))\n ```\n Axis of size 1 will be broadcast if necessary.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n coeff: It is an array and allows for scaling the output of the addition operation.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "coeff", "type": "OptionalAttr>" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.AddConst", "summary": "Add Const operator", "description": "1.Op Introduction\n The AddConst operator is designed to perform an element-wise addition of a constant value to an input tensor.\n\n 2.Math formula\n ```math\n output = input + const_val\n ```\n Where input1, input2, ..., inputN are the input tensors.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.Arange", "summary": "Arange operator", "description": "1.Op Introduction\n gen by torch aten::arange.\n\n 2.Math formula\n ```math\n output = [x | x = start + n * step, n is an integer, and start ≤ x < end]\n ```\n\n 3.activation and weight\n start(act.): The starting value of the sequence. This can be a tensor or None. If None, it defaults to 0.;\n end(act.): The exclusive upper limit of the sequence.;\n step(act.): The increment between each value in the sequence. This can be a tensor or None. If None, it defaults to 1.;", "operands": [ { "name": "start", "type": "AnyTensorOrNone" }, { "name": "end", "type": "AnyTensor" }, { "name": "step", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Arccos", "summary": "Arccos operator", "description": "1.Op Introduction\n Calculates the Arccos of the given input tensor.\n\n 2.Math formula\n ```math\n output = Arccos(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Arctanh", "summary": "Arctanh operator", "description": "1.Op Introduction\n Calculates the Arctanh of the given input tensor.\n\n 2.Math formula\n ```math\n output = Arctanh(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Arg", "summary": "Arg operation", "description": "1.Op Introduction\n Computes the indices of the min/max/ of the input tensor's element along the provided axis.\n\n 2.Math formula\n ```math\n maximum operation:\n output_max[i_1, i_2, i_3,..., i_k] = arg max{j}(input[i_1, i_2,..., i_k, j])\n minimum operation:\n output_min[i_1, i_2, i_3,..., i_k] = arg min{j}(input[i_1, i_2,..., i_k, j])\n ```\n where, ( j ) represents the index along the specified axis.\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n select_last_index: select the last index of the minimum or maximum value when multiple along the specified axis.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "indices", "type": "AnyTensor" }, { "name": "values", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "keepdims", "type": "BoolAttr" }, { "name": "mode", "type": "ArgModeAttr" }, { "name": "select_last_index", "type": "DefaultValuedAttr" } ] }, { "name": "top.Attention", "summary": "Attention operator", "description": "1.Op Introduction\n Performs a multi head attention block. https://en.wikipedia.org/wiki/Attention_(machine_learning)\n This block has Q_w, K_w,V_w, O_w and mask;\n This operator utilizes query, key, and value weights (denoted as (Q_w), (K_w), and (V_w), respectively) to compute attention scores and\n generate output representations.\n\n 2.Math formula\n ```math\n Attention(Q, K, V) = softmax(((Q x K^T) / \\sqrt{d_k}) + musk) x V;\n head_i = Attention(Q x queries_weight, K x keys_weight, V x values_weight);\n MultiHead(Q, K, V) = Concat(head_1, head_2, ..., head_h) x out_weight + out_bias;\n output = MultiHead(input x queries_weight + queries_bias, input x keys_weight + keys_bias, input x values_weight + values_bias).\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n keys(act.): The keys are derived from the input data and help the model determine which parts of the input are relevant for each query.;\n values(act.): The values are the actual information that will be aggregated based on the attention scores computed from the queries and keys.;\n queries_weight(w.): Queries are the features that the model uses to ask questions about the input data.;\n queries_bias(w.): added to the query representations after the weight transformation.;\n keys_weight(w.): This weight tensor transforms the input into key representations.;\n keys_bias(w.): added to the key representations after the weight transformation, providing further adjustment.;\n values_weight(w.): used to transform the input into value representations.;\n values_bias(w.): added to the value representations after the weight transformation.;\n out_weight(w.): used to transform the concatenated output of the attention heads into the final output representation.;\n out_bias(w.): added to the output representation after the final weight transformation.;\n musk(w.): apply masking during the attention computation, Masks can prevent the model from attending to certain positions in the input.;\n\n\n 4.attributes\n scale: a scaling factor applied to the attention scores before they are passed through the softmax function.;\n head: the number of attention heads to use in the multi-head attention mechanism.;\n dim: the size of the input features or the size of the query, key, and value vectors.;\n scale_param: adjust the scaling factor for the attention scores, It allows for flexibility in tuning the attention mechanism.;\n zp_param: the zero-point parameters for quantization,;\n has_bias: whether the attention mechanism includes bias terms in its computations.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "keys", "type": "AnyTensor" }, { "name": "values", "type": "AnyTensor" }, { "name": "queries_weight", "type": "AnyTensor" }, { "name": "queries_bias", "type": "AnyTensorOrNone" }, { "name": "keys_weight", "type": "AnyTensor" }, { "name": "keys_bias", "type": "AnyTensorOrNone" }, { "name": "values_weight", "type": "AnyTensor" }, { "name": "values_bias", "type": "AnyTensorOrNone" }, { "name": "out_weight", "type": "AnyTensor" }, { "name": "out_bias", "type": "AnyTensorOrNone" }, { "name": "mask", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "F64Attr" }, { "name": "head", "type": "I64Attr" }, { "name": "dim", "type": "DefaultValuedAttr" }, { "name": "scale_param", "type": "DefaultValuedAttr, {1.0}>" }, { "name": "zp_param", "type": "DefaultValuedAttr, {0}>" }, { "name": "has_bias", "type": "DefaultValuedAttr" } ] }, { "name": "top.AvgPool", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n {output}(N_i, C_j, p, q) = pool(input(N_i, C_j, start_h, start_w), kernel_size)\n ```\n start_h and start_w are the starting indices for the pooling window in the height and width dimensions.\n pool can be any pooling function (max pooling, average pooling) applied over the region defined by the kernel size.\n N is a batch size, C denotes a number of channels,\n Shape:\n - Input: (N, C_{in}, H_{in}, W_{in})\n - Output: (N, C_{out}, H_{out}, W_{out})\n ```math\n H_{output} = {H_{in} + {padding}[0] + {padding}[2] - {kernel_shape}[0]} / {stride}[0] + 1\n ```\n ```math\n W_{output} = {W_{in} + {padding}[1] + {padding}[3] - {kernel_shape}[1]} / {stride}[1] + 1\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n auto_pad: It can be set to different modes (e.g., SAME, VALID) to automatically calculate the necessary padding based on\n the input size,kernel size, and stride.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "ceil_mode", "type": "OptionalAttr" }, { "name": "auto_pad", "type": "OptionalAttr" }, { "name": "is_adaptive", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.BatchNorm", "summary": "BatchNormalization operation", "description": "1.Op Introduction\n Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs with additional channel dimension)\n as described in the paper Batch Normalization: Accelerating Deep Network Training by Reducing\n Internal Covariate Shift `__ .\n\n 2.Math formula\n ```math\n output = \\frac{input - \\mathrm{E}[input]}{ \\variance + \\epsilon} * \\gamma + \\beta\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n mean(w.): mean of input tensor in dim C;\n variance(w.): quantifies the spread of the input tensor values along the channel dimension (dimension C) for each mini-batch.;\n gamma(w.): scalar;\n beta(w.): scalar;\n The mean and standard-deviation are calculated per-dimension over\n the mini-batches and $$\\gamma$$ and $$\\beta$$ are learnable parameter vectors\n of size C (where C is the input channel size).\n\n 4.attributes\n epsilon;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "variance", "type": "AnyTensor" }, { "name": "gamma", "type": "AnyTensorOrNone" }, { "name": "beta", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.BatchNormBwd", "summary": "BatchNormalization backward operation", "description": "1.Op Introduction\n Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs\n with additional channel dimension) as described in the paper\n Batch Normalization: Accelerating Deep Network Training by Reducing\n Internal Covariate Shift `__ .\n\n 2.Math formula\n ```math\n y = \\frac{x - \\mathrm{E}[x]}{ \\sqrt{\\mathrm{Var}[x] + \\epsilon}} * \\gamma + \\beta\n ```\n The mean and standard-deviation are calculated per-dimension over\n the mini-batches and $$\\gamma$$ and $$\\beta$$ are learnable parameter vectors\n of size C (where C is the input channel size).\n\n 3.activation and weight\n input(act.): input tensor.;\n grad_out(w.): the gradient of the loss with respect to the output of the layer normalization.;\n\n 4.attributes\n weight_opt: the optimal scaling for the normalized output.;\n saved_mean: the mean of the input tensor calculated.;\n saved_invstd: the inverse standard deviation of the input tensor calculated.;\n epsilon;", "operands": [ { "name": "grad_out", "type": "AnyTensor" }, { "name": "input", "type": "AnyTensor" }, { "name": "weight_opt", "type": "AnyTensorOrNone" }, { "name": "saved_mean", "type": "AnyTensorOrNone" }, { "name": "saved_invstd", "type": "AnyTensorOrNone" } ], "results": [ { "name": "grad_in", "type": "AnyTensor" }, { "name": "weight_grad", "type": "AnyTensorOrNone" }, { "name": "bias_grad", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" } ] }, { "name": "top.BatchNormTrain", "summary": "BatchNormalization train operation", "description": "1.Op Introduction\n Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs\n with additional channel dimension) as described in the paper\n Batch Normalization: Accelerating Deep Network Training by Reducing\n Internal Covariate Shift `__ .\n\n 2.Math formula\n ```math\n y = \\frac{x - \\mathrm{E}[x]}{ \\sqrt{\\mathrm{Var}[x] + \\epsilon}} * \\gamma + \\beta\n ```\n The mean and standard-deviation are calculated per-dimension over\n the mini-batches and $$\\gamma$$ and $$\\beta$$ are learnable parameter vectors\n of size C (where C is the input channel size).\n\n 3.activation and weight\n input(act.): input tensor.;\n mean(w.): mean values to subtract from each channel for normalization.;\n variance(w.): adjust the predicted boxes during the training process.;\n\n 4.attributes\n gamma;\n beta;\n epsilon;\n momentum: hyperparameter;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "var", "type": "AnyTensor" }, { "name": "gamma", "type": "AnyTensorOrNone" }, { "name": "beta", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "mean_out", "type": "AnyTensor" }, { "name": "saved_invstd", "type": "AnyTensor" }, { "name": "running_mean", "type": "AnyTensor" }, { "name": "running_var", "type": "AnyTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "momentum", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.BinaryConstShift", "summary": "Binary Const with shift operator", "description": "1.Op Introduction\n The BinaryConstShift operator is a specialized tensor operation that combines binary arithmetic with constant scaling and shifting.\n\n 2.Math formula\n ```math\n output = saturation(input +/-/* scale >> -shift)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: a scaling factor multiplies the input tensor.;\n shift: a shift value applied to the quantized data before scaling.;\n is_reverse: whether the subtraction operation is performed in reverse order.;\n saturation: whether the output should be saturated.\n When set true, the output will be clamped to a predefined range to prevent overflow or underflow during the operation.;\n round_mode: It determines how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "SI32Attr" }, { "name": "mode", "type": "BinaryShiftAttr" }, { "name": "shift", "type": "SI32Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "saturation", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.BinaryShift", "summary": "Binary with shift operator", "description": "1.Op Introduction\n The BinaryShift operator is designed to perform binary operations on two input tensors with an additional shift operation.\n\n 2.Math formula\n ```math\n output = saturation(input1 +/-/* input2 >> -shift)\n ```\n\n 3.activation and weight\n input1(act.): input tensor;\n input2(act.): input tensor;\n\n 4.attributes\n shift: a shift value applied to the quantized data before scaling.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n is_reverse: whether the subtraction operation is performed in reverse order.;\n saturation: whether the output should be saturated.\n When set to true, the output will be clamped to a predefined range to prevent overflow or underflow during the operation.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input1", "type": "AnyTensor" }, { "name": "input2", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "BinaryShiftAttr" }, { "name": "shift", "type": "SI32Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "saturation", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.Cast", "summary": "Cast operation", "description": "1.Op Introduction\n quant::UniformQuantizedType cast to float type; or float type cast to quant::UniformQuantizedType\n\n 2.Math formula\n Float(output) = Cast (input, dtype=UniformQuantizedType);\n UniformQuantizedType(output) = Cast (input, dtype=Float);\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "to", "type": "DefaultValuedAttr" } ] }, { "name": "top.Ceil", "summary": "Ceil operator", "description": "1.Op Introduction\n y = ceil(x)\n rounds each element of the input tensor up to the nearest integer.\n\n 2.Math formula\n ```math\n output = ceil(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.ChunkGatedDeltaRule", "summary": "Chunk Gated Delta Rule operator", "description": "1.Op Introduction\n The ChunkGatedDeltaRule operator implements a chunk-wise gated delta rule attention mechanism,\n specialized for efficient linear attention with recurrent state updates.\n The input sequence is split into fixed-size chunks. Within each chunk, intra-chunk attention\n is computed using gated decay factors derived from g. Across chunks, a recurrent state is\n maintained and updated to propagate inter-chunk information. The gating signal g controls\n exponential decay, and beta modulates key/value contributions via element-wise scaling.\n\n 2.Math formula\n ```math\n scale = 1 / sqrt(k_head_dim)\n query = query * scale\n v_beta = value * beta, k_beta = key * beta\n\n // Chunk decay\n g_cumsum = cumsum(g, dim=-1)\n decay_mask = tril(exp(tril(g_cumsum[:, :, :, :, None] - g_cumsum[:, :, :, None, :])))\n attn = I + resolve_lower_triangular(-(k_beta @ key^T) * decay_mask)\n v_new_chunk = attn @ v_beta\n k_cumdecay = attn @ (k_beta * exp(g_cumsum))\n\n // Intra-chunk attention\n intra_chunk_attn = masked_fill(query @ key^T * decay_mask, upper_tri_mask, 0)\n\n // Inter-chunk recurrence (for each chunk i)\n v_prime = k_cumdecay_i @ S_{i-1}\n v_new = v_new_chunk_i - v_prime\n output_i = (query_i * exp(g_i)) @ S_{i-1} + intra_chunk_attn_i @ v_new\n S_i = S_{i-1} * exp(g_last_i) + (key_i * exp(g_last_i - g_i))^T @ v_new\n ```\n\n 3.activation and weight\n query(act.): query tensor with shape (B, num_heads, S, k_head_dim).;\n key(act.): key tensor with shape (B, num_heads, S, k_head_dim).;\n value(act.): value tensor with shape (B, num_heads, S, v_head_dim).;\n g(act.): gating signal tensor with shape (B, num_heads, S), controls the exponential decay rate per position.;\n beta(act.): scaling factor tensor with shape (B, num_heads, S), modulates key and value contributions.;\n recurrent_state(act.): initial recurrent state tensor with shape (B, num_heads, k_head_dim, v_head_dim), carries information across chunks.;\n eye(act.): identity matrix tensor with shape (chunk_size, chunk_size), used for constructing the intra-chunk attention transform.;\n\n 4.attributes\n chunk_size: the size of each chunk that the input sequence is split into. The sequence is padded to be divisible by chunk_size.;", "operands": [ { "name": "query", "type": "AnyTensor" }, { "name": "key", "type": "AnyTensor" }, { "name": "value", "type": "AnyTensor" }, { "name": "g", "type": "AnyTensor" }, { "name": "beta", "type": "AnyTensor" }, { "name": "recurrent_state", "type": "AnyTensor" }, { "name": "triu_mask", "type": "AnyTensor" }, { "name": "strict_triu_mask", "type": "AnyTensor" }, { "name": "tril_mask", "type": "AnyTensor" }, { "name": "eye", "type": "AnyTensor" } ], "results": [ { "name": "attn_out", "type": "AnyTensor" } ], "attributes": [ { "name": "num_k_heads", "type": "I64Attr" }, { "name": "num_v_heads", "type": "I64Attr" }, { "name": "d", "type": "I64Attr" }, { "name": "chunk_size", "type": "I64Attr" }, { "name": "use_qk_l2norm", "type": "BoolAttr" }, { "name": "scale", "type": "F64Attr" } ] }, { "name": "top.Clip", "summary": "Clip operator", "description": "1.Op Introduction\n The operator limits the given input to a certain range.\n\n 2.Math formula\n ```math\n output[i] = min if input[i] < min;\n input[i] if input[i] >= min && input[i] <= max;\n max if input[i] > max;\n\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n min: the minimum value that the elements of the input tensor can take.;\n max: the maximum value that the elements of the input tensor can take.;", "operands": [ { "name": "inputs", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "min", "type": "F64Attr" }, { "name": "max", "type": "F64Attr" } ] }, { "name": "top.Compare", "summary": "Compare operation", "description": "1.Op Introduction\n Returns the tensor resulted from performing the compare\n operation elementwise on the input tensors A and B.\n\n 2.Math formula\n ```math\n output[i] = 1 if lhs[i] mode rhs[i] is true\n 0 otherwise\n ```\n\n 3.activation and weight\n lhs(act.): the first input tensor used as the left operand in the element-wise comparison.;\n rhs(act.): the second input tensor used as the right operand in the element-wise comparison.;\n\n 4.attributes\n mode: the type of comparison to be performed between the two input tensors.\n mdoe include Equal, Not Equal, Less Than, Less Than or Equal, Greater Than and Greater Than or Equal;", "operands": [ { "name": "lhs", "type": "AnyTensor" }, { "name": "rhs", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "CompareModeAttr" } ] }, { "name": "top.CompareConst", "summary": "CompareConst operation", "description": "1.Op Introduction\n Returns the tensor resulted from performing the compare\n operation elementwise on the input tensors A and Const.\n\n 2.Math formula\n ```math\n output[i] = 1 if input[i] mode const_val is true\n 0 otherwise\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n mode: the type of comparison to be performed between the two input tensors.\n mdoe include Equal, Not Equal, Less Than, Less Than or Equal, Greater Than and Greater Than or Equal;\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n inversed: whether the mask should be inverted.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "CompareModeAttr" }, { "name": "const_val", "type": "F64Attr" }, { "name": "inversed", "type": "BoolAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.Concat", "summary": "Concat operator", "description": "1.Op Introduction\n Concatenates the given sequence of seq tensors in the given dimension.\n All tensors must either have the same shape (except in the concatenating dimension) or be empty.\n\n 2.Math formula\n output = Concat(input1, input2, axis)\n = input1[axis] + input2[axis];\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n axis: the dimension along which the input tensors will be concated together.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n round_mode: This determines how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "only_merge", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.ConcatSlice", "summary": "ConcatSlice operator", "description": "1.Op Introduction\n The ConcatSlice operator concatenates two tensors along a specified axis,\n then slices off the front portion so the output shape matches the first input.\n This is equivalent to: output = concat(in0, in1, axis)[..., axis_size_1:, ...]\n\n 2.Math formula\n ```math\n concat_result = concatenate(in0, in1, axis=axis)\n output = concat_result[axis_size_1 : axis_size_0 + axis_size_1]\n ```\n where axis_size_0 and axis_size_1 are the sizes of in0 and in1 along the axis.\n\n 3.activation and weight\n in0(act.): first input tensor with shape (n0, c0, h0, w0).;\n in1(act.): second input tensor with shape (n1, c1, h1, w1),\n all dims must match in0 except at the concat axis.;\n\n 4.attributes\n axis: the axis along which to concatenate and then slice.;", "operands": [ { "name": "in0", "type": "AnyTensor" }, { "name": "in1", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ] }, { "name": "top.ConcatVolume", "summary": "Concat volume operator for stereo matching", "description": "Build concatenated cost volume for stereo matching.\n Concatenate left and right features with disparity shift.\n\n 2.Math formula\n for i in range(max_disp):\n if i > 0:\n output[:, :C, i, :, :] = left_feature[:, :, :, :]\n output[:, C:, i, :, i:] = right_feature[:, :, :, :-i]\n else:\n output[:, :C, i, :, :] = left_feature\n output[:, C:, i, :, :] = right_feature\n\n 3.activation and weight\n input(act.): left_feature (B, C, H, W), right_feature (B, C, H, W)\n\n 4.attributes\n max_disp: Maximum disparity value, determines the disparity dimension size.\n\n 5.output\n output: Cost volume (B, 2*C, max_disp, H, W)", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "max_disp", "type": "DefaultValuedAttr" } ] }, { "name": "top.ConstantFill", "summary": "constant fill operator", "description": "1.Op Introduction\n fill the constant value\n\n 2.Math formula\n ```math\n output = value * ones(shape(input))\n ```\n where, ones(shape(input)) generates a tensor of the same shape as the input tensor, filled with ones.\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n value: the constant value that will fill the output tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "F64Attr" } ] }, { "name": "top.Conv", "summary": "Convolution operator", "description": "1.Op Introduction\n The Top_ConvOp is a convolution operator designed to perform convolution operations on input tensors.\n The operation transforms an input tensor with shape ((N, C_{\\text{in}}, H_{\\text{in}}, W_{\\text{in}})) into\n an output tensor with shape ((N, C_{\\text{out}}, H_{\\text{out}}, W_{\\text{out}})).\n The output is computed using learnable weights (filters) and optional biases,\n following the mathematical formula for convolution, which incorporates parameters such as kernel size, strides, padding, and dilation.\n\n 2.Math formula\n ```math\n output(N, C_{out}, H, H) = \\sum_{C_{in}} input(N, C_{in}, H + sH * kH, W + sW * kW) * filter(C_{in}, C_{out}, kH, kW) + bias(C_{out}) + bisa(C_{out})\n ```\n where, kH and kW are the height and width of the filter (kernel), sH and sW are the vertical and horizontal strides.\n N is a batch size, C denotes a number of channels, H is a height of input, and W is width.\n Shape:\n - Input: (N, C_{in}, H_{in}, W_{in})\n - Output: (N, C_{out}, H_{out}, W_{out})\n ```math\n H_{output} = {H_{in} + {padding}[0] + {padding}[2] - {dilation}[0] x ({kernel_size}[0] - 1) - 1} / {stride}[0] + 1\n ```\n ```math\n W_{output} = {W_{in} + {padding}[1] + {padding}[3] - {dilation}[1] x ({kernel_size}[1] - 1) - 1} / {stride}[1] + 1\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n filter(w.): the learnable weights of the convolution 2d operation.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array. ;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n groups: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n dilation: controls the spacing between the kernel points;\n inserts: additional parameters that may be used for specific optimizations or configurations.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n dynweight_reorderd: whether the weights (filters) should be reordered dynamically.;\n weight_is_coeff: whether the weights should be treated as coefficients.;\n do_winograd: whether to use the Winograd algorithm for convolution,\n which can speed up the computation by reducing the number of multiplications needed.;\n auto_pad: It can be set to different modes (e.g., SAME, VALID) to automatically calculate the necessary padding based on\n the input size,kernel size, and stride.;\n in_int4_scale: This attribute defines the scaling factor for input tensors represented in 4-bit integer format (INT4).;\n in_int4_zp: The in_int4_zp attribute specifies the zero-point for the input tensors in INT4 format.;\n out_int8_scale: This attribute defines the scaling factor for output tensors represented in 8-bit integer format (INT8).;\n out_int8_zp: The out_int8_zp attribute specifies the zero-point for the output tensors in INT8 format.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "filter", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "inserts", "type": "OptionalAttr>" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "dynweight_reorderd", "type": "DefaultValuedAttr" }, { "name": "weight_is_coeff", "type": "DefaultValuedAttr" }, { "name": "do_winograd", "type": "OptionalAttr" }, { "name": "auto_pad", "type": "OptionalAttr" }, { "name": "in_int4_scale", "type": "OptionalAttr" }, { "name": "in_int4_zp", "type": "OptionalAttr" }, { "name": "out_int8_scale", "type": "OptionalAttr" }, { "name": "out_int8_zp", "type": "OptionalAttr" }, { "name": "weight_bits", "type": "OptionalAttr" } ] }, { "name": "top.Convbwd", "summary": "convolution backward", "description": "1.Op Introduction\n calculate grad_input,grad_weight,grad_bias of convolution operation.\n\n 2.Math formula\n ```math\n \\text{grad\\_input} = \\sum_{k=0}^{K-1} \\text{grad\\_out} \\ast \\text{kernel}_{k}\n where \\( K \\) is the number of output channels and \\( \\ast \\) denotes the convolution operation.\n\n \\text{grad\\_weight} = \\sum_{n=0}^{N-1} \\text{input}_{n} \\ast \\text{grad\\_out}\n where \\( N \\) is the number of input channels.\n\n \\text{grad\\_bias} = \\sum_{i=0}^{M-1} \\text{grad\\_out}_{i}\n where \\( M \\) is the number of output channels.\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grad_out(w.): the gradient of the loss with respect to the output of the layer normalization.;\n kernel(w.): convolution kernel (filter) tensor.;\n\n 4.attributes\n groups: Number of blocked connections from input channels to output channels. Default: 1.;\n input_shape: The shape of the input tensor.;\n grad_out_shape: The shape of the gradient output tensor.;\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n dilations: controls the spacing between the kernel points;\n padding: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n inserts: selectively enabling or disabling the calculation of gradients;\n grad_input_enable: whether to compute the gradient for the input tensor.;\n grad_weight_enable: whether to compute the gradient for the weight tensor (kernel).;\n grad_bias_enable: whether to compute the gradient for the bias term as well.;", "operands": [ { "name": "grad_out", "type": "AnyTensor" }, { "name": "input", "type": "AnyTensor" }, { "name": "kernel", "type": "AnyTensor" } ], "results": [ { "name": "grad_input", "type": "AnyTensorOrNone" }, { "name": "grad_weight", "type": "AnyTensorOrNone" }, { "name": "grad_bias", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "groups", "type": "I64Attr" }, { "name": "input_shape", "type": "TypedArrayAttrBase" }, { "name": "grad_out_shape", "type": "TypedArrayAttrBase" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "inserts", "type": "TypedArrayAttrBase" }, { "name": "grad_input_enable", "type": "BoolAttr" }, { "name": "grad_weight_enable", "type": "BoolAttr" }, { "name": "grad_bias_enable", "type": "BoolAttr" } ] }, { "name": "top.ConvBwd_Weight", "summary": "Convolution Backward operator", "description": "1.Op Introduction\n Gradient of Weight in Convolution Backward.\n\n 2.Math formula\n ```math\n \\frac{\\partial L}{\\partial W} = \\sum_{n=1}^{N} \\sum_{c=1}^{C_{in}} \\sum_{h=1}^{H} \\sum_{w=1}^{W} \\text{input}[n, c, h, w] \\cdot \\text{grad\\_out}[n, :, h', w']\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grad_output(act.): the gradient of the loss with respect to the output.;\n gradout_transpose(w.): The transposed gradient of the output tensor.;\n\n 4.attributes\n groups: Number of blocked connections from input channels to output channels. Default: 1.;\n input_shape: The shape of the input tensor.;\n grad_out_shape: The shape of the gradient output tensor.;\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n dilations: controls the spacing between the kernel points;\n padding: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n grad_bias_enable: whether to compute the gradient for the bias term as well.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "gradout", "type": "AnyTensor" }, { "name": "gradout_transpose", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "groups", "type": "I64Attr" }, { "name": "input_shape", "type": "TypedArrayAttrBase" }, { "name": "grad_out_shape", "type": "TypedArrayAttrBase" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "grad_bias_enable", "type": "BoolAttr" } ] }, { "name": "top.Copy", "summary": "Copy operator", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "input_stride", "type": "TypedArrayAttrBase" }, { "name": "output_stride", "type": "TypedArrayAttrBase" } ] }, { "name": "top.Correlation", "summary": "Custom operator correlation", "description": "Multiply the sliced left_feature and right_feature based on max_disp;\n then perform a reduce operation;\n and finally concatenate the results.\n\n 2.Math formula\n for i in range(max_disp):\n if i > 0:\n output[:, i, :, i:] = (left_feature[:, :, :, i:] * right_feature[:, :, :, :-i]).mean(dim=1)\n else:\n output[:, i, :, :] = (left_feature * right_feature).mean(dim=1)\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n max_disp: The number of slicing iterations, which is also the size of the output dimension C.\n num_groups: The number of batch groups.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "max_disp", "type": "DefaultValuedAttr" }, { "name": "num_groups", "type": "DefaultValuedAttr" } ] }, { "name": "top.Cos", "summary": "Cos operator", "description": "1.Op Introduction\n Calculates the Cos of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = cos(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Cosh", "summary": "Cosh operator", "description": "1.Op Introduction\n Calculates the Cosh of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = cosh(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Csc", "summary": "Color space convert for model's inputs", "description": "1.Op Introduction\n Performs csc operation on inputs.\n\n 2.Math formula\n ```math\n output = Csc(input, pixel_format, y_align, w_align, channel_align)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n pixel_format: required, pixel format type.;\n y_align: width alignment of channel y.;\n w_align: width alignment of channel uv.;\n channel_align: alignment of channel.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "pixel_format", "type": "StrAttr" }, { "name": "aligned", "type": "BoolAttr" }, { "name": "y_align", "type": "I64Attr" }, { "name": "w_align", "type": "I64Attr" }, { "name": "channel_align", "type": "I64Attr" } ] }, { "name": "top.CumSum", "summary": "CumSum operator", "description": "1.Op Introduction\n Returns the cumulative sum of elements of input in the dimension dim.\n\n 2.Math formula\n ```math\n output[i] = \\sum{j=0, i}input[j]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n dim(w.): If set to 0, computed across rows, If set to 1, computed across columns.;\n\n 4.attributes\n axis: the dimension of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "dim", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ] }, { "name": "top.Custom", "summary": "Custom operator", "description": "1.Op Introduction\n Custom operator\n\n 2.Math formula\n ```math\n output = CustomFunction(inputs, name, params)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n name: the name of the custom operation to be executed.;\n params: A dictionary of parameters.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "params", "type": "TypedArrayAttrBase" } ] }, { "name": "top.Deconv", "summary": "Deconvolution operator", "description": "1.Op Introduction\n Perform Deconvolution operation.\n\n 2.Math formula\n The height and width of the output tensor can be calculated using the following formulas:\n ```math\n H_{out} = H_{in - 1} x stride[0] - 2 x pads[0] + H_k + output_padding[0]\n W_{out} = W_{in - 1} x stride[1] - 2 x pads[1] + W_k + output_padding[1]\n ```\n The output tensor is computed as:\n ```math\n output(N, C_out, H_out, W_out) = \\sum(c_in) {\\sum(h_k) {\\sum(w_k){input(n, c_in, h_in, w_in) x filter(c_out, c_in, h_k, w_k)}}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array. ;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n group: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n dilations: controls the spacing between the kernel points;\n output_padding: The value can be provided as a single integer or a tuple, allowing for different padding values for height and width.;\n dynweight_reorderd: whether the weights (filters) should be reordered dynamically.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "filter", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "output_padding", "type": "OptionalAttr>" }, { "name": "dynweight_reorderd", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.DeformConv2D", "summary": "Deformable Convolution Operator", "description": "1.Op Introduction\n In the simplest case, the output value of the layer with input size\n $$(N, C_{\\text{in}}, H, W)$$ and output $$(N, C_{\\text{out}}, H_{\\text{out}}, W_{\\text{out}})$$\n can be precisely described as:\n\n 2.Math formula\n - Input: $$(N, C_{in}, H_{in}, W_{in})$$\n - Output: $$(N, C_{out}, H_{out}, W_{out})$$ where\n weight (Tensor): the learnable weights of the module of shape\n $$(\\text{out\\_channels}, \\frac{\\text{in\\_channels}}{\\text{groups}},\n \\text{kernel\\_size[0]}, \\text{kernel\\_size[1]})$$\n\n offset (Tensor): the learnable offsets of the module of shape\n $$(\\text{N}, \\times{\\text{2}}{\\text{offset\\_groups}{\\text{kernel\\_size[0]}}{\\text{kernel\\_size[1]}}},\n \\text{H_{\\text{out}}}, \\text{W_{\\text{out}}})$$\n\n mask (Tensor): the learnable masks of the module of shape\n $$(\\text{N}, \\times{\\text{offset\\_groups}{\\text{kernel\\_size[0]}}{\\text{kernel\\_size[1]}}},\n \\text{H_{\\text{out}}}, \\text{W_{\\text{out}}})$$\n\n bias (Tensor optional): the learnable bias of the module of shape (out_channels).\n\n ```math\n H_{out} = \\left\\lfloor\\frac{H_{in} + \\text{padding}[0] + \\text{padding}[2] - \\text{dilation}[0]\n \\times (\\text{kernel\\_size}[0] - 1) - 1}{\\text{stride}[0]} + 1\\right\\rfloor\n ```\n ```math\n W_{out} = \\left\\lfloor\\frac{W_{in} + \\text{padding}[1] + \\text{padding}[3] - \\text{dilation}[1]\n \\times (\\text{kernel\\_size}[1] - 1) - 1}{\\text{stride}[1]} + 1\\right\\rfloor\n ```\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n offset(w.): the learnable offsets of the module of shape.;\n mask(w.): the learnable masks of the module of shape.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n group: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n deform_group: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n use_mask: whether use mask for input tensor.;\n dilations: controls the spacing between the kernel points;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "filter", "type": "AnyTensor" }, { "name": "offset", "type": "AnyTensor" }, { "name": "mask", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "deform_group", "type": "DefaultValuedAttr" }, { "name": "use_mask", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.DepackRaw", "summary": "Postprocess for raw image.", "description": "1.Op Introduction\n postprocess raw image from 4 channels to mixed pixel pattern,\n remove padding first if padded before,\n then for each channel depack to 2 * 2 image block.\n\n 2.Math formula\n ```math\n output = Depack(RemovePadding(input, padding_h, padding_w), channel_order)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n padding_h: The height of the padding.;\n padding_w: The width of the padding.;\n white_level: The maximum intensity value for white in the image data.;\n black_level: The minimum intensity value for black in the image data.;\n channel_order: The order of color channels in the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "padding_h", "type": "I64Attr" }, { "name": "padding_w", "type": "I64Attr" }, { "name": "white_level", "type": "F64Attr" }, { "name": "black_level", "type": "F64Attr" }, { "name": "channel_order", "type": "TypedArrayAttrBase" } ] }, { "name": "top.Depth2Space", "summary": "Depth2Space operator", "description": "1.Op Introduction\n Refer to `https://github.com/onnx/onnx/blob/main/docs/Operators.md#depthtospace`\n [n, c, h, w] => [n, c / (block_h * block_w), h * block_h, w * block_w];\n if inversed, [n, c, h, w] => [n, c * block_h * block_w, h / block_h, w / block_w];\n if DCR(depth-column-row), channel ordered by block_h * block_w * c;\n else CRD(column-row-depth), channel ordered by c * block_h * block_w;\n The format of input or output is NCHW or NHWC.\n\n 2.Math formula\n\n (1)Standard Transformation:\n Given an input tensor of shape ( (N, C, H, W) ):\n The output tensor after applying the Depth2Space operation can be calculated as:\n ```math\n {output}(N_i, C_j', H_k, W_l) = input(N_i, C_j, k / block_h, l / block_w)\n ```\n where k / block_h and l / block_w are rounded down.\n\n (2)Inverse Transformation:\n Given an input tensor of shape ( (N, C, H, W) ):\n The output tensor after applying the Depth2Space operation can be calculated as:\n ```math\n {output}(N_i, C_j, H_k, W_l) = input(N_i, C_j', (k x block_h + j / (C / (block_h x block_w))), (l x block_w + j % (C / (block_h x block_w))))\n ```\n where C / (block_h x block_w) is rounded down.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n block_h: The height of the blocks used to rearrange the depth into spatial dimensions.;\n block_w: The width of the blocks used to rearrange the depth into spatial dimensions.;\n is_CRD: whether the channel ordering is in Column-Row-Depth format.;\n is_inversed: whether the channel ordering is in Column-Row-Depth format.;\n in_is_NCHW: whether the input tensor is in NCHW format.;\n out_is_NCHW: whether the output tensor should be in NCHW format.;\n swap_cr: swaps the height and width dimensions in the output tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "block_h", "type": "I64Attr" }, { "name": "block_w", "type": "I64Attr" }, { "name": "is_CRD", "type": "BoolAttr" }, { "name": "is_inversed", "type": "BoolAttr" }, { "name": "in_is_NCHW", "type": "DefaultValuedAttr" }, { "name": "out_is_NCHW", "type": "DefaultValuedAttr" }, { "name": "swap_cr", "type": "DefaultValuedAttr" } ] }, { "name": "top.DequantInt", "summary": "dequant operation", "description": "1.Op Introduction\n Dequant 8 bit data to 32/16 bit data.\n\n 2.Math formula\n 32/16bit(output) = DequantIntOp((8bit(input), shift) x multiplier) ≪ lshift;\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n shift: a shift value applied to the quantized data before scaling.;\n lshift: a left shift operation applied to the dequantized data after scaling.;\n quant_mode: the mode or method used for quantization during the requantization operation.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "multiplier", "type": "TypedArrayAttrBase" }, { "name": "shift", "type": "TypedArrayAttrBase" }, { "name": "lshift", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "DequantModeAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.DequantizeLinear", "summary": "Linear dequantize operation", "description": "1.Op Introduction\n DequantizeLinear(x) := (x - x_zero_point) * x_scale\n\n 2.Math formula\n ```math\n output = (input - x_zero_point) * x_scale\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n x_scale: convert the quantized values back original;\n x_zero_point: adjust the zero point of quantized values, represents4 that corresponds to the original value of zero.;\n axis: the dimension of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "x_scale", "type": "TypedArrayAttrBase" }, { "name": "x_zero_point", "type": "TypedArrayAttrBase" }, { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "top.DetectionOutput", "summary": "DetectionOutput operation", "description": "1.Op Introduction\n takes the predicted bounding boxes, class scores, and other relevant information to produce the final detection results.\n\n 2.Math formula\n ```math\n 1.Raw Detection Output\n raw_output = {(b_i, c_i) | i = 1, 2,...,N}\n b_i is the bounding box coordinates, c_i is the i-th confidence score.\n 2.Apply Confidence threshold\n filtered_output = {(b_i, c_i) | c_i >= confidence_threshold}\n 3.Non-Maximum Suppression(NMS)\n nms_output = NMS(filtered_output, nms_threshold)\n 4.Top K detections\n output = top_k(nms_output, top_k)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n\n 4.attributes\n num_classes: total number of classes, including the background class.;\n background_label_id: background class, differentiate between detected objects and the background.;\n nms_threshold: The threshold used for Non-Maximum Suppression (NMS).;\n top_k: The maximum number of predictions to be considered for each image.;\n code_type: the encoding type for the bounding box coordinates.;\n keep_top_k: The number of top scoring detections to keep after applying NMS.;\n confidence_threshold: The minimum confidence score required for a detection to be considered valid.;\n share_location: whether the bounding box locations are shared across different classes.;\n variance_encoded_in_target: whether the variance for bounding box predictions is encoded in the target.;\n eta: adjusts the confidence scores during NMS.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "num_classes", "type": "I64Attr" }, { "name": "background_label_id", "type": "DefaultValuedAttr" }, { "name": "nms_threshold", "type": "F64Attr" }, { "name": "top_k", "type": "I64Attr" }, { "name": "code_type", "type": "DetectionOutputCodeTypeAttr" }, { "name": "keep_top_k", "type": "I64Attr" }, { "name": "confidence_threshold", "type": "F64Attr" }, { "name": "share_location", "type": "DefaultValuedAttr" }, { "name": "variance_encoded_in_target", "type": "DefaultValuedAttr" }, { "name": "eta", "type": "DefaultValuedAttr" } ] }, { "name": "top.Div", "summary": "Div operator", "description": "1.Op Introduction\n Performs element-wise binary division.\n\n 2.Math formula\n ```math\n output[i] = \\frac{inputs[i]}{divisor}\n if is_reverse == True;\n output[i] = \\frac{divisor}{inputs[i]}\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n is_reverse: whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.DivConst", "summary": "Div Const operator", "description": "1.Op Introduction\n The DivConst operator is designed to perform element-wise division of an input tensor by a constant value.\n\n 2.Math formula\n ```math\n output = input/const_val or const_val/input\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n is_reverse: whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.DtypeCast", "summary": "Cast F32 to F16", "description": "1.Op Introduction\n Cast F32 to F16\n\n 2.Math formula\n FLOAT16(output) = DtypeCastOp (FLOAT32(input));\n\n 3.activation\n input(act.): input tensor;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Einsum", "summary": "Einsum operator", "description": "1.Op Introduction\n # https://pytorch.org/docs/1.13/generated/torch.einsum.html?highlight=einsum#torch.einsum\n The Einsum operator implements Einstein summation notation, which provides a concise way to specify tensor operations.\n\n 2.Math formula\n ```math\n \\mathrm{Output}=\\sum_{i\\in I}A_iB_j\\ldots\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n mode: determines how the input tensors will be combined based on the specified subscripts. ;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "EinsumModeAttr" } ] }, { "name": "top.Elu", "summary": "Elu operation", "description": "1.Op Introduction\n Elu takes input data (Tensor) and an argument alpha,\n and produces one output data (Tensor)\n where the function f(x) = alpha * (e^x - 1) for x <= 0, f(x) = x for x > 0,\n is applied to the data tensor elementwise.\n\n 2.Math formula\n ```math\n output[i] = alpha * (e ^ input - 1) if input[i] < 0 && input[i] == 0\n input[i]\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n alpha: scalar.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "alpha", "type": "F64Attr" } ] }, { "name": "top.EmbDenseBwd", "summary": "EmbDenseBwd operation for train", "description": "1.Op Introduction\n layer normalization\n\n 2.Math formula\n ```math\n output = grad_output[indices]\n ```\n\n 3.activation and weight\n grad_output(act.): the gradient of the loss with respect to the output.;\n indices(w.): the indices of the input tokens or items.;\n\n 4.attributes\n num_weights: the total number of embedding weights.;", "operands": [ { "name": "grad_output", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "num_weights", "type": "SI32Attr" } ] }, { "name": "top.Erf", "summary": "Erf operation", "description": "1.Op Introduction\n Computes the error function of the given input tensor element-wise.\n\n 2.Math formula\n ```math\n output = Erf(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Exp", "summary": "Exp operator", "description": "1.Op Introduction\n Calculates the exponent of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = exp(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Expand", "summary": "Expand operator", "description": "1.Op Introduction\n Broadcast the input tensor following the given shape and the broadcast rule.\n\n 2.Math formula\n ```math\n output[i1, i2, i3,...in] = input[j1, j2, j3,...jn]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n shape: An array of the target shape to which the input tensor will be expanded.;\n shapeT: An optional tensor that can be used to specify the shape dynamically.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "shapeT", "type": "Optional" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "shape", "type": "DefaultValuedAttr, {}>" } ] }, { "name": "top.FAttention", "summary": "Flash Attention operator", "description": "Performs a two dimensional matrix multiplication. This allows both inputs to\n be activations, rather than reserving weights as an attribute in the\n FULLY_CONNECTED operator. If mask_size is 0, means it's full mask; or it's a small mask with size [mask_size, mask_size]", "operands": [ { "name": "queries", "type": "AnyTensor" }, { "name": "keys", "type": "AnyTensor" }, { "name": "values", "type": "AnyTensor" }, { "name": "mask", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "F64Attr" }, { "name": "batch", "type": "I64Attr" }, { "name": "q_head", "type": "I64Attr" }, { "name": "kv_head", "type": "I64Attr" }, { "name": "dim", "type": "I64Attr" }, { "name": "mq", "type": "I64Attr" }, { "name": "mk", "type": "I64Attr" }, { "name": "keep_dims", "type": "DefaultValuedAttr" }, { "name": "mask_size", "type": "DefaultValuedAttr" } ] }, { "name": "top.Flatten", "summary": "Flatten operation", "description": "1.Op Introduction\n gen by torch aten::flatten or onnx, the flatten operation collapses the specified dimensions of the tensor into a single dimension,\n effectively reducing the number of dimensions of the tensor.\n\n 2.Math formula\n ```math\n output = FlattenOp(input, start_dim, end_dim)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n start_dim: the first dimension to flatten.;\n end_dim: the last dimension to flatten.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "start_dim", "type": "DefaultValuedAttr" }, { "name": "end_dim", "type": "DefaultValuedAttr" } ] }, { "name": "top.Floor", "summary": "Floor operation", "description": "1.Op Introduction\n the Floor function rounds down each element of the input tensor to the nearest integer less than or equal to that element.\n\n 2.Math formula\n ```math\n output = floor(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.Fp8MatMul", "summary": "fp8 matmul operator", "description": "The matrix multiplication designed for fp8.\n\n y_f16 = (x_fp8 x weight_fp8) * (scale_f16 * x_scale_f16)", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensor" }, { "name": "weight_scale", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "weight_transpose", "type": "DefaultValuedAttr" }, { "name": "block_size", "type": "DefaultValuedAttr" } ] }, { "name": "top.FrcnDetection", "summary": "Faster rcnn detection operator", "description": "1.Op Introduction\n outputs the detected classes and their corresponding bounding boxes,\n filtering results based on specified thresholds.\n\n 2.Math formula\n ```math\n output = FrcnDetection(inputs, class_num, obj_threshold, nms_threshold, keep_topk)\n ```\n 3.activation and weight\n inputs(act.): input tensor;\n\n 4.attributes\n class_num: detection class num.;\n obj_threshold: object threshold.;\n nms_threshold: nms threshold.;\n keep_topk: keep top k.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "class_num", "type": "I64Attr" }, { "name": "obj_threshold", "type": "F64Attr" }, { "name": "nms_threshold", "type": "F64Attr" }, { "name": "keep_topk", "type": "I64Attr" } ] }, { "name": "top.Gather", "summary": "Gather operator", "description": "1.Op Introduction\n Perform Gather operation on the given axis.\n\n 2.Math formula\n ```math\n output = input[indices]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n indices(w.): the indices of the elements to be gathered from the input tensor. ;\n\n 4.attributes\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n axis: the dimension of the input tensor.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" }, { "name": "is_lora", "type": "DefaultValuedAttr" } ] }, { "name": "top.GatherElements", "summary": "GatherElements operator", "description": "1.Op Introduction\n Perform GatherElements operation on the given axis.\n\n 2.Math formula\n ```math\n output[i_1, i_2, i_3,...i_k] = input[i_1, i_2, i_3,..., indices[i_k]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n indices(w.): the indices of the elements to be gathered from the input tensor. ;\n\n 4.attributes\n axis: the dimension of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "top.GatherND", "summary": "GatherND operator", "description": "1.Op Introduction\n This operator is the inverse of ScatterND.\n\n 2.Math formula\n ```math\n output_i = input[indices_i]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n indices(w.): which elements to gather from the input tensor.;\n\n 4.attributes\n indice_dims: the number of dimensions in the indices tensor.;\n batch_dims: the number of batch dimensions in the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "indice_dims", "type": "OptionalAttr" }, { "name": "batch_dims", "type": "DefaultValuedAttr" } ] }, { "name": "top.GELU", "summary": "GELU operator, 0.5x * (1.0 + tf.erf(x / tf.sqrt(2.0)))", "description": "1.Op Introduction\n An activation function based on Gaussian error function.;\n\n 2.Math formula\n ```math\n Y = 0.5*input * (1.0 + tf.erf(input / tf.sqrt(2.0)))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n approx_mode: include three mode.\n normal: This mode uses the exact mathematical form of the GELU function;\n tanh: This mode uses tanh to speed up computation;\n sigm: This mode uses sigmoid to speed up computation;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "approx_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.GridSampler", "summary": "GridSampler operation", "description": "1.Op Introduction\n Given an input and a flow-field grid, computes the output\n using input values and pixel locations from grid.\n\n 2.Math formula\n ```math\n output[N, C, H', W'] = input[C, grid[N, H', W', 1], grid[N, H', W', 0]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grid(w.): The flow-field grid tensor that defines the pixel locations for sampling.;\n\n 4.attributes\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n padding_mode: padding mode for outside grid values, Int attribute [0, 1, 2],\n representing 'zero' | 'boundary' | 'reflection't.;\n align_corners: whether to align the corners of the input and output tensors.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "grid", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "I64Attr" }, { "name": "padding_mode", "type": "I64Attr" }, { "name": "align_corners", "type": "BoolAttr" } ] }, { "name": "top.GroupNorm", "summary": "GroupNorm operation", "description": "1.Op Introduction\n group normalization\n\n 2.Math formula\n ```math\n mean_g = 1 / ((C / num_groups) * H * W) \\sum{i=1, C/num_groups} \\sum{j=1, H} \\sum{k=1, W} input_{n,c,j,k}\n var_g = 1 / ((C / num_groups) * H * W) \\sum{i=1, C/num_groups} \\sum{j=1, H} \\sum{k=1, W} (input_{n,c,j,k} - mean_g) ^ 2\n output_{n,c,j,k} = weight * (input_{n,c,j,k} - mean_g) / sqrt(var_g + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n num_groups: the number of groups to divide the input channels into for normalization.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "num_groups", "type": "I64Attr" }, { "name": "eps", "type": "F64Attr" } ] }, { "name": "top.GroupNormTrain", "summary": "GroupNorm operation", "description": "1.Op Introduction\n group normalization\n\n 2.Math formula\n ```math\n output = \\frac{input - mean}{\\sqrt{\\sigma^2 + eps}} \\cdot weight + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n num_groups: number of groups to divide the channels into for normalization.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "rstd", "type": "AnyTensor" } ], "attributes": [ { "name": "num_groups", "type": "I64Attr" }, { "name": "eps", "type": "F64Attr" } ] }, { "name": "top.GRU", "summary": "GRU operator", "description": "1.Op Introduction\n Perform RNN GRU operation.\n\n 2.Math formula\n ```math\n update gate(z_t):\n z_t = Sigma(W_z · x_t + U_z ·h_(t-1) + b_z)\n reset gate(r_t):\n r_t = Sigma(W_r · x_t + U_r ·h_(t-1) + b_r)\n Candidate Activation(h_t):\n h_t = tanh(W_h · x_t + r_t \\odot (U_h · h_(t-1)) + b_h)\n final output:\n output = (1 - z_t) \\odot h_(t-1) + z_t \\odot h_t\n ```\n where, x_t is the input at time step (t), h_(t-1) is the hidden state from the previous time step.\n W_z, W_r, W_h are the weight matrices for the input.\n U_z, U_r, U_h are the weight matrices for the hidden state.\n b_z, b_r, b_h are the bias vectors.\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n recurrence(w.): the previous hidden state influences the current hidden state.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n initial_h(w.): the initial hidden state, which can be provided to start the GRU computation.;\n\n 4.attributes\n hidden_size: the number of units in the GRU cell,;\n bidirectional: whether the GRU should be bidirectional;\n linear_before_reset: whether to apply a linear transformation to the input before applying the reset gate.;\n batch_first: the input and output tensors are provided in the shape (batch_size, seq_length, input_size).;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "filter", "type": "AnyTensor" }, { "name": "recurrence", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "initial_h", "type": "AnyTensorOrNone" } ], "results": [ { "name": "Y", "type": "AnyTensorOrNone" }, { "name": "Y_h", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "hidden_size", "type": "I64Attr" }, { "name": "bidirectional", "type": "BoolAttr" }, { "name": "linear_before_reset", "type": "DefaultValuedAttr" }, { "name": "batch_first", "type": "DefaultValuedAttr" } ] }, { "name": "top.HardSigmoid", "summary": "HardSigmoid operation", "description": "1.Op Introduction\n a piecewise linear function to the input tensor element-wise.\n hardsigmoid(x; alpha, beta) := min(max(alpha*x + beta, 0), 1).\n\n 2.Math formula\n ```math\n output[i] = min(max(alpha * input[i] + beta, 0), 1)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n alpha: scalar;\n beta: scalar;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "alpha", "type": "F64Attr" }, { "name": "beta", "type": "F64Attr" } ] }, { "name": "top.HardSwish", "summary": "HardSwish operation", "description": "1.Op Introduction\n hardswish(x) := x * hardsigmoid(x; 1/6, 0.5)\n\n 2.Math formula\n ```math\n output[i] = input[i] * min(max(1/6 * input[i] + 0.5, 0), 1)\n ```\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.If", "summary": "if operation", "description": "1.Op Introduction\n If conditional\n\n 2.Math formula\n ```math\n output = then_branch if cond is true\n else_branch if cond is false\n ```\n\n 3.activation and weight\n cond(act.): which branch of execution to follow.;", "operands": [ { "name": "cond", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "regions": [ { "name": "then_branch", "type": "SizedRegion<1>" }, { "name": "else_branch", "type": "SizedRegion<1>" } ] }, { "name": "top.IndexPut", "summary": "Index_put_ operation", "description": "1.Op Introduction\n update specific elements of an input tensor at given indices with new values.\n\n 2.Math formula\n ```math\n if accumulate\n input[indices] += values\n else\n input[indices] = values\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n indices(w.): the indices of the elements in the input tensor that should be updated.;\n values(w.): the new values that will replace the existing values in the input tensor at the specified indices.;\n\n 4.attributes\n accumulate: whether the operation should accumulate values at the specified indices or replace them.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" }, { "name": "values", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "accumulate", "type": "DefaultValuedAttr" } ] }, { "name": "top.Input", "summary": "Input operator", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "shape_tensor", "type": "OptionalAttr>" }, { "name": "do_preprocess", "type": "DefaultValuedAttr" }, { "name": "pixel_format", "type": "OptionalAttr" }, { "name": "channel_format", "type": "OptionalAttr" }, { "name": "resize_dims", "type": "OptionalAttr>" }, { "name": "keep_aspect_ratio", "type": "OptionalAttr" }, { "name": "keep_ratio_mode", "type": "OptionalAttr" }, { "name": "pad_value", "type": "OptionalAttr" }, { "name": "pad_type", "type": "OptionalAttr" }, { "name": "scale", "type": "OptionalAttr>" }, { "name": "mean", "type": "OptionalAttr>" }, { "name": "customization_format", "type": "OptionalAttr" }, { "name": "aligned", "type": "OptionalAttr" }, { "name": "yuv_type", "type": "OptionalAttr" } ] }, { "name": "top.Insert", "summary": "Insert the rhs tensor into input tensor at the specified axis and position.", "description": "1.Op Introduction\n insert the rhs tensor into input tensor at the specified axis and position.\n\n 2.Math formula\n ```math\n output = Insert(input, rhs, axis, offset)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n rhs(w.): the tensor to be inserted;\n axis: the axis along which to insert the rhs tensor.\n offset: the position at which the rhs tensor is inserted.", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "rhs", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "offset", "type": "I64Attr" } ] }, { "name": "top.InstanceNorm", "summary": "Instance Norm operation", "description": "1.Op Introduction\n instance normalization.\n\n 2.Math formula\n ```math\n output[i] = weight * (input[i] - mean) / sprt(var + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" } ] }, { "name": "top.Interp", "summary": "Interp operation", "description": "1.Op Introduction\n Perform linear upsample on input.\n\n 2.Math formula\n ```math\n H' = H x scale_h\n W' = W x scale_w\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n target_shape(w.): the desired shape of the output tensor after interpolation.;\n\n 4.attributes\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n coord_mode: whether the coordinates are normalized (ranging from 0 to 1) or absolute (based on pixel indices).;\n scale_h: the scaling factor for the height (number of rows) of the input tensor.;\n scale_w: the scaling factor for the width (number of columns) of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "target_shape", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "InterpModeAttr" }, { "name": "coord_mode", "type": "InterpCoordModeAttr" }, { "name": "scale_h", "type": "DefaultValuedAttr" }, { "name": "scale_w", "type": "DefaultValuedAttr" } ] }, { "name": "top.LayerNorm", "summary": "LayerNorm operation", "description": "1.Op Introduction\n layer normalization\n\n 2.Math formula\n ```math\n 1.Normalization\n mean = 1 / H \\sum{j=1, H} input[j]\n var = 1 / H \\sum{j=1, H} (input[j] - mean) ^ 2\n 2.Layer Normalized Output\n output[i] = weight * (input[i] - mean) / sprt(var + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n normalized_shape: the shape of the input tensor that will be normalized.;\n axis: the dimension of the input tensor.;\n eps: a small constant added to the denominator during normalization to prevent division by zero.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "normalized_shape", "type": "TypedArrayAttrBase" }, { "name": "axis", "type": "SI32Attr" }, { "name": "eps", "type": "F64Attr" } ] }, { "name": "top.LayerNormBwd", "summary": "LayerNorm operation for train", "description": "1.Op Introduction\n layer normalization\n\n 2.Math formula\n ```math\n 1.gradient input\n grad_input = 1 / N(weight / sqrt(variance + eps) 1 / N \\sum{i=1, N}grad_out)\n - (input - mean) / N * \\sum(i=1, N)weight * grad_out / sqrt(variance + eps)\n 2.gradient weight\n grad_weight = \\sum(i=1, N)grad_out * (input - mean) / sqrt(variance + eps)\n 3.gradient bias\n grad_bias = \\sum(i=1, N)grad_out\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grad_out(w.): the gradient of the loss with respect to the output of the layer normalization.;\n mean(w.): mean values to subtract from each channel for normalization.;\n variance(w.): adjust the predicted boxes during the training process.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n normalized_shape: the shape of the input tensor dimensions.;", "operands": [ { "name": "grad_out", "type": "AnyTensor" }, { "name": "input", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "variance", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "grad_input", "type": "AnyTensorOrNone" }, { "name": "grad_weight", "type": "AnyTensorOrNone" }, { "name": "grad_bias", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "normalized_shape", "type": "TypedArrayAttrBase" } ] }, { "name": "top.LayerNormTrain", "summary": "LayerNorm operation for train", "description": "1.Op Introduction\n layer normalization in train.\n\n 2.Math formula\n ```math\n 1.Normalization\n mean = 1 / H \\sum{j=1, H} input[j]\n var = 1 / H \\sum{j=1, H} (input[j] - mean) ^ 2\n 2.Layer Normalized Output\n output[i] = weight * (input[i] - mean) / sprt(var + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n normalized_shape: the shape of the input tensor dimensions.;\n axis: the dimension of the input tensor.;\n eps: a small constant added to the denominator during normalization to prevent division by zero.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "variance", "type": "AnyTensor" } ], "attributes": [ { "name": "normalized_shape", "type": "TypedArrayAttrBase" }, { "name": "axis", "type": "SI32Attr" }, { "name": "eps", "type": "F64Attr" } ] }, { "name": "top.LeakyRelu", "summary": "LeakyRelu operation", "description": "1.Op Introduction\n LeakyRelu takes input data (Tensor) and an argument alpha,\n and produces one output data (Tensor)\n where the function f(x) = alpha * x for x < 0, f(x) = x for x >= 0,\n is applied to the data tensor elementwise.\n\n 2.Math formula\n ```math\n output = alpha * input, if input < 0\n output = input, if input >= 0\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n alpha: a scalar factor.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "alpha", "type": "F64Attr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.List", "summary": "List operator", "description": "1.Op Introduction\n gen by torch prim::ListConstruct, y = [a, b]\n output shape is [1]\n\n 2.Math formula\n ```math\n output = [input1, input2, ..., inputN]\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Log", "summary": "Log operator", "description": "1.Op Introduction\n Calculates the natural log of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = ln(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.LogB", "summary": "LogB operator", "description": "1.Op Introduction\n Calculates the log of the given input tensor to the base B, element-wise.\n\n 2.Math formula\n ```math\n output = ln(input) / ln(B)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "base", "type": "I64Attr" } ] }, { "name": "top.LogicalAnd", "summary": "logical and operation", "description": "1.Op Introduction\n logical and operation between two variables\n\n 2.Math formula\n ```math\n output = input1 and input2\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Loop", "summary": "Loop operation", "description": "Generic Looping construct. This loop has multiple termination conditions:\n\n 1. Trip count. Iteration count specified at runtime. Set by\n specifying the input M. Optional. Set to empty string to omit.\n Note that a static trip count (specified at graph construction time) can be\n specified by passing in a constant node for input M.\n 2. Loop termination condition. This is an input to the op that determines\n whether to run the first iteration and also a loop-carried dependency for\n the body graph. The body graph must yield a value for the condition variable,\n whether this input is provided or not.\n\n This table summarizes the operating modes of this operator with equivalent\n C-style code:\n\n Operator inputs defined as (max_trip_count, condition_var).\n\n input (\\\"\\\", \\\"\\\"):\n for (int i=0; ; ++i) {\n cond = ... // Note this value is ignored, but is required in the body\n }\n\n input (\\\"\\\", cond) // Note this is analogous to a while loop\n bool cond = ...;\n for (int i=0; cond; ++i) {\n cond = ...;\n }\n\n input (\\\"\\\", 1) // Note this is analogous to a do-while loop\n bool cond = true\n for (int i=0; cond; ++i) {\n cond = ...;\n }\n\n input (trip_count, \\\"\\\") // Note this is analogous to a for loop\n int trip_count = ...\n for (int i=0; i < trip_count; ++i) {\n cond = ...; // ignored\n }\n\n input (trip_count, cond)\n int trip_count = ...;\n bool cond = ...;\n for (int i=0; i < trip_count && cond; ++i) {\n cond = ...;\n }\n\n\n *Sample usage - cond as well as trip count*\n\n graph predict-net {\n %a = Constant[value = ]()\n %b = Constant[value = ]()\n %keepgoing = Constant[value = ]()\n %max_trip_count = Constant[value = ]()\n %keepgoing_out, %b_out, %user_defined_vals = Loop[body = ](%max_trip_count, %keepgoing, %b)\n return\n }\n\n graph body-net (\n %i[INT32, scalar] // iteration number\n %keepgoing_in[BOOL, scalar] // incoming loop-termination-condition; not used\n %b_in[INT32, scalar] // incoming value of loop-carried-dependency b\n ) {\n %my_local = Add(%a, %b_in)\n %b_out = Sub(%a, %b_in) // outgoing value of loop-carried-dependency b\n %keepgoing_out = Greater(%my_local, %b_out) // outgoing loop-termination-condition\n %user_defined_val = Add(%b_in, %b_in) // scan-output value to be accumulated\n return %keepgoing_out, %b_out, %user_defined_val\n }\n\n *Sample equivalent C code*\n\n {\n /* User-defined code (enclosing scope) */\n int a = 3, b = 6;\n bool keepgoing = true; // Analogous to input cond\n /* End user-defined code */\n\n /* Implicitly-defined code */\n const int max_trip_count = 10; // Analogous to input M\n int user_defined_vals[]; // Imagine this is resizable\n /* End implicitly-defined code */\n /* initialize loop-carried variables and scan-output variables */\n bool keepgoing_out = keepgoing\n int b_out = b\n\n for (int i=0; i < max_trip_count && keepgoing_out; ++i) {\n /* Implicitly-defined code: bind actual parameter values\n to formal parameter variables of loop-body */\n bool keepgoing_in = keepgoing_out;\n bool b_in = b_out;\n\n /* User-defined code (loop body) */\n int my_local = a + b_in; // Reading value \\\"a\\\" from the enclosing scope is fine\n b_out = a - b_in;\n keepgoing_out = my_local > b_out;\n user_defined_val = b_in + b_in; // b_in and b_out are different variables\n /* End user-defined code */\n\n /* Implicitly defined-code */\n user_defined_vals[i] = user_defined_val // accumulate scan-output values\n }\n // int t = my_local; // Can't do this. my_local is not accessible here.\n\n // The values below are bound to the output variables of the loop and therefore accessible\n // b_out; user_defined_vals; keepgoing_out;\n }\n\n There are several things of note in this code snippet:\n\n 1. Values from the enclosing scope (i.e. variable \\\"a\\\" here) are in scope and can\n be referenced in the inputs of the loop.\n 2. Any values computed in the loop body that needs to be used in a subsequent\n iteration or after the loop are modelled using a pair of variables in the loop-body,\n consisting of an input variable (eg., b_in) and an output variable (eg., b_out).\n These are referred to as loop-carried dependences. The loop operation node\n supplies the input value of the input variable for the first iteration, and\n returns the output value of the output variable produced by the final\n iteration.\n 3. Scan_output variables are used to implicitly concatenate values computed across\n all the iterations. In the above example, the value of user_defined_val computed\n over all iterations are concatenated and returned as the value of user_defined_vals\n after the loop.\n 4. Values created in the body cannot be accessed in the enclosing scope,\n except using the mechanism described above.\n\n Note that the semantics of this op support \\\"diagonal\\\" or \\\"wavefront\\\" execution.\n (See Step 3 here for an example:\n https://devblogs.nvidia.com/optimizing-recurrent-neural-networks-cudnn-5/).\n Frontends should emit multi-layer RNNs as a series of While operators (with\n time being the inner looping dimension), with each successive layer consuming\n the scan_outputs from the previous layer, possibly going through several\n point-wise operators (e.g. dropout, residual connections, linear layer).\n\n The input/output of subgraph (produced by loop node) matching is based on order instead of name. The implementation will figure out the names based on this order.", "operands": [ { "name": "M", "type": "AnyTypeOf<[AnyTensor, NoneType]>" }, { "name": "cond", "type": "AnyTypeOf<[AnyTensor, NoneType]>" }, { "name": "v_initial", "type": "Variadic>" } ], "results": [ { "name": "v_final_and_scan_outputs", "type": "Variadic>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "top.LRN", "summary": "Local Response Normalization", "description": "1.Op Introduction\n It normalizes over local input regions. The local region is defined across the channels.\n\n 2.Math formula\n ```math\n output[i, j, k] = \\frac{input[i, j, k]}{(bias + \\alpha \\sum_{c=\\max(0,k-\\text{size})}^{\\min(N-1,k+\\text{size})} input[i, j, c]^2)^{\\beta}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n size: how many neighboring channels are considered during the normalization process.;\n alpha: a scaling factor;\n beta: a scaling factor;\n bias: A floating-point value added to the normalization denominator to prevent division by zero.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "size", "type": "I64Attr" }, { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "bias", "type": "DefaultValuedAttr" } ] }, { "name": "top.LSTM", "summary": "LSTM operator", "description": "1.Op Introduction\n Perform RNN LSTM operation.\n\n 2.Math formula\n ```math\n forget gate(f_t):\n f_t = Sigma(W_f · x_t + U_f · h_(t-1) + b_f)\n input gate(i_t):\n i_t = Sigma(W_i · x_t + U_i · h_(t-1) + b_i)\n Candidate cell state(C_t):\n C_t = tanh(W_C · x_t + U_C · h_(t-1) + b_C)\n cell state update(c_t):\n c_t = f_t \\odot c_(t-1) + i_t \\odot C_t\n output gate(o_t):\n o_t = Sigma(W_o · x_t + U_o · h_(t-1) + b_o)\n hidden state output(h_t):\n h_t = o_t \\odot tanh(c_t)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n recurrence(w.): the previous hidden state influences the current hidden state.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n initial_h(w.): the initial hidden state, which can be provided to start the LSTM computation.;\n initial_c(w.): the initial cell state, which can be provided to start the LSTM computation.;\n cont(w.): control weights or additional context that may be provided to influence the LSTM's behavior.;\n\n 4.attributes\n hidden_size: the number of units in the LSTM cell, ;\n bidirectional: A boolean indicating whether the LSTM should be bidirectional;\n batch_first: the input and output tensors are provided in the shape (batch_size, seq_length, input_size).;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "filter", "type": "AnyTensor" }, { "name": "recurrence", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "initial_h", "type": "AnyTensorOrNone" }, { "name": "initial_c", "type": "AnyTensorOrNone" }, { "name": "cont", "type": "AnyTensorOrNone" } ], "results": [ { "name": "Y", "type": "AnyTensorOrNone" }, { "name": "Y_h", "type": "AnyTensorOrNone" }, { "name": "Y_c", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "hidden_size", "type": "I64Attr" }, { "name": "bidirectional", "type": "BoolAttr" }, { "name": "batch_first", "type": "DefaultValuedAttr" } ] }, { "name": "top.Lut", "summary": "Lut operator", "description": "1.Op Introduction\n lookup table in index [0-255], y[i] = table(x[i])\n\n 2.Math formula\n ```math\n output[i] = table(input[i])\n ```\n 3.activation and weight\n input(act.): input tensor;\n table(w.): map input values to corresponding output values.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "table", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.MaskedFill", "summary": "MaskedFill operation", "description": "1.Op Introduction\n Return elements, either from X or Const, depending on condition.\n\n 2.Math formula\n ```math\n brn if inversed and cond=0\n output = brn + const_val if inversed and cond!=0\n brn + const_val if !inversed and cond!=0\n brn if !inversed and cond=0\n ```\n If inversed is true, the operation fills the elements of brn where cond is zero with const_val, while leaving other elements unchanged.\n If inversed is false, the operation fills the elements of brn where cond is non-zero with const_val, while leaving other elements unchanged.\n\n 3.activation and weight\n cond(act.): a tensor that serves as the condition for selecting elements from the true branch (tbrn) or the false branch (fbrn).;\n brn(w.): the input tensor from which elements will be selected based on the condition provided by the cond tensor.;\n\n 4.attributes\n inversed: whether the mask should be inverted.;\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;", "operands": [ { "name": "cond", "type": "AnyTensor" }, { "name": "brn", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "inversed", "type": "BoolAttr" }, { "name": "const_val", "type": "F64Attr" } ] }, { "name": "top.MaskRCNN_BboxPooler", "summary": "BBox_Pooler gen by PPL", "description": "1.Op Introduction\n MaskRCNN_BBox_Pooler, the 1st ROIAlign in MaskRCNN.\n\n 2.Math formula\n ```math\n output = ROIAlign(feature map, rois_multi_batch)\n ```\n\n 3.activation and weight\n ptr_feat0(act.): Pointer to the feature map at level 0.;\n ptr_feat1(act.): Pointer to the feature map at level 1.;\n ptr_feat2(act.): Pointer to the feature map at level 2.;\n ptr_feat3(act.): Pointer to the feature map at level 3.;\n rois_multi_batch(w.): ROIs (Regions of Interest) for multiple batches.;\n\n 4.attributes\n ROI_NUM_LEVELS: The number of levels in the ROI feature pyramid.;\n ROI_H: The height of the pooled ROI features.;\n ROI_W: The width of the pooled ROI features.;\n CHANNEL_ROI: The number of channels in the pooled ROI features.;\n ROI_SLICE: The number of slices or segments;\n ROI_PH: The height of the ROI in the feature map.;\n ROI_PW: The width of the ROI in the feature map.;\n ROI_LEN: The length of the ROIs being processed.;", "operands": [ { "name": "ptr_feat0", "type": "AnyTensor" }, { "name": "ptr_feat1", "type": "AnyTensor" }, { "name": "ptr_feat2", "type": "AnyTensor" }, { "name": "ptr_feat3", "type": "AnyTensor" }, { "name": "rois_multi_batch", "type": "AnyTensor" } ], "results": [ { "name": "result_res", "type": "AnyTensor" }, { "name": "result_rois", "type": "AnyTensor" } ], "attributes": [ { "name": "ROI_NUM_LEVELS", "type": "I64Attr" }, { "name": "ROI_H", "type": "I64Attr" }, { "name": "ROI_W", "type": "I64Attr" }, { "name": "CHANNEL_ROI", "type": "I64Attr" }, { "name": "ROI_SLICE", "type": "I64Attr" }, { "name": "ROI_PH", "type": "I64Attr" }, { "name": "ROI_PW", "type": "I64Attr" }, { "name": "ROI_LEN", "type": "I64Attr" } ] }, { "name": "top.MaskRCNN_GetBboxB", "summary": "MaskRCNN GetBboxB gen by PPL", "description": "1.Op Introduction\n Mask rcnn consist of three part: backbone to get proposals, bbox head to get bbox pred, mask_head to get mask pred, GetBboxB is final part in bbox head\n\n 2.Math formula\n ```math\n output = \\text{NMS}\\Bigl( \\text{Decode}\\Bigl( \\text{ptr\\_rois},\\, \\text{ptr\\_bbox},\\, \\text{max\\_val},\\, \\text{scale\\_factor},\\, \\text{delta2bbox\\_means},\\, \\text{delta2bbox\\_stds} \\Bigr),\\, \\text{ptr\\_score},\\, \\text{threshold\\_score\\_eq},\\, \\text{nms\\_iou\\_thr} \\Bigr)\n ```\n\n 3.activation and weight\n ptr_rois(act.): candidate regions of interest for possible objects.;\n ptr_bbox(act.): the bounding box predictions.;\n ptr_score(act.): confidence scores associated with each proposal.;\n max_val(w.): max scores the bbox predictions.;\n scale_factor(w.): scale the decoded bounding box coordinates.;\n\n 4.attributes\n threshold_score_eq: A threshold value used to filter out proposals with a low confidence score before applying NMS.;\n wh_ratio_log: A logarithmic scaling factor, adjust the width-to-height ratio during decoding of bounding boxes.;\n nms_iou_thr: IoU (Intersection over Union) threshold.;\n delta2bbox_means: Mean values used to decode the bounding box regression.;\n delta2bbox_stds_0: Standard deviation (first component) for scaling the decoded bbox values.;\n delta2bbox_stds_1: Standard deviation (second component) for scaling the decoded bbox values.;\n NUM_INDEXES: the number of indexes (or anchors).;\n NUM_CLASSES: The total number of object classes.;\n TOPK_ONNX_NMS: to select a fixed number of candidates.;\n NUM_CLASSES_getBboxB: Number of classes used in this bounding box decoding step.;\n MAX_NMS_LENGTH_GetBboxB: Maximum number of bounding box candidates.;\n MAX_PER_IMG: The maximum number of detections allowed per image.;\n MAX_PER_IMG_GetBboxB: maximum number of bounding boxes after the final processing.;", "operands": [ { "name": "ptr_rois", "type": "AnyTensor" }, { "name": "ptr_bbox", "type": "AnyTensor" }, { "name": "ptr_score", "type": "AnyTensor" }, { "name": "max_val", "type": "AnyTensor" }, { "name": "scale_factor", "type": "AnyTensor" } ], "results": [ { "name": "result_det_bboxes", "type": "AnyTensor" }, { "name": "result_det_labels", "type": "AnyTensor" } ], "attributes": [ { "name": "threshold_score_eq", "type": "F64Attr" }, { "name": "wh_ratio_log", "type": "F64Attr" }, { "name": "nms_iou_thr", "type": "F64Attr" }, { "name": "delta2bbox_means", "type": "F64Attr" }, { "name": "delta2bbox_stds_0", "type": "F64Attr" }, { "name": "delta2bbox_stds_1", "type": "F64Attr" }, { "name": "NUM_INDEXES", "type": "I64Attr" }, { "name": "NUM_CLASSES", "type": "I64Attr" }, { "name": "TOPK_ONNX_NMS", "type": "I64Attr" }, { "name": "NUM_CLASSES_getBboxB", "type": "I64Attr" }, { "name": "MAX_NMS_LENGTH_GetBboxB", "type": "I64Attr" }, { "name": "MAX_PER_IMG", "type": "I64Attr" }, { "name": "MAX_PER_IMG_GetBboxB", "type": "I64Attr" } ] }, { "name": "top.MaskRCNN_MaskPooler", "summary": "Mask_Pooler gen by PPL", "description": "1.Op Introduction\n MaskRCNN_Mask_Pooler, the 2st ROIAlign in MaskRCNN\n\n 2.Math formula\n ```math\n output = \\text{ROIAlign}\\Bigl( \\{x_i\\}_{i=0}^3, \\, \\text{det\\_bboxes\\_multi\\_batch}, \\, \\text{det\\_labels\\_multi\\_batch}, \\, \\text{scale\\_factor}, \\, ROI\\_NUM\\_LEVELS, \\, ROI\\_H, \\, ROI\\_W, \\, CHANNEL\\_ROI, \\, ROI\\_SLICE, \\, ROI\\_PH, \\, ROI\\_PW, \\, ROI\\_LEN \\Bigr)\n ```\n\n 3.activation and weight\n x_0(act.): first level of the feature pyramid.;\n x_1(act.): second level of the feature pyramid.;\n x_2(act.): third level of the feature pyramid.;\n x_3(act.): fourth level of the feature pyramid.;\n det_bboxes_multi_batch(act.): detected bounding boxes over multiple batches.;\n det_labels_multi_batch(act.): class labels associated with the detected bounding boxes across multiple batches.;\n scale_factor(w.): scale the decoded bounding box coordinates.;\n\n 4.attributes\n ROI_NUM_LEVELS: the number of feature levels (or pyramid levels) available for ROI pooling.;\n ROI_H: target height of the pooled region for each ROI.;\n ROI_W: target width of the pooled region for each ROI.;\n CHANNEL_ROI: number of channels to be kept or considered when performing ROIAlign.;\n ROI_SLICE: slicing strategy for ROIs, if the ROI needs to be segmented into sub-regions for finer pooling.;\n ROI_PH: Padding height for the ROI.;\n ROI_PW: Padding width for the ROI.;\n ROI_LEN: total length (or area) of the ROI.;", "operands": [ { "name": "x_0", "type": "AnyTensor" }, { "name": "x_1", "type": "AnyTensor" }, { "name": "x_2", "type": "AnyTensor" }, { "name": "x_3", "type": "AnyTensor" }, { "name": "det_bboxes_multi_batch", "type": "AnyTensor" }, { "name": "det_labels_multi_batch", "type": "AnyTensor" }, { "name": "scale_factor", "type": "AnyTensor" } ], "results": [ { "name": "result_res", "type": "AnyTensor" } ], "attributes": [ { "name": "ROI_NUM_LEVELS", "type": "I64Attr" }, { "name": "ROI_H", "type": "I64Attr" }, { "name": "ROI_W", "type": "I64Attr" }, { "name": "CHANNEL_ROI", "type": "I64Attr" }, { "name": "ROI_SLICE", "type": "I64Attr" }, { "name": "ROI_PH", "type": "I64Attr" }, { "name": "ROI_PW", "type": "I64Attr" }, { "name": "ROI_LEN", "type": "I64Attr" } ] }, { "name": "top.MaskRCNN_RPNGetBboxes", "summary": "RPN_get_bboxes gen by PPL", "description": "1.Op Introduction\n MaskRCNN_RPN_get_bboxes, the sub-block with 1st NMS between RPN_head and 1st ROIAlign.\n\n 2.Math formula\n ```math\n 1.Score Filtering\n valid_indices_i = cls_scores_i > conf_threshold (for each level i)\n 2.Bounding Box Adjustment\n adjusted_bboxes_i = anchors_i + bbox_preds_i * delta2bbox_std_i + delta2bbox_mean_i\n 3.IoU Calculation\n iou = calculate_iou(adjusted_bboxes_i, ground_truth_boxes)\n 4.NMS Application\n final_bboxes = nms(adjusted_bboxes_i[valid_indices_i], iou_threshold)\n 5.final output\n output = concatenate(final_bboxes)\n ```\n 3.activation and weight\n cls_scores_0: the class scores0 for each anchor;\n cls_scores_1: the class scores1 for each anchor;\n cls_scores_2: the class scores2 for each anchor;\n cls_scores_3: the class scores3 for each anchor;\n cls_scores_4: the class scores4 for each anchor;\n bbox_preds_0: the bounding box0 predictions;\n bbox_preds_1: the bounding box1 predictions;\n bbox_preds_2: the bounding box2 predictions;\n bbox_preds_3: the bounding box3 predictions;\n bbox_preds_4: the bounding box4 predictions;\n max_shape: the maximum dimensions of the output bounding boxes.;\n mlvl_anchors_0: the multi-level anchors0 used for generating bounding box proposals.;\n mlvl_anchors_1: the multi-level anchors1 used for generating bounding box proposals.;\n mlvl_anchors_2: the multi-level anchors2 used for generating bounding box proposals.;\n mlvl_anchors_3: the multi-level anchors3 used for generating bounding box proposals.;\n mlvl_anchors_4: the multi-level anchors4 used for generating bounding box proposals.;\n\n 4.attributes\n delta2bbox_mean_0: the means used to normalize the bounding box0 deltas for the corresponding feature levels.;\n delta2bbox_mean_1: the means used to normalize the bounding box1 deltas for the corresponding feature levels.;\n delta2bbox_mean_2: the means used to normalize the bounding box2 deltas for the corresponding feature levels.;\n delta2bbox_mean_3: the means used to normalize the bounding box3 deltas for the corresponding feature levels.;\n delta2bbox_std_0: the standard deviations used to normalize the bounding box0 deltas for the corresponding feature levels.;\n delta2bbox_std_1: the standard deviations used to normalize the bounding box1 deltas for the corresponding feature levels.;\n delta2bbox_std_2: the standard deviations used to normalize the bounding box2 deltas for the corresponding feature levels.;\n delta2bbox_std_3: the standard deviations used to normalize the bounding box3 deltas for the corresponding feature levels.;\n delta2bbox_max_scalar_c: a scalar value;\n iou_threshold: filtering out low-quality proposals during NMS.;\n conf_threshold: a confidence score threshold.;\n MAX_LENGTH_STATIC_STRECHED: the maximum length for the output list of bounding boxes after processing.;\n NUM_INDEXES: the number of indexes.;\n NUM_CLASSES: the number of classes.;\n CHANNEL_RPN_BBOXES: the number of channels for the bounding box predictions.;\n CHANNEL_RPN_SCORES: the number of channels used for the class score predictions.;\n NMS_PRE: the number of proposals to be considered before NMS.;\n HARDWARE_FACTOR_TOPK: how many top proposals to keep.;\n NMS_MAX_LENGTH: the maximum number of boxes after NMS.;\n TOPK_ONNX_NMS: the number of top proposals when using ONNX format for NMS.;\n H_RPN_DYN_MAX: the maximum height for the dynamic RPN output.;\n W_RPN_DYN_MAX: the maximum width for the dynamic RPN output.;\n MAX_PER_IMG: the maximum number of proposals to be generated per image.;", "operands": [ { "name": "cls_scores_0", "type": "AnyTensor" }, { "name": "cls_scores_1", "type": "AnyTensor" }, { "name": "cls_scores_2", "type": "AnyTensor" }, { "name": "cls_scores_3", "type": "AnyTensor" }, { "name": "cls_scores_4", "type": "AnyTensor" }, { "name": "bbox_preds_0", "type": "AnyTensor" }, { "name": "bbox_preds_1", "type": "AnyTensor" }, { "name": "bbox_preds_2", "type": "AnyTensor" }, { "name": "bbox_preds_3", "type": "AnyTensor" }, { "name": "bbox_preds_4", "type": "AnyTensor" }, { "name": "max_shape", "type": "AnyTensor" }, { "name": "mlvl_anchors_0", "type": "AnyTensor" }, { "name": "mlvl_anchors_1", "type": "AnyTensor" }, { "name": "mlvl_anchors_2", "type": "AnyTensor" }, { "name": "mlvl_anchors_3", "type": "AnyTensor" }, { "name": "mlvl_anchors_4", "type": "AnyTensor" } ], "results": [ { "name": "result_list", "type": "AnyTensor" } ], "attributes": [ { "name": "delta2bbox_mean_0", "type": "F64Attr" }, { "name": "delta2bbox_mean_1", "type": "F64Attr" }, { "name": "delta2bbox_mean_2", "type": "F64Attr" }, { "name": "delta2bbox_mean_3", "type": "F64Attr" }, { "name": "delta2bbox_std_0", "type": "F64Attr" }, { "name": "delta2bbox_std_1", "type": "F64Attr" }, { "name": "delta2bbox_std_2", "type": "F64Attr" }, { "name": "delta2bbox_std_3", "type": "F64Attr" }, { "name": "delta2bbox_max_scalar_c", "type": "F64Attr" }, { "name": "iou_threshold", "type": "F64Attr" }, { "name": "conf_threshold", "type": "F64Attr" }, { "name": "MAX_LENGTH_STATIC_STRECHED", "type": "I64Attr" }, { "name": "NUM_INDEXES", "type": "I64Attr" }, { "name": "NUM_CLASSES", "type": "I64Attr" }, { "name": "CHANNEL_RPN_BBOXES", "type": "I64Attr" }, { "name": "CHANNEL_RPN_SCORES", "type": "I64Attr" }, { "name": "NMS_PRE", "type": "I64Attr" }, { "name": "HARDWARE_FACTOR_TOPK", "type": "I64Attr" }, { "name": "NMS_MAX_LENGTH", "type": "I64Attr" }, { "name": "TOPK_ONNX_NMS", "type": "I64Attr" }, { "name": "H_RPN_DYN_MAX", "type": "I64Attr" }, { "name": "W_RPN_DYN_MAX", "type": "I64Attr" }, { "name": "MAX_PER_IMG", "type": "I64Attr" } ] }, { "name": "top.MatchTemplate", "summary": "opencv MatchTemplate operator", "description": "1.Op Introduction\n Perform opencv MatchTemplate operation.\n\n 2.Math formula\n ```math\n R(x, y) = \\sum_{i=0}^{T_w-1} \\sum_{j=0}^{T_h-1} I(x+i, y+j) \\cdot T(i, j)\n ```\n where:\n R(x, y) is the result of the match at position(x, y).\n I is the input image.\n T is the template image.\n T_w and T_h are the width and height of the template.\n\n 3.activation and weight\n input(act.): input tensor.;\n match(w.): the template image that will be matched against the input image.;\n\n 4.attributes\n mode: the method of template matching to be used (e.g., correlation, squared difference, etc.).;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "match", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "MatchTemplateModeAttr" } ] }, { "name": "top.MatMul", "summary": "matmul operator", "description": "1.Op Introduction\n The MatMul operator performs two-dimensional matrix multiplication between two input tensors.\n\n 2.Math formula\n ```math\n output = input x right + bias\n ```\n\n 3.activation and weight\n input(act.): the first input tensor;\n right(act.): the second input tensor;\n bias(w.): an optional tensor can be added to the result of the matrix multiplication. ;\n\n 4.attributes\n right_transpose: whether to transpose the right input tensor before performing the multiplication.;\n left_transpose: whether to transpose the input tensor before performing the multiplication.;\n output_transpose: whether to transpose the output tensor after the multiplication.;\n hdim_is_batch: whether the first dimension of the input tensor represents the batch size.;\n keep_dims: whether to keep the dimensions of the output tensor the same as the input tensors.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n weight_bits: the bit-width for quantizing the weights.;\n in_int4_scale: the scaling factor for input tensors that are quantized to 4 bits.;\n in_int4_zp: the zero point for input tensors that are quantized to 4 bits.;\n out_int8_scale:the scaling factor for the output tensor when quantized to 8 bits.;\n out_int8_zp: This optional attribute specifies the zero point for the output tensor that is quantized to 8 bits.;\n dq_type: the quantized data type for dynamic quantization.;\n q_group_size: the group size for per-group quantization.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "right", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "right_transpose", "type": "DefaultValuedAttr" }, { "name": "left_transpose", "type": "DefaultValuedAttr" }, { "name": "output_transpose", "type": "DefaultValuedAttr" }, { "name": "hdim_is_batch", "type": "DefaultValuedAttr" }, { "name": "keep_dims", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_lora", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "OptionalAttr" }, { "name": "in_int4_scale", "type": "OptionalAttr" }, { "name": "in_int4_zp", "type": "OptionalAttr" }, { "name": "out_int8_scale", "type": "OptionalAttr" }, { "name": "out_int8_zp", "type": "OptionalAttr" }, { "name": "dq_type", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" } ] }, { "name": "top.Max", "summary": "max operator", "description": "1.Op Introduction\n Element-wise max of each of the input tensors. All inputs and outputs must have the same data type.\n\n 2.Math formula\n ```math\n output = max(input1,input2, ..., inputN)\n ```\n Where input1, input2, ..., inputN are the input tensors.\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.MaxConst", "summary": "Max Const operator", "description": "1.Op Introduction\n max of one input and one const.\n\n 2.Math formula\n ```math\n output = Max(input, const_val)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.MaxPool", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n {output}(N_i, C_j, p, q) = pool(input(N_i, C_j, start_h, start_w), kernel_size)\n ```\n start_h and start_w are the starting indices for the pooling window in the height and width dimensions.\n pool can be any pooling function (max pooling, average pooling) applied over the region defined by the kernel size.\n N is a batch size, C denotes a number of channels,\n Shape:\n - Input: (N, C_{in}, H_{in}, W_{in})\n - Output: (N, C_{out}, H_{out}, W_{out})\n ```math\n H_{output} = {H_{in} + {padding}[0] + {padding}[2] - {kernel_shape}[0]} / {stride}[0] + 1\n ```\n ```math\n W_{output} = {W_{in} + {padding}[1] + {padding}[3] - {kernel_shape}[1]} / {stride}[1] + 1\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n auto_pad: It can be set to different modes (e.g., SAME, VALID) to automatically calculate the necessary padding based on\n the input size,kernel size, and stride.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "ceil_mode", "type": "OptionalAttr" }, { "name": "auto_pad", "type": "OptionalAttr" }, { "name": "is_adaptive", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.MaxPoolingIndicesBwd", "summary": "MaxPoolingIndicesBwd operator", "description": "1.Op Introduction\n MaxPoolingIndicesBwd operator\n\n 2.Math formula\n ```math\n output = grad_output[indices]\n ```\n\n 3.activation and weight\n grad_output(act.): the gradient of the loss with respect to the output.;\n indices(w.): the indices of the input tokens or items.;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n dilations: controls the spacing between the kernel points;\n input_shape: The shape of the input tensor.;", "operands": [ { "name": "grad_output", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "grad_input", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "input_shape", "type": "TypedArrayAttrBase" } ] }, { "name": "top.MaxPoolWithMask", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n {output}(N_i, C_j, p, q) = pool(input(N_i, C_j, start_h, start_w), kernel_size)\n ```\n start_h and start_w are the starting indices for the pooling window in the height and width dimensions.\n pool can be any pooling function (max pooling, average pooling) applied over the region defined by the kernel size.\n N is a batch size, C denotes a number of channels,\n Shape:\n - Input: (N, C_{in}, H_{in}, W_{in})\n - Output: (N, C_{out}, H_{out}, W_{out})\n ```math\n H_{output} = {H_{in} + {padding}[0] + {padding}[2] - {kernel_shape}[0]} / {stride}[0] + 1\n ```\n ```math\n W_{output} = {W_{in} + {padding}[1] + {padding}[3] - {kernel_shape}[1]} / {stride}[1] + 1\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n auto_pad: It can be set to different modes (e.g., SAME, VALID) to automatically calculate the necessary padding based on\n the input size,kernel size, and stride.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "mask", "type": "AnyTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "ceil_mode", "type": "OptionalAttr" }, { "name": "auto_pad", "type": "OptionalAttr" }, { "name": "is_adaptive", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.MaxUnpool", "summary": "MaxUnpool operation", "description": "1.Op Introduction\n Perform MaxUnpool on input.\n\n 2.Math formula\n ```math\n output[i, j] = Upsample(input[i / scale_h, j / scale_w])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n mask(act.): the positions of the maximum values that were retained during the max pooling operation.;\n\n 4.attributes\n scale_h: the scaling factor for the height (number of rows) of the input tensor.;\n scale_w: the scaling factor for the width (number of columns) of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "mask", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale_h", "type": "I64Attr" }, { "name": "scale_w", "type": "I64Attr" } ] }, { "name": "top.MeanRstd", "summary": "Compute Mean, Rstd, Running_mean, Running_var in batchnorm train op", "description": "1.Op Introduction\n computes the mean, reverse standard deviation (Rstd), running mean, and running variance.\n\n 2.Math formula\n ```math\n mean(x),1/sqrt(var+eps),(1-momentum)*running_mean + momentum*mean,(1-momentum)*running_var + momentum*var\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n running_mean(w.): mean during running.;\n running_var(w.): variances during running.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n momentum: hyperparameter;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "running_mean", "type": "AnyTensor" }, { "name": "running_var", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensor" } ], "results": [ { "name": "mean", "type": "AnyTensor" }, { "name": "rstd", "type": "AnyTensor" }, { "name": "running_mean_update", "type": "AnyTensor" }, { "name": "running_var_update", "type": "AnyTensor" }, { "name": "scale", "type": "AnyTensor" }, { "name": "bias_new", "type": "AnyTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" }, { "name": "momentum", "type": "F64Attr" } ] }, { "name": "top.MeanStdScale", "summary": "MeanStdScale, it's for preprocess.", "description": "1.Op Introduction\n for preprocess, do multiplier&rshift quantize.\n\n 2.Math formula\n ```math\n output = (input - mean) / std * scale + zero_points\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n quant_mode: the mode or method used for quantization during the requantization operation.;\n customization_format: custom format for the input data.;\n channel_order: The order of color channels in the input tensor.;\n scale: each channel scale.;\n mean: mean values to subtract from each channel for normalization.;\n sign: if output is signed.;\n std: standard deviation values for each channel.;\n zero_points: zero point values for each channel.;\n resize_dims: resize the input tensor' dimensions.;\n rounding_mode: The rounding method to use during quantization.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "quant_mode", "type": "StrAttr" }, { "name": "customization_format", "type": "StrAttr" }, { "name": "channel_order", "type": "StrAttr" }, { "name": "sign", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "std", "type": "TypedArrayAttrBase" }, { "name": "mean", "type": "TypedArrayAttrBase" }, { "name": "zero_points", "type": "TypedArrayAttrBase" }, { "name": "resize_dims", "type": "TypedArrayAttrBase" }, { "name": "rounding_mode", "type": "StrAttr" } ] }, { "name": "top.MeshGrid", "summary": "MeshGrid operation", "description": "1.Op Introduction\n torch mesh grid operation\n\n 2.Math formula\n ```math\n X[i] = x[i mod m] for i = 0, 1, ..., m · n-1\n Y[i] = y[j // m] for j = 0, 1, ..., m · n-1\n ```\n where X, Y will have shape (m, n);\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n is_reverse: whether the subtraction operation is performed in reverse order.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "is_reverse", "type": "BoolAttr" } ] }, { "name": "top.Min", "summary": "min operator", "description": "1.Op Introduction\n Element-wise min of each of the input tensors. All inputs and outputs must have the same data type.\n\n 2.Math formula\n ```math\n output = min(input1,input2, ..., inputN)\n ```\n Where input1, input2, ..., inputN are the input tensors.\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.MinConst", "summary": "Min Const operator", "description": "1.Op Introduction\n min of one input and one const.\n\n 2.Math formula\n ```math\n output = Min(input, const_val)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.Mish", "summary": "Mish operator", "description": "1.Op Introduction\n Calculates the mish of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output[i] = input[i] x tanh(softplus(input[i]))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Mlp", "summary": "w8a16 / w4a16 / a16 mlp operator", "description": "to do", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight_gate", "type": "AnyTensor" }, { "name": "weight_up", "type": "AnyTensor" }, { "name": "weight_down", "type": "AnyTensor" }, { "name": "bias_gate", "type": "AnyTensorOrNone" }, { "name": "bias_up", "type": "AnyTensorOrNone" }, { "name": "bias_down", "type": "AnyTensorOrNone" }, { "name": "expert_id", "type": "AnyTensorOrNone" }, { "name": "scale_gate", "type": "AnyTensorOrNone" }, { "name": "scale_up", "type": "AnyTensorOrNone" }, { "name": "scale_down", "type": "AnyTensorOrNone" }, { "name": "zp_gate", "type": "AnyTensorOrNone" }, { "name": "zp_up", "type": "AnyTensorOrNone" }, { "name": "zp_down", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "right_transpose_gate", "type": "DefaultValuedAttr" }, { "name": "right_transpose_up", "type": "DefaultValuedAttr" }, { "name": "right_transpose_down", "type": "DefaultValuedAttr" }, { "name": "is_expert", "type": "DefaultValuedAttr" }, { "name": "quantized", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "DefaultValuedAttr" }, { "name": "num_expert", "type": "DefaultValuedAttr" }, { "name": "num_expert_per_tok", "type": "DefaultValuedAttr" } ] }, { "name": "top.Mmap2Rgbmap", "summary": "isp mmap2rgbmap.", "description": "isp mmap2rgbmap.", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Mod", "summary": "Mod operator", "description": "1.Op Introduction\n a mathematical operation that calculates the remainder of the division of two numbers (or tensors) element-wise.\n\n 2.Math formula\n ```math\n f(x, y) = Mod(x, y)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Mul", "summary": "Mul operator", "description": "1.Op Introduction\n Elementwise multiplication of input1 and input2. input1 and input2 are tensors.\n\n 2.Math formula\n ```math\n output = ReLU((input1 * input2))\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.MulConst", "summary": "Mul Const operator", "description": "1.Op Introduction\n Elementwise mul of input1 and input2. Input2 is constant.\n\n 2.Math formula\n ```math\n output = input * const_val\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.Nms", "summary": "NMS operator", "description": "1.Op Introduction\n onnx nms\n used to eliminate redundant overlapping bounding boxes by selecting only the most relevant ones based on their confidence scores.\n\n 2.Math formula\n ```math\n IOU(a, b) = Area(a \\cap b) / Area(a \\cup b)\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor.;\n\n 4.attributes\n center_point_box: whether the bounding boxes are defined by their center points.;\n max_output_size: the maximum number of boxes to be output after NMS.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "center_point_box", "type": "I64Attr" }, { "name": "max_output_size", "type": "I64Attr" } ] }, { "name": "top.None", "summary": "none operator", "description": "A none Op to return a NoneType.", "results": [ { "name": "result", "type": "NoneType" } ] }, { "name": "top.NonZero", "summary": "NonZero operation", "description": "1.Op Introduction\n Returns the indices of the elements that are non-zero\n (in row-major order - by dimension).\n\n 2.Math formula\n ```math\n output = input[i1, i2, i3,...in] != 0\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n order: the order in which the non-zero indices should be returned.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "order", "type": "NonZeroOrderAttr" } ] }, { "name": "top.Normalize", "summary": "Normalize operator", "description": "1.Op Introduction\n Normalizes an array across batch and spatial dimensions.\n\n 2.Math formula\n ```math\n output = ((input - Mu) / (Sigma + Epsilon)) x scale\n ```\n where, Mu is the mean of the input values calculated across the specified dimensions.\n\n 3.activation and weight\n input(act.): input tensor;\n scale(w.): the scale weight tensor.;\n\n 4.attributes\n across_spatial: determines whether the normalization is performed across the spatial dimensions of the input tensor.;\n channel_shared: indicates whether the scaling weight tensor should be shared across channels.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "scale", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "across_spatial", "type": "DefaultValuedAttr" }, { "name": "channel_shared", "type": "DefaultValuedAttr" } ] }, { "name": "top.Pack", "summary": "Pack operator", "description": "1.Op Introduction\n Pack a list of tensors in the given dimension, All tensors must have the same shape.\n\n 2.Math formula\n output = Pack(input1, input2, input3; axis)\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n\n 4.attributes\n axis: It specifies the dimension along which the input tensors will be packed together.;\n values_count: It indicates the number of tensors being packed.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "values_count", "type": "I64Attr" } ] }, { "name": "top.Pad", "summary": "Pad operation", "description": "1.Op Introduction\n This operation pads a tensor according to the paddings you specify.\n paddings is an integer tensor with shape [2, n], where n is the rank of tensor.\n For each dimension D of input, paddings[0, D] indicates how many values to add\n before the contents of tensor in that dimension, and paddings[1, D] indicates\n how many values to add after the contents of tensor in that dimension.\n\n 2.Math formula\n ```math\n output = input(padding, val, mode)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n paddingsT(act.): the padding values for each dimension.;\n\n 4.attributes\n paddings: defines how much padding to add before and after the contents of the input tensor for each dimension. ;\n val: the value to be used for padding the input tensor. ;\n mode: the padding mode include constant(Pads with a constant value); reflect(Pads with a reflection of the tensor values); replicate(Pads by replicating the edge values of the tensor).;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "paddingsT", "type": "Optional" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "paddings", "type": "TypedArrayAttrBase" }, { "name": "val", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "PaddingModeAttr{default_|same|valid}" } ] }, { "name": "top.Permute", "summary": "Permute operator", "description": "1.Op Introduction\n Perform permute on input.\n\n 2.Math formula\n ```math\n output(...dim2, dim1, dim0) = PermuteOp(input(dim0, dim1, dim2...order))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n order: An array of integers specifying the permutation order of the input tensor's dimensions.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "order", "type": "TypedArrayAttrBase" } ] }, { "name": "top.PixelNorm", "summary": "PixelNorm operation", "description": "1.Op Introduction\n pixel normalization (normalize along c-axis)\n\n 2.Math formula\n ```math\n norm_{n, i, j} = sqrt(1 /C \\sum{c=1, C}input_{n, c, i, j} ^ 2) + eps\n output_{n, c, i, j} = weight * input_{n, c, i, j} / norm_{n, i, j} + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" } ] }, { "name": "top.PoolMask", "summary": "pool mask operator", "description": "1.Op Introduction\n pooling mask on input\n\n 2.Math formula\n ```math\n {output}(N_i, C_j, p, q) = scale x pool(input(N_i, C_j, start_h, start_w), kernel_size)\n ```\n start_h and start_w are the starting indices for the pooling window in the height and width dimensions.\n pool can be any pooling function (max pooling, average pooling) applied over the region defined by the kernel size.\n N is a batch size, C denotes a number of channels,\n Shape:\n - Input: (N, C_{in}, H_{in}, W_{in})\n - Output: (N, C_{out}, H_{out}, W_{out})\n ```math\n H_{output} = {H_{in} + {padding}[0] + {padding}[2] - {kernel_shape}[0]} / {stride}[0] + 1\n ```\n ```math\n W_{output} = {W_{in} + {padding}[1] + {padding}[3] - {kernel_shape}[1]} / {stride}[1] + 1\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: a scaling factor is applied to the output of the pooling operation, can adjust the intensity or magnitude of the output mask.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "I64Attr" } ] }, { "name": "top.Pow", "summary": "Pow operation", "description": "1.Op Introduction\n computes the element-wise power of an input tensor raised to a specified exponent.\n\n 2.Math formula\n ```math\n output = input ^ n\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n exponent: the power to which each element of the input tensor will be raised.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "exponent", "type": "F64Attr" } ] }, { "name": "top.Pow2", "summary": "Pow2 operation", "description": "1.Op Introduction\n computes the result of raising a constant value ( n ) to the power of each element in the input tensor.\n\n 2.Math formula\n ```math\n output = n ^ input\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" } ] }, { "name": "top.Pow3", "summary": "Pow3 operation", "description": "1.Op Introduction\n computes the element-wise power of two input tensors.\n\n 2.Math formula\n ```math\n output = input1 ^ input2\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.PRelu", "summary": "PRelu operator", "description": "1.Op Introduction\n Parametric Rectified Linear Unit is an activation function.\n\n 2.Math formula\n ```math\n f(x) = slope * x for x < 0\n f(x) = x for x >= 0\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n slope(w.): the activation function for negative input values.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "slope", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Preprocess", "summary": "FusePreprcess, it's just a placeholder op.", "description": "1.Op Introduction\n It may be divided to permute + slice + scale/scale_lut ops.\n\n 2.Math formula\n ```math\n output = Scale(Slice(Permute(input,channel_order), resize_dims), scale) - mean.\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n quant_mode: the mode or method used for quantization during the requantization operation.;\n customization_format: custom format for the input data.;\n channel_order: The order of color channels in the input tensor.;\n resize_dims: resize the input tensor' dimensions.;\n scale: each channel scale.;\n mean: mean values to subtract from each channel for normalization.;\n sign: if output is signed.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "quant_mode", "type": "StrAttr" }, { "name": "customization_format", "type": "StrAttr" }, { "name": "channel_order", "type": "StrAttr" }, { "name": "resize_dims", "type": "TypedArrayAttrBase" }, { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "mean", "type": "TypedArrayAttrBase" }, { "name": "sign", "type": "DefaultValuedAttr" } ] }, { "name": "top.PriorBox", "summary": "PriorBox operation", "description": "1.Op Introduction\n Intended for use with MultiBox detection method to generate prior.\n\n 2.Math formula\n ```math\n output[i] = input(x, y, w, h) i in [0, num_priors]\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n\n 4.attributes\n min_size: the minimum size of the prior boxes.;\n max_size: the maximum size of the prior boxes.;\n aspect_ratios: A list of aspect ratios for the generated prior boxes.;\n variance: adjust the predicted boxes during the training process.;\n clip: whether the prior boxes should be clipped to the image boundaries.;\n step_h: The vertical step size for generating prior boxes.;\n step_w: The horizontal step size for generating prior boxes.;\n img_h: The height of the input image.;\n img_w: The width of the input image.;\n offset: A value used to offset the prior boxes from their calculated positions.;\n num_priors: The number of prior boxes to be generated for each location in the feature map.;\n use_default_aspect_ratio: whether to use a default aspect ratio (1.0);", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "min_size", "type": "TypedArrayAttrBase" }, { "name": "max_size", "type": "TypedArrayAttrBase" }, { "name": "aspect_ratios", "type": "TypedArrayAttrBase" }, { "name": "variance", "type": "TypedArrayAttrBase" }, { "name": "clip", "type": "DefaultValuedAttr" }, { "name": "step_h", "type": "F64Attr" }, { "name": "step_w", "type": "F64Attr" }, { "name": "img_h", "type": "I64Attr" }, { "name": "img_w", "type": "I64Attr" }, { "name": "offset", "type": "DefaultValuedAttr" }, { "name": "num_priors", "type": "I64Attr" }, { "name": "use_default_aspect_ratio", "type": "DefaultValuedAttr" } ] }, { "name": "top.Proposal", "summary": "Proposal operator", "description": "1.Op Introduction\n generate candidate bounding boxes primarily in object detection tasks.\n\n 2.Math formula\n ```math\n 1.anchor box generation and regression\n a_i = (x + \\delta(x), y + \\delta(y), w * e ^ \\delta(w), e ^ \\delta(h))\n 2.obj score\n s_i = sigmoid(output_ModelPredict(a_i))\n 3.Final select output\n output = NMS(s_i)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n net_input_h: net input height.;\n net_input_w: net input width.;\n feat_stride: anchor box stride size.;\n anchor_base_size: anchor box base size.;\n rpn_obj_threshold: obj threshold.;\n rpn_nms_threshold: nms threshold for generate proposal boxes.;\n rpn_nms_post_top_n: keep num boxes after nms.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "net_input_h", "type": "I64Attr" }, { "name": "net_input_w", "type": "I64Attr" }, { "name": "feat_stride", "type": "I64Attr" }, { "name": "anchor_base_size", "type": "I64Attr" }, { "name": "rpn_obj_threshold", "type": "F64Attr" }, { "name": "rpn_nms_threshold", "type": "F64Attr" }, { "name": "rpn_nms_post_top_n", "type": "I64Attr" } ] }, { "name": "top.QuantizeLinear", "summary": "Linear quantize operation", "description": "1.Op Introduction\n QuantizeLinear(x) := saturate ((x / y_scale) + y_zero_point)\n\n 2.Math formula\n ```math\n output[i] = saturate((input[i] / y_scale[j]) + y_zero_point[j])\n ```\n i indexes the elements of the input tensor, and j corresponds to the specific dimension or channel.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n y_scale: Each element to a specific output channel or dimension, determining how much to scale the input values.;\n y_zero_point: an array of zero points used in the quantization process.;\n axis: the dimension of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "y_scale", "type": "TypedArrayAttrBase" }, { "name": "y_zero_point", "type": "TypedArrayAttrBase" }, { "name": "axis", "type": "DefaultValuedAttr" } ] }, { "name": "top.RandnLike", "summary": "randn_like operator, y = randn_like(x)", "description": "1.Op Introduction\n create a tensor with the same shape as input, and fill with value from normal distribution\n\n 2.Math formula\n ```math\n output = randn(shape(input))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n randn_data(w.): the characteristics of the normal distribution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "randn_data", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Range", "summary": "Range operator", "description": "1.Op Introduction\n onnx range op.\n generates a sequence of evenly spaced values within a specified range.\n\n 2.Math formula\n ```math\n output = [x | x = start + n * delta, n is an integer, and start ≤ x < limit]\n ```\n\n 3.activation and weight\n start(act.): The starting value of the sequence. This can be a tensor or None. If None, it defaults to 0.;\n limit(w.): The exclusive upper limit of the sequence.;\n delta(w.): The increment between each value;", "operands": [ { "name": "start", "type": "AnyTensorOrNone" }, { "name": "limit", "type": "AnyTensor" }, { "name": "delta", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Reciprocal", "summary": "Constant scalar divide tensor operator", "description": "1.Op Introduction\n The Reciprocal operator is a tensor operation that performs division of a constant scalar value by an input tensor.\n\n 2.Math formula\n ```math\n output = const_val / input\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.RecurrentGatedDeltaRule", "summary": "Recurrent Gated Delta Rule operator", "description": "1.Op Introduction\n The RecurrentGatedDeltaRule operator implements a single-step recurrent gated delta rule\n attention mechanism, designed for efficient autoregressive inference with linear attention\n and recurrent state updates.\n\n 2.Math formula\n ```math\n scale = 1 / sqrt(k_head_dim)\n query = query * scale\n g_exp = exp(g)\n state = state * g_exp\n kv_mem = state^T @ key\n delta = (value - kv_mem) * beta\n state = state + key (outer) delta\n output = state^T @ query\n ```\n\n 3.activation and weight\n query(act.): query tensor with shape (B, 1, num_k_heads, k_head_dim).;\n key(act.): key tensor with shape (B, 1, num_k_heads, k_head_dim).;\n value(act.): value tensor with shape (B, 1, num_v_heads, v_head_dim).;\n g(act.): gating signal tensor with shape (B, 1, num_v_heads), controls the exponential decay rate.;\n beta(act.): scaling factor tensor with shape (B, 1, num_v_heads), modulates value contributions.;\n recurrent_state(act.): recurrent state tensor with shape (B, num_v_heads, k_head_dim, v_head_dim).;\n\n 4.attributes\n num_k_heads: number of key/query heads.;\n num_v_heads: number of value heads (must be a multiple of num_k_heads for GQA).;\n d: head dimension.;\n use_qk_l2norm: whether to apply L2 normalization to query and key.;\n scale: scaling factor applied to query.;", "operands": [ { "name": "query", "type": "AnyTensor" }, { "name": "key", "type": "AnyTensor" }, { "name": "value", "type": "AnyTensor" }, { "name": "g", "type": "AnyTensor" }, { "name": "beta", "type": "AnyTensor" }, { "name": "recurrent_state", "type": "AnyTensor" } ], "results": [ { "name": "attn_out", "type": "AnyTensor" } ], "attributes": [ { "name": "num_k_heads", "type": "I64Attr" }, { "name": "num_v_heads", "type": "I64Attr" }, { "name": "d", "type": "I64Attr" }, { "name": "use_qk_l2norm", "type": "BoolAttr" }, { "name": "scale", "type": "F64Attr" } ] }, { "name": "top.Reduce", "summary": "Reduce operation", "description": "1.Op Introduction\n Computes the mean/max/prod/sum of the input tensor's element along the provided axes.\n\n 2.Math formula\n ```math\n 1.Sum\n output[i_1, i_2, i_3,..., i_k] = \\sum{j in A}input[i_1, i_2,..., j, ..., i_n]\n where ( A ) is the set of axes to reduce.\n 2.Mean\n output[i_1, i_2, i_3,..., i_k] = 1 / count (\\sum{j in A}input[i_1, i_2,..., j, ..., i_n])\n where count is the number of elements being summed along the axes ( A ).\n 3.Max\n output[i_1, i_2, i_3,..., i_k] = max{j in A}input[i_1, i_2,..., j, ..., i_n]\n 4.Product\n output[i_1, i_2, i_3,..., i_k] = \\prod_{j=1}^m(input[i_1, i_2,..., i_k, j])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grid(w.): The flow-field grid tensor that defines the pixel locations for sampling.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" }, { "name": "keepdims", "type": "BoolAttr" }, { "name": "mode", "type": "ReduceModeAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.Relu", "summary": "Relu operator", "description": "1.Op Introduction\n ReLU with a scalar maximum value. if limit is zero, do not use upper limit.\n\n 2.Math formula\n ```math\n output = ReluOp(input) -> (0, 1)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.Remainder", "summary": "Remainder operator", "description": "1.Op Introduction\n computes the element-wise remainder of division between two tensors.\n\n 2.Math formula\n ```math\n quo = x / y;\n floor_quo = floor(quo);\n output = torch.remainder(x, y) = x - y * floor_quo.\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Repeat", "summary": "Repeat operator", "description": "1.Op Introduction\n Perform aten::repeat operation on the given tensor.\n\n 2.Math formula\n ```math\n output[i_1, i_2, i_3,...i_k] = input[i_1 / r_1, i_2 / r_2, i_3 / r_3,..., i_k mod r_k]\n ```\n where r_j represents the corresponding value from the repeats tensor for dimension ( j ).\n\n 3.activation and weight\n input(act.): input tensor.;\n repeats(w.): the number of times to repeat the input tensor along each dimension.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "repeats", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.RequantFp", "summary": "requant operation", "description": "1.Op Introduction\n Requant 32/16/8 bit data to int8 or uint8 data, by scale\n\n 2.Math formula\n int8/uint8/fp8(output) = round(float32/float16/float8(input) x scale + offset);\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: Scalar;\n offset: Scalar;\n quant_mode: the mode or method used for quantization during the requantization operation.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "offset", "type": "TypedArrayAttrBase" }, { "name": "quant_mode", "type": "RequantModeAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.RequantInt", "summary": "requant operation", "description": "1.Op Introduction\n Requant 32/16/8 bit data to int8 or uint8 data, by int multiplier and int shift;\n\n 2.Math formula\n int8/uint8(output) = RequantIntOp (int32/16/8(input));\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n quant_mode: the mode or method used for quantization during the requantization operation.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n rq_axis: the axis along which the requantization operation is applied.;\n fuse_rq: whether to fuse the requantization operation with a preceding operation (such as a convolution or activation function).;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "multiplier", "type": "TypedArrayAttrBase" }, { "name": "rshift", "type": "TypedArrayAttrBase" }, { "name": "quant_mode", "type": "RequantModeAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "rq_axis", "type": "DefaultValuedAttr" }, { "name": "fuse_rq", "type": "DefaultValuedAttr" } ] }, { "name": "top.Reshape", "summary": "Reshape operation", "description": "1.Op Introduction\n Returns a tensor with the same type/values as the input, with a new shape\n specified by the shape argument. Reshape may operate on tensors of any rank.\n No data conversion happens during a reshape operation.\n\n 2.Math formula\n ```math\n output = ReshapeOp(input, shape)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n shapeT(act.): an optional input tensor that specifies the desired shape for the output tensor.;\n\n 4.attributes\n shape: 0: keep dim from input; -1: left dim from input.;\n flatten_start_dim: the starting dimension from which to begin flattening the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "shapeT", "type": "Optional" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "shape", "type": "OptionalAttr>" }, { "name": "flatten_start_dim", "type": "DefaultValuedAttr" } ] }, { "name": "top.RetinaFaceDetection", "summary": "RetinaFaceDetection operator", "description": "1.Op Introduction\n Perform retinaface detection on feature map\n\n 2.Math formula\n ```math\n output = NMS(Filter(Detect(inputs), confidence_threshold), nms_threshold, keep_topk)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n\n 4.attributes\n nms_threshold: nms threshold.;\n confidence_threshold: classification confidence threshold.;\n keep_topk: after nms, keep bbox num.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "nms_threshold", "type": "F64Attr" }, { "name": "confidence_threshold", "type": "F64Attr" }, { "name": "keep_topk", "type": "I64Attr" } ] }, { "name": "top.Reverse", "summary": "Reverse operation", "description": "1.Op Introduction\n Reverse on input.\n\n 2.Math formula\n ```math\n output = ReverseOp(input, axis)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of reverse;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ] }, { "name": "top.RMSNorm", "summary": "RMSNorm operation", "description": "1.Op Introduction\n A simplification of the original layer normalization (LayerNorm).\n Only normalize the last dimension of tensor.\n\n 2.Math formula\n ```math\n output = gamma * input / sqrt(mean(input ^ 2) + epsilon)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n gamma(w.): scalar.;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "gamma", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" }, { "name": "weight_keep_f32", "type": "DefaultValuedAttr" } ] }, { "name": "top.RoiAlign", "summary": "RoiAlign operator", "description": "1.Op Introduction\n RoiAlign consumes an input tensor X and region of interests\n (rois) to apply pooling across each RoI.\n\n 2.Math formula\n ```math\n 1.ROI coordinate scaling[x1, y1, x2, y2]\n x_scaled = x x spatial_scale\n y_scaled = y x spatial_scale\n 2.Delineation of grid sub-areas\n bin_height = (y2_scaled - y1_scaled) / output_height\n bin_width = (x2_scaled - x1_scaled) / output_width\n 3.align_corners -> true\n x_grid = x1_scaled + (i + 0.5) x bin_width\n y_grid = y1_scaled + (j + 0.5) x bin_height\n output = RoiAlign(input, rois, output_height, output_width, sampling_ratio, spatial_scale, align_corners)\n ```\n\n 3.activation and weight\n input(act.): input tensor(4D);\n rois(w.): RoIs (Regions of Interest) to pool over.;\n rois is 2-D input of shape (num_rois, 4) given as [[x1, y1, x2, y2], ...].;\n\n 4.attributes\n mode: the type of comparison to be performed between the two input tensors.\n mdoe include Equal, Not Equal, Less Than, Less Than or Equal, Greater Than and Greater Than or Equal;\n output_height: the height of the output feature maps.;\n output_width: the width of the output feature maps.;\n sampling_ratio: the number of sampling points in each direction (height and width).;\n spatial_scale: a scaling factor that maps the input coordinates (RoIs) to the input feature map's scale.;\n align_corners: whether to align the corners of the input and output tensors.;\n batch_indices: 1-D tensor with each element denoting the index of the corresponding image in the batch.", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "rois", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "RoiAlignModeAttr" }, { "name": "output_height", "type": "I64Attr" }, { "name": "output_width", "type": "I64Attr" }, { "name": "sampling_ratio", "type": "I64Attr" }, { "name": "spatial_scale", "type": "F64Attr" }, { "name": "align_corners", "type": "BoolAttr" } ] }, { "name": "top.RoiExtractor", "summary": "RoiExtractor operator", "description": "1.Op Introduction\n RoiExtractor consumes an input tensor X and region of interests\n (rois) to apply pooling across each RoI.\n\n 2.Math formula\n ```math\n 1.ROI coordinate scaling[x1, y1, x2, y2]\n x_scaled = x x spatial_scale\n y_scaled = y x spatial_scale\n 2.Delineation of grid sub-areas\n bin_height = (y2_scaled - y1_scaled) / output_height\n bin_width = (x2_scaled - x1_scaled) / output_width\n 3.align_corners -> true\n x_grid = x1_scaled + (i + 0.5) x bin_width\n y_grid = y1_scaled + (j + 0.5) x bin_height\n output_i = RoiAlign(input, rois_i, output_height, output_width, sampling_ratio, spatial_scale, align_corners)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n rois(w.): RoIs (Regions of Interest) to pool over.;\n rois is 2-D input of shape (num_rois, 4) given as [[x1, y1, x2, y2], ...].;\n target_lvls(w.): 1-D tensor with each element denoting the index of the corresponding image in the batch.;\n\n 4.attributes\n mode: the type of comparison to be performed between the two input tensors.\n mdoe include Equal, Not Equal, Less Than, Less Than or Equal, Greater Than and Greater Than or Equal;\n num_levels: The number of levels in the feature pyramid.;\n output_height: the height of the output feature maps.;\n output_width: the width of the output feature maps.;\n sampling_ratio: the number of sampling points in each direction (height and width).;\n spatial_scale: a scaling factor that maps the input coordinates (RoIs) to the input feature map's scale.;\n align_corners: whether to align the corners of the input and output tensors.;\n is_static: whether the operation has a static shape.;", "operands": [ { "name": "rois", "type": "AnyTensor" }, { "name": "target_lvls", "type": "AnyTensor" }, { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "RoiAlignModeAttr" }, { "name": "num_levels", "type": "I64Attr" }, { "name": "output_height", "type": "I64Attr" }, { "name": "output_width", "type": "I64Attr" }, { "name": "sampling_ratio", "type": "I64Attr" }, { "name": "spatial_scales", "type": "TypedArrayAttrBase" }, { "name": "align_corners", "type": "BoolAttr" }, { "name": "is_static", "type": "BoolAttr" } ] }, { "name": "top.ROIPooling", "summary": "ROIPooling operator", "description": "1.Op Introduction\n Max pooling on ROI.\n\n 2.Math formula\n ```math\n output(pooled_h, pooled_w) = max_pooling(input(h, w) in ROI(spatial_scale))\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n pooled_h: pooled output height.;\n pooled_w: pooled output width.;\n spatial_scale: adjust the ROI coordinates.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "pooled_h", "type": "I64Attr" }, { "name": "pooled_w", "type": "I64Attr" }, { "name": "spatial_scale", "type": "F64Attr" } ] }, { "name": "top.Rope", "summary": "Rope operator", "description": "1.Op Introduction\n The Rope operator is a specialized tensor operation designed for efficient computations involving multiple input tensors.\n\n 2.Math formula\n ```math\n output=saturation((input1 x shift(input2, mul1_shift))⊕(input3 x shift(input2, mul2_shift))) + shift(input3, dd_shift)\n ```\n The operator ⊕ represents the addition of the two multiplicative results.\n The function shift(input,shift_value) applies a shift to the input tensor based on the provided shift value.\n The saturation function ensures that the output remains within a defined range, preventing overflow or underflow.\n\n 3.activation and weight\n input1(act.): input tensor;\n input2(act./w.): input tensor or dynamic weight tensor;\n input3(act./w.): input tensor or dynamic weight tensor;\n\n 4.attributes\n is_permute_optimize:whether to apply optimization for permuting the input tensors.;\n mul1_round_mode: the rounding mode to be used for the first multiplication operation.;\n mul2_round_mode: Similar to mul1_round_mode, this attribute defines the rounding mode for the second multiplication operation.;\n add_round_mode: the rounding mode for the addition operation.;\n mul1_shift: the number of bits to shift the result of the first multiplication.;\n mul2_shift: Similar to mul1_shift, this attribute defines the number of bits to shift for the second multiplication operation.;\n add_shift: the number of bits to shift the result of the addition operation.;\n mul1_saturation: whether the output of the first multiplication should be saturated.\n When set to true, the result will be clamped to prevent overflow or underflow.;\n mul2_saturation: Similar to mul1_saturation, this attribute specifies whether saturation should be applied to the second multiplication's output.;\n add_saturation: whether to apply saturation to the output of the addition operation.;\n force_f32: when set to true, forces the computations to be performed in 32-bit floating point format, regardless of the input tensor formats.;", "operands": [ { "name": "input1", "type": "AnyTensor" }, { "name": "input2", "type": "AnyTensor" }, { "name": "input3", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "rope_mode", "type": "DefaultValuedAttr" }, { "name": "is_permute_optimize", "type": "DefaultValuedAttr" }, { "name": "mul1_round_mode", "type": "DefaultValuedAttr" }, { "name": "mul2_round_mode", "type": "DefaultValuedAttr" }, { "name": "add_round_mode", "type": "DefaultValuedAttr" }, { "name": "mul1_shift", "type": "DefaultValuedAttr" }, { "name": "mul2_shift", "type": "DefaultValuedAttr" }, { "name": "add_shift", "type": "DefaultValuedAttr" }, { "name": "mul1_saturation", "type": "DefaultValuedAttr" }, { "name": "mul2_saturation", "type": "DefaultValuedAttr" }, { "name": "add_saturation", "type": "DefaultValuedAttr" }, { "name": "force_f32", "type": "DefaultValuedAttr" } ] }, { "name": "top.Round", "summary": "Round operator", "description": "1.Op Introduction\n Round takes one input Tensor and rounds the values, element-wise,\n meaning it finds the nearest integer for each value. In case of halfs,\n the rule is to round them to the nearest even integer.\n If input x is integral, +0, -0, NaN, or infinite, x itself is returned.\n The output tensor has the same shape and type as the input.\n\n 2.Math formula\n ```math\n output = Round(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Rsqrt", "summary": "Rsqrt Operator", "description": "1.Op Introduction\n Reverse square root.\n\n 2.Math formula\n ```math\n output = \\frac{1}{\\sqrt{input}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Scale", "summary": "Scale operator", "description": "1.Op Introduction\n Y = X * S + B,\n where the shape of X/Y is [n, c, h, w] and the shape of S/B is [1, c, 1, 1].\n\n 2.Math formula\n ```math\n output = input x scale + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n scale(w.): scalar;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "scale", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.ScaleDotProductAttention", "summary": "ScaleDotProductAttention operator (pytorch)", "description": "1.Op Introduction\n Scale_Dot_Product_Attention Operation for pytorch.\n\n 2.Math formula\n ```math\n output = (softmax(Q * K^T) / sqrt(d_k) + mask) * V\n ```\n\n 3.activation and weight\n query(act.): queries input tensor.;\n key(act.): keys input tensor.;\n value(act.): values input tensor.;\n mask(w.): the learnable masks of the module of shape.;\n\n 4.attributes\n dropout_p: the dropout probability for attention weights.;\n is_causal: whether the attention should be causal.;\n scale: the scaling factor.;", "operands": [ { "name": "query", "type": "AnyTensor" }, { "name": "key", "type": "AnyTensor" }, { "name": "value", "type": "AnyTensor" }, { "name": "mask", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "dropout_p", "type": "DefaultValuedAttr" }, { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "DefaultValuedAttr" } ] }, { "name": "top.ScaleLut", "summary": "Scale by lut operator", "description": "1.Op Introduction\n Performs scale on input, y = input * scale + bias.\n\n 2.Math formula\n ```math\n output = input * scale + bias\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: each channel scale.;\n bias: each channel bias.;\n sign: if output is signed.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "bias", "type": "TypedArrayAttrBase" }, { "name": "sign", "type": "DefaultValuedAttr" } ] }, { "name": "top.ScatterElements", "summary": "ScatterElements op", "description": "1.Op Introduction\n ScatterElements takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that\n identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by\n creating a copy of the input data, and then updating its value to values specified by updates at specific index\n positions specified by indices. Its output shape is the same as the shape of data.\n\n 2.Math formula\n ```math\n output = ScatterElements(input[axis], updates, indices)\n ```\n 3.activation and weight\n input(act.): input tensor;\n indices(w.): Tensor of int32/int64 indices, of r >= 1 (same rank as input).\n All index values are expected to be within bounds [-s, s-1] along axis of size s.\n updates(w.): Tensor of rank r >=1 (same rank and shape as indices).\n\n 4.attributes\n axis: the dimension of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" }, { "name": "updates", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "reduction", "type": "DefaultValuedAttr" }, { "name": "nc_can_split", "type": "DefaultValuedAttr" } ] }, { "name": "top.ScatterND", "summary": "ScatterND operator", "description": "1.Op Introduction\n The output of the operation is produced by creating a copy of the input data,\n and then updating its value to values specified by updates at\n specific index positions specified by indices.\n\n 2.Math formula\n ```math\n output = ScatterND(input_data[indices], updates, reduction)\n ```\n\n 3.activation and weight\n input_data(act.): input tensor;\n indices(w.): Tensor of rank q >= 1.;\n updates(w.): Tensor of rank q + r - indices_shape[-1] - 1.;\n\n 4.attributes\n reduction: Type of reduction to apply: none (0 default), add(1), sub(2), max(3), min(4), mul(5).;", "operands": [ { "name": "input_data", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" }, { "name": "updates", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "reduction", "type": "DefaultValuedAttr" } ] }, { "name": "top.SelectiveScan", "summary": "2D Selective Scan Operator (specialized for VMamba)", "description": "1. Op Introduction\n Performs structured state space modeling (SSM) on 2D image data using a bidirectional scanning mechanism.\n Core component of the VMamba architecture that enables efficient long-range dependency modeling in visual data.\n\n 2. Math formula\n For each scanning direction:\n ```\n h_t = δA_t ⊙ h_{t-1} + δB_t ⊙ u_t\n y_t = c_t ⊙ h_t\n ```\n Final output:\n ```\n output = concat(y_forward, y_backward) + u ⊙ D\n ```\n code:\n\n for i in range(L):\n x_up = deltaA_up[:, :, i, :] * x_up + deltaB_u_up[:, :, i, :]\n x_down = deltaA_down[:, :, L - 1 - i, :] * x_down + deltaB_u_down[:, :, L - 1 - i, :]\n y_up[i, :, :] = x_up[0, :, :] * c_up[i, :, 0, :]\n y_down[L - 1 - i, :, :] = x_down[0, :, :] * c_down[L - 1 - i, :, 0, :]\n\n y = concat((y_up, y_down), dim=1)\n out = y if D is None else y + u * D\n\n 3. Input parameters:\n u: Input feature map tensor (after linear projection) [N, C, L, Batch]\n c: State-to-output projection weights [N, C, L, Batch]\n D: Residual connection weights (optional) [N, C]\n δA: Discretized state transition matrix [N, C, L, Batch]\n δB_u: Combined input projection and discretized control matrix [N, C, L, Batch]\n\n 4. Attributes:\n direction: Bidirectional scanning scheme (forward & reverse)\n time_dim: Sequence length dimension (L = H × W)\n channel_split: Channel dimension partitioning factor (C → C//2)\n residual: Whether to apply residual connection (D term)", "operands": [ { "name": "Cs", "type": "AnyTensor" }, { "name": "deltaA", "type": "AnyTensor" }, { "name": "deltaB_u", "type": "AnyTensor" }, { "name": "us", "type": "AnyTensor" }, { "name": "Ds", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Shape", "summary": "Shape operation", "description": "1.Op Introduction\n Takes a tensor as input and outputs an 1D int tensor containing the shape of the input tensor.\n\n 2.Math formula\n ```math\n output = shape(input[d1, d2,...,dn])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n start(w.): the ending indices for slicing along each axis.;\n step: the step sizes for slicing along each axis.;\n end: the ending indices for slicing along each axis.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "start", "type": "OptionalAttr" }, { "name": "end", "type": "OptionalAttr" }, { "name": "step", "type": "OptionalAttr" } ] }, { "name": "top.ShuffleChannel", "summary": "ShuffleChannel operator", "description": "1.Op Introduction\n Perform ShuffleChannel on input.\n\n 2.Math formula\n ```math\n output(N, C, H, W) = input(N, Shuffle(C), H, W)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n group: An integer specifying the number of groups to divide the channels into.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "group", "type": "I64Attr" } ] }, { "name": "top.Sigmoid", "summary": "Exp operator, scale * Sigmoid + bias", "description": "1.Op Introduction\n Y = scale * Sigmoid(x) + bias\n if log --> Y = Log(scale * Sigmoid(x) + bias)\n\n 2.Math formula\n ```math\n output = scale * Sigmoid(input) + bias\n\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n scale: a scaling factor applied to the attention scores before they are passed through the softmax function.;\n bias: added to the result of the matrix multiplication. ;\n log: whether the output should be computed using the logarithm of the scaled sigmoid function. ;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "bias", "type": "DefaultValuedAttr" }, { "name": "log", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.Sign", "summary": "Sign Operator", "description": "1.Op Introduction\n Calculate the sign of the given input tensor element-wise.\n If input > 0, output 1. if input < 0, output -1. if input == 0,\n output 0.\n\n 2.Math formula\n ```math\n output = SignOp(input) -> 0/1\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.SiLU", "summary": "SiLU operator, y = x * Sigmoid(x)", "description": "1.Op Introduction\n An activation function.\n Smooth nonlinear transformation is provided to avoid the gradient disappearance problem of ReLU.;\n\n 2.Math formula\n ```math\n output = input * Sigmoid(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Sin", "summary": "Sin operator", "description": "1.Op Introduction\n Calculates the Sin of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = sin(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Sinh", "summary": "Sinh operator", "description": "1.Op Introduction\n Calculates the Sinh of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = sinh(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Size", "summary": "Size operator", "description": "1.Op Introduction\n gen by torch aten::size. The Size operation retrieves the size (or shape) of the given input tensor.\n\n 2.Math formula\n ```math\n output = SizeOp(input) ->[dim0, dim1, dim2..., dimN]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of reverse;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ] }, { "name": "top.Slice", "summary": "Slice operator", "description": "1.Op Introduction\n Slice Operation on input.\n\n 2.Math formula\n ```math\n output[i] = input[offset[j] : ends[j] : steps[j]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n offsetT(w.): the starting indices for each slice along the specified axes.;\n endsT(w.): the ending indices for each slice along the specified axes.;\n stepsT(w.): the step sizes for each slice along the specified axes.;\n\n 4.attributes\n offset: An array of the starting indices for slicing along each axis.;\n steps: An array of the step sizes for slicing along each axis.;\n ends: An array of the ending indices for slicing along each axis.;\n axes: An array of the axes along which to perform the slicing operation.;\n hasparamConvert_axes: whether parameter conversion is needed for the specified axes.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "offsetT", "type": "AnyTensorOrNone" }, { "name": "endsT", "type": "AnyTensorOrNone" }, { "name": "stepsT", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "offset", "type": "TypedArrayAttrBase" }, { "name": "steps", "type": "TypedArrayAttrBase" }, { "name": "ends", "type": "TypedArrayAttrBase" }, { "name": "axes", "type": "DefaultValuedAttr, {}>" }, { "name": "hasparamConvert_axes", "type": "DefaultValuedAttr, {}>" } ] }, { "name": "top.SliceAxis", "summary": "Slice operator on one axis", "description": "1.Op Introduction\n Slice Operation on input.\n\n 2.Math formula\n ```math\n output[i] = input[starts[j] + i * strides[j]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n axis(w.): the dimension of the input tensor.;\n start(w.): the ending indices for slicing along each axis.;\n step: the step sizes for slicing along each axis.;\n end: the ending indices for slicing along each axis.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "axis", "type": "AnyTensor" }, { "name": "start", "type": "AnyTensor" }, { "name": "step", "type": "AnyTensorOrNone" }, { "name": "end", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Softmax", "summary": "Softmax operation", "description": "1.Op Introduction\n Integrates some operations related to softmax.\n\n 2.Math formula\n ```math\n \\text{output}[i] = \\frac{e^{\\text{input}[i]}}{\\sum_{j} e^{\\text{input}[j]}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n log: when set to true, indicates that the output should be computed in log space.;\n beta: scaling factor.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "log", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.SoftmaxBwd", "summary": "softmax backward operator", "description": "1.Op Introduction\n Integrates some operations related to softmax backward.\n\n 2.Math formula\n ```math\n grad_input[i] = softmax(output)[i] * (grad_output[i] - \\sum{j}grad_output[j] * softmax(output)[j])\n ```\n\n 3.activation and weight\n grad_output(act.): the gradient of the loss with respect to the output.;\n output(act.): output tensor.;\n\n 4.attributes\n dim: If set to 0, computed across rows, If set to 1, computed across columns.;", "operands": [ { "name": "grad_output", "type": "AnyTensor" }, { "name": "output", "type": "AnyTensor" } ], "results": [ { "name": "grad_input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "top.Softplus", "summary": "Softplus operation", "description": "1.Op Introduction\n a smooth approximation of the ReLU (Rectified Linear Unit) activation function.\n\n 2.Math formula\n ```math\n output = ln(exp(input) + 1)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Softsign", "summary": "Softsign Operator", "description": "1.Op Introduction\n The Softsign operation is an activation function that provides a smooth approximation of the sign function.\n\n 2.Math formula\n ```math\n output = input / (1 + |input|)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Sort", "summary": "Sort operation", "description": "1.Op Introduction\n Integrates some operations related to Sort.\n\n 2.Math formula\n ```math\n output = Sort(input, axis, descending)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n descending: the order of sorting.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "values", "type": "AnyTensorOrNone" }, { "name": "indices", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "descending", "type": "DefaultValuedAttr" } ] }, { "name": "top.Split", "summary": "Split operator", "description": "1.Op Introduction\n Split input tensor into a list of tensors.\n\n 2.Math formula\n ```math\n output = input[i * split_size: (i + 1) * split_size] for i = 0, 1, ... num - 1\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of split;\n num: the number of equal parts to split the input tensor into along the specified axis.;\n split_size: the exact sizes of each split along the specified axis.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "num", "type": "I64Attr" }, { "name": "split_size", "type": "OptionalAttr>" } ] }, { "name": "top.Sqrt", "summary": "Sqrt operation", "description": "1.Op Introduction\n Computes the square root of the input tensor's element.\n\n 2.Math formula\n ```math\n output = Sqrt(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Squeeze", "summary": "Squeeze operator", "description": "1.Op Introduction\n The operator squeeze the input shapes by given axis.\n\n 2.Math formula\n ```math\n output = squeeze(input, axes)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.StridedSlice", "summary": "Strided Slice operator", "description": "1.Op Introduction\n Strided Slice Operation on input.\n\n 2.Math formula\n ```math\n output[i] = input[starts[j] + i * strides[j]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n starts(w.): the starting indices for each dimension of the input tensor.;\n ends(w.): the ending indices for each dimension of the input tensor.;\n strides(w.): the stride values for each dimension, determining the step size between indices in the slicing operation.;\n\n 4.attributes\n begin_mask: If set, the start index for that dimension is considered as 0.;\n end_mask: If set, the end index for that dimension is considered as the size of the dimension.;\n ellipsis_mask: whether allowing for the selection of all dimensions in between specified slices.;\n new_axis_mask: which dimensions should be added as new axes in the output tensor.;\n shrink_axis_mask: which dimensions should be removed from the output tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "starts", "type": "AnyTensor" }, { "name": "ends", "type": "AnyTensor" }, { "name": "strides", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "begin_mask", "type": "I64Attr" }, { "name": "end_mask", "type": "I64Attr" }, { "name": "ellipsis_mask", "type": "I64Attr" }, { "name": "new_axis_mask", "type": "I64Attr" }, { "name": "shrink_axis_mask", "type": "I64Attr" } ] }, { "name": "top.Sub", "summary": "sub operator", "description": "1.Op Introduction\n Elementwise subtraction of input1 and input2. Axis of size 1 will be broadcast,\n as necessary.\n\n 2.Math formula\n ```math\n output = ReLU((input1 - input2; dim))\n ```\n Axis of size 1 will be broadcast if necessary.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n is_reverse: whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n coeff: It is an array and allows for scaling the output of the addition operation.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "coeff", "type": "OptionalAttr>" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.SubConst", "summary": "Sub Const operator", "description": "1.Op Introduction\n Elementwise subtraction of input1 and input2. Input1 or Input2 is constant.\n as necessary.\n\n 2.Math formula\n ```math\n output = input - const_val or const_val - input\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n is_reverse: This boolean attribute indicates whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n is_scalar: whether the addition operation is performed with scalar values or tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "is_scalar", "type": "DefaultValuedAttr" } ] }, { "name": "top.SwapChannel", "summary": "swap channel operator, normally RGB <=> BGR", "description": "1.Op Introduction\n Swap Channel on input.\n\n 2.Math formula\n ```math\n output(h, w, c) = input(h, w, channel_order)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n channel_order: channel swap order.;\n quant: a QuantParam struct attributes.;\n name: name for calibration, comparing, or debug.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "channel_order", "type": "TypedArrayAttrBase" } ] }, { "name": "top.SwapDimInner", "summary": "if offset is not 0, split there and swap first part and second part of it", "description": "1.Op Introduction\n a dimension-swapping operation based on a specified offset.\n\n 2.Math formula\n ```math\n output = SwapDimInner(input, offset)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n offset: the position at which the input tensor is split.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "offset", "type": "TypedArrayAttrBase" } ] }, { "name": "top.Swish", "summary": "Swish operation", "description": "1.Op Introduction\n hardswish(x) := x * sigmoid(x * beta)\n\n 2.Math formula\n ```math\n output[i] = input[i] * sigmoid(input[i] * beta)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n beta: scalar;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "beta", "type": "F64Attr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.Tan", "summary": "Tan operator", "description": "1.Op Introduction\n Calculates the tan of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = Tan(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Tanh", "summary": "Tanh operator", "description": "1.Op Introduction\n Calculates the tanh of the given input tensor, element-wise.\n\n 2.Math formula\n ```math\n output = Tan(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.Tile", "summary": "Tile operator", "description": "1.Op Introduction\n Perform Tile operation on the given tensor.\n\n 2.Math formula\n ```math\n output[i_1, i_2, i_3,...i_k] = input[i_1 mod d_1, i_2 mod d_2, i_3 mod d_3,..., i_k mod d_k]\n ```\n where d_j represents the corresponding dimension size of the input tensor after tiling.\n\n 3.activation and weight\n input(act.): input tensor.;\n tileT(w.): how many times to replicate the input tensor along each dimension.;\n\n 4.attributes\n tile: the number of times to replicate the input tensor along each dimension.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "tileT", "type": "Optional" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "tile", "type": "OptionalAttr>" } ] }, { "name": "top.TopK", "summary": "TopK operation", "description": "1.Op Introduction\n Integrates some operations related to topk.\n\n 2.Math formula\n ```math\n output_values, output_indices = TopK(input, K, axis, largest, sorted)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n K: how many of the largest (or smallest, depending on the largest attribute) values will be returned. defaults is -1;\n largest: whether to retrieve the largest or smallest values.;\n sorted: whether the output values should be sorted in descending order (if largest is true) or ascending order (if largest is false).;\n kT: provide a specific tensor for K values. This allows for dynamic specification of K.;\n use_hau: whether the operator uses hau to implement.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "kT", "type": "Optional" } ], "results": [ { "name": "values", "type": "AnyTensorOrNone" }, { "name": "indices", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "K", "type": "DefaultValuedAttr" }, { "name": "largest", "type": "DefaultValuedAttr" }, { "name": "sorted", "type": "DefaultValuedAttr" }, { "name": "replace_topk_indices", "type": "DefaultValuedAttr" }, { "name": "use_hau", "type": "DefaultValuedAttr" } ] }, { "name": "top.Transpose", "summary": "Transpose operator", "description": "1.Op Introduction\n Transpose on input.\n\n 2.Math formula\n ```math\n output(dim1, dim0) = TransposeOp(input(dim0, dim1))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n dim0: the first dimension of input tensor.;\n dim1: the second dimension of input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "dim0", "type": "SI32Attr" }, { "name": "dim1", "type": "SI32Attr" } ] }, { "name": "top.Trilu", "summary": "Trilu operation", "description": "1.Op Introduction\n Returns the upper or lower triangular part of input.\n\n 2.Math formula\n ```math\n output = Triu(input, diagonal) if upper = 1\n output = Tril(input, diagonal) if upper = 0\n ```\n where, Triu() return the upper triangular part of the input tensor.\n Tril() return the lower triangular part of the input tensor.\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n upper: whether to extract the upper or lower triangular part of the input tensor.;\n diagonal: 0 refers to the main diagonal, positive values indicate diagonals above the main diagonal,\n and negative values indicate diagonals below the main diagonal.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "upper", "type": "SI32Attr" }, { "name": "diagonal", "type": "SI32Attr" } ] }, { "name": "top.Tuple", "summary": "Tuple operator", "description": "1.Op Introduction\n gen by torch prim::TupleConstruct, y = (a, b)\n\n 2.Math formula\n ```math\n output = TupleOp(input1, input2)\n ```\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Unpack", "summary": "Unpack operator", "description": "1.Op Introduction\n Unpack a tensor to list of tensors in the given dimension.\n\n 2.Math formula\n output1, output2, output3 = UnPack(input; axis)\n\n 3.activation and weight\n input(act.): Variadic input tensor;\n\n 4.attributes\n axis: It specifies the dimension along which the input tensors will be packed together.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" } ] }, { "name": "top.Unsqueeze", "summary": "Unsqueeze operator", "description": "1.Op Introduction\n The operator unsqueeze the input shapes by given axis.\n\n 2.Math formula\n ```math\n output = unsqueeze(input, axes)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ] }, { "name": "top.UnTuple", "summary": "UnTuple operator", "description": "1.Op Introduction\n gen by torch prim::TupleUnpack, a, b = y\n\n 2.Math formula\n ```math\n output1, output2 = UnTupleOp(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ] }, { "name": "top.Upsample", "summary": "Upsample operation", "description": "1.Op Introduction\n Perform nearest upsample on input.\n\n 2.Math formula\n ```math\n output[i, j] = Upsample(input[i / scale_h, j / scale_w])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n scale_h: the scaling factor for the height (number of rows) of the input tensor.;\n scale_w: the scaling factor for the width (number of columns) of the input tensor.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale_h", "type": "I64Attr" }, { "name": "scale_w", "type": "I64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" } ] }, { "name": "top.Variance", "summary": "Compute Variance operator", "description": "1.Op Introduction\n variance\n\n 2.Math formula\n ```math\n output = \\frac{1}{N} \\sum_{i=1}^{N} (input_i - mean)^2\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n reduce_list: A list of dimensions along which to compute the variance.;\n correction: correction factor.;\n keep_dims: whether to keep the dimensions of the output tensor the same as the input tensors.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "reduce_list", "type": "TypedArrayAttrBase" }, { "name": "correction", "type": "F64Attr" }, { "name": "keep_dims", "type": "DefaultValuedAttr" } ] }, { "name": "top.View", "summary": "View operation", "description": "1.Op Introduction\n gen by torch aten::view, the view operation allows for changing the shape of the tensor without altering its data.\n 0: keep dim from input\n -1: left dim from input\n\n 2.Math formula\n ```math\n output = ViewOp(input, shape)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n shape(w.): 0: keep dim from input; -1: left dim from input.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "shape", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "top.Weight", "summary": "weight operator", "description": "If `inline_bytes` is not defined or `inline_bytes` is a null string:\n Load weight from a file. The file should be a valid .npz format file.\n This Op does not take any input, and the location captures the tensor name.\n The Output is an n-dimensional tensor whose type matches\n the tensor type in the .npz file.\n Else:\n Load weight from `inline_bytes`.", "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "OptionalAttr>" }, { "name": "store_mode", "type": "OptionalAttr" }, { "name": "allow_split", "type": "OptionalAttr>" }, { "name": "indices_idx", "type": "OptionalAttr>" }, { "name": "indices_slice", "type": "OptionalAttr>" }, { "name": "path", "type": "OptionalAttr" }, { "name": "placeholder", "type": "OptionalAttr" }, { "name": "do_compress", "type": "OptionalAttr" }, { "name": "bias0", "type": "OptionalAttr" }, { "name": "bias1", "type": "OptionalAttr" }, { "name": "is_signed", "type": "OptionalAttr" }, { "name": "zero_guard", "type": "OptionalAttr" }, { "name": "inline_bytes", "type": "OptionalAttr" } ] }, { "name": "top.WeightReorder", "summary": "WeightReorder operator", "description": "1.Op Introduction\n reorder Weight.\n\n 2.Math formula\n ```math\n output = Reorder(input, reorder_mode)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n reorder_mode: rearranging the weight tensor, such as sorting, shuffling, or applying a specific permutation.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "reorder_mode", "type": "DefaultValuedAttr" } ] }, { "name": "top.Where", "summary": "Where operation", "description": "1.Op Introduction\n Return elements, either from X or Y, depending on condition.\n\n 2.Math formula\n ```math\n output = tbrn if condition else fbrn\n ```\n\n 3.activation and weight\n cond(act.): a tensor that serves as the condition for selecting elements from the true branch (tbrn) or the false branch (fbrn).;\n tbrn(w.): the tensor that will be selected when the condition is true.;\n fbrn(w.): the tensor that will be selected when the condition is false.;\n\n 4.attributes\n x_is_const: the tensor for the true branch (tbrn) is a constant.;\n y_is_const: the tensor for the false branch (fbrn) is a constant.;\n x_const_val: the constant value to be used for the true branch if tbrn is not provided or is constant.;\n y_const_val: the constant value to be used for the false branch if fbrn is not provided or is constant.;", "operands": [ { "name": "cond", "type": "AnyTensor" }, { "name": "tbrn", "type": "AnyTensorOrNone" }, { "name": "fbrn", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "x_is_const", "type": "DefaultValuedAttr" }, { "name": "y_is_const", "type": "DefaultValuedAttr" }, { "name": "x_const_val", "type": "DefaultValuedAttr" }, { "name": "y_const_val", "type": "DefaultValuedAttr" } ] }, { "name": "top.Yield", "summary": "Yield operation", "description": "1.Op Introduction\n The `top.Yield` operation represents a return operation within an subgraph.\n The operation takes variable number of operands and produces no results.\n This operation is not part of the standard and was added to assist tpu-mlr.\n\n 2.Math formula\n ```math\n output = Yield(operands)\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ] }, { "name": "top.YoloDetection", "summary": "YoloDetection operator", "description": "1.Op Introduction\n Perform yolo detection on feature map.\n\n 2.Math formula\n ```math\n 1.Feature Map output\n raw_predictions = {(b_i, c_i, p_i) | i = 1, 2,...,N}\n b_i is the bounding box coordinates, c_i is the i-th class score, p_i is the i-th obj score.\n 2.Apply Objectness Threshold\n filtered_predictions = {(b_i, c_i, p_i) | p_i >= obj_threshold}\n 3.Non-Maximum Suppression(NMS)\n nms_output = NMS(filtered_predictions, nms_threshold)\n 4.Top K Detections\n output = top_k(nms_output, keep_topk)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n\n 4.attributes\n net_input_h: The height of the input image.;\n net_input_w: The width of the input image;\n nms_threshold: The threshold used for Non-Maximum Suppression (NMS).;\n obj_threshold: The minimum confidence score required for an object detection to be considered valid.;\n keep_topk: The maximum number of detections to keep after applying NMS.;\n anchors: A list of anchor box dimensions.;\n version: The version of the YOLO model being used.;\n class_num: The number of classes that the YOLO model can predict.;\n num_boxes: The number of bounding boxes that the model predicts for each grid cell in the feature map.;\n agnostic_nms: whether to use class-agnostic NMS.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "net_input_h", "type": "I64Attr" }, { "name": "net_input_w", "type": "I64Attr" }, { "name": "nms_threshold", "type": "F64Attr" }, { "name": "obj_threshold", "type": "F64Attr" }, { "name": "keep_topk", "type": "I64Attr" }, { "name": "anchors", "type": "TypedArrayAttrBase" }, { "name": "version", "type": "YoloVersionAttr" }, { "name": "class_num", "type": "DefaultValuedAttr" }, { "name": "num_boxes", "type": "DefaultValuedAttr" }, { "name": "agnostic_nms", "type": "DefaultValuedAttr" } ] }, { "name": "top.Yuv2rgbFormula", "summary": "Yuv2rgb formula operator", "description": "1.Op Introduction\n Yuv2rgb formula Operator.\n\n 2.Math formula\n ```math\n (R) = (Y + 1.402 x (V - 128))\n (G) = (Y - 0.344136 x (U - 128) - 0.714136 x (V - 128))\n (B) = (Y + 1.772 x (U - 128))\n\n ```\n\n 3.activation and weight\n YUV(act.): input tensor.;\n\n 4.attributes\n src_format: the source format of the input YUV data.;\n dst_format: the desired destination format for the output RGB data.;\n image_format: how the YUV data should be processed and how the output RGB data should be structured.;\n formula_mode: the mode of the conversion formula used for the YUV to RGB transformation. ;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;", "operands": [ { "name": "YUV", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "src_format", "type": "UI32Attr" }, { "name": "dst_format", "type": "UI32Attr" }, { "name": "image_format", "type": "ImageOutFormatAttr" }, { "name": "formula_mode", "type": "Yuv2rgbFormulaAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" } ] }, { "name": "torch_c.from_builtin_tensor", "summary": "Convert a `tensor` to a `!torch.vtensor`", "description": "This op only operates on ValueTensorType, to avoid conflating conversions\n between value-semantic and non-value-semantic types.", "operands": [ { "name": "operand", "type": "AnyTensor" } ], "results": [ { "name": "result", "type": "Torch_ValueTensorType" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($operand)) `->` qualified(type($result))" }, { "name": "torch_c.from_f64", "summary": "Convert an `f64` to a `!torch.float`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.from_i1", "summary": "Convert an `i1` to a `!torch.bool`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "I1" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.from_i64", "summary": "Convert an `i64` to a `!torch.int`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.generator_to_i64", "summary": "Convert a `Generator` to a `i64`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "Torch_GeneratorType" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.get_next_seed", "summary": "Get the next global seed", "description": "This op is for getting the next global seed for RNG", "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "attr-dict `:` `(``)` `->` qualified(type($result))" }, { "name": "torch_c.i64_to_generator", "summary": "Convert an `i64` to an `Generator`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "Torch_GeneratorType" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.to_builtin_tensor", "summary": "Convert a `!torch.vtensor` to a `tensor`", "description": "This op only operates on ValueTensorType, to avoid conflating conversions\n between value-semantic and non-value-semantic types.", "operands": [ { "name": "operand", "type": "Torch_ValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTensor" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($operand)) `->` qualified(type($result))" }, { "name": "torch_c.to_f64", "summary": "Convert a `!torch.float` to an `f64`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.to_i1", "summary": "Convert a `!torch.bool` to an `i1`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch_c.to_i64", "summary": "Convert a `!torch.int` to an `i64`", "description": "This op is primarily useful as a materialization during dialect conversion.", "operands": [ { "name": "operand", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict" }, { "name": "torch.aten.__and__.bool", "summary": "Generated op for `aten::__and__.bool : (bool, bool) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_BoolType" }, { "name": "b", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__and__.Scalar", "summary": "Generated op for `aten::__and__.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__and__.Tensor", "summary": "Generated op for `aten::__and__.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__contains__.int_list", "summary": "Generated op for `aten::__contains__.int_list : (int[], int) -> (bool)`", "operands": [ { "name": "l", "type": "AnyTorchListOfTorchIntType" }, { "name": "item", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__contains__.str", "summary": "Generated op for `aten::__contains__.str : (Dict(str, t), str) -> (bool)`", "operands": [ { "name": "dict", "type": "Torch_DictType" }, { "name": "key", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__contains__.str_list", "summary": "Generated op for `aten::__contains__.str_list : (str[], str) -> (bool)`", "operands": [ { "name": "l", "type": "AnyTorchListOfTorchStringType" }, { "name": "item", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__derive_index", "summary": "Generated op for `aten::__derive_index : (int, int, int) -> (int)`", "operands": [ { "name": "index", "type": "Torch_IntType" }, { "name": "start", "type": "Torch_IntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__getitem__.Dict_str", "summary": "Generated op for `aten::__getitem__.Dict_str : (Dict(str, t), str) -> (t)`", "operands": [ { "name": "self", "type": "Torch_DictType" }, { "name": "key", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__getitem__.t", "summary": "Generated op for `aten::__getitem__.t : (t[], int) -> (t)`", "operands": [ { "name": "list", "type": "AnyTorchListType" }, { "name": "idx", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__interpolate.size_list_scale_list", "summary": "Generated op for `aten::__interpolate.size_list_scale_list : (Tensor, int[]?, float[]?, str, bool?, bool?, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "scale_factor", "type": "AnyTorchOptionalListOfTorchFloatType" }, { "name": "mode", "type": "Torch_StringType" }, { "name": "align_corners", "type": "AnyTorchOptionalBoolType" }, { "name": "recompute_scale_factor", "type": "AnyTorchOptionalBoolType" }, { "name": "antialias", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__is__", "summary": "Generated op for `aten::__is__ : (t1, t2) -> (bool)`", "operands": [ { "name": "self", "type": "AnyTorchType" }, { "name": "obj", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__isnot__", "summary": "Generated op for `aten::__isnot__ : (t1, t2) -> (bool)`", "operands": [ { "name": "self", "type": "AnyTorchType" }, { "name": "obj", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__lshift__.Scalar", "summary": "Generated op for `aten::__lshift__.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__not__", "summary": "Generated op for `aten::__not__ : (bool) -> (bool)`", "operands": [ { "name": "self", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__or__.bool", "summary": "Generated op for `aten::__or__.bool : (bool, bool) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_BoolType" }, { "name": "b", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__or__.Tensor", "summary": "Generated op for `aten::__or__.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__range_length", "summary": "Generated op for `aten::__range_length : (int, int, int) -> (int)`", "operands": [ { "name": "lo", "type": "Torch_IntType" }, { "name": "hi", "type": "Torch_IntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.__rshift__.Scalar", "summary": "Generated op for `aten::__rshift__.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._adaptive_avg_pool2d", "summary": "Generated op for `aten::_adaptive_avg_pool2d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._adaptive_avg_pool2d_backward", "summary": "Generated op for `aten::_adaptive_avg_pool2d_backward : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._adaptive_avg_pool3d", "summary": "Generated op for `aten::_adaptive_avg_pool3d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._adaptive_avg_pool3d_backward", "summary": "Generated op for `aten::_adaptive_avg_pool3d_backward : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._assert_scalar", "summary": "Generated op for `aten::_assert_scalar : (Scalar, str) -> ()`", "operands": [ { "name": "self", "type": "AnyTorchScalarType" }, { "name": "assert_msg", "type": "Torch_StringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._assert_tensor_metadata", "summary": "Generated op for `aten::_assert_tensor_metadata : (Tensor, int[]?, int[]?, int?, Device?, int?) -> ()`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._cast_Float", "summary": "Generated op for `aten::_cast_Float : (Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "non_blocking", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._cast_Long", "summary": "Generated op for `aten::_cast_Long : (Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "non_blocking", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._convolution", "summary": "Generated op for `aten::_convolution : (Tensor, Tensor, Tensor?, int[], int[], int[], bool, int[], int, bool, bool, bool, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "transposed", "type": "Torch_BoolType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "benchmark", "type": "Torch_BoolType" }, { "name": "deterministic", "type": "Torch_BoolType" }, { "name": "cudnn_enabled", "type": "Torch_BoolType" }, { "name": "allow_tf32", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._convolution.deprecated", "summary": "Generated op for `aten::_convolution.deprecated : (Tensor, Tensor, Tensor?, int[], int[], int[], bool, int[], int, bool, bool, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "transposed", "type": "Torch_BoolType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "benchmark", "type": "Torch_BoolType" }, { "name": "deterministic", "type": "Torch_BoolType" }, { "name": "cudnn_enabled", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._embedding_bag", "summary": "Generated op for `aten::_embedding_bag : (Tensor, Tensor, Tensor, bool, int, bool, Tensor?, bool, int) -> (Tensor, Tensor, Tensor, Tensor)`", "operands": [ { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchTensorType" }, { "name": "offsets", "type": "AnyTorchTensorType" }, { "name": "scale_grad_by_freq", "type": "Torch_BoolType" }, { "name": "mode", "type": "Torch_IntType" }, { "name": "sparse", "type": "Torch_BoolType" }, { "name": "per_sample_weights", "type": "AnyTorchOptionalTensorType" }, { "name": "include_last_offset", "type": "Torch_BoolType" }, { "name": "padding_idx", "type": "Torch_IntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" }, { "name": "result3", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._fake_quantize_per_tensor_affine_cachemask_tensor_qparams", "summary": "Generated op for `aten::_fake_quantize_per_tensor_affine_cachemask_tensor_qparams : (Tensor, Tensor, Tensor, Tensor, int, int) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "AnyTorchTensorType" }, { "name": "zero_point", "type": "AnyTorchTensorType" }, { "name": "fake_quant_enabled", "type": "AnyTorchTensorType" }, { "name": "quant_min", "type": "Torch_IntType" }, { "name": "quant_max", "type": "Torch_IntType" } ], "results": [ { "name": "output", "type": "AnyTorchOptionalTensorType" }, { "name": "mask", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._index_put_impl", "summary": "Generated op for `aten::_index_put_impl : (Tensor, Tensor?[], Tensor, bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchListOfOptionalTensorType" }, { "name": "values", "type": "AnyTorchTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" }, { "name": "unsafe", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._index_put_impl_", "summary": "Generated op for `aten::_index_put_impl_ : (Tensor, Tensor?[], Tensor, bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "indices", "type": "AnyTorchListOfOptionalNonValueTensorType" }, { "name": "values", "type": "Torch_NonValueTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" }, { "name": "unsafe", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._int_mm", "summary": "Generated op for `aten::_int_mm : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mat2", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._linalg_det", "summary": "Generated op for `aten::_linalg_det : (Tensor) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "A", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" }, { "name": "LU", "type": "AnyTorchOptionalTensorType" }, { "name": "pivots", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._log_softmax", "summary": "Generated op for `aten::_log_softmax : (Tensor, int, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "half_to_float", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._log_softmax_backward_data", "summary": "Generated op for `aten::_log_softmax_backward_data : (Tensor, Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "output", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "input_dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._make_per_channel_quantized_tensor", "summary": "Generated op for `aten::_make_per_channel_quantized_tensor : (Tensor, Tensor, Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "AnyTorchTensorType" }, { "name": "zero_point", "type": "AnyTorchTensorType" }, { "name": "axis", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._make_per_tensor_quantized_tensor", "summary": "Generated op for `aten::_make_per_tensor_quantized_tensor : (Tensor, float, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "Torch_FloatType" }, { "name": "zero_point", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._reshape_alias", "summary": "Generated op for `aten::_reshape_alias : (Tensor, int[], int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._reshape_alias_copy", "summary": "Generated op for `aten::_reshape_alias_copy : (Tensor, int[], int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._safe_softmax", "summary": "Generated op for `aten::_safe_softmax : (Tensor, int, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._scaled_mm", "summary": "Generated op for `aten::_scaled_mm : (Tensor, Tensor, Tensor, Tensor, Tensor?, Tensor?, int?, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mat2", "type": "AnyTorchTensorType" }, { "name": "scale_a", "type": "AnyTorchTensorType" }, { "name": "scale_b", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "scale_result", "type": "AnyTorchOptionalTensorType" }, { "name": "out_dtype", "type": "AnyTorchOptionalIntType" }, { "name": "use_fast_accum", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._scaled_mm_v2", "summary": "Generated op for `aten::_scaled_mm_v2 : (Tensor, Tensor, Tensor[], int[], int[], Tensor[], int[], int[], Tensor?, int?, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mat2", "type": "AnyTorchTensorType" }, { "name": "scale_a", "type": "AnyTorchListOfTensorType" }, { "name": "recipe_a", "type": "AnyTorchListOfTorchIntType" }, { "name": "swizzle_a", "type": "AnyTorchListOfTorchIntType" }, { "name": "scale_b", "type": "AnyTorchListOfTensorType" }, { "name": "recipe_b", "type": "AnyTorchListOfTorchIntType" }, { "name": "swizzle_b", "type": "AnyTorchListOfTorchIntType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "out_dtype", "type": "AnyTorchOptionalIntType" }, { "name": "contraction_dim", "type": "AnyTorchListOfTorchIntType" }, { "name": "use_fast_accum", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._set_item.str", "summary": "Generated op for `aten::_set_item.str : (Dict(str, t), str, t) -> ()`", "operands": [ { "name": "l", "type": "Torch_DictType" }, { "name": "idx", "type": "Torch_StringType" }, { "name": "v", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._set_item.t", "summary": "Generated op for `aten::_set_item.t : (t[], int, t) -> (t[])`", "operands": [ { "name": "l", "type": "AnyTorchListType" }, { "name": "idx", "type": "Torch_IntType" }, { "name": "el", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._shape_as_tensor", "summary": "Generated op for `aten::_shape_as_tensor : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._softmax", "category": "Activation", "summary": "Generated op for `aten::_softmax : (Tensor, int, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "half_to_float", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._softmax_backward_data", "summary": "Generated op for `aten::_softmax_backward_data : (Tensor, Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "output", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "input_dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._to_copy", "summary": "Generated op for `aten::_to_copy : (Tensor, int?, int?, Device?, bool?, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "non_blocking", "type": "Torch_BoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._trilinear", "summary": "Generated op for `aten::_trilinear : (Tensor, Tensor, Tensor, int[], int[], int[], int[], int) -> (Tensor)`", "operands": [ { "name": "i1", "type": "AnyTorchTensorType" }, { "name": "i2", "type": "AnyTorchTensorType" }, { "name": "i3", "type": "AnyTorchTensorType" }, { "name": "expand1", "type": "AnyTorchListOfTorchIntType" }, { "name": "expand2", "type": "AnyTorchListOfTorchIntType" }, { "name": "expand3", "type": "AnyTorchListOfTorchIntType" }, { "name": "sumdim", "type": "AnyTorchListOfTorchIntType" }, { "name": "unroll_dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._unsafe_index_put.hacked_twin", "summary": "Generated op for `aten::_unsafe_index_put.hacked_twin : (Tensor, Tensor[], Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchListOfTensorType" }, { "name": "values", "type": "AnyTorchTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._unsafe_view", "summary": "Generated op for `aten::_unsafe_view : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten._weight_norm_interface", "summary": "Generated op for `aten::_weight_norm_interface : (Tensor, Tensor, int) -> (Tensor, Tensor)`", "operands": [ { "name": "v", "type": "AnyTorchTensorType" }, { "name": "g", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.abs", "summary": "Generated op for `aten::abs : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.abs_", "summary": "Generated op for `aten::abs_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.absolute", "summary": "Generated op for `aten::absolute : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.absolute_", "summary": "Generated op for `aten::absolute_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.acos", "summary": "Generated op for `aten::acos : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.acos_", "summary": "Generated op for `aten::acos_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.acosh", "summary": "Generated op for `aten::acosh : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.acosh_", "summary": "Generated op for `aten::acosh_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.adaptive_avg_pool1d", "summary": "Generated op for `aten::adaptive_avg_pool1d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.adaptive_avg_pool2d", "summary": "Generated op for `aten::adaptive_avg_pool2d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.adaptive_avg_pool3d", "summary": "Generated op for `aten::adaptive_avg_pool3d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.adaptive_max_pool1d", "summary": "Generated op for `aten::adaptive_max_pool1d : (Tensor, int[]) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.adaptive_max_pool2d", "summary": "Generated op for `aten::adaptive_max_pool2d : (Tensor, int[]) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.adaptive_max_pool3d", "summary": "Generated op for `aten::adaptive_max_pool3d : (Tensor, int[]) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add", "summary": "Generated op for `aten::add : (Scalar, Scalar) -> (Scalar)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" }, { "name": "b", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add_.Scalar", "summary": "Generated op for `aten::add_.Scalar : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add_.Tensor", "summary": "Generated op for `aten::add_.Tensor : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.float", "summary": "Generated op for `aten::add.float : (float, float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.float_int", "summary": "Generated op for `aten::add.float_int : (float, int) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.int", "summary": "Generated op for `aten::add.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.Scalar", "summary": "Generated op for `aten::add.Scalar : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.str", "summary": "Generated op for `aten::add.str : (str, str) -> (str)`", "operands": [ { "name": "a", "type": "Torch_StringType" }, { "name": "b", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_StringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.t", "summary": "Generated op for `aten::add.t : (t[], t[]) -> (t[])`", "operands": [ { "name": "a", "type": "AnyTorchListType" }, { "name": "b", "type": "AnyTorchListType" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.add.Tensor", "summary": "Generated op for `aten::add.Tensor : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.addcdiv", "summary": "Generated op for `aten::addcdiv : (Tensor, Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "tensor1", "type": "AnyTorchTensorType" }, { "name": "tensor2", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.addcdiv_", "summary": "Generated op for `aten::addcdiv_ : (Tensor, Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "tensor1", "type": "Torch_NonValueTensorType" }, { "name": "tensor2", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.addcmul", "summary": "Generated op for `aten::addcmul : (Tensor, Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "tensor1", "type": "AnyTorchTensorType" }, { "name": "tensor2", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.addcmul_", "summary": "Generated op for `aten::addcmul_ : (Tensor, Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "tensor1", "type": "Torch_NonValueTensorType" }, { "name": "tensor2", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.addmm", "summary": "Generated op for `aten::addmm : (Tensor, Tensor, Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mat1", "type": "AnyTorchTensorType" }, { "name": "mat2", "type": "AnyTorchTensorType" }, { "name": "beta", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.alias", "summary": "Generated op for `aten::alias : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.alias_copy", "summary": "Generated op for `aten::alias_copy : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.all", "summary": "Generated op for `aten::all : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.all.bool", "summary": "Generated op for `aten::all.bool : (bool[]) -> (bool)`", "operands": [ { "name": "self", "type": "AnyTorchListOfTorchBoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.all.dim", "summary": "Generated op for `aten::all.dim : (Tensor, int, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.amax", "summary": "Generated op for `aten::amax : (Tensor, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.amin", "summary": "Generated op for `aten::amin : (Tensor, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.aminmax", "summary": "Generated op for `aten::aminmax : (Tensor, int?, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "min", "type": "AnyTorchOptionalTensorType" }, { "name": "max", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.any", "summary": "Generated op for `aten::any : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.any.bool", "summary": "Generated op for `aten::any.bool : (bool[]) -> (bool)`", "operands": [ { "name": "self", "type": "AnyTorchListOfTorchBoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.any.dim", "summary": "Generated op for `aten::any.dim : (Tensor, int, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.any.dims", "summary": "Generated op for `aten::any.dims : (Tensor, int[]?, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.append.t", "summary": "Generated op for `aten::append.t : (t[], t) -> (t[])`", "operands": [ { "name": "self", "type": "AnyTorchListType" }, { "name": "el", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.arange", "summary": "Generated op for `aten::arange : (Scalar, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "end", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.arange.start", "summary": "Generated op for `aten::arange.start : (Scalar, Scalar, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "start", "type": "AnyTorchScalarType" }, { "name": "end", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.arange.start_out", "summary": "Generated op for `aten::arange.start_out : (Scalar, Scalar, Scalar, Tensor) -> (Tensor)`", "operands": [ { "name": "start", "type": "AnyTorchScalarType" }, { "name": "end", "type": "AnyTorchScalarType" }, { "name": "step", "type": "AnyTorchScalarType" }, { "name": "out", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.arange.start_step", "summary": "Generated op for `aten::arange.start_step : (Scalar, Scalar, Scalar, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "start", "type": "AnyTorchScalarType" }, { "name": "end", "type": "AnyTorchScalarType" }, { "name": "step", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.argmax", "summary": "Generated op for `aten::argmax : (Tensor, int?, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.argmin", "summary": "Generated op for `aten::argmin : (Tensor, int?, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.argsort", "summary": "Generated op for `aten::argsort : (Tensor, int, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "descending", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.as_strided", "summary": "Generated op for `aten::as_strided : (Tensor, int[], int[], int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "storage_offset", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.as_strided_copy", "summary": "Generated op for `aten::as_strided_copy : (Tensor, int[], int[], int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "storage_offset", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.as_strided_scatter", "summary": "Generated op for `aten::as_strided_scatter : (Tensor, Tensor, int[], int[], int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "storage_offset", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.asin", "summary": "Generated op for `aten::asin : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.asin_", "summary": "Generated op for `aten::asin_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.asinh", "summary": "Generated op for `aten::asinh : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.asinh_", "summary": "Generated op for `aten::asinh_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atan", "summary": "Generated op for `aten::atan : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atan_", "summary": "Generated op for `aten::atan_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atan2", "summary": "Generated op for `aten::atan2 : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atan2_", "summary": "Generated op for `aten::atan2_ : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atanh", "summary": "Generated op for `aten::atanh : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atanh_", "summary": "Generated op for `aten::atanh_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atleast_1d", "summary": "Generated op for `aten::atleast_1d : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.atleast_2d", "summary": "Generated op for `aten::atleast_2d : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.avg_pool1d", "summary": "Generated op for `aten::avg_pool1d : (Tensor, int[], int[], int[], bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "count_include_pad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.avg_pool2d", "summary": "Generated op for `aten::avg_pool2d : (Tensor, int[], int[], int[], bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "count_include_pad", "type": "Torch_BoolType" }, { "name": "divisor_override", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.avg_pool2d_backward", "summary": "Generated op for `aten::avg_pool2d_backward : (Tensor, Tensor, int[], int[], int[], bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "count_include_pad", "type": "Torch_BoolType" }, { "name": "divisor_override", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.avg_pool3d", "summary": "Generated op for `aten::avg_pool3d : (Tensor, int[], int[], int[], bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "count_include_pad", "type": "Torch_BoolType" }, { "name": "divisor_override", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.avg_pool3d_backward", "summary": "Generated op for `aten::avg_pool3d_backward : (Tensor, Tensor, int[], int[], int[], bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "count_include_pad", "type": "Torch_BoolType" }, { "name": "divisor_override", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.baddbmm", "summary": "Generated op for `aten::baddbmm : (Tensor, Tensor, Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "batch1", "type": "AnyTorchTensorType" }, { "name": "batch2", "type": "AnyTorchTensorType" }, { "name": "beta", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.baddbmm_", "summary": "Generated op for `aten::baddbmm_ : (Tensor, Tensor, Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "batch1", "type": "Torch_NonValueTensorType" }, { "name": "batch2", "type": "Torch_NonValueTensorType" }, { "name": "beta", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.batch_norm", "summary": "Generated op for `aten::batch_norm : (Tensor, Tensor?, Tensor?, Tensor?, Tensor?, bool, float, float, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "running_mean", "type": "AnyTorchOptionalTensorType" }, { "name": "running_var", "type": "AnyTorchOptionalTensorType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "momentum", "type": "Torch_FloatType" }, { "name": "eps", "type": "Torch_FloatType" }, { "name": "cudnn_enabled", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bernoulli", "summary": "Generated op for `aten::bernoulli : (Tensor, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bernoulli_.float", "summary": "Generated op for `aten::bernoulli_.float : (Tensor, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bernoulli_.Tensor", "summary": "Generated op for `aten::bernoulli_.Tensor : (Tensor, Tensor, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "p", "type": "Torch_NonValueTensorType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bernoulli.p", "summary": "Generated op for `aten::bernoulli.p : (Tensor, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bernoulli.Tensor", "summary": "Generated op for `aten::bernoulli.Tensor : (Tensor, Tensor, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "AnyTorchTensorType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bilinear", "summary": "Generated op for `aten::bilinear : (Tensor, Tensor, Tensor, Tensor?) -> (Tensor)`", "operands": [ { "name": "input1", "type": "AnyTorchTensorType" }, { "name": "input2", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.binary_cross_entropy", "summary": "Generated op for `aten::binary_cross_entropy : (Tensor, Tensor, Tensor?, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.binary_cross_entropy_backward", "summary": "Generated op for `aten::binary_cross_entropy_backward : (Tensor, Tensor, Tensor, Tensor?, int) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.binary_cross_entropy_with_logits", "summary": "Generated op for `aten::binary_cross_entropy_with_logits : (Tensor, Tensor, Tensor?, Tensor?, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "pos_weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bincount", "summary": "Generated op for `aten::bincount : (Tensor, Tensor?, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "weights", "type": "AnyTorchOptionalTensorType" }, { "name": "minlength", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_and_.Scalar", "summary": "Generated op for `aten::bitwise_and_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_and_.Tensor", "summary": "Generated op for `aten::bitwise_and_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_and.Scalar", "summary": "Generated op for `aten::bitwise_and.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_and.Tensor", "summary": "Generated op for `aten::bitwise_and.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_left_shift_.Tensor", "summary": "Generated op for `aten::bitwise_left_shift_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_left_shift.Tensor", "summary": "Generated op for `aten::bitwise_left_shift.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_not", "summary": "Generated op for `aten::bitwise_not : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_not_", "summary": "Generated op for `aten::bitwise_not_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_or_.Tensor", "summary": "Generated op for `aten::bitwise_or_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_or.Tensor", "summary": "Generated op for `aten::bitwise_or.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_right_shift_.Tensor", "summary": "Generated op for `aten::bitwise_right_shift_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_right_shift.Tensor", "summary": "Generated op for `aten::bitwise_right_shift.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_xor_.Tensor", "summary": "Generated op for `aten::bitwise_xor_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bitwise_xor.Tensor", "summary": "Generated op for `aten::bitwise_xor.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bmm", "summary": "Generated op for `aten::bmm : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mat2", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Bool.float", "summary": "Generated op for `aten::Bool.float : (float) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Bool.int", "summary": "Generated op for `aten::Bool.int : (int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Bool.Tensor", "summary": "Generated op for `aten::Bool.Tensor : (Tensor) -> (bool)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.broadcast_tensors", "summary": "Generated op for `aten::broadcast_tensors : (Tensor[]) -> (Tensor[])`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.broadcast_to", "summary": "Generated op for `aten::broadcast_to : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.bucketize.Tensor", "summary": "Generated op for `aten::bucketize.Tensor : (Tensor, Tensor, bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "boundaries", "type": "AnyTorchTensorType" }, { "name": "out_int32", "type": "Torch_BoolType" }, { "name": "right", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cat", "summary": "Generated op for `aten::cat : (Tensor[], int) -> (Tensor)`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ceil", "summary": "Generated op for `aten::ceil : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ceil_", "summary": "Generated op for `aten::ceil_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ceil.float", "summary": "Generated op for `aten::ceil.float : (float) -> (int)`", "operands": [ { "name": "a", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ceil.Scalar", "summary": "Generated op for `aten::ceil.Scalar : (Scalar) -> (Scalar)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.celu", "summary": "Generated op for `aten::celu : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.celu_", "summary": "Generated op for `aten::celu_ : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.channel_shuffle", "summary": "Generated op for `aten::channel_shuffle : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.chunk", "summary": "Generated op for `aten::chunk : (Tensor, int, int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "chunks", "type": "Torch_IntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp", "category": "Activation", "summary": "Generated op for `aten::clamp : (Tensor, Scalar?, Scalar?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "min", "type": "AnyTorchOptionalScalarType" }, { "name": "max", "type": "AnyTorchOptionalScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_", "summary": "Generated op for `aten::clamp_ : (Tensor, Scalar?, Scalar?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "min", "type": "AnyTorchOptionalScalarType" }, { "name": "max", "type": "AnyTorchOptionalScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_.Tensor", "summary": "Generated op for `aten::clamp_.Tensor : (Tensor, Tensor?, Tensor?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "min", "type": "AnyTorchOptionalNonValueTensorType" }, { "name": "max", "type": "AnyTorchOptionalNonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_max", "summary": "Generated op for `aten::clamp_max : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "max", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_max_", "summary": "Generated op for `aten::clamp_max_ : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "max", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_max_.Tensor", "summary": "Generated op for `aten::clamp_max_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "max", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_max.Tensor", "summary": "Generated op for `aten::clamp_max.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "max", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_min", "summary": "Generated op for `aten::clamp_min : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "min", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_min_", "summary": "Generated op for `aten::clamp_min_ : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "min", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_min_.Tensor", "summary": "Generated op for `aten::clamp_min_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "min", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp_min.Tensor", "summary": "Generated op for `aten::clamp_min.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "min", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clamp.Tensor", "summary": "Generated op for `aten::clamp.Tensor : (Tensor, Tensor?, Tensor?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "min", "type": "AnyTorchOptionalTensorType" }, { "name": "max", "type": "AnyTorchOptionalTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.clone", "summary": "Generated op for `aten::clone : (Tensor, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.col2im", "summary": "Generated op for `aten::col2im : (Tensor, int[], int[], int[], int[], int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.column_stack", "summary": "Generated op for `aten::column_stack : (Tensor[]) -> (Tensor)`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.complex", "summary": "Generated op for `aten::complex : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "real", "type": "AnyTorchTensorType" }, { "name": "imag", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.constant_pad_nd", "summary": "Generated op for `aten::constant_pad_nd : (Tensor, int[], Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "pad", "type": "AnyTorchListOfTorchIntType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.contiguous", "summary": "Generated op for `aten::contiguous : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "memory_format", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv_tbc", "summary": "Generated op for `aten::conv_tbc : (Tensor, Tensor, Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchTensorType" }, { "name": "pad", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv_tbc_backward", "summary": "Generated op for `aten::conv_tbc_backward : (Tensor, Tensor, Tensor, Tensor, int) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchTensorType" }, { "name": "pad", "type": "Torch_IntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv_transpose1d", "summary": "Generated op for `aten::conv_transpose1d : (Tensor, Tensor, Tensor?, int[], int[], int[], int, int[]) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv_transpose2d.input", "summary": "Generated op for `aten::conv_transpose2d.input : (Tensor, Tensor, Tensor?, int[], int[], int[], int, int[]) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv_transpose3d.input", "summary": "Generated op for `aten::conv_transpose3d.input : (Tensor, Tensor, Tensor?, int[], int[], int[], int, int[]) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv1d", "summary": "Generated op for `aten::conv1d : (Tensor, Tensor, Tensor?, int[], int[], int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv1d.padding", "summary": "Generated op for `aten::conv1d.padding : (Tensor, Tensor, Tensor?, int[], str, int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "Torch_StringType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv2d", "category": "Layer", "summary": "Generated op for `aten::conv2d : (Tensor, Tensor, Tensor?, int[], int[], int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv2d.padding", "summary": "Generated op for `aten::conv2d.padding : (Tensor, Tensor, Tensor?, int[], str, int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "Torch_StringType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv3d", "category": "Layer", "summary": "Generated op for `aten::conv3d : (Tensor, Tensor, Tensor?, int[], int[], int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.conv3d.padding", "summary": "Generated op for `aten::conv3d.padding : (Tensor, Tensor, Tensor?, int[], str, int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "Torch_StringType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.convolution", "category": "Layer", "summary": "Generated op for `aten::convolution : (Tensor, Tensor, Tensor?, int[], int[], int[], bool, int[], int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "transposed", "type": "Torch_BoolType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.convolution_backward", "summary": "Generated op for `aten::convolution_backward : (Tensor, Tensor, Tensor, int[]?, int[], int[], int[], bool, int[], int, bool[]) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias_sizes", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "transposed", "type": "Torch_BoolType" }, { "name": "output_padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "output_mask", "type": "AnyTorchListOfTorchBoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.copy", "summary": "Generated op for `aten::copy : (Tensor, Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "non_blocking", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.copy_", "summary": "Generated op for `aten::copy_ : (Tensor, Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "src", "type": "Torch_NonValueTensorType" }, { "name": "non_blocking", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.copysign_.Tensor", "summary": "Generated op for `aten::copysign_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.copysign.Tensor", "summary": "Generated op for `aten::copysign.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cos", "summary": "Generated op for `aten::cos : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cos_", "summary": "Generated op for `aten::cos_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cosh", "summary": "Generated op for `aten::cosh : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cosh_", "summary": "Generated op for `aten::cosh_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cosine_embedding_loss", "summary": "Generated op for `aten::cosine_embedding_loss : (Tensor, Tensor, Tensor, float, int) -> (Tensor)`", "operands": [ { "name": "input1", "type": "AnyTorchTensorType" }, { "name": "input2", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "margin", "type": "Torch_FloatType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cosine_similarity", "summary": "Generated op for `aten::cosine_similarity : (Tensor, Tensor, int, float) -> (Tensor)`", "operands": [ { "name": "x1", "type": "AnyTorchTensorType" }, { "name": "x2", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "eps", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.count_nonzero", "summary": "Generated op for `aten::count_nonzero : (Tensor, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.count_nonzero.dim_IntList", "summary": "Generated op for `aten::count_nonzero.dim_IntList : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cpu", "summary": "Generated op for `aten::cpu : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cross_entropy_loss", "summary": "Generated op for `aten::cross_entropy_loss : (Tensor, Tensor, Tensor?, int, int, float) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" }, { "name": "ignore_index", "type": "Torch_IntType" }, { "name": "label_smoothing", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cuda", "summary": "Generated op for `aten::cuda : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cumprod", "summary": "Generated op for `aten::cumprod : (Tensor, int, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.cumsum", "summary": "Generated op for `aten::cumsum : (Tensor, int, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.deg2rad", "summary": "Generated op for `aten::deg2rad : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Delete.Dict_str", "summary": "Generated op for `aten::Delete.Dict_str : (Dict(str, t), str) -> ()`", "operands": [ { "name": "self", "type": "Torch_DictType" }, { "name": "key", "type": "Torch_StringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.dequantize.self", "summary": "Generated op for `aten::dequantize.self : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.dequantize.tensor", "summary": "Generated op for `aten::dequantize.tensor : (Tensor) -> (Tensor)`", "operands": [ { "name": "qtensor", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.detach", "summary": "Generated op for `aten::detach : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.detach_copy", "summary": "Generated op for `aten::detach_copy : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.device.with_index", "summary": "Generated op for `aten::device.with_index : (str, int) -> (Device)`", "operands": [ { "name": "type", "type": "Torch_StringType" }, { "name": "index", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_DeviceType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.diag_embed", "summary": "Generated op for `aten::diag_embed : (Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "offset", "type": "Torch_IntType" }, { "name": "dim1", "type": "Torch_IntType" }, { "name": "dim2", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.diagonal", "summary": "Generated op for `aten::diagonal : (Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "offset", "type": "Torch_IntType" }, { "name": "dim1", "type": "Torch_IntType" }, { "name": "dim2", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.diagonal_copy", "summary": "Generated op for `aten::diagonal_copy : (Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "offset", "type": "Torch_IntType" }, { "name": "dim1", "type": "Torch_IntType" }, { "name": "dim2", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.diagonal_scatter", "summary": "Generated op for `aten::diagonal_scatter : (Tensor, Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "offset", "type": "Torch_IntType" }, { "name": "dim1", "type": "Torch_IntType" }, { "name": "dim2", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.dim", "summary": "Generated op for `aten::dim : (Tensor) -> (int)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div", "summary": "Generated op for `aten::div : (Scalar, Scalar) -> (float)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" }, { "name": "b", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div_.Scalar", "summary": "Generated op for `aten::div_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div_.Scalar_mode", "summary": "Generated op for `aten::div_.Scalar_mode : (Tensor, Scalar, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "rounding_mode", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div_.Tensor", "summary": "Generated op for `aten::div_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div_.Tensor_mode", "summary": "Generated op for `aten::div_.Tensor_mode : (Tensor, Tensor, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" }, { "name": "rounding_mode", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div.float", "summary": "Generated op for `aten::div.float : (float, float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div.int", "summary": "Generated op for `aten::div.int : (int, int) -> (float)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div.Scalar", "summary": "Generated op for `aten::div.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div.Scalar_mode", "summary": "Generated op for `aten::div.Scalar_mode : (Tensor, Scalar, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "rounding_mode", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div.Tensor", "summary": "Generated op for `aten::div.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.div.Tensor_mode", "summary": "Generated op for `aten::div.Tensor_mode : (Tensor, Tensor, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" }, { "name": "rounding_mode", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.dot", "summary": "Generated op for `aten::dot : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "tensor", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.dropout", "summary": "Generated op for `aten::dropout : (Tensor, float, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "p", "type": "Torch_FloatType" }, { "name": "train", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.dropout_", "summary": "Generated op for `aten::dropout_ : (Tensor, float, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "p", "type": "Torch_FloatType" }, { "name": "train", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.einsum", "summary": "Generated op for `aten::einsum : (str, Tensor[], int[]?) -> (Tensor)`", "operands": [ { "name": "equation", "type": "Torch_StringType" }, { "name": "tensors", "type": "AnyTorchListOfTensorType" }, { "name": "path", "type": "AnyTorchOptionalListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.elu", "summary": "Generated op for `aten::elu : (Tensor, Scalar, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" }, { "name": "scale", "type": "AnyTorchScalarType" }, { "name": "input_scale", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.elu_", "summary": "Generated op for `aten::elu_ : (Tensor, Scalar, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" }, { "name": "scale", "type": "AnyTorchScalarType" }, { "name": "input_scale", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.elu_backward", "summary": "Generated op for `aten::elu_backward : (Tensor, Scalar, Scalar, Scalar, bool, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" }, { "name": "scale", "type": "AnyTorchScalarType" }, { "name": "input_scale", "type": "AnyTorchScalarType" }, { "name": "is_result", "type": "Torch_BoolType" }, { "name": "self_or_result", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.embedding", "category": "Transform", "summary": "Generated op for `aten::embedding : (Tensor, Tensor, int, bool, bool) -> (Tensor)`", "operands": [ { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchTensorType" }, { "name": "padding_idx", "type": "Torch_IntType" }, { "name": "scale_grad_by_freq", "type": "Torch_BoolType" }, { "name": "sparse", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.embedding_bag.padding_idx", "summary": "Generated op for `aten::embedding_bag.padding_idx : (Tensor, Tensor, Tensor, bool, int, bool, Tensor?, bool, int?) -> (Tensor, Tensor, Tensor, Tensor)`", "operands": [ { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchTensorType" }, { "name": "offsets", "type": "AnyTorchTensorType" }, { "name": "scale_grad_by_freq", "type": "Torch_BoolType" }, { "name": "mode", "type": "Torch_IntType" }, { "name": "sparse", "type": "Torch_BoolType" }, { "name": "per_sample_weights", "type": "AnyTorchOptionalTensorType" }, { "name": "include_last_offset", "type": "Torch_BoolType" }, { "name": "padding_idx", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" }, { "name": "result3", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.embedding_dense_backward", "summary": "Generated op for `aten::embedding_dense_backward : (Tensor, Tensor, int, int, bool) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchTensorType" }, { "name": "num_weights", "type": "Torch_IntType" }, { "name": "padding_idx", "type": "Torch_IntType" }, { "name": "scale_grad_by_freq", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.empty_like", "summary": "Generated op for `aten::empty_like : (Tensor, int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.empty_strided", "summary": "Generated op for `aten::empty_strided : (int[], int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.empty.memory_format", "summary": "Generated op for `aten::empty.memory_format : (int[], int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq_.Scalar", "summary": "Generated op for `aten::eq_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq_.Tensor", "summary": "Generated op for `aten::eq_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.bool", "summary": "Generated op for `aten::eq.bool : (bool, bool) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_BoolType" }, { "name": "b", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.device", "summary": "Generated op for `aten::eq.device : (Device, Device) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_DeviceType" }, { "name": "b", "type": "Torch_DeviceType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.float", "summary": "Generated op for `aten::eq.float : (float, float) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.int", "summary": "Generated op for `aten::eq.int : (int, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.int_list", "summary": "Generated op for `aten::eq.int_list : (int[], int[]) -> (bool)`", "operands": [ { "name": "a", "type": "AnyTorchListOfTorchIntType" }, { "name": "b", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.Scalar", "summary": "Generated op for `aten::eq.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.str", "summary": "Generated op for `aten::eq.str : (str, str) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_StringType" }, { "name": "b", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eq.Tensor", "summary": "Generated op for `aten::eq.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.erf", "summary": "Generated op for `aten::erf : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.erf_", "summary": "Generated op for `aten::erf_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.erfinv", "summary": "Generated op for `aten::erfinv : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.erfinv_", "summary": "Generated op for `aten::erfinv_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.exp", "summary": "Generated op for `aten::exp : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.exp_", "summary": "Generated op for `aten::exp_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.exp2", "summary": "Generated op for `aten::exp2 : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.exp2_", "summary": "Generated op for `aten::exp2_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.expand", "summary": "Generated op for `aten::expand : (Tensor, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "implicit", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.expand_as", "summary": "Generated op for `aten::expand_as : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.expand_copy", "summary": "Generated op for `aten::expand_copy : (Tensor, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "implicit", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.expm1", "summary": "Generated op for `aten::expm1 : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.expm1_", "summary": "Generated op for `aten::expm1_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.exponential", "summary": "Generated op for `aten::exponential : (Tensor, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "lambd", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eye", "summary": "Generated op for `aten::eye : (int, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "n", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.eye.m", "summary": "Generated op for `aten::eye.m : (int, int, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "n", "type": "Torch_IntType" }, { "name": "m", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fake_quantize_per_channel_affine", "summary": "Generated op for `aten::fake_quantize_per_channel_affine : (Tensor, Tensor, Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "AnyTorchTensorType" }, { "name": "zero_point", "type": "AnyTorchTensorType" }, { "name": "axis", "type": "Torch_IntType" }, { "name": "quant_min", "type": "Torch_IntType" }, { "name": "quant_max", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fake_quantize_per_channel_affine_cachemask", "summary": "Generated op for `aten::fake_quantize_per_channel_affine_cachemask : (Tensor, Tensor, Tensor, int, int, int) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "AnyTorchTensorType" }, { "name": "zero_point", "type": "AnyTorchTensorType" }, { "name": "axis", "type": "Torch_IntType" }, { "name": "quant_min", "type": "Torch_IntType" }, { "name": "quant_max", "type": "Torch_IntType" } ], "results": [ { "name": "output", "type": "AnyTorchOptionalTensorType" }, { "name": "mask", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fake_quantize_per_tensor_affine", "summary": "Generated op for `aten::fake_quantize_per_tensor_affine : (Tensor, float, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "Torch_FloatType" }, { "name": "zero_point", "type": "Torch_IntType" }, { "name": "quant_min", "type": "Torch_IntType" }, { "name": "quant_max", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fake_quantize_per_tensor_affine_cachemask", "summary": "Generated op for `aten::fake_quantize_per_tensor_affine_cachemask : (Tensor, float, int, int, int) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "Torch_FloatType" }, { "name": "zero_point", "type": "Torch_IntType" }, { "name": "quant_min", "type": "Torch_IntType" }, { "name": "quant_max", "type": "Torch_IntType" } ], "results": [ { "name": "output", "type": "AnyTorchOptionalTensorType" }, { "name": "mask", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fake_quantize_per_tensor_affine.tensor_qparams", "summary": "Generated op for `aten::fake_quantize_per_tensor_affine.tensor_qparams : (Tensor, Tensor, Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "AnyTorchTensorType" }, { "name": "zero_point", "type": "AnyTorchTensorType" }, { "name": "quant_min", "type": "Torch_IntType" }, { "name": "quant_max", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fft_fft", "summary": "Generated op for `aten::fft_fft : (Tensor, int?, int, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "n", "type": "AnyTorchOptionalIntType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "norm", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fft_ifft", "summary": "Generated op for `aten::fft_ifft : (Tensor, int?, int, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "n", "type": "AnyTorchOptionalIntType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "norm", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fft_rfft", "summary": "Generated op for `aten::fft_rfft : (Tensor, int?, int, str?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "n", "type": "AnyTorchOptionalIntType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "norm", "type": "AnyTorchOptionalStringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fill_.Scalar", "summary": "Generated op for `aten::fill_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fill_.Tensor", "summary": "Generated op for `aten::fill_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fill.Scalar", "summary": "Generated op for `aten::fill.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fill.Tensor", "summary": "Generated op for `aten::fill.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fix", "summary": "Generated op for `aten::fix : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fix_", "summary": "Generated op for `aten::fix_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.flatten.using_ints", "summary": "Generated op for `aten::flatten.using_ints : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "start_dim", "type": "Torch_IntType" }, { "name": "end_dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.flip", "summary": "Generated op for `aten::flip : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fliplr", "summary": "Generated op for `aten::fliplr : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.flipud", "summary": "Generated op for `aten::flipud : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.float_power.Tensor_Tensor", "summary": "Generated op for `aten::float_power.Tensor_Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "exponent", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Float.Scalar", "summary": "Generated op for `aten::Float.Scalar : (Scalar) -> (float)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Float.str", "summary": "Generated op for `aten::Float.str : (str) -> (float)`", "operands": [ { "name": "a", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Float.Tensor", "summary": "Generated op for `aten::Float.Tensor : (Tensor) -> (float)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.FloatImplicit", "summary": "Generated op for `aten::FloatImplicit : (Tensor) -> (float)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.floor", "summary": "Generated op for `aten::floor : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.floor_", "summary": "Generated op for `aten::floor_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.floor_divide", "summary": "Generated op for `aten::floor_divide : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.floor_divide.Scalar", "summary": "Generated op for `aten::floor_divide.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.floordiv.int", "summary": "Generated op for `aten::floordiv.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fmax", "summary": "Generated op for `aten::fmax : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fmin", "summary": "Generated op for `aten::fmin : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fmod_.Scalar", "summary": "Generated op for `aten::fmod_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fmod.Scalar", "summary": "Generated op for `aten::fmod.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.fmod.Tensor", "summary": "Generated op for `aten::fmod.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.format", "summary": "Generated op for `aten::format : (...) -> (str)`", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Torch_StringType" } ], "assemblyFormat": "`(` $operands `)` attr-dict `:` qualified(type($operands)) `->` qualified(type($result))" }, { "name": "torch.aten.frac", "summary": "Generated op for `aten::frac : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.frac_", "summary": "Generated op for `aten::frac_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.frobenius_norm.dim", "summary": "Generated op for `aten::frobenius_norm.dim : (Tensor, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.full", "summary": "Generated op for `aten::full : (int[], Scalar, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "fill_value", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.full_like", "summary": "Generated op for `aten::full_like : (Tensor, Scalar, int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "fill_value", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gather", "category": "Tensor", "summary": "Generated op for `aten::gather : (Tensor, int, Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" }, { "name": "sparse_grad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge_.Scalar", "summary": "Generated op for `aten::ge_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge_.Tensor", "summary": "Generated op for `aten::ge_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge.float", "summary": "Generated op for `aten::ge.float : (float, float) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge.float_int", "summary": "Generated op for `aten::ge.float_int : (float, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge.int", "summary": "Generated op for `aten::ge.int : (int, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge.Scalar", "summary": "Generated op for `aten::ge.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ge.Tensor", "summary": "Generated op for `aten::ge.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gelu", "summary": "Generated op for `aten::gelu : (Tensor, str) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "approximate", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gelu_backward", "summary": "Generated op for `aten::gelu_backward : (Tensor, Tensor, str) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "approximate", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.get.default_str", "summary": "Generated op for `aten::get.default_str : (Dict(str, t), str, t) -> (t)`", "operands": [ { "name": "self", "type": "Torch_DictType" }, { "name": "key", "type": "Torch_StringType" }, { "name": "default_value", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.glu", "summary": "Generated op for `aten::glu : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.grid_sampler", "summary": "Generated op for `aten::grid_sampler : (Tensor, Tensor, int, int, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "grid", "type": "AnyTorchTensorType" }, { "name": "interpolation_mode", "type": "Torch_IntType" }, { "name": "padding_mode", "type": "Torch_IntType" }, { "name": "align_corners", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.group_norm", "summary": "Generated op for `aten::group_norm : (Tensor, int, Tensor?, Tensor?, float, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "num_groups", "type": "Torch_IntType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "eps", "type": "Torch_FloatType" }, { "name": "cudnn_enabled", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt_.Scalar", "summary": "Generated op for `aten::gt_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt_.Tensor", "summary": "Generated op for `aten::gt_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt.float", "summary": "Generated op for `aten::gt.float : (float, float) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt.float_int", "summary": "Generated op for `aten::gt.float_int : (float, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt.int", "summary": "Generated op for `aten::gt.int : (int, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt.Scalar", "summary": "Generated op for `aten::gt.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.gt.Tensor", "summary": "Generated op for `aten::gt.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hann_window.periodic", "summary": "Generated op for `aten::hann_window.periodic : (int, bool, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "window_length", "type": "Torch_IntType" }, { "name": "periodic", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardshrink", "summary": "Generated op for `aten::hardshrink : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "lambd", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardsigmoid", "summary": "Generated op for `aten::hardsigmoid : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardsigmoid_", "summary": "Generated op for `aten::hardsigmoid_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardswish", "summary": "Generated op for `aten::hardswish : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardswish_", "summary": "Generated op for `aten::hardswish_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardtanh", "summary": "Generated op for `aten::hardtanh : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "min_val", "type": "AnyTorchScalarType" }, { "name": "max_val", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardtanh_", "summary": "Generated op for `aten::hardtanh_ : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "min_val", "type": "AnyTorchScalarType" }, { "name": "max_val", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hardtanh_backward", "summary": "Generated op for `aten::hardtanh_backward : (Tensor, Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "min_val", "type": "AnyTorchScalarType" }, { "name": "max_val", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.heaviside", "summary": "Generated op for `aten::heaviside : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "values", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.heaviside_", "summary": "Generated op for `aten::heaviside_ : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "values", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.hstack", "summary": "Generated op for `aten::hstack : (Tensor[]) -> (Tensor)`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.im2col", "summary": "Generated op for `aten::im2col : (Tensor, int[], int[], int[], int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.imag", "summary": "Generated op for `aten::imag : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index_put", "summary": "Generated op for `aten::index_put : (Tensor, Tensor?[], Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchListOfOptionalTensorType" }, { "name": "values", "type": "AnyTorchTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index_put_", "summary": "Generated op for `aten::index_put_ : (Tensor, Tensor?[], Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "indices", "type": "AnyTorchListOfOptionalNonValueTensorType" }, { "name": "values", "type": "Torch_NonValueTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index_put_.hacked_twin", "summary": "Generated op for `aten::index_put_.hacked_twin : (Tensor, Tensor[], Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "indices", "type": "AnyTorchListOfNonValueTensorType" }, { "name": "values", "type": "Torch_NonValueTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index_put.hacked_twin", "summary": "Generated op for `aten::index_put.hacked_twin : (Tensor, Tensor[], Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchListOfTensorType" }, { "name": "values", "type": "AnyTorchTensorType" }, { "name": "accumulate", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index_select", "summary": "Generated op for `aten::index_select : (Tensor, int, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index.Tensor", "summary": "Generated op for `aten::index.Tensor : (Tensor, Tensor?[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchListOfOptionalTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.index.Tensor_hacked_twin", "summary": "Generated op for `aten::index.Tensor_hacked_twin : (Tensor, Tensor[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchListOfTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.insert.t", "summary": "Generated op for `aten::insert.t : (t[], int, t) -> ()`", "operands": [ { "name": "self", "type": "AnyTorchListType" }, { "name": "idx", "type": "Torch_IntType" }, { "name": "el", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.instance_norm", "summary": "Generated op for `aten::instance_norm : (Tensor, Tensor?, Tensor?, Tensor?, Tensor?, bool, float, float, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "running_mean", "type": "AnyTorchOptionalTensorType" }, { "name": "running_var", "type": "AnyTorchOptionalTensorType" }, { "name": "use_input_stats", "type": "Torch_BoolType" }, { "name": "momentum", "type": "Torch_FloatType" }, { "name": "eps", "type": "Torch_FloatType" }, { "name": "cudnn_enabled", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.int_repr", "summary": "Generated op for `aten::int_repr : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Int.bool", "summary": "Generated op for `aten::Int.bool : (bool) -> (int)`", "operands": [ { "name": "a", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Int.float", "summary": "Generated op for `aten::Int.float : (float) -> (int)`", "operands": [ { "name": "a", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Int.Scalar", "summary": "Generated op for `aten::Int.Scalar : (Scalar) -> (int)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.Int.Tensor", "summary": "Generated op for `aten::Int.Tensor : (Tensor) -> (int)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.IntImplicit", "summary": "Generated op for `aten::IntImplicit : (Tensor) -> (int)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.is_floating_point", "summary": "Generated op for `aten::is_floating_point : (Tensor) -> (bool)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.isclose", "summary": "Generated op for `aten::isclose : (Tensor, Tensor, float, float, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" }, { "name": "rtol", "type": "Torch_FloatType" }, { "name": "atol", "type": "Torch_FloatType" }, { "name": "equal_nan", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.isfinite", "summary": "Generated op for `aten::isfinite : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.isinf", "summary": "Generated op for `aten::isinf : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.isnan", "summary": "Generated op for `aten::isnan : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.isneginf", "summary": "Generated op for `aten::isneginf : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.isposinf", "summary": "Generated op for `aten::isposinf : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.item", "summary": "Generated op for `aten::item : (Tensor) -> (Scalar)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.join", "summary": "Generated op for `aten::join : (str, str[]) -> (str)`", "operands": [ { "name": "self", "type": "Torch_StringType" }, { "name": "values", "type": "AnyTorchListOfTorchStringType" } ], "results": [ { "name": "result", "type": "Torch_StringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.keys.str", "summary": "Generated op for `aten::keys.str : (Dict(str, t)) -> (str[])`", "operands": [ { "name": "self", "type": "Torch_DictType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTorchStringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.kl_div", "summary": "Generated op for `aten::kl_div : (Tensor, Tensor, int, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "reduction", "type": "Torch_IntType" }, { "name": "log_target", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.kthvalue", "summary": "Generated op for `aten::kthvalue : (Tensor, int, int, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "k", "type": "Torch_IntType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "values", "type": "AnyTorchOptionalTensorType" }, { "name": "indices", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.l1_loss", "summary": "Generated op for `aten::l1_loss : (Tensor, Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.layer_norm", "summary": "Generated op for `aten::layer_norm : (Tensor, int[], Tensor?, Tensor?, float, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "normalized_shape", "type": "AnyTorchListOfTorchIntType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "eps", "type": "Torch_FloatType" }, { "name": "cudnn_enable", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ldexp.Tensor", "summary": "Generated op for `aten::ldexp.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.le_.Scalar", "summary": "Generated op for `aten::le_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.le_.Tensor", "summary": "Generated op for `aten::le_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.le.int", "summary": "Generated op for `aten::le.int : (int, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.le.Scalar", "summary": "Generated op for `aten::le.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.le.Tensor", "summary": "Generated op for `aten::le.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.leaky_relu", "summary": "Generated op for `aten::leaky_relu : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "negative_slope", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.leaky_relu_", "summary": "Generated op for `aten::leaky_relu_ : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "negative_slope", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.leaky_relu_backward", "summary": "Generated op for `aten::leaky_relu_backward : (Tensor, Tensor, Scalar, bool) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "negative_slope", "type": "AnyTorchScalarType" }, { "name": "self_is_result", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.len.str", "summary": "Generated op for `aten::len.str : (str) -> (int)`", "operands": [ { "name": "s", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.len.t", "summary": "Generated op for `aten::len.t : (t[]) -> (int)`", "operands": [ { "name": "a", "type": "AnyTorchListType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.len.Tensor", "summary": "Generated op for `aten::len.Tensor : (Tensor) -> (int)`", "operands": [ { "name": "t", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lerp_.Scalar", "summary": "Generated op for `aten::lerp_.Scalar : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "end", "type": "Torch_NonValueTensorType" }, { "name": "weight", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lerp_.Tensor", "summary": "Generated op for `aten::lerp_.Tensor : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "end", "type": "Torch_NonValueTensorType" }, { "name": "weight", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lerp.Scalar", "summary": "Generated op for `aten::lerp.Scalar : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "end", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lerp.Tensor", "summary": "Generated op for `aten::lerp.Tensor : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "end", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lift_fresh_copy", "summary": "Generated op for `aten::lift_fresh_copy : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linalg_cross", "summary": "Generated op for `aten::linalg_cross : (Tensor, Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linalg_det", "summary": "Generated op for `aten::linalg_det : (Tensor) -> (Tensor)`", "operands": [ { "name": "A", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linalg_norm", "summary": "Generated op for `aten::linalg_norm : (Tensor, Scalar?, int[]?, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "ord", "type": "AnyTorchOptionalScalarType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linalg_qr", "summary": "Generated op for `aten::linalg_qr : (Tensor, str) -> (Tensor, Tensor)`", "operands": [ { "name": "A", "type": "AnyTorchTensorType" }, { "name": "mode", "type": "Torch_StringType" } ], "results": [ { "name": "Q", "type": "AnyTorchOptionalTensorType" }, { "name": "R", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linalg_slogdet", "summary": "Generated op for `aten::linalg_slogdet : (Tensor) -> (Tensor, Tensor)`", "operands": [ { "name": "A", "type": "AnyTorchTensorType" } ], "results": [ { "name": "sign", "type": "AnyTorchOptionalTensorType" }, { "name": "logabsdet", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linalg_vector_norm", "summary": "Generated op for `aten::linalg_vector_norm : (Tensor, Scalar, int[]?, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "ord", "type": "AnyTorchScalarType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linear", "summary": "Generated op for `aten::linear : (Tensor, Tensor, Tensor?) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.linspace", "summary": "Generated op for `aten::linspace : (Scalar, Scalar, int, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "start", "type": "AnyTorchScalarType" }, { "name": "end", "type": "AnyTorchScalarType" }, { "name": "steps", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.list.t", "summary": "Generated op for `aten::list.t : (t[]) -> (t[])`", "operands": [ { "name": "l", "type": "AnyTorchListType" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log", "summary": "Generated op for `aten::log : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log_", "summary": "Generated op for `aten::log_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log_sigmoid", "summary": "Generated op for `aten::log_sigmoid : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log_sigmoid_backward", "summary": "Generated op for `aten::log_sigmoid_backward : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "buffer", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log_sigmoid_forward", "summary": "Generated op for `aten::log_sigmoid_forward : (Tensor) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "output", "type": "AnyTorchOptionalTensorType" }, { "name": "buffer", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log_softmax.int", "summary": "Generated op for `aten::log_softmax.int : (Tensor, int, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log.int", "summary": "Generated op for `aten::log.int : (int) -> (float)`", "operands": [ { "name": "a", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log10", "summary": "Generated op for `aten::log10 : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log10_", "summary": "Generated op for `aten::log10_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log1p", "summary": "Generated op for `aten::log1p : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log1p_", "summary": "Generated op for `aten::log1p_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log2", "summary": "Generated op for `aten::log2 : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.log2_", "summary": "Generated op for `aten::log2_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logaddexp", "summary": "Generated op for `aten::logaddexp : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logaddexp2", "summary": "Generated op for `aten::logaddexp2 : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logcumsumexp", "summary": "Generated op for `aten::logcumsumexp : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_and", "summary": "Generated op for `aten::logical_and : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_and_", "summary": "Generated op for `aten::logical_and_ : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_not", "summary": "Generated op for `aten::logical_not : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_not_", "summary": "Generated op for `aten::logical_not_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_or", "summary": "Generated op for `aten::logical_or : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_or_", "summary": "Generated op for `aten::logical_or_ : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_xor", "summary": "Generated op for `aten::logical_xor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logical_xor_", "summary": "Generated op for `aten::logical_xor_ : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logit", "summary": "Generated op for `aten::logit : (Tensor, float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "eps", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logit_", "summary": "Generated op for `aten::logit_ : (Tensor, float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "eps", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.logsumexp", "summary": "Generated op for `aten::logsumexp : (Tensor, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt_.Scalar", "summary": "Generated op for `aten::lt_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt_.Tensor", "summary": "Generated op for `aten::lt_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt.float", "summary": "Generated op for `aten::lt.float : (float, float) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt.float_int", "summary": "Generated op for `aten::lt.float_int : (float, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt.int", "summary": "Generated op for `aten::lt.int : (int, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt.Scalar", "summary": "Generated op for `aten::lt.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.lt.Tensor", "summary": "Generated op for `aten::lt.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_fill_.Scalar", "summary": "Generated op for `aten::masked_fill_.Scalar : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "mask", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_fill_.Tensor", "summary": "Generated op for `aten::masked_fill_.Tensor : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "mask", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_fill.Scalar", "summary": "Generated op for `aten::masked_fill.Scalar : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mask", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_fill.Tensor", "summary": "Generated op for `aten::masked_fill.Tensor : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mask", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_scatter", "summary": "Generated op for `aten::masked_scatter : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mask", "type": "AnyTorchTensorType" }, { "name": "source", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_scatter_", "summary": "Generated op for `aten::masked_scatter_ : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "mask", "type": "Torch_NonValueTensorType" }, { "name": "source", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.masked_select", "summary": "Generated op for `aten::masked_select : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mask", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.matmul", "summary": "Generated op for `aten::matmul : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max", "summary": "Generated op for `aten::max : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool1d", "summary": "Generated op for `aten::max_pool1d : (Tensor, int[], int[], int[], int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool1d_with_indices", "summary": "Generated op for `aten::max_pool1d_with_indices : (Tensor, int[], int[], int[], int[], bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool2d", "category": "Pool", "summary": "Generated op for `aten::max_pool2d : (Tensor, int[], int[], int[], int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool2d_with_indices", "summary": "Generated op for `aten::max_pool2d_with_indices : (Tensor, int[], int[], int[], int[], bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool2d_with_indices_backward", "summary": "Generated op for `aten::max_pool2d_with_indices_backward : (Tensor, Tensor, int[], int[], int[], int[], bool, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "indices", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool3d", "summary": "Generated op for `aten::max_pool3d : (Tensor, int[], int[], int[], int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool3d_with_indices", "summary": "Generated op for `aten::max_pool3d_with_indices : (Tensor, int[], int[], int[], int[], bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_pool3d_with_indices_backward", "summary": "Generated op for `aten::max_pool3d_with_indices_backward : (Tensor, Tensor, int[], int[], int[], int[], bool, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "kernel_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" }, { "name": "dilation", "type": "AnyTorchListOfTorchIntType" }, { "name": "ceil_mode", "type": "Torch_BoolType" }, { "name": "indices", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_unpool2d", "summary": "Generated op for `aten::max_unpool2d : (Tensor, Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max_unpool3d", "summary": "Generated op for `aten::max_unpool3d : (Tensor, Tensor, int[], int[], int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "indices", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max.dim", "summary": "Generated op for `aten::max.dim : (Tensor, int, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "values", "type": "AnyTorchOptionalTensorType" }, { "name": "indices", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.max.other", "summary": "Generated op for `aten::max.other : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.maximum", "summary": "Generated op for `aten::maximum : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mean", "summary": "Generated op for `aten::mean : (Tensor, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mean.dim", "summary": "Generated op for `aten::mean.dim : (Tensor, int[]?, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.meshgrid", "summary": "Generated op for `aten::meshgrid : (Tensor[]) -> (Tensor[])`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.meshgrid.indexing", "summary": "Generated op for `aten::meshgrid.indexing : (Tensor[], str) -> (Tensor[])`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" }, { "name": "indexing", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.min", "summary": "Generated op for `aten::min : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.min.dim", "summary": "Generated op for `aten::min.dim : (Tensor, int, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "values", "type": "AnyTorchOptionalTensorType" }, { "name": "indices", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.min.other", "summary": "Generated op for `aten::min.other : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.minimum", "summary": "Generated op for `aten::minimum : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mish", "summary": "Generated op for `aten::mish : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mm", "summary": "Generated op for `aten::mm : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mat2", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.movedim.int", "summary": "Generated op for `aten::movedim.int : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "source", "type": "Torch_IntType" }, { "name": "destination", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mse_loss", "summary": "Generated op for `aten::mse_loss : (Tensor, Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mse_loss_backward", "summary": "Generated op for `aten::mse_loss_backward : (Tensor, Tensor, Tensor, int) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul", "summary": "Generated op for `aten::mul : (Scalar, Scalar) -> (Scalar)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" }, { "name": "b", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul_.Scalar", "summary": "Generated op for `aten::mul_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul_.Tensor", "summary": "Generated op for `aten::mul_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.float", "summary": "Generated op for `aten::mul.float : (float, float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.float_int", "summary": "Generated op for `aten::mul.float_int : (float, int) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.int", "summary": "Generated op for `aten::mul.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.int_float", "summary": "Generated op for `aten::mul.int_float : (int, float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.left_t", "summary": "Generated op for `aten::mul.left_t : (t[], int) -> (t[])`", "operands": [ { "name": "l", "type": "AnyTorchListType" }, { "name": "n", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.Scalar", "summary": "Generated op for `aten::mul.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mul.Tensor", "summary": "Generated op for `aten::mul.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.multinomial", "summary": "Generated op for `aten::multinomial : (Tensor, int, bool, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "num_samples", "type": "Torch_IntType" }, { "name": "replacement", "type": "Torch_BoolType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.mv", "summary": "Generated op for `aten::mv : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "vec", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nan_to_num", "summary": "Generated op for `aten::nan_to_num : (Tensor, float?, float?, float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "nan", "type": "AnyTorchOptionalFloatType" }, { "name": "posinf", "type": "AnyTorchOptionalFloatType" }, { "name": "neginf", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.narrow", "summary": "Generated op for `aten::narrow : (Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "start", "type": "Torch_IntType" }, { "name": "length", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.narrow.Tensor", "summary": "Generated op for `aten::narrow.Tensor : (Tensor, int, Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "start", "type": "AnyTorchTensorType" }, { "name": "length", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_batch_norm", "summary": "Generated op for `aten::native_batch_norm : (Tensor, Tensor?, Tensor?, Tensor?, Tensor?, bool, float, float) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "running_mean", "type": "AnyTorchOptionalTensorType" }, { "name": "running_var", "type": "AnyTorchOptionalTensorType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "momentum", "type": "Torch_FloatType" }, { "name": "eps", "type": "Torch_FloatType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_batch_norm_backward", "summary": "Generated op for `aten::native_batch_norm_backward : (Tensor, Tensor, Tensor?, Tensor?, Tensor?, Tensor?, Tensor?, bool, float, bool[]) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "grad_out", "type": "AnyTorchTensorType" }, { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "running_mean", "type": "AnyTorchOptionalTensorType" }, { "name": "running_var", "type": "AnyTorchOptionalTensorType" }, { "name": "save_mean", "type": "AnyTorchOptionalTensorType" }, { "name": "save_invstd", "type": "AnyTorchOptionalTensorType" }, { "name": "train", "type": "Torch_BoolType" }, { "name": "eps", "type": "Torch_FloatType" }, { "name": "output_mask", "type": "AnyTorchListOfTorchBoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_dropout", "summary": "Generated op for `aten::native_dropout : (Tensor, float, bool?) -> (Tensor, Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "p", "type": "Torch_FloatType" }, { "name": "train", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_dropout_backward", "summary": "Generated op for `aten::native_dropout_backward : (Tensor, Tensor, float) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "mask", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_group_norm", "summary": "Generated op for `aten::native_group_norm : (Tensor, Tensor?, Tensor?, int, int, int, int, float) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "N", "type": "Torch_IntType" }, { "name": "C", "type": "Torch_IntType" }, { "name": "HxW", "type": "Torch_IntType" }, { "name": "group", "type": "Torch_IntType" }, { "name": "eps", "type": "Torch_FloatType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_group_norm_backward", "summary": "Generated op for `aten::native_group_norm_backward : (Tensor, Tensor, Tensor, Tensor, Tensor?, int, int, int, int, bool[]) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "grad_out", "type": "AnyTorchTensorType" }, { "name": "input", "type": "AnyTorchTensorType" }, { "name": "mean", "type": "AnyTorchTensorType" }, { "name": "rstd", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "N", "type": "Torch_IntType" }, { "name": "C", "type": "Torch_IntType" }, { "name": "HxW", "type": "Torch_IntType" }, { "name": "group", "type": "Torch_IntType" }, { "name": "output_mask", "type": "AnyTorchListOfTorchBoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_layer_norm", "summary": "Generated op for `aten::native_layer_norm : (Tensor, int[], Tensor?, Tensor?, float) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "normalized_shape", "type": "AnyTorchListOfTorchIntType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "eps", "type": "Torch_FloatType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.native_layer_norm_backward", "summary": "Generated op for `aten::native_layer_norm_backward : (Tensor, Tensor, int[], Tensor, Tensor, Tensor?, Tensor?, bool[]) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "grad_out", "type": "AnyTorchTensorType" }, { "name": "input", "type": "AnyTorchTensorType" }, { "name": "normalized_shape", "type": "AnyTorchListOfTorchIntType" }, { "name": "mean", "type": "AnyTorchTensorType" }, { "name": "rstd", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "bias", "type": "AnyTorchOptionalTensorType" }, { "name": "output_mask", "type": "AnyTorchListOfTorchBoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne_.Scalar", "summary": "Generated op for `aten::ne_.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne_.Tensor", "summary": "Generated op for `aten::ne_.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.bool", "summary": "Generated op for `aten::ne.bool : (bool, bool) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_BoolType" }, { "name": "b", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.float_int", "summary": "Generated op for `aten::ne.float_int : (float, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.int", "summary": "Generated op for `aten::ne.int : (int, int) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.int_list", "summary": "Generated op for `aten::ne.int_list : (int[], int[]) -> (bool)`", "operands": [ { "name": "a", "type": "AnyTorchListOfTorchIntType" }, { "name": "b", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.Scalar", "summary": "Generated op for `aten::ne.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.str", "summary": "Generated op for `aten::ne.str : (str, str) -> (bool)`", "operands": [ { "name": "a", "type": "Torch_StringType" }, { "name": "b", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ne.Tensor", "summary": "Generated op for `aten::ne.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.neg", "summary": "Generated op for `aten::neg : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.neg_", "summary": "Generated op for `aten::neg_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.neg.float", "summary": "Generated op for `aten::neg.float : (float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.neg.int", "summary": "Generated op for `aten::neg.int : (int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.new_empty", "summary": "Generated op for `aten::new_empty : (Tensor, int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.new_empty_strided", "summary": "Generated op for `aten::new_empty_strided : (Tensor, int[], int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "stride", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.new_full", "summary": "Generated op for `aten::new_full : (Tensor, int[], Scalar, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "fill_value", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.new_ones", "summary": "Generated op for `aten::new_ones : (Tensor, int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.new_zeros", "summary": "Generated op for `aten::new_zeros : (Tensor, int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nll_loss_backward", "summary": "Generated op for `aten::nll_loss_backward : (Tensor, Tensor, Tensor, Tensor?, int, int, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" }, { "name": "ignore_index", "type": "Torch_IntType" }, { "name": "total_weight", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nll_loss_forward", "summary": "Generated op for `aten::nll_loss_forward : (Tensor, Tensor, Tensor?, int, int) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" }, { "name": "ignore_index", "type": "Torch_IntType" } ], "results": [ { "name": "output", "type": "AnyTorchOptionalTensorType" }, { "name": "total_weight", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nll_loss2d_backward", "summary": "Generated op for `aten::nll_loss2d_backward : (Tensor, Tensor, Tensor, Tensor?, int, int, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" }, { "name": "ignore_index", "type": "Torch_IntType" }, { "name": "total_weight", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nll_loss2d_forward", "summary": "Generated op for `aten::nll_loss2d_forward : (Tensor, Tensor, Tensor?, int, int) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "reduction", "type": "Torch_IntType" }, { "name": "ignore_index", "type": "Torch_IntType" } ], "results": [ { "name": "output", "type": "AnyTorchOptionalTensorType" }, { "name": "total_weight", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nonzero", "summary": "Generated op for `aten::nonzero : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nonzero_numpy", "summary": "Generated op for `aten::nonzero_numpy : (Tensor) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.nonzero_static", "summary": "Generated op for `aten::nonzero_static : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "Torch_IntType" }, { "name": "fill_value", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.norm.Scalar", "summary": "Generated op for `aten::norm.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.norm.ScalarOpt_dim", "summary": "Generated op for `aten::norm.ScalarOpt_dim : (Tensor, Scalar?, int[], bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "AnyTorchOptionalScalarType" }, { "name": "dim", "type": "AnyTorchListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.normal_functional", "summary": "Generated op for `aten::normal_functional : (Tensor, float, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "mean", "type": "Torch_FloatType" }, { "name": "std", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.numel", "summary": "Generated op for `aten::numel : (Tensor) -> (int)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.numpy_T", "summary": "Generated op for `aten::numpy_T : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.one_hot", "summary": "Generated op for `aten::one_hot : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "num_classes", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ones", "summary": "Generated op for `aten::ones : (int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ones_like", "summary": "Generated op for `aten::ones_like : (Tensor, int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.outer", "summary": "Generated op for `aten::outer : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "vec2", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pad", "category": "Transform", "summary": "Generated op for `aten::pad : (Tensor, int[], str, float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "pad", "type": "AnyTorchListOfTorchIntType" }, { "name": "mode", "type": "Torch_StringType" }, { "name": "value", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.permute", "summary": "Generated op for `aten::permute : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.permute_copy", "summary": "Generated op for `aten::permute_copy : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pixel_shuffle", "summary": "Generated op for `aten::pixel_shuffle : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "upscale_factor", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pixel_unshuffle", "summary": "Generated op for `aten::pixel_unshuffle : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "downscale_factor", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.poisson_nll_loss", "summary": "Generated op for `aten::poisson_nll_loss : (Tensor, Tensor, bool, bool, float, int) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "target", "type": "AnyTorchTensorType" }, { "name": "log_input", "type": "Torch_BoolType" }, { "name": "full", "type": "Torch_BoolType" }, { "name": "eps", "type": "Torch_FloatType" }, { "name": "reduction", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.polar", "summary": "Generated op for `aten::polar : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "abs", "type": "AnyTorchTensorType" }, { "name": "angle", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pow.int_float", "summary": "Generated op for `aten::pow.int_float : (int, float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pow.Scalar", "summary": "Generated op for `aten::pow.Scalar : (Scalar, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchScalarType" }, { "name": "exponent", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pow.Tensor_Scalar", "summary": "Generated op for `aten::pow.Tensor_Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "exponent", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.pow.Tensor_Tensor", "summary": "Generated op for `aten::pow.Tensor_Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "exponent", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.prelu", "summary": "Generated op for `aten::prelu : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.prod", "summary": "Generated op for `aten::prod : (Tensor, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.prod.dim_int", "summary": "Generated op for `aten::prod.dim_int : (Tensor, int, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "keepdim", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.quantize_per_channel", "summary": "Generated op for `aten::quantize_per_channel : (Tensor, Tensor, Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scales", "type": "AnyTorchTensorType" }, { "name": "zero_points", "type": "AnyTorchTensorType" }, { "name": "axis", "type": "Torch_IntType" }, { "name": "dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.quantize_per_tensor", "summary": "Generated op for `aten::quantize_per_tensor : (Tensor, float, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "Torch_FloatType" }, { "name": "zero_point", "type": "Torch_IntType" }, { "name": "dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rad2deg", "summary": "Generated op for `aten::rad2deg : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rand", "summary": "Generated op for `aten::rand : (int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rand_like", "summary": "Generated op for `aten::rand_like : (Tensor, int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.randint", "summary": "Generated op for `aten::randint : (int, int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "high", "type": "Torch_IntType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.randint.low", "summary": "Generated op for `aten::randint.low : (int, int, int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "low", "type": "Torch_IntType" }, { "name": "high", "type": "Torch_IntType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.randn", "summary": "Generated op for `aten::randn : (int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.randn_like", "summary": "Generated op for `aten::randn_like : (Tensor, int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.randn.generator", "summary": "Generated op for `aten::randn.generator : (int[], Generator?, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.random", "summary": "Generated op for `aten::random : (Tensor, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.random.from", "summary": "Generated op for `aten::random.from : (Tensor, int, int?, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "from", "type": "Torch_IntType" }, { "name": "to", "type": "AnyTorchOptionalIntType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.real", "summary": "Generated op for `aten::real : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reciprocal", "summary": "Generated op for `aten::reciprocal : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reciprocal_", "summary": "Generated op for `aten::reciprocal_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reflection_pad1d", "summary": "Generated op for `aten::reflection_pad1d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reflection_pad2d", "summary": "Generated op for `aten::reflection_pad2d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reflection_pad3d", "summary": "Generated op for `aten::reflection_pad3d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.relu", "category": "Activation", "summary": "Generated op for `aten::relu : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.relu_", "summary": "Generated op for `aten::relu_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.relu6", "summary": "Generated op for `aten::relu6 : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.relu6_", "summary": "Generated op for `aten::relu6_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.remainder.int", "summary": "Generated op for `aten::remainder.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.remainder.Scalar", "summary": "Generated op for `aten::remainder.Scalar : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.remainder.Tensor", "summary": "Generated op for `aten::remainder.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.renorm", "summary": "Generated op for `aten::renorm : (Tensor, Scalar, int, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "AnyTorchScalarType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "maxnorm", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.repeat", "summary": "Generated op for `aten::repeat : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "repeats", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.repeat_interleave.self_int", "summary": "Generated op for `aten::repeat_interleave.self_int : (Tensor, int, int?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "repeats", "type": "Torch_IntType" }, { "name": "dim", "type": "AnyTorchOptionalIntType" }, { "name": "output_size", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.replication_pad1d", "summary": "Generated op for `aten::replication_pad1d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.replication_pad2d", "summary": "Generated op for `aten::replication_pad2d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.replication_pad3d", "summary": "Generated op for `aten::replication_pad3d : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "padding", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reshape", "category": "Shape", "summary": "Generated op for `aten::reshape : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "shape", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.reshape_as", "summary": "Generated op for `aten::reshape_as : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.resize", "summary": "Generated op for `aten::resize : (Tensor, int[], int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.resize_", "summary": "Generated op for `aten::resize_ : (Tensor, int[], int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rms_norm", "summary": "Generated op for `aten::rms_norm : (Tensor, int[], Tensor?, float?) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "normalized_shape", "type": "AnyTorchListOfTorchIntType" }, { "name": "weight", "type": "AnyTorchOptionalTensorType" }, { "name": "eps", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.roll", "summary": "Generated op for `aten::roll : (Tensor, int[], int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "shifts", "type": "AnyTorchListOfTorchIntType" }, { "name": "dims", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rot90", "summary": "Generated op for `aten::rot90 : (Tensor, int, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "k", "type": "Torch_IntType" }, { "name": "dims", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.round", "summary": "Generated op for `aten::round : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.round_", "summary": "Generated op for `aten::round_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.round_.decimals", "summary": "Generated op for `aten::round_.decimals : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "decimals", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.round.decimals", "summary": "Generated op for `aten::round.decimals : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "decimals", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rrelu", "summary": "Generated op for `aten::rrelu : (Tensor, Scalar, Scalar, bool, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "lower", "type": "AnyTorchScalarType" }, { "name": "upper", "type": "AnyTorchScalarType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rrelu_", "summary": "Generated op for `aten::rrelu_ : (Tensor, Scalar, Scalar, bool, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "lower", "type": "AnyTorchScalarType" }, { "name": "upper", "type": "AnyTorchScalarType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rrelu_with_noise", "summary": "Generated op for `aten::rrelu_with_noise : (Tensor, Tensor, Scalar, Scalar, bool, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "noise", "type": "AnyTorchTensorType" }, { "name": "lower", "type": "AnyTorchScalarType" }, { "name": "upper", "type": "AnyTorchScalarType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rrelu_with_noise_", "summary": "Generated op for `aten::rrelu_with_noise_ : (Tensor, Tensor, Scalar, Scalar, bool, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "noise", "type": "Torch_NonValueTensorType" }, { "name": "lower", "type": "AnyTorchScalarType" }, { "name": "upper", "type": "AnyTorchScalarType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rrelu_with_noise_backward", "summary": "Generated op for `aten::rrelu_with_noise_backward : (Tensor, Tensor, Tensor, Scalar, Scalar, bool, bool) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "noise", "type": "AnyTorchTensorType" }, { "name": "lower", "type": "AnyTorchScalarType" }, { "name": "upper", "type": "AnyTorchScalarType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "self_is_result", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rrelu_with_noise_functional", "summary": "Generated op for `aten::rrelu_with_noise_functional : (Tensor, Tensor, Scalar, Scalar, bool, Generator?) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "noise", "type": "AnyTorchTensorType" }, { "name": "lower", "type": "AnyTorchScalarType" }, { "name": "upper", "type": "AnyTorchScalarType" }, { "name": "training", "type": "Torch_BoolType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "noise_out", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rsqrt", "summary": "Generated op for `aten::rsqrt : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rsqrt_", "summary": "Generated op for `aten::rsqrt_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.rsub.Scalar", "summary": "Generated op for `aten::rsub.Scalar : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scalar_tensor", "summary": "Generated op for `aten::scalar_tensor : (Scalar, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "s", "type": "AnyTorchScalarType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.ScalarImplicit", "summary": "Generated op for `aten::ScalarImplicit : (Tensor) -> (Scalar)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scaled_dot_product_attention", "summary": "Generated op for `aten::scaled_dot_product_attention : (Tensor, Tensor, Tensor, Tensor?, float, bool, float?, bool) -> (Tensor)`", "operands": [ { "name": "query", "type": "AnyTorchTensorType" }, { "name": "key", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchTensorType" }, { "name": "attn_mask", "type": "AnyTorchOptionalTensorType" }, { "name": "dropout_p", "type": "Torch_FloatType" }, { "name": "is_causal", "type": "Torch_BoolType" }, { "name": "scale", "type": "AnyTorchOptionalFloatType" }, { "name": "enable_gqa", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter_.src", "summary": "Generated op for `aten::scatter_.src : (Tensor, int, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_NonValueTensorType" }, { "name": "src", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter_.value", "summary": "Generated op for `aten::scatter_.value : (Tensor, int, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_NonValueTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter_add", "summary": "Generated op for `aten::scatter_add : (Tensor, int, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter_add_", "summary": "Generated op for `aten::scatter_add_ : (Tensor, int, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_NonValueTensorType" }, { "name": "src", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter_reduce_.two", "summary": "Generated op for `aten::scatter_reduce_.two : (Tensor, int, Tensor, Tensor, str, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_NonValueTensorType" }, { "name": "src", "type": "Torch_NonValueTensorType" }, { "name": "reduce", "type": "Torch_StringType" }, { "name": "include_self", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter_reduce.two", "summary": "Generated op for `aten::scatter_reduce.two : (Tensor, int, Tensor, Tensor, str, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "reduce", "type": "Torch_StringType" }, { "name": "include_self", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter.reduce", "summary": "Generated op for `aten::scatter.reduce : (Tensor, int, Tensor, Tensor, str) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "reduce", "type": "Torch_StringType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter.src", "summary": "Generated op for `aten::scatter.src : (Tensor, int, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.scatter.value", "summary": "Generated op for `aten::scatter.value : (Tensor, int, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.select_copy.int", "summary": "Generated op for `aten::select_copy.int : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.select_scatter", "summary": "Generated op for `aten::select_scatter : (Tensor, Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.select.int", "summary": "Generated op for `aten::select.int : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "index", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.selu", "summary": "Generated op for `aten::selu : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.selu_", "summary": "Generated op for `aten::selu_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sgn", "summary": "Generated op for `aten::sgn : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sgn_", "summary": "Generated op for `aten::sgn_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sigmoid", "category": "Activation", "summary": "Generated op for `aten::sigmoid : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sigmoid_", "summary": "Generated op for `aten::sigmoid_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sigmoid_backward", "summary": "Generated op for `aten::sigmoid_backward : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "output", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sign", "summary": "Generated op for `aten::sign : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sign_", "summary": "Generated op for `aten::sign_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.signbit", "summary": "Generated op for `aten::signbit : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.silu", "summary": "Generated op for `aten::silu : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.silu_", "summary": "Generated op for `aten::silu_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sin", "summary": "Generated op for `aten::sin : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sin_", "summary": "Generated op for `aten::sin_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sinh", "summary": "Generated op for `aten::sinh : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sinh_", "summary": "Generated op for `aten::sinh_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.size", "summary": "Generated op for `aten::size : (Tensor) -> (int[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTorchIntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.size.int", "summary": "Generated op for `aten::size.int : (Tensor, int) -> (int)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.slice_copy.Tensor", "summary": "Generated op for `aten::slice_copy.Tensor : (Tensor, int, int?, int?, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "start", "type": "AnyTorchOptionalIntType" }, { "name": "end", "type": "AnyTorchOptionalIntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.slice_scatter", "summary": "Generated op for `aten::slice_scatter : (Tensor, Tensor, int, int?, int?, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "src", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "start", "type": "AnyTorchOptionalIntType" }, { "name": "end", "type": "AnyTorchOptionalIntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.slice.t", "summary": "Generated op for `aten::slice.t : (t[], int?, int?, int) -> (t[])`", "operands": [ { "name": "l", "type": "AnyTorchListType" }, { "name": "start", "type": "AnyTorchOptionalIntType" }, { "name": "end", "type": "AnyTorchOptionalIntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.slice.Tensor", "summary": "Generated op for `aten::slice.Tensor : (Tensor, int, int?, int?, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "start", "type": "AnyTorchOptionalIntType" }, { "name": "end", "type": "AnyTorchOptionalIntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.softmax.int", "summary": "Generated op for `aten::softmax.int : (Tensor, int, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.softplus", "summary": "Generated op for `aten::softplus : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "beta", "type": "AnyTorchScalarType" }, { "name": "threshold", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.softplus_backward", "summary": "Generated op for `aten::softplus_backward : (Tensor, Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "beta", "type": "AnyTorchScalarType" }, { "name": "threshold", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.softshrink", "summary": "Generated op for `aten::softshrink : (Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "lambd", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sort", "summary": "Generated op for `aten::sort : (Tensor, int, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "descending", "type": "Torch_BoolType" } ], "results": [ { "name": "values", "type": "AnyTorchOptionalTensorType" }, { "name": "indices", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sort.int", "summary": "Generated op for `aten::sort.int : (int[], bool) -> ()`", "operands": [ { "name": "self", "type": "AnyTorchListOfTorchIntType" }, { "name": "reverse", "type": "Torch_BoolType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.special_expm1", "summary": "Generated op for `aten::special_expm1 : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.split_copy.Tensor", "summary": "Generated op for `aten::split_copy.Tensor : (Tensor, int, int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "split_size", "type": "Torch_IntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.split_with_sizes", "summary": "Generated op for `aten::split_with_sizes : (Tensor, int[], int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "split_sizes", "type": "AnyTorchListOfTorchIntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.split_with_sizes_copy", "summary": "Generated op for `aten::split_with_sizes_copy : (Tensor, int[], int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "split_sizes", "type": "AnyTorchListOfTorchIntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.split.sizes", "summary": "Generated op for `aten::split.sizes : (Tensor, int[], int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "split_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.split.Tensor", "summary": "Generated op for `aten::split.Tensor : (Tensor, int, int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "split_size", "type": "Torch_IntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sqrt", "summary": "Generated op for `aten::sqrt : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sqrt_", "summary": "Generated op for `aten::sqrt_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sqrt.int", "summary": "Generated op for `aten::sqrt.int : (int) -> (float)`", "operands": [ { "name": "a", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.square", "summary": "Generated op for `aten::square : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.square_", "summary": "Generated op for `aten::square_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.squeeze", "summary": "Generated op for `aten::squeeze : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.squeeze_copy", "summary": "Generated op for `aten::squeeze_copy : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.squeeze_copy.dim", "summary": "Generated op for `aten::squeeze_copy.dim : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.squeeze.dim", "summary": "Generated op for `aten::squeeze.dim : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.stack", "summary": "Generated op for `aten::stack : (Tensor[], int) -> (Tensor)`", "operands": [ { "name": "tensors", "type": "AnyTorchListOfTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.std", "summary": "Generated op for `aten::std : (Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "unbiased", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.std.correction", "summary": "Generated op for `aten::std.correction : (Tensor, int[]?, Scalar?, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "correction", "type": "AnyTorchOptionalScalarType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.std.dim", "summary": "Generated op for `aten::std.dim : (Tensor, int[]?, bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "unbiased", "type": "Torch_BoolType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.stft", "summary": "Generated op for `aten::stft : (Tensor, int, int?, int?, Tensor?, bool, bool?, bool?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "n_fft", "type": "Torch_IntType" }, { "name": "hop_length", "type": "AnyTorchOptionalIntType" }, { "name": "win_length", "type": "AnyTorchOptionalIntType" }, { "name": "window", "type": "AnyTorchOptionalTensorType" }, { "name": "normalized", "type": "Torch_BoolType" }, { "name": "onesided", "type": "AnyTorchOptionalBoolType" }, { "name": "return_complex", "type": "AnyTorchOptionalBoolType" }, { "name": "align_to_window", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.stft.center", "summary": "Generated op for `aten::stft.center : (Tensor, int, int?, int?, Tensor?, bool, str, bool, bool?, bool?, bool?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "n_fft", "type": "Torch_IntType" }, { "name": "hop_length", "type": "AnyTorchOptionalIntType" }, { "name": "win_length", "type": "AnyTorchOptionalIntType" }, { "name": "window", "type": "AnyTorchOptionalTensorType" }, { "name": "center", "type": "Torch_BoolType" }, { "name": "pad_mode", "type": "Torch_StringType" }, { "name": "normalized", "type": "Torch_BoolType" }, { "name": "onesided", "type": "AnyTorchOptionalBoolType" }, { "name": "return_complex", "type": "AnyTorchOptionalBoolType" }, { "name": "align_to_window", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.str", "summary": "Generated op for `aten::str : (t) -> (str)`", "operands": [ { "name": "elem", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "Torch_StringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub", "summary": "Generated op for `aten::sub : (Scalar, Scalar) -> (Scalar)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" }, { "name": "b", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub_.Scalar", "summary": "Generated op for `aten::sub_.Scalar : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub_.Tensor", "summary": "Generated op for `aten::sub_.Tensor : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "other", "type": "Torch_NonValueTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub.float", "summary": "Generated op for `aten::sub.float : (float, float) -> (float)`", "operands": [ { "name": "a", "type": "Torch_FloatType" }, { "name": "b", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "Torch_FloatType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub.int", "summary": "Generated op for `aten::sub.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub.Scalar", "summary": "Generated op for `aten::sub.Scalar : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sub.Tensor", "summary": "Generated op for `aten::sub.Tensor : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" }, { "name": "alpha", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sum", "summary": "Generated op for `aten::sum : (Tensor, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sum.dim_IntList", "summary": "Generated op for `aten::sum.dim_IntList : (Tensor, int[]?, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "keepdim", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sym_constrain_range", "summary": "Generated op for `aten::sym_constrain_range : (Scalar, int?, int?) -> ()`", "operands": [ { "name": "size", "type": "AnyTorchScalarType" }, { "name": "min", "type": "AnyTorchOptionalIntType" }, { "name": "max", "type": "AnyTorchOptionalIntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.sym_constrain_range_for_size", "summary": "Generated op for `aten::sym_constrain_range_for_size : (Scalar, int?, int?) -> ()`", "operands": [ { "name": "size", "type": "AnyTorchScalarType" }, { "name": "min", "type": "AnyTorchOptionalIntType" }, { "name": "max", "type": "AnyTorchOptionalIntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.t", "summary": "Generated op for `aten::t : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.t_copy", "summary": "Generated op for `aten::t_copy : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tan", "summary": "Generated op for `aten::tan : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tan_", "summary": "Generated op for `aten::tan_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tanh", "category": "Activation", "summary": "Generated op for `aten::tanh : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tanh_", "summary": "Generated op for `aten::tanh_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tanh_backward", "summary": "Generated op for `aten::tanh_backward : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "output", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tensor", "summary": "Generated op for `aten::tensor : (t[], int?, Device?, bool) -> (Tensor)`", "operands": [ { "name": "data", "type": "AnyTorchListType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "requires_grad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tensor_split.sections", "summary": "Generated op for `aten::tensor_split.sections : (Tensor, int, int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "sections", "type": "Torch_IntType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tensor.bool", "summary": "Generated op for `aten::tensor.bool : (bool, int?, Device?, bool) -> (Tensor)`", "operands": [ { "name": "t", "type": "Torch_BoolType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "requires_grad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tensor.float", "summary": "Generated op for `aten::tensor.float : (float, int?, Device?, bool) -> (Tensor)`", "operands": [ { "name": "t", "type": "Torch_FloatType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "requires_grad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tensor.int", "summary": "Generated op for `aten::tensor.int : (int, int?, Device?, bool) -> (Tensor)`", "operands": [ { "name": "t", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "requires_grad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.threshold", "summary": "Generated op for `aten::threshold : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "threshold", "type": "AnyTorchScalarType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.threshold_", "summary": "Generated op for `aten::threshold_ : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "threshold", "type": "AnyTorchScalarType" }, { "name": "value", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.threshold_backward", "summary": "Generated op for `aten::threshold_backward : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "threshold", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tile", "summary": "Generated op for `aten::tile : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.to.device", "summary": "Generated op for `aten::to.device : (Tensor, Device, int, bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "device", "type": "Torch_DeviceType" }, { "name": "dtype", "type": "Torch_IntType" }, { "name": "non_blocking", "type": "Torch_BoolType" }, { "name": "copy", "type": "Torch_BoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.to.dtype", "summary": "Generated op for `aten::to.dtype : (Tensor, int, bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "Torch_IntType" }, { "name": "non_blocking", "type": "Torch_BoolType" }, { "name": "copy", "type": "Torch_BoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.to.dtype_layout", "summary": "Generated op for `aten::to.dtype_layout : (Tensor, int?, int?, Device?, bool?, bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "non_blocking", "type": "Torch_BoolType" }, { "name": "copy", "type": "Torch_BoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.to.other", "summary": "Generated op for `aten::to.other : (Tensor, Tensor, bool, bool, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" }, { "name": "non_blocking", "type": "Torch_BoolType" }, { "name": "copy", "type": "Torch_BoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.to.prim_Device", "summary": "Generated op for `aten::to.prim_Device : (Tensor, Device?, int?, bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "non_blocking", "type": "Torch_BoolType" }, { "name": "copy", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.topk", "summary": "Generated op for `aten::topk : (Tensor, int, int, bool, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "k", "type": "Torch_IntType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "largest", "type": "Torch_BoolType" }, { "name": "sorted", "type": "Torch_BoolType" } ], "results": [ { "name": "values", "type": "AnyTorchOptionalTensorType" }, { "name": "indices", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.trace", "summary": "Generated op for `aten::trace : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.transpose_copy.int", "summary": "Generated op for `aten::transpose_copy.int : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim0", "type": "Torch_IntType" }, { "name": "dim1", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.transpose.int", "category": "Transform", "summary": "Generated op for `aten::transpose.int : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim0", "type": "Torch_IntType" }, { "name": "dim1", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tril", "summary": "Generated op for `aten::tril : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "diagonal", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tril_", "summary": "Generated op for `aten::tril_ : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "diagonal", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.tril_indices", "summary": "Generated op for `aten::tril_indices : (int, int, int, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "row", "type": "Torch_IntType" }, { "name": "col", "type": "Torch_IntType" }, { "name": "offset", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.triu", "summary": "Generated op for `aten::triu : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "diagonal", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.triu_", "summary": "Generated op for `aten::triu_ : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "diagonal", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.triu_indices", "summary": "Generated op for `aten::triu_indices : (int, int, int, int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "row", "type": "Torch_IntType" }, { "name": "col", "type": "Torch_IntType" }, { "name": "offset", "type": "Torch_IntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.trunc", "summary": "Generated op for `aten::trunc : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.trunc_", "summary": "Generated op for `aten::trunc_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.type_as", "summary": "Generated op for `aten::type_as : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unbind_copy.int", "summary": "Generated op for `aten::unbind_copy.int : (Tensor, int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unbind.int", "summary": "Generated op for `aten::unbind.int : (Tensor, int) -> (Tensor[])`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchListOfTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unflatten.int", "summary": "Generated op for `aten::unflatten.int : (Tensor, int, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "sizes", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unfold", "summary": "Generated op for `aten::unfold : (Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dimension", "type": "Torch_IntType" }, { "name": "size", "type": "Torch_IntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unfold_copy", "summary": "Generated op for `aten::unfold_copy : (Tensor, int, int, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dimension", "type": "Torch_IntType" }, { "name": "size", "type": "Torch_IntType" }, { "name": "step", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.uniform", "summary": "Generated op for `aten::uniform : (Tensor, float, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "from", "type": "Torch_FloatType" }, { "name": "to", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.uniform_", "summary": "Generated op for `aten::uniform_ : (Tensor, float, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "from", "type": "Torch_FloatType" }, { "name": "to", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unique_consecutive", "summary": "Generated op for `aten::unique_consecutive : (Tensor, bool, bool, int?) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "return_inverse", "type": "Torch_BoolType" }, { "name": "return_counts", "type": "Torch_BoolType" }, { "name": "dim", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unique_dim", "summary": "Generated op for `aten::unique_dim : (Tensor, int, bool, bool, bool) -> (Tensor, Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "sorted", "type": "Torch_BoolType" }, { "name": "return_inverse", "type": "Torch_BoolType" }, { "name": "return_counts", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" }, { "name": "result2", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unsqueeze", "summary": "Generated op for `aten::unsqueeze : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unsqueeze_", "summary": "Generated op for `aten::unsqueeze_ : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.unsqueeze_copy", "summary": "Generated op for `aten::unsqueeze_copy : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_bilinear2d", "summary": "Generated op for `aten::upsample_bilinear2d : (Tensor, int[], bool, float?, float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "align_corners", "type": "Torch_BoolType" }, { "name": "scales_h", "type": "AnyTorchOptionalFloatType" }, { "name": "scales_w", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_bilinear2d.vec", "summary": "Generated op for `aten::upsample_bilinear2d.vec : (Tensor, int[]?, bool, float[]?) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "align_corners", "type": "Torch_BoolType" }, { "name": "scale_factors", "type": "AnyTorchOptionalListOfTorchFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_nearest1d", "summary": "Generated op for `aten::upsample_nearest1d : (Tensor, int[], float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "scales", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_nearest1d.vec", "summary": "Generated op for `aten::upsample_nearest1d.vec : (Tensor, int[]?, float[]?) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "scale_factors", "type": "AnyTorchOptionalListOfTorchFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_nearest2d", "summary": "Generated op for `aten::upsample_nearest2d : (Tensor, int[], float?, float?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "scales_h", "type": "AnyTorchOptionalFloatType" }, { "name": "scales_w", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_nearest2d_backward", "summary": "Generated op for `aten::upsample_nearest2d_backward : (Tensor, int[], int[], float?, float?) -> (Tensor)`", "operands": [ { "name": "grad_output", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "input_size", "type": "AnyTorchListOfTorchIntType" }, { "name": "scales_h", "type": "AnyTorchOptionalFloatType" }, { "name": "scales_w", "type": "AnyTorchOptionalFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.upsample_nearest2d.vec", "summary": "Generated op for `aten::upsample_nearest2d.vec : (Tensor, int[]?, float[]?) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "output_size", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "scale_factors", "type": "AnyTorchOptionalListOfTorchFloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.var", "summary": "Generated op for `aten::var : (Tensor, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "unbiased", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.var_mean", "summary": "Generated op for `aten::var_mean : (Tensor, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "unbiased", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.var_mean.correction", "summary": "Generated op for `aten::var_mean.correction : (Tensor, int[]?, Scalar?, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "correction", "type": "AnyTorchOptionalScalarType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.var_mean.dim", "summary": "Generated op for `aten::var_mean.dim : (Tensor, int[]?, bool, bool) -> (Tensor, Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "unbiased", "type": "Torch_BoolType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.var.correction", "summary": "Generated op for `aten::var.correction : (Tensor, int[]?, Scalar?, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "correction", "type": "AnyTorchOptionalScalarType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.var.dim", "summary": "Generated op for `aten::var.dim : (Tensor, int[]?, bool, bool) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "unbiased", "type": "Torch_BoolType" }, { "name": "keepdim", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.view", "summary": "Generated op for `aten::view : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.view_as_complex", "summary": "Generated op for `aten::view_as_complex : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.view_as_real", "summary": "Generated op for `aten::view_as_real : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.view_copy", "summary": "Generated op for `aten::view_copy : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "size", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.view_copy.dtype", "summary": "Generated op for `aten::view_copy.dtype : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.view.dtype", "summary": "Generated op for `aten::view.dtype : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.warn", "summary": "Generated op for `aten::warn : (str, int) -> ()`", "operands": [ { "name": "message", "type": "Torch_StringType" }, { "name": "stacklevel", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.where.Scalar", "summary": "Generated op for `aten::where.Scalar : (Tensor, Scalar, Scalar) -> (Tensor)`", "operands": [ { "name": "condition", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchScalarType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.where.ScalarOther", "summary": "Generated op for `aten::where.ScalarOther : (Tensor, Tensor, Scalar) -> (Tensor)`", "operands": [ { "name": "condition", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.where.ScalarSelf", "summary": "Generated op for `aten::where.ScalarSelf : (Tensor, Scalar, Tensor) -> (Tensor)`", "operands": [ { "name": "condition", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchScalarType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.where.self", "summary": "Generated op for `aten::where.self : (Tensor, Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "condition", "type": "AnyTorchTensorType" }, { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.xlogy.Tensor", "summary": "Generated op for `aten::xlogy.Tensor : (Tensor, Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "other", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.zero", "summary": "Generated op for `aten::zero : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.zero_", "summary": "Generated op for `aten::zero_ : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalNonValueTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.zeros", "summary": "Generated op for `aten::zeros : (int[], int?, int?, Device?, bool?) -> (Tensor)`", "operands": [ { "name": "size", "type": "AnyTorchListOfTorchIntType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.aten.zeros_like", "summary": "Generated op for `aten::zeros_like : (Tensor, int?, int?, Device?, bool?, int?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "AnyTorchOptionalIntType" }, { "name": "layout", "type": "AnyTorchOptionalIntType" }, { "name": "device", "type": "AnyTorchOptionalDeviceType" }, { "name": "pin_memory", "type": "AnyTorchOptionalBoolType" }, { "name": "memory_format", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.attr", "summary": "Declare an attribute of a torch.class_type", "description": "This op declaratively specifies that torch.nn.Module's of the parent\n torch.class_type must have an attribute `name` of type `type`.\n\n If `private` is present, it indicates that the value of this attribute\n cannot be accessed externally.", "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "isPrivate", "type": "UnitAttr" } ], "assemblyFormat": "(`private` $isPrivate^)? $name `:` $type attr-dict" }, { "name": "torch.bind_symbolic_shape", "summary": "Binds shape expressions to tensors using an affine map indexed by shape symbols", "description": "The `torch.bind_symbolic_shape` operation binds shape expressions\n useful to compute the dynamic dimensions of a tensor. It takes a\n variadic of SSA symbols that map 1:1 to the local symbols declared\n in the affine map. The affine map contains a list of affine shape\n expressions for each dim where the terminals are from the declared\n symbols.\n\n Example:\n ```\n torch.bind_symbolic_shape %arg0, [%0, %1], affine_map<()[s0, s1] -> (s0, s1, 3)> : !torch.vtensor<[?,?,3],f32>\n torch.bind_symbolic_shape %out0, [%0, %1, %2], affine_map<()[s0, s1, s2] -> (s0, s1 * 2 + s2, 3)> : !torch.vtensor<[?,?,3],f32>\n ```", "operands": [ { "name": "operand", "type": "Torch_ValueTensorType" }, { "name": "shape_symbols", "type": "Variadic" } ], "attributes": [ { "name": "shape_expressions", "type": "Builtin_AffineMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.class_type", "summary": "Constructs a torch.ClassType", "description": "Declares a class type. Class types are the types used to describe\n TorchScript `torch.nn.Module`'s. The terminology \"class type\" is for\n consistency with TorchScript (a better name in our context might be\n \"nn module subtype\"). The `syn_name` of this op is the same string\n as in the `!torch.nn.Module<\"...\">` type.\n\n Example:\n\n ```mlir\n // A simple empty torch.class_type, with corresponding torch.nn_module.\n torch.class_type @empty {}\n %submodule = torch.nn_module {} : !torch.nn.Module<\"empty\">\n\n // A class type with many members.\n torch.class_type @test {\n torch.attr \"b\" : !torch.bool\n torch.attr \"i\" : !torch.int\n torch.attr \"f\" : !torch.float\n torch.attr \"t\" : !torch.tensor\n torch.attr \"submodule\" : !torch.nn.Module<\"empty\">\n torch.method \"method\", @f\n }\n torch.nn_module {\n // These must match the order and names in the `torch.class_type`.\n torch.slot \"b\", %bool_true : !torch.bool\n torch.slot \"i\", %int3 : !torch.int\n torch.slot \"f\", %float : !torch.float\n torch.slot \"t\", %t : !torch.tensor\n torch.slot \"submodule\", %submodule : !torch.nn.Module<\"empty\">\n } : !torch.nn.Module<\"test\">\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "$sym_name $region attr-dict" }, { "name": "torch.class_type_terminator", "summary": "Implicit terminator for torch.class_type", "assemblyFormat": "attr-dict" }, { "name": "torch.constant.bool", "summary": "Materialize a constant `bool` value.", "results": [ { "name": "result", "type": "Torch_BoolType" } ], "attributes": [ { "name": "value", "type": "I1Attr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "torch.constant.device", "summary": "Materialize a constant Device value.", "results": [ { "name": "result", "type": "Torch_DeviceType" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "torch.constant.float", "summary": "Materialize a constant `float` value.", "description": "Note: TorchScript represents `float` as 64-bit floating point values.\n\n TODO: Add a `!torch.float` type.", "results": [ { "name": "result", "type": "Torch_FloatType" } ], "attributes": [ { "name": "value", "type": "F64Attr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "torch.constant.int", "summary": "Materialize a constant `int` value.", "description": "Note: TorchScript represents integers as 64-bit signed values, unlike\n Python where they are arbitrary precision.", "results": [ { "name": "result", "type": "Torch_IntType" } ], "attributes": [ { "name": "value", "type": "I64Attr" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.constant.none", "summary": "Get the singleton None value.", "description": "Not to be confused with the `mlir::NoneType`. Be careful to use\n `Torch::NoneType` to avoid namespace ambiguity.", "results": [ { "name": "result", "type": "Torch_NoneType" } ], "assemblyFormat": "attr-dict" }, { "name": "torch.constant.number", "summary": "Materialize a constant `number` value.", "description": "This op is used as a workaround to the fact that the constant\n materialization in MLIR must materialize a constant with a single op.\n To materialize ops with a static `!torch.number` type, we must use this op,\n even though we statically know if it is an integer or a float.\n\n Note: This op unconditionally canonicalizes to\n `torch.constant.{float,int}` + `torch.derefine`", "results": [ { "name": "result", "type": "Torch_NumberType" } ], "attributes": [ { "name": "value", "type": "AnyAttrOf<[F64Attr, I64Attr]>" } ] }, { "name": "torch.constant.str", "summary": "Materialize a constant str value.", "description": "Note: Strings in Python (and TorchScript) are immutable.", "results": [ { "name": "result", "type": "Torch_StringType" } ], "attributes": [ { "name": "value", "type": "StrAttr" } ], "assemblyFormat": "$value attr-dict" }, { "name": "torch.copy.to_tensor", "summary": "Create a !torch.tensor with the same contents as the operand", "description": "This op is used to convert from !torch.vtensor to !torch.tensor.\n It does so by allocating a new !torch.tensor and filling it with\n the contents of the operand.\n\n However, this op *does not* allow adding/removing static information about\n sizes/dtype. For that, use `torch.tensor_static_info_cast`.\n\n This op does not have the AllowsTypeRefinement trait because the operand\n and result types are coupled. Only places that know how to simultaneously\n update both types should be changing the type of this op.", "operands": [ { "name": "operand", "type": "Torch_ValueTensorType" } ], "results": [ { "name": "result", "type": "Torch_NonValueTensorType" } ], "traits": [ { "type": "TypesMatchWith<'result', 'operand', 'cast($_self).getWithValueSemantics()'>" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($result))" }, { "name": "torch.copy.to_vtensor", "summary": "Create a !torch.vtensor with the same contents as the operand", "description": "This op is used to convert from !torch.tensor to !torch.vtensor.\n\n However, this op *does not* allow adding/removing static information about\n sizes/dtype. For that, use `torch.tensor_static_info_cast`.\n\n This op does not have the AllowsTypeRefinement trait because the operand\n and result types are coupled. Only places that know how to simultaneously\n update both types should be changing the type of this op.", "operands": [ { "name": "operand", "type": "Torch_NonValueTensorType" } ], "results": [ { "name": "result", "type": "Torch_ValueTensorType" } ], "traits": [ { "type": "TypesMatchWith<'result', 'operand', 'cast($_self).getWithoutValueSemantics()'>" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($result))" }, { "name": "torch.derefine", "summary": "De-refine a type", "description": "In terms of IR structure, TorchScript allows types to vary in many\n circumstances where MLIR requires pointer-identical types. In particular,\n it is valid to pass any subtype in place of a type. For example, if an\n `Optional[int]` is required somewhere in the IR, it is legal to pass a\n value of just `int` (but not the other way around; see\n `torch.prim.unchecked_cast`). In effect, every *use* can have a different\n type.\n\n This op bridges that impedance mismatch. This op allows casting a value\n from one type to a type that it is a subtype of to model this behavior.\n This op uses the TorchScript notion of subtype, which matches the\n Python notion of subtype presented in PEP 483.", "operands": [ { "name": "operand", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($operand)) `to` qualified(type($result))" }, { "name": "torch.dtype.calculate", "summary": "Dtype calculation encapsulation op", "description": "The `torch.dtype.calculate` op captures a dtype calculation\n (in the region `calculation`) which calculates the dtypes for\n the set of values yielded by the `body` region.\n\n The `calculation` region yields a `!torch.int` for each\n value yielded by the `body` region.\n\n Conceptually, the `calculation` region executes first, then `body`\n region. So the `calculation` region can also contain arbitrary\n assertions or side-effecting code which guard the validity of the execution\n of the body (typically by terminating the program with a\n torch.prim.RaiseException op).\n\n The program has undefined behavior if the values yielded by the `body`\n region do not have the dtypes yielded by the `calculation` region.", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" }, { "name": "calculation", "type": "SizedRegion<1>" } ], "assemblyFormat": "$body `dtypes` $calculation attr-dict `:` type($results)" }, { "name": "torch.dtype.calculate.yield", "summary": "yield-like terminator for torch.dtype.calculate", "description": "This op terminates the `body` region of a `torch.dtype.calculate` op.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "torch.dtype.calculate.yield.dtypes", "summary": "yield-like terminator for torch.dtype.calculate shape region", "description": "This op terminates the `dtypeCalculation` region of a\n `torch.dtype.calculate` op.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "torch.global_slot", "summary": "A slot with global storage", "description": "Represents a slot with global storage. The slot semantics are the same\n as Python's: getting or setting a slot is done by object identity.\n\n The `typeBound` is a type that the contained type is a subtype of.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "typeBound", "type": "TypeAttr" } ], "assemblyFormat": "($sym_visibility^)? $sym_name attr-dict `:` $typeBound" }, { "name": "torch.global_slot.get", "summary": "Get the value stored in a torch.global_slot", "results": [ { "name": "result", "type": "AnyTorchType" } ], "attributes": [ { "name": "slot", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$slot attr-dict `:` qualified(type($result))" }, { "name": "torch.global_slot.init", "summary": "yield-like terminator for torch.initialize.global_slotsr region", "description": "The operand to this op becomes the initial value of the parent\n torch.global_slot.", "operands": [ { "name": "initialValue", "type": "AnyTorchType" } ], "assemblyFormat": "$initialValue attr-dict `:` qualified(type($initialValue))" }, { "name": "torch.global_slot.module_initializer", "summary": "Module initializer for all `torch.global_slot` ops", "description": "Initializer function that runs once at program startup to initialize\n all `torch.global_slot` ops in the module.\n\n The only ops that should be in the module initializer should be ops\n generated by the IValue importer. This set avoids the need to define\n the behavior in case of certain kinds of side effects in the initializer\n (except for the side effect of updating the torch.global_slot ops with the\n `torch.initialize.global_slots` op).", "regions": [ { "name": "initializer", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$initializer attr-dict" }, { "name": "torch.global_slot.set", "summary": "Set the value stored in a torch.global_slot", "operands": [ { "name": "value", "type": "AnyTorchType" } ], "attributes": [ { "name": "slot", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$slot `=` $value attr-dict `:` qualified(type($value))" }, { "name": "torch.hop_flex_attention", "summary": "Computes the flex_attention operation", "description": "FlexAttention operation with flexible block-sparse attention patterns.\n\n Args:\n query: Query tensor [B, H, M, K]\n key: Key tensor [B, H, N, K]\n value: Value tensor [B, H, N, Ev]\n scale: Optional float for scaling attention scores (None means 1/sqrt(head_dim))\n return_lse: Bool to return log-sum-exp values\n\n Attributes:\n enable_gqa: Optional bool metadata indicating lowerings should expand\n key/value heads to query heads for grouped-query attention. When\n omitted, lowerings may infer whether grouped-query attention expansion\n is needed from the query/key/value head dimensions. This is not a\n PyTorch HOP operand.\n score_mod_fn: Optional function symbol reference for score modification\n mask_mod_fn: Optional function symbol reference for mask modification\n\n # TODO: kernel_options: Dict attributes for performance tuning (block_size, num_warps, etc.)\n\n Returns:\n output: Result tensor [B, H, M, Ev]\n logsumexp: Optional log-sum-exp tensor [B, H, M] (if return_lse=True)\n max_scores: Optional max-scores tensor [B, H, M] (if return_max_scores=True)", "operands": [ { "name": "query", "type": "AnyTorchTensorType" }, { "name": "key", "type": "AnyTorchTensorType" }, { "name": "value", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "AnyTorchOptionalFloatType" }, { "name": "return_lse", "type": "Torch_BoolType" }, { "name": "return_max_scores", "type": "Torch_BoolType" } ], "results": [ { "name": "output", "type": "AnyTorchTensorType" }, { "name": "logsumexp", "type": "AnyTorchOptionalTensorType" }, { "name": "max_scores", "type": "AnyTorchOptionalTensorType" } ], "attributes": [ { "name": "enable_gqa", "type": "OptionalAttr" }, { "name": "score_mod_fn", "type": "OptionalAttr" }, { "name": "mask_mod_fn", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.initialize.global_slots", "summary": "Terminator for torch.global_slot.module_initializer region", "description": "Atomically updates the value of all the global slots named in `slotSymNames`\n with the corresponding values provided in `initialValues`.", "operands": [ { "name": "initialValues", "type": "Variadic" } ], "attributes": [ { "name": "slotSymNames", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.linear_params.create", "summary": "Create a `!torch.LinearParams`", "operands": [ { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "Torch_LinearParamsType" } ], "assemblyFormat": "$weight (`,` $bias^)? attr-dict `:` qualified(type($weight)) (`,` qualified(type($bias))^)?" }, { "name": "torch.method", "summary": "Declare a method of a torch.class_type", "description": "This op declaratively specifies that the parent torch.class_type has a\n method `name` which calls `function`. `function` is an unbound function.\n That is, it explicitly takes the torch.nn.Module as a parameter (no implicit\n \"self\" object).\n\n If `private` is present, it indicates that external calls cannot be made\n to this method.", "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "function", "type": "FlatSymbolRefAttr" }, { "name": "isPrivate", "type": "UnitAttr" } ], "assemblyFormat": "(`private` $isPrivate^)? $name `,` $function attr-dict" }, { "name": "torch.nn_module", "summary": "Constructs a torch.nn.Module", "description": "This op is used to represent a torch.nn.Module when importing a\n graph of Python objects.\n\n This op returns a new torch.nn.Module as an SSA value, with a set of\n declaratively specified properties.\n\n Example:\n\n ```mlir\n %2 = torch.nn_module {\n torch.slot \"b\", %bool_true : !torch.bool\n torch.slot \"i\", %int3 : !torch.int\n torch.slot \"f\", %float : !torch.float\n torch.slot \"t\", %t : !torch.tensor\n torch.slot \"submodule\", %1 : !torch.nn.Module\n } : !torch.nn.Module<\"my_class_name\">\n ```\n\n This op is tightly coupled to the `torch.class_type` op named in the\n `!torch.nn.Module<\"my_class_name\">` type. Each slot must match precisely\n with the corresponding `torch.attr` in the `torch.class_type`.\n See the documentation for `torch.class_type` for information.", "results": [ { "name": "result", "type": "Torch_NnModuleType" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "$region attr-dict `:` qualified(type($result))" }, { "name": "torch.nn_module_terminator", "summary": "Implicit terminator for torch.nn_module", "assemblyFormat": "attr-dict" }, { "name": "torch.onnx.rotary_embedding", "summary": "`rotary_embedding op : (Tensor, Tensor, Tensor, Tensor, int, int, int, int, float) -> (Tensor)`", "description": "The `torch.onnx.rotary_embedding` operation is an op which is used\n specifically for supporting the Onnx's Rotary Embedding op. The\n reason for this is that the Onnx ops can't be directly lowered to\n Linalg and we have to map them to a legal Torch Dialect op, hence\n this op is used for that purpose.", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "position_ids", "type": "AnyTorchTensorType" }, { "name": "cos_cache", "type": "AnyTorchTensorType" }, { "name": "sin_cache", "type": "AnyTorchTensorType" }, { "name": "interleaved", "type": "Torch_IntType" }, { "name": "is_packed_batching", "type": "Torch_IntType" }, { "name": "num_heads", "type": "Torch_IntType" }, { "name": "rotary_embedding_dim", "type": "Torch_IntType" }, { "name": "scale", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "AnyTorchTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.operator", "summary": "Opaque torch operator", "description": "Represents an invocation of a `torch::jit::Operator` for which we don't\n have a registered MLIR operation.\n\n The `name` attribute contains the name that the MLIR op would have\n (excluding `torch.`) if we did have it registered, which allows easy\n cross referencing with `JITOperatorRegistryDump.txt`.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "regions": [ { "name": "regions", "type": "VariadicRegion" } ], "assemblyFormat": "$name `(` $operands `)` attr-dict `:` functional-type($operands, $results) $regions" }, { "name": "torch.operator_terminator", "summary": "Implicit terminator for torch.operator", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "$operands attr-dict `:` type($operands)" }, { "name": "torch.overwrite.tensor.contents", "summary": "Ovewrite the contents of tensor with values from another.", "description": "Replaces the contents of `overwritten` with corresponding values from\n `value`.\n\n Immediately after this op has completed, indexing `overwritten` will result\n in identical values as indexing into `value`. Of course, later ops\n might mutate `overwritten`, so this relationship need not hold for the\n entire program. This op only updates the tensor data (not metadata).\n In other words, it cannot change the (dynamic) shape of the overwritten tensor.\n\n This op does not have the AllowsTypeRefinement trait because the types of the\n two operands are coupled. Only places that know how to simultaneously update\n both types should be changing the type of this op.", "operands": [ { "name": "value", "type": "Torch_ValueTensorType" }, { "name": "overwritten", "type": "Torch_NonValueTensorType" } ], "traits": [ { "type": "TypesMatchWith<'value', 'overwritten', 'cast($_self).getWithoutValueSemantics()'>" } ], "assemblyFormat": "$value `overwrites` $overwritten attr-dict\n `:` qualified(type($value)) `,` qualified(type($overwritten))" }, { "name": "torch.per_tensor_affine.create", "summary": "Create a per-tensor-affine quantized tensor", "description": "Create a quantized tensor.\n\n Quantization formula is:\n ```\n Q(x, scale, zero_point) = round(x/scale + zero_point)\n ```\n\n See:\n https://pytorch.org/docs/stable/quantization.html#quantized-tensors", "operands": [ { "name": "int_repr", "type": "AnyTorchTensorType" }, { "name": "scale", "type": "Torch_FloatType" }, { "name": "offset", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchTensorType" } ], "assemblyFormat": "$int_repr `,` $scale `,` $offset attr-dict\n `:` qualified(type($int_repr)) `,` qualified(type($scale)) `,` qualified(type($offset)) `->` qualified(type($result))" }, { "name": "torch.prim.abs.Scalar", "summary": "Generated op for `prim::abs.Scalar : (Scalar) -> (Scalar)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchScalarType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.CallMethod", "summary": "TorchScript prim::CallMethod op", "operands": [ { "name": "receiver", "type": "Torch_NnModuleType" }, { "name": "methodOperands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$receiver `[` $name `]` `(` $methodOperands `)` attr-dict `:` qualified(type($receiver)) `,` functional-type($methodOperands, $result)" }, { "name": "torch.prim.CreateObject", "summary": "TorchScript prim::CreateObject op", "results": [ { "name": "result", "type": "Torch_NnModuleType" } ], "assemblyFormat": "attr-dict qualified(type($result))" }, { "name": "torch.prim.device", "summary": "Generated op for `prim::device : (Tensor) -> (Device)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_DeviceType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.DictConstruct", "summary": "TorchScript prim::DictConstruct op", "operands": [ { "name": "keys", "type": "Variadic" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Torch_DictType" } ], "assemblyFormat": "`keys` `(` ($keys^ `:` qualified(type($keys)))? `)` `values` `(` ($values^ `:` qualified(type($values)))? `)` attr-dict `->` qualified(type($result))" }, { "name": "torch.prim.dtype", "summary": "Generated op for `prim::dtype : (Tensor) -> (int)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.Enter", "summary": "enter operation", "description": "This op represents a prim::Enter node in the Python object graph.", "operands": [ { "name": "inp", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "Torch_NoneType" } ], "assemblyFormat": "$inp attr-dict `:` qualified(type($inp))" }, { "name": "torch.prim.Exit", "summary": "exit operation", "description": "This op represents a prim::Exit node in the Python object graph.", "operands": [ { "name": "inp", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "AnyTorchTensorType" } ], "assemblyFormat": "$inp attr-dict `:` qualified(type($inp)) `->` qualified(type($result))" }, { "name": "torch.prim.GetAttr", "summary": "TorchScript prim::GetAttr op", "operands": [ { "name": "receiver", "type": "Torch_NnModuleType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$receiver `[` $name `]` attr-dict `:` qualified(type($receiver)) `->` qualified(type($result))" }, { "name": "torch.prim.If", "summary": "TorchScript prim::If op", "description": "This op (together with prim.If.yield) define a conditional control flow\n construct. It is analogous to `scf.if` for MLIR folks that are familiar\n with that. The main differences from that op are:\n\n - `!torch.bool` condition value.\n - The \"else\" region is always present. This is reflective of invariants of\n the TorchScript IR.\n - No special prettiness for the \"no yielded values\" case. These are\n interesting for modeling mostly-non-SSA programs, but TorchScript IR\n is already in SSA form.\n\n See: https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/OVERVIEW.md#if", "operands": [ { "name": "condition", "type": "Torch_BoolType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "thenRegion", "type": "SizedRegion<1>" }, { "name": "elseRegion", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.If.yield", "summary": "yield-like terminator for torch.prim.If", "description": "Does not correspond to any torch prim op directly (the way that they model\n blocks has a built-in notion of yield-like terminator).", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` qualified(type($results)))?" }, { "name": "torch.prim.layout", "summary": "Generated op for `prim::layout : (Tensor) -> (int)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.ListConstruct", "summary": "TorchScript prim::ListConstruct op", "operands": [ { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyTorchListType" } ], "assemblyFormat": "$elements attr-dict `:` functional-type(operands, results)" }, { "name": "torch.prim.ListUnpack", "summary": "TorchScript prim::ListUnpack op", "operands": [ { "name": "operand", "type": "AnyTorchType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($operand)) `->` qualified(type($results))" }, { "name": "torch.prim.Load", "summary": "load operation", "description": "This op represents a prim::Load node in the Python object graph.", "results": [ { "name": "result", "type": "AnyTorchType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name attr-dict `:` qualified(type($result))" }, { "name": "torch.prim.Loop", "summary": "TorchScript prim::Loop op", "description": "This op (together with prim.Loop.condition) define a looping construct\n that combines `for` and `while` behavior.\n\n See: https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/OVERVIEW.md#loops", "operands": [ { "name": "maxTripCount", "type": "Torch_IntType" }, { "name": "initialCondition", "type": "Torch_BoolType" }, { "name": "iterArgsInit", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "assemblyFormat": "$maxTripCount `,` $initialCondition `,` `init` `(` $iterArgsInit `)` $region\n attr-dict `:` functional-type(operands, results)" }, { "name": "torch.prim.Loop.condition", "summary": "yield-like terminator for torch.prim.Loop", "description": "Does not correspond to any torch prim op directly (the way that they model\n blocks has a built-in notion of yield-like terminator).", "operands": [ { "name": "shouldContinue", "type": "Torch_BoolType" }, { "name": "iterArgs", "type": "Variadic" } ], "assemblyFormat": "$shouldContinue `,`\n `iter` `(` ($iterArgs^ `:` qualified(type($iterArgs)))? `)` attr-dict" }, { "name": "torch.prim.max.int", "summary": "Generated op for `prim::max.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.max.self_int", "summary": "Generated op for `prim::max.self_int : (int[]) -> (int)`", "operands": [ { "name": "self", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.min.int", "summary": "Generated op for `prim::min.int : (int, int) -> (int)`", "operands": [ { "name": "a", "type": "Torch_IntType" }, { "name": "b", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.min.self_int", "summary": "Generated op for `prim::min.self_int : (int[]) -> (int)`", "operands": [ { "name": "self", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.NumToTensor.Scalar", "summary": "Generated op for `prim::NumToTensor.Scalar : (Scalar) -> (Tensor)`", "operands": [ { "name": "a", "type": "AnyTorchScalarType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.Print", "summary": "Generated op for `prim::Print : (...) -> ()`", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "`(` $operands `)` attr-dict `:` qualified(type($operands))" }, { "name": "torch.prim.RaiseException", "summary": "Generated op for `prim::RaiseException : (str, str?) -> ()`", "operands": [ { "name": "msg", "type": "Torch_StringType" }, { "name": "cls", "type": "AnyTorchOptionalStringType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.SetAttr", "summary": "TorchScript prim::SetAttr op", "operands": [ { "name": "receiver", "type": "Torch_NnModuleType" }, { "name": "value", "type": "AnyTorchType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$receiver `[` $name `]` `=` $value attr-dict `:` qualified(type($receiver)) `,` qualified(type($value))" }, { "name": "torch.prim.Store", "summary": "store operation", "description": "This op represents a prim::Store node in the Python object graph.", "operands": [ { "name": "value", "type": "AnyTorchType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name `,` $value attr-dict `:` qualified(type($value))" }, { "name": "torch.prim.tolist", "summary": "Generated op for `prim::tolist : (...) -> (...)`", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "`(` $operands `)` attr-dict `:` qualified(type($operands)) `->` qualified(type($results))" }, { "name": "torch.prim.TupleConstruct", "summary": "TorchScript prim::TupleConstruct op", "description": "Note: This op does not allow trivial type refinement, because the\n operand types and the result types must be in correspondence.", "operands": [ { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Torch_TupleType" } ], "assemblyFormat": "$elements attr-dict `:` qualified(type($elements)) `->` qualified(type($result))" }, { "name": "torch.prim.TupleIndex", "summary": "Generated op for `prim::TupleIndex : (Any, int) -> (Any)`", "operands": [ { "name": "tup", "type": "AnyTorchType" }, { "name": "i", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.TupleUnpack", "summary": "Generated op for `prim::TupleUnpack : (Any) -> (...)`", "operands": [ { "name": "tup", "type": "AnyTorchType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "$tup attr-dict `:` qualified(type($tup)) `->` qualified(type($results))" }, { "name": "torch.prim.unchecked_cast", "summary": "Generated op for `prim::unchecked_cast : (t) -> (t)`", "operands": [ { "name": "x", "type": "AnyTorchType" } ], "results": [ { "name": "result", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prim.Uninitialized", "summary": "Generated op for `prim::Uninitialized : () -> (Any)`", "results": [ { "name": "result", "type": "AnyTorchType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.collapse", "summary": "Generated op for `prims::collapse : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" }, { "name": "start", "type": "Torch_IntType" }, { "name": "end", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.convert_element_type", "summary": "Generated op for `prims::convert_element_type : (Tensor, int) -> (Tensor)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" }, { "name": "dtype", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.iota", "summary": "Generated op for `prims::iota : (int, int, int, int, Device, bool) -> (Tensor)`", "operands": [ { "name": "length", "type": "Torch_IntType" }, { "name": "start", "type": "Torch_IntType" }, { "name": "step", "type": "Torch_IntType" }, { "name": "dtype", "type": "Torch_IntType" }, { "name": "device", "type": "Torch_DeviceType" }, { "name": "requires_grad", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.prod", "summary": "Generated op for `prims::prod : (Tensor, int[]?, int?) -> (Tensor)`", "operands": [ { "name": "inp", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "output_dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.split_dim", "summary": "Generated op for `prims::split_dim : (Tensor, int, int) -> (Tensor)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" }, { "name": "dim", "type": "Torch_IntType" }, { "name": "outer_length", "type": "Torch_IntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.sqrt", "summary": "Generated op for `prims::sqrt : (Tensor) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.squeeze", "summary": "Generated op for `prims::squeeze : (Tensor, int[]) -> (Tensor)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" }, { "name": "dimensions", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.sum", "summary": "Generated op for `prims::sum : (Tensor, int[]?, int?) -> (Tensor)`", "operands": [ { "name": "inp", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "output_dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.var", "summary": "Generated op for `prims::var : (Tensor, int[]?, float?, int?) -> (Tensor)`", "operands": [ { "name": "inp", "type": "AnyTorchTensorType" }, { "name": "dims", "type": "AnyTorchOptionalListOfTorchIntType" }, { "name": "correction", "type": "AnyTorchOptionalFloatType" }, { "name": "output_dtype", "type": "AnyTorchOptionalIntType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.prims.view_of", "summary": "Generated op for `prims::view_of : (Tensor) -> (Tensor)`", "operands": [ { "name": "a", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.promote_dtypes", "summary": "`promote_dtypes op : (int?[], int[]) -> (int)`", "description": "This op is generated when the python function\n `__torch_mlir_internal_promote_dtypes` is used in a dtype refinement\n function. It represents the type promotion logic used by PyTorch to\n determine result types.\n\n The first argument is a list of optional ranks for each of the inputs\n being used for promotion. The ranks are optional to allow representing\n `Scalar` inputs, which follow their own set of promotion rules.\n\n The second argument is a list of dtypes for each of the inputs being used\n for promotion.\n\n The order of the values in each list must be the same. In other words,\n the ith rank and the ith dtype must be from the same Scalar/Tensor.\n\n It is an error to call this op with empty lists or lists of different size.", "operands": [ { "name": "ranks", "type": "AnyTorchListOfOptionalIntType" }, { "name": "dtypes", "type": "AnyTorchListOfTorchIntType" } ], "results": [ { "name": "result", "type": "Torch_IntType" } ], "assemblyFormat": "$ranks `,` $dtypes attr-dict `:` functional-type(operands, results)" }, { "name": "torch.quantized.linear", "summary": "Generated op for `quantized::linear : (Tensor, __torch__.torch.classes.quantized.LinearPackedParamsBase, float, int) -> (Tensor)`", "operands": [ { "name": "X", "type": "AnyTorchTensorType" }, { "name": "W_prepack", "type": "Torch_LinearParamsType" }, { "name": "Y_scale_i", "type": "Torch_FloatType" }, { "name": "Y_zero_point_i", "type": "Torch_IntType" } ], "results": [ { "name": "Y", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.runtime.assert", "summary": "Runtime Assertion", "operands": [ { "name": "condition", "type": "Torch_BoolType" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$condition `,` $message attr-dict" }, { "name": "torch.shape.calculate", "summary": "Shape calculation encapsulation op", "description": "The `torch.shape.calculate` op captures a shape calculation\n (in the region `calculation`) which calculates the shapes for\n the set of values yielded by the `body` region.\n\n The `calculation` region yields a `!torch.list` for each\n value yielded by the `body` region.\n\n Conceptually, the `calculation` region executes first, then `body`\n region. So the `calculation` region can also contain arbitrary\n assertions or side-effecting code which guard the validity of the execution\n of the body (typically by terminating the program with a\n torch.prim.RaiseException op).\n\n The program has undefined behavior if the values yielded by the `body`\n region do not have the shapes yielded by the `calculation` region.", "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" }, { "name": "calculation", "type": "SizedRegion<1>" } ], "assemblyFormat": "$body `shapes` $calculation attr-dict `:` type($results)" }, { "name": "torch.shape.calculate.yield", "summary": "yield-like terminator for torch.shape.calculate", "description": "This op terminates the `body` region of a `torch.shape.calculate` op.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "torch.shape.calculate.yield.shapes", "summary": "yield-like terminator for torch.shape.calculate shape region", "description": "This op terminates the `shapeCalculation` region of a\n `torch.shape.calculate` op.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" }, { "name": "torch.slot", "summary": "Define the value of a slot of a torch.nn.Module", "description": "This op specifies that the initial value of the slot `name` of the\n parent torch.nn_module should be `value`, which is allowed to be an\n arbitrary Torch-compatible SSA value, including other !torch.nn.Module's.", "operands": [ { "name": "value", "type": "AnyTorchType" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$name `,` $value attr-dict `:` qualified(type($value))" }, { "name": "torch.symbolic_int", "summary": "Symbolic int representing a dynamic dimension", "description": "The `torch.symbolic_int` operation captures a dynamic dimension on the\n global function arguments as exported by TorchDynamo (torch.export).\n It associates the shape symbols (i.e. \"s0\", \"s1\") with the\n global SSA values (i.e. `%0`, `%1`) that is then referenced\n to bind shapes on op results.\n\n Additionally, the operation annotates `min_val` and `max_val` attributes\n denoting the range constraints for the dynamic dimension. This may be\n useful for modeling runtime shape guards, or compile-time optimizations\n based on the shape bounds (min, opt, max) on results of ops / regions.\n\n Example:\n ```\n %0 = torch.symbolic_int \"s0\" {min_val = 5, max_val = 10} : !torch.int\n %1 = torch.symbolic_int \"s1\" {min_val = 2, max_val = 20} : !torch.int\n ```\n\n In this case, we see that `s0` has the range [5, 10] and `s1` has the\n range [2, 20]. When unspecified, the range constraints feeding in from\n TorchDynamo default to [0, INT_MAX] (or [2, INT_MAX] in older PyTorch\n releases). In either case, the interpretation (as specified by TorchDynamo)\n is that the dynamic dimension is assumed to be not 0 or 1. This is not a\n bug, and does not necessarily mean that the exported program will not work\n for dimensions 0 or 1. For an in-depth discussion of this topic, see\n [The 0/1 Specialization Problem](https://docs.google.com/document/d/16VPOa3d-Liikf48teAOmxLc92rgvJdfosIy-yoT38Io/edit?fbclid=IwAR3HNwmmexcitV0pbZm_x1a4ykdXZ9th_eJWK-3hBtVgKnrkmemz6Pm5jRQ#heading=h.ez923tomjvyk).", "results": [ { "name": "result", "type": "Torch_IntType" } ], "attributes": [ { "name": "symbol_name", "type": "StrAttr" }, { "name": "min_val", "type": "I64Attr" }, { "name": "max_val", "type": "I64Attr" } ], "assemblyFormat": "$symbol_name ` ` `{` `min_val` `=` $min_val `,` `max_val` `=` $max_val `}` attr-dict `:` type($result)" }, { "name": "torch.tensor_static_info_cast", "summary": "Adds/removes static information from a tensor type.", "description": "This op does not imply any runtime code. Semantically it is an identity\n function. However, it statically annotates (or erases) shape and dtype\n information from a tensor type.\n\n This op *cannot* be used to add/remove value semantics from a tensor.\n For converting between the value-semantic and non-value-semantic domains,\n use `torch.copy.to_tensor` and `torch.copy.from_tensor`. This op is kept\n separate to prevent canonicalizations from accidentally dropping static\n information. In most cases, after running the `torch-refine-types` pass,\n this op becomes a no-op (the pass will incorporate the static information\n into other ops that allow type refinement).", "operands": [ { "name": "operand", "type": "AnyTorchTensorType" } ], "results": [ { "name": "result", "type": "AnyTorchTensorType" } ], "assemblyFormat": "$operand attr-dict `:` qualified(type($operand)) `to` qualified(type($result))" }, { "name": "torch.tensor.literal", "summary": "Create a value of !torch.tensor type from a literal", "description": "Example:\n ```\n %0 = torch.tensor.literal(dense<0.0> : tensor<3x5xf32>) : !torch.tensor\n %1 = torch.tensor.literal(dense<0.0> : tensor<3xf32>) : !torch.tensor<[3],f32>\n ```\n\n This op covers a typical frontend use case of creating a type-erased\n `!torch.tensor`. Inside the compiler, we decompose it into\n `torch.vtensor.literal` which is easier to analyze and transform.\n\n Note: This op is not called \"constant\" because the created tensor is not\n \"constant\" in any meaning of that word.", "results": [ { "name": "result", "type": "Torch_NonValueTensorType" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` qualified(type($result))" }, { "name": "torch.torchvision.deform_conv2d", "summary": "Generated op for `torchvision::deform_conv2d : (Tensor, Tensor, Tensor, Tensor, Tensor, int, int, int, int, int, int, int, int, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "weight", "type": "AnyTorchTensorType" }, { "name": "offset", "type": "AnyTorchTensorType" }, { "name": "mask", "type": "AnyTorchTensorType" }, { "name": "bias", "type": "AnyTorchTensorType" }, { "name": "stride_h", "type": "Torch_IntType" }, { "name": "stride_w", "type": "Torch_IntType" }, { "name": "pad_h", "type": "Torch_IntType" }, { "name": "pad_w", "type": "Torch_IntType" }, { "name": "dilation_h", "type": "Torch_IntType" }, { "name": "dilation_w", "type": "Torch_IntType" }, { "name": "groups", "type": "Torch_IntType" }, { "name": "offset_groups", "type": "Torch_IntType" }, { "name": "use_mask", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.torchvision.nms", "summary": "Generated op for `torchvision::nms : (Tensor, Tensor, float) -> (Tensor)`", "operands": [ { "name": "dets", "type": "AnyTorchTensorType" }, { "name": "scores", "type": "AnyTorchTensorType" }, { "name": "iou_threshold", "type": "Torch_FloatType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.torchvision.roi_align", "summary": "Generated op for `torchvision::roi_align : (Tensor, Tensor, float, int, int, int, bool) -> (Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "rois", "type": "AnyTorchTensorType" }, { "name": "spatial_scale", "type": "Torch_FloatType" }, { "name": "pooled_height", "type": "Torch_IntType" }, { "name": "pooled_width", "type": "Torch_IntType" }, { "name": "sampling_ratio", "type": "Torch_IntType" }, { "name": "aligned", "type": "Torch_BoolType" } ], "results": [ { "name": "result", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.torchvision.roi_pool", "summary": "Generated op for `torchvision::roi_pool : (Tensor, Tensor, float, int, int) -> (Tensor, Tensor)`", "operands": [ { "name": "input", "type": "AnyTorchTensorType" }, { "name": "rois", "type": "AnyTorchTensorType" }, { "name": "spatial_scale", "type": "Torch_FloatType" }, { "name": "pooled_height", "type": "Torch_IntType" }, { "name": "pooled_width", "type": "Torch_IntType" } ], "results": [ { "name": "result0", "type": "AnyTorchOptionalTensorType" }, { "name": "result1", "type": "AnyTorchOptionalTensorType" } ], "hasCustomAssemblyFormat": true }, { "name": "torch.valsem.aten.bernoulli.float", "summary": "`bernoulli.float op : (Tensor, float, Generator?) -> (Tensor)`", "operands": [ { "name": "self", "type": "AnyTorchTensorType" }, { "name": "p", "type": "Torch_FloatType" }, { "name": "generator", "type": "AnyTorchOptionalGeneratorType" } ], "results": [ { "name": "result", "type": "AnyTorchTensorType" } ], "assemblyFormat": "$self `,` $p `,` $generator attr-dict `:` type($self) `,` type($p) `,` type($generator) `->` type($result)" }, { "name": "torch.vtensor.literal", "summary": "Create a value of !torch.vtensor type from a literal", "description": "Example:\n ```\n %0 = torch.vtensor.literal(dense<0.0> : tensor<3x5xf32>) : !torch.vtensor<[3,5],f32>\n %1 = torch.vtensor.literal(dense<0.0> : tensor<3xf32>) : !torch.vtensor<[3],f32>\n ```\n\n Unlike `torch.tensor.literal`, which covers a typical frontend use case\n and allows type refinement, this op always has a maximally resolved type\n (which is always possible, because it is created from a literal). This\n has a stronger set of invariants that better fit the needs of the\n compiler internals.", "results": [ { "name": "result", "type": "Torch_ValueTensorType" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ], "assemblyFormat": "`(` $value `)` attr-dict `:` qualified(type($result))" }, { "name": "tosa.abs", "summary": "Elementwise abs operator.", "description": "Elementwise absolute value operation.\n\n This operation is not pure. Undefined behaviour may occur if the\n calculated result underflows.\n\n Example:\n\n ```mlir\n %output = tosa.abs(%input1) : (tensor<21x3xf32>) -> tensor<21x3xf32>\n ```", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.add", "summary": "Elementwise addition operator.", "description": "Elementwise addition of input1 and input2. Axis of size 1 will be broadcast,\n as necessary. Rank of input tensors must match.\n\n This operation is not pure. Undefined behaviour may occur if the calculated\n result overflows.\n\n Example:\n\n ```mlir\n // Elementwise addition.\n %out = tosa.add %input1, %input2 : tensor<12x6xf32>, tensor<12x6xf32> -> tensor<12x6xf32>\n\n // Elementwise addition with broadcasting.\n %out = tosa.add %input1, %input2 : tensor<12x6xsi32>, tensor<1x1xsi32> -> tensor<12x6xsi32>\n ```", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.add_shape", "summary": "Elementwise addition of shapes.", "description": "Elementwise addition of input1 and input2. Size of shapes must match.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.apply_scale", "summary": "Rescale scalar operator for Tosa tensor operators", "description": "Applies rescaling for fixed point values. This behavior is replicated in\n multiple quantized operations (mul, convolution, rescale, matmul, pooling).\n\n The commonplace implementation is to use i64 operations to avoid integer\n overflow with target specific implementations can use native operations to\n avoid wider than necessary types.", "operands": [ { "name": "value", "type": "Tosa_IntLike" }, { "name": "multiplier", "type": "Tosa_IntLike" }, { "name": "shift", "type": "Tosa_Int8Like" } ], "results": [ { "name": "output", "type": "Tosa_IntLike" } ], "attributes": [ { "name": "rounding_mode", "type": "Tosa_RoundingModeAttr{SINGLE_ROUND|INEXACT_ROUND|DOUBLE_ROUND}" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.argmax", "summary": "Perform argmax on the input.", "description": "This returns the index with the largest value across the given axis of the\n input tensor. If multiple locations have equal values, returns the first\n match along the search axis.\n\n This operation is not pure. Undefined behaviour may occur if the max index\n is out of bounds for the output data type.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.arithmetic_right_shift", "summary": "Elementwise Arithmetic Right Shift.", "description": "Elementwise arithmetic right shift of input1 by the amount specified in\n input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors\n must match.\n\n This operation is not pure. Undefined behaviour may occur if the specified\n shift is out of range.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "round", "type": "BoolAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.assert_equal_shape", "summary": "Verify two shapes are equal.", "description": "Verify input1 and input2 are equal. If allow_broadcast is set, shapes which\n are broadcast compatible are allowed.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "attributes": [ { "name": "allow_broadcast", "type": "BoolAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.avg_pool2d", "summary": "Performs average pooling on the input.", "description": "This performs an average pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor, with\n the mean value being placed in the output tensor. When calculating the\n average, only the number of valid input tensor values, but not padding, are\n used to calculate the divisor.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "output_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "kernel", "type": "ConfinedAttr]>" }, { "name": "stride", "type": "ConfinedAttr]>" }, { "name": "pad", "type": "ConfinedAttr]>" }, { "name": "acc_type", "type": "TypeAttrOf" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.avg_pool2d_adaptive", "summary": "Performs average pooling on the input with shape operands.", "description": "This performs an average pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor, with\n the mean value being placed in the output tensor. When calculating the\n average, only the number of valid input tensor values, but not padding, are\n used to calculate the divisor. Compared to avg_pool2d, the kernel/stride/\n pad values are provided as inputs.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "output_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "kernel", "type": "Rank2TosaShape" }, { "name": "stride", "type": "Rank2TosaShape" }, { "name": "pad", "type": "Rank4TosaShape" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "acc_type", "type": "TypeAttrOf" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.bitwise_and", "summary": "Bitwise AND operator.", "description": "Elementwise bitwise AND of input1 and input2. Axis of size 1\n will be broadcast as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.bitwise_not", "summary": "Bitwise NOT operator.", "description": "Elementwise bitwise NOT of input tensor.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.bitwise_or", "summary": "Bitwise OR operator.", "description": "Elementwise bitwise OR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.bitwise_xor", "summary": "Bitwise XOR operator.", "description": "Elementwise bitwise XOR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.cast", "summary": "Cast operation.", "description": "Casts a tensor from one data type to another.", "operands": [ { "name": "input", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.cast_from_block_scaled", "summary": "Apply scales from a scale tensor to the values in a value tensor", "description": "Apply the scales from a scale tensor to the values in a value tensor, casting\n the result to the output type. The block dimension must be the last dimension\n of the tensor.\n\n Note: This operation is deprecated. It will be removed in the future.", "operands": [ { "name": "input_data", "type": "Tosa_MXFPDataTensorAtLeast1D" }, { "name": "input_scale", "type": "Tosa_MXFPScaleTensorAtLeast1D" } ], "results": [ { "name": "output_data", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "block_size", "type": "Tosa_BlockSizeAttr{BLOCK_SIZE_1|BLOCK_SIZE_32}" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.cast_to_block_scaled", "summary": "Calculate scale tensor values per block, output to separate scale and data tensors.", "description": "Calculate a scale value per block of input values and use that to calculate\n scaled data values from an input tensor. The output tensors are cast to the\n specified scale and value types. The block dimension will be the last dimension\n of the tensor.\n\n Note: This operation is deprecated. It will be removed in the future.", "operands": [ { "name": "input_data", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output_data", "type": "Tosa_MXFPDataTensorAtLeast1D" }, { "name": "output_scale", "type": "Tosa_MXFPScaleTensorAtLeast1D" } ], "attributes": [ { "name": "block_size", "type": "Tosa_BlockSizeAttr{BLOCK_SIZE_1|BLOCK_SIZE_32}" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.ceil", "summary": "Elementwise ceil operator.", "description": "Elementwise ceiling operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.clamp", "category": "Activation", "summary": "Computes clamp(features, min, max).", "description": "Clamp to an arbitrary minimum and maximum value.\n Maximum and minimum values are specified as values in the range of the\n input type.\n No zero point subtraction is done to the values, thus to clamp to the zero\n point value, the zero point itself should be supplied as the minimum value.", "operands": [ { "name": "input", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "min_val", "type": "Tosa_IntOrFloatAttr" }, { "name": "max_val", "type": "Tosa_IntOrFloatAttr" }, { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.clz", "summary": "Elementwise count leading zero operator.", "description": "Elementwise count leading zeros operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.concat", "category": "Tensor", "summary": "Concatenates tensors along one dimension.", "description": "Concatenate a list of tensors along a given axis.\n No data conversion happens during a concat operation.", "operands": [ { "name": "input1", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.concat_shape", "summary": "Concatenates a list of shapes.", "description": "Concatenates a list of shapes into a new shape with length equal to the sum\n of the lengths of the inputs.", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.cond_if", "summary": "Conditional if operator.", "description": "Evaluates a Boolean condition and then takes one of two distinct execution\n paths. This implements the semantic If-then-else structure.", "operands": [ { "name": "condition", "type": "Tosa_I1Tensor" }, { "name": "input_list", "type": "Variadic" } ], "results": [ { "name": "output_list", "type": "Variadic" } ], "regions": [ { "name": "then_graph", "type": "SizedRegion<1>" }, { "name": "else_graph", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.const", "summary": "Constant operator.", "description": "A node containing constant data for use as the input to an operation. May\n hold data in any of the supported data formats.\n\n Example:\n\n ```mlir\n // Generic form\n %out = \"tosa.const\"() {values = dense<0> : tensor<2x3xi32>} : () -> tensor<2x3xi32>\n ```", "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "values", "type": "ElementsAttr" } ], "traits": [ { "type": "FirstAttrDerivedResultType" } ] }, { "name": "tosa.const_shape", "summary": "Constant Shape operator.", "description": "A node containing a constant shape.\n\n Example:\n\n ```mlir\n // Generic form\n %out = \"tosa.const_shape\"() {values = dense<0> : tensor<4xindex>} : () -> !tosa.shape<4>\n ```", "results": [ { "name": "output", "type": "Tosa_Shape" } ], "attributes": [ { "name": "values", "type": "IndexElementsAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.conv2d", "category": "Layer", "summary": "2D Convolution operator.", "description": "Performs a 2D convolution over the given tensor input, using the weight\n tensor. Implementations may choose to skip calculation of multiplies in\n the padding area.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "weight", "type": "Tosa_Tensor4D" }, { "name": "bias", "type": "Tosa_Tensor1D" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "weight_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "pad", "type": "ConfinedAttr]>" }, { "name": "stride", "type": "ConfinedAttr]>" }, { "name": "dilation", "type": "ConfinedAttr]>" }, { "name": "acc_type", "type": "TypeAttrOf" }, { "name": "local_bound", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.conv2d_block_scaled", "summary": "Performs two dimensional convolution using block scaled tensors.", "description": "Performs a 2D convolution over the given input data and scales, using\n the weight data and scales. Implementations may choose to skip calculation\n of multiplies in the padding area.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input_data", "type": "Tosa_MXFPDataTensor4D" }, { "name": "input_scale", "type": "Tosa_MXFPScaleTensor4D" }, { "name": "weight_data", "type": "Tosa_MXFPDataTensor4D" }, { "name": "weight_scale", "type": "Tosa_MXFPScaleTensor4D" }, { "name": "bias", "type": "Tosa_Tensor1D" }, { "name": "pad", "type": "Rank4TosaShape" }, { "name": "stride", "type": "Rank2TosaShape" }, { "name": "dilation", "type": "Rank2TosaShape" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "block_size", "type": "Tosa_BlockSizeAttr{BLOCK_SIZE_1|BLOCK_SIZE_32}" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.conv3d", "category": "Layer", "summary": "3D Convolution operator.", "description": "Performs a 3D convolution over the given input tensor. Implementations\n may choose to skip calculation of multiplies in the padding area.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_Tensor5D" }, { "name": "weight", "type": "Tosa_Tensor5D" }, { "name": "bias", "type": "Tosa_Tensor1D" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "weight_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor5D" } ], "attributes": [ { "name": "pad", "type": "ConfinedAttr]>" }, { "name": "stride", "type": "ConfinedAttr]>" }, { "name": "dilation", "type": "ConfinedAttr]>" }, { "name": "acc_type", "type": "TypeAttrOf" }, { "name": "local_bound", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.cos", "summary": "Elementwise cos operator.", "description": "Elementwise cosine operation for values given in radians.", "operands": [ { "name": "input1", "type": "Tosa_FloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_FloatTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.custom", "summary": "Custom operator wrapper for Tosa", "description": "Hardware implementing TOSA may choose to add additional custom operators\n that are not expressed in the existing TOSA operations. These operators are\n not expected to be portable across TOSA implementations. The input and\n output signatures must be expressed in the corresponding TOSA node.\n\n `operator_name` is a string that tells the backend which custom operator is\n being called.\n\n `domain_name` is a string identifier which can help avoid name collisions on\n the identifier field.\n\n `implementation_attrs` is a string which is a backend and identifier specific\n set of attributes to the custom operator.\n\n `input_list` is the set of tensor inputs to the custom operator.\n\n `output_list` is the list of tensors returned by the operator. The number of operators\n is backend specific.\n\n Example:\n\n ```mlir\n %out = tosa.custom %in {domain_name = \"tosa_mlir_test\", operator_name =\n \"custom_test\", implementation_attrs = \"\"}: (tensor<10xi32>) ->\n (tensor<10xi32>)\n ```", "operands": [ { "name": "input_list", "type": "Variadic" } ], "results": [ { "name": "output_list", "type": "Variadic" } ], "attributes": [ { "name": "operator_name", "type": "StrAttr" }, { "name": "domain_name", "type": "StrAttr" }, { "name": "implementation_attrs", "type": "StrAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.depthwise_conv2d", "summary": "Depthwise 2D Convolution operator.", "description": "Performs 2D convolutions separately over each channel of the given tensor\n input, using the weight tensor. Implementations may choose to skip\n calculation of multiplies in the padding area.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "weight", "type": "Tosa_Tensor4D" }, { "name": "bias", "type": "Tosa_Tensor1D" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "weight_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "pad", "type": "ConfinedAttr]>" }, { "name": "stride", "type": "ConfinedAttr]>" }, { "name": "dilation", "type": "ConfinedAttr]>" }, { "name": "acc_type", "type": "TypeAttrOf" }, { "name": "local_bound", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.dim", "summary": "Extract size of dimension from input tensor.", "description": "Returns a length 1 shape_t of the size of the input tensor for the given axis.", "operands": [ { "name": "input1", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.div_ceil_shape", "summary": "Elementwise ceiling divide of shapes.", "description": "Elementwise divide of input1 by input2. The result of the divide is rounded up.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.div_floor_shape", "summary": "Elementwise floor divide of shapes.", "description": "Elementwise integer divide of input1 by input2. The result of the divide is rounded down.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.equal", "summary": "Returns the truth value of (input1 == input2) element-wise.", "description": "Elementwise comparison operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.erf", "summary": "Computes gauss error function of input.", "description": "Gauss error function: $ erf(x) = \\frac{2}{\\sqrt{\\pi}} \\int_{0}^{x} e^{-t^2} dt $\n For quantized integer data types, the TABLE operator should be used instead\n with the following definition. The ERF table has 513 entries each of\n 16-bit precision and covering the input range -4.0 to +4.0 in steps of 1/64.", "operands": [ { "name": "input", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.exp", "summary": "Elementwise exp operator.", "description": "Elementwise e to the x operation", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.exp2_shape", "summary": "Elementwise base-2 exponential of shapes.", "description": "Computation of raising two to the power of each element in input.", "operands": [ { "name": "input", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.fft2d", "summary": "Performs FFT2D operation on the input.", "description": "Performs a batched complex 2D Fast Fourier Transform over the input. The\n complex input values are constructed from the corresponding values in the\n input_real and input_imag tensors. The resulting values in the output are\n split into the output_real and output_imag tensors. No normalization is\n applied on either the forward or inverse versions of the operation.\n\n Example:\n\n ```mlir\n %output_real, %output_imag = tosa.fft2d %input_real, %input_imag : (tensor<8x9xf32>, tensor<8x9xf32>) -> (tensor<8x9xf32>, tensor<8x9xf32>)\n ```", "operands": [ { "name": "input_real", "type": "Tosa_Tensor3D" }, { "name": "input_imag", "type": "Tosa_Tensor3D" } ], "results": [ { "name": "output_real", "type": "Tosa_Tensor3D" }, { "name": "output_imag", "type": "Tosa_Tensor3D" } ], "attributes": [ { "name": "inverse", "type": "BoolAttr" }, { "name": "local_bound", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.floor", "summary": "Elementwise floor operator.", "description": "Elementwise floor operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.gather", "category": "Tensor", "summary": "Gather operation.", "description": "Generate a tensor for which each element in the output is a subtensor of the\n values tensor based on the indices. N is the number of batches, W the number\n of indices in each batch, K the range of each index and C the number data\n channels for each index.\n\n This operation is not pure. Undefined behaviour may occur if the specified\n indices are out of range.", "operands": [ { "name": "values", "type": "Tosa_Tensor3D" }, { "name": "indices", "type": "Tosa_IndexTensor2D" } ], "results": [ { "name": "output", "type": "Tosa_Tensor3D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.greater", "summary": "Returns the truth value of (input1 > input2) element-wise.", "description": "Elementwise greater than comparison operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.greater_equal", "summary": "Returns the truth value of (input1 >= input2) element-wise.", "description": "Elementwise comparison operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.identity", "summary": "Identity operator.", "description": "Returns a tensor with the same shape, type, and contents as the input.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.intdiv", "summary": "Integer divide operator.", "description": "Elementwise integer divide of input1 by input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match. The result of the\n divide is truncated towards zero. Expected use is for operations on\n non-scaled integers. Floating point divide should use RECIPROCAL and MUL.\n Quantized integer divide should use TABLE (for 1/x) and MUL.\n\n This operation is not pure. Undefined behaviour may occur on division by zero.", "operands": [ { "name": "input1", "type": "Tosa_Int32Or64Tensor" }, { "name": "input2", "type": "Tosa_Int32Or64Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Int32Or64Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.log", "summary": "Elementwise log operator.", "description": "Elementwise natural logarithm operation", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.log2_ceil_shape", "summary": "Elementwise ceil base-2 logarithm of shapes.", "description": "Computation of the base two logarithm of each element in input. Result is rounded up.", "operands": [ { "name": "input", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.log2_floor_shape", "summary": "Elementwise floor base-2 logarithm of shapes.", "description": "Computation of the base two logarithm of each element in input. Result is rounded down.", "operands": [ { "name": "input", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.logical_and", "summary": "Returns the truth value of input1 AND input2 element-wise.", "description": "Elementwise logical AND of input1 and input2. Axis of size 1 will be\n broadcast, as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_I1Tensor" }, { "name": "input2", "type": "Tosa_I1Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.logical_left_shift", "summary": "Elementwise Logical Left Shift.", "description": "Elementwise logical left-shift of input1 by the amount specified in input2.\n Axis of size 1 will be broadcast, as necessary.\n Rank of input tensors must match.\n\n This operation is not pure. Undefined behaviour may occur if the specified\n shift is out of range.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.logical_not", "summary": "Returns the truth value of NOT input1 element-wise.", "description": "Elementwise logical NOT of input.", "operands": [ { "name": "input1", "type": "Tosa_I1Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.logical_or", "summary": "Returns the truth value of x OR y element-wise.", "description": "Elementwise logical OR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_I1Tensor" }, { "name": "input2", "type": "Tosa_I1Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.logical_right_shift", "summary": "Elementwise Logical Right Shift.", "description": "Elementwise logical right shift of input1 by the amount specified in input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors must\n match.\n\n This operation is not pure. Undefined behaviour may occur if the specified\n shift is out of range.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.logical_xor", "summary": "Returns the truth value of input1 XOR input2 element-wise.", "description": "Elementwise logical XOR of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_I1Tensor" }, { "name": "input2", "type": "Tosa_I1Tensor" } ], "results": [ { "name": "output", "type": "Tosa_I1Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.matmul", "summary": "Matrix multiplication operator.", "description": "Performs two dimensional matrix multiplications.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "a", "type": "Tosa_Tensor3D" }, { "name": "b", "type": "Tosa_Tensor3D" }, { "name": "a_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "b_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor3D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.matmul_t", "summary": "Matrix multiplication with transposed B operator.", "description": "Performs two dimensional matrix multiplications. `A` matrix is of shape\n `N x H x C`. `B` matrix is of shape `D x W x C`. This is effectively a\n matrix multiply of `A` by the transposed `B` matrix. If the batched \n dimension of input `B` is of size 1, the `B` matrix is broadcast.", "operands": [ { "name": "a", "type": "Tosa_Tensor3D" }, { "name": "b", "type": "Tosa_Tensor3D" }, { "name": "a_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "b_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor3D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.matmul_t_block_scaled", "summary": "Performs two dimensional matrix multiplications using block scaled tensors.", "description": "Performs two dimensional matrix multiplications using block scaled tensors. The block\n dimension is always the the last dimension of the tensor, so the result is effectively\n a matrix multiply of A by the transposed B matrix. If the N dimension of input B is of\n size 1, the B matrix will be broadcast.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "a_data", "type": "Tosa_MXFPDataTensor3D" }, { "name": "a_scale", "type": "Tosa_MXFPScaleTensor3D" }, { "name": "b_data", "type": "Tosa_MXFPDataTensor3D" }, { "name": "b_scale", "type": "Tosa_MXFPScaleTensor3D" } ], "results": [ { "name": "output_data", "type": "Tosa_Tensor3D" } ], "attributes": [ { "name": "block_size", "type": "Tosa_BlockSizeAttr{BLOCK_SIZE_1|BLOCK_SIZE_32}" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.max_pool2d", "category": "Pool", "summary": "Performs max pooling on the input.", "description": "This performs a max pooling over the given input tensor. A sliding window of\n size given by is passed over the input tensor, with the\n maximum value being placed in the\n output tensor.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "kernel", "type": "ConfinedAttr]>" }, { "name": "stride", "type": "ConfinedAttr]>" }, { "name": "pad", "type": "ConfinedAttr]>" }, { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.max_pool2d_adaptive", "summary": "Performs max pooling on the input.", "description": "This performs a max pooling over the given input tensor. A sliding window of\n size given by is passed over the input tensor, with the\n maximum value being placed in the output tensor.\n Compared to MAX_POOL2D, MAX_POOL2D_ADAPTIVE has the kernel, stride,\n pad arguments as inputs rather than attributes.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "kernel", "type": "Rank2TosaShape" }, { "name": "stride", "type": "Rank2TosaShape" }, { "name": "pad", "type": "Rank4TosaShape" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.max_shape", "summary": "Elementwise maximum of shapes.", "description": "Elementwise maximum of input1 and input2.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.maximum", "summary": "Elementwise Maximum.", "description": "Elementwise max of input1 and input2. Axis of size 1 will be broadcast, as\n necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.min_shape", "summary": "Elementwise minimum of shapes.", "description": "Elementwise minimum of input1 and input2.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.minimum", "summary": "Elementwise Minimum.", "description": "Elementwise minimum of input1 and input2. Axis of size 1\n will be broadcast, as necessary. Rank of input tensors must match.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.mod_shape", "summary": "Elementwise modulo of shapes.", "description": "Elementwise modulo of input1 divided by input2.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.mul", "summary": "Multiplication operator.", "description": "Elementwise multiplication (Hadamard product) of input1 and input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors must\n match.\n\n This operation is not pure. Undefined behaviour may occur if the specifed\n shift is out of range or the result overflows.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" }, { "name": "shift", "type": "Tosa_ScalarInt8Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.mul_shape", "summary": "Elementwise multiplication of shapes.", "description": "Elementwise multiplication of input1 and input2.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.negate", "summary": "Elementwise negate operator.", "description": "Elementwise negation operation.\n\n This operation is not pure. Undefined behaviour may occur if the calculated\n result underflows or overflows.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input1_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "output_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.pad", "category": "Transform", "summary": "Pads a tensor with value specified.", "description": "Pads a tensor along the borders of each dimension with a supplied value.\n Returns a new tensor with the padding included. The pad_const value includes\n the zero point if the tensor uses a zero point.\n\n Example:\n\n ```mlir\n %pad_const = \"tosa.const\"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>\n %padding = tosa.const_shape {values = dense<[1, 2, 3, 4]> : tensor<4xindex>} : () -> !tosa.shape<4>\n tosa.pad %arg0, %padding, %pad_const: (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xf32>) -> (tensor<4x9xf32>)\n ```\n\n Example 2:\n\n ```mlir\n %pad_const = \"tosa.const\"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>\n %padding = tosa.const_shape {values = dense<[-1, 2, 3, 4]> : tensor<4xindex>} : () -> !tosa.shape<4>\n tosa.pad %arg0, %padding, %pad_const : (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xf32>) -> (tensor)\n ```", "operands": [ { "name": "input1", "type": "Tosa_TensorAtLeast1D" }, { "name": "padding", "type": "Tosa_Shape" }, { "name": "pad_const", "type": "Tosa_ScalarTensor" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.pow", "summary": "Computes the power of one value to another.", "description": "Elementwise input1 value raised to the power of input2.\n Axis of size 1 will be broadcast, as necessary. Rank of input tensors must\n match.\n\n This operation is not pure. Undefined behaviour may occur if specified\n exponent is negative.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.reciprocal", "summary": "Elementwise reciprocal operator.", "description": "Elementwise reciprocal operation. For integer operation, a TABLE should be\n used with the appropriate ranges.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.reduce_all", "summary": "Reduce All operator.", "description": "Reduce a tensor along the given axis with a logical AND operation.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.reduce_any", "summary": "Reduce Any operator.", "description": "Reduce a tensor along the given axis with a logical OR operation.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.reduce_max", "summary": "Reduce Max operator.", "description": "Reduce a tensor along the given axis with a maximum operation.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.reduce_min", "summary": "Reduce Min operator.", "description": "Reduce a tensor along the given axis with a minimum operation.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "nan_mode", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.reduce_product", "summary": "Reduce Product operator.", "description": "Reduce a tensor along the given axis by computing the product of the axis.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.reduce_sum", "summary": "Reduce Sum operator.", "description": "Reduce a tensor along the given axis by computing the sum of the axis.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.rescale", "summary": "Tosa rescale operator.", "description": "RESCALE is defined using an integer multiply, add, and shift.\n\n Rescale supports two precisions of multiplier: 16-bit and 32-bit. The 32-bit multiplier\n version supports two rounding modes to enable simpler lowering of existing frameworks\n that use two stage rounding. All arithmetic is designed so that it does not overflow a\n 64-bit accumulator and that the result fits in 32 bits. In particular, a 48-bit value\n cannot be scaled with the 32-bit multiplier because the accumulator would need to have\n 80 bits.\n\n The shift and value range are limited to allow a variety of implementations. The limit\n of 62 on shift allows the shift to be decomposed as two right shifts of 31.\n\n This operation is not pure. Undefined behaviour may occur if the calculated\n result underflows or overflows.\n\n Supported rescalings:\n * This table is showing the supported conversions from the TOSA Specification.\n * The MLIR dialect here can be used to represent other conversions.\n\n | Mode | Input | Output | Unsigned input | Unsigned output |\n |------------------------|-------|--------|----------------|-----------------|\n | signed 16 to 16 | int16 | int16 | false | false |\n | signed 16 to 32 | int16 | int32 | false | false |\n | signed 16 to 8 | int16 | int8 | false | false |\n | signed 32 to 16 | int32 | int16 | false | false |\n | signed 32 to 32 | int32 | int32 | false | false |\n | signed 32 to 8 | int32 | int8 | false | false |\n | signed 8 to 16 | int8 | int16 | false | false |\n | signed 8 to 32 | int8 | int32 | false | false |\n | signed 8 to 8 | int8 | int8 | false | false |\n | signed 48 to 16 | int48 | int16 | false | false |\n | signed 48 to 32 | int48 | int32 | false | false |\n | signed 48 to 8 | int48 | int8 | false | false |\n | unsigned 8 to signed 8 | uint8 | int8 | true | false |\n | signed 8 to unsigned 8 | int8 | uint8 | false | true |", "operands": [ { "name": "input", "type": "Tosa_Tensor" }, { "name": "multiplier", "type": "Tosa_1DInt16Or32Tensor" }, { "name": "shift", "type": "Tosa_1DInt8Tensor" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "output_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "scale32", "type": "BoolAttr" }, { "name": "rounding_mode", "type": "Tosa_RoundingModeAttr{SINGLE_ROUND|INEXACT_ROUND|DOUBLE_ROUND}" }, { "name": "per_channel", "type": "BoolAttr" }, { "name": "input_unsigned", "type": "BoolAttr" }, { "name": "output_unsigned", "type": "BoolAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.reshape", "category": "Shape", "summary": "Reshape operator.", "description": "Returns a tensor with the same type/values as the input, with a new shape\n specified by the shape argument. Reshape may operate on tensors of any rank.\n No data conversion happens during a reshape operation.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "shape", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.reshape_block_scaled", "summary": "Reshape with support for block scaled tensors.", "description": "Returns a tensor-list with the same type/values as the input, with a new\n shape specified by the shape argument. Reshape may operate on block-scaled\n tensors (values tensor followed by scale tensor) of rank 1 or higher; or a\n single non-block-scaled tensor of any rank. No data conversion happens during\n a reshape operation. Reshape must retain the relationship between values\n and their scale in a block for block-scaled content.", "operands": [ { "name": "input", "type": "Variadic" }, { "name": "new_value_shape", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "block_size", "type": "Tosa_BlockSizeAttr{BLOCK_SIZE_1|BLOCK_SIZE_32}" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.resize", "summary": "Resize operation, supports various resize/upsample modes.", "description": "Resizes a tensor. Resize is only allowed in the H and W dimensions.\n\n The height dimension is scaled by factor (scale_y_n/scale_y_d). The width\n dimension is scaled by factor (scale_x_n/scale_x_d).\n\n The NEAREST_NEIGHBOR mode returns the value of the input tensor closest to\n the calculated sample position for both floating-point and integer data\n formats.\n\n Floating-point BILINEAR mode returns a bilinearly interpolated output value\n based on the four closest input sample positions.\n\n For integer BILINEAR interpolation mode, the output value must be scaled by\n 1/(scale_y_n * scale_x_n) in a following operation to complete the\n interpolation (for example with a RESCALE operator).\n\n The output dimensions can be derived from the input dimensions by inverting\n the scale as described in the pseudocode. The [border_y, border_x] values\n adjust the output size to allow fractional sampling beyond integer input\n position (IH - 1,IW - 1).\n\n The limit MAX_SCALE is applied to each scale ratio after reduction of the\n ratio. Individual scale numerator and denominator values are allowed to be\n larger than MAX_SCALE.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "scale", "type": "Rank4TosaShape" }, { "name": "offset", "type": "Rank2TosaShape" }, { "name": "border", "type": "Rank2TosaShape" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "mode", "type": "Tosa_ResizeModeAttr{NEAREST_NEIGHBOR|BILINEAR}" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.reverse", "category": "Transform", "summary": "Reverse operator.", "description": "Returns a tensor with the same type/values as the input, with the data\n reversed along the given axis. No data conversion happens during a reverse\n operation.", "operands": [ { "name": "input1", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.rfft2d", "summary": "Performs RFFT2D operation on the input.", "description": "Performs a batched 2D real-valued Fast Fourier Transform over the input where\n the input tensor consists of real values producing complex valued output. The\n complex output values will be split into the output_real and output_imag\n tensor arguments. RFFT2D takes advantage of Hermitian symmetry to only\n calculate the first half of the final output axis. Implementations may choose\n to skip calculation of the imaginary values at (0,0), (0,W/2), (H/2,0), and\n (H/2, W/2). If the calculation is skipped, the result at that location must be\n zero.\n\n Example:\n\n ```mlir\n %ouput_real, %output_imag = tosa.rfft2d %input_real : (tensor<8x16xf32>) -> (tensor<8x9xf32>, tensor<8x9xf32>)\n ```", "operands": [ { "name": "input_real", "type": "Tosa_Tensor3D" } ], "results": [ { "name": "output_real", "type": "Tosa_Tensor3D" }, { "name": "output_imag", "type": "Tosa_Tensor3D" } ], "attributes": [ { "name": "local_bound", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.row_gather", "summary": "Row gather operation.", "description": "Generate a tensor based on the input indices and row_count. The number of\n consecutive rows gathered for each index is specified in row_count. N is \n the number of batches, W is the number of indices in each batch, K is\n the range of each index, and C is the number of data channels for each\n index. The values tensor has shape [N, K, C] and the output tensor has shape\n [N, W * row_count, C].\n\n This operation is not pure. Undefined behaviour may occur if the specified\n indices are out of range.", "operands": [ { "name": "values", "type": "Tosa_Tensor3D" }, { "name": "indices", "type": "Tosa_IndexTensor2D" }, { "name": "row_count", "type": "Tosa_ScalarInt32Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor3D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.row_gather_block_scaled", "summary": "Row gather operation for block-scaled and non-block-scaled data.", "description": "Generate a tensor-list which contains a data tensor and an optional scale\n tensor based on the input indices and row_count. The number of consecutive\n rows gathered for each index is specified in row_count.\n\n The variadic `values` operands and results model the flattened\n `tensor_list_t` form from the TOSA spec:\n - non-block-scaled: 1 input value tensor and 1 result tensor\n - block-scaled: data + scale input tensors and data + scale result tensors\n\n This operation follows the TOSA 1.1 draft specification and may evolve as\n the specification is updated.\n\n This operation is not pure. Undefined behaviour may occur if the specified\n indices are out of range.", "operands": [ { "name": "values", "type": "Variadic" }, { "name": "indices", "type": "Tosa_IndexTensor2D" }, { "name": "row_count", "type": "Tosa_ScalarInt32Tensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "attributes": [ { "name": "block_size", "type": "Tosa_BlockSizeAttr{BLOCK_SIZE_1|BLOCK_SIZE_32}" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.rsqrt", "summary": "Elementwise 1/sqrt operator.", "description": "Elementwise reciprocal square root operation. For integer operation, a TABLE\n should be used with the appropriate ranges.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.scatter", "category": "Tensor", "summary": "Scatter operation.", "description": "The values_out tensor is set to the values_in tensor with data modified as\n follows: data from the input tensor is inserted at the positions specified\n by the indices tensor. N is the number of batches, W the number of indices\n in each batch, K the range of each index and C the number data channels for\n each index. It is not permitted to repeat the same output index within a\n single SCATTER operation and so each output index occurs at most once. It\n follows that K >= W. In use cases that require multiple updates to the same\n output position, these must be decomposed into multiple SCATTER operations.\n\n This operation is not pure. Undefined behaviour may occur if the specified\n indices are out of range or duplicate indices are provided.", "operands": [ { "name": "values_in", "type": "Tosa_Tensor3D" }, { "name": "indices", "type": "Tosa_IndexTensor2D" }, { "name": "input", "type": "Tosa_Tensor3D" } ], "results": [ { "name": "values_out", "type": "Tosa_Tensor3D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.select", "summary": "Elementwise select operator.", "description": "Elementwise select of the output based on a condition.", "operands": [ { "name": "input1", "type": "Tosa_I1Tensor" }, { "name": "input2", "type": "Tosa_Tensor" }, { "name": "input3", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.sigmoid", "category": "Activation", "summary": "Computes elementwise sigmoid of input.", "description": "Applies the sigmoid logistic function to each element of the input tensor:\n $ sigmoid(x) = \\frac{1}{1 + e^{-x}} $.\n\n For quantized integer data types, the TABLE operator should be used instead.\n Each implementation may choose an appropriate TABLE given the scale and zero\n point of the input data. Eight or sixteen bit precision tables may be used\n based on the input tensor to the sigmoid function.", "operands": [ { "name": "input", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.sin", "summary": "Elementwise sin operator.", "description": "Elementwise sine operation for values given in radians.", "operands": [ { "name": "input1", "type": "Tosa_FloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_FloatTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.slice", "category": "Tensor", "summary": "Slice operator.", "description": "Extracts a slice of input1, beginning at the start coordinates,\n and extending for size elements in each direction.\n No data conversion happens during a slice operation.", "operands": [ { "name": "input1", "type": "Tosa_TensorAtLeast1D" }, { "name": "start", "type": "Tosa_Shape" }, { "name": "size", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.slice_shape", "summary": "Extract slice of a shape.", "description": "Extract a shape of size from input.", "operands": [ { "name": "input", "type": "Tosa_Shape" }, { "name": "start", "type": "Tosa_ScalarInt32Tensor" }, { "name": "size", "type": "Tosa_ScalarInt32Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.sub", "summary": "Elementwise subtraction operator.", "description": "Elementwise subtraction of input1 and input2. Axis of size 1 will be\n broadcast as necessary. Rank of input tensors must match.\n\n This operation is not pure. Undefined behaviour may occur if the calculated\n result underflows.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "input2", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.sub_shape", "summary": "Elementwise subtraction of shapes.", "description": "Elementwise subtraction of input1 and input2. Size of shapes must match.", "operands": [ { "name": "input1", "type": "Tosa_Shape" }, { "name": "input2", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_Shape" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.table", "summary": "Table lookup operator.", "description": "Table lookup operation. For int8_t TABLE operation, perform a 256 entry\n table lookup returning an int8_t value. For int16_t tables, the int16_t\n input is treated as a fixed-point 9.7 value. The most significant 9 bits\n are used to index into the table. The fractional 7 bits are used to\n interpolate based on table[index] and table[index+1]. For int16_t inputs,\n the TABLE operator returns a 16.7 interpolated value in an int32_t. This\n value can then be input to the RESCALE operator to scale to the required\n output data type. Note that int16_t table has 513 values to handle\n table[index+1] when index=511.\n\n An int16_t to int16_t table lookup can be constructed in TOSA as follows:\n * Use the TABLE operator to produce a fixed point 16.7 interpolated result\n * Use RESCALE (in_t=int32_t, out_t=int16_t, scale=1<<14, shift=21) to\n scale the output to int16_t range (or alternate scale as required)\n\n This operation is not pure. Undefined behaviour may occur if the calculated\n slope is out of range.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" }, { "name": "table", "type": "Tosa_Tensor1D" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.tanh", "category": "Activation", "summary": "Computes elementwise hyperbolic tangent of input.", "description": "Parameterized hyperbolic tangent: $ tanh(x) = \\frac{1 - e^{-2x}}{1 + e^{-2x}} $.\n\n For quantized integer data types, the TABLE operator should be used instead.\n Each implementation may choose an appropriate TABLE given the scale and zero\n point of the input data. Eight or sixteen bit precision tables may be used\n based on the input tensor to the tanh function.", "operands": [ { "name": "input", "type": "Tosa_Tensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.tile", "summary": "Tile operator.", "description": "Replicates input1 multiples times along each dimension.", "operands": [ { "name": "input1", "type": "Tosa_TensorAtLeast1D" }, { "name": "multiples", "type": "Tosa_Shape" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.transpose", "category": "Transform", "summary": "Transpose operator.", "description": "Permutes the dimensions of the input tensor input1 based on the perms\n argument. Each value in the perms list must be a valid dimension of the\n input tensor and may not be repeated.", "operands": [ { "name": "input1", "type": "Tosa_TensorAtLeast1D" } ], "results": [ { "name": "output", "type": "Tosa_TensorAtLeast1D" } ], "attributes": [ { "name": "perms", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.transpose_conv2d", "summary": "Transpose 2D Convolution operator.", "description": "Performs a 2D transposed convolution over the given tensor input, using the\n weights tensor. Implementations may choose to skip calculation of multiplies\n by zero at fractional input positions.\n\n This operation is not pure. Undefined behaviour may occur if the accumulated\n result overflows.", "operands": [ { "name": "input", "type": "Tosa_Tensor4D" }, { "name": "weight", "type": "Tosa_Tensor4D" }, { "name": "bias", "type": "Tosa_Tensor1D" }, { "name": "input_zp", "type": "Tosa_ScalarIntOrFloatTensor" }, { "name": "weight_zp", "type": "Tosa_ScalarIntOrFloatTensor" } ], "results": [ { "name": "output", "type": "Tosa_Tensor4D" } ], "attributes": [ { "name": "out_pad", "type": "ConfinedAttr]>" }, { "name": "stride", "type": "ConfinedAttr]>" }, { "name": "acc_type", "type": "TypeAttrOf" }, { "name": "local_bound", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "tosa.variable", "summary": "Defines a variable", "description": "Defines a new TOSA variable. This is a persistent mutable value across multiple\n TOSA graph invocations. Modifications are expressed using read/write semantics.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "var_shape", "type": "IndexElementsAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "initial_value", "type": "OptionalAttr" } ], "assemblyFormat": "$sym_name\n attr-dict\n custom($var_shape, $type, $initial_value)", "hasCustomAssemblyFormat": true }, { "name": "tosa.variable_read", "summary": "read_buffer operator", "description": "Reads the value from a pseudo-buffer resource holding a persistent mutable tensor.", "results": [ { "name": "output1", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "name", "type": "SymbolNameAttr" } ], "assemblyFormat": "$name attr-dict `:` type($output1)" }, { "name": "tosa.variable_write", "summary": "write_buffer operator", "description": "Assigns a value to the pseudo-buffer resource holding a persistent mutable tensor.", "operands": [ { "name": "input1", "type": "Tosa_Tensor" } ], "attributes": [ { "name": "name", "type": "SymbolNameAttr" } ], "assemblyFormat": "$name attr-dict `,` $input1 `:` type($input1)" }, { "name": "tosa.while_loop", "summary": "output = input; While (Cond(output)) {output = Body(output)}", "description": "Generates and evaluates a Boolean condition and either executes a loop body\n or exits the loop. This action is performed repeatedly after\n updating and re-evaluating the Boolean condition every iteration. This\n implements the semantic foreach or while iterative loop structure.", "operands": [ { "name": "input_list", "type": "Variadic" } ], "results": [ { "name": "output_list", "type": "Variadic" } ], "regions": [ { "name": "cond_graph", "type": "SizedRegion<1>" }, { "name": "body_graph", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "tosa.yield", "summary": "yield operator", "description": "return operation within the conditional and body of\n structured control flow. Operation takes variadic operands\n but produces no results of its own.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "assemblyFormat": "$inputs attr-dict `:` type($inputs)" }, { "name": "toy.add", "summary": "element-wise addition operation", "description": "The \"add\" operation performs element-wise addition between two tensors.\n The shapes of the tensor operands are expected to match.", "operands": [ { "name": "lhs", "type": "F64Tensor" }, { "name": "rhs", "type": "F64Tensor" } ], "results": [ { "name": "result", "type": "F64Tensor" } ], "hasCustomAssemblyFormat": true }, { "name": "toy.cast", "summary": "shape cast operation", "description": "The \"cast\" operation converts a tensor from one type to an equivalent type\n without changing any data elements. The source and destination types must\n both be tensor types with the same element type. If both are ranked, then\n shape is required to match. The operation is invalid if converting to a\n mismatching constant dimension.", "operands": [ { "name": "input", "type": "F64Tensor" } ], "results": [ { "name": "output", "type": "F64Tensor" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($output)" }, { "name": "toy.constant", "summary": "constant", "description": "Constant operation turns a literal into an SSA value. The data is attached\n to the operation as an attribute. For example:\n\n ```mlir\n %0 = toy.constant dense<[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]>\n : tensor<2x3xf64>\n ```", "results": [ { "name": "result", "type": "F64Tensor" } ], "attributes": [ { "name": "value", "type": "F64ElementsAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "toy.func", "summary": "user defined function operation", "description": "The \"toy.func\" operation represents a user defined function. These are\n callable SSA-region operations that contain toy computations.\n\n Example:\n\n ```mlir\n toy.func @main() {\n %0 = toy.constant dense<5.500000e+00> : tensor\n %1 = toy.reshape(%0 : tensor) to tensor<2x2xf64>\n toy.print %1 : tensor<2x2xf64>\n toy.return\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "toy.generic_call", "summary": "generic call operation", "description": "Generic calls represent calls to a user defined function that needs to\n be specialized for the shape of its arguments. The callee name is attached\n as a symbol reference via an attribute. The arguments list must match the\n arguments expected by the callee. For example:\n\n ```mlir\n %4 = toy.generic_call @my_func(%1, %3)\n : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>\n ```\n\n This is only valid if a function named \"my_func\" exists and takes two\n arguments.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Toy_Type" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $inputs `)` attr-dict `:` functional-type($inputs, results)" }, { "name": "toy.mul", "summary": "element-wise multiplication operation", "description": "The \"mul\" operation performs element-wise multiplication between two\n tensors. The shapes of the tensor operands are expected to match.", "operands": [ { "name": "lhs", "type": "F64Tensor" }, { "name": "rhs", "type": "F64Tensor" } ], "results": [ { "name": "result", "type": "F64Tensor" } ], "hasCustomAssemblyFormat": true }, { "name": "toy.print", "summary": "print operation", "description": "The \"print\" builtin operation prints a given input tensor, and produces\n no results.", "operands": [ { "name": "input", "type": "AnyTypeOf<[F64Tensor, F64MemRef]>" } ], "assemblyFormat": "$input attr-dict `:` type($input)" }, { "name": "toy.reshape", "summary": "tensor reshape operation", "description": "Reshape operation is transforming its input tensor into a new tensor with\n the same number of elements but different shapes. For example:\n\n ```mlir\n %0 = toy.reshape (%arg1 : tensor<10xf64>) to tensor<5x2xf64>\n ```", "operands": [ { "name": "input", "type": "F64Tensor" } ], "results": [ { "name": "result", "type": "StaticShapeTensorOf<[F64]>" } ], "assemblyFormat": "`(` $input `:` type($input) `)` attr-dict `to` type(results)" }, { "name": "toy.return", "summary": "return operation", "description": "The \"return\" operation represents a return operation within a function.\n The operation takes an optional operand and produces no results.\n The operand type must match the signature of the function that contains\n the operation. For example:\n\n ```mlir\n toy.func @foo() -> tensor<2xf64> {\n ...\n toy.return %0 : tensor<2xf64>\n }\n ```", "operands": [ { "name": "input", "type": "Variadic" } ], "assemblyFormat": "($input^ `:` type($input))? attr-dict" }, { "name": "toy.struct_access", "summary": "struct access", "description": "Access the Nth element of a value returning a struct type.", "operands": [ { "name": "input", "type": "Toy_StructType" } ], "results": [ { "name": "output", "type": "Toy_Type" } ], "attributes": [ { "name": "index", "type": "I64Attr" } ], "assemblyFormat": "$input `[` $index `]` attr-dict `:` type($input) `->` type($output)" }, { "name": "toy.struct_constant", "summary": "struct constant", "description": "Constant operation turns a literal struct value into an SSA value. The data\n is attached to the operation as an attribute. The struct constant is encoded\n as an array of other constant values. For example:\n\n ```mlir\n %0 = toy.struct_constant [\n dense<[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]> : tensor<2x3xf64>\n ] : !toy.struct>\n ```", "results": [ { "name": "output", "type": "Toy_StructType" } ], "attributes": [ { "name": "value", "type": "ArrayAttr" } ], "assemblyFormat": "$value attr-dict `:` type($output)" }, { "name": "toy.transpose", "summary": "transpose operation", "operands": [ { "name": "input", "type": "F64Tensor" } ], "results": [ { "name": "result", "type": "F64Tensor" } ], "assemblyFormat": "`(` $input `:` type($input) `)` attr-dict `to` type(results)" }, { "name": "tpu.A16Gather", "summary": "Quantized gather operator for embedding lookup", "description": "Gather operation with quantized weights, designed for embedding lookup in LLMs.\n Performs: output[..., dim] = dequant(weight[indices[...], :])\n\n The weight tensor is stored in quantized format (INT8 or packed INT4),\n with per-group scale and zero-point for dequantization.\n Similar to Gather, but with quantized weight table instead of float input.\n\n Currently only axis=0 is supported (runtime assertion).\n keepdims controls whether the gathered axis dimension is retained (as size 1)\n in the output. Default is false (axis dimension replaced by indices shape).", "operands": [ { "name": "weight", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyTensorOrNone" }, { "name": "zp", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "keepdims", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.A16MatMul", "summary": "w8a16 / w4a16 matmul operator", "description": "1.Op Introduction\n The special matrix multiplication designed for LLM Linear Layer.\n Weight is saved in int8 with f16 per-channel quant scale.\n\n 2.Math formula\n ```math\n y_f16 = x_f16 x (quantized_w.to(f16) * scale_f16)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n weight(w.): weight tensor.;\n scale(w.): scalar.;\n zp(w.): zero points for weight quant.;\n bias(w.): an optional tensor can be added to the result of the matrix multiplication. ;\n\n 4.attributes\n weight_bits: the bit-width used to represent the weight values.;\n sign: if output is signed.;\n w_transpose: whether the weight tensor should be transposed;\n q_group_size: the group size for per-group quantization.;\n multicore: whether op supports multicore execution.;\n dq_type: the quantized data type for dynamic quantization.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyTensorOrNone" }, { "name": "zp", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "weight_bits", "type": "I64Attr" }, { "name": "sign", "type": "DefaultValuedAttr" }, { "name": "w_transpose", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" }, { "name": "dq_type", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.Active", "summary": "Active operator", "description": "1.Op Introduction\n The operator for activation function.\n\n 2.Math formula\n ```math\n output = Active(input),for example:Relu, Silu...\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n mode: the specific activation mode or function to be applied by the operator.;\n coeffs: an array of float64 values as coefficients for activation functions.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "Tpu_ActiveModeAttr{TANH|SIGMOID|RELU|EXP|ELU|SQRT|SQUARE|RSQRT|ABSVAL|LN|ROUND|CEIL|FLOOR|SIN|COS|IS_FINITE|MISH|SWISH|HSWISH|SILU|ARCSIN|ARCCOS|ARCSINH|ARCCOSH|ARCTANH|SINH|COSH|TAN|SIGN|GELU|ERF|HSIGMOID|LOG_SIGMOID|SOFT_PLUS|SOFT_SIGN|LOG2|TGELU|QGELU}" }, { "name": "coeffs", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Add", "summary": "add operator", "description": "1.Op Introduction\n Elementwise addition of input1 and input2. Axis of size 1 will be broadcast,\n as necessary.\n\n 2.Math formula\n ```math\n output = ReLU((input1 + input2; dim))\n ```\n Axis of size 1 will be broadcast if necessary.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n coeff: It is an array and allows for scaling the output of the addition operation.;\n // early stride param\n do_early_stride: whether to apply early stride optimization during the addition operation.;\n early_stride_h: the height of the early stride.;\n early_stride_w: the width of the early stride.;\n // quant param\n multipliers: an array of multipliers used for quantization, It allows for scaling the input values before the addition operation.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n f8_scales: scaling factors for FP8 (8-bit floating point) quantization.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "coeff", "type": "OptionalAttr>" }, { "name": "do_early_stride", "type": "OptionalAttr" }, { "name": "early_stride_h", "type": "OptionalAttr" }, { "name": "early_stride_w", "type": "OptionalAttr" }, { "name": "multipliers", "type": "OptionalAttr>" }, { "name": "rshifts", "type": "OptionalAttr>" }, { "name": "f8_scales", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.AddConst", "summary": "add const operator", "description": "1.Op Introduction\n Elementwise add of input1 and input2. Input2 is constant.\n\n 2.Math formula\n ```math\n output = input + const_val\n ```\n Where input1, input2, ..., inputN are the input tensors.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n f8_scale: the scaling factor for FP8 (8-bit floating point) quantization.;\n ginfo: contains layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "f8_scale", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Arg", "summary": "Arg operator", "description": "1.Op Introduction\n Computes the indices of the min/max/ of the input tensor's element along the provided axis.\n\n 2.Math formula\n ```math\n maximum operation:\n output_max[i_1, i_2, i_3,..., i_k] = arg max{j}(input[i_1, i_2,..., i_k, j])\n minimum operation:\n output_min[i_1, i_2, i_3,..., i_k] = arg min{j}(input[i_1, i_2,..., i_k, j])\n ```\n where, ( j ) represents the index along the specified axis.\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n select_last_index: select the last index of the minimum or maximum value when multiple along the specified axis.;\n use_int_input: choose if use i32/i16 as input, due to BF16 chip arch limit.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "indices", "type": "AnyRankedTensor" }, { "name": "values", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "keepdims", "type": "BoolAttr" }, { "name": "mode", "type": "ArgModeAttr" }, { "name": "select_last_index", "type": "DefaultValuedAttr" }, { "name": "use_int_input", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Attention", "summary": "Attention operator", "description": "1.Op Introduction\n Performs a multi head attention block. https://en.wikipedia.org/wiki/Attention_(machine_learning)\n This block has Q_w, K_w,V_w, O_w and mask\n\n 2.Math formula\n ```math\n Attention(Q, K, V) = softmax(((Q x K^T) / \\sqrt{d_k}) + musk) x V;\n head_i = Attention(Q x queries_weight, K x keys_weight, V x values_weight);\n MultiHead(Q, K, V) = Concat(head_1, head_2, ..., head_h) x out_weight + out_bias;\n output = MultiHead(input x queries_weight + queries_bias, input x keys_weight + keys_bias, input x values_weight + values_bias).\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n keys(act.): The keys are derived from the input data and help the model determine which parts of the input are relevant for each query.;\n values(act.): The values are the actual information that will be aggregated based on the attention scores computed from the queries and keys.;\n queries_weight(w.): Queries are the features that the model uses to ask questions about the input data.;\n queries_bias(w.): added to the query representations after the weight transformation.;\n keys_weight(w.): This weight tensor transforms the input into key representations.;\n keys_bias(w.): added to the key representations after the weight transformation, providing further adjustment.;\n values_weight(w.): used to transform the input into value representations.;\n values_bias(w.): added to the value representations after the weight transformation.;\n out_weight(w.): used to transform the concatenated output of the attention heads into the final output representation.;\n out_bias(w.): added to the output representation after the final weight transformation.;\n musk(w.): apply masking during the attention computation, Masks can prevent the model from attending to certain positions in the input.;\n table(w.): additional computations or transformations during the softmax operation.;\n\n 4.attributes\n quant_param: used to reduce the precision of the numbers used in computations.;\n scale: a scaling factor applied to the attention scores before they are passed through the softmax function.;\n head: the number of attention heads to use in the multi-head attention mechanism.;\n dim: the size of the input features or the size of the query, key, and value vectors.;;\n has_bias: whether the attention mechanism includes bias terms in its computations.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "keys", "type": "AnyTensorOrNone" }, { "name": "values", "type": "AnyTensorOrNone" }, { "name": "queries_weight", "type": "AnyTensor" }, { "name": "queries_bias", "type": "AnyTensorOrNone" }, { "name": "keys_weight", "type": "AnyTensorOrNone" }, { "name": "keys_bias", "type": "AnyTensorOrNone" }, { "name": "values_weight", "type": "AnyTensorOrNone" }, { "name": "values_bias", "type": "AnyTensorOrNone" }, { "name": "out_weight", "type": "AnyTensor" }, { "name": "out_bias", "type": "AnyTensorOrNone" }, { "name": "mask", "type": "AnyTensorOrNone" }, { "name": "table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "quant_param", "type": "DefaultValuedAttr, {0}>" }, { "name": "scale", "type": "F64Attr" }, { "name": "head", "type": "I64Attr" }, { "name": "dim", "type": "I64Attr" }, { "name": "has_bias", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.AutoIncrease", "summary": "Auto increase", "description": "1.Op Introduction\n increase by 1 in-place\n\n 2.Math formula\n ```math\n output = AutoIncrease(input, const_val)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ] }, { "name": "tpu.Batch2Space", "summary": "Batch2Space operator", "description": "1.Op Introduction\n Refer to `https://www.tensorflow.org/api_docs/python/tf/batch_to_space`\n\n 2.Math formula\n ```math\n h_croping = h * block_h - crop_top - crop_bottom,\n w_croping = w * block_w - crop_left - crop_right,\n [n, c, h, w] => [n / (block_h * block_w), c, h * block_h, w * block_w]\n => [n / (block_h * block_w), c, h_croping, w_croping];\n The format of input or output is NCHW.\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n block_h: The height of the blocks used to rearrange the depth into spatial dimensions.;\n block_w: The width of the blocks used to rearrange the depth into spatial dimensions.;\n crops: It contains four ints with top, left, bottom, right.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "block_h", "type": "I64Attr" }, { "name": "block_w", "type": "I64Attr" }, { "name": "crops", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.BatchNormBwd", "summary": "BatchNormalization operation", "description": "1.Op Introduction\n Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs\n with additional channel dimension) as described in the paper\n Batch Normalization: Accelerating Deep Network Training by Reducing\n Internal Covariate Shift `__ .\n\n 2.Math formula\n ```math\n output = \\frac{input - \\mathrm{E}[input]}{ \\variance + \\epsilon} * \\gamma + \\beta\n ```\n\n 3.activation and weight\n grad_out(act.): the gradients of the output of the Batch Normalization layer with respect to the loss. ;\n input(act.): input tensor;\n weight_opt(w.): the optimized weight (or scale) parameter.;\n saved_mean(w.): the mean of the input tensor calculated during the forward pass.;\n saved_invstd(w.): the saved inverse standard deviation (or the reciprocal of the standard deviation) of the input tensor,\n also computed during the forward pass.;\n buffer(w.): serve as a temporary storage or workspace that may be used during the computation of gradients.;\n The mean and standard-deviation are calculated per-dimension over\n the mini-batches and $$\\gamma$$ and $$\\beta$$ are learnable parameter vectors\n of size C (where C is the input channel size).\n\n 4.attributes\n epsilon;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "grad_out", "type": "AnyTensor" }, { "name": "input", "type": "AnyTensor" }, { "name": "weight_opt", "type": "AnyTensorOrNone" }, { "name": "saved_mean", "type": "AnyTensorOrNone" }, { "name": "saved_invstd", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "grad_in", "type": "AnyTensor" }, { "name": "weight_grad", "type": "AnyTensorOrNone" }, { "name": "bias_grad", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.BatchNormTrain", "summary": "BatchNormalization operation", "description": "1.Op Introduction\n Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs\n with additional channel dimension) as described in the paper\n Batch Normalization: Accelerating Deep Network Training by Reducing\n Internal Covariate Shift `__ .\n\n 2.Math formula\n ```math\n output = \\frac{input - \\mathrm{E}[input]}{ \\variance + \\epsilon} * \\gamma + \\beta\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n mean(w.): mean of input tensor in dim C;\n variance(w.): the spread of the input tensor values along the channel dimension for each mini-batch.;\n gamma(w.): scalar;\n beta(w.): scalar;\n The mean and standard-deviation are calculated per-dimension over\n the mini-batches and $$\\gamma$$ and $$\\beta$$ are learnable parameter vectors\n of size C (where C is the input channel size).\n\n 4.attributes\n epsilon;\n momentum: Momentum is a hyperparameter that controls the moving average of the mean and variance of the input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "var", "type": "AnyTensor" }, { "name": "gamma", "type": "AnyTensorOrNone" }, { "name": "beta", "type": "AnyTensorOrNone" }, { "name": "running_status_buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "mean_out", "type": "AnyTensor" }, { "name": "saved_invstd", "type": "AnyTensor" }, { "name": "running_mean", "type": "AnyTensor" }, { "name": "running_var", "type": "AnyTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "momentum", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.BinaryConstShift", "summary": "Binary Const with shift operator", "description": "1.Op Introduction\n The BinaryConstShift operator is a specialized tensor operation that combines binary arithmetic with constant scaling and shifting.\n\n 2.Math formula\n ```math\n output = saturation(input +/-/* scale >> -shift)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: a scaling factor multiplies the input tensor.;\n shift: a shift value applied to the quantized data before scaling.;\n is_reverse: whether the subtraction operation is performed in reverse order.;\n saturation: whether the output should be saturated.\n When set true, the output will be clamped to a predefined range to prevent overflow or underflow during the operation.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "SI32Attr" }, { "name": "mode", "type": "BinaryShiftAttr" }, { "name": "shift", "type": "SI32Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "saturation", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.BinaryShift", "summary": "Binary with shift operator", "description": "1.Op Introduction\n The BinaryShift operator is designed to perform binary operations on two input tensors with an additional shift operation.\n\n 2.Math formula\n ```math\n output = saturation(input1 +/-/* input2 >> -shift)\n ```\n\n 3.activation and weight\n input1(act.): input tensor;\n input2(act.): input tensor;\n\n 4.attributes\n shift: a shift value applied to the quantized data before scaling.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n is_reverse: whether the subtraction operation is performed in reverse order.;\n saturation: whether the output should be saturated.\n When set to true, the output will be clamped to a predefined range to prevent overflow or underflow during the operation.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input1", "type": "AnyRankedTensor" }, { "name": "input2", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "BinaryShiftAttr" }, { "name": "shift", "type": "SI32Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "saturation", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Buffer", "summary": "buffer operator", "description": "1.Op Introduction\n A global buffer for operation, and free after op\n\n 2.Math formula\n ```math\n output = \\text{buffer}(\\text{data})\n ```\n\n 3.activation and weight\n none\n\n 4.attributes\n buffer_type: the type of buffer to be used for the operation.\n include Global memory buffer(GMEM)y, Local memory buffer(LMEM), Tensor memory buffer(TMEM);", "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "buffer_type", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.Cast", "summary": "Cast operation", "description": "1.Op Introduction\n The Tpu_CastOp is a tensor operation that performs type casting on the input tensor.\n\n 2.Math formula\n output = Cast(input);\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n extra_input: whether additional input is required for the casting operation.;\n ginfo: contains layer grouping information.;\n with_scale: whether the casting operation should include a scaling factor.;\n round_mode: the rounding mode to be used during the casting operation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "extra_input", "type": "OptionalAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "with_scale", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.CastAdd", "summary": "add operator", "description": "Cast + Add; One of original Add is casted. Elementwise addition of input1 and input2. Axis of size 1 will be broadcast,\n as necessary.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.ChunkGatedDeltaRule", "summary": "Chunk Gated Delta Rule operator", "description": "1.Op Introduction\n The ChunkGatedDeltaRule operator implements a chunk-wise gated delta rule attention mechanism,\n specialized for efficient linear attention with recurrent state updates.\n The input sequence is split into fixed-size chunks. Within each chunk, intra-chunk attention\n is computed using gated decay factors derived from g. Across chunks, a recurrent state is\n maintained and updated to propagate inter-chunk information. The gating signal g controls\n exponential decay, and beta modulates key/value contributions via element-wise scaling.\n\n 2.Math formula\n ```math\n scale = 1 / sqrt(k_head_dim)\n query = query * scale\n v_beta = value * beta, k_beta = key * beta\n\n // Chunk decay\n g_cumsum = cumsum(g, dim=-1)\n decay_mask = tril(exp(tril(g_cumsum[:, :, :, :, None] - g_cumsum[:, :, :, None, :])))\n attn = I + resolve_lower_triangular(-(k_beta @ key^T) * decay_mask)\n v_new_chunk = attn @ v_beta\n k_cumdecay = attn @ (k_beta * exp(g_cumsum))\n\n // Intra-chunk attention\n intra_chunk_attn = masked_fill(query @ key^T * decay_mask, upper_tri_mask, 0)\n\n // Inter-chunk recurrence (for each chunk i)\n v_prime = k_cumdecay_i @ S_{i-1}\n v_new = v_new_chunk_i - v_prime\n output_i = (query_i * exp(g_i)) @ S_{i-1} + intra_chunk_attn_i @ v_new\n S_i = S_{i-1} * exp(g_last_i) + (key_i * exp(g_last_i - g_i))^T @ v_new\n ```\n\n 3.activation and weight\n query(act.): query tensor with shape (B, num_heads, S, k_head_dim).;\n key(act.): key tensor with shape (B, num_heads, S, k_head_dim).;\n value(act.): value tensor with shape (B, num_heads, S, v_head_dim).;\n g(act.): gating signal tensor with shape (B, num_heads, S), controls the exponential decay rate per position.;\n beta(act.): scaling factor tensor with shape (B, num_heads, S), modulates key and value contributions.;\n recurrent_state(act.): initial recurrent state tensor with shape (B, num_v_heads, k_head_dim, v_head_dim), carries information across chunks.;\n eye(act.): identity matrix tensor with shape (chunk_size, chunk_size), used for constructing the intra-chunk attention transform.;\n\n 4.attributes\n chunk_size: the size of each chunk that the input sequence is split into. The sequence is padded to be divisible by chunk_size.;", "operands": [ { "name": "query", "type": "AnyTensor" }, { "name": "key", "type": "AnyTensor" }, { "name": "value", "type": "AnyTensor" }, { "name": "g", "type": "AnyTensor" }, { "name": "beta", "type": "AnyTensor" }, { "name": "recurrent_state", "type": "AnyTensor" }, { "name": "triu_mask", "type": "AnyTensor" }, { "name": "strict_triu_mask", "type": "AnyTensor" }, { "name": "tril_mask", "type": "AnyTensor" }, { "name": "eye", "type": "AnyTensor" } ], "results": [ { "name": "attn_out", "type": "AnyTensor" } ], "attributes": [ { "name": "num_k_heads", "type": "I64Attr" }, { "name": "num_v_heads", "type": "I64Attr" }, { "name": "d", "type": "I64Attr" }, { "name": "chunk_size", "type": "I64Attr" }, { "name": "use_qk_l2norm", "type": "BoolAttr" }, { "name": "scale", "type": "F64Attr" } ] }, { "name": "tpu.Clip", "summary": "Clip operator", "description": "1.Op Introduction\n The operator limits the given input to a certain range.\n\n 2.Math formula\n ```math\n output[i] = min if input[i] < min;\n input[i] if input[i] >= min && input[i] <= max;\n max if input[i] > max;\n\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n min: the minimum value that the elements of the input tensor can take.;\n max: the maximum value that the elements of the input tensor can take.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "min", "type": "F64Attr" }, { "name": "max", "type": "F64Attr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Compare", "summary": "Compare operator", "description": "1.Op Introduction\n Returns the tensor resulted from performing the compare\n operation elementwise on the input tensors A and B.\n\n 2.Math formula\n ```math\n output[i] = 1 if lhs[i] mode rhs[i] is true\n 0 otherwise\n ```\n\n 3.activation and weight\n lhs(act.): the first input tensor used as the left operand in the element-wise comparison.;\n rhs(act.): the second input tensor used as the right operand in the element-wise comparison.;\n\n 4.attributes\n mode: the type of comparison to be performed between the two input tensors.\n mdoe include Equal, Not Equal, Less Than, Less Than or Equal, Greater Than and Greater Than or Equal;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "CompareModeAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.CompareConst", "summary": "CompareConst operator", "description": "1.Op Introduction\n Returns the tensor resulted from performing the compare\n operation elementwise on the input tensors A and Const.\n\n 2.Math formula\n ```math\n output[i] = 1 if input[i] mode const_val is true\n 0 otherwise\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n mode: the type of comparison to be performed between the two input tensors.\n mdoe include Equal, Not Equal, Less Than, Less Than or Equal, Greater Than and Greater Than or Equal;\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n inversed: whether the mask should be inverted.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "CompareModeAttr" }, { "name": "const_val", "type": "F64Attr" }, { "name": "inversed", "type": "BoolAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Concat", "summary": "Concatate operation", "description": "1.Op Introduction\n Concatenates the given sequence of seq tensors in the given dimension.\n All tensors must either have the same shape (except in the concatenating dimension) or be empty.\n\n 2.Math formula\n output = Concat(input1, input2, axis)\n = input1[axis] + input2[axis];\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n axis: the dimension along which the input tensors will be concatenated.;\n only_merge: whether the operation should only perform a merge of tensors without additional processing.;\n // param for cv18xx\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // for group\n ginfo: contains layer group information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "only_merge", "type": "DefaultValuedAttr" }, { "name": "multipliers", "type": "OptionalAttr>" }, { "name": "rshifts", "type": "OptionalAttr>" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.ConcatSlice", "summary": "ConcatSlice operator", "description": "1.Op Introduction\n The ConcatSlice operator concatenates two tensors along a specified axis,\n then slices off the front portion so the output shape matches the first input.\n This is equivalent to: output = concat(in0, in1, axis)[..., axis_size_1:, ...]\n\n 2.Math formula\n ```math\n concat_result = concatenate(in0, in1, axis=axis)\n output = concat_result[axis_size_1 : axis_size_0 + axis_size_1]\n ```\n where axis_size_0 and axis_size_1 are the sizes of in0 and in1 along the axis.\n\n 3.activation and weight\n in0(act.): first input tensor with shape (n0, c0, h0, w0).;\n in1(act.): second input tensor with shape (n1, c1, h1, w1),\n all dims must match in0 except at the concat axis.;\n\n 4.attributes\n axis: the axis along which to concatenate and then slice.;", "operands": [ { "name": "in0", "type": "AnyTensor" }, { "name": "in1", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ] }, { "name": "tpu.ConcatVolume", "summary": "Concat volume operator for stereo matching", "description": "Build concatenated cost volume for stereo matching.\n Concatenate left and right features with disparity shift.\n\n 2.Math formula\n for i in range(max_disp):\n if i > 0:\n output[:, :C, i, :, :] = left_feature[:, :, :, :]\n output[:, C:, i, :, i:] = right_feature[:, :, :, :-i]\n else:\n output[:, :C, i, :, :] = left_feature\n output[:, C:, i, :, :] = right_feature\n\n 3.activation and weight\n input(act.): left_feature (B, C, H, W), right_feature (B, C, H, W)\n\n 4.attributes\n max_disp: Maximum disparity value, determines the disparity dimension size.\n\n 5.output\n output: Cost volume (B, 2*C, max_disp, H, W)", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "max_disp", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.ConstantFill", "summary": "constant fill operator", "description": "1.Op Introduction\n fill the constant value\n\n 2.Math formula\n ```math\n output = value * ones(shape(input))\n ```\n where, ones(shape(input)) generates a tensor of the same shape as the input tensor, filled with ones.\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n value: the constant value that will fill the output tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "value", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Conv2D", "summary": "convolution 2d operator", "description": "1.Op Introduction\n The Tpu_Conv2DOp operation implements a 2D convolution, which is a fundamental operation in many neural networks,particularly in convolutional neural networks (CNNs).\n This operation takes an input tensor (often representing an image or feature map) and applies a set of learnable filters (kernels) to produce an output tensor.\n\n 2.Math formula\n ```math\n output(N, C_{out}, H, W) = \\sum_{C_{in}} input(N, C_{in}, H + sH * kH, W + sW * kW) * filter(C_{in}, C_{out}, kH, kW) + bias(C_{out})\n ```\n where, kH and kW are the height and width of the filter (kernel), sH and sW are the vertical and horizontal strides.\n N is a batch size, C denotes a number of channels, H is a height of input, and W is width.\n\n 3.activation and weight\n input(act.): input tensor;\n filter(w.): the learnable weights of the convolution 2d operation.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n groups: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n dilation: controls the spacing between the kernel points;\n inserts: additional parameters that may be used for specific optimizations or configurations.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n //new param\n with_bias: whether to include a bias term in the convolution operation.;\n weight_is_coeff: whether the weights (filters) are coefficients.;\n coeff_merged: whether the coefficients have been merged.;\n use_3ic_optimize: whether to use 3-input channel optimization.;\n This Options call `use_3ic_optimize` is useful for speed up convolution computation:\n use_3ic_optimize & 0x3 == 1 means merge kh to ic\n use_3ic_optimize & 0x3 == 2 means merge kw to ic\n use_3ic_optimize & 0x3 == 3 means merge kh and kw to ic\n use_3ic_optimize & 0x10 != 0 means using tiu to do channel broadcast instead of gdma\n use_3ic_optimize & 0x20 != 0 means input bcast addr use buffer (e.g. current op is used by more than one ops)\n use_3ic_optimize & 0x20 != 0 means using tiu to do channel broadcast instead of gdma and input bcast addr use buffer\n (e.g. current op is used by more than one ops)\n kernel_zp: the zero-point for the kernel.It is used in quantized models to adjust the range of the weights.;\n use_winograd: This attribute indicates whether to use the Winograd algorithm for convolution.;\n multiplier: This parameter is used for scaling the output values.;\n rshift: the number of bits to right-shift the quantized values.;\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n ginfo: This attribute contains information about layer grouping, which can be useful for organizing layers in a neural network.;\n // fuse leakyRelu\n do_leaky_relu: whether to apply the Leaky ReLU activation function after the convolution operation.;\n neg_slope: sets the slope for the negative part of the Leaky ReLU function, determining how much the output can be negative.;\n multiplier_pos: This parameter specifies the multiplier for the positive part of the output, used in the context of quantization.;\n multiplier_neg: This parameter specifies the multiplier for the negative part of the output, used in the context of quantization.;\n rshift_pos: This attribute defines the right shift for the positive output values during quantization.;\n rshift_neg: This attribute defines the right shift for the negative output values during quantization.;\n out_f8_scales: This parameter contains the scaling factors for the output in FP8 (8-bit floating point) format.;\n //nnvlc\n support_compress: whether the operation supports compression.;\n compress_info: contains information about the compression method used.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "filter", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "inserts", "type": "OptionalAttr>" }, { "name": "do_kernel_rotate", "type": "OptionalAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "with_bias", "type": "BoolAttr" }, { "name": "weight_is_coeff", "type": "DefaultValuedAttr" }, { "name": "coeff_merged", "type": "DefaultValuedAttr" }, { "name": "use_3ic_optimize", "type": "DefaultValuedAttr" }, { "name": "kernel_zp", "type": "DefaultValuedAttr" }, { "name": "use_winograd", "type": "OptionalAttr" }, { "name": "multiplier", "type": "OptionalAttr>" }, { "name": "rshift", "type": "OptionalAttr>" }, { "name": "weight_bits", "type": "OptionalAttr" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "do_leaky_relu", "type": "OptionalAttr" }, { "name": "neg_slope", "type": "OptionalAttr" }, { "name": "multiplier_pos", "type": "OptionalAttr" }, { "name": "multiplier_neg", "type": "OptionalAttr" }, { "name": "rshift_pos", "type": "OptionalAttr" }, { "name": "rshift_neg", "type": "OptionalAttr" }, { "name": "out_f8_scales", "type": "OptionalAttr>" }, { "name": "support_compress", "type": "DefaultValuedAttr" }, { "name": "compress_info", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Conv3D", "summary": "convolution 2d operator", "description": "1.Op Introduction\n The Tpu_Conv2DOp operation implements a 2D convolution, which is a fundamental operation in many neural networks,particularly in convolutional neural networks (CNNs).\n This operation takes an input tensor (often representing an image or feature map) and applies a set of learnable filters (kernels) to produce an output tensor.\n\n 2.Math formula\n ```math\n output(N, C_{out}, D, H, H) = \\sum_{C_{in}} input(N, C_{in}, D + sD * kD, H + sH * kH, W + sW * kW) * filter(C_{in}, C_{out}, kD, kH, kW) + bias(C_{out})\n ```\n where, kD, kH and kW are the depth, height and width of the filter (kernel), sH and sW are the vertical and horizontal strides.\n N is a batch size, C denotes a number of channels, H is a height of input, and W is width.\n\n 3.activation and weight\n input(act.): input tensor;\n filter(w.): the learnable weights of the convolution 2d operation.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n groups: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n dilation: controls the spacing between the kernel points;\n inserts: additional parameters that may be used for specific optimizations or configurations.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n //new param\n with_bias: whether to include a bias term in the convolution operation.;\n kernel_zp: the zero-point for the kernel.It is used in quantized models to adjust the range of the weights.;\n multiplier: This parameter is used for scaling the output values.;\n rshift: the number of bits to right-shift the quantized values.;\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n ginfo: This attribute contains information about layer grouping, which can be useful for organizing layers in a neural network.;\n out_f8_scale: This parameter contains the scaling factors for the output in FP8 (8-bit floating point) format.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "filter", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "inserts", "type": "OptionalAttr>" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "with_bias", "type": "BoolAttr" }, { "name": "kernel_zp", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "OptionalAttr>" }, { "name": "rshift", "type": "OptionalAttr>" }, { "name": "weight_bits", "type": "OptionalAttr" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "out_f8_scale", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Convbwd", "summary": "convolution backward", "description": "1.Op Introduction\n calculate grad_input,grad_weight,grad_bias of convolution operation;\n\n 2.Math formula\n ```math\n input(N, C_{in}, D, H, W) = \\sum_{C_{out}} output(N, C_{output}, D + sD, H + sH * kH, W + sW * kW) * kernel(C_{in}, C_{out}, kD, kH, kW)\n ```\n 3.activation and weight\n grad_out(act.): how the loss changes with respect to the output of the convolution operation.;\n input(act.): input tensor;\n kernel(w.): weights (filters) ;\n buffer(act.): intermediate computations or storage during the backward pass;\n\n 4.attributes\n groups: the number of groups for grouped convolutions.;\n input_shape: the shape of the input tensor.;\n grad_out_shape: the shape of the tensor that is being backpropagated.;\n kernel_shape: an array of integers.;\n stride: an array of integers for each dimension.;\n dilations: dilation rate for the convolution, controls the spacing between kernel elements.;\n padding: an array of integers.;\n inserts: additional parameters;\n grad_input_enable: whether to compute the gradient with respect to the input tensor.;\n grad_weight_enable: whether to compute the gradient with respect to the kernel tensor.;\n grad_bias_enable: whether to compute the gradient with respect to the bias tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "grad_out", "type": "AnyTensor" }, { "name": "input", "type": "AnyTensor" }, { "name": "kernel", "type": "AnyTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "grad_input", "type": "AnyTensorOrNone" }, { "name": "grad_weight", "type": "AnyTensorOrNone" }, { "name": "grad_bias", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "groups", "type": "I64Attr" }, { "name": "input_shape", "type": "TypedArrayAttrBase" }, { "name": "grad_out_shape", "type": "TypedArrayAttrBase" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "inserts", "type": "TypedArrayAttrBase" }, { "name": "grad_input_enable", "type": "BoolAttr" }, { "name": "grad_weight_enable", "type": "BoolAttr" }, { "name": "grad_bias_enable", "type": "BoolAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.ConvBwd_Weight", "summary": "Convolution Backward operator", "description": "1.Op Introduction\n Gradient of Weight in Convolution Backward.\n\n 2.Math formula\n ```math\n \\frac{\\partial L}{\\partial W} = \\sum_{n=1}^{N} \\sum_{c=1}^{C_{in}} \\sum_{h=1}^{H} \\sum_{w=1}^{W} \\text{input}[n, c, h, w] \\cdot \\text{grad\\_out}[n, :, h', w']\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grad_output(act.): the gradient of the loss with respect to the output.;\n gradout_transpose(w.): The transposed gradient of the output tensor.;\n\n 4.attributes\n groups: Number of blocked connections from input channels to output channels. Default: 1.;\n input_shape: The shape of the input tensor.;\n grad_out_shape: The shape of the gradient output tensor.;\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n dilations: controls the spacing between the kernel points;\n padding: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n grad_bias_enable: whether to compute the gradient for the bias term as well.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "gradout", "type": "AnyTensor" }, { "name": "gradout_transpose", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "groups", "type": "I64Attr" }, { "name": "input_shape", "type": "TypedArrayAttrBase" }, { "name": "grad_out_shape", "type": "TypedArrayAttrBase" }, { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "stride", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "padding", "type": "TypedArrayAttrBase" }, { "name": "grad_bias_enable", "type": "BoolAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Copy", "summary": "TG copy operator.", "description": "1.Op Introduction\n duplicating tensor data from an input to an output buffer.\n\n 2.Math formula\n output = Copy(input, shape, input_stride, output_stride)\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n shape: 0: keep dim from input; -1: left dim from input.;\n input_stride: input data stride(saved as I64ArrayAttr).\n output_stride: output data stride(saved as I64ArrayAttr).\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" }, { "name": "input_stride", "type": "TypedArrayAttrBase" }, { "name": "output_stride", "type": "TypedArrayAttrBase" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.CoreBegin", "summary": "Begin op parallel to multi cores", "description": "1.Op Introduction\n Begin of pattern to multi cores\n\n 2.Math formula\n output = CoreBegin(input, pattern)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n pattern: the core operation pattern used for initializing parallel execution across multiple cores.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "pattern", "type": "Tpu_CorePatternAttr{Common}" } ] }, { "name": "tpu.CoreEnd", "summary": "End op parallel to multi cores", "description": "1.Op Introduction\n End of pattern to multi cores\n\n 2.Math formula\n output = CoreEnd(input, pattern)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n pattern: the core operation pattern used for initializing parallel execution across multiple cores.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "pattern", "type": "Tpu_CorePatternAttr{Common}" } ] }, { "name": "tpu.CoreJoin", "summary": "Join tensor to continues pieces", "description": "1.Op Introduction\n The ops in one parallel should run in parallel.\n\n 2.Math formula\n output = concat(input)\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "multicore", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.CoreParallel", "summary": "Parallel execution region in multi cores", "description": "1.Op Introduction\n The ops in one parallel should run in parallel.\n\n 2.Math formula\n output = CoreParallel(input, offset, size)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n offset: scalar;\n size: the number of elements.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "offset", "type": "I64Attr" }, { "name": "size", "type": "I64Attr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tpu.CoreSplit", "summary": "split tensor to continues pieces", "description": "1.Op Introduction\n The ops in one parallel should run in parallel.\n\n 2.Math formula\n ```math\n output = input[i * split_size: (i + 1) * split_size] for i = 0, 1, ... num - 1\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "multicore", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.Correlation", "summary": "Custom operator correlation", "description": "Multiply the sliced left_feature and right_feature based on max_disp;\n then perform a reduce operation;\n and finally concatenate the results.\n\n 2.Math formula\n for i in range(max_disp):\n if i > 0:\n output[:, i, :, i:] = (left_feature[:, :, :, i:] * right_feature[:, :, :, :-i]).mean(dim=1)\n else:\n output[:, i, :, :] = (left_feature * right_feature).mean(dim=1)\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n max_disp: The number of slicing iterations, which is also the size of the output dimension C.\n num_groups: The number of batch groups.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "max_disp", "type": "DefaultValuedAttr" }, { "name": "num_groups", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.Csc", "summary": "Color space convert for model's inputs", "description": "1.Op Introduction\n Performs csc operation on inputs.\n\n 2.Math formula\n ```math\n output = Csc(input, pixel_format, y_align, w_align, channel_align)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n channel_order: the order of the color channels in the output tensor.(e.g., RGB, BGR).;\n pixel_format: required, pixel format type.;\n aligned: whether the pixel data should be aligned.;\n pixel_type: the type of pixel data.;\n y_align: width alignment of channel y.;\n w_align: width alignment of channel uv.;\n channel_align: alignment of channel.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "channel_order", "type": "OptionalAttr>" }, { "name": "pixel_format", "type": "StrAttr" }, { "name": "aligned", "type": "DefaultValuedAttr" }, { "name": "pixel_type", "type": "DefaultValuedAttr" }, { "name": "y_align", "type": "DefaultValuedAttr" }, { "name": "w_align", "type": "DefaultValuedAttr" }, { "name": "channel_align", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.CumSum", "summary": "CumSum operator", "description": "1.Op Introduction\n Returns the cumulative sum of elements of input in the dimension dim.\n\n 2.Math formula\n ```math\n output[i] = \\sum{j=0, i}input[j]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n dim(w.): If set to 0, computed across rows, If set to 1, computed across columns.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "dim", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Custom", "summary": "Custom operator", "description": "1.Op Introduction\n Custom operator\n\n 2.Math formula\n ```math\n output = CustomFunction(inputs, name, params)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n name: the name of the custom operation to be executed.;\n params: A dictionary of parameters.;\n ginfo: associated with layer grouping information.;", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "params", "type": "TypedArrayAttrBase" }, { "name": "ginfo", "type": "OptionalAttr" } ] }, { "name": "tpu.D2D", "summary": "Copy WeightOp to Device Mem", "description": "1.Op Introduction\n for to alloc address, and can modify the data(with WeightOp to init it)\n\n 2.Math formula\n ```math\n output = D2D(input, const_val)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" } ] }, { "name": "tpu.Deconv", "summary": "deconvolution operator", "description": "1.Op Introduction\n Perform Deconvolution operation.\n\n 2.Math formula\n The height and width of the output tensor can be calculated using the following formulas:\n ```math\n H_{out} = H_{in - 1} x stride[0] - 2 x pads[0] + H_k + output_padding[0]\n W_{out} = W_{in - 1} x stride[1] - 2 x pads[1] + W_k + output_padding[1]\n ```\n The output tensor is computed as:\n ```math\n output(N, C_out, H_out, W_out) = \\sum(c_in) {\\sum(h_k) {\\sum(w_k) {input(n, c_in, h_in, w_in) x filter(c_out, c_in, h_k, w_k)}}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array. ;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n group: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n dilations: controls the spacing between the kernel points;\n output_padding: The value can be provided as a single integer or a tuple, allowing for different padding values for height and width.;\n dynweight_reorderd: whether the weights (filters) should be reordered dynamically.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n with_bias: whether to include a bias term in the convolution operation.;\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n quant_mode: It determines how the output tensor should be quantized.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "filter", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "output_padding", "type": "OptionalAttr>" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "with_bias", "type": "BoolAttr" }, { "name": "multiplier", "type": "OptionalAttr>" }, { "name": "rshift", "type": "OptionalAttr>" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Deconv3D", "summary": "3D deconvolution operator", "description": "1.Op Introduction\n \"Perform 3D deconvolution operation.\"\n\n 2.Math formula\n ```math\n O(n, d, h, w) = \\sum_{c=0}^{C_{\\text{in}}-1} \\sum_{k_d=0}^{K_d-1} \\sum_{k_h=0}^{K_h-1} \\sum_{k_w=0}^{K_w-1}I\\big(n, c, d' \\, , h' \\, , w'\\big) \\times F\\big(c, :, k_d, k_h, k_w\\big)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.;\n group: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n dilations: controls the spacing between the kernel points;\n output_padding: The value can be provided as a single integer or a tuple, allowing for different padding values for height and width.;\n dynweight_reorderd: whether the weights (filters) should be reordered dynamically.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n with_bias: whether to include a bias term in the convolution operation.;\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n quant_mode: It determines how the output tensor should be quantized.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "filter", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "group", "type": "DefaultValuedAttr" }, { "name": "dilations", "type": "OptionalAttr>" }, { "name": "output_padding", "type": "OptionalAttr>" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "with_bias", "type": "BoolAttr" }, { "name": "multiplier", "type": "OptionalAttr>" }, { "name": "rshift", "type": "OptionalAttr>" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.DeformGather", "summary": "Deform gather operator", "description": "1.Op Introduction\n The deform gather operator for deform_conv2d.\n\n 2.Math formula\n ```math\n output = input(offset) * use_mask * mask\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n offset(w.): the learnable offsets of the module of shape.;\n mask(act.): place the pooled values in the output tensor.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n dilations: controls the spacing between the kernel points;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.;\n deform_group: (optional)Number of blocked connections from input channels to output channels. Default: 1.;\n use_mask: whether use mask for input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "offset", "type": "AnyRankedTensor" }, { "name": "mask", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "use_mask", "type": "DefaultValuedAttr" }, { "name": "deform_group", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.DepackRaw", "summary": "Postprocess for raw image.", "description": "1.Op Introduction\n (1) depack channel (b, bh * bw, ih + ph, iw + pw) -> (b, 1, oh * bh, ow * bw)\n (2) cast to INT16 then postprocess img to raw pattern ( 3 byte 2 pixel )\n (3) (b, bh * bw, ih + ph, iw + pw) 16bit -> (b, 1, oh * bh, ow * bw * 3 / 2) 8bit\n\n 2.Math formula\n (1)Depacking:\n The depacking operation can be represented as:\n ```math\n depacked_tensor = reshape(input, (b, 1, oh · bh,ow · bw));\n ```\n Here, input is the packed tensor, and depacked_tensor is the resulting tensor after reshaping.\n (2)Casting to INT16:\n After reshaping, the values are cast to 16-bit integers:\n ```math\n int16_tensor = cast(depacked_tensor, int16);\n ```\n (3)Postprocessing to Raw Pattern:\n The conversion from INT16 back to the raw image format can be described as:\n ```math\n raw_image = int16_tensor x (255 / (white_level - black_level));\n ```\n This scaling ensures that the pixel values are appropriately adjusted based on the specified white and black levels.\n (4)Final Output Tensor:\n Finally, the output tensor is formed by packing the processed values into the required format:\n ```math\n output=reshape(raw_image, (b, 1, oh · bh, ow · bw · 2/3));\n ```\n This ensures that the output tensor has the correct dimensions and format for further processing.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n padding_h: the height of the padding applied to the input image.;\n padding_w: the width of the padding applied to the input image.;\n white_level: the maximum intensity level for normalization.;\n black_level: the minimum intensity level for normalization.;\n channel_order: the order of the color channels in the output tensor.(e.g., RGB, BGR).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "padding_h", "type": "I64Attr" }, { "name": "padding_w", "type": "I64Attr" }, { "name": "white_level", "type": "F64Attr" }, { "name": "black_level", "type": "F64Attr" }, { "name": "channel_order", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Depth2Space", "summary": "Depth2Space operator", "description": "1.Op Introduction\n Refer to `https://github.com/onnx/onnx/blob/main/docs/Operators.md#depthtospace`\n [n, c, h, w] => [n, c / (block_h * block_w), h * block_h, w * block_w];\n if inversed, [n, c, h, w] => [n, c * block_h * block_w, h / block_h, w / block_w];\n if DCR(depth-column-row), channel ordered by block_h * block_w * c;\n else CRD(column-row-depth), channel ordered by c * block_h * block_w;\n The format of input or output is NCHW or NHWC.\n\n 2.Math formula\n\n (1)Standard Transformation:\n Given an input tensor of shape ( (N, C, H, W) ):\n The output tensor after applying the Depth2Space operation can be calculated as:\n ```math\n {output}(N_i, C_j', H_k, W_l) = input(N_i, C_j, k / block_h, l / block_w)\n ```\n where k / block_h and l / block_w are rounded down.\n\n (2)Inverse Transformation:\n Given an input tensor of shape ( (N, C, H, W) ):\n The output tensor after applying the Depth2Space operation can be calculated as:\n ```math\n {output}(N_i, C_j, H_k, W_l) = input(N_i, C_j', (k x block_h + j / (C / (block_h x block_w))), (l x block_w + j % (C / (block_h x block_w))))\n ```\n where C / (block_h x block_w) is rounded down.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n block_h: The height of the blocks used to rearrange the depth into spatial dimensions.;\n block_w: The width of the blocks used to rearrange the depth into spatial dimensions.;\n is_CRD: whether the channel ordering is in Column-Row-Depth format.;\n is_inversed: whether the channel ordering is in Column-Row-Depth format.;\n in_is_NCHW: whether the input tensor is in NCHW format.;\n out_is_NCHW: whether the output tensor should be in NCHW format.;\n swap_cr: swaps the height and width dimensions in the output tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "block_h", "type": "I64Attr" }, { "name": "block_w", "type": "I64Attr" }, { "name": "is_CRD", "type": "BoolAttr" }, { "name": "is_inversed", "type": "BoolAttr" }, { "name": "in_is_NCHW", "type": "DefaultValuedAttr" }, { "name": "out_is_NCHW", "type": "DefaultValuedAttr" }, { "name": "swap_cr", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.DequantInt", "summary": "dequant operation", "description": "1.Op Introduction\n Dequant 8 bit data to 32/16 bit data.\n\n 2.Math formula\n 32/16bit(output) = DequantIntOp((8bit(input), shift) x multiplier) ≪ lshift;\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n shift: a shift value applied to the quantized data before scaling.;\n lshift: a left shift operation applied to the dequantized data after scaling.;\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n ginfo: contains layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "multiplier", "type": "SI32Attr" }, { "name": "shift", "type": "I64Attr" }, { "name": "lshift", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "Tpu_DequantModeAttr{Normal|TFLite}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.DequantIntAxis", "summary": "dequant operation", "description": "1.Op Introduction\n Dequant 8 bit data to 32/16 bit data, PerAxis(or PerChannel)\n\n 2.Math formula\n 32/16bit(output) = DequantIntAxisOp((8bit(input), quant, shift) x multiplier) ≪ lshift;\n\n 3.activation and weight\n input(act.): input tensor;\n quant(act.): This attribute represents the quantization parameters tensor.\n It contains the values used for requantization, such as multipliers and shifts,\n which are specific to each axis or channel.;\n\n 4.attributes\n lshift: a left shift operation applied to the dequantized data after scaling.;\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n ginfo: contains layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "quant", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "lshift", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "Tpu_DequantModeAttr{Normal|TFLite}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.DetectionOutput", "summary": "DetectionOutput operation", "description": "1.Op Introduction\n Intended for use with MultiBox detection method to generate prior.\n\n 2.Math formula\n ```math\n 1.Raw Detection Output\n raw_output = {(b_i, c_i) | i = 1, 2,...,N}\n b_i is the bounding box coordinates, c_i is the i-th confidence score.\n 2.Apply Confidence threshold\n filtered_output = {(b_i, c_i) | c_i >= confidence_threshold}\n 3.Non-Maximum Suppression(NMS)\n nms_output = NMS(filtered_output, nms_threshold)\n 4.Top K detections\n output = top_k(nms_output, top_k)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n num_classes: total number of classes, including the background class.;\n background_label_id: background class, differentiate between detected objects and the background.;\n nms_threshold: The threshold used for Non-Maximum Suppression (NMS).;\n top_k: The maximum number of predictions to be considered for each image.;\n code_type: the encoding type for the bounding box coordinates.;\n keep_top_k: The number of top scoring detections to keep after applying NMS.;\n confidence_threshold: The minimum confidence score required for a detection to be considered valid.;\n share_location: whether the bounding box locations are shared across different classes.;\n variance_encoded_in_target: whether the variance for bounding box predictions is encoded in the target.;\n eta: adjusts the confidence scores during NMS.;\n onnx_nms: configuration for ONNX compatibility (default is 1).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "num_classes", "type": "I64Attr" }, { "name": "background_label_id", "type": "DefaultValuedAttr" }, { "name": "nms_threshold", "type": "F64Attr" }, { "name": "top_k", "type": "I64Attr" }, { "name": "code_type", "type": "DetectionOutputCodeTypeAttr" }, { "name": "keep_top_k", "type": "I64Attr" }, { "name": "confidence_threshold", "type": "F64Attr" }, { "name": "share_location", "type": "DefaultValuedAttr" }, { "name": "variance_encoded_in_target", "type": "DefaultValuedAttr" }, { "name": "eta", "type": "DefaultValuedAttr" }, { "name": "onnx_nms", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.DevBegin", "summary": "Begin distribution tensors to multi device", "description": "1.Op Introduction\n Tensors split to distributed device\n\n 2.Math formula\n output = DevBegin(inputs, pattern, begin_methods, num_head, done)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n pattern: the core operation pattern used for initializing parallel execution across multiple cores.;\n begin_methods: an array of strategies used to begin the distribution process across devices.;\n num_head: the number of primary channels that are processed first or in parallel.;\n done: a flag whether the distribution initialization process is completed.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "pattern", "type": "Tpu_DevPatternAttr{MatMulColumn|MatMulRow|MatMulMerge|MatMulSliceMerge|MatMulTopK|MatMulSliceMerge2|MatMulSliceMerge3|AttentionSliceMerge|AttentionSliceMerge2|EmbeddingSliceMerge|FAttentionSliceMerge}" }, { "name": "begin_methods", "type": "TypedArrayAttrBase" }, { "name": "num_head", "type": "DefaultValuedAttr" }, { "name": "done", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.DevEnd", "summary": "End distribution tensors from outputs", "description": "1.Op Introduction\n Tensors from distributed device connect together.\n\n 2.Math formula\n output = DevBegin(inputs, pattern, begin_methods, num_head, done)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n pattern: the core operation pattern used for initializing parallel execution across multiple cores.;\n end_methods: an array of strategies used to end the distribution process across devices.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "pattern", "type": "Tpu_DevPatternAttr{MatMulColumn|MatMulRow|MatMulMerge|MatMulSliceMerge|MatMulTopK|MatMulSliceMerge2|MatMulSliceMerge3|AttentionSliceMerge|AttentionSliceMerge2|EmbeddingSliceMerge|FAttentionSliceMerge}" }, { "name": "end_methods", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.Device2Host", "summary": "Device2Host Operation", "description": "1.Op Introduction\n takes data from device mem to host mem\n\n 2.Math formula\n ```math\n output = Device2Host(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.Div", "summary": "div operator", "description": "1.Op Introduction\n Performs element-wise binary division.\n\n 2.Math formula\n ```math\n output = input/const_val or const_val/input\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n is_reverse: whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.DtypeCast", "summary": "Cast F32 to F16", "description": "1.Op Introduction\n Cast F32 to F16\n The Tpu_DtypeCastOp is a specialized operation designed to cast floating-point tensors from 32-bit precision (F32) to 16-bit precision (F16).\n\n 2.Math formula\n FLOAT16(output) = DtypeCastOp (FLOAT32(input));\n\n 3.activation\n input(act.): input tensor;\n\n 4.attributes\n extra_input: whether additional input is required for the casting operation.;\n ginfo: contains layer grouping information.;\n with_scale: whether the casting operation should include a scaling factor.;\n round_mode: the rounding mode to be used during the casting operation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "extra_input", "type": "OptionalAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "with_scale", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.EmbDenseBwd", "summary": "EmbDenseBwd operation for train", "description": "1.Op Introduction\n layer normalization\n\n 2.Math formula\n ```math\n output = grad_output[indices]\n ```\n\n 3.activation and weight\n grad_output(act.): the gradient of the loss with respect to the output.;\n indices(w.): the indices of the input tokens or items.;\n\n 4.attributes\n num_weights: the total number of embedding weights.;\n padding_idx: a index for padding.;\n scale_grad_by_freq: whether the gradient should be scaled by the inverse frequency of that token.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "grad_output", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "num_weights", "type": "SI32Attr" }, { "name": "padding_idx", "type": "SI32Attr" }, { "name": "scale_grad_by_freq", "type": "BoolAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.FAttention", "summary": "Flash Attention operator", "description": "1.Op Introduction\n Performs a two dimensional matrix multiplication. This allows both inputs to\n be activations, rather than reserving weights as an attribute in the\n FULLY_CONNECTED operator.\n\n 2.Math formula\n ```math\n Attention(Q, K, V) = softmax(((Q x K^T) / \\sqrt{d_k}) + musk) x V;\n head_i = Attention(Q x queries_weight, K x keys_weight, V x values_weight);\n MultiHead(Q, K, V) = Concat(head_1, head_2, ..., head_h) x out_weight + out_bias;\n output = MultiHead(input x queries_weight + queries_bias, input x keys_weight + keys_bias, input x values_weight + values_bias).\n ```\n\n 3.activation and weight\n queries(act.): input tensor.;\n keys(act.): The keys are derived from the input data and help the model determine which parts of the input are relevant for each query.;\n values(act.): The values are the actual information that will be aggregated based on the attention scores computed from the queries and keys.;\n mask(w.): apply masking during the attention computation, Masks can prevent the model from attending to certain positions in the input.;;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n scale: scalar.;\n batch: batch size.;\n q_head: the number of query heads in the multi-head attention mechanism.;\n kv_head: the number of key/value heads.;\n dim: the size of the input features or the size of the query, key, and value vectors.;\n mq: a dimension or a modifier related to the query matrix.;\n mk: the key matrix.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "queries", "type": "AnyTensor" }, { "name": "keys", "type": "AnyTensor" }, { "name": "values", "type": "AnyTensor" }, { "name": "mask", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "scale", "type": "F64Attr" }, { "name": "batch", "type": "I64Attr" }, { "name": "q_head", "type": "I64Attr" }, { "name": "kv_head", "type": "I64Attr" }, { "name": "dim", "type": "I64Attr" }, { "name": "mq", "type": "I64Attr" }, { "name": "mk", "type": "I64Attr" }, { "name": "keep_dims", "type": "DefaultValuedAttr" }, { "name": "mask_size", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Fp8MatMul", "summary": "fp8 matmul operator", "description": "1.Op Introduction\n The special matrix multiplication designed for fp8.\n Weight is saved in fp8.\n\n 2.Math formula\n ```math\n y_f16 = (x_fp8 x weight_fp8) * (scale_f16 * x_scale_f16)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n weight(w.): weight tensor.;\n weight_scale(w.): weight scale tensor.;\n bias(w.): an optional tensor can be added to the result of the matrix multiplication. ;\n\n 4.attributes\n weight_transpose: whether the weight tensor should be transposed;\n block_size: the block size for fp8 quantization.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "weight_scale", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "weight_transpose", "type": "DefaultValuedAttr" }, { "name": "block_size", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.FusedActiveCast", "summary": "Active + Cast", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "Tpu_ActiveModeAttr{TANH|SIGMOID|RELU|EXP|ELU|SQRT|SQUARE|RSQRT|ABSVAL|LN|ROUND|CEIL|FLOOR|SIN|COS|IS_FINITE|MISH|SWISH|HSWISH|SILU|ARCSIN|ARCCOS|ARCSINH|ARCCOSH|ARCTANH|SINH|COSH|TAN|SIGN|GELU|ERF|HSIGMOID|LOG_SIGMOID|SOFT_PLUS|SOFT_SIGN|LOG2|TGELU|QGELU}" }, { "name": "coeffs", "type": "OptionalAttr>" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Gather", "summary": "Gather operator", "description": "1.Op Introduction\n Perform Gather operation on the given axis.\n\n 2.Math formula\n ```math\n output = input[indices]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n indices(w.): the indices of the elements to be gathered from the input tensor.;\n buffer(w.): temporary storage of intermediate results or states during the computation.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n if_neg_index: how negative indices should be handled.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "if_neg_index", "type": "DefaultValuedAttr" }, { "name": "is_lora", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.GatherElements", "summary": "GatherElements operator", "description": "1.Op Introduction\n Perform GatherElements operation on the given axis.\n\n 2.Math formula\n ```math\n output[i_1, i_2, i_3,...i_k] = input[i_1, i_2, i_3,..., indices[i_k]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n indices(w.): the indices of the elements to be gathered from the input tensor.;\n indices_coeff(w.): a scaling or modifying factor for the indices.;\n buffer(w.): temporary storage of intermediate results or states during the computation.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" }, { "name": "indices_coeff", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.GatherND", "summary": "GatherND operator", "description": "1.Op Introduction\n This operator is the inverse of ScatterND.\n\n 2.Math formula\n ```math\n output_i = input[indices_i]\n ```\n\n 3.activation and weight\n input_data(act.): input tensor.;\n indices(w.): which elements to gather from the input tensor.;\n\n 4.attributes\n indice_dims: the number of dimensions in the indices tensor.;\n batch_dims: the number of batch dimensions in the input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input_data", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "indice_dims", "type": "OptionalAttr" }, { "name": "batch_dims", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.GenericCpu", "summary": "generic cpu operator", "description": "1.Op Introduction\n Generic Cpu Op.\n\n 2.Math formula\n output = GenericCpu(inputs, param)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n cpu_op_name: the name of the CPU-specific operator to be executed.;\n param: a set of parameters.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "cpu_op_name", "type": "StrAttr" }, { "name": "param", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.GridSampleInDeformableAttn", "summary": "GridSampleInDeformableAttn operation", "description": "1.Op Introduction\n Given an input and a flow-field grid, computes the output\n using input values and pixel locations from grid.\n\n 2.Math formula\n ```math\n output[N, C, H', W'] = input[C, grid[N, H', W', 1], grid[N, H', W', 0]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grid(w.): The flow-field grid tensor that defines the pixel locations for sampling.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n padding_mode: padding mode for outside grid values, Int attribute [0, 1, 2],\n representing 'zero' | 'boundary' | 'reflection't.;\n align_corners: whether to align the corners of the input and output tensors.;\n scale: scalar.;\n mean: mean values to subtract from each channel for normalization.;\n need_permute: whether permutation of the output tensor is required;", "operands": [ { "name": "input_global_addr", "type": "Variadic" }, { "name": "grid_global_addr", "type": "Variadic" }, { "name": "attn_global_addr", "type": "Variadic" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output_global_addr", "type": "AnyTensor" } ], "attributes": [ { "name": "num_grid_samples", "type": "I64Attr" }, { "name": "input_dims", "type": "I64Attr" }, { "name": "input_n", "type": "TypedArrayAttrBase" }, { "name": "input_c", "type": "TypedArrayAttrBase" }, { "name": "input_d", "type": "TypedArrayAttrBase" }, { "name": "input_h", "type": "TypedArrayAttrBase" }, { "name": "input_w", "type": "TypedArrayAttrBase" }, { "name": "grid_dout", "type": "I64Attr" }, { "name": "grid_hout", "type": "I64Attr" }, { "name": "grid_wout", "type": "I64Attr" }, { "name": "interp_mode", "type": "I64Attr" }, { "name": "padding_mode", "type": "I64Attr" }, { "name": "align_corners", "type": "BoolAttr" } ] }, { "name": "tpu.GridSampler", "summary": "GridSampler operation", "description": "1.Op Introduction\n Given an input and a flow-field grid, computes the output\n using input values and pixel locations from grid.\n\n 2.Math formula\n ```math\n output[N, C, H', W'] = input[C, grid[N, H', W', 1], grid[N, H', W', 0]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grid(w.): The flow-field grid tensor that defines the pixel locations for sampling.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n padding_mode: padding mode for outside grid values, Int attribute [0, 1, 2],\n representing 'zero' | 'boundary' | 'reflection't.;\n align_corners: whether to align the corners of the input and output tensors.;\n scale: scalar.;\n mean: mean values to subtract from each channel for normalization.;\n need_permute: whether permutation of the output tensor is required;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "grid", "type": "AnyTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "mode", "type": "I64Attr" }, { "name": "padding_mode", "type": "I64Attr" }, { "name": "align_corners", "type": "BoolAttr" }, { "name": "mean", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "need_permute", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Group", "summary": "Group operation", "description": "1.Op Introduction\n Make ops in one group to inferece by local mem\n\n 2.Math formula\n output = Group(nsecs, hsecs, dsecs, wsecs, csecs; swpipl_stage_num, group_type, flow, self_up_overlap_op, self_down_overlap_op, other_up_overlap_op, other_down_overlap_op, support_compress, run_core_id, core_slice_ncdhw)\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n nsecs: the number of sections in the \"n\" (batch or number) dimension.;\n hsecs: the number of sections in the \"h\" (height) dimension.;\n dsecs: the number of sections in the \"d\" (depth) dimension.;\n wsecs: the number of sections in the \"w\" (width) dimension.;\n csecs: the number of sections in the \"c\" (channel) dimension.;\n swpipl_stage_num: the number of stages in the pipeline, which related to swappable operations or pipelined processing.;\n group_type: the type of the grouping strategy.;\n flow: store both negative timestep indices and positive operation identifiers.;\n self_up_overlap_op: overlapped in the upward (or previous) direction within the same group.;\n self_down_overlap_op: overlapped in the downward (or subsequent) direction within the same group.;\n other_up_overlap_op: Holds the operation identifiers in other groups overlapping in the upward direction.;\n other_down_overlap_op: Holds the operation identifiers in other groups overlapping in the downward direction.;\n support_compress: whether compression is supported for the load operation.;\n run_core_id: an array of core IDs for running.;\n core_slice_ncdhw: the tensor's dimensions (n, c, d, h, w) are partitioned.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "nsecs", "type": "I64Attr" }, { "name": "hsecs", "type": "I64Attr" }, { "name": "dsecs", "type": "I64Attr" }, { "name": "wsecs", "type": "I64Attr" }, { "name": "csecs", "type": "I64Attr" }, { "name": "swpipl_stage_num", "type": "I64Attr" }, { "name": "group_type", "type": "I64Attr" }, { "name": "flow", "type": "DefaultValuedAttr, {0}>" }, { "name": "self_up_overlap_op", "type": "DefaultValuedAttr, {}>" }, { "name": "self_down_overlap_op", "type": "DefaultValuedAttr, {}>" }, { "name": "other_up_overlap_op", "type": "DefaultValuedAttr, {}>" }, { "name": "other_down_overlap_op", "type": "DefaultValuedAttr, {}>" }, { "name": "support_compress", "type": "DefaultValuedAttr" }, { "name": "run_core_id", "type": "DefaultValuedAttr, {}>" }, { "name": "core_slice_ncdhw", "type": "DefaultValuedAttr, {}>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tpu.GroupNorm", "summary": "GroupNorm operation", "description": "1.Op Introduction\n group normalization\n\n 2.Math formula\n ```math\n mean_g = 1 / ((C / num_groups) * H * W) \\sum{i=1, C/num_groups} \\sum{j=1, H} \\sum{k=1, W} input_{n,c,j,k}\n var_g = 1 / ((C / num_groups) * H * W) \\sum{i=1, C/num_groups} \\sum{j=1, H} \\sum{k=1, W} (input_{n,c,j,k} - mean_g) ^ 2\n output_{n,c,j,k} = weight * (input_{n,c,j,k} - mean_g) / sqrt(var_g + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n // cv18xx\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n mantissa_table(w.): stores a table of mantissa values used in calculations to improve precision or to handle specific numerical representations.;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n num_groups: the number of groups to divide the input channels into for normalization.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "mantissa_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_groups", "type": "I64Attr" }, { "name": "eps", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.GroupNormTrain", "summary": "GroupNorm operation", "description": "1.Op Introduction\n group normalization\n\n 2.Math formula\n ```math\n output = \\frac{input - mean}{\\sqrt{\\sigma^2 + eps}} \\cdot weight + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n num_groups: number of groups to divide the channels into for normalization.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "rstd", "type": "AnyTensor" } ], "attributes": [ { "name": "num_groups", "type": "I64Attr" }, { "name": "eps", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.GroupParallel", "summary": "Mutiple regions run in parallel.", "description": "1.Op Introduction\n This operation is composed of numerous regions, with each region corresponding\n to a subgraph. These subgraphs share identical computational patterns and are\n distributed across various cores of a multi-core TPU for processing.\n\n 2.Math formula\n output = GroupParallel(input)\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "regions": [ { "name": "parallel", "type": "VariadicRegion>" } ] }, { "name": "tpu.GRU", "summary": "GRU operator", "description": "1.Op Introduction\n Perform RNN GRU operation.\n\n 2.Math formula\n ```math\n update gate(z_t):\n z_t = Sigma(W_z · x_t + U_z ·h_(t-1) + b_z)\n reset gate(r_t):\n r_t = Sigma(W_r · x_t + U_r ·h_(t-1) + b_r)\n Candidate Activation(h_t):\n h_t = tanh(W_h · x_t + r_t \\odot (U_h · h_(t-1)) + b_h)\n final output:\n output = (1 - z_t) \\odot h_(t-1) + z_t \\odot h_t\n ```\n where, x_t is the input at time step (t), h_(t-1) is the hidden state from the previous time step.\n W_z, W_r, W_h are the weight matrices for the input.\n U_z, U_r, U_h are the weight matrices for the hidden state.\n b_z, b_r, b_h are the bias vectors.\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n recurrence(w.): the previous hidden state influences the current hidden state.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n initial_h(w.): the initial hidden state, which can be provided to start the GRU computation.;\n buffer(w.): temporary storage of intermediate results or states during the GRU computation.;\n sigmoid_table: a lookup table that contains pre-computed values for the sigmoid activation function.;\n sigmoid_slope_table: This table contains pre-computed slopes (derivatives) of the sigmoid function, enhancing the training efficiency of the LSTM.;\n tanh_table: contains pre-computed values for the hyperbolic tangent (tanh) activation function.;\n tanh_slope_table: This table contains pre-computed slopes (derivatives) of the tanh function;\n\n 4.attributes\n hidden_size: the number of units in the GRU cell,;\n bidirectional: whether the GRU should be bidirectional;\n linear_before_reset: whether to apply a linear transformation to the input before applying the reset gate.;\n batch_first: the input and output tensors are provided in the shape (batch_size, seq_length, input_size).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "filter", "type": "AnyTensorOrNone" }, { "name": "recurrence", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "initial_h", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" }, { "name": "sigmoid_table", "type": "AnyTensorOrNone" }, { "name": "sigmoid_slope_table", "type": "AnyTensorOrNone" }, { "name": "tanh_table", "type": "AnyTensorOrNone" }, { "name": "tanh_slope_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "Y", "type": "AnyTensorOrNone" }, { "name": "Y_h", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "hidden_size", "type": "I64Attr" }, { "name": "bidirectional", "type": "BoolAttr" }, { "name": "linear_before_reset", "type": "DefaultValuedAttr" }, { "name": "batch_first", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Host2Device", "summary": "Host2Device Operation", "description": "1.Op Introduction\n takes data from host mem to device mem\n\n 2.Math formula\n ```math\n output = Host2Device(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.Identity", "summary": "identity operator", "description": "1.Op Introduction\n identity operator.\n\n 2.Math formula\n ```math\n output = Identity(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Variadic" } ] }, { "name": "tpu.If", "summary": "if operation", "description": "1.Op Introduction\n If conditional\n\n 2.Math formula\n ```math\n output = then_branch if cond is true\n else_branch if cond is false\n ```\n\n 3.activation and weight\n cond(act.): which branch of execution to follow.;", "operands": [ { "name": "cond", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "Variadic" } ], "regions": [ { "name": "then_branch", "type": "SizedRegion<1>" }, { "name": "else_branch", "type": "SizedRegion<1>" } ] }, { "name": "tpu.IndexPut", "summary": "IndexPut operation", "description": "1.Op Introduction\n aten::index_put_\n update specific elements of an input tensor at given indices with new values.\n\n 2.Math formula\n ```math\n if accumulate\n input[indices] += values\n else\n input[indices] = values\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n indices(w.): the indices of the elements in the input tensor that should be updated.;\n values(w.): the new values that will replace the existing values in the input tensor at the specified indices.;\n //for accumulate is True\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n accumulate: whether the operation should accumulate values at the specified indices or replace them.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "values", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "accumulate", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Insert", "summary": "Insert operator.", "description": "1.Op Introduction\n insert the rhs tensor into input tensor at the specified axis and position.\n\n 2.Math formula\n ```math\n output = Insert(input, rhs, axis, offset)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n rhs(w.): the tensor to be inserted;\n axis: the axis along which to insert the rhs tensor.\n offset: the position at which the rhs tensor is inserted.", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "rhs", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "offset", "type": "I64Attr" } ] }, { "name": "tpu.InstanceNorm", "summary": "InstanceNorm operation", "description": "1.Op Introduction\n instance normalization.\n\n 2.Math formula\n ```math\n output[i] = weight * (input[i] - mean) / sprt(var + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n // cv18xx\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n mantissa_table(w.): stores a table of mantissa values used in calculations to improve precision or to handle specific numerical representations.;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "mantissa_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Interp", "summary": "Interp operation", "description": "1.Op Introduction\n Perform Interp on input.\n\n 2.Math formula\n ```math\n H' = H x scale_h\n W' = W x scale_w\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n shapeT(act.): an optional input tensor that specifies the desired shape for the output tensor.;\n buffer(w.): temporary storage of intermediate results or states during the computation.;\n\n 4.attributes\n scale_h: the scaling factor for the height (number of rows) of the input tensor.;\n scale_w: the scaling factor for the width (number of columns) of the input tensor.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n coord_mode: whether the coordinates are normalized (ranging from 0 to 1) or absolute (based on pixel indices).;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "shapeT", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale_h", "type": "F64Attr" }, { "name": "scale_w", "type": "F64Attr" }, { "name": "mode", "type": "Tpu_ResizeModeAttr{nearest|linear}" }, { "name": "coord_mode", "type": "Tpu_ResizeCoordModeAttr{align_corners|half_pixel|pytorch_half_pixel|asymmetric}" }, { "name": "ppl_flag", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Join", "summary": "Join tensor to continues pieces", "description": "1.Op Introduction\r\n The ops in one parallel should run in parallel.\r\n\r\n 2.Math formula\r\n output = concat(input)\r\n\r\n 3.activation and weight\r\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ] }, { "name": "tpu.LayerNorm", "summary": "LayerNorm operation", "description": "1.Op Introduction\n layer normalization\n\n 2.Math formula\n ```math\n 1.Normalization\n mean = 1 / H \\sum{j=1, H} input[j]\n var = 1 / H \\sum{j=1, H} (input[j] - mean) ^ 2\n 2.Layer Normalized Output\n output[i] = weight * (input[i] - mean) / sprt(var + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n // cv18xx\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n mantissa_table(w.): stores a table of mantissa values used in calculations to improve precision or to handle specific numerical representations.;\n\n 4.attributes\n normalized_shape: the shape of the input tensor that will be normalized.;\n axis: the dimension of the input tensor.;\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "mantissa_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "normalized_shape", "type": "TypedArrayAttrBase" }, { "name": "axis", "type": "SI32Attr" }, { "name": "eps", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.LayerNormBwd", "summary": "LayerNorm operation for train", "description": "1.Op Introduction\n layer normalization\n\n 2.Math formula\n ```math\n 1.gradient input\n grad_input = 1 / N(weight / sqrt(variance + eps) 1 / N \\sum{i=1, N}grad_out)\n - (input - mean) / N * \\sum(i=1, N)weight * grad_out / sqrt(variance + eps)\n 2.gradient weight\n grad_weight = \\sum(i=1, N)grad_out * (input - mean) / sqrt(variance + eps)\n 3.gradient bias\n grad_bias = \\sum(i=1, N)grad_out\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n grad_out(w.): the gradient of the loss with respect to the output of the layer normalization.;\n mean(w.): mean values to subtract from each channel for normalization.;\n variance(w.): adjust the predicted boxes during the training process.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n normalized_shape: the shape of the input tensor dimensions.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "grad_out", "type": "AnyTensor" }, { "name": "input", "type": "AnyTensor" }, { "name": "mean", "type": "AnyTensor" }, { "name": "variance", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "grad_input", "type": "AnyTensorOrNone" }, { "name": "grad_weight", "type": "AnyTensorOrNone" }, { "name": "grad_bias", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "normalized_shape", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.LayerNormCast", "summary": "LayerNorm + Requant", "description": "LayerNorm + Requant", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "eps", "type": "F64Attr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "isCastAtEnd", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.LayerNormTrain", "summary": "LayerNorm operation for train", "description": "1.Op Introduction\n layer normalization in train.\n\n 2.Math formula\n ```math\n 1.Normalization\n mean = 1 / H \\sum{j=1, H} input[j]\n var = 1 / H \\sum{j=1, H} (input[j] - mean) ^ 2\n 2.Layer Normalized Output\n output[i] = weight * (input[i] - mean) / sprt(var + eps) + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n normalized_shape: the shape of the input tensor dimensions.;\n axis: the dimension of the input tensor.;\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" }, { "name": "mean", "type": "AnyRankedTensor" }, { "name": "variance", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "normalized_shape", "type": "TypedArrayAttrBase" }, { "name": "axis", "type": "SI32Attr" }, { "name": "eps", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.LeakyRelu", "summary": "leakyrelu operation", "description": "1.Op Introduction\n The LeakyRelu operation multiples alpha with negative values, and the others keep changeless.\n\n 2.Math formula\n ```math\n output = alpha * input, if input < 0\n output = input, if input >= 0\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n alpha: a scalar factor.;\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n multiplier_neg: specify the multiplier for negative input values.;\n rshift: the number of bits to right-shift the quantized values.;\n rshift_neg: specifies the number of bits to right-shift the quantized negative values.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "alpha", "type": "OptionalAttr" }, { "name": "multiplier", "type": "OptionalAttr" }, { "name": "multiplier_neg", "type": "OptionalAttr" }, { "name": "rshift", "type": "OptionalAttr" }, { "name": "rshift_neg", "type": "OptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Load", "summary": "Load operation", "description": "1.Op Introduction\n load input or weight from gmem to lmem;\n if do_bcast, [1,1,1,w] will load to [1,npu,1,w]\n\n 2.Math formula\n output = Load(input, do_bcast, use_3ic_optimize, lmem_type, support_compress);\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_bcast: whether broadcasting.;\n use_3ic_optimize: whether the 3-IC (Three Input Channels) optimization;\n lmem_type: the type of local memory (lmem) to be used when loading data from global memory (gmem).;\n ginfo: associated with layer grouping information.;\n support_compress: whether compression is supported for the load operation.;\n compress_info: used in conjunction with support_compress to specify details like compression schemes, ratios, or any relevant metadata.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_bcast", "type": "DefaultValuedAttr" }, { "name": "use_3ic_optimize", "type": "DefaultValuedAttr" }, { "name": "lmem_type", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "support_compress", "type": "DefaultValuedAttr" }, { "name": "is_idx_weight", "type": "DefaultValuedAttr" }, { "name": "compress_info", "type": "OptionalAttr" }, { "name": "indexing_map_s2l", "type": "OptionalAttr" } ] }, { "name": "tpu.LoadToL2M", "summary": "Load operation", "description": "1.Op Introduction\n load weight from gmem to l2mem;\n\n 2.Math formula\n output = Load(input, id, l2m_addr);\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n id: differentiate or index various instances of the load operation, ensuring correctly matched.;\n l2m_addr: the address or offset within the local L2 memory (l2mem).;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "id", "type": "I64Attr" } ] }, { "name": "tpu.LogicalAnd", "summary": "logical and operation", "description": "1.Op Introduction\n logical and operation between two variables\n\n 2.Math formula\n ```math\n output = input1 and input2\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.Loop", "summary": "Loop operation", "description": "1.Op Introduction\n Generic Looping construct, support while/do_while/for/forerver etc:\n\n 2.Math formula\n none\n\n 3.activation and weight\n AnyTensor;", "operands": [ { "name": "M", "type": "AnyTypeOf<[AnyTensor, NoneType]>" }, { "name": "cond", "type": "AnyTypeOf<[AnyTensor, NoneType]>" }, { "name": "v_initial", "type": "Variadic>" } ], "results": [ { "name": "v_final_and_scan_outputs", "type": "Variadic>" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ] }, { "name": "tpu.LRN", "summary": "Local Response Normalization", "description": "1.Op Introduction\n It normalizes over local input regions. The local region is defined across the channels.\n 2.Math formula\n ```math\n output[i, j, k] = \\frac{input[i, j, k]}{(bias + \\alpha \\sum_{c=\\max(0,k-\\text{size})}^{\\min(N-1,k+\\text{size})} input[i, j, c]^2)^{\\beta}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n mantissa(w.): store the mantissa values, which can be part of the normalization process.;\n\n 4.attributes\n size: how many neighboring channels are considered during the normalization process.;\n alpha: a scaling factor;\n beta: a scaling factor;\n bias: A floating-point value added to the normalization denominator to prevent division by zero.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "mantissa", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "size", "type": "I64Attr" }, { "name": "alpha", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "bias", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.LSTM", "summary": "LSTM operator", "description": "1.Op Introduction\n Perform RNN LSTM operation.\n\n 2.Math formula\n ```math\n forget gate(f_t):\n f_t = Sigma(W_f · x_t + U_f · h_(t-1) + b_f)\n input gate(i_t):\n i_t = Sigma(W_i · x_t + U_i · h_(t-1) + b_i)\n Candidate cell state(C_t):\n C_t = tanh(W_C · x_t + U_C · h_(t-1) + b_C)\n cell state update(c_t):\n c_t = f_t \\odot c_(t-1) + i_t \\odot C_t\n output gate(o_t):\n o_t = Sigma(W_o · x_t + U_o · h_(t-1) + b_o)\n hidden state output(h_t):\n h_t = o_t \\odot tanh(c_t)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n filter(w.): the learnable weights of the convolution 2d operation.;\n recurrence(w.): the previous hidden state influences the current hidden state.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n initial_h(w.): the initial hidden state, which can be provided to start the LSTM computation.;\n initial_c(w.): the initial cell state, which can be provided to start the LSTM computation.;\n cont(w.): control weights or additional context that may be provided to influence the LSTM's behavior.;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n sigmoid_table: a lookup table that contains pre-computed values for the sigmoid activation function.;\n sigmoid_slope_table: This table contains pre-computed slopes (derivatives) of the sigmoid function, enhancing the training efficiency of the LSTM.;\n tanh_table: contains pre-computed values for the hyperbolic tangent (tanh) activation function.;\n tanh_slope_table: This table contains pre-computed slopes (derivatives) of the tanh function;\n\n 4.attributes\n hidden_size: the number of units in the LSTM cell, ;\n bidirectional: A boolean indicating whether the LSTM should be bidirectional;\n batch_first: the input and output tensors are provided in the shape (batch_size, seq_length, input_size).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "filter", "type": "AnyTensorOrNone" }, { "name": "recurrence", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "initial_h", "type": "AnyTensorOrNone" }, { "name": "initial_c", "type": "AnyTensorOrNone" }, { "name": "cont", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" }, { "name": "sigmoid_table", "type": "AnyTensorOrNone" }, { "name": "sigmoid_slope_table", "type": "AnyTensorOrNone" }, { "name": "tanh_table", "type": "AnyTensorOrNone" }, { "name": "tanh_slope_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "Y", "type": "AnyTensorOrNone" }, { "name": "Y_h", "type": "AnyTensorOrNone" }, { "name": "Y_c", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "hidden_size", "type": "I64Attr" }, { "name": "bidirectional", "type": "BoolAttr" }, { "name": "batch_first", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Lut", "summary": "Lut operator", "description": "1.Op Introduction\n lookup table in index [0-255], y[i] = table(x[i])\n\n 2.Math formula\n ```math\n output[i] = table(input[i])\n ```\n 3.activation and weight\n input(act.): input tensor;\n table(w.): map input values to corresponding output values.;\n\n 4.attributes\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" }, { "name": "indexing_map_s2l", "type": "OptionalAttr" }, { "name": "indexing_map_l2s", "type": "OptionalAttr" } ] }, { "name": "tpu.LutBF16", "summary": "LutBF16 operator", "description": "1.Op Introduction\n input and output is BF16, input BF16 split as exponent and mantissa,\n get output by exponent table and mantissa table\n BF16 mode, lookup table in index [0-255], y[i] = table(x[i]).\n\n 2.Math formula\n ```math\n output[i] = table(input[i])\n ```\n 3.activation and weight\n input(act.): input tensor;\n table(w.): map input values to corresponding output values.;\n mantissa(w.): the mantissa component of the lookup table weights.;\n\n 4.attributes\n max_range: the maximum value in the range of valid input values.;\n min_range: the minimum value in the range of valid input values.;\n lut_mode: the mode of operation for the lookup table.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyRankedTensor" }, { "name": "mantissa", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "max_range", "type": "DefaultValuedAttr" }, { "name": "min_range", "type": "DefaultValuedAttr" }, { "name": "lut_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MaskedFill", "summary": "MaskedFill operator", "description": "1.Op Introduction\n Return elements, either from X or Const, depending on condition.\n\n 2.Math formula\n ```math\n brn if inversed and cond=0\n output = brn + const_val if inversed and cond!=0\n brn + const_val if !inversed and cond!=0\n brn if !inversed and cond=0\n ```\n If inversed is true, the operation fills the elements of brn where cond is zero with const_val, while leaving other elements unchanged.\n If inversed is false, the operation fills the elements of brn where cond is non-zero with const_val, while leaving other elements unchanged.\n\n 3.activation and weight\n cond(act.): a tensor that serves as the condition for selecting elements from the true branch (tbrn) or the false branch (fbrn).;\n brn(w.): the input tensor from which elements will be selected based on the condition provided by the cond tensor.;\n\n 4.attributes\n inversed: whether the mask should be inverted.;\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "cond", "type": "AnyRankedTensor" }, { "name": "brn", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "inversed", "type": "BoolAttr" }, { "name": "const_val", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MaskRCNN_BboxPooler", "summary": "Bbox_Pooler gen by PPL", "description": "1.Op Introduction\n MaskRCNN_BBox_Pooler, the 1st ROIAlign in MaskRCNN.\n\n 2.Math formula\n ```math\n output = ROIAlign(feature map, rois_multi_batch)\n ```\n\n 3.activation and weight\n ptr_feat0(act.): Pointer to the feature map at level 0.;\n ptr_feat1(act.): Pointer to the feature map at level 1.;\n ptr_feat2(act.): Pointer to the feature map at level 2.;\n ptr_feat3(act.): Pointer to the feature map at level 3.;\n rois_multi_batch(w.): ROIs (Regions of Interest) for multiple batches.;\n\n 4.attributes\n ROI_NUM_LEVELS: The number of levels in the ROI feature pyramid.;\n ROI_H: The height of the pooled ROI features.;\n ROI_W: The width of the pooled ROI features.;\n CHANNEL_ROI: The number of channels in the pooled ROI features.;\n ROI_SLICE: The number of slices or segments;\n ROI_PH: The height of the ROI in the feature map.;\n ROI_PW: The width of the ROI in the feature map.;\n ROI_LEN: The length of the ROIs being processed.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "ptr_feat0", "type": "AnyTensor" }, { "name": "ptr_feat1", "type": "AnyTensor" }, { "name": "ptr_feat2", "type": "AnyTensor" }, { "name": "ptr_feat3", "type": "AnyTensor" }, { "name": "rois_multi_batch", "type": "AnyTensor" }, { "name": "ptr_tmp_res", "type": "AnyTensorOrNone" }, { "name": "ptr_rois_tmp", "type": "AnyTensorOrNone" } ], "results": [ { "name": "result_res", "type": "AnyTensor" }, { "name": "result_rois", "type": "AnyTensor" } ], "attributes": [ { "name": "ROI_NUM_LEVELS", "type": "I64Attr" }, { "name": "ROI_H", "type": "I64Attr" }, { "name": "ROI_W", "type": "I64Attr" }, { "name": "CHANNEL_ROI", "type": "I64Attr" }, { "name": "ROI_SLICE", "type": "I64Attr" }, { "name": "ROI_PH", "type": "I64Attr" }, { "name": "ROI_PW", "type": "I64Attr" }, { "name": "ROI_LEN", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MaskRCNN_GetBboxB", "summary": "GetBboxB operator", "description": "1.Op Introduction\n MaskRCNN_GetBboxB, the 2nd onnx_nms in MaskRCNN\n\n 2.Math formula\n ```math\n decode_bbox_i = bbox_means + scale_factor x (ptr_bbox[i] x bbox_stds + [res_bbox0[i] res_bbox1[i] res_bbox[i]])\n score_i = ptr_score[i] (or a combination of res_score0,res_score1,res_score2,res_score3)\n {bboxs, lables} = NMS({decode_bbox_i}, {score_i}, nms_iou_thr)\n ```\n\n 3.activation and weight\n ptr_rois(act.): candidate regions of interest for possible objects.;\n ptr_bbox(act.): the bounding box predictions.;\n ptr_score(act.): confidence scores associated with each proposal.;\n max_val(w.): max scores the bbox predictions.;\n scale_factor(w.): scale the decoded bounding box coordinates.;\n stds(w.): standard deviation values for each channel.;\n means(w.): mean values to subtract from each channel for normalization.;\n res_bbox(w.): bounding box prediction values.;\n res_bbox1(w.): one branch of the processed bounding box predictions.;\n res_bbox0(w.): another branch or variant of the bounding box decoding results.;\n res_score0(w.): one set of confidence scores associated with the proposals.;\n res_score1(w.): an additional set of confidence scores.;\n res_score2(w.): another set of scoring values.;\n res_score3(w.): final selection of bounding boxes.;\n res_label2(w.): the predicted class labels.;\n result_list(w.): the final list of processed results or proposal indices after filtering and ranking.;\n keep_3nch(w.): whether retains proposals having three-channel inputs.;\n keep_u32_1h(w.): whether using a single 32-bit unsigned integer per element.;\n glb_buffer_boxes(w.): A global temporary buffer used to store bounding box.;\n glb_buffer_scores(w.): A global temporary buffer for storing scores associated with the candidate bounding boxes.;\n glb_buffer_nms(w.): This global buffer holds intermediate NMS-related information.;\n glb_buffer_nonzero(w.): stores the non-zero elements (or valid indices) from processed tensors.;\n result_valid_ind(w.): the indices of proposals.;\n glb_lables(w.): A global buffer dedicated to storing the class labels.;\n glb_lables_expand(w.): an expanded version of the global labels.;\n\n 4.attributes\n threshold_score_eq: A threshold value used to filter out proposals with a low confidence score before applying NMS.;\n wh_ratio_log: A logarithmic scaling factor, adjust the width-to-height ratio during decoding of bounding boxes.;\n nms_iou_thr: IoU (Intersection over Union) threshold.;\n delta2bbox_means: Mean values used to decode the bounding box regression.;\n delta2bbox_stds_0: Standard deviation (first component) for scaling the decoded bbox values.;\n delta2bbox_stds_1: Standard deviation (second component) for scaling the decoded bbox values.;\n NUM_INDEXES: the number of indexes (or anchors).;\n NUM_CLASSES: The total number of object classes.;\n TOPK_ONNX_NMS: to select a fixed number of candidates.;\n NUM_CLASSES_getBboxB: Number of classes used in this bounding box decoding step.;\n MAX_NMS_LENGTH_GetBboxB: Maximum number of bounding box candidates.;\n MAX_PER_IMG: The maximum number of detections allowed per image.;\n MAX_PER_IMG_GetBboxB: maximum number of bounding boxes after the final processing.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "ptr_rois", "type": "AnyTensor" }, { "name": "ptr_bbox", "type": "AnyTensor" }, { "name": "ptr_score", "type": "AnyTensor" }, { "name": "max_val", "type": "AnyTensor" }, { "name": "scale_factor", "type": "AnyTensor" }, { "name": "means", "type": "AnyTensorOrNone" }, { "name": "stds", "type": "AnyTensorOrNone" }, { "name": "res_bbox", "type": "AnyTensorOrNone" }, { "name": "res_bbox1", "type": "AnyTensorOrNone" }, { "name": "res_bbox0", "type": "AnyTensorOrNone" }, { "name": "res_score0", "type": "AnyTensorOrNone" }, { "name": "res_score1", "type": "AnyTensorOrNone" }, { "name": "res_score2", "type": "AnyTensorOrNone" }, { "name": "res_score3", "type": "AnyTensorOrNone" }, { "name": "res_label2", "type": "AnyTensorOrNone" }, { "name": "result_list", "type": "AnyTensorOrNone" }, { "name": "keep_3nch", "type": "AnyTensorOrNone" }, { "name": "keep_u32_1h", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_boxes", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_scores", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_nms", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_nonzero", "type": "AnyTensorOrNone" }, { "name": "result_valid_ind", "type": "AnyTensorOrNone" }, { "name": "glb_lables", "type": "AnyTensorOrNone" }, { "name": "glb_lables_expand", "type": "AnyTensorOrNone" } ], "results": [ { "name": "result_det_bboxes", "type": "AnyTensor" }, { "name": "result_det_labels", "type": "AnyTensor" } ], "attributes": [ { "name": "threshold_score_eq", "type": "F64Attr" }, { "name": "wh_ratio_log", "type": "F64Attr" }, { "name": "nms_iou_thr", "type": "F64Attr" }, { "name": "delta2bbox_means", "type": "F64Attr" }, { "name": "delta2bbox_stds_0", "type": "F64Attr" }, { "name": "delta2bbox_stds_1", "type": "F64Attr" }, { "name": "NUM_INDEXES", "type": "I64Attr" }, { "name": "NUM_CLASSES", "type": "I64Attr" }, { "name": "TOPK_ONNX_NMS", "type": "I64Attr" }, { "name": "NUM_CLASSES_getBboxB", "type": "I64Attr" }, { "name": "MAX_NMS_LENGTH_GetBboxB", "type": "I64Attr" }, { "name": "MAX_PER_IMG", "type": "I64Attr" }, { "name": "MAX_PER_IMG_GetBboxB", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MaskRCNN_MaskPooler", "summary": "Mask_Pooler gen by PPL", "description": "1.Op Introduction\n MaskRCNN_Mask_Pooler, the 2st ROIAlign in MaskRCNN\n\n 2.Math formula\n ```math\n output = \\text{ROIAlign}\\Bigl( \\{x_i\\}_{i=0}^3, \\, \\text{det\\_bboxes\\_multi\\_batch}, \\, \\text{det\\_labels\\_multi\\_batch}, \\, \\text{scale\\_factor}, \\, ROI\\_NUM\\_LEVELS, \\, ROI\\_H, \\, ROI\\_W, \\, CHANNEL\\_ROI, \\, ROI\\_SLICE, \\, ROI\\_PH, \\, ROI\\_PW, \\, ROI\\_LEN \\Bigr)\n ```\n\n 3.activation and weight\n x_0(act.): first level of the feature pyramid.;\n x_1(act.): second level of the feature pyramid.;\n x_2(act.): third level of the feature pyramid.;\n x_3(act.): fourth level of the feature pyramid.;\n det_bboxes_multi_batch(act.): detected bounding boxes over multiple batches.;\n det_labels_multi_batch(act.): class labels associated with the detected bounding boxes across multiple batches.;\n scale_factor(w.): scale the decoded bounding box coordinates.;\n ptr_rois_buff(w.): a temporary buffer that holds precomputed or intermediate Regions of Interest (ROIs).;\n result_filled_det_bboxes(w.): stores the processed or “filled” detection bounding boxes.;\n result_filled_det_labels(w.): corresponding class labels that have been associated with the detected bounding boxes.;\n ptr_tmp_res(w.): temporary result buffer used internally during the pooling process.;\n ptr_rois_tmp(w.): a temporary workspace that stores intermediate ROI values.;\n\n 4.attributes\n ROI_NUM_LEVELS: the number of feature levels (or pyramid levels) available for ROI pooling.;\n ROI_H: target height of the pooled region for each ROI.;\n ROI_W: target width of the pooled region for each ROI.;\n CHANNEL_ROI: number of channels to be kept or considered when performing ROIAlign.;\n ROI_SLICE: slicing strategy for ROIs, if the ROI needs to be segmented into sub-regions for finer pooling.;\n ROI_PH: Padding height for the ROI.;\n ROI_PW: Padding width for the ROI.;\n ROI_LEN: total length (or area) of the ROI.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "x_0", "type": "AnyTensor" }, { "name": "x_1", "type": "AnyTensor" }, { "name": "x_2", "type": "AnyTensor" }, { "name": "x_3", "type": "AnyTensor" }, { "name": "det_bboxes_multi_batch", "type": "AnyTensor" }, { "name": "det_labels_multi_batch", "type": "AnyTensor" }, { "name": "scale_factor", "type": "AnyTensor" }, { "name": "ptr_rois_buff", "type": "AnyTensorOrNone" }, { "name": "result_filled_det_bboxes", "type": "AnyTensorOrNone" }, { "name": "result_filled_det_labels", "type": "AnyTensorOrNone" }, { "name": "ptr_tmp_res", "type": "AnyTensorOrNone" }, { "name": "ptr_rois_tmp", "type": "AnyTensorOrNone" } ], "results": [ { "name": "result_res", "type": "AnyTensor" } ], "attributes": [ { "name": "ROI_NUM_LEVELS", "type": "I64Attr" }, { "name": "ROI_H", "type": "I64Attr" }, { "name": "ROI_W", "type": "I64Attr" }, { "name": "CHANNEL_ROI", "type": "I64Attr" }, { "name": "ROI_SLICE", "type": "I64Attr" }, { "name": "ROI_PH", "type": "I64Attr" }, { "name": "ROI_PW", "type": "I64Attr" }, { "name": "ROI_LEN", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MaskRCNN_RPNGetBboxes", "summary": "RPN_get_bboxes gen by PPL", "description": "1.Op Introduction\n MaskRCNN_RPN_get_bboxes, the sub-block with 1st NMS between RPN_head and 1st ROIAlign.\n\n 2.Math formula\n ```math\n 1.Score Filtering\n valid_indices_i = cls_scores_i > conf_threshold (for each level i)\n 2.Bounding Box Adjustment\n adjusted_bboxes_i = anchors_i + bbox_preds_i * delta2bbox_std_i + delta2bbox_mean_i\n 3.IoU Calculation\n iou = calculate_iou(adjusted_bboxes_i, ground_truth_boxes)\n 4.NMS Application\n final_bboxes = nms(adjusted_bboxes_i[valid_indices_i], iou_threshold)\n 5.final output\n output = concatenate(final_bboxes)\n ```\n 3.activation and weight\n cls_scores_0: the class scores0 for each anchor;\n cls_scores_1(act.): the class scores1 for each anchor;\n cls_scores_2: the class scores2 for each anchor;\n cls_scores_3: the class scores3 for each anchor;\n cls_scores_4: the class scores4 for each anchor;\n bbox_preds_0: the bounding box0 predictions;\n bbox_preds_1: the bounding box1 predictions;\n bbox_preds_2: the bounding box2 predictions;\n bbox_preds_3: the bounding box3 predictions;\n bbox_preds_4: the bounding box4 predictions;\n max_shape: the maximum dimensions of the output bounding boxes.;\n mlvl_anchors_0: the multi-level anchors0 used for generating bounding box proposals.;\n mlvl_anchors_1: the multi-level anchors1 used for generating bounding box proposals.;\n mlvl_anchors_2: the multi-level anchors2 used for generating bounding box proposals.;\n mlvl_anchors_3: the multi-level anchors3 used for generating bounding box proposals.;\n mlvl_anchors_4: the multi-level anchors4 used for generating bounding box proposals.;\n batch_mlvl_scores: the class scores for all anchors across multiple feature levels in a batch.;\n batch_mlvl_anchors: the multi-level anchors generated for the entire batch.;\n batch_mlvl_rpn_bbox_pred: the bounding box predictions for each anchor across multiple levels in the batch.;\n batch_mlvl_proposals: the proposed bounding boxes generated for the entire batch after processing;\n batch_mlvl_ids: the ids associated with the proposals for each anchor across the batch.;\n glb_buffer_tmp_scores_stretched: the stretched class scores for processing before NMS.;\n glb_buffer_ranked_scores: The buffer stores the ranked class scores after sorting the top proposals.;\n glb_buffer_rank_inds_int32: the indices of the ranked scores in 32-bit integer format;\n glb_buffer_rank_inds_u32: stores the indices in 32-bit unsigned integer format.;\n glb_topk_inds: This buffer holds the indices of the top K proposals after the ranking process.;\n glb_buffer_gather_1: gathering specific data from the ranked scores or proposals.;\n glb_buffer_gather_2: Similar to glb_buffer_gather_1;\n glb_buffer_rpn_bbox_permuted: the permuted bounding box predictions.;\n glb_buffer_nonzero: non-zero entries from the scores or proposals.;\n result_valid_ind: the valid indices of the resulting proposals after processing.;\n glb_buffer_gather_boxes: gather the final bounding boxes from the proposals after NMS.;\n glb_buffer_gather_scores: holds the final scores associated with the gathered bounding boxes.;\n keep_3nch: maintain a specific format or structure for the gathered results(three-channel format).;\n keep_u32_1h: manage the format or structure of the output in a specific way.;\n glb_buffer_boxes: the final bounding boxes ready for output after all processing steps.;\n glb_buffer_scores: the final class scores corresponding to the output bounding boxes.;\n glb_buffer_nms: This buffer is used during the Non-Maximum Suppression process to manage overlapping proposals.;\n gather_mlvl_proposals: gather proposals from multiple levels for final processing.;\n gather_mlvl_scores: gather scores from multiple levels for the final proposal selection.;\n gather_mlvl_ids: gather ids from multiple levels to track proposals across the batch.;\n glb_buffer_result_list: the final list of results.;\n\n 4.attributes\n delta2bbox_mean_0: the means used to normalize the bounding box0 deltas for the corresponding feature levels.;\n delta2bbox_mean_1: the means used to normalize the bounding box1 deltas for the corresponding feature levels.;\n delta2bbox_mean_2: the means used to normalize the bounding box2 deltas for the corresponding feature levels.;\n delta2bbox_mean_3: the means used to normalize the bounding box3 deltas for the corresponding feature levels.;\n delta2bbox_std_0: the standard deviations used to normalize the bounding box0 deltas for the corresponding feature levels.;\n delta2bbox_std_1: the standard deviations used to normalize the bounding box1 deltas for the corresponding feature levels.;\n delta2bbox_std_2: the standard deviations used to normalize the bounding box2 deltas for the corresponding feature levels.;\n delta2bbox_std_3: the standard deviations used to normalize the bounding box3 deltas for the corresponding feature levels.;\n delta2bbox_max_scalar_c: a scalar value;\n iou_threshold: filtering out low-quality proposals during NMS.;\n conf_threshold: a confidence score threshold.;\n MAX_LENGTH_STATIC_STRECHED: the maximum length for the output list of bounding boxes after processing.;\n NUM_INDEXES: the number of indexes.;\n NUM_CLASSES: the number of classes.;\n CHANNEL_RPN_BBOXES: the number of channels for the bounding box predictions.;\n CHANNEL_RPN_SCORES: the number of channels used for the class score predictions.;\n NMS_PRE: the number of proposals to be considered before NMS.;\n HARDWARE_FACTOR_TOPK: how many top proposals to keep.;\n NMS_MAX_LENGTH: the maximum number of boxes after NMS.;\n TOPK_ONNX_NMS: the number of top proposals when using ONNX format for NMS.;\n H_RPN_DYN_MAX: the maximum height for the dynamic RPN output.;\n W_RPN_DYN_MAX: the maximum width for the dynamic RPN output.;\n MAX_PER_IMG: the maximum number of proposals to be generated per image.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "cls_scores_0", "type": "AnyTensor" }, { "name": "cls_scores_1", "type": "AnyTensor" }, { "name": "cls_scores_2", "type": "AnyTensor" }, { "name": "cls_scores_3", "type": "AnyTensor" }, { "name": "cls_scores_4", "type": "AnyTensor" }, { "name": "bbox_preds_0", "type": "AnyTensor" }, { "name": "bbox_preds_1", "type": "AnyTensor" }, { "name": "bbox_preds_2", "type": "AnyTensor" }, { "name": "bbox_preds_3", "type": "AnyTensor" }, { "name": "bbox_preds_4", "type": "AnyTensor" }, { "name": "max_shape", "type": "AnyTensor" }, { "name": "mlvl_anchors_0", "type": "AnyTensor" }, { "name": "mlvl_anchors_1", "type": "AnyTensor" }, { "name": "mlvl_anchors_2", "type": "AnyTensor" }, { "name": "mlvl_anchors_3", "type": "AnyTensor" }, { "name": "mlvl_anchors_4", "type": "AnyTensor" }, { "name": "batch_mlvl_scores", "type": "AnyTensorOrNone" }, { "name": "batch_mlvl_anchors", "type": "AnyTensorOrNone" }, { "name": "batch_mlvl_rpn_bbox_pred", "type": "AnyTensorOrNone" }, { "name": "batch_mlvl_proposals", "type": "AnyTensorOrNone" }, { "name": "batch_mlvl_ids", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_tmp_scores_stretched", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_ranked_scores", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_rank_inds_int32", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_rank_inds_u32", "type": "AnyTensorOrNone" }, { "name": "glb_topk_inds", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_gather_1", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_gather_2", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_rpn_bbox_permuted", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_nonzero", "type": "AnyTensorOrNone" }, { "name": "result_valid_ind", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_gather_boxes", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_gather_scores", "type": "AnyTensorOrNone" }, { "name": "keep_3nch", "type": "AnyTensorOrNone" }, { "name": "keep_u32_1h", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_boxes", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_scores", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_nms", "type": "AnyTensorOrNone" }, { "name": "gather_mlvl_proposals", "type": "AnyTensorOrNone" }, { "name": "gather_mlvl_scores", "type": "AnyTensorOrNone" }, { "name": "gather_mlvl_ids", "type": "AnyTensorOrNone" }, { "name": "glb_buffer_result_list", "type": "AnyTensorOrNone" } ], "results": [ { "name": "result_list", "type": "AnyTensor" } ], "attributes": [ { "name": "delta2bbox_mean_0", "type": "F64Attr" }, { "name": "delta2bbox_mean_1", "type": "F64Attr" }, { "name": "delta2bbox_mean_2", "type": "F64Attr" }, { "name": "delta2bbox_mean_3", "type": "F64Attr" }, { "name": "delta2bbox_std_0", "type": "F64Attr" }, { "name": "delta2bbox_std_1", "type": "F64Attr" }, { "name": "delta2bbox_std_2", "type": "F64Attr" }, { "name": "delta2bbox_std_3", "type": "F64Attr" }, { "name": "delta2bbox_max_scalar_c", "type": "F64Attr" }, { "name": "iou_threshold", "type": "F64Attr" }, { "name": "conf_threshold", "type": "F64Attr" }, { "name": "MAX_LENGTH_STATIC_STRECHED", "type": "I64Attr" }, { "name": "NUM_INDEXES", "type": "I64Attr" }, { "name": "NUM_CLASSES", "type": "I64Attr" }, { "name": "CHANNEL_RPN_BBOXES", "type": "I64Attr" }, { "name": "CHANNEL_RPN_SCORES", "type": "I64Attr" }, { "name": "NMS_PRE", "type": "I64Attr" }, { "name": "HARDWARE_FACTOR_TOPK", "type": "I64Attr" }, { "name": "NMS_MAX_LENGTH", "type": "I64Attr" }, { "name": "TOPK_ONNX_NMS", "type": "I64Attr" }, { "name": "H_RPN_DYN_MAX", "type": "I64Attr" }, { "name": "W_RPN_DYN_MAX", "type": "I64Attr" }, { "name": "MAX_PER_IMG", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MatchTemplate", "summary": "Opencv MatchTemplate operator", "description": "1.Op Introduction\n Perform opencv MatchTemplate operation.\n\n 2.Math formula\n ```math\n R(x, y) = \\sum_{i=0}^{T_w-1} \\sum_{j=0}^{T_h-1} I(x+i, y+j) \\cdot T(i, j)\n ```\n where:\n R(x, y) is the result of the match at position(x, y).\n I is the input image.\n T is the template image.\n T_w and T_h are the width and height of the template.\n\n 3.activation and weight\n input(act.): input tensor(source image).;\n match(w.): the template image that will be matched against the input image.;\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n mantissa_table(w.): stores a table of mantissa values used in calculations to improve precision or to handle specific numerical representations.;\n\n 4.attributes\n mode: the method of template matching to be used (e.g., correlation, squared difference, etc.).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "match", "type": "AnyTensorOrNone" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "mantissa_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "MatchTemplateModeAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MatMul", "summary": "matmul operator", "description": "1.Op Introduction\n Performs a two dimensional matrix multiplication. This allows both inputs to\n be activations, rather than reserving weights as an attribute in the\n FULLY_CONNECTED operator.\n\n 2.Math formula\n ```math\n output = input x right + bias\n ```\n\n 3.activation and weight\n input(act.): the first input tensor;\n right(act.): the second input tensor;\n bias(w.): an optional tensor can be added to the result of the matrix multiplication. ;\n multi(w.): used during the matrix multiplication operation.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n right_transpose: whether to transpose the right input tensor before performing the multiplication.;\n left_transpose: whether to transpose the input tensor before performing the multiplication.;\n output_transpose: whether to transpose the output tensor after the multiplication.;\n hdim_is_batch: whether the first dimension of the input tensor represents the batch size.;\n keep_dims: whether to keep the dimensions of the output tensor the same as the input tensors.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n multipliers: an integer array that specifies scaling factors to be applied to the results of the matrix multiplication.;\n rshifts: an integer array that indicates the right shift values.;\n right_zp: the zero point for the right input tensor.;\n input_zp: the zero point for the left input tensor.;\n quant_mode: It determines how the output tensor should be quantized.;\n ginfo: associated with layer grouping information.;\n multi_core: executed using multiple cores.;\n fuse_rq: fuse the requantization step with the matrix multiplication operation.;\n round_mode: the rounding mode to be used during the casting operation.;\n multicore: whether op supports multicore execution.;\n dq_type: the quantized data type for dynamic quantization.;\n q_group_size: the group size for per-group quantization.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "right", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "multi", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "left_transpose", "type": "DefaultValuedAttr" }, { "name": "right_transpose", "type": "DefaultValuedAttr" }, { "name": "output_transpose", "type": "DefaultValuedAttr" }, { "name": "hdim_is_batch", "type": "DefaultValuedAttr" }, { "name": "keep_dims", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multipliers", "type": "DefaultValuedAttr, {1}>" }, { "name": "rshifts", "type": "DefaultValuedAttr, {0}>" }, { "name": "right_zp", "type": "DefaultValuedAttr" }, { "name": "input_zp", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "left_reuse", "type": "DefaultValuedAttr" }, { "name": "out_scales", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multi_core", "type": "OptionalAttr" }, { "name": "fuse_rq", "type": "DefaultValuedAttr" }, { "name": "is_lora", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "OptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" }, { "name": "dq_type", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.MatMulLut", "summary": "MatMul + Lut", "description": "MatMul + Lut", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyRankedTensor" }, { "name": "right", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "multi", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "left_transpose", "type": "DefaultValuedAttr" }, { "name": "right_transpose", "type": "DefaultValuedAttr" }, { "name": "output_transpose", "type": "DefaultValuedAttr" }, { "name": "hdim_is_batch", "type": "DefaultValuedAttr" }, { "name": "keep_dims", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multipliers", "type": "DefaultValuedAttr, {1}>" }, { "name": "rshifts", "type": "DefaultValuedAttr, {0}>" }, { "name": "right_zp", "type": "DefaultValuedAttr" }, { "name": "input_zp", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "left_reuse", "type": "DefaultValuedAttr" }, { "name": "out_f8_scales", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multi_core", "type": "OptionalAttr" }, { "name": "fuse_rq", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Max", "summary": "max operator", "description": "1.Op Introduction\n Elementwise max of input1 and input2. All inputs and outputs must have the same data type.\n\n 2.Math formula\n ```math\n output = max(input1,input2, ..., inputN)\n ```\n Where input1, input2, ..., inputN are the input tensors.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n coeff: It is an array and allows for scaling the output of the addition operation.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "coeff", "type": "OptionalAttr>" }, { "name": "multipliers", "type": "OptionalAttr>" }, { "name": "rshifts", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.MaxConst", "summary": "max_const operator", "description": "1.Op Introduction\n max of one input and one const.\n\n 2.Math formula\n ```math\n output = Max(input, const_val)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.MaxPoolingIndicesBwd", "summary": "MaxPoolingIndicesBwd operator", "description": "1.Op Introduction\n Integrates some operations related to MaxPoolingIndicesBwd.\n\n 2.Math formula\n ```math\n grad\\_input(p) = \\sum_{q} \\delta\\big(p = indices[q]\\big) \\times grad\\_output(q)\n ```\n\n 3.activation and weight\n grad_output(act.): the gradient of the loss with respect to the output.;\n indices(w.): the indices of the input tokens or items.;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n dilations: controls the spacing between the kernel points;\n input_shape: The shape of the input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "grad_output", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" } ], "results": [ { "name": "grad_input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "dilations", "type": "TypedArrayAttrBase" }, { "name": "input_shape", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.MaxPoolWithMask", "summary": "max pool with operator", "description": "1.Op Introduction\n This performs an max pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n get output tensor and mask tensor\n\n 2.Math formula\n ```math\n output(N, C, H', W') = MaxPool(max(input(N, C, H, W)))\n maskOutput(N, C, H', W') = MaxPoolWithMask(argmax(input(N, C, H, W)))\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n strides: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n layer_group: multiple layers to be processed together or treated as a single unit during computation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" }, { "name": "mask", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "layer_group", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MaxUnpool", "summary": "MaxUnpool operation", "description": "1.Op Introduction\n Perform MaxUnpool on input.\n\n 2.Math formula\n ```math\n output1(N, C, H', W') = input(N, C, H, W) #if (h,w) is the index of the max value in the mask, otherwise is 0;\n output = scale * output1\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n mask(act.): place the pooled values in the output tensor.;\n\n 4.attributes\n scale_h: scaling factor for the height dimension of the output tensor.;\n scale_w: scaling factor for the width dimension of the output tensor.;\n ginfo: group information for layer grouping;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "mask", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale_h", "type": "I64Attr" }, { "name": "scale_w", "type": "I64Attr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MeanRstd", "summary": "Compute Mean, Rstd, Running_mean, Running_var in batchnorm train op", "description": "1.Op Introduction\n computes the mean, reverse standard deviation (Rstd), running mean, and running variance.\n\n 2.Math formula\n ```math\n mean(x),1/sqrt(var+eps),(1-momentum)*running_mean + momentum*mean,(1-momentum)*running_var + momentum*var\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n running_mean(w.): mean during running.;\n running_var(w.): variances during running.;\n weight(w.): weight tensor.;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n momentum: hyperparameter;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "running_mean", "type": "AnyTensor" }, { "name": "running_var", "type": "AnyTensor" }, { "name": "weight", "type": "AnyTensor" }, { "name": "bias", "type": "AnyTensor" } ], "results": [ { "name": "mean", "type": "AnyTensor" }, { "name": "rstd", "type": "AnyTensor" }, { "name": "running_mean_update", "type": "AnyTensor" }, { "name": "running_var_update", "type": "AnyTensor" }, { "name": "scale", "type": "AnyTensor" }, { "name": "bias_new", "type": "AnyTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" }, { "name": "momentum", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.MeanStdScale", "summary": "MeanStdScale, it's for preprocess.", "description": "1.Op Introduction\n for preprocess, do multiplier&rshift quantize.\n\n 2.Math formula\n ```math\n output = (input - mean) / std * scale + zero_points\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n f32_param(w.): a weight tensor parameter of type float32.;\n\n 4.attributes\n quant_mode: the mode or method used for quantization during the requantization operation.;\n customization_format: custom format for the input data.;\n channel_order: The order of color channels in the input tensor.;\n sign: if output is signed.;\n scale: scalar.;\n std: standard deviation values for each channel.;\n mean: mean values to subtract from each channel for normalization.;\n zero_points: zero point values for each channel.;\n resize_dims: resize the input tensor' dimensions.;\n multi: used during the matrix multiplication operation.;\n rshift: right shift values corresponding to each input tensor.;\n offset: Scalar;\n rounding_mode: The rounding method to use during quantization.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "f32_param", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "quant_mode", "type": "StrAttr" }, { "name": "customization_format", "type": "StrAttr" }, { "name": "channel_order", "type": "StrAttr" }, { "name": "sign", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "std", "type": "TypedArrayAttrBase" }, { "name": "mean", "type": "TypedArrayAttrBase" }, { "name": "zero_points", "type": "TypedArrayAttrBase" }, { "name": "resize_dims", "type": "TypedArrayAttrBase" }, { "name": "multi", "type": "TypedArrayAttrBase" }, { "name": "rshift", "type": "TypedArrayAttrBase" }, { "name": "offset", "type": "TypedArrayAttrBase" }, { "name": "rounding_mode", "type": "StrAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Min", "summary": "min operator", "description": "1.Op Introduction\n Elementwise min of input1 and input2. All inputs and outputs must have the same data type.\n\n 2.Math formula\n ```math\n output = min(input1,input2, ..., inputN)\n ```\n Where input1, input2, ..., inputN are the input tensors.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n coeff: It is an array and allows for scaling the output of the addition operation.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "coeff", "type": "OptionalAttr>" }, { "name": "multipliers", "type": "OptionalAttr>" }, { "name": "rshifts", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.MinConst", "summary": "min_const operator", "description": "1.Op Introduction\n min of one input and one const.\n\n 2.Math formula\n ```math\n output = Min(input, const_val)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Mlp", "summary": "w8a16 / w4a16 / a16 mlp operator", "description": "to do", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight_gate", "type": "AnyRankedTensor" }, { "name": "scale_gate", "type": "AnyTensorOrNone" }, { "name": "zp_gate", "type": "AnyTensorOrNone" }, { "name": "bias_gate", "type": "AnyTensorOrNone" }, { "name": "weight_up", "type": "AnyRankedTensor" }, { "name": "scale_up", "type": "AnyTensorOrNone" }, { "name": "zp_up", "type": "AnyTensorOrNone" }, { "name": "bias_up", "type": "AnyTensorOrNone" }, { "name": "weight_down", "type": "AnyRankedTensor" }, { "name": "scale_down", "type": "AnyTensorOrNone" }, { "name": "zp_down", "type": "AnyTensorOrNone" }, { "name": "bias_down", "type": "AnyTensorOrNone" }, { "name": "expert_id", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "w_transpose_gate", "type": "DefaultValuedAttr" }, { "name": "w_transpose_up", "type": "DefaultValuedAttr" }, { "name": "w_transpose_down", "type": "DefaultValuedAttr" }, { "name": "is_expert", "type": "DefaultValuedAttr" }, { "name": "quantized", "type": "DefaultValuedAttr" }, { "name": "q_group_size", "type": "DefaultValuedAttr" }, { "name": "weight_bits", "type": "DefaultValuedAttr" }, { "name": "num_expert", "type": "DefaultValuedAttr" }, { "name": "num_expert_per_tok", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.Mmap2Rgbmap", "summary": "Postprocess for isp mmap2rgbmap.", "description": "1.Op Introduction\n Postprocess for isp mmap2rgbmap.\n\n 2.Math formula\n ```math\n output = Postprocess(input)\n ```\n\n 3.activation and weight\n input(act.): input tensor;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Move", "summary": "local mem move op for layer group lmem alloc", "description": "1.Op Introduction\n local mem move op for layer group lmem alloc\n\n 2.Math formula\n ```math\n output = Move(input, move_src_add, move_dest_add, move_size, ts_id)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;\n\n 4.attributes\n name: a human-readable identifier for the move operation.;\n move_src_add: source addresses (offsets) in the local memory.;\n move_dest_add: destination addresses (offsets) in the local memory.;\n move_size: A list of sizes corresponding to each move operation.;\n ts_id: A unique identifier (timestamp id or task id);", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "move_src_add", "type": "TypedArrayAttrBase" }, { "name": "move_dest_add", "type": "TypedArrayAttrBase" }, { "name": "move_size", "type": "TypedArrayAttrBase" }, { "name": "ts_id", "type": "I64Attr" } ] }, { "name": "tpu.Mul", "summary": "mul operator", "description": "1.Op Introduction\n Elementwise multiplication of input1 and input2. input1 and input2 are tensors.\n\n 2.Math formula\n ```math\n output = ReLU((input1 * input2))\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n quant_mode: It determines how the output tensor should be quantized.;\n out_f8_scales: This parameter contains the scaling factors for the output in FP8 (8-bit floating point) format.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "DefaultValuedAttr" }, { "name": "out_f8_scales", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.MulConst", "summary": "mul const operator", "description": "1.Op Introduction\n Elementwise mul of input1 and input2. Input2 is constant.\n\n 2.Math formula\n ```math\n output = input * const_val\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.MulShift", "summary": "MulShift operator", "description": "1.Op Introduction\n performs an element-wise multiplication of the input tensor (after adjusting for a zero-point offset)\n\n 2.Math formula\n output = int8(input-zx) * multiplier >> rshift + zy\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "multiplier", "type": "SI32Attr" }, { "name": "rshift", "type": "SI32Attr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Nms", "summary": "NMS operator", "description": "1.Op Introduction\n tpu nms\n\n 2.Math formula\n ```math\n IOU(a, b) = Area(a \\cap b) / Area(a \\cup b)\n ```\n\n 3.activation and weight\n input(act.): Variadic input tensor.;\n buffer(w.): a temporary storage area for intermediate calculations or results during the NMS process.;\n\n 4.attributes\n center_point_box: whether the bounding boxes are defined by their center points.;\n max_output_size: the maximum number of boxes to be output after NMS.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "center_point_box", "type": "I64Attr" }, { "name": "max_output_size", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.NonZero", "summary": "NonZero operation", "description": "1.Op Introduction\n Returns the indices of the elements that are non-zero\n (in row-major order - by dimension).\n\n 2.Math formula\n ```math\n output = input[i1, i2, i3,...in] != 0\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n order: the order in which the non-zero indices should be returned.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "order", "type": "NonZeroOrderAttr" } ] }, { "name": "tpu.OutBuffer", "summary": "OutBuffer for store op", "description": "1.Op Introduction\n This operation stores storeOp output data on DDR when some tentor in layer-group\n is not output to returnOp but storeAndLoad is needed.\n\n 2.Math formula\n ```math\n output = storeOp_output\n \"storeOp_output\" represents the data produced by the store operation that is saved on DDR.\n ```\n\n 3.activation and weight\n none\n\n 4.attributes\n need_dump: whether the stored output data should be additionally dumped for debugging or analysis.;", "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "need_dump", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.PackRaw", "summary": "Preprocess for raw image.", "description": "1.Op Introduction\n (1) preprocess raw image from 3 byte 2 pixel to 2 byte 1 pixel,\n for each row pixel fill 0 in top 4 bits;\n for each img block pack to 4 channels pattern;\n (2) cast to float then normalize and clip by black & white level;\n (3) cast to odtype then pad img to align padding param and move to ddr;\n\n 2.Math formula\n (1)Pixel Conversion:\n For each pixel in the input tensor, the conversion can be represented as:\n ```math\n packed_pixel = (input & 0x3FF) (keeping lower 10 bits) (with top 4 bits set to 0);\n ```\n Here, input_pixel is the original pixel value, and packed_pixel is the newly formatted pixel value.\n (2)Normalization:\n The normalization step can be described as:\n ```math\n normalized_value = (packed_pixel - black_level) / (white_level - black_level);\n ```\n This formula ensures that the pixel values are scaled between 0 and 1 based on the specified black and white levels.\n (3)Clipping:\n After normalization, the values are clipped to ensure they remain within the valid range:\n ```math\n clipped_value = clip(normalized_value, 0, 1);\n ```\n (4)Output Casting and Padding:\n Finally, the output tensor is formed by casting the clipped values to the desired output data type and applying padding:\n ```math\n output = pad(cast(clipped_value), padding_params);\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n high_table(w.): defines the upper bounds for pixel values during normalization.;\n low_table(w.): defines the lower bounds for pixel values.;\n\n 4.attributes\n white_level: the maximum intensity level for normalization.;\n black_level: the minimum intensity level for normalization.;\n threshold: a threshold value that can be used during the normalization or clipping stages.;\n channel_order: the order of the color channels in the output tensor.(e.g., RGB, BGR).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "high_table", "type": "AnyTensorOrNone" }, { "name": "low_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "white_level", "type": "F64Attr" }, { "name": "black_level", "type": "F64Attr" }, { "name": "threshold", "type": "F64Attr" }, { "name": "channel_order", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Pad", "summary": "Pad operation", "description": "1.Op Introduction\n This operation pads a tensor according to the paddings you specify.\n paddings is an integer tensor with shape [2, n], where n is the rank of tensor.\n For each dimension D of input, paddings[0, D] indicates how many values to add\n before the contents of tensor in that dimension, and paddings[1, D] indicates\n how many values to add after the contents of tensor in that dimension.\n\n 2.Math formula\n ```math\n output = input(padding, val, mode)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n paddingsT(act.): the padding values for each dimension.;\n // for cv18xx reflect mode\n left_select(w.):reflect the tensor values when adding padding on the left side.;\n right_select(w.):reflect the tensor values when adding padding on the right side.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n paddings: defines how much padding to add before and after the contents of the input tensor for each dimension. ;\n val: the value to be used for padding the input tensor. ;\n mode: the padding mode include constant(Pads with a constant value); reflect(Pads with a reflection of the tensor values); replicate(Pads by replicating the edge values of the tensor).;\n with_insert_zero : When with_insert_zero is true, it means that the PadOp first performs the insert zero operation, and then conducts the Padding expansion. In this case, the mode can only be PaddingMode::constant. When with_insert_zero is false, the insert zero operation is not performed.\n inserts : When with_insert_zero is true, the number of zeros inserted between points in the h and w dimensions.\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "paddingsT", "type": "Optional" }, { "name": "left_select", "type": "AnyTensorOrNone" }, { "name": "right_select", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "paddings", "type": "TypedArrayAttrBase" }, { "name": "val", "type": "DefaultValuedAttr" }, { "name": "mode", "type": "DefaultValuedAttr" }, { "name": "with_insert_zero", "type": "DefaultValuedAttr" }, { "name": "insert_zeros", "type": "OptionalAttr>" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "indexing_map_s2l", "type": "OptionalAttr" }, { "name": "indexing_map_l2s", "type": "OptionalAttr" } ] }, { "name": "tpu.Permute", "summary": "Permute operator", "description": "1.Op Introduction\n Perform permute on input.\n\n 2.Math formula\n ```math\n output(...dim2, dim1, dim0) = PermuteOp(input(dim0, dim1, dim2...order))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n order: An array of integers specifying the permutation order of the input tensor's dimensions.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "order", "type": "TypedArrayAttrBase" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" }, { "name": "indexing_map_s2l", "type": "OptionalAttr" }, { "name": "indexing_map_l2s", "type": "OptionalAttr" } ] }, { "name": "tpu.PixelNorm", "summary": "PixelNorm operation", "description": "1.Op Introduction\n pixel normalization (normalize along c-axis)\n\n 2.Math formula\n ```math\n norm_{n, i, j} = sqrt(1 /C \\sum{c=1, C}input_{n, c, i, j} ^ 2) + eps\n output_{n, c, i, j} = weight * input_{n, c, i, j} / norm_{n, i, j} + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n weight(w.): weight tensor;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n // cv18xx\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n mantissa_table(w.): stores a table of mantissa values used in calculations to improve precision or to handle specific numerical representations.;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyTensorOrNone" }, { "name": "bias", "type": "AnyTensorOrNone" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "mantissa_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Pool1D", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n output(N, C, H', W') = Pool(max(input(N, C, H, W)))\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n pool_mode: ;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n /// symmetric quantize param\n multipliers: an array of multipliers used for quantization, It allows for scaling the input values before the addition operation.;\n rshift: right shift values corresponding to each input tensor.;\n /// asymmetric quantize param\n scale: Scalar;\n offset: Scalar;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;\n layer_group: multiple layers to be processed together or treated as a single unit during computation.;\n /// fp8 quantize param\n fp8_out_scale: scaling factor used for the output tensor when utilizing 8-bit floating-point (FP8) representation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "pool_mode", "type": "Tpu_PoolModeAttr{Avg|Max}" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "is_adaptive", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "ceil_mode", "type": "OptionalAttr" }, { "name": "multiplier", "type": "OptionalAttr" }, { "name": "rshift", "type": "OptionalAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "offset", "type": "OptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" }, { "name": "layer_group", "type": "OptionalAttr" }, { "name": "fp8_out_scale", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Pool2D", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n output(N, C, H', W') = Pool(max(input(N, C, H, W)))\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n pool_mode: ;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n /// symmetric quantize param\n multipliers: an array of multipliers used for quantization, It allows for scaling the input values before the addition operation.;\n rshift: right shift values corresponding to each input tensor.;\n /// asymmetric quantize param\n scale: Scalar;\n offset: Scalar;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;\n layer_group: multiple layers to be processed together or treated as a single unit during computation.;\n /// fp8 quantize param\n fp8_out_scale: scaling factor used for the output tensor when utilizing 8-bit floating-point (FP8) representation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "pool_mode", "type": "Tpu_PoolModeAttr{Avg|Max}" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "is_adaptive", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "ceil_mode", "type": "OptionalAttr" }, { "name": "multiplier", "type": "OptionalAttr" }, { "name": "rshift", "type": "OptionalAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "offset", "type": "OptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" }, { "name": "layer_group", "type": "OptionalAttr" }, { "name": "fp8_out_scale", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Pool3D", "summary": "pool operator", "description": "1.Op Introduction\n This performs an pooling over the given input tensor. A sliding\n window of size given by is passed over the input tensor.\n\n 2.Math formula\n ```math\n output(N, C, H', W') = Pool(max(input(N, C, H, W)))\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n kernel_shape: the size of the convolution kernel (filter) as an array.;\n stride: the stride for the cross-correlation, a single number or a tuple.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.\n pool_mode: ;\n pad_value: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n is_adaptive: whether the pooling operation is adaptive.\n If true, adjusts the kernel size based on the input size to produce a specified output size.\n count_include_pad: whether to include the padded values in the pooling count.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n ceil_mode: whether to use ceiling or floor when calculating the output size.;\n /// symmetric quantize param\n multipliers: an array of multipliers used for quantization, It allows for scaling the input values before the addition operation.;\n rshift: right shift values corresponding to each input tensor.;\n /// asymmetric quantize param\n scale: Scalar;\n offset: Scalar;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;\n layer_group: multiple layers to be processed together or treated as a single unit during computation.;\n /// fp8 quantize param\n fp8_out_scale: scaling factor used for the output tensor when utilizing 8-bit floating-point (FP8) representation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel_shape", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "pool_mode", "type": "Tpu_PoolModeAttr{Avg|Max}" }, { "name": "pad_value", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "OptionalAttr" }, { "name": "rshift", "type": "OptionalAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "offset", "type": "OptionalAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" }, { "name": "layer_group", "type": "OptionalAttr" }, { "name": "fp8_out_scale", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.PoolMask", "summary": "pool mask operator", "description": "1.Op Introduction\n pooling mask on input\n\n 2.Math formula\n ```math\n output1(N, C, H', W') = Pool(max(input(N, C, H, W)))\n maskOutput(N, C, H', W') = PoolMask(argmax(input(N, C, H, W)))\n output = scale * output1\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: a scaling factor is applied to the output of the pooling operation, can adjust the intensity or magnitude of the output mask.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "I64Attr" } ] }, { "name": "tpu.PReluOp", "summary": "PReluOp operator", "description": "1.Op Introduction\n Parametric Rectified Linear Unit is an activation function.\n\n 2.Math formula\n ```math\n f(x) = slope * x for x < 0\n f(x) = x for x >= 0\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n slope(w.): the activation function for negative input values.;\n\n 4.attributes\n rshift: the number of bits to right-shift the quantized values.;\n rshift_pos: This attribute defines the right shift for the positive output values during quantization.;\n multiplier_pos: This parameter specifies the multiplier for the positive part of the output, used in the context of quantization.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "slope", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "rshift_pos", "type": "OptionalAttr" }, { "name": "multiplier_pos", "type": "OptionalAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Preprocess", "summary": "FusePreprocess, it's just a placeholder op.", "description": "1.Op Introduction\n It may be divided to permute + slice + scale/scale_lut ops.\n\n 2.Math formula\n ```math\n output = \\text{Preprocess}(input, \\text{resize_dims}, \\text{mean}, \\text{scale}, \\text{channel_order})\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n quant_mode: It determines how the output tensor should be quantized.;\n customization_format: define how input data should be structured or formatted before being processed by the model.;\n channel_order: the order of the color channels in the output tensor.(e.g., RGB, BGR).;\n resize_dims: the target dimensions to which the input tensor should be resized.;\n scale: a scaling factor applied to the attention scores before they are passed through the softmax function.;\n mean: the mean values that should be subtracted from the input tensor during normalization.;\n sign: whether the preprocessing operation should include a sign adjustment.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "quant_mode", "type": "StrAttr" }, { "name": "customization_format", "type": "StrAttr" }, { "name": "channel_order", "type": "StrAttr" }, { "name": "resize_dims", "type": "TypedArrayAttrBase" }, { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "mean", "type": "TypedArrayAttrBase" }, { "name": "sign", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.RandnLike", "summary": "RandnLike operator", "description": "1.Op Introduction\n create a tensor with the same shape as input, and fill with value from normal distribution\n\n 2.Math formula\n ```math\n output = randn(shape(input))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n randn_data(w.): the characteristics of the normal distribution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "randn_data", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.Range", "summary": "Range operator", "description": "1.Op Introduction\n range op.\n generates a sequence of evenly spaced values within a specified range.\n\n 2.Math formula\n ```math\n output = [x | x = start + n * delta, n is an integer, and start ≤ x < limit]\n ```\n\n 3.activation and weight\n start(act.): The starting value of the sequence. This can be a tensor or None. If None, it defaults to 0.;\n limit(w.): The exclusive upper limit of the sequence.;\n delta(w.): The increment between each value;", "operands": [ { "name": "start", "type": "AnyTensor" }, { "name": "limit", "type": "AnyTensor" }, { "name": "delta", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.Reciprocal", "summary": "ConstantBinary (Div) operator", "description": "1.Op Introduction\n The Reciprocal operator is a tensor operation that performs division of a constant scalar value by an input tensor.\n\n 2.Math formula\n ```math\n output = const_val / input\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: specifies the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "const_val", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.RecurrentGatedDeltaRule", "summary": "Recurrent Gated Delta Rule operator", "description": "1.Op Introduction\n The RecurrentGatedDeltaRule operator implements a single-step recurrent gated delta rule\n attention mechanism, designed for efficient autoregressive inference with linear attention\n and recurrent state updates.\n\n 2.Math formula\n ```math\n scale = 1 / sqrt(k_head_dim)\n query = query * scale\n g_exp = exp(g)\n state = state * g_exp\n kv_mem = state^T @ key\n delta = (value - kv_mem) * beta\n state = state + key (outer) delta\n output = state^T @ query\n ```\n\n 3.activation and weight\n query(act.): query tensor with shape (B, 1, num_k_heads, k_head_dim).;\n key(act.): key tensor with shape (B, 1, num_k_heads, k_head_dim).;\n value(act.): value tensor with shape (B, 1, num_v_heads, v_head_dim).;\n g(act.): gating signal tensor with shape (B, 1, num_v_heads), controls the exponential decay rate.;\n beta(act.): scaling factor tensor with shape (B, 1, num_v_heads), modulates value contributions.;\n recurrent_state(act.): recurrent state tensor with shape (B, num_v_heads, k_head_dim, v_head_dim).;\n\n 4.attributes\n num_k_heads: number of key/query heads.;\n num_v_heads: number of value heads (must be a multiple of num_k_heads for GQA).;\n d: head dimension.;\n use_qk_l2norm: whether to apply L2 normalization to query and key.;\n scale: scaling factor applied to query.;", "operands": [ { "name": "query", "type": "AnyTensor" }, { "name": "key", "type": "AnyTensor" }, { "name": "value", "type": "AnyTensor" }, { "name": "g", "type": "AnyTensor" }, { "name": "beta", "type": "AnyTensor" }, { "name": "recurrent_state", "type": "AnyTensor" } ], "results": [ { "name": "attn_out", "type": "AnyTensor" } ], "attributes": [ { "name": "num_k_heads", "type": "I64Attr" }, { "name": "num_v_heads", "type": "I64Attr" }, { "name": "d", "type": "I64Attr" }, { "name": "use_qk_l2norm", "type": "BoolAttr" }, { "name": "scale", "type": "F64Attr" } ] }, { "name": "tpu.Reduce", "summary": "Reduce operator", "description": "1.Op Introduction\n Computes the mean/max/prod/sum of the input tensor's element along the provided axes.\n\n 2.Math formula\n ```math\n 1.Sum\n output[i_1, i_2, i_3,..., i_k] = \\sum{j in A}input[i_1, i_2,..., j, ..., i_n]\n where ( A ) is the set of axes to reduce.\n 2.Mean\n output[i_1, i_2, i_3,..., i_k] = 1 / count (\\sum{j in A}input[i_1, i_2,..., j, ..., i_n])\n where count is the number of elements being summed along the axes ( A ).\n 3.Max\n output[i_1, i_2, i_3,..., i_k] = max{j in A}input[i_1, i_2,..., j, ..., i_n]\n 4.Product\n output[i_1, i_2, i_3,..., i_k] = \\prod_{j=1}^m(input[i_1, i_2,..., i_k, j])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n reciprocal_mantissa_table(w.): store the mantissa values of the reciprocal.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" }, { "name": "reciprocal_mantissa_table", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" }, { "name": "keepdims", "type": "BoolAttr" }, { "name": "mode", "type": "ReduceModeAttr" }, { "name": "multiplier", "type": "OptionalAttr>" }, { "name": "rshift", "type": "OptionalAttr>" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Relu", "summary": "Relu operator", "description": "1.Op Introduction\n ReLU with a scalar maximum value.\n\n 2.Math formula\n ```math\n output = ReluOp(input) -> (0, 1)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n ginfo: associated with layer grouping information.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "ginfo", "type": "OptionalAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.RequantFp", "summary": "requant float operation", "description": "1.Op Introduction\n Requant 32/16/8 bit data to int8 or uint8 or fp8 data, by float scale and float offset, when to fp8 data, offset is not used;\n\n 2.Math formula\n int8/uint8/fp8(output) = round(float32/float16/float8(input) x scale + offset);\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n scale: Scalar;\n offset: Scalar;\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;\n ginfo: contains layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "F64Attr" }, { "name": "offset", "type": "DefaultValuedAttr" }, { "name": "quant_mode", "type": "Tpu_RequantModeAttr{TFLite_LShift|TFLite|MultiplierShift|OnlyShift|QDM|OnlyScale}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.RequantFpAxis", "summary": "requant float operation", "description": "1.Op Introduction\n Requant 32/16/8 bit data to int8 or uint8 data, PerAxis(or PerChannel);\n\n 2.Math formula\n int8/uint8(output) = RequantFpAxisOp(float32/float16/float8(input),quant);\n\n 3.activation and weight\n input(act.): input tensor;\n quant(act.): This attribute represents the quantization parameters tensor.\n It contains the values used for requantization, such as multipliers and shifts,\n which are specific to each axis or channel.;\n\n 4.attributes\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n first_round_mode: the rounding behavior applied to the scaled value before the offset is added.;\n ginfo: contains layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "quant", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "quant_mode", "type": "Tpu_RequantModeAttr{TFLite_LShift|TFLite|MultiplierShift|OnlyShift|QDM|OnlyScale}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "first_round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.RequantInt", "summary": "requant operation", "description": "1.Op Introduction\n Requant 32/16/8 bit data to int8 or uint8 data, by int multiplier and int shift;\n\n 2.Math formula\n int8/uint8(output) = RequantIntOp (int32/16/8(input));\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n multiplier: Floating-point multiplication operations are usually converted to fixed-point multiplication operations.;\n rshift: the number of bits to right-shift the quantized values.;\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n ginfo: contains layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "multiplier", "type": "SI32Attr" }, { "name": "rshift", "type": "SI32Attr" }, { "name": "quant_mode", "type": "Tpu_RequantModeAttr{TFLite_LShift|TFLite|MultiplierShift|OnlyShift|QDM|OnlyScale}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.RequantIntAxis", "summary": "requant operation", "description": "1.Op Introduction\n Requant 32/16/8 bit data to int8 or uint8 data, PerAxis(or PerChannel);\n\n 2.Math formula\n int8/uint8(output) = RequantIntAxisOp(int32/16/8(input), quant);\n\n 3.activation and weight\n input(act.): input tensor;\n quant(act.): the quantization parameters tensor.;\n\n 4.attributes\n quant_mode: It determines how the output tensor should be quantized.;\n round_mode: This parameter specifies the rounding mode to be used during quantization.;\n ginfo: contains layer grouping information.;\n rq_axis: the axis along which the requantization is performed.;\n fuse_rq_axis: whether to fuse the requantization operation with subsequent operations along the specified axis.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "quant", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "quant_mode", "type": "Tpu_RequantModeAttr{TFLite_LShift|TFLite|MultiplierShift|OnlyShift|QDM|OnlyScale}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "rq_axis", "type": "DefaultValuedAttr" }, { "name": "fuse_rq_axis", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Reshape", "summary": "Reshape operation", "description": "1.Op Introduction\n Returns a tensor with the same type/values as the input, with a new shape\n specified by the shape argument. Reshape may operate on tensors of any rank.\n No data conversion happens during a reshape operation.\n\n 2.Math formula\n ```math\n output = ReshapeOp(input, shape)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n shape: 0: keep dim from input; -1: left dim from input.;\n flatten_start_dim: the starting dimension from which to begin flattening the input tensor.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "Optional" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "DefaultValuedAttr, {}>" }, { "name": "flatten_start_dim", "type": "DefaultValuedAttr" }, { "name": "indexing_map_s2l", "type": "OptionalAttr" }, { "name": "indexing_map_l2s", "type": "OptionalAttr" } ] }, { "name": "tpu.Reverse", "summary": "Reverse operation", "description": "1.Op Introduction\n Reverse on input.\n\n 2.Math formula\n ```math\n output = ReverseOp(input, axis)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of reverse;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.RMSNorm", "summary": "RMSNorm operation", "description": "1.Op Introduction\n A simplification of the original layer normalization (LayerNorm).\n Only normalize the last dimension of tensor.\n\n 2.Math formula\n ```math\n output = gamma * input / sqrt(mean(input ^ 2) + epsilon)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n gamma(w.): scalar.;\n\n 4.attributes\n eps: a small constant added to the denominator during normalization to prevent division by zero.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "gamma", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "eps", "type": "F64Attr" }, { "name": "weight_keep_f32", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.RoiAlign", "summary": "RoiAlign operator", "description": "1.Op Introduction\n RoiAlign consumes an input tensor X and region of interests\n (rois) to apply pooling across each RoI.\n\n 2.Math formula\n ```math\n 1.ROI coordinate scaling[x1, y1, x2, y2]\n x_scaled = x x spatial_scale\n y_scaled = y x spatial_scale\n 2.Delineation of grid sub-areas\n bin_height = (y2_scaled - y1_scaled) / output_height\n bin_width = (x2_scaled - x1_scaled) / output_width\n 3.align_corners -> true\n x_grid = x1_scaled + (i + 0.5) x bin_width\n y_grid = y1_scaled + (j + 0.5) x bin_height\n output = RoiAlign(input, rois, output_height, output_width, sampling_ratio, spatial_scale, align_corners)\n ```\n\n 3.activated and weight\n input(act.): input tensor(4D);\n rois: RoIs (Regions of Interest) to pool over;\n rois is 2-D input of shape (num_rois, 4) given as [[x1, y1, x2, y2], ...].\n\n 4.attributes\n mode: the pooling mode to be used when extracting features from the RoIs on the input feature maps.;\n output_height: the height of the output feature maps.;\n output_width: the width of the output feature maps.;\n sampling_ratio: the number of sampling points in each direction (height and width).;\n spatial_scale: a scaling factor that maps the input coordinates (RoIs) to the input feature map's scale.;\n align_corners: whether to align the corners of the input and output tensors.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "rois", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "RoiAlignModeAttr" }, { "name": "output_height", "type": "I64Attr" }, { "name": "output_width", "type": "I64Attr" }, { "name": "sampling_ratio", "type": "I64Attr" }, { "name": "spatial_scale", "type": "F64Attr" }, { "name": "align_corners", "type": "BoolAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.RoiExtractor", "summary": "RoiExtractor operator", "description": "1.Op Introduction\n RoiExtractor consumes an input tensor X and region of interests\n (rois) to apply pooling across each RoI.\n\n 2.Math formula\n ```math\n 1.ROI coordinate scaling[x1, y1, x2, y2]\n x_scaled = x x spatial_scale\n y_scaled = y x spatial_scale\n 2.Delineation of grid sub-areas\n bin_height = (y2_scaled - y1_scaled) / output_height\n bin_width = (x2_scaled - x1_scaled) / output_width\n 3.align_corners -> true\n x_grid = x1_scaled + (i + 0.5) x bin_width\n y_grid = y1_scaled + (j + 0.5) x bin_height\n output = RoiAlign(input, rois, output_height, output_width, sampling_ratio, spatial_scale, align_corners)\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n rois(act.): RoIs (Regions of Interest) to pool over;\n rois is 2-D input of shape (num_rois, 4) given as [[x1, y1, x2, y2], ...]\n target_lvls(act.): 1-D tensor with each element denoting the index of the corresponding image in the batch.\n\n 4.attributes\n mode: the pooling mode to be used when extracting features from the RoIs on the input feature maps.;\n num_levels: the number of feature levels.;\n output_height: the height of the output feature maps.;\n output_width: the width of the output feature maps.;\n sampling_ratio: the number of sampling points in each direction (height and width).;\n spatial_scale: a scaling factor that maps the input coordinates (RoIs) to the input feature map's scale.;\n align_corners: whether to align the corners of the input and output tensors.;\n is_static: whether the RoI extraction process has a fixed (static) configuration.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "rois", "type": "AnyRankedTensor" }, { "name": "target_lvls", "type": "AnyRankedTensor" }, { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mode", "type": "RoiAlignModeAttr" }, { "name": "num_levels", "type": "I64Attr" }, { "name": "output_height", "type": "I64Attr" }, { "name": "output_width", "type": "I64Attr" }, { "name": "sampling_ratio", "type": "I64Attr" }, { "name": "spatial_scales", "type": "TypedArrayAttrBase" }, { "name": "align_corners", "type": "BoolAttr" }, { "name": "is_static", "type": "BoolAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Rope", "summary": "Rope Operator", "description": "1.Op Introduction\n rope operator.\n\n 2.Math formula\n ```math\n output=saturation((input1 x shift(input2, mul1_shift))⊕(input3 x shift(input2, mul2_shift))) + shift(input3, dd_shift)\n ```\n The operator ⊕ represents the addition of the two multiplicative results.\n The function shift(input,shift_value) applies a shift to the input tensor based on the provided shift value.\n The saturation function ensures that the output remains within a defined range, preventing overflow or underflow.\n\n 3.activation and weight\n input1(act.): input tensor;\n input2(act.): input tensor;\n input3(act.): input tensor;\n\n 4.attributes\n is_permute_optimize:whether to apply optimization for permuting the input tensors.;\n mul1_round_mode: the rounding mode to be used for the first multiplication operation.;\n mul2_round_mode: Similar to mul1_round_mode, this attribute defines the rounding mode for the second multiplication operation.;\n add_round_mode: the rounding mode for the addition operation.;\n mul1_shift: the number of bits to shift the result of the first multiplication.;\n mul2_shift: Similar to mul1_shift, this attribute defines the number of bits to shift for the second multiplication operation.;\n add_shift: the number of bits to shift the result of the addition operation.;\n mul1_saturation: whether the output of the first multiplication should be saturated.\n When set to true, the result will be clamped to prevent overflow or underflow.;\n mul2_saturation: Similar to mul1_saturation, this attribute specifies whether saturation should be applied to the second multiplication's output.;\n add_saturation: whether to apply saturation to the output of the addition operation.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input1", "type": "AnyRankedTensor" }, { "name": "input2", "type": "AnyRankedTensor" }, { "name": "input3", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "rope_mode", "type": "DefaultValuedAttr" }, { "name": "is_permute_optimize", "type": "DefaultValuedAttr" }, { "name": "mul1_round_mode", "type": "DefaultValuedAttr" }, { "name": "mul2_round_mode", "type": "DefaultValuedAttr" }, { "name": "add_round_mode", "type": "DefaultValuedAttr" }, { "name": "mul1_shift", "type": "DefaultValuedAttr" }, { "name": "mul2_shift", "type": "DefaultValuedAttr" }, { "name": "add_shift", "type": "DefaultValuedAttr" }, { "name": "mul1_saturation", "type": "DefaultValuedAttr" }, { "name": "mul2_saturation", "type": "DefaultValuedAttr" }, { "name": "add_saturation", "type": "DefaultValuedAttr" }, { "name": "force_f32", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Scale", "summary": "Scale operator", "description": "1.Op Introduction\n Y = X * S + B,\n where the shape of X/Y is [n, c, h, w] and the shape of S/B is [1, c, 1, 1].\n\n 2.Math formula\n ```math\n output = input x scale + bias\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n scale(w.): scalar;\n bias(w.): the learnable bias of the module of shape (out_channels).;\n lshift: a left shift operation applied to the dequantized data after scaling.;\n\n 4.attributes\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyRankedTensor" }, { "name": "lshift", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.ScaleLut", "summary": "scale lut operator.", "description": "1.Op Introduction\n Performs scale on input, y = input * scale + bias.\n\n Interfaces or Traits:\n `NoSideEffect`\n `TpuOpCommonInterface` : support common TPU TG Op interface.\n `TpuTGOpCodegenInterface` : support generate TPU instuctions.\n\n\n 2.Math formula\n ```math\n output = input * scale + bias\n ```\n 3.activation and weight\n input(act.): input tensor;\n table(w.): store a lookup table that may assist in optimizing the matching process.;\n\n 4.attributes\n scale: each channel scale.;\n bias: each channel bias.;\n sign: if output is signed.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "TypedArrayAttrBase" }, { "name": "bias", "type": "TypedArrayAttrBase" }, { "name": "sign", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.ScatterElements", "summary": "ScatterElements op", "description": "1.Op Introduction\n ScatterElements takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that\n identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by\n creating a copy of the input data, and then updating its value to values specified by updates at specific index\n positions specified by indices. Its output shape is the same as the shape of data.\n\n 2.Math formula\n ```math\n output = ScatterElements(input[axis], updates, indices)\n ```\n 3.activation and weight\n input(act.): input tensor;\n indices(w.): Tensor of int32/int64 indices, of r >= 1 (same rank as input).\n All index values are expected to be within bounds [-s, s-1] along axis of size s.\n updates(w.): Tensor of rank r >=1 (same rank and shape as indices).\n indices_coeff(w.): a scaling or modifying factor for the indices.;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "updates", "type": "AnyRankedTensor" }, { "name": "indices_coeff", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "reduction", "type": "DefaultValuedAttr" }, { "name": "nc_can_split", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.ScatterND", "summary": "ScatterND operator", "description": "1.Op Introduction\n The output of the operation is produced by creating a copy of the input data,\n and then updating its value to values specified by updates at\n specific index positions specified by indices.\n\n 2.Math formula\n ```math\n output = ScatterND(input_data[indices], updates, reduction)\n ```\n\n 3.activated and weight\n input_data(act.): input tensor;\n indices(w.): Tensor of rank q >= 1.;\n updates(w.): Tensor of rank q + r - indices_shape[-1] - 1.;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n reduction: Type of reduction to apply: none (0 default), add(1), sub(2), max(3), min(4), mul(5).;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input_data", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "updates", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduction", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.SelectiveScan", "summary": "2D Selective Scan Operator (specialized for VMamba)", "description": "1. Op Introduction\n Performs structured state space modeling (SSM) on 2D image data using a bidirectional scanning mechanism.\n Core component of the VMamba architecture that enables efficient long-range dependency modeling in visual data.\n\n 2. Math formula\n For each scanning direction:\n ```\n h_t = δA_t ⊙ h_{t-1} + δB_t ⊙ u_t\n y_t = c_t ⊙ h_t\n ```\n Final output:\n ```\n output = concat(y_forward, y_backward) + u ⊙ D\n ```\n code:\n\n for i in range(L):\n x_up = deltaA_up[:, :, i, :] * x_up + deltaB_u_up[:, :, i, :]\n x_down = deltaA_down[:, :, L - 1 - i, :] * x_down + deltaB_u_down[:, :, L - 1 - i, :]\n y_up[i, :, :] = x_up[0, :, :] * c_up[i, :, 0, :]\n y_down[L - 1 - i, :, :] = x_down[0, :, :] * c_down[L - 1 - i, :, 0, :]\n\n y = concat((y_up, y_down), dim=1)\n out = y if D is None else y + u * D\n\n 3. Input parameters:\n u: Input feature map tensor (after linear projection) [N, C, L, Batch]\n c: State-to-output projection weights [N, C, L, Batch]\n D: Residual connection weights (optional) [N, C]\n δA: Discretized state transition matrix [N, C, L, Batch]\n δB_u: Combined input projection and discretized control matrix [N, C, L, Batch]\n\n 4. Attributes:\n direction: Bidirectional scanning scheme (forward & reverse)\n time_dim: Sequence length dimension (L = H × W)\n channel_split: Channel dimension partitioning factor (C → C//2)\n residual: Whether to apply residual connection (D term)\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "Cs", "type": "AnyTensor" }, { "name": "deltaA", "type": "AnyTensor" }, { "name": "deltaB_u", "type": "AnyTensor" }, { "name": "us", "type": "AnyTensor" }, { "name": "Ds", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Shape", "summary": "Shape operation", "description": "1.Op Introduction\n Takes a tensor as input and outputs an 1D int tensor containing the shape of the input tensor.\n\n 2.Math formula\n ```math\n output = shape(input[d1, d2,...,dn])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.ShapeArith", "summary": "Cpu data operation", "description": "1.Op Introduction\n Arithmetic implementation for simple data in host memory such as 'Shape, Index, Stride' etc.\n\n 2.Math formula\n ```math\n output = ShapeArith(input, type)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n type: the kind of arithmetic operation.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "type", "type": "StrAttr" } ] }, { "name": "tpu.ShapeAssign", "summary": "ShapeAssign operator", "description": "1.Op Introduction\n reshape for dynamic shape\n\n 2.Math formula\n ```math\n output = ShapeAssign(input, shape)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n shape(w.): 0: keep dim from input; -1: left dim from input.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "shape", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.ShapeCast", "summary": "Shape Cast operation", "description": "1.Op Introduction\n designed to perform shape casting, which allows the transformation of the shape of an input tensor while preserving its data type.\n\n 2.Math formula\n output = reshape(input, new_shape);\n\n 3.activation\n input(act.): input tensor;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ] }, { "name": "tpu.ShapeClip", "summary": "ShapeClip operation running on CPU", "description": "1.Op Introduction\n The operator limits the given input to a certain range.\n\n 2.Math formula\n ```math\n output[i] = min if input[i] < min;\n input[i] if input[i] >= min && input[i] <= max;\n max if input[i] > max;\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n min: the minimum value that the elements of the input tensor can take.;\n max: the maximum value that the elements of the input tensor can take.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "min", "type": "F32Attr" }, { "name": "max", "type": "F32Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.ShapePack", "summary": "Shape Concatate operation", "description": "1.Op Introduction\n Concatenates the given sequence of seq tensors in the given dimension.\n All tensors must either have the same shape (except in the concatenating dimension) or be empty.\n\n 2.Math formula\n output = ShapePack(input, axis)\n\n 3.activation and weight\n inputs(act.): input tensor;\n\n 4.attributes\n axis: the dimension of the input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" } ] }, { "name": "tpu.ShapePow", "summary": "ShapePow operation running on CPU", "description": "1.Op Introduction\n perform an element-wise power calculation on the input tensor.\n\n 2.Math formula\n output = input ^ n\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n exponent:;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "exponent", "type": "F32Attr" } ] }, { "name": "tpu.ShapeReduce", "summary": "ShapeReduce operator", "description": "1.Op Introduction\n ShapeReduce Operation on input.\n\n 2.Math formula\n \\text{output} = \\text{scale} \\times \\mathrm{reduce}\\left(\\text{input}, \\text{axes}; \\, \\text{mode}\\right)\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;\n keepdims: whether to retain the dimensions of the input tensor in the output.\n If true, will have the same number of dimensions as the input tensor.;\n mode: the type of binary operation to be performed, addition, subtraction, or other types of binary operations.;\n scale: scalar.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" }, { "name": "keepdims", "type": "BoolAttr" }, { "name": "mode", "type": "ReduceModeAttr" }, { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.ShapeReshape", "summary": "ShapeReshape operation", "description": "1.Op Introduction\n Returns a tensor with the same type/values as the input, with a new shape\n specified by the shape argument. Reshape may operate on tensors of any rank.\n No data conversion happens during a reshape operation.\n\n 2.Math formula\n ```math\n output = ShapeReshapeOp(input, shape)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n shape: 0: keep dim from input; -1: left dim from input.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "DefaultValuedAttr, {}>" } ] }, { "name": "tpu.ShapeReverse", "summary": "ShapeReverse operation", "description": "1.Op Introduction\n Reverse on input\n\n 2.Math formula\n ```math\n output = ShapeReverse(input, axis)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axis: the dimension of reverse;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" } ] }, { "name": "tpu.ShapeScatterElements", "summary": "ScatterElements op", "description": "1.Op Introduction\n ScatterElements takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that\n identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by\n creating a copy of the input data, and then updating its value to values specified by updates at specific index\n positions specified by indices. Its output shape is the same as the shape of data.\n\n 2.Math formula\n ```math\n output = ScatterElements(input[axis], updates, indices)\n ```\n 3.activation and weight\n input(act.): input tensor;\n indices(w.): Tensor of int32/int64 indices, of r >= 1 (same rank as input).\n All index values are expected to be within bounds [-s, s-1] along axis of size s.\n updates(w.): Tensor of rank r >=1 (same rank and shape as indices).\n indices_coeff(w.): a scaling or modifying factor for the indices.;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n axis: the dimension of the input tensor.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "indices", "type": "AnyTensor" }, { "name": "updates", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "reduction", "type": "DefaultValuedAttr" }, { "name": "nc_can_split", "type": "DefaultValuedAttr" } ] }, { "name": "tpu.ShapeSlice", "summary": "ShapeSlice operator", "description": "1.Op Introduction\n Slice Operation on shape-type tensor.\n\n 2.Math formula\n ```math\n output[i] = input[offset[j] : ends[j] : steps[j]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n offsetT(w.): the starting indices for each slice along the specified axes.;\n endsT(w.): the ending indices for each slice along the specified axes.;\n stepsT(w.): the step sizes for each slice along the specified axes.;\n\n 4.attributes\n offset: An array of the starting indices for slicing along each axis.;\n steps: An array of the step sizes for slicing along each axis.;\n ends: An array of the ending indices for slicing along each axis.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "offsetT", "type": "AnyTensorOrNone" }, { "name": "endsT", "type": "AnyTensorOrNone" }, { "name": "stepsT", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "offset", "type": "TypedArrayAttrBase" }, { "name": "steps", "type": "TypedArrayAttrBase" }, { "name": "ends", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.ShapeSqueeze", "summary": "Onnx-Style ShapeSqueeze operator", "description": "1.Op Introduction\n ShapeSqueeze Operation on input.\n\n 2.Math formula\n output = ShapeSqueeze(input, axes)\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: An array of the axes along which to perform the slicing operation.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.ShapeTile", "summary": "Shape Tile operation", "description": "1.Op Introduction\n Returns a tensor with the same type as the input, with a new shape\n specified by the shape argument.\n\n 2.Math formula\n ```math\n output[i_1, i_2, i_3,...i_k] = input[i_1 mod d_1, i_2 mod d_2, i_3 mod d_3,..., i_k mod d_k]\n ```\n where d_j represents the corresponding dimension size of the input tensor after tiling.\n\n 3.activation and weight\n input(act.): input tensor.;\n tileT(w.): how many times to replicate the input tensor along each dimension.;\n buffer(w.): temporary storage of intermediate results or states during the computation.;\n\n 4.attributes\n tile: the number of times to replicate the input tensor along each dimension.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "tileT", "type": "Optional" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "tile", "type": "DefaultValuedAttr, {}>" } ] }, { "name": "tpu.ShapeTranspose", "summary": "ShapeTransposeOp operator", "description": "1.Op Introduction\n Perform permute on input.\n\n 2.Math formula\n ```math\n output(dim1, dim0) = TransposeOp(input(dim0, dim1))\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n order: the order in which the non-zero indices should be returned.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "order", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.ShapeUnsqueeze", "summary": "Onnx-Style ShapeUnsqueeze operator", "description": "1.Op Introduction\n ShapeUnsqueeze Operation on input.\n\n 2.Math formula\n output = ShapeUnsqueeze(input, axes)\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: An array of the axes along which to perform the slicing operation.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.ShuffleChannel", "summary": "ShuffleChannel operator", "description": "1.Op Introduction\n Perform ShuffleChannel on input.\n\n 2.Math formula\n ```math\n output(N, C, H, W) = input(N, Shuffle(C), H, W)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n group: An integer specifying the number of groups to divide the channels into.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "group", "type": "I64Attr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Slice", "summary": "Slice operator", "description": "1.Op Introduction\n Slice Operation on input.\n\n 2.Math formula\n ```math\n output[i] = input[offset[j] : ends[j] : steps[j]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n offsetT(w.): the starting indices for each slice along the specified axes.;\n endsT(w.): the ending indices for each slice along the specified axes.;\n stepsT(w.): the step sizes for each slice along the specified axes.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n offset: An array of the starting indices for slicing along each axis.;\n steps: An array of the step sizes for slicing along each axis.;\n ends: An array of the ending indices for slicing along each axis.;\n axes: An array of the axes along which to perform the slicing operation.;\n hasparamConvert_axes: whether parameter conversion is needed for the specified axes.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "offsetT", "type": "AnyTensorOrNone" }, { "name": "endsT", "type": "AnyTensorOrNone" }, { "name": "stepsT", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "offset", "type": "TypedArrayAttrBase" }, { "name": "steps", "type": "TypedArrayAttrBase" }, { "name": "ends", "type": "TypedArrayAttrBase" }, { "name": "axes", "type": "DefaultValuedAttr, {1}>" }, { "name": "hasparamConvert_axes", "type": "DefaultValuedAttr, {}>" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "indexing_map_s2l", "type": "OptionalAttr" }, { "name": "indexing_map_l2s", "type": "OptionalAttr" } ] }, { "name": "tpu.SliceMerge", "summary": "SliceMerge", "description": "1.Op Introduction\n When there are multiple slices in the layer-group,\n this operation combines the store op output of each slice to output to the yield op.\n\n 2.Math formula\n ```math\n output = SliceMerge(input)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ] }, { "name": "tpu.Softmax", "summary": "softmax operator", "description": "1.Op Introduction\n Integrates some operations related to softmax.\n\n 2.Math formula\n ```math\n \\text{output}[i] = \\frac{e^{\\text{input}[i]}}{\\sum_{j} e^{\\text{input}[j]}}\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n table(w.): additional computations or transformations during the softmax operation.;\n slope_table(w.): contain scaling factors or slopes that can adjust the output.;\n reciprocal_table(w.): holds precomputed reciprocal values that can be used to optimize the division operations;\n reciprocal_mantissa_table(w.): store the mantissa values of the reciprocal.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n log: when set to true, indicates that the output should be computed in log space.;\n beta: scaling factor.;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "slope_table", "type": "AnyTensorOrNone" }, { "name": "reciprocal_table", "type": "AnyTensorOrNone" }, { "name": "reciprocal_mantissa_table", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "log", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.SoftmaxBwd", "summary": "softmax backward operator", "description": "1.Op Introduction\n Integrates some operations related to softmax backward.\n\n 2.Math formula\n ```math\n grad_input[i] = softmax(output)[i] * (grad_output[i] - \\sum{j}grad_output[j] * softmax(output)[j])\n ```\n\n 3.activation and weight\n grad_output(act.): the gradient of the loss with respect to the output.;\n output(act.): output tensor.;\n\n 4.attributes\n dim: If set to 0, computed across rows, If set to 1, computed across columns.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "grad_output", "type": "AnyTensor" }, { "name": "output", "type": "AnyTensor" } ], "results": [ { "name": "grad_input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.SoftmaxCast", "summary": "softmax operator", "description": "Softmax + Requant", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "table", "type": "AnyTensorOrNone" }, { "name": "slope_table", "type": "AnyTensorOrNone" }, { "name": "reciprocal_table", "type": "AnyTensorOrNone" }, { "name": "reciprocal_mantissa_table", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "SI32Attr" }, { "name": "log", "type": "DefaultValuedAttr" }, { "name": "beta", "type": "DefaultValuedAttr" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.Sort", "summary": "Sort operation", "description": "1.Op Introduction\n Integrates some operations related to Sort.\n\n 2.Math formula\n ```math\n output = Sort(input, axis, descending)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n buffer(w.): a temporary storage area for intermediate calculations or results during the NMS process.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n descending: the order of sorting.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "values", "type": "AnyTensorOrNone" }, { "name": "indices", "type": "AnyTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "descending", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Space2Batch", "summary": "Space2Batch operator", "description": "1.Op Introduction\n Refer to `https://www.tensorflow.org/api_docs/python/tf/space_to_batch`\n\n 2.Math formula\n ```math\n h_padding = h + pad_top + pad_bottom,\n w_padding = w + pad_left + pad_right,\n [n, c, h, w] => [n, c, h_padding, w_padding]\n =>[n * block_h * block_w, c, h_padding / block_h, w / block_w];\n h_padding and w_padding should satisfy:\n h_padding % block_h = 0, w_padding % block_w = 0\n The format of input or output is NCHW.\n ```\n\n 3.activation and weight\n inputs(act.): input tensor.;\n buffer(w.): temporary storage of intermediate results or states during computation.;\n\n 4.attributes\n block_h: The height of the blocks used to rearrange the depth into spatial dimensions.;\n block_w: The width of the blocks used to rearrange the depth into spatial dimensions.;\n pads: the amount of padding applied to the input. It contains four ints with top, left, bottom, right.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "block_h", "type": "I64Attr" }, { "name": "block_w", "type": "I64Attr" }, { "name": "pads", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Split", "summary": "split tensor to continues pieces", "description": "1.Op Introduction\r\n The ops in one parallel should run in parallel.\r\n\r\n 2.Math formula\r\n ```math\r\n output = input[i * split_size: (i + 1) * split_size] for i = 0, 1, ... num - 1\r\n ```\r\n\r\n 3.activation and weight\r\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "outputs", "type": "Variadic" } ] }, { "name": "tpu.Squeeze", "summary": "Onnx-Style Squeeze operator", "description": "1.Op Introduction\n Squeeze Operation on input.\n\n 2.Math formula\n ```math\n output = squeeze(input, axes)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.Store", "summary": "Store operation", "description": "1.Op Introduction\n store weight from gmem to l2mem;\n\n 2.Math formula\n output = store(input, input_gmem, ginfo, support_compress, compress_info, l2m_addr)\n\n 3.activation and weight\n input(act.): input tensor;\n input_gmem(w.): the input tensor containing the weights stored in global memory (gmem).;\n\n 4.attributes\n ginfo: associated with layer grouping information.;\n support_compress: whether compression is supported for the load operation.;\n compress_info: used in conjunction with support_compress to specify details like compression schemes, ratios, or any relevant metadata.;\n l2m_addr: the address or offset within the local L2 memory (l2mem).;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "ginfo", "type": "OptionalAttr" }, { "name": "support_compress", "type": "DefaultValuedAttr" }, { "name": "compress_info", "type": "OptionalAttr" }, { "name": "indexing_map_l2s", "type": "OptionalAttr" }, { "name": "paddings", "type": "OptionalAttr>" }, { "name": "pad_const_val", "type": "OptionalAttr" } ] }, { "name": "tpu.StridedSlice", "summary": "Strided Slice operator", "description": "1.Op Introduction\n Strided Slice Operation on input.\n\n 2.Math formula\n ```math\n output[i] = input[starts[j] + i * strides[j]]\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n starts(w.): the starting indices for each dimension of the input tensor.;\n ends(w.): the ending indices for each dimension of the input tensor.;\n strides(w.): the stride values for each dimension, determining the step size between indices in the slicing operation.;\n\n 4.attributes\n begin_mask: If set, the start index for that dimension is considered as 0.;\n end_mask: If set, the end index for that dimension is considered as the size of the dimension.;\n ellipsis_mask: whether allowing for the selection of all dimensions in between specified slices.;\n new_axis_mask: which dimensions should be added as new axes in the output tensor.;\n shrink_axis_mask: which dimensions should be removed from the output tensor.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "starts", "type": "AnyRankedTensor" }, { "name": "ends", "type": "AnyRankedTensor" }, { "name": "strides", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "begin_mask", "type": "I64Attr" }, { "name": "end_mask", "type": "I64Attr" }, { "name": "ellipsis_mask", "type": "I64Attr" }, { "name": "new_axis_mask", "type": "I64Attr" }, { "name": "shrink_axis_mask", "type": "I64Attr" } ] }, { "name": "tpu.Sub", "summary": "sub operator", "description": "1.Op Introduction\n Elementwise subtraction of input1 and input2. Axis of size 1 will be broadcast,\n as necessary.\n\n 2.Math formula\n ```math\n output = ReLU((input1 - input2; dim))\n ```\n Axis of size 1 will be broadcast if necessary.\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n is_reverse: whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n coeff: It is an array and allows for scaling the output of the addition operation.;\n // quant param\n multipliers: applied during the concatenation process to adjust the values of the input tensors.;\n rshifts: an array of right shift values corresponding to each input tensor.;\n f8_scales: scaling factors for FP8 (8-bit floating point) quantization.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "coeff", "type": "OptionalAttr>" }, { "name": "multipliers", "type": "OptionalAttr>" }, { "name": "rshifts", "type": "OptionalAttr>" }, { "name": "f8_scales", "type": "OptionalAttr>" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.SubConst", "summary": "sub const operator", "description": "1.Op Introduction\n Elementwise subtraction of input1 and input2. Input1 or Input2 is constant.\n as necessary.\n\n 2.Math formula\n ```math\n output = input - const_val or const_val - input\n ```\n\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n const_val: the constant value to be added to each element of the input tensor(positive, negative, or zero).;\n is_reverse: This boolean attribute indicates whether the subtraction operation is performed in reverse order.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n // quant param\n multiplier: applied during the concatenation process to adjust the values of the input tensors.;\n rshift: right shift values corresponding to each input tensor.;\n f8_scale: scaling factors for FP8 (8-bit floating point) quantization.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "const_val", "type": "F64Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "multiplier", "type": "DefaultValuedAttr" }, { "name": "rshift", "type": "DefaultValuedAttr" }, { "name": "f8_scale", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.SwapChannel", "summary": "SwapChannel operator.", "description": "1.Op Introduction\n Swap Channel on input.\n\n Interfaces or Traits:\n `NoSideEffect`\n `TpuOpCommonInterface` : support common TPU TG Op interface.\n `TpuTGOpCodegenInterface` : support generate TPU instuctions.\n\n 2.Math formula\n ```math\n output(h, w, c) = input(h, w, channel_order)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n channel_order: channel swap order.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "channel_order", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.SwapDimInner", "summary": "SwapDimInner operator.", "description": "1.Op Introduction\n a dimension-swapping operation based on a specified offset.\n\n 2.Math formula\n ```math\n output = SwapDimInner(input, offset)\n ```\n 3.activation and weight\n input(act.): input tensor;\n\n 4.attributes\n offset: the position at which the input tensor is split.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "offset", "type": "TypedArrayAttrBase" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Tile", "summary": "Tile operation", "description": "1.Op Introduction\n Returns a tensor with the same type as the input, with a new shape\n specified by the shape argument.\n\n 2.Math formula\n ```math\n output[i_1, i_2, i_3,...i_k] = input[i_1 mod d_1, i_2 mod d_2, i_3 mod d_3,..., i_k mod d_k]\n ```\n where d_j represents the corresponding dimension size of the input tensor after tiling.\n\n 3.activation and weight\n input(act.): input tensor.;\n tileT(w.): how many times to replicate the input tensor along each dimension.;\n buffer(w.): temporary storage of intermediate results or states during the computation.;\n\n 4.attributes\n tile: the number of times to replicate the input tensor along each dimension.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "tileT", "type": "Optional" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "tile", "type": "DefaultValuedAttr, {}>" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.TopK", "summary": "TopK operation", "description": "1.Op Introduction\n Integrates some operations related to topk.\n\n 2.Math formula\n ```math\n output_values, output_indices = TopK(input, K, axis, largest, sorted)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n kT(w.): provide a specific tensor for K values. This allows for dynamic specification of K.;\n\n 4.attributes\n axis: the dimension of the input tensor.;\n K: how many of the largest (or smallest, depending on the largest attribute) values will be returned. defaults is -1;\n largest: whether to retrieve the largest or smallest values.;\n sorted: whether the output values should be sorted in descending order (if largest is true) or ascending order (if largest is false).;\n values_used_only: whether to return only the values of the top K elements without their corresponding indices.;\n buffer_val: the provision of a buffer tensor where the output values can be stored.;\n buffer_idx: the provision of a buffer tensor for storing the output indices of the top K elements.;\n buffer_scatter_idx: the provision of a buffer tensor for storing the scatter indices used in the sorting process.;\n buffer_seq_idx: the provision of a buffer tensor for storing the sequence indices used in the sorting process.;\n replace_topk_indices: whether to replace the indices of the top K elements in the output with new indices.;\n use_hau: whether the operator uses hau to implement.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "kT", "type": "Optional" }, { "name": "buffer_val", "type": "AnyTensorOrNone" }, { "name": "buffer_idx", "type": "AnyTensorOrNone" }, { "name": "buffer_scatter_idx", "type": "AnyTensorOrNone" }, { "name": "buffer_seq_idx", "type": "AnyTensorOrNone" } ], "results": [ { "name": "values", "type": "AnyTensorOrNone" }, { "name": "indices", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "K", "type": "I64Attr" }, { "name": "largest", "type": "DefaultValuedAttr" }, { "name": "sorted", "type": "DefaultValuedAttr" }, { "name": "values_used_only", "type": "DefaultValuedAttr" }, { "name": "replace_topk_indices", "type": "DefaultValuedAttr" }, { "name": "use_hau", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Trilu", "summary": "Trilu operation", "description": "1.Op Introduction\n Returns the upper or lower triangular part of input.\n\n 2.Math formula\n ```math\n output = Triu(input, diagonal) if upper = 1\n output = Tril(input, diagonal) if upper = 0\n ```\n where, Triu() return the upper triangular part of the input tensor.\n Tril() return the lower triangular part of the input tensor.\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n upper: whether to extract the upper or lower triangular part of the input tensor.;\n diagonal: 0 refers to the main diagonal, positive values indicate diagonals above the main diagonal,\n and negative values indicate diagonals below the main diagonal.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "upper", "type": "SI32Attr" }, { "name": "diagonal", "type": "SI32Attr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Unsqueeze", "summary": "Onnx-Style Unsqueeze operator", "description": "1.Op Introduction\n Unsqueeze Operation on input.\n\n 2.Math formula\n ```math\n output = unsqueeze(input, axes)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n axes: the dimensions (axes) of the input tensor that should be squeezed (removed).;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "TypedArrayAttrBase" } ] }, { "name": "tpu.Upsample", "summary": "Upsample operation", "description": "1.Op Introduction\n Perform nearest upsample on input.\n\n 2.Math formula\n ```math\n output[i, j] = Upsample(input[i / scale_h, j / scale_w])\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n scale_h: the scaling factor for the height (number of rows) of the input tensor.;\n scale_w: the scaling factor for the width (number of columns) of the input tensor.;\n do_relu: If set true, the output will be activated via the ReLU function after the calculation is complete.;\n relu_limit: If set -1.0, it means that there is no upper limit and the output will only be affected by the ReLU function.;\n ginfo: associated with layer grouping information.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale_h", "type": "I64Attr" }, { "name": "scale_w", "type": "I64Attr" }, { "name": "do_relu", "type": "DefaultValuedAttr" }, { "name": "relu_limit", "type": "DefaultValuedAttr" }, { "name": "ginfo", "type": "OptionalAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Weight2Activation", "summary": "Weight to activation operator", "description": "1.Op Introduction\n Convert weight tensor to activation tensor\n\n 2.Math formula\n ```math\n \\text{output}[i] = \\text{input}[i] \\quad \\forall i\n ```\n\n 3.activation and weight\n input(act.): input tensor.;", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ] }, { "name": "tpu.WeightReorder", "summary": "WeightReorder operator", "description": "1.Op Introduction\n reorder Weight.\n\n 2.Math formula\n ```math\n output = Reorder(input, reorder_mode)\n ```\n\n 3.activation and weight\n input(act.): input tensor.;\n\n 4.attributes\n reorder_mode: rearranging the weight tensor, such as sorting, shuffling, or applying a specific permutation.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "reorder_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Where", "summary": "Where operator", "description": "1.Op Introduction\n Return elements, either from X or Y, depending on condition.\n\n 2.Math formula\n ```math\n output = tbrn if condition else fbrn\n ```\n\n 3.activation and weight\n cond(act.): a tensor that serves as the condition for selecting elements from the true branch (tbrn) or the false branch (fbrn).;\n tbrn(w.): the tensor that will be selected when the condition is true.;\n fbrn(w.): the tensor that will be selected when the condition is false.;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n x_is_const: the tensor for the true branch (tbrn) is a constant.;\n y_is_const: the tensor for the false branch (fbrn) is a constant.;\n x_const_val: the constant value to be used for the true branch if tbrn is not provided or is constant.;\n y_const_val: the constant value to be used for the false branch if fbrn is not provided or is constant.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "cond", "type": "AnyRankedTensor" }, { "name": "tbrn", "type": "AnyTensorOrNone" }, { "name": "fbrn", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "x_is_const", "type": "DefaultValuedAttr" }, { "name": "y_is_const", "type": "DefaultValuedAttr" }, { "name": "x_const_val", "type": "DefaultValuedAttr" }, { "name": "y_const_val", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" }, { "name": "do_core_parallel", "type": "OptionalAttr" } ] }, { "name": "tpu.WhereBnbwdOp", "summary": "WhereBnbwd operation", "description": "1.Op Introduction\n Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs\n with additional channel dimension) as described in the paper\n Batch Normalization: Accelerating Deep Network Training by Reducing\n Internal Covariate Shift `__ .\n\n 2.Math formula\n ```math\n output = \\frac{input - \\mathrm{E}[input]}{ \\sqrt{\\mathrm{Var}[input] + \\epsilon}} * \\gamma + \\beta\n ```\n The mean and standard-deviation are calculated per-dimension over\n the mini-batches and $$\\gamma$$ and $$\\beta$$ are learnable parameter vectors\n of size C (where C is the input channel size).\n\n 3.activation and weight\n where_output(act.): an optional intermediate output from a \"where\" operation applied during the forward pass.;\n where_grad_out(act.): the gradients computed with respect to the \"where\" output.;\n bnbwd_input(act.): the primary input to the batch normalization backward operation.;\n bnbwd_weight(w.): re-scale the normalized input.;\n bnbwd_bias(w.): re-centering the normalized values.;\n bnbwd_saved_mean(w.): the per-dimension mean values computed during the forward pass.;\n bnbwd_saved_invstd(w.): stores the inverse standard deviation computed during the forward pass.;\n buffer(w.): serve as a temporary storage or workspace that may be used during the computation of gradients.;\n\n 4.attributes\n epsilon:;\n do_recompute: whether recomputed during the backward pass instead of being stored from the forward pass.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "where_output", "type": "AnyTensorOrNone" }, { "name": "where_grad_out", "type": "AnyTensor" }, { "name": "bnbwd_input", "type": "AnyTensor" }, { "name": "bnbwd_weight", "type": "AnyTensorOrNone" }, { "name": "bnbwd_bias", "type": "AnyTensorOrNone" }, { "name": "bnbwd_saved_mean", "type": "AnyTensorOrNone" }, { "name": "bnbwd_saved_invstd", "type": "AnyTensorOrNone" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "grad_in", "type": "AnyTensor" }, { "name": "weight_grad", "type": "AnyTensorOrNone" }, { "name": "bias_grad", "type": "AnyTensorOrNone" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "do_recompute", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Yield", "summary": "Yield values to parent operation", "description": "1.Op Introduction\n yields values to its parent operation.\n\n 2.Math formula\n output_i = input_i i = 1, 2, ..., N\n\n 3.activation and weight\n operands(act.): a variadic number of input tensors.;", "operands": [ { "name": "operands", "type": "Variadic" } ] }, { "name": "tpu.YoloDetection", "summary": "YoloDetection operator", "description": "1.Op Introduction\n Perform yolo detection on feature map.\n\n 2.Math formula\n ```math\n 1.Feature Map output\n raw_predictions = {(b_i, c_i, p_i) | i = 1, 2,...,N}\n b_i is the bounding box coordinates, c_i is the i-th class score, p_i is the i-th obj score.\n 2.Apply Objectness Threshold\n filtered_predictions = {(b_i, c_i, p_i) | p_i >= obj_threshold}\n 3.Non-Maximum Suppression(NMS)\n nms_output = NMS(filtered_predictions, nms_threshold)\n 4.Top K Detections\n output = top_k(nms_output, keep_topk)\n ```\n\n 3.activation and weight\n inputs(act.): input tensor;\n buffer(w.): temporary storage of intermediate results or states during the LSTM computation.;\n\n 4.attributes\n net_input_h: The height of the input image.;\n net_input_w: The width of the input image;\n nms_threshold: The threshold used for Non-Maximum Suppression (NMS).;\n obj_threshold: The minimum confidence score required for an object detection to be considered valid.;\n keep_topk: The maximum number of detections to keep after applying NMS.;\n anchors: A list of anchor box dimensions.;\n version: The version of the YOLO model being used.;\n class_num: The number of classes that the YOLO model can predict.;\n num_boxes: The number of bounding boxes that the model predicts for each grid cell in the feature map.;\n agnostic_nms: whether to use class-agnostic NMS.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "buffer", "type": "AnyTensorOrNone" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "net_input_h", "type": "I64Attr" }, { "name": "net_input_w", "type": "I64Attr" }, { "name": "nms_threshold", "type": "F64Attr" }, { "name": "obj_threshold", "type": "F64Attr" }, { "name": "keep_topk", "type": "I64Attr" }, { "name": "anchors", "type": "TypedArrayAttrBase" }, { "name": "version", "type": "YoloVersionAttr" }, { "name": "class_num", "type": "DefaultValuedAttr" }, { "name": "num_boxes", "type": "DefaultValuedAttr" }, { "name": "agnostic_nms", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "tpu.Yuv2rgbFormula", "summary": "Yuv2rgbFormulaOp operator", "description": "1.Op Introduction\n Yuv2rgbFormulaOp operator.\n\n 2.Math formula\n ```math\n (R) = (Y + 1.402 x (V - 128))\n (G) = (Y - 0.344136 x (U - 128) - 0.714136 x (V - 128))\n (B) = (Y + 1.772 x (U - 128))\n\n ```\n\n 3.activation and weight\n YUV(act.): input tensor.;\n\n 4.attributes\n src_format: the source format of the input YUV data.;\n dst_format: the desired destination format for the output RGB data.;\n image_format: how the YUV data should be processed and how the output RGB data should be structured.;\n formula_mode: the mode of the conversion formula used for the YUV to RGB transformation. ;\n round_mode: how values are rounded during the conversion from higher precision to lower precision.;\n multicore: whether op supports multicore execution.;", "operands": [ { "name": "YUV", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "src_format", "type": "UI32Attr" }, { "name": "dst_format", "type": "UI32Attr" }, { "name": "image_format", "type": "Tpu_ImageOutFormatAttr{FLOAT32|UINT8}" }, { "name": "formula_mode", "type": "Tpu_Yuv2rgbFormulaAttr{_601_limited|_601_full}" }, { "name": "round_mode", "type": "DefaultValuedAttr" }, { "name": "multicore", "type": "OptionalAttr" } ] }, { "name": "transform.affine.simplify_bounded_affine_ops", "description": "Simplify the targeted affine.min / affine.max ops given the supplied\n lower and upper bounds for values that may be used as target op operands.\n\n Example:\n ```\n %0 = transform.structured.match ops{[\"affine.min\", \"affine.max\"]} in %arg1\n %1 = transform.structured.match ops{[\"gpu.lane_id\"]} in %arg1\n transform.affine.simplify_bounded_affine_ops %0 with [%1] within [0] and [32]\n\n // Multiple bounds can be specified.\n transform.affine.simplify_bounded_affine_ops %0 with [%1, %2] within [0, 5] and [32, 50]\n ```\n\n Bounded op handles (`%1` and `%2) must be mapped to ops that have a single\n result of index type. The sets of target ops and bounded ops must not\n overlap.\n\n #### Return modes\n\n Target ops must be affine.min or affine.max ops. This transform consumes the\n target handle and does not produce any handle. It reads the bounded op\n handles.\n\n TODO: Support affine.apply targets.\n TODO: Allow mixed PDL_Operation/int64_t for lower_bounds and upper_bounds.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "bounded_values", "type": "Variadic" } ], "attributes": [ { "name": "lower_bounds", "type": "DenseI64ArrayAttr" }, { "name": "upper_bounds", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$target `with` `[` ($bounded_values^ `:` type($bounded_values))? `]`\n `within` $lower_bounds `and` $upper_bounds attr-dict\n `:` type($target)" }, { "name": "transform.affine.simplify_min_max_affine_ops", "description": "Simplify the targeted `affine.min` / `affine.max` ops using the\n `mlir::affine::simplifyAffineMinMaxOps` transform.\n\n Example:\n ```\n %0 = transform.structured.match ops{[\"affine.max\"]} in %arg1\n transform.affine.simplify_min_max_affine_ops %0 : !transform.any_op\n ```\n\n #### Return modes\n\n This transform consumes the target handle and does not produce any results.\n This transforms definitely fails if any of the targeted operations is not an\n `affine.min` or `affine.max` operation, or if the canonicalization patterns\n failed to converge.\n This transform silently fails if none of the operations were simplified.\n Otherwise, it succeeds.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.affine.super_vectorize", "description": "Vectorize to a target independent n-D vector abstraction.\n This operation is an exposition to the transform dialect of the affine-super-vectorize pass.\n To make its usage easier, it ignores inputs which are children of an affine.for op (itself excluded),\n this way the matcher can be simpler.\n\n This operation may generate operations from the vector dialect.\n\n Example:\n ```\n %0 = transform.structured.match ops{[\"affine.for\"]} in %arg1 : (!transform.any_op) -> !transform.any_op\n transform.affine.super_vectorize %0 [8, 16] fastest_varying_pattern=[1,0] vectorize_reductions=true : !transform.any_op\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "vector_sizes", "type": "DenseI64ArrayAttr" }, { "name": "fastest_varying_pattern", "type": "OptionalAttr" }, { "name": "vectorize_reductions", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target $vector_sizes\n (`fastest_varying_pattern` `=` $fastest_varying_pattern^)? \n (`vectorize_reductions` `=` $vectorize_reductions^)? \n attr-dict `:` type($target)" }, { "name": "transform.alternatives", "summary": "Attempts sequences of transforms until one succeeds", "description": "This op may have an arbitrary number of regions, each of which represents a\n sequence of transform operations to be applied to the same payload IR. The\n regions are visited in order of appearance, and transforms in them are\n applied in their respective order of appearance. If one of these transforms\n fails to apply, the remaining ops in the same region are skipped an the next\n region is attempted. If all transformations in a region succeed, the\n remaining regions are skipped and the entire \"alternatives\" transformation\n succeeds. If all regions contained a failing transformation, the entire\n \"alternatives\" transformation fails.\n\n It is up to the nested operations to define which errors are \"recoverable\"\n (or \"silenceable\") and allow another alternatives to be attempted, and which\n errors should be propagated without attempting the other alternatives.\n\n The single operand of this operation is the scope in which the alternative\n transformation sequences are attempted, that is, an operation in the payload\n IR that contains all the other operations that may be modified by the\n transformations. The scope operation must be isolated from above. There is\n no check that the transforms are indeed scoped as their \"apply\" methods can\n be arbitrarily complex. Therefore it is the responsibility of the user to\n ensure that the transforms are scoped correctly, or to produce an\n irrecoverable error and thus abort the execution without attempting the\n remaining alternatives. Note that the payload IR outside of the given scope\n is not necessarily in the valid state, or even accessible to the\n transformation.\n\n The changes to the IR within the scope performed by transforms in the failed\n alternative region are reverted before attempting the next region.\n Practically, this is achieved by cloning the scope. Therefore it is advised\n to limit the scope as much as possible and place the most likely\n alternatives early in the region list. The operation is also isolated from\n above and requires rediscovering the operations within the given scope to\n avoid additional handle invalidation. The latter restriction may be lifted\n in the future.\n\n Each of the regions may yield transform IR handles. The handles of the first\n successful alternative region are returned as the results of the\n \"alternatives\" op. Therefore, each alternative region must yield the same\n number of results, which should also match the number and the types of the\n \"alternatives\" op results.\n\n Remark: this op allows one to implement a simple \"try\" construct as follows:\n\n ```mlir\n %result = transform.alternatives %scope {\n ^bb0(%arg0: !transform.any_op):\n // Try a fallible transformation.\n %0 = transform.fallible %arg0 // ...\n // If succeeded, yield the the result of the transformation.\n transform.yield %0 : !transform.any_op\n }, {\n ^bb0(%arg0: !transform.any_op):\n // Otherwise, the second alternative is tried and it always succeeds by\n // returning the original handle.\n transform.yield %arg0 : !transform.any_op\n }\n ```", "operands": [ { "name": "scope", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "alternatives", "type": "VariadicRegion>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "($scope^ `:` type($scope))? (`->` type($results)^)? attr-dict-with-keyword regions" }, { "name": "transform.annotate", "summary": "Annotates the target operation with an attribute by name", "description": "Adds an attribute with the given `name` to the `target` operation. An\n optional `param` handle can be provided to give the attribute a specific\n value, else a UnitAttr is added. A single attribute will be broadcasted to\n all target operations, otherwise the attributes will be mapped 1:1 based on\n the order within the handles.\n\n Produces a silenceable failure if the length of the parameter payload does\n not match the length of the target payload. Does not consume the provided\n handles.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "param", "type": "Optional" } ], "attributes": [ { "name": "name", "type": "StrAttr" } ], "assemblyFormat": "$target $name attr-dict (`=` $param^)?`:` type($target) (`,` type($param)^)?" }, { "name": "transform.apply_conversion_patterns", "summary": "Applies conversion patterns to the body of the targeted op", "description": "This transform applies the specified conversion patterns to the targeted op\n and all nested ops. By default, this transform applies a \"full\" dialect\n conversion. If the `partial_conversion` unit attribute is present, this\n transform applies a partial dialect conversion.\n\n The patterns that should be applied are specified in the first graph region\n of this op. They must implement the\n `ConversionPatternDescriptorOpInterface`. The order in which patterns are\n applied is unspecified; i.e., the ordering of ops in the region of this op\n is irrelevant.\n\n The second, optional graph region contains exactly one op that specifies\n default type converter that should be used with this dialect conversion. If\n provided, this op must implement the `TypeConverterBuilderOpInterface`.\n Type converters are a property of conversion patterns: each conversion\n pattern stores the type converter that should be used in its C++ class. Each\n conversion pattern descriptor can optionally specify a type converter in its\n `getTypeConverter` interface method. If no type converter is specified in\n this method, the default type converter of the dialect conversion is used.\n Default type converters are useful if the same type converter should be used\n for multiple sets of conversion patterns. (Patterns that should not use this\n default type converter specify their own type converter.)\n\n The `legal_ops`, `illegal_ops`, `legal_dialects`, `illegal_dialects`\n attributes specify the conversion target.\n\n This transform modifies the payload. By default, it consumes the `target`\n handle. It does not produce any handles.\n\n If the `preserve_handles` attribute is set, this transform does not consume\n the `target` handle and instead updates handles based on notifications from\n a tracking listener that is attached to the dialect conversion, similar to\n `transform.apply_patterns`. Only replacements via `RewriterBase::replaceOp`\n or `replaceOpWithNewOp` are considered \"payload op replacements\". In\n contrast to `transform.apply_patterns`, we allow replacement ops even if the\n op name has changed. This is because conversion patterns are expected to\n lower ops to different ops (from a different dialect). More details can be\n found at the documentation site of `TrackingListener`.\n\n This transform produces a silenceable failure if the dialect conversion was\n unsuccessful or the tracking listener failed to find a replacement op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "legal_ops", "type": "OptionalAttr>" }, { "name": "illegal_ops", "type": "OptionalAttr>" }, { "name": "legal_dialects", "type": "OptionalAttr>" }, { "name": "illegal_dialects", "type": "OptionalAttr>" }, { "name": "partial_conversion", "type": "UnitAttr" }, { "name": "preserve_handles", "type": "UnitAttr" } ], "regions": [ { "name": "patterns", "type": "MaxSizedRegion<1>" }, { "name": "default_type_converter_region", "type": "VariadicRegion>" } ], "assemblyFormat": "`to` $target $patterns\n (`with` `type_converter` $default_type_converter_region^)?\n attr-dict `:` type($target)" }, { "name": "transform.apply_conversion_patterns.dialect_to_llvm", "description": "Collects patterns that convert ops from the specified dialect to LLVM\n dialect ops. These patterns require an \"LLVMTypeConverter\".\n\n Note: Only dialects that implement the `ConvertToLLVMPatternInterface` are\n supported. Any conversion target modifications by interface implementations\n are currently ignored. The conversion target is fully specified by the\n enclosing \"apply_conversion_patterns\" op.", "attributes": [ { "name": "dialect_name", "type": "StrAttr" } ], "assemblyFormat": "$dialect_name attr-dict" }, { "name": "transform.apply_conversion_patterns.func.func_to_llvm", "description": "Collects patterns that convert Func dialect ops to LLVM dialect ops.\n These patterns require an \"LLVMTypeConverter\".", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.gpu.gpu_subgroup_reduce_to_nvvm", "description": "Collects patterns that convert GPU dialect ops related to wmma ops\n to NVVM dialect ops.\n These patterns require an \"LLVMTypeConverter\".", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.gpu.gpu_to_nvvm", "description": "Collects patterns that convert GPU dialect ops to NVVM dialect ops. These\n patterns require an \"LLVMTypeConverter\".", "attributes": [ { "name": "benefit", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.gpu.gpu_to_rocdl", "description": "Collects patterns that convert GPU dialect ops to ROCDL dialect ops. These\n patterns require an \"LLVMTypeConverter\".", "attributes": [ { "name": "chipset", "type": "StrAttr" } ], "assemblyFormat": "`chipset` `=` $chipset attr-dict" }, { "name": "transform.apply_conversion_patterns.gpu.gpu_wmma_to_nvvm", "description": "Collects patterns that convert GPU dialect ops related to wmma ops\n to NVVM dialect ops.\n These patterns require an \"LLVMTypeConverter\".", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.memref.memref_to_llvm_type_converter", "description": "This operation provides an \"LLVMTypeConverter\" that lowers memref types to\n LLVM types.\n\n The type converter can be customized as follows:\n - `use_aligned_alloc`: Use aligned_alloc in place of malloc for heap\n allocations.\n - `index_bitwidth`: Bitwidth of the index type, \"0\" indicates the size of a\n machine word.\n - `use_generic_functions`: Use generic allocation and deallocation functions\n instead of the classic \"malloc\", \"aligned_alloc\" and \"free\" functions.\n // TODO: the following two options don't really make sense for \n // memref_to_llvm_type_converter specifically.\n // We should have a single to_llvm_type_converter.\n - `use_bare_ptr_call_conv`: Replace FuncOp's MemRef arguments with bare \n pointers to the MemRef element types.\n - `data-layout`: String description (LLVM format) of the data layout that is\n expected on the produced module.", "attributes": [ { "name": "use_aligned_alloc", "type": "DefaultValuedOptionalAttr" }, { "name": "index_bitwidth", "type": "DefaultValuedOptionalAttr" }, { "name": "use_generic_functions", "type": "DefaultValuedOptionalAttr" }, { "name": "use_bare_ptr_call_conv", "type": "DefaultValuedOptionalAttr" }, { "name": "data_layout", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.nvgpu.nvgpu_to_nvvm", "description": "Collects patterns that convert NVGPU dialect ops to NVVM dialect ops. These\n patterns require an \"LLVMTypeConverter\".", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.scf.scf_to_control_flow", "description": "Collects patterns that lower structured control flow ops to unstructured\n control flow.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.scf.structural_conversions", "description": "Collects patterns for performing structural conversions of SCF operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.transform.test_conversion_patterns", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.transform.test_type_converter", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_conversion_patterns.vector.vector_to_llvm", "description": "Collects patterns that convert vector dialect ops to LLVM dialect ops. These\n patterns require an \"LLVMTypeConverter\".\n\n The patterns can be customized as follows:\n - `reassociate_fp_reductions`: Allows LLVM to reassociate floating-point\n reductions for speed.\n - `force_32bit_vector_indices`: Allows the compiler to assume that vector\n indices fit in 32-bit if that yields faster code.", "attributes": [ { "name": "reassociate_fp_reductions", "type": "DefaultValuedAttr" }, { "name": "force_32bit_vector_indices", "type": "DefaultValuedAttr" }, { "name": "use_vector_alignment", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_cse", "summary": "Eliminate common subexpressions in the body of the target op", "description": "This transform applies common subexpression elimination (CSE) to the body\n of the targeted op.\n\n This transform reads the target handle and modifies the payload. Existing\n handles to operations inside of the targeted op are retained and updated if\n necessary. Note that this can lead to situations where a handle, that was\n previously mapped to multiple distinct (but equivalent) operations, is now\n mapped to the same operation multiple times.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "`to` $target attr-dict `:` type($target)" }, { "name": "transform.apply_dce", "summary": "Eliminate dead operations in the body of the target op", "description": "This transform applies dead code elimination (DCE) to the body of the\n targeted op.\n\n Note: \"transform.apply_patterns\" with an empty region can also be used to\n remove dead ops. However, that op applies additional simplifications such as\n op folding and region simplification.\n\n This transform reads the target handle and modifies the payload. Note that\n this transform may silently remove payload ops from handles.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "`to` $target attr-dict `:` type($target)" }, { "name": "transform.apply_licm", "summary": "Move loop-invariant code out of a loop-like op", "description": "This transform moves side-effect free, loop invariant code out of the\n targeted loop-like op. The targeted op must implement the\n `LoopLikeOpInterface`.\n\n Note: To move invariant ops from a loop nest, this transform must be applied\n to each loop of the loop nest, starting with the inner-most loop.\n\n This transform reads the target handle and modifies the payload.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "`to` $target attr-dict `:` type($target)" }, { "name": "transform.apply_patterns", "summary": "Greedily applies patterns to the body of the targeted op", "description": "This transform greedily applies the specified patterns to the body of the\n targeted op until a fixpoint was reached. Patterns are not applied to the\n targeted op itself.\n\n The patterns that should be applied are specified in the graph region of\n this op. They must implement the `PatternDescriptorOpInterface`. The order\n in which patterns are applied is unspecified; i.e., the ordering of ops in\n the region of this op is irrelevant.\n\n If `apple_cse` is set, the greedy pattern rewrite is interleaved with\n common subexpression elimination (CSE): both are repeated until a fixpoint\n is reached.\n\n This transform only reads the target handle and modifies the payload. If a\n pattern erases or replaces a tracked op, the mapping is updated accordingly.\n\n Only replacements via `RewriterBase::replaceOp` or `replaceOpWithNewOp` are\n considered \"payload op replacements\". Furthermore, only if the replacement\n values are defined by the same op and that op has the same type as the\n original op, the mapping is updated. Otherwise, this transform produces a\n silenceable failure. More details can be found at the documentation site of\n `TrackingListener`.\n\n This transform also produces a silenceable failure if the pattern\n application did not converge within the default number of\n iterations/rewrites of the greedy pattern rewrite driver.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "apply_cse", "type": "UnitAttr" }, { "name": "max_iterations", "type": "DefaultValuedAttr(-1)>" }, { "name": "max_num_rewrites", "type": "DefaultValuedAttr(-1)>" } ], "regions": [ { "name": "patterns", "type": "MaxSizedRegion<1>" } ], "assemblyFormat": "`to` $target $patterns attr-dict `:` type($target)" }, { "name": "transform.apply_patterns.arm_neon.vector_contract_to_bfmmla", "description": "Indicates that vector contract operations should be lowered to\n to ArmNeon dialect operations mapping to instructions from FEAT_BF16.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.arm_neon.vector_contract_to_i8mm", "description": "Indicates that vector contract operations should be lowered to\n to ArmNeon dialect operations mapping to instructions from FEAT_I8MM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.arm_sve.vector_contract_to_bfmmla", "description": "Indicates that vector contract operations should be lowered to\n ArmSVE dialect operations mapping to instructions from FEAT_BF16.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.arm_sve.vector_contract_to_i8mm", "description": "Indicates that vector contract operations should be lowered to\n to ArmSVE dialect operations mapping to instructions from FEAT_I8MM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.canonicalization", "summary": "Populates canonicalization patterns", "description": "This op populates all canonicalization patterns of all loaded dialects in\n an `apply_patterns` transform.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.gpu.eliminate_barriers", "description": "Removes unnecessary GPU barriers from the function. If a barrier does not\n enforce any conflicting pair of memory effects, including a pair that is\n enforced by another barrier, it is unnecessary and can be removed.\n\n The approach is based on \"High-Performance GPU-to-CPU Transpilation and\n Optimization via High-Level Parallel Constructs\" by Moses, Ivanov,\n Domke, Endo, Doerfert, and Zinenko in PPoPP 2023. Specifically, it\n analyzes the memory effects of the operations before and after the given\n barrier and checks if the barrier enforces any of the memory\n effect-induced dependencies that aren't already enforced by another\n barrier.\n\n For example, in the following code\n\n ```mlir\n store %A\n barrier // enforces load-after-store\n load %A\n barrier // load-after-store already enforced by the previous barrier\n load %A\n ```\n\n the second barrier can be removed.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.gpu.gpu_rewrite_patterns", "description": "Collects GPU rewrite patterns comprising:\n 1. GpuAllReduceRewrite patterns\n 2. GpuGlobalIdRewriter patterns\n 3. GpuShuffleRewriter patterns", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.gpu.gpu_shuffle_to_amdgpu", "description": "Collects patterns that are tryin to promote `gpu.shuffle`s to specialized\n AMDGPU intrinsics.", "attributes": [ { "name": "chipset", "type": "OptionalAttr" } ], "assemblyFormat": "(`chipset` `=` $chipset^)? attr-dict" }, { "name": "transform.apply_patterns.gpu.unroll_vectors_subgroup_mma", "description": "Unrolls contractions to the target `m`, `n`, and `k` native vector size,\n along with other vector operations based on expected usage. `transfer_read`\n ops unroll based on the extract slice shape introduced by unrolling the\n contractions, while elementwise and `transfer_write` ops unroll to the shape of\n the C matrix (`m x n`).\n\n This operation applies to pure vector operations and should be applied before\n lowering to subgroup_mma ops.", "attributes": [ { "name": "m", "type": "I64Attr" }, { "name": "n", "type": "I64Attr" }, { "name": "k", "type": "I64Attr" } ], "assemblyFormat": "`[` $m `,` $n `,` $k `]` attr-dict" }, { "name": "transform.apply_patterns.iree.bubble_collapse", "description": "Populate patterns to fold an expanding tensor.expand_shape operation with\n its producer generic operation by collapsing the dimensions of the generic\n op.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.bubble_expand", "description": "Populate patterns to fold an expanding (collapsing) tensor_reshape\n operation with its producer (consumer) generic operation by expanding\n the dimensionality of the loop in the generic op.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.bubble_pack_unpack", "description": "Populate patterns to bubble up or down data layout ops across other\n operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.collapse_forall_dest", "description": "Populate patterns to collapse the destination of scf.forall ops by hoisting\n expand_shape ops out of the parallel_insert_slice.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.drop_inner_tiled_unit_dims", "description": "Populate patterns to drop the unit dims from inner_tiled ops with\n only unit iteration bounds.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.fold_fill_into_pad", "description": "Populates a pattern that folds\n \"tensor.pad(cst, tensor.extract*(linalg.fill(cst)))\" into\n \"linalg.fill(cst, empty)\" when the padding constant and the fill constant\n are the same.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.fold_reshape_into_tensor_hal_interface", "description": "Populate patterns that fold tensor.expand_shape/tensor.collapse_shape into\n the source hal.interface.binding.subspan op.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.fold_tensor_slice_into_transfer", "description": "Indicates that tensor.extract_slice -> vector.transfer_read and\n vector.transfer_write -> tensor.insert_slice op chains should be folded into\n vector transfer read and write ops", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.hoist_forall_from_for", "description": "Hoists perfectly nested `scf.forall` ops from parent `scf.for` ops if\n the slice the forall loop operates on is loop invariant w.r.t. the for loop.\n\n This pattern only applies to forall ops that yield tensors. For bufferized\n loops the parallel loop is always trivially hoistable with a barrier and\n happens automatically when lowering the `scf.forall`.\n\n Currently only supports a single result tensor.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.linalg_elementwise_greedy_fusion", "description": "Populate patterns to fuse `linalg.generic` -> `linalg.generic` operations\n when both operations are fusable elementwise operations.\n\n Note: This pattern set is parameterized for usage in IREE, therefore\n it is called \"iree.linalg_elementwise_greedy_fusion\".", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.lower_barrier_region", "description": "Populate patterns that lowers iree_gpu.barrier_region ops to allocations\n and copies.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.lower_inner_tiled", "description": "Populate patterns to lowering inner_tiled ops to the intrinsic specified by\n the |kind| attribute.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.lower_value_barrier", "description": "Populate patterns to convert value barriers on vectors into gpu.barrier ops.\n Barriers on tensors are ignored.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.prepare_vector_to_mma", "description": "Populate patterns that transform vector ops into a canonical form to\n convert to MMA matrix operations. If `useNvGpu` is true, then the patterns\n will populated will prepare for conversion to `nvgpu` mma operations\n rather than the `gpu` dialect WMMA operations.", "attributes": [ { "name": "useNvGpu", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.unroll_multi_mma", "description": "Populate patterns to unroll iree_gpu.multi_mma ops to a single intrinsic.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.unroll_vectors_gpu_mma_sync", "description": "Populate patterns that unroll vectors. TODO: better documentation.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.unroll_vectors_gpu_wmma_sync", "description": "Populate patterns that unroll vectors. TODO: better documentation.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.iree.vectorize_iree_gpu", "description": "Populate patterns to vectorize various iree_gpu ops. Expected to run\n before or as a part of a larger vectorization pass.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.kernel.affine_bounds_optimization", "description": "Apply simplification patterns for `arith` and `affine.apply|min|max`\n based on constraint information derived from\n `ValueBoundsConstraintSet`/`ValueBoundsOpInterface`.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.kernel.interchange_for_and_forall", "description": "Includes patterns to interchange `scf.for` and `scf.forall` so that\n the `scf.forall` is outer-most. This is possible if the `scf.forall`\n effectively implements a subset insertion/extraction on the `scf.for`\n iteration arguments. In that case, we can hoist the `scf.forall` up\n without changing the semantics of the program.\n\n Finds instances of the following pattern:\n\n ```\n %result = for ... iter_args(%iter = $init) {\n %update = forall ... outs(%out = %iter) {\n %0 = extract_slice %out[%o][%s][1]\n ...\n %tile = ...\n parallel_insert_slice %tile into %out[%o][%s][1]\n }\n yield %update\n }\n ```\n\n And produces:\n\n ```\n %result = forall ... outs(%out = %init) {\n %0 = extract_slice %out[%o][%s][1]\n %1 = for ... iter_args(%iter = $0) {\n ...\n %tile = ...\n yield %tile\n }\n parallel_insert_slice %1 into %out[%o][%s][1]\n }\n ```", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.data_layout_propagation", "description": "Collection of patterns to bubble up or down data layout ops across other\n operations.", "attributes": [ { "name": "poison_padding", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.decompose_pack_unpack", "description": "Collect patterns to decompose linalg.pack and linalg.unpack into e.g.\n tensor::PadOp, linalg::transposeOp Ops. Requires all outer dims to be unit.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.decompose_pad", "description": "Collect patterns to decompose tensor.pad into e.g. tensor::EmptyOp,\n linalg::FillOp and tensor::InsertSliceOp.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.erase_unnecessary_inputs", "description": "Collects patterns that promote inputs to outputs and remove unused inputs of\n `linalg.generic` ops.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.extract_slice_sinking", "description": "Patterns to sink extract slice across other operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.fold_add_into_dest", "description": "Collects patterns to replace linalg.add when destination passing suffices\n for achieving the sum.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.fold_pack_unpack_into_empty", "description": "// TODO:", "attributes": [ { "name": "fold_single_use_only", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.fold_unit_extent_dims_via_reshapes", "description": "Collects patterns to fold unit-extent dimensions in operands/results of\n linalg ops on tensors via reassociative reshape ops.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.fold_unit_extent_dims_via_slices", "description": "Collects patterns to fold unit-extent dimensions in operands/results of\n linalg ops on tensors via rank-reducing slices.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.pad_vectorization", "description": "Apply patterns that vectorize tensor.pad.\n\n These patterns rewrite tensor.pad Ops using vector.transfer_read and\n vector.transfer_write operations. This is done either by:\n 1. Folding tensor.pad with an existing vector.transfer_read /\n vector.transfer_write Op (generated prior to running these patterns). \n 2. Rewriting it (when matched together with q tensor.insert_slice\n consumer Op) as a vector.transfer_read + vector.transfer_write pair.\n\n In both cases, these patterns look at producers and consumers for the\n matched tensor.pad Op to find opportunities for vectorization.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.linalg.tiling_canonicalization", "description": "Collects canonicalization patterns relevant to apply after tiling patterns.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.memref.alloc_to_alloca", "description": "Collects patterns to rewrite scoped dynamic allocation (`alloc`/`dealloc`\n pairs) into automatic allocation (`alloca`) in the same scope, for memrefs\n of static shape.\n\n The `size_limit` attribute controls the maximum allocated memory (in bytes,\n subject to data layout) for which the pattern applies.", "attributes": [ { "name": "size_limit", "type": "OptionalAttr" } ], "assemblyFormat": "(`size_limit` `(` $size_limit^ `)`)? attr-dict" }, { "name": "transform.apply_patterns.memref.expand_ops", "description": "Collects patterns to rewrite ops within the memref dialect.\n\n - Converts `atomic_rmw` that cannot be lowered to a simple atomic op with\n AtomicRMWOpLowering pattern, e.g. with \"minf\" or \"maxf\" attributes, to\n `memref.generic_atomic_rmw` with the expanded code.\n - Converts `memref.reshape` that has a target shape of a statically-known\n size to `memref.reinterpret_cast`.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.memref.expand_strided_metadata", "description": "Collects patterns for expanding memref operations that modify the metadata\n (sizes, offset, strides) of a memref into easier to analyze constructs.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.memref.extract_address_computations", "description": "Collects patterns for extracting address computations from operations\n with memory accesses such that these memory accesses use only a base\n pointer.\n\n For instance,\n ```mlir\n memref.load %base[%off0, ...]\n ```\n\n Will be rewritten in:\n ```mlir\n %new_base = memref.subview %base[%off0,...][1,...][1,...]\n memref.load %new_base[%c0,...]\n ```", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.memref.fold_memref_alias_ops", "description": "Collects patterns for folding memref aliasing ops (memref.subview) into\n consumer load/store ops (affine.load, memref.load, nvgpu.ldmatrix,\n vector.load, vector.transfer_read, affine.store, memref.store, etc.) and\n other ops (e.g., memref.subview).", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.memref.resolve_ranked_shaped_type_result_dims", "description": "Collects patterns that resolve `memref.dim` operations with values that are\n defined by operations that implement the `ReifyRankedShapedTypeOpInterface`,\n in terms of shapes of its input operands.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.scf.for_loop_canonicalization", "description": "Collects patterns for canonicalizing operations inside SCF loop bodies.\n At the moment, only affine.min/max computations with iteration variables,\n loop bounds and loop steps are canonicalized.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.bubble_up_extract_slice", "description": "Indicates that producers of tensor.extract_slice should swap and operate on \n the result of the slice.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.decompose_concat", "description": "Indicates that tensor.concat ops should be decomposed into a chain of\n tensor.insert_slice operations inserting into a materialized destination.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.drop_redundant_insert_slice_rank_expansion", "description": "Indicates that redundant tensor.insert_slice rank reductions should be\n dropped. E.g., cases where a tensor.extract_slice rank reduction immediately\n follows an inverse tensor.insert_slice rank expansion.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.fold_into_pack_and_unpack", "description": "Indicates that operations like tensor.pad and tensor.extract_slice should\n be folded into linalg.pack and linalg.unpack operations, respectively.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.fold_tensor_empty", "description": "Indicates that tensor.extract_slice and reassociative reshapes should be\n folded into tensor.empty.\n\n If `fold_single_use_only` is set to \"true\", only tensor.empty that have a\n single use are folded.", "attributes": [ { "name": "fold_single_use_only", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.fold_tensor_subset_ops", "description": "Indicates that tensor.empty should be folded with tensor.extract_slice,\n tensor.expand_shape and tensor.collapse_shape.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.fold_tensor_subset_ops_into_vector_transfers", "description": "Indicates that tensor.extract_slice -> vector.transfer_read and\n vector.transfer_write -> tensor.insert_slice op chains should be folded into\n vector tranfer read and write ops", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.merge_consecutive_insert_extract_slice", "description": "Indicates that consecutive tensor.extract_slice/tensor.insert_slice ops\n should be merged into a single op. These patterns are not canonicalizations\n because the bufferization is sensitive to IR structure.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.reassociative_reshape_folding", "description": "Indicates that reassociative reshapes (tensor.collapse_shape /\n tensor.expand_shape) should be folded with inverse rank expansions / rank\n reductions (via tensor.insert_slice / tensor.extract_slice).", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.tensor.rewrite_as_constant", "description": "Indicates that tensor ops (such as tensor.generate) should be replaced with\n constants (arith.constant) when possible.", "attributes": [ { "name": "aggressive", "type": "UnitAttr" } ], "assemblyFormat": "(`aggressive` $aggressive^)? attr-dict" }, { "name": "transform.apply_patterns.transform.test_patterns", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.cast_away_vector_leading_one_dim", "description": "Collect a set of leading one dimension removal patterns.\n\n These patterns insert vector.shape_cast to remove leading one dimensions\n to expose more canonical forms of read/write/insert/extract operations.\n With them, there are more chances that we can cancel out extract-insert\n pairs or forward write-read pairs.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.drop_inner_most_unit_dims_from_xfer_ops", "description": "Apply vector patterns to drop the inner most unit dims from\n vector.transfer_read and vector.transfer_write Ops by taking a subview (via\n memref.subview) of the original source/destination MemRef. Since it\n requires the input/ouptu to be MemRefs, this Op is only helpful\n past-bufferization.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.drop_unit_dims_with_shape_cast", "description": "Apply vector patterns to fold unit dims with vector.shape_cast Ops:\n - DropUnitDimFromElementwiseOps\n - DropUnitDimsFromScfForOp\n - DropUnitDimsFromTransposeOp\n\n Excludes patterns for vector.transfer Ops. This is complemented by\n shape_cast folding patterns.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.elementwise_to_vector", "description": "Collect a set of patterns that fold elementwise op on vectors to the vector\n dialect.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.flatten_vector_transfer_ops", "description": "Collect patterns to rewrite contiguous row-major vector.transfer_read or \n vector.transfer_write operations to a 1D operation.", "attributes": [ { "name": "target_vector_bitwidth", "type": "DefaultValuedAttr::max()>" } ], "assemblyFormat": "(`target_vector_bitwidth` `=` $target_vector_bitwidth^)? attr-dict" }, { "name": "transform.apply_patterns.vector.fold_arith_extension", "description": "Collect a set of patterns that fold arithmetic extension on floating point\n into vector contract for the backends with native support.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.interleave_and_deinterleave_to_shuffle", "description": "Indicates that 1D vector interleave and deinterleave operations should be\n rewritten as vector shuffle operations.\n\n This is motivated by some current codegen backends not handling vector\n interleave and deinterleave operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.interleave_to_shuffle", "description": "Indicates that 1D vector interleave operations should be rewritten as\n vector shuffle operations.\n\n This is motivated by some current codegen backends not handling vector\n interleave operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_bitcast", "description": "Indicates that vector bitcast operations should be lowered to\n finer-grained vector primitives.\n\n This is usally a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_broadcast", "description": "Indicates that vector broadcast operations should be lowered to\n finer-grained vector primitives.\n\n This is usally a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_contraction", "description": "Indicates that vector contraction-like operations should be lowered to\n finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`lowering_strategy` `=` $lowering_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.lower_create_mask", "description": "Indicates that vector create_mask-like operations should be lowered to\n finer-grained vector primitives.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_gather", "description": "Indicates that vector.gather operations should be lowered to\n finer-grained vector primitives.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_interleave", "description": "Indicates that vector interleave operations should be lowered to\n finer-grained vector primitives.\n\n This is usally a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_masked_transfers", "description": "Apply opt-in patterns that lower vector.mask operations surrounding\n side-effecting ops:\n - MaskedTransferReadOpPattern\n - MaskedTransferWriteOpPattern\n - MaskedGatherOpPattern\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_masks", "description": "Indicates that vector.create_mask and vector.constant_mask operations\n should be lowered to finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_multi_reduction", "description": "Indicates that vector multi_reduction-like operations should be lowered to\n finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`lowering_strategy` `=` $lowering_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.lower_outerproduct", "description": "Indicates that the vector outerproduct operations should be lowered to\n finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_scan", "description": "Indicates that vector.scan operations should be lowered to\n finer-grained vector primitives.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_shape_cast", "description": "Indicates that vector shape_cast operations should be lowered to\n finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.lower_step", "description": "Indicates that vector.step operations should be lowered to finer-grained\n vector primitives.\n\n `index_bitwidth` is the bitwidth used to materialize `index`-typed steps; a\n bitwidth of 0 leaves them untouched (e.g. to defer to a later, target-aware\n lowering). It must not exceed the index storage bitwidth. Integer-typed\n steps are unaffected by this option.", "attributes": [ { "name": "index_bitwidth", "type": "I64Attr" } ], "assemblyFormat": "`index_bitwidth` `=` $index_bitwidth attr-dict" }, { "name": "transform.apply_patterns.vector.lower_transfer", "description": "Indicates that vector transfer operations should be lowered to finer-grained\n vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "attributes": [ { "name": "max_transfer_rank", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`max_transfer_rank` `=` $max_transfer_rank^)? attr-dict" }, { "name": "transform.apply_patterns.vector.lower_transpose", "description": "Indicates that vector transpose-like operations should be lowered to\n finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" }, { "name": "avx2_lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "oilist (\n `lowering_strategy` `=` $lowering_strategy\n | `avx2_lowering_strategy` `=` $avx2_lowering_strategy\n )\n attr-dict" }, { "name": "transform.apply_patterns.vector.materialize_masks", "description": "Indicates that mask operations should be lowered to fine-grained arithemtic\n operations.\n\n This is usually the last step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.multi_reduction_flattening", "description": "Indicates that vector multi_reduction operations should be flattened from\n more than 2-D to 2-D.", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`lowering_strategy` `=` $lowering_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.multi_reduction_unrolling", "description": "Indicates that vector multi_reduction operations should be unrolled.\n 1-D multi_reductions are converted directly to vector.reduction.\n 2-D multi_reductions are unrolled into either a sequence of\n vector.reduction ops (innerreduction) or element-wise arith ops\n (innerparallel).\n\n This populates the patterns from\n `populateVectorMultiReductionUnrollingPatterns`, i.e.:\n * `OneDimMultiReductionToReduction`\n * `TwoDimMultiReductionToReduction` (innerreduction)\n * `TwoDimMultiReductionToElementWise` (innerparallel)", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`lowering_strategy` `=` $lowering_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.rank_reducing_subview_patterns", "description": "Apply opt-in vector transfer permutation patterns that include:\n - TransferReadDropUnitDimsPattern\n - TransferWriteDropUnitDimsPattern\n\n These patterns have the effect of rewriting a vector.transfer with unit\n dimensions into a rank-reduced version thanks to subview operations.\n This is complemented by shape_cast folding patterns.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.reduction_to_contract", "description": "Apply opt-in patterns that convert reductions to contract:\n - MultiReduceToContract\n - CombineContractBroadcast\n - CombineContractABTranspose\n - CombineContractResultTranspose\n - ReorderElementwiseOpsOnTranspose\n - ReorderElementwiseOpsOnBroadcast\n - ReorderCastOpsOnBroadcast\n\n These patterns have the effect of rewriting a vector.multi_reduce into a\n vector.contract.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.reorder_and_expand_multi_reduction_dims", "description": "Indicates that vector multi_reduction-like operations should be\n transformed such that all reduction dimensions become innermost or\n outermost, and 1-D reductions are lifted to 2-D.\n\n This populates the patterns from\n `populateVectorMultiReductionReorderAndExpandPatterns`, i.e.:\n * `InnerOuterDimReductionConversion`\n * `OneDimMultiReductionToTwoDim`", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`lowering_strategy` `=` $lowering_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.reorder_multi_reduction_dims", "description": "Indicates that vector multi_reduction-like operations should be\n transformed such that all reduction dimensions become innermost or\n outermost, depending on `lowering_strategy`.\n\n This populates the patterns from\n `populateVectorMultiReductionReorderPatterns`, i.e.:\n * `InnerOuterDimReductionConversion`", "attributes": [ { "name": "lowering_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`lowering_strategy` `=` $lowering_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.rewrite_narrow_types", "description": "Indicates that vector narrow rewrite operations should be applied.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.\n\n Warning: these patterns currently only work for little endian targets.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.rewrite_vector_transfer_read_to_constant", "description": "Includes a vector simplification pattern in the set. The pattern\n detects when a `vector.transfer_read` is reading from the result of\n a `vector.transfer_write` which has an overwrite/fill-like effect.\n\n Such `vector.transfer_reads` are then replaced with `arith.constant`\n with a splat constant value.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.sink_mem_ops", "description": "Patterns that replace redundant Vector Ops (followed by\n `vector.load`/`vector.store`) with either vector.load/vector.store or\n `memref.load`/`memref.store`. Currently limited to 1-element vectors.\n\n Example:\n ```\n vector.load %arg0[%arg1] : memref, vector<4xf32>\n vector.extract %0[1] : f32 from vector<4xf32>\n ```\n Gets converted to:\n ```\n %c1 = arith.constant 1 : index\n %0 = arith.addi %arg1, %c1 overflow : index\n %1 = memref.load %arg0[%0] : memref\n ```", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.sink_ops", "description": "Patterns that remove redundant Vector Ops by re-ordering them with\n e.g. elementwise Ops.\n\n Example:\n ```\n %at = vector.transpose %a, [1, 0]: vector<4x2xf32> to vector<2x4xf32>\n %bt = vector.transpose %b, [1, 0]: vector<4x2xf32> to vector<2x4xf32>\n %r = arith.addf %at, %bt : vector<2x4xf32>\n ```\n gets converted to:\n ```\n %0 = arith.addf %a, %b : vector<4x2xf32>\n %r = vector.transpose %0, [1, 0] : vector<2x4xf32>\n ```\n At the moment, these patterns are limited to vector.broadcast,\n vector.transpose and vector.extract.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.split_transfer_full_partial", "description": "Indicates that vector transfer operations should be split to full and\n partial parts.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "attributes": [ { "name": "split_transfer_strategy", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`split_transfer_strategy` `=` $split_transfer_strategy^)? attr-dict" }, { "name": "transform.apply_patterns.vector.transfer_permutation_patterns", "description": "Apply opt-in vector transfer permutation patterns that include:\n - TransferReadPermutationLowering\n - TransferWritePermutationLowering\n - TransferOpReduceRank\n - TransferWriteNonPermutationLowering\n\n These patterns have the effect of rewriting a vector.transfer with an\n arbitrary permutation_map to a vector.transfer with a permutation_map that\n is a minor identity followed by a vector.transpose.\n\n In other words, this makes the vector.transfer contiguous on the most minor\n dimensions and materializes the permutation_map as a vector.transpose.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.transfer_to_scf", "description": "Indicates that vector transfer operations should be rewritten with scf.for\n loops over finer-grained vector primitives.\n\n This is usually a late step that is run after bufferization as part of the\n process of lowering to e.g. LLVM or NVVM.", "attributes": [ { "name": "max_transfer_rank", "type": "DefaultValuedAttr" }, { "name": "full_unroll", "type": "DefaultValuedAttr" } ], "assemblyFormat": "oilist (\n `max_transfer_rank` `=` $max_transfer_rank\n | `full_unroll` `=` $full_unroll\n )\n attr-dict" }, { "name": "transform.apply_patterns.vector.unroll_from_elements", "description": "Indicates that vector from_elements operations should be unrolled\n along the outermost dimension.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.vector.unroll_to_elements", "description": "Indicates that vector to_elements operations should be unrolled\n along the outermost dimension.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86.shuffle_vector_fma_ops", "description": "Collect patterns to shuffle FMAs with x86 operations as operands \n such that FMAs are grouped with respect to odd/even packed index.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86.sink_vector_producer_ops", "description": "Collect patterns to sink vector producer operations forward in a block to \n place them immediately before their first use.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86.vector_contract_bf16_to_fma", "description": "Collect patterns to lower a BF16 type vector.contract operation\n to a FMA via emulation lowering using BF16 packed operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86.vector_contract_to_amx_dot_product", "description": "Collect patterns to lower a BF16/Int8 type vector.contract operation \n\tto a BF16/Int8 AMX tiled dot-product.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86.vector_contract_to_fma", "description": "Collect patterns to lower a F32 type vector.contract operation to a FMA.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86.vector_contract_to_packed_type_dot_product", "description": "Collect patterns to lower a BF16/Int8 type vector.contract operation \n\tto a BF16/Int8 dot-product.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86vector.shuffle_vector_fma_ops", "description": "Collect patterns to shuffle FMAs with x86vector operations as operands \n such that FMAs are grouped with respect to odd/even packed index.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86vector.sink_vector_producer_ops", "description": "Collect patterns to sink vector producer operations forward in a block to \n place them immediately before their first use.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86vector.vector_contract_bf16_to_fma", "description": "Collect patterns to lower a BF16 type vector.contract operation\n to a FMA via emulation lowering using BF16 packed operations.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86vector.vector_contract_to_fma", "description": "Collect patterns to lower a F32 type vector.contract operation to a FMA.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_patterns.x86vector.vector_contract_to_packed_type_dot_product", "description": "Collect patterns to lower a BF16/Int8 type vector.contract operation \n\tto a BF16/Int8 dot-product.", "assemblyFormat": "attr-dict" }, { "name": "transform.apply_registered_pass", "summary": "Applies the specified registered pass or pass pipeline", "description": "This transform applies the specified pass or pass pipeline to the targeted\n ops. The name of the pass/pipeline is specified as a string attribute, as\n set during pass/pipeline registration.\n\n Optionally, pass options may be specified via a DictionaryAttr. This\n dictionary is converted to a string -- formatted `key=value ...` -- which\n is expected to be in the exact format used by the pass on the commandline.\n Values are either attributes or (SSA-values of) Transform Dialect params.\n For example:\n\n ```mlir\n transform.apply_registered_pass \"canonicalize\"\n with options = { \"top-down\" = false,\n \"max-iterations\" = %max_iter,\n \"test-convergence\" = true,\n \"max-num-rewrites\" = %max_rewrites }\n to %module\n : (!transform.any_param, !transform.any_param, !transform.any_op) -> !transform.any_op\n ```\n\n Options' values which are `ArrayAttr`s are converted to comma-separated\n lists of options. Likewise for params which associate multiple values.\n\n This op first looks for a pass pipeline with the specified name. If no such\n pipeline exists, it looks for a pass with the specified name. If no such\n pass exists either, this op fails definitely.\n\n This transform consumes the target handle and produces a new handle that is\n mapped to the same op. Passes are not allowed to remove/modify the operation\n that they operate on, so the target op is guaranteed to still exist. The\n target handle is invalidated because a pass may arbitrarily modify the body\n of targeted ops.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "dynamic_options", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "pass_name", "type": "StrAttr" }, { "name": "options", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$pass_name (`with` `options` `=`\n custom($options, $dynamic_options)^)?\n `to` $target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.bufferization.buffer_loop_hoisting", "description": "Hoist buffer allocations (\"memref.alloc\" and \"memref.alloca\") from loops\n within the targeted op. This transform assumes that there are no buffer\n deallocation ops in the IR.\n\n This transform reads the `target` handle and modifies the payload.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.bufferization.eliminate_empty_tensors", "description": "Try to eliminate all `tensor.empty` ops within the targeted op by replacing\n them with another destination tensor.\n\n \"tensor.empty\" ops cannot be bufferized. They can either be converted to\n \"bufferization.alloc_tensor\" or replaced with another tensor (via this\n transform). \"tensor.empty\" does not specify the contents of the returned\n tensor so their results can be replaced with arbitrary tensor values as long\n as the dimensions match.\n\n This transformation looks for subset ops that insert a tensor that\n originates from a \"tensor.empty\" (as per the reverse use-def chain). Such\n \"tensor.empty\" ops are replaced with the destination subset.\n\n Example:\n\n ```\n %0 = tensor.empty() : tensor<5xf32>\n %1 = linalg.fill ... outs(%0)\n %2 = tensor.insert_slice %1 into %t[1][5][1]\n ```\n\n Is rewritten with:\n ```\n %0 = tensor.extract_slice %t[1][5][1]\n %1 = linalg.fill ... outs(%0)\n %2 = tensor.insert_slice %1 into %t[1][5][1]\n ```\n\n In the above example, the subset op is \"tensor.insert_slice\". When tracing\n back the reverse use-def chain of a the source, we end up at a\n \"tensor.empty\" op.\n\n The above example can bufferize without an allocation (in the absence of\n other conflicts) because there is no longer a `tensor.empty` op.\n\n See `-eliminate-empty-tensors` for more details.\n\n #### Return modes\n\n This transform reads the target handle and modifies the payload. It does\n not produce any handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.bufferization.empty_tensor_to_alloc_tensor", "description": "Replace a tensor.empty with a bufferization.tensor_alloc.\n\n #### Return modes\n\n This operation consumes the `target` handle and produces the `transformed`\n handle. `target` is expected to be a `tensor.empty` operation. The transform\n always succeeds.", "operands": [ { "name": "target", "type": "Transform_EmptyOp" } ], "results": [ { "name": "transformed", "type": "Transform_AllocTensorOp" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.bufferization.one_shot_bufferize", "description": "Indicates that the given `target` op should be bufferized with One-Shot\n Bufferize. The bufferization can be configured with various attributes that\n corresponding to options in `BufferizationOptions` and the\n `one-shot-bufferize` pass. More information can be found in the pass\n documentation.\n\n The targeted ops must be modules or functions. This is because there is\n always a single, bufferized replacement op for such targets.\n\n Note: Only ops that implement `BufferizableOpInterface` are bufferized. All\n other ops are ignored if `allow_unknown_ops`. If `allow_unknown_ops` is\n unset, this transform fails when an unknown/non-bufferizable op is found.\n Many ops implement `BufferizableOpInterface` via an external model. These\n external models must be registered when applying this transform op;\n otherwise, said ops would be considered non-bufferizable.\n\n #### Return modes\n\n This operation consumes the `target` handle and produces the `transformed`\n handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "function_boundary_type_conversion", "type": "OptionalAttr" }, { "name": "allow_return_allocs_from_loops", "type": "DefaultValuedAttr" }, { "name": "allow_unknown_ops", "type": "DefaultValuedAttr" }, { "name": "bufferize_function_boundaries", "type": "DefaultValuedAttr" }, { "name": "dump_alias_sets", "type": "DefaultValuedAttr" }, { "name": "test_analysis_only", "type": "DefaultValuedAttr" }, { "name": "print_conflicts", "type": "DefaultValuedAttr" }, { "name": "check_parallel_regions", "type": "DefaultValuedAttr" }, { "name": "memcpy_op", "type": "DefaultValuedAttr" } ], "assemblyFormat": "(`layout` `{` $function_boundary_type_conversion^ `}`)?\n $target attr-dict `:` functional-type($target, results)" }, { "name": "transform.cast", "operands": [ { "name": "input", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "output", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$input attr-dict `:` type($input) `to` type($output)" }, { "name": "transform.collect_matching", "summary": "Collects all payload ops that match the given named matcher", "description": "Collects operations or other payload IR objects nested under `root`\n (inclusive) that match the given matcher expressed as a named sequence. The\n matcher sequence must accept exactly one argument that it is not allowed to\n modify. It must yield as many values as this op has results. Each of the\n yielded values must be associated with exactly one payload object. If any\n operation in the matcher sequence produces a silenceable failure, the\n matcher advances to the next payload operation in the walk order without\n finishing the sequence.\n\n The i-th result of this operation is constructed by concatenating the i-th\n yielded payload IR objects of all successful matcher sequence applications.\n All results are guaranteed to be mapped to the same number of payload IR\n objects.\n\n The operation succeeds unless the matcher sequence produced a definite\n failure for any invocation.", "operands": [ { "name": "root", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "matcher", "type": "SymbolRefAttr" } ], "assemblyFormat": "$matcher `in` $root attr-dict `:` functional-type($root, $results)" }, { "name": "transform.debug.emit_param_as_remark", "summary": "Prints the parameter as a diagnostic remark", "description": "This operation emits a diagnostic remark containing the string form of the\n attributes associated with the parameter provided as attribute. It takes\n as optional arguments:\n - an additional message text to prepend;\n - a handle pointing to operations the location of which will be used to\n emit the diagnostic; if multiple operations are associated, the\n diagnostic is emitted for all of their respective locations.\n\n This operation always succeeds.", "operands": [ { "name": "param", "type": "TransformParamTypeInterface" }, { "name": "anchor", "type": "Optional" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "assemblyFormat": "$param (`,` $message^)? (`at` $anchor^)?attr-dict `:` type($param) (`,` type($anchor)^)?" }, { "name": "transform.debug.emit_remark_at", "summary": "Print a message as diagnostic remark attached to payload", "description": "This operation emits a diagnostic remark with the given message at the\n location of each payload object associated with the argument. The argument\n may be an operation or a value handle.\n\n This operation always succeeds.", "operands": [ { "name": "at", "type": "Transform_AnyHandleType" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$at `,` $message attr-dict `:` type($at)" }, { "name": "transform.dlti.query", "summary": "Return attribute (as param) associated to key via DTLI", "description": "This op queries data layout and target information associated to payload\n IR by way of the DLTI dialect.\n\n A lookup is performed for the given `keys` at `target` op - or its closest\n interface-implementing ancestor - by way of the `DLTIQueryInterface`, which\n returns an attribute for a key. Each key should be either a (quoted) string\n or a type. If more than one key is provided, the lookup continues\n recursively, now on the returned attributes, with the condition that these\n implement the above interface. For example if the payload IR is\n\n ```\n module attributes {#dlti.map = #dlti.map<#dlti.dl_entry<\"A\",\n #dlti.map<#dlti.dl_entry<\"B\", 42: int>>>} {\n func.func private @f()\n }\n ```\n and we have that `%func` is a Tranform handle to op `@f`, then\n `transform.dlti.query [\"A\", \"B\"] at %func` returns 42 as a param and\n `transform.dlti.query [\"A\"] at %func` returns the `#dlti.map` attribute\n containing just the key \"B\" and its value. Using `[\"B\"]` or `[\"A\",\"C\"]` as\n `keys` will yield an error.\n\n #### Return modes\n\n When successful, the result, `associated_attr`, associates one attribute as\n a param for each op in `target`'s payload.\n\n If the lookup fails - as no DLTI attributes/interfaces are found or entries\n with the right names are missing - a silenceable failure is returned.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "associated_attr", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "keys", "type": "ArrayAttr" } ], "assemblyFormat": "$keys `at` $target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.foreach", "summary": "Executes the body for each element of the payload", "description": "Execute the op's body - its single region block - exactly once per\n element of the payload associated to a target handle. The body's\n transformations are applied in order of appearance until reaching the\n (implicit) YieldOp terminator.\n\n Each iteration gets executed by co-indexing the payloads of the arguments\n and mapping the body's arguments to these tuples, as though iterating over\n the zipped together `targets`. As such, in each iteration, the size of the\n payload of each of the body's block arguments is exactly one. The attribute\n `zip_shortest` can be used if the targets vary in their number of payloads;\n this will limit the iterations to only the number of payloads found in the\n shortest target.\n\n This op always reads the target handles. Furthermore, it consumes a handle\n if there is a transform op in the body that consumes the corresponding\n block argument. Handles can point to ops, values, or parameters.\n\n #### Return Modes\n\n This op produces as many result handles as the body's terminating YieldOp\n has operands. For each result, the payloads of the corresponding YieldOp\n operand are merged and mapped to the same resulting handle.\n\n If the target handles do not associate payloads of the same size, a\n silencable failure will be generated.\n\n During application, if any transformation in the sequence fails, the entire\n sequence fails immediately with the same failure, leaving the payload IR in\n a potentially invalid state, i.e., this operation offers no transformation\n rollback capabilities.", "operands": [ { "name": "targets", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "with_zip_shortest", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "defaultDialect": "transform", "assemblyFormat": "$targets oilist(`with_zip_shortest` $with_zip_shortest) `:` type($targets) (`->` type($results)^)? $body attr-dict" }, { "name": "transform.foreach_match", "summary": "Applies named sequences when a named matcher succeeds", "description": "Given a pair of co-indexed lists of transform dialect symbols (such as\n `transform.named_sequence`), walks the payload IR associated with the root\n handle and interprets the symbols as matcher/action pairs by applying the\n body of the corresponding symbol definition. The symbol from the first list\n is the matcher part: if it results in a silenceable error, the error is\n silenced and the next matcher is attempted. Definite failures from any\n matcher stop the application immediately and are propagated unconditionally.\n If none of the matchers succeeds, the next payload operation in walk order\n (post-order at the moment of writing, double check `Operation::walk`) is\n matched. If a matcher succeeds, the co-indexed action symbol is applied and\n the following matchers are not applied to the same payload operation. If the\n action succeeds, the next payload operation in walk order is matched. If it\n fails, both silenceable and definite errors are propagated as the result of\n this op; propagation of silenceable errors is postponed until the end of the\n walk.\n\n The matcher symbol must take at least one operand of a type that implements\n the same transform dialect interface as the `root` operand (a check is\n performed at application time to see if the associated payload satisfies the\n constraints of the actual type), and may take additional operands with a\n similar type requirement. It must not consume operands as multiple matchers\n may be applied. The matcher may produce any number of results. The action\n symbol paired with the matcher must take the same number of arguments as the\n matcher has results, and these arguments must implement the same transform\n dialect interfaces, but not necessarily have the exact same type (again, a\n check is performed at application time to see if the associated payload\n satisfies the constraints of actual types on both sides).\n\n The action symbol may have results that are accumulated from all actions and\n returned from the `foreach_match` operation on success. Unless the\n `flatten_results` attribute is present, each action result must be\n associated with exactly one payload entity. The actions are expected to only\n modify payload operations nested in the `root` payload operations associated\n with the operand of this transform operation. Furthermore, the actions may\n not modify operations outside of the currently matched payload operation,\n e.g., they may not modify sibling or parent operations. If such behavior is\n desired, the parent must be matched first and the nested operations obtained\n by traversing the IR from the parent. This is due to the matching being\n performed as a post-order IR walk.\n\n This operation consumes the operand and produces a new handle associated\n with the same payload. This is necessary to trigger invalidation of handles\n to any of the payload operations nested in the payload operations associated\n with the operand, as those are likely to be modified by actions.\n\n By default, the root payload operation associated with the operand is not\n matched. This is to support the conservative case where applied actions may\n invalidate the root payload operation. If the optional `restrict_root`\n attribute is set, the root operand is guaranteed to not be invalidated by any\n of the applied actions. In such cases, the root payload operation is also\n matched. This is useful because matching the root payload operation is a\n common idiom, when e.g. matching a func.func directly and operations nested\n under it.\n\n The operation succeeds if none of the matchers produced a definite failure\n during application and if all of the applied actions produced success. Note\n that it also succeeds if all the matchers failed on all payload operations,\n i.e. failure to apply is not an error. The operation produces a silenceable\n failure if any applied action produced a silenceable failure. In this case,\n the resulting handle is associated with an empty payload. The operation\n produces a definite failure if any of the applied matchers or actions\n produced a definite failure.", "operands": [ { "name": "root", "type": "TransformHandleTypeInterface" }, { "name": "forwarded_inputs", "type": "Variadic" } ], "results": [ { "name": "updated", "type": "TransformHandleTypeInterface" }, { "name": "forwarded_outputs", "type": "Variadic" } ], "attributes": [ { "name": "restrict_root", "type": "UnitAttr" }, { "name": "flatten_results", "type": "UnitAttr" }, { "name": "matchers", "type": "TypedArrayAttrBase" }, { "name": "actions", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "oilist( `restrict_root` $restrict_root\n | `flatten_results` $flatten_results\n )\n `in`\n $root (`,` $forwarded_inputs^)?\n custom($matchers, $actions)\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.func.cast_and_call", "summary": "Casts values to the signature of a function and replaces them with a call", "description": "This transform takes value handles to a set of `inputs` and `outputs` and\n attempts to cast them to the function signature of the attached function\n op, then builds a call to the function and replaces the users of the\n outputs. It is the responsibility of the user to ensure that the slice of\n the program replaced by this operation makes sense, i.e. there is no\n verification that the inputs to this operation have any relation to the\n outputs outside of basic dominance requirements needed for the call.\n\n The casting materialization functions are specified in the graph region of\n this op. They must implement the `TypeConverterBuilderOpInterface`. The\n order of ops within the region is irrelevant.\n\n The target function can be specified by a symbol name or by a handle to the\n operation.\n\n This transform only reads the operand handles and only replaces the users of\n the outputs with the results of the call. No handles are consumed and no\n operations are removed. Users are expected to run cleanup separately if\n desired.\n\n Warning: The replacement of the uses of the outputs could invalidate certain\n restricted value handle types (e.g. `transform.block_arg` if it existed, by\n replacing the use with something not coming from a block argument). The\n value will still exist in such cases but wouldn't verify against the type.\n See the discussion here for more information:\n https://github.com/llvm/llvm-project/pull/78398#discussion_r1455070087\n\n This transform will emit a silenceable failure if:\n - The set of outputs isn't unique\n - The handle for the insertion point does not include exactly one operation\n - The insertion point op does not dominate any of the output users\n - The insertion point op is not dominated by any of the inputs\n - The function signature does not match the number of inputs/outputs\n\n This transform will emit a definite failure if it fails to resolve the\n target function, or if it fails to materialize the conversion casts of\n either the inputs to the function argument types, or the call results to\n the output types.", "operands": [ { "name": "insertion_point", "type": "TransformHandleTypeInterface" }, { "name": "inputs", "type": "Optional" }, { "name": "outputs", "type": "Optional" }, { "name": "function", "type": "Optional" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "insert_after", "type": "UnitAttr" }, { "name": "function_name", "type": "OptionalAttr" } ], "regions": [ { "name": "conversions", "type": "MaxSizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "($function_name^)? ($function^)?\n ( `(` $inputs^ `)` )?\n ( `->` $outputs^ )?\n (`after` $insert_after^):(`before`)? $insertion_point\n ($conversions^)? attr-dict `:` functional-type(operands, results)" }, { "name": "transform.func.deduplicate_func_args", "description": "This transform takes a module and a function name, and deduplicates\n the arguments of the function. The function is expected to be defined in\n the module.\n\n This transform will emit a silenceable failure if:\n - The function with the given name does not exist in the module.\n - The function does not have duplicate arguments.\n - The function does not have a single call.", "operands": [ { "name": "module", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed_module", "type": "TransformHandleTypeInterface" }, { "name": "transformed_function", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "function_name", "type": "SymbolRefAttr" } ], "assemblyFormat": "$function_name\n `at` $module attr-dict `:` functional-type(operands, results)" }, { "name": "transform.func.replace_func_signature", "description": "This transform takes a module and a function name, and replaces the\n signature of the function by reordering the arguments and results\n according to the interchange arrays. The function is expected to be\n defined in the module, and the interchange arrays must match the number\n of arguments and results of the function.\n\n The `adjust_func_calls` attribute indicates whether the function calls\n should be adjusted to match the new signature. If set to `true`, the\n function calls will be adjusted to match the new signature, otherwise\n they will not be adjusted.\n\n This transform will emit a silenceable failure if:\n - The function with the given name does not exist in the module.\n - The interchange arrays do not match the number of arguments/results.\n - The interchange arrays contain out of bound indices.", "operands": [ { "name": "module", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed_module", "type": "TransformHandleTypeInterface" }, { "name": "transformed_function", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "function_name", "type": "SymbolRefAttr" }, { "name": "args_interchange", "type": "DenseI32ArrayAttr" }, { "name": "results_interchange", "type": "DenseI32ArrayAttr" }, { "name": "adjust_func_calls", "type": "UnitAttr" } ], "assemblyFormat": "$function_name\n `args_interchange` `=` $args_interchange\n `results_interchange` `=` $results_interchange\n `at` $module attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_consumers_of_result", "summary": "Get handle to the consumers of this operation's result number", "description": "The handle defined by this Transform op corresponds to all operations that\n consume the SSA value defined by the `target` and `result_number`\n arguments.\n This operation applies to a single payload operation, otherwise it produces\n a definite failure.\n The return handle points to the consuming operations operations, which can\n be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "consumers", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "result_number", "type": "I64Attr" } ], "assemblyFormat": "$target `[` $result_number `]` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_defining_op", "summary": "Get handle to the defining op of a value", "description": "The handle defined by this Transform op corresponds to the defining op of\n the targeted value.\n\n This transform produces a silenceable failure if the targeted value is a\n block argument.", "operands": [ { "name": "target", "type": "TransformValueHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_operand", "summary": "Get a handle to the operand(s) of the targeted op", "description": "The handle defined by this Transform op corresponds to the operands of the\n given `target` operation specified by the given set of positions. There are\n three possible modes:\n\n - Position list directly, i.e. `%target[0, 1, 2]`. This will return the\n operands at the specified positions.\n - Inverted position list, i.e. `%target[except(0, 1, 2)]`. This will return\n all operands except those at the given positions.\n - All, i.e. `%target[all]`. This will return all operands of the operation.\n \n This transform produces a silenceable failure if any of the operand indices\n exceeds the number of operands in the target. It reads the target handle and\n produces the result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "raw_position_list", "type": "DenseI64ArrayAttr" }, { "name": "is_inverted", "type": "UnitAttr" }, { "name": "is_all", "type": "UnitAttr" } ], "assemblyFormat": "$target `[`custom($raw_position_list, $is_inverted, $is_all)`]` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_parent_op", "summary": "Gets handles to the closest parent ops", "description": "The handle defined by this Transform op corresponds to the parents of the\n targeted payload ops (in the same order).\n\n Requirements that parent ops must fulfill can be optionally specified. In\n that case for each target op, the closest parent op that fulfills all\n requirements, is returned.\n - `isolated_from_above`: the parent op must be isolated from above\n - `allow_empty_results`: get_parent_op is allowed to return an empty list\n and still succeeds. In such a case, if `get_parent_op` fails for any\n operation in the list, the entire transform returns an empty handle.\n - `op_name`: the parent op must have the specified name\n - `nth_parent`: get the n-th parent of that satisfies the above requirements\n\n If `deduplicate` is set, the result handle does not contain any duplicate\n ops. For example, given the list\n \"(childof(A), childof(B), childof(B), childof(A), childof(B))\", the\n resulting list will be just \"(A, B)\". Note that no other semantic ordering\n is applied, e.g., \"B\" may itself be a parent of \"A\". This may have an impact\n on the further transformation applied to the handle produced here.\n\n If any of the given Payload IR ops has no such suitable parent, then:\n - if `allow_empty_results` is set, the result handle is empty\n - otherwise, the transformation produces a silenceable failure.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "parent", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "isolated_from_above", "type": "UnitAttr" }, { "name": "allow_empty_results", "type": "UnitAttr" }, { "name": "op_name", "type": "OptionalAttr" }, { "name": "deduplicate", "type": "UnitAttr" }, { "name": "nth_parent", "type": "DefaultValuedAttr, 1>" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_producer_of_operand", "summary": "Get handle to the producer of this operation's operand number", "description": "The handle defined by this Transform op corresponds to operation that\n produces the SSA value defined by the `target` and `operand_number`\n arguments. If the origin of the SSA value is not an operations (i.e. it is\n a block argument), the transform produces a silenceable failure.\n The return handle points to only the subset of successfully produced\n computational operations, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "producer", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "operand_number", "type": "I64Attr" } ], "assemblyFormat": "$target `[` $operand_number `]` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_result", "summary": "Get a handle to the result(s) of the targeted op", "description": "The handle defined by this Transform op correspond to the OpResults of the\n given `target` operation. Optionally `result_number` can be specified to\n select a specific result.\n \n This transform fails silently if the targeted operation does not have enough\n results. It reads the target handle and produces the result handle.\n\n The handle defined by this Transform op corresponds to the results of the\n given `target` operation specified by the given set of positions. There are\n three possible modes:\n\n - Position list directly, i.e. `%target[0, 1, 2]`. This will return the\n results at the specified positions.\n - Inverted position list, i.e. `%target[except(0, 1, 2)]`. This will return\n all results except those at the given positions.\n - All, i.e. `%target[all]`. This will return all results of the operation.\n \n This transform produces a silenceable failure if any of the result indices\n exceeds the number of results returned by the target. It reads the target\n handle and produces the result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "raw_position_list", "type": "DenseI64ArrayAttr" }, { "name": "is_inverted", "type": "UnitAttr" }, { "name": "is_all", "type": "UnitAttr" } ], "assemblyFormat": "$target `[`custom($raw_position_list, $is_inverted, $is_all)`]` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.get_type", "summary": "Get a parameter containing the type of the given value", "description": "This operation creates a new Transform parameter containing the\n type(s) of the value(s) associated with the operand handle.\n\n This transform never fails.", "operands": [ { "name": "value", "type": "TransformValueHandleTypeInterface" } ], "results": [ { "name": "type_param", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "elemental", "type": "UnitAttr" } ], "assemblyFormat": "(`elemental` $elemental^)? $value attr-dict `:`functional-type(operands, results)" }, { "name": "transform.gpu.map_forall_to_blocks", "description": "Target the gpu_launch op and rewrite the top level `scf.forall`\n to distributed gpu.block_id attribute. If `generate_gpu_launch` attribute\n is set, then first generates `gpu_launch` and moves the top level\n `scf.forall` inside.\n\n The operation searches top level `scf.forall` ops under\n `gpu_launch` and maps each such op to GPU blocks. Mapping is\n one-to-one and the induction variables of `scf.forall` are\n rewritten to gpu.block_id according to the `thread_dim_mapping` attribute.\n\n Dynamic, `scf.forall` trip counts are currently not supported.\n Dynamic block dim sizes are currently not supported.\n\n Only **bufferized** scf.forall are currently supported.\n Only scf.forall distributed to **at most 3 dimensions** are\n currently supported.\n\n The operation alters the block size of the given gpu_launch using the\n grid_dims argument.\n\n #### Return modes:\n\n This operation ignores non-gpu_launch ops and drops them in the return.\n\n If any scf.forall with tensors is found, the transform definitely\n fails.\n\n If all the `scf.forall` operations contained within the LaunchOp\n referred to by the `target` handle lower to GPU properly, the\n transform succeeds. Otherwise the transform definitely fails.\n\n The returned handle points to the same LaunchOp operand, consuming it and\n producing a new SSA value to satisfy chaining and linearity of the IR\n properties.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "grid_dims", "type": "DefaultValuedOptionalAttr" }, { "name": "generate_gpu_launch", "type": "UnitAttr" } ], "assemblyFormat": "$target\n (`generate_gpu_launch` $generate_gpu_launch^)?\n (`grid_dims` `=` $grid_dims^)?\n attr-dict\n `:` functional-type($target, $result)" }, { "name": "transform.gpu.map_nested_forall_to_threads", "description": "Target the `gpu.launch op` and rewrite all `scf.forall` nested in it to\n distributed `gpu.thread_id` attribute.\n\n The operation searches for `scf.forall` ops nested under `target` and maps\n each such op to GPU threads.\n\n `scf.forall` induction variables are rewritten to `gpu.thread_id` according\n to the `mapping` attribute.\n\n Different types of mappings attributes are supported:\n - the block_dims is a list of integers that specifies the number of\n threads in each dimension. This is a mandatory attribute that is used\n to constrain the number of threads in each dimension. If an\n `scf.forall` op is mapped to fewer threads, predication occurs.\n - the warp_dims is a list of integers that specifies the number of\n warps in each dimension. This is an optional attribute that is used\n to constrain the number of warps in each dimension. When present, this\n attribute must be specified in a way that is compatible with the\n block_dims attribute. If an `scf.forall` op is mapped to fewer warps,\n predication occurs.\n\n Dynamic `scf.forall` trip counts are currently not supported.\n Dynamic block dim sizes are currently not supported.\n\n Only **bufferized** `scf.forall` are currently supported.\n Only `scf.forall` distributed to **at most 3 dimensions** are\n currently supported.\n\n The `sync_after_distribute`attribute controls whether a `gpu.barrier` is\n inserted after each scf.forall op. At this time, this is an all or nothing\n choice. This will need to be tightened in the future.\n\n The operation alters the block size of the given gpu_launch using the\n mandatory block_dims argument.\n\n #### Return modes:\n\n This operation ignores non-`gpu_launch` ops and drops them in the return.\n\n If any scf.forall with tensors is found, the transform definitely\n fails.\n\n If all the `scf.forall` operations with gpu.thread mapping contained\n within the `LaunchOp` referred to by the `target` handle lower to GPU\n properly, the transform succeeds. Otherwise the transform definitely\n fails.\n\n scf.forall operations with mappings other than gpu.thread are\n ignored.\n\n The returned handle points to the same LaunchOp operand, consuming it and\n producing a new SSA value to satisfy chaining and linearity of the IR\n properties.\n\n #### Example:\n\n ```\n gpu.launch blocks(%bx, %by, %bz) in (%x = %0, %y = %1, %z = %2)\n threads(%tx, %ty, %tz) in (%tx = %3, %ty = %4, %tz = %5) {\n scf.forall (%i, %j) in (7, 9) {\n ... // body 1\n } {mapping = [#gpu.thread, #gpu.thread, #gpu.thread]}\n scf.forall (%i) in (12) {\n ... // body 2\n } {mapping = [#gpu.thread]}\n gpu.terminator\n }\n ```\n\n is translated to:\n\n ```\n %bdimX = arith.constant 12 : index\n %bdimY = arith.constant 9 : index\n gpu.launch blocks(%bx, %by, %bz) in (%x = %0, %y = %1, %z = %2)\n threads(%tx, %ty, %tz) in (%tx = %bdimX, %ty = %bdimY, %tz = %5) {\n if (threadIdx.x < 9 && threadIdx.y < 7) {\n ... // body 1\n }\n gpu.barrier\n if (threadIdx.y < 1) {\n ... // body 2\n }\n gpu.barrier\n gpu.terminator\n }\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "block_dims", "type": "DefaultValuedAttr" }, { "name": "sync_after_distribute", "type": "DefaultValuedAttr" }, { "name": "warp_size", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target\n `block_dims` `=` $block_dims\n (`sync_after_distribute` `=` $sync_after_distribute^)?\n (`warp_size` `=` $warp_size^)?\n attr-dict\n `:` functional-type($target, $result)" }, { "name": "transform.include", "summary": "Includes a named transform sequence", "description": "The application of this transform operation is equivalent to applying the\n operations contained in the named transform sequence with operands being\n remapped to block arguments. The behavior of the operation when a\n transformation in the included named sequence produces a silenceable error\n is controlled by the `failure_propagation_mode` attribute. When set to\n `propagate`, the failure of any nested transformation in the sequence\n implies immediate failure of the entire sequence with a silenceable error,\n and no further transformation is attempted. When set to `suppress`,\n silenceable errors in nested operations are ignored and further\n transformations are applied. Beware that even silenceable errors may leave\n the payload IR in a state unsuitable for further transformations. It is the\n responsibility of the user to ensure the following transformations are\n robust enough when errors are suppressed. Definite errors are propagated\n immediately regardless of the mode. The objects associated with the results\n of this operation are the same as those associated with the operands of the\n `transform.yield` in the referenced named sequence.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "target", "type": "SymbolRefAttr" }, { "name": "failure_propagation_mode", "type": "FailurePropagationMode{propagate|suppress}" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$target `failures` `(` $failure_propagation_mode `)``(` $operands `)` attr-dict `:` functional-type($operands, $results)" }, { "name": "transform.irdl.collect_matching", "summary": "Finds ops that match the IRDL definition without registering them.", "operands": [ { "name": "root", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "matched", "type": "TransformHandleTypeInterface" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`in` $root `:` functional-type(operands, results) attr-dict-with-keyword regions" }, { "name": "transform.iree.amdgpu_distribute_vectors", "description": "Run AMDGPU Vector Contraction distribution on the target as the root.\n\n The anchor points are set by using the attribute\n \"__vector_layout_test_anchor_operand_x\" and\n \"__vector_layout_test_anchor_result_x\", where \"x\" is the operand/result\n number.\n\n This op produces amdgpu MFMA ops.\n\n #### Return modes\n\n This transform does not consume the target handle and always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "test_conversion", "type": "UnitAttr" }, { "name": "workgroup_size", "type": "DefaultValuedAttr" }, { "name": "subgroup_size", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target (`test_conversion` $test_conversion^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.apply_licm", "description": "Apply loop-independent code motion and single iteration loop promotion.\n This transform is applied to all FuncOps within the target. Distinguished\n from the upstream `apply_licm` op that only applies to a single loop with\n the `iree` prefix.\n\n #### Return modes\n\n This operation does not consume the target handle and does not produce any\n handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.iree.bufferize", "description": "Target the whole hal.executable_variant op and call upstream comprehensive\n bufferize with extra IREE hooks.\n\n By default, CPU allocations are emitted. This behavior can be modified by\n using the following attributes:\n - target_gpu: if set, GPU allocations are emitted.\n\n #### Return modes\n\n This operation calls the upstream one-shot bufferization pass with extra\n registered patterns for IREE.\n\n The pass is ran on all the ModuleOp nested under the top-level op on which\n the transform dialect interpreter pass is applied.\n\n If any of the pass on any of the ModuleOp fails, the transformation\n definitely fails. Otherwise the transformation succeeds.\n\n This transform consumes the target handle and produces a result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "target_gpu", "type": "UnitAttr" }, { "name": "test_analysis_only", "type": "UnitAttr" }, { "name": "print_conflicts", "type": "UnitAttr" } ], "assemblyFormat": "attr-dict $target `:` functional-type($target, results)" }, { "name": "transform.iree.convert_to_multi_mma", "description": "Converts the target linalg op to a multi_mma operation based on the\n given intrinsic kind.\n\n #### Return modes\n Emits a definite failure if the target is not a contraction like linalg\n op or the conversion to the target mma fails.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "intrinsic_kind", "type": "IREEGPU_AnyMmaAttr" } ], "assemblyFormat": "$target `,` `kind` `(` $intrinsic_kind `)` attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.convert_to_online_attention", "description": "Target iree_linalg_ext.attention ops and decompose them.\n This transform consumes the target handle and produces a result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.copy_tensor_operand", "summary": "Create a linalg copy of a specified value.", "description": "Inserts a copy of the specified operand of the target operation.\n\n #### Return modes\n Returns a handle to the new copy.\n\n It does not consume the target handle and emits a definite failure if the\n operand index is out of range or if the operand is not a tensor type.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "operand_index", "type": "I64Attr" } ], "assemblyFormat": "$target `[` $operand_index `]` attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.create_async_groups", "description": "Convert copies to shared memory to async copies. This creates groups\n of consecutive copies and emit wait operation right after.\n The input operation is a `func.func`.\n\n `use_mma_sync` specifies whether `bypassL1` attributes should be added to the\n async copies.\n\n #### Return modes\n This op returns a handle to the transformed function, even if nothing\n changed.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "use_mma_sync", "type": "UnitAttr" } ], "assemblyFormat": "$target\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.create_matmul_mfma_tile_sizes", "description": "Create param of tile sizes based on the matmul sizes.\n This operation won't succeed if the matmul shape size is not 2.\n Now it only covers the shape of [256*, 128*], [128, 64*], [8192, 320].", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "workgroup_tile_sizes", "type": "TransformParamTypeInterface" }, { "name": "problem_specific_sizes", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.decompose_aggregate_op", "description": "Target iree_linalg_ext.attention ops and decompose them.\n This transform consumes the target handle and produces a result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "tile_size", "type": "OptionalAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.distribute_inner_tiled", "description": "Distributes the target inner_tiled op to lanes.\n\n #### Return modes\n Emits a definite failure if the target is not an iree_codegen.inner_tiled op or\n if it fails to distribute.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.eliminate_empty_tensors", "description": "This is a pre-processing pass for iree.bufferize. It tries to remove\n tensor.empty ops by replacing them with suitable destination tensors,\n which can reduce the number of allocations when bufferizing.\n\n This transform is not part of iree.bufferize because additional\n canonicalization are sometimes possible after eliminate_empty_tensors but\n before iree.bufferize.\n\n #### Return modes\n\n This transform does not consume the target handle and always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "attr-dict $target `:` functional-type($target, results)" }, { "name": "transform.iree.eliminate_gpu_barriers", "description": "Removes unnecessary GPU barriers from the function. If a barrier does not\n enforce any conflicting pair of memory effects, including a pair that is\n enforced by another barrier, it is unnecessary and can be removed.\n\n #### Return modes\n\n Consumes the operand handle and produces a new handle to the function after\n rewriting.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.emit_remark", "description": "Emits a diagnostic remark with the given message located at payload ops\n associated with the given handle. This can be used, e.g., for debugging.", "operands": [ { "name": "handle", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$message `at` $handle attr-dict `:` type($handle)" }, { "name": "transform.iree.flatten_forall_mapping", "description": "Flattens the thread mapping of an `scf.forall` op.\n\n #### Return modes\n Emits a definite failure if the target is not an scf.forall op or if\n the mapping type is not `gpu.thread` or `gpu.warp` with linear dims in\n descending order.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.forall_to_flow", "description": "Rewrite an scf.forall to Flow::DispatchWorkgroups.\n\n #### Return modes\n\n This operation ignores non-scf::ForeachThread ops and drops them in the\n return.\n\n If any rewrite fails, the transform definitely fails.\n\n If all the operations referred to by the `target` operand generalize\n properly, the transform succeeds. Otherwise the transform silently fails.\n\n The return handle points to only the subset of successfully produced\n equivalent flow::DispatchWorkgroups operations, which can be empty.\n\n This operation consumes the `target` handle and produces the `transformed`\n handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.forall_to_lanes", "description": "Collect all of the scf.forall ops in the target that are distributed to\n lanes.\n\n Only scf.forall distributed to exactly a single lane id are currently\n supported.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.iree.forall_to_workgroup", "description": "Target the whole hal.executable_variant op and rewrite the unique topLevel\n scf.forall to distributed workgroup_id and workgroup_count.\n\n The mapping of threads to workgroup_id is currently one-to-one and in order.\n Only **bufferized** scf.forall are currently supported.\n Only scf.forall distributed to **at most 3 dimensions** are currently\n supported.\n\n Return modes:\n =============\n This operation ignores non-Func ops and drops them in the return.\n\n If no unique scf.forall topLevel operation is found, then the\n transform definitely fails.\n If the unique topLevel scf.forall has results (i.e. tensors), then\n the transform definitely fails.\n\n If the unique topLevel scf.forall maps to a dynamic number of\n threads, then the transform definitely fails. This is a temporary\n limitation until the backward slice computing scf.forall.num_threads\n can be extracted into the hal::executable_export workgroup_count region.\n This region may require arbitrary computations and cannot magically match\n what the `stream.cmd.dispatch` has already imposed on us at a distance.\n For now we must specify the number of values properly when applying the\n topLevel tile_using_forall.\n\n If the unique topLevel scf.forall operation contained within the\n FuncOp referred to by the `target` transform handle lowers to workgroup\n properly, the transform succeeds.\n\n Otherwise the transform definitely fails.\n\n This transform does not consume its input handle and produces no result.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.iree.fuse_collapse_shape_into_forall", "description": "Fuses a consumer tensor.collapse_shape op into a producer scf.forall op.\n The users of the block argument for the corresponding forall output operand\n should be only a tensor.parallel_insert_slice op, and tensor.extract_slice\n ops that extract an equivalent subset. After the fusion, the output of the\n forall will be collapsed, and all users of this block arg will also be\n collapsed. Additional tensor.expand_shape ops will be inserted after any\n tensor.extract_slice users inside the forall so that types match. Similarly,\n a tensor.collapse_shape will be inserted before the\n tensor.parallel_insert_slice.\n\n #### Return modes\n Emits a definite failure if either the producer is not an scf.forall op or\n if the consumer is not a tensor.collapse_shape op.", "operands": [ { "name": "producer", "type": "TransformHandleTypeInterface" }, { "name": "consumer", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$consumer `into` $producer attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.fuse_consumer", "description": "Fuses the consumer of the operation pointed to by the target handle\n using the options provided as attributes.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "results": [ { "name": "consumer", "type": "TransformHandleTypeInterface" }, { "name": "fused_consumer", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target `in` `(` $loops `)` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.fuse_extract_slice_into_forall", "description": "Fuses a consumer tensor.extract_slice op into a producer scf.forall op.\n This transform is supported if the extract_slice op has all zero offsets,\n and if all the offsets, sizes, and strides dominate the scf.forall op.\n After the transformation, the forall loop output argument corresponding\n to the sliced result will be replaced with a slice of it with the same\n offsets, sizes, and strides as the original extract_slice. The source of\n the corresponding tensor.parallel_insert_slice of the scf.forall will also\n become a slice of the original parallel insert source, clamped to fit within\n the new sliced result tensor.\n\n #### Return modes\n Emits a definite failure if either the producer is not an scf.forall op or\n if the consumer is not a tensor.extract_slice op.", "operands": [ { "name": "producer", "type": "TransformHandleTypeInterface" }, { "name": "consumer", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$consumer `into` $producer attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.fuse_forall", "description": "Fuses a producer-consumer pair of scf.forall ops that share the same\n iterator mapping types and trip counts. An allocation is created to\n bridge the `parallel.insert_slice` of the producer with the per-thread\n `extract_slice` of the consumer. If specified, uses |address_space| for\n the intermediate allocation.\n\n The mapping attributes of both the producer and consumer `scf.forall` ops\n must be in a relative descending order, for example:\n [#gpu.thread, #gpu.thread, #gpu.thread]\n or\n [#gpu.thread, #gpu.thread]\n\n NOTE: This pattern implicitly REQUIRES that the resulting scf.forall\n is capable of synchronizing all threads at the point of fusion (i.e.\n inserting a barrier). This invalidates certain kinds of lowerings of\n scf.forall ops such as lowering it to loops.\n\n #### Return modes\n Emits a definite failure if either the producer or consumer are not\n scf.forall ops.", "operands": [ { "name": "producer", "type": "TransformHandleTypeInterface" }, { "name": "consumer", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "address_space", "type": "OptionalAttr" } ], "assemblyFormat": "$producer `into` $consumer attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.gpu_distribute_shared_memory_copy", "summary": "Distribute shared memory copies.", "description": "Find copies to/from shared memory and distribute the copies based on the\n workgroup size.\n\n #### Return modes\n This operation applies to the entire function and does not consume the\n target handle. It always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.hoist_static_alloc", "summary": "Hoist static allocations.", "description": "Find static allocations and hoist them to the top level.\n\n #### Return modes\n This transform applies static alloc hoisting the whole region of the operand.\n\n It does not consume the target handle and always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.map_nested_forall_to_gpu_threads", "description": "Target the whole hal.executable_variant op and rewrite all scf.forall\n to distributed gpu.thread_id and translation_info attribute.\n\n This op will handle all the scf.forall using gpu.thread or gpu.warp\n mapping.\n\n The mapping of threads to gpu.thread_id is currently one-to-one and in order.\n Only **bufferized** scf.forall are currently supported.\n Only scf.forall distributed to **at most 3 dimensions** are currently\n supported.\n\n Multiple scf.forall are supported per function in which case, the\n max of all the threads is computed and taken for the global gpu.thread_id.\n If necessary, scf.forall that do not use the whole thread range\n result in predicated computations.\n\n Barriers are inserted after each scf.forall op\n if `sync_after_distribution` is true.\n\n Return modes:\n =============\n This operation ignores non-Func ops and drops them in the return.\n\n If any scf.forall with tensors is found, the transform definitely\n fails.\n\n If all the scf.forall operations contained within the FuncOp\n referred to by the `target` operand lower to GPU properly, the\n transform succeeds. Otherwise the transform definitely fails.\n\n The returned handle points to the same FuncOp operand, consuming it and\n producing a new SSA value to satisfy chaining and linearity of the IR\n properties.\n\n Example:\n ========\n\n ```\n hal.executable {\n hal.executable.variant {\n hal.executable.export {\n func @foo() {\n scf.forall (%i, %j) in (7, 9) {\n ... // body 1\n }\n scf.forall (%i) in (12) {\n ... // body 2\n }\n }\n ```\n\n is translated to:\n\n ```\n hal.executable {\n hal.executable.variant {\n hal.executable.export ... workgroup_size = [12 : index, 9 : index, 1 : index] {\n func @foo() {\n if (threadIdx.x < 7) {\n ... // body 1\n }\n if (threadIdx.y < 1) {\n ... // body 2\n }\n }\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "workgroup_dims", "type": "DefaultValuedAttr" }, { "name": "subgroup_size", "type": "DefaultValuedOptionalAttr" }, { "name": "sync_after_distribution", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target\n `workgroup_dims` `=` $workgroup_dims\n (`subgroup_size` `=` $subgroup_size^)?\n (`sync_after_distribution` `=` $sync_after_distribution^)?\n attr-dict\n `:` functional-type($target, results)" }, { "name": "transform.iree.match_callback", "description": "Performs payload IR matching using a C++ callback registered beforehand.\n The callback is identified by name and is passed the current transform\n state and the list of handle operands, along with information necessary\n for error propagation. See `register_match_callbacks` for the description\n of the callback contract.\n\n If `failure_propagation_mode` is set to `suppress`, any silenceable errors\n in the callback (typically, \"failure to match\") will be ignored and the\n resulting handles will be associated with empty lists of payload\n operations. Otherwise, silenceable failures are propagated.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "callback_name", "type": "StrAttr" }, { "name": "failure_propagation_mode", "type": "FailurePropagationMode{propagate|suppress}" } ], "assemblyFormat": "`failures` `(` $failure_propagation_mode `)` $callback_name `(` $inputs `)` attr-dict `:` functional-type($inputs, $outputs)" }, { "name": "transform.iree.match.attention", "summary": "Check whether the op is an attention operation.", "description": "Matches operations from the IREELinalgExt dialect that implement\n attention: iree_linalg_ext.attention.\n\n ### Example\n\n ```mlir\n #map_query = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d4)>\n #map_key = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d5, d4)>\n #map_value = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d3, d5)>\n #map_scale = affine_map<(d0, d1, d2, d3, d4, d5) -> ()>\n #map_output = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d3)>\n\n %batch_dims, %m_dims, %n_dims, %k1_dims, %k2_dims =\n transform.iree.match.attention %attn_op,\n query_type = f32, key_type = f32, value_type = f32, output_type = f32,\n indexing_maps = [#map_query, #map_key, #map_value, #map_scale, #map_output] :\n !transform.any_op -> !transform.param\n ```\n\n This succeeds when `%attn_op` is an attention operation with f32 element\n types for query, key, value, and output tensors, and matches the specified\n indexing maps pattern.\n\n #### Return modes\n\n Succeeds if the operation is an attention operation, and\n produces a silenceable failure otherwise.\n\n #### Results\n\n Returns arrays of dimension sizes extracted from the iteration domain:\n - batch_dims: Array of batch dimension sizes.\n - m_dims: Array of query sequence length dimension sizes.\n - n_dims: Array of number of heads dimension sizes.\n - k1_dims: Array of key/value sequence length dimension sizes.\n - k2_dims: Array of key embedding dimension sizes.\n\n The exact interpretation depends on the indexing maps of the attention op.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "batch_dims", "type": "TransformParamTypeInterface" }, { "name": "m_dims", "type": "TransformParamTypeInterface" }, { "name": "n_dims", "type": "TransformParamTypeInterface" }, { "name": "k1_dims", "type": "TransformParamTypeInterface" }, { "name": "k2_dims", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "query_type", "type": "TypeAttr" }, { "name": "key_type", "type": "TypeAttr" }, { "name": "value_type", "type": "TypeAttr" }, { "name": "output_type", "type": "TypeAttr" }, { "name": "indexing_maps", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AllTypesMatch<['batch_dims', 'm_dims', 'n_dims', 'k1_dims', 'k2_dims']>" } ], "assemblyFormat": "$operand_handle\n `,` `query_type` `=` $query_type\n `,` `key_type` `=` $key_type\n `,` `value_type` `=` $value_type\n `,` `output_type` `=` $output_type\n `,` `indexing_maps` `=` $indexing_maps\n attr-dict `:` type($operand_handle) `->` type($batch_dims)" }, { "name": "transform.iree.match.cast_compatible_dag_from_root", "summary": "Checks if the body of the target op matches an operation dag starting\n at the given root.", "description": "Checks whether the given root op matches an operation dag specified in the\n body of this op. Enforces cast compatibility between types rather than a\n strict equality, similar to `iree.match.cast_compatible_type`.\n\n Note: This operation is experimental and subject to change. General subgraph\n matching is difficult and can spawn various DSLs and a slew of transforms.\n This op tries to keep it relatively simple an inflexible, reflecting the\n expected use case of splicing in hand written kernels that can be equally\n inflexible.\n\n #### Return modes\n\n Succeeds if the root operation matches the dag given by this op, and\n produces a silenceable failure otherwise. Produces a definite failure\n if the operand is not associated with a single payload value.\n\n On success, this operation produces a handle to the inputs and outputs\n of the operation dag based on the outputs of the root op and the block\n arguments of this operations body.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "inputs", "type": "TransformValueHandleTypeInterface" }, { "name": "outputs", "type": "TransformValueHandleTypeInterface" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$operand_handle attr-dict-with-keyword regions `:` functional-type(operands, results)" }, { "name": "transform.iree.match.cast_compatible_type", "summary": "Checks if the payload value is cast compatible with a target type.", "description": "Checks whether the given value is cast-compatible with the given target\n type attribute.\n\n Currently this operation only allows casting of tensor types. Other types\n must match exactly.\n\n #### Return modes\n\n Succeeds if the value's type is compatible with the target type, and\n produces a silenceable failure otherwise. Produces a definite failure\n if the operand is not associated with a single payload value.", "operands": [ { "name": "operand_handle", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "target_type", "type": "TypeAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$operand_handle `=` $target_type attr-dict `:` type($operand_handle)" }, { "name": "transform.iree.match.contraction", "summary": "Check whether the op is a contraction operation.", "description": "Matches operations that implement the ContractionOpInterface.\n This includes operations like linalg.matmul, linalg.batch_matmul, etc.\n\n Optionally matches specific indexing maps patterns.\n\n ### Example\n\n ```mlir\n #map_lhs = affine_map<(d0, d1, d2) -> (d0, d2)>\n #map_rhs = affine_map<(d0, d1, d2) -> (d1, d2)>\n #map_output = affine_map<(d0, d1, d2) -> (d0, d1)>\n\n %batch_dims, %m_dims, %n_dims, %k_dims =\n transform.iree.match.contraction %matmul_op,\n lhs_type = f32, rhs_type = f32, output_type = f32,\n indexing_maps = [#map_lhs, #map_rhs, #map_output] :\n !transform.any_op -> !transform.param\n ```\n\n This succeeds when `%matmul_op` is a contraction operation with f32 input\n types and f32 output type, and matches the specified indexing maps pattern.\n\n #### Return modes\n\n Succeeds if the operation is a contraction operation, and\n produces a silenceable failure otherwise.\n\n #### Results\n\n Returns arrays of dimension sizes for each contraction dimension:\n - batch_dims: Array of batch dimension sizes.\n - m_dims: Array of M dimension sizes.\n - n_dims: Array of N dimension sizes.\n - k_dims: Array of K dimension sizes.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "batch_dims", "type": "TransformParamTypeInterface" }, { "name": "m_dims", "type": "TransformParamTypeInterface" }, { "name": "n_dims", "type": "TransformParamTypeInterface" }, { "name": "k_dims", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "lhs_type", "type": "TypeAttr" }, { "name": "rhs_type", "type": "TypeAttr" }, { "name": "output_type", "type": "TypeAttr" }, { "name": "indexing_maps", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['batch_dims', 'm_dims', 'n_dims', 'k_dims']>" } ], "assemblyFormat": "$operand_handle\n `,` `lhs_type` `=` $lhs_type\n `,` `rhs_type` `=` $rhs_type\n `,` `output_type` `=` $output_type\n (`,` `indexing_maps` `=` $indexing_maps^)?\n attr-dict `:` type($operand_handle) `->` type($batch_dims)" }, { "name": "transform.iree.match.convolution", "summary": "Check whether the op is a convolution operation.", "description": "Matches operations that implement the ConvolutionOpInterface.\n This includes operations like linalg.conv_2d_nhwc_hwcf,\n linalg.conv_2d_nchw_fchw, linalg.depthwise_conv_2d_nhwc_hwc, etc.\n\n Optionally matches specific indexing maps patterns.\n\n ### Example\n\n ```mlir\n #map_input = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1 + d4, d2 + d5, d6)>\n #map_filter = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d4, d5, d6, d3)>\n #map_output = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1, d2, d3)>\n\n %batch_dims, %output_image_dims, %output_channel_dims, %filter_dims,\n %input_channel_dims, %depth_dims, %strides, %dilations =\n transform.iree.match.convolution %conv_op,\n lhs_type = f32, rhs_type = f32, output_type = f32,\n indexing_maps = [#map_input, #map_filter, #map_output] :\n !transform.any_op -> !transform.param\n ```\n\n This succeeds when `%conv_op` is a convolution operation with f32 element\n types for input, filter, and output tensors.\n\n #### Return modes\n\n Succeeds if the operation is a convolution operation, and\n produces a silenceable failure otherwise.\n\n #### Results\n\n Returns arrays of dimension sizes for each convolution dimension:\n - batch_dims: Array of batch dimension sizes.\n - output_image_dims: Array of output spatial dimension sizes.\n - output_channel_dims: Array of output channel dimension sizes.\n - filter_dims: Array of filter spatial dimension sizes.\n - input_channel_dims: Array of input channel dimension sizes.\n - depth_dims: Array of depth dimension sizes (for depthwise convolutions).\n - strides: Array of stride values.\n - dilations: Array of dilation values.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "batch_dims", "type": "TransformParamTypeInterface" }, { "name": "output_image_dims", "type": "TransformParamTypeInterface" }, { "name": "output_channel_dims", "type": "TransformParamTypeInterface" }, { "name": "filter_dims", "type": "TransformParamTypeInterface" }, { "name": "input_channel_dims", "type": "TransformParamTypeInterface" }, { "name": "depth_dims", "type": "TransformParamTypeInterface" }, { "name": "strides", "type": "TransformParamTypeInterface" }, { "name": "dilations", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "lhs_type", "type": "TypeAttr" }, { "name": "rhs_type", "type": "TypeAttr" }, { "name": "output_type", "type": "TypeAttr" }, { "name": "indexing_maps", "type": "OptionalAttr>" } ], "traits": [ { "type": "AllTypesMatch<['batch_dims', 'output_image_dims', 'output_channel_dims', 'filter_dims', 'input_channel_dims', 'depth_dims', 'strides', 'dilations']>" } ], "assemblyFormat": "$operand_handle\n `,` `lhs_type` `=` $lhs_type\n `,` `rhs_type` `=` $rhs_type\n `,` `output_type` `=` $output_type\n (`,` `indexing_maps` `=` $indexing_maps^)?\n attr-dict `:` type($operand_handle) `->` type($batch_dims)" }, { "name": "transform.iree.match.dim_bounds", "summary": "Checks whether the size of a dim is within given bounds.", "description": "Checks whether a dim is within a specified lower and upper bound.\n\n #### Return modes\n\n Succeeds if the value's type is compatible with the target type, and\n produces a silenceable failure otherwise. Produces a definite failure\n if the operand is not associated with a single payload value.", "operands": [ { "name": "operand_handle", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "dim", "type": "I64Attr" }, { "name": "lower_bound", "type": "OptionalAttr" }, { "name": "upper_bound", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$operand_handle `[` $dim `]` `,` (`umin` `=` $lower_bound^):(`none`)?\n `,` (`umax` `=` $upper_bound^):(`none`)? attr-dict `:` type($operand_handle)" }, { "name": "transform.iree.match.dim_is_multiple_of", "summary": "Checks the static size of a dim is divisible by a given value.", "description": "Checks whether the given dimension given shaped value is a multiple of the\n given size.\n\n #### Return modes\n\n Succeeds if the value's type is compatible with the target type, and\n produces a silenceable failure otherwise. Produces a definite failure\n if the operand is not associated with a single payload value.", "operands": [ { "name": "operand_handle", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "dim", "type": "I64Attr" }, { "name": "size", "type": "I64Attr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$operand_handle `[` $dim `]` `,` $size attr-dict `:` type($operand_handle)" }, { "name": "transform.iree.match.dims_equal", "summary": "Check whether transform parameters match expected size values exactly.", "description": "Matches dimension sizes against expected values.\n Each position in the dimension sizes array must match the corresponding\n expected value exactly.\n\n ### Example\n\n ```mlir\n transform.iree.match.size_equals %m, [512, 256] : !transform.param\n ```\n\n This succeeds when `%m` has exactly two dimensions, 512 and 256.\n\n #### Return modes\n\n Succeeds if all parameters match their corresponding expected values, and\n produces a silenceable failure otherwise.", "operands": [ { "name": "dimension_sizes", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "expected_values", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$dimension_sizes `,` $expected_values\n attr-dict `:` type($dimension_sizes)" }, { "name": "transform.iree.match.has_no_lowering_config", "summary": "Checks that the payload op does not carry a lowering config or compilation info.", "description": "Verifies that the payload does not have a \"compilation_info\" or\n \"lowering_config\" attribute. This is a very common check needed for external\n matchers to avoid overwriting already configured ops.\n\n #### Return modes\n\n Succeeds if the payload lacks a configuration. Produces a silenceable\n failure otherwise. Produces a definite failure if the operand is not\n associated with a single payload op.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` type($operand_handle)" }, { "name": "transform.iree.match.online_attention", "summary": "Check whether the op is an online_attention operation.", "description": "Matches operations from the IREELinalgExt dialect that implement\n online attention without a mask: iree_linalg_ext.online_attention.\n\n ### Example\n\n ```mlir\n #map_query = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d4)>\n #map_key = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d5, d4)>\n #map_value = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d3, d5)>\n #map_scale = affine_map<(d0, d1, d2, d3, d4, d5) -> ()>\n #map_output = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d3)>\n #map_max = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2)>\n #map_sum = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2)>\n\n %batch_dims, %m_dims, %n_dims, %k1_dims, %k2_dims =\n transform.iree.match.online_attention %attn_op,\n query_type = f16, key_type = f16, value_type = f16, scale_type = f16,\n output_type = f32, max_type = f32, sum_type = f32,\n indexing_maps = [#map_query, #map_key, #map_value, #map_scale,\n #map_output, #map_max, #map_sum] :\n !transform.any_op -> !transform.param\n ```\n\n This succeeds when `%attn_op` is an unmasked online_attention operation\n with the specified element types and indexing maps.\n\n #### Return modes\n\n Succeeds if the operation is an unmasked online_attention operation, and\n produces a silenceable failure otherwise.\n\n #### Results\n\n Returns arrays of dimension sizes extracted from the iteration domain:\n - batch_dims: Array of batch dimension sizes.\n - m_dims: Array of query sequence length dimension sizes.\n - n_dims: Array of number of heads dimension sizes.\n - k1_dims: Array of key/value sequence length dimension sizes.\n - k2_dims: Array of key embedding dimension sizes.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "batch_dims", "type": "TransformParamTypeInterface" }, { "name": "m_dims", "type": "TransformParamTypeInterface" }, { "name": "n_dims", "type": "TransformParamTypeInterface" }, { "name": "k1_dims", "type": "TransformParamTypeInterface" }, { "name": "k2_dims", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "query_type", "type": "TypeAttr" }, { "name": "key_type", "type": "TypeAttr" }, { "name": "value_type", "type": "TypeAttr" }, { "name": "scale_type", "type": "TypeAttr" }, { "name": "output_type", "type": "TypeAttr" }, { "name": "max_type", "type": "TypeAttr" }, { "name": "sum_type", "type": "TypeAttr" }, { "name": "indexing_maps", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AllTypesMatch<['batch_dims', 'm_dims', 'n_dims', 'k1_dims', 'k2_dims']>" } ], "assemblyFormat": "$operand_handle `,`\n `query_type` `=` $query_type\n `,` `key_type` `=` $key_type\n `,` `value_type` `=` $value_type\n `,` `scale_type` `=` $scale_type\n `,` `output_type` `=` $output_type\n `,` `max_type` `=` $max_type\n `,` `sum_type` `=` $sum_type\n `,` `indexing_maps` `=` $indexing_maps\n attr-dict `:` type($operand_handle) `->` type($batch_dims)" }, { "name": "transform.iree.match.regions", "summary": "Checks if the body of the target op matches the body of the single contained op.", "description": "Does a structural comparison of the regions of the single op contained\n within the region of this op against the regions of the target operation.\n\n #### Return modes\n\n Succeeds if the operation body satisfies the specified criteria, produces a\n silenceable failure otherwise. Produces a definite failure if the operand is\n not associated with a single payload op.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$operand_handle attr-dict `:` type($operand_handle) regions" }, { "name": "transform.iree.pack_shared_memory_alloc", "summary": "Pack shared memory allocation to reduce memory usage.", "description": "Looks for allocs in shared memory space with overlapping liveness and\n groups them, then packs all the allocations in each group into one i8\n alloc. Also adds barriers to make sure we are done writing/reading\n from the previous alias group before starting a new one.\n\n #### Return modes\n\n It does not consume the target handle and always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.pipeline_shared_memory_copies", "description": "This applies software pipelining to a given scf.for loop. The pipelining\n strategy will look for a copy to shared memory and pipeline it to overlap\n it with the rest of the loop.\n It is user responsibility to ensure that there are no dependency between\n `depth` iterations of the loop by using multi-buffering.\n\n `depth` will indicate how many stages the software pipeline should have.\n `peel_epilogue` allows to force the epilogue to be peeled out instead of\n potentially using predicated operations for the epilogue phase.\n\n #### Return modes\n This transform consumes the scf.for handle and produces a result handle\n which points to a) the new scf.for loop generated (success case) or b) the\n existing scf.for loop (failure case).", "operands": [ { "name": "for_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "depth", "type": "I64Attr" }, { "name": "peel_epilogue", "type": "UnitAttr" }, { "name": "use_mma_sync", "type": "UnitAttr" } ], "assemblyFormat": "$for_op\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.populate_workgroup_count_region_using_num_threads_slice", "description": "Populate the `iree_codegen.dispatch_config` workgroup count region.\n\n Finds the `dispatch_config` op for the parent function and resolves the\n `workgroup_count_from_slice` placeholder in its body using the\n `num_threads` values from the given `scf.forall` op.\n `PropagateDispatchConfig` later copies the result to the\n `hal.executable.export` count region.", "operands": [ { "name": "for_all_op", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "attr-dict $for_all_op `:` functional-type($for_all_op, results)" }, { "name": "transform.iree.prefetch_shared_memory_copies", "description": "#### Return modes\n This transform consumes the scf.for handle and produces a result handle\n which points to a) the new scf.for loop generated (success case) or b) the\n existing scf.for loop (failure case).", "operands": [ { "name": "for_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$for_op\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.promote_operands", "description": "This op promotes the specified operands of the provided target handle.\n\n #### Return modes\n This op consume its target handle and returns a new handle to its target handle\n as well as an allocTensorOp for each of the provided valid indices.\n\n If the promotion of any specified operand fails to occur, the op definitely\n fails.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "indices", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target $indices attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.reduce_shared_memory_bank_conflicts", "summary": "Add padding to 'memref.alloc' ops reduce shared memory bank conflicts.", "description": "The `paddingSizeBits` argument should be picked based on the target\n architecture, striking balance between minimizing bank conflicts and keeping\n the data aligned. Smaller values (close to the bank bitwidth) achieve the\n former, while larger (~= widest load size) the latter. We want to **misalign**\n the rows, but not too much. For gfx942, 64 is a good default.\n\n #### Return modes\n\n This transform does not consume the target handle and always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "padding_size_bits", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.region_to_workgroups", "description": "Convert a flow.dispatch.region op into a flow.dispatch.workgroups op.\n\n Region ops can capture any values that are in scope in their body, whereas\n workgroup ops are isolated from above and all values must be explicitly\n captured via operands.\n\n #### Return modes\n\n This operation consumes the `target` handle and produces the `transformed`\n handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.register_match_callbacks", "description": "Registers named structured op matcher callbacks specific for IREE to use\n with `transform.iree.match_callback`. This should be called before first\n `match_callback` may be executed following the transform dialect control\n flow.\n\n The callbacks must have a unique name and a signature compatible with\n `MatchCallbacksRegistry::MatchCallbackFn`, which currently means\n `DiagnosedSilenceableFailure(MatchCallbackResult &, Location,\n const TransformState &, ValueRange)`. The callback receives a \"result\",\n followed by a location at which errors should be reported, a transform\n state at the moment of the _match_ (not registration) and a list of\n handle values passed as operands to the `match_callback` operation.\n It is expected to populate the \"result\" object with lists of payload\n operations that will be bound to the handles produced by the\n `match_callback` operation. The callback may fail, at which point\n it should produce a silenceable error. The callback currently is not\n allowed to modify the payload IR (though this may be revised in the\n future for the purpose of communicating the properties of the IR\n captured by the match). Therefore, it should not have a reason to\n produce a definite error.", "assemblyFormat": "attr-dict" }, { "name": "transform.iree.reorder_transpose", "description": "Targets the whole func op and finds transpose ops whose source\n comes from an elementwise op. For each of those transpose ops,\n it moves the transpose before the elementwise op by first\n transposing the operands of the elementwise op and then redoing\n the elementwise op using the transposed operands. It then\n replaces all uses of the original transpose op with the result\n of the new elementwise op.\n\n More specifically, given IR that looks like below,\n %0 = arith.subf %a, %b : vector<16x8xf16>\n %1 = vector.transpose %0 [1, 0] : vector<16x8xf16> to vector<8x16xf16>\n\n It moves the transpose before the elementwise op to produce\n %transposed_a = vector.transpose %a [1, 0] : vector<16x8xf16> to vector<8x16xf16>\n %transposed_b = vector.transpose %b [1, 0] : vector<16x8xf16> to vector<8x16xf16>\n %0 = arith.subf %transposed_a, %transposed_b : vector<8x16xf16>", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.iree.share_forall_operands", "description": "Target a single scf.forall op and shares all uses of the specified\n `share_operands` operand indices.\n\n Sharing can be thought of as the inverse of traditional privatization.\n Privatization consists in determining that a part of memory is only accessed\n by a single thread to and subsequently slicing out that part into a\n thread_private storage that has smaller footprint, better locality and better\n alignment properties.\n In the case of scf.forall on tensors, tensor values are immutable\n and the same tensor value may be passed as `shared_outs` and also captured\n for internal uses.\n Due to the immutability property, the whole tensor values are private by\n construction and result in alloc + copy of the whole tensor on every thread\n to maintain the original SSA value after bufferizing.\n\n An analysis similar to privatization is needed to ensure that only a private\n slice is needed and that the whole tensor can be shared.\n This transformation amounts to injecting the result of such an analysis as\n static information in the program.\n The transformation checks that the values captured are `tensor.extract_slice`\n with a matching `tensor.parallel_insert_slice`, to approximate the lack of\n a cross-thread dependence analysis.\n However this can still be unsafe wrt parallelism so use carefully!\n\n Sharing consists in rewriting all uses of the operands passed as\n `shared_outs` that are also captured within the `scf.forall` region\n into the matching `shared_outs` bbarg.\n\n Only those operands whose indices are specified in `share_operands` are\n shared. An empty `share_operands` specification considers all operands to\n be shared.\n\n #### Return modes\n\n If any of the `share_operands` indices overflow, a definite error is produced.\n\n If a `share_operands` fails a sharing precondition, it is ignored.\n In the future, we should emit a notification.\n\n This transform consumes the target handle and produces a result handle to\n the modified `scf.forall` op.", "operands": [ { "name": "forall_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "share_operands", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$forall_op (`share_operands` `=` $share_operands^ )? attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.synchronize_loop", "description": "This inserts a gpu.barrier after a given scf.for loop.\n\n #### Return modes\n This transform consumes the scf.for handle and produces a result handle\n which points to the new scf.for loop generated. It will fail if the loop\n cannot be pipelined or if there are no shared memory copies.", "operands": [ { "name": "for_op", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$for_op\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.iree.take_first", "description": "Given an arbitrary list of handles associated with potentially empty lists\n of payload operations, produces two new handles:\n\n - a handle pointing to the same payload operations as the first operand\n handle with a non-empty list of payload operations;\n - a handle pointing to the concatenated list of payload operations\n associated with any other handle.\n\n Note that this does not perform any deduplication.\n\n This operation is useful to select a single target after some potentially\n unsuccessful matches.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "first", "type": "TransformHandleTypeInterface" }, { "name": "rest", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$inputs attr-dict `:` functional-type($inputs, results)" }, { "name": "transform.iree.test_gpu_vector_distribution", "description": "Run GPUVectorDistribution on the target as the root.\n\n The anchor points are set by using the attribute\n \"__vector_layout_test_anchor_operand_x\" and\n \"__vector_layout_test_anchor_result_x\", where \"x\" is the operand/result\n number.\n\n The distribution is done for a single warp using gpu.thread x as the lane\n ID. The optional experimental attribute enabled experimental distribution\n patterns.\n\n #### Return modes\n\n This transform does not consume the target handle and always return success.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "experimental", "type": "DefaultValuedOptionalAttr" }, { "name": "workgroup_size", "type": "DefaultValuedAttr" }, { "name": "subgroup_size", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.iree.vector.to_warp_execute_on_lane_0", "description": "Given an scf.if target predicated by `if (threadIdx.x == 0)`, rewrite its\n body to vector.execute_on_lane_0 running ***on a single warp***.\n\n The warp size is determined by the `warp_size` attribute (it is generally\n 32 but we do not want to hardcode it).\n\n This rewrite only applies if it can be determined from the IR (i.e. from\n the surrounding IREE::HAL::ExecutableExportOp) that the number of threads\n along the warp dimension is a multiple of the warp size. The transformation\n bails on non-perfect multiples of the warp size that would not properly\n distribute.\n\n This is the first of two step towards apply vector distribution to a single\n warp.\n\n\n Return modes:\n =============\n This operation ignores non-scf::IfOp ops and drops them in the return.\n\n If all the operations referred to by the `target` operand are properly\n properly, the transform succeeds. Otherwise the transform silently fails.\n\n If the transform is anchored at a top-level that is not isolated from above,\n the transform definitely fails.\n\n If the transform cannot find a proper HAL::ExecutableExportOp with a\n well-formed workgroup_size 3-entry attribute such that the threadIdx.x\n component is a multiple of warp_size, the transform silently fails.\n If the scf::ForOp predicate does not predicate on threadIdx.x == 0, the\n transform silently fails.\n\n Otherwise the transformation succeeds and the returned handle points to the\n produced vector::WarpExecuteOnThread0Op.\n\n\n Example:\n ========\n\n ```\n hal.executable.export public @foo ... { workgroup_size = [64: index, 1: index, 1: index] }\n builtin.module {\n func.func @foo() {\n %c0 = arith.constant 0 : index\n %c1 = arith.constant 1 : index\n %0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<128xf32>\n %1 = gpu.thread_id x\n %2 = arith.cmpi ult, %1, %c1 : index\n scf.if %2 {\n %3 = arith.constant dense<1.0> : vector<128xf32>\n vector.transfer_write %3, %0[%c0] : vector<128xf32>, memref<128xf32>\n }\n }\n }\n ```\n\n rewrites to:\n\n ```\n hal.executable.export public @foo ... { workgroup_size = [64: index, 1: index, 1: index] }\n builtin.module {\n func.func @foo() {\n %c0 = arith.constant 0 : index\n %c4 = arith.constant 4 : index\n %c32 = arith.constant 32 : index\n %cst = arith.constant dense<1.000000e+00> : vector<128xf32>\n %0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<128xf32>\n %1 = gpu.thread_id x\n %2 = arith.cmpi ult, %1, %c32 : index\n // Single-warp guard filters out threads 32-63.\n scf.if %2 {\n vector.warp_execute_on_lane_0(%1)[32] {\n %cst = arith.constant dense<1.000000e+00> : vector<128xf32>\n vector.transfer_write %cst, %0[%c0] : vector<128xf32>, memref<128xf32>\n }\n }\n }\n }\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "warp_size", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, $result)" }, { "name": "transform.iree.vector.vector_to_mma_conversion", "description": "This converts slices of operations containing vector.contract op into\n mma operations, targeting warp level tensorcore operations. If the vector\n operations are bigger than the native mma size it will first split up those\n vector operations.\n\n Exactly one of use_wmma or use_mma_sync must be specified.\n\n #### Return modes\n\n This transform consumes the target handle and produces a result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "use_mma_sync", "type": "UnitAttr" }, { "name": "use_wmma", "type": "UnitAttr" } ], "assemblyFormat": "$target\n attr-dict\n `:` functional-type($target, results)" }, { "name": "transform.iree.vector.warp_distribute", "description": "Given a vector.warp_execute_on_lane_0, apply the patterns to rewrite into\n distributed form with warp synchronization. This produces IR that runs\n ***on a single warp***.\n\n IR that cannot be distributed will be predicated by `if (threadIdx.x == 0)`.\n\n This is the second step of two for applying vector distribution to a single\n warp.\n\n\n Return modes:\n =============\n This operation applies a number of patterns to rewrite vector IR into\n distributed warp form. To apply these patterns, this operation must target\n an operation that is isolated from above, otherwise the transform definitely\n fails.\n\n Patterns sets are applied in the following order:\n - applyMultiReductionLoweringPatterns\n - applyVectorTransferWriteDistribution\n - applyPropagateVectorDistribution\n - applyWarpExecuteOnLane0ToScf\n\n If any of the pattern sets fail to apply, the transformation definitely\n fails.\n\n Otherwise the transformation is successful and no result is returned.\n\n\n Example:\n ========\n\n ```\n hal.executable.export public @foo ... { workgroup_size = [64: index, 1: index, 1: index] }\n builtin.module {\n func.func @foo() {\n %c0 = arith.constant 0 : index\n %c4 = arith.constant 4 : index\n %c32 = arith.constant 32 : index\n %cst = arith.constant dense<1.000000e+00> : vector<128xf32>\n %0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<128xf32>\n %1 = gpu.thread_id x\n %2 = arith.cmpi ult, %1, %c32 : index\n // Single-warp guard filters out threads 32-63.\n scf.if %2 {\n vector.warp_execute_on_lane_0(%1)[32] {\n %cst = arith.constant dense<1.000000e+00> : vector<128xf32>\n vector.transfer_write %cst, %0[%c0] : vector<128xf32>, memref<128xf32>\n }\n }\n }\n }\n ```\n\n distributes to:\n\n ```\n hal.executable.export public @foo ... { workgroup_size = [64: index, 1: index, 1: index] }\n builtin.module {\n func.func @foo() {\n %c0 = arith.constant 0 : index\n %c4 = arith.constant 4 : index\n %c32 = arith.constant 32 : index\n %cst = arith.constant dense<1.000000e+00> : vector<128xf32>\n %0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<128xf32>\n %1 = gpu.thread_id x\n %2 = arith.cmpi ult, %1, %c32 : index\n // Single-warp guard filters out threads 32-63.\n scf.if %2 {\n %3 = arith.cmpi eq, %1, %c0 : index\n %4 = memref.alloc() : memref<128xf32, 3>\n // Single-thread guard runs on thread 0 only.\n scf.if %3 {\n vector.store %cst, %4[%c0] : memref<128xf32, 3>, vector<128xf32>\n }\n %5 = arith.muli %1, %c4 : index\n %6 = vector.load %4[%5] : memref<128xf32, 3>, vector<4xf32>\n %7 = affine.apply #map()[%1]\n vector.transfer_write %6, %0[%7] {in_bounds = [true]} : vector<4xf32>, memref<128xf32>\n }\n }\n }\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target\n attr-dict\n `:` functional-type($target, results)" }, { "name": "transform.kernel.forall_to_kernel", "description": "Outlines the body of an `scf.forall` operation to a new `func.func` nested\n under a `gpu.module` operation. The `scf.forall` operation is replaced by\n a `kernel.call` operation that represents \"launching\" the kernel.\n\n The block arguments for the `scf.forall` body representing the indices of\n the processing elements are replaced by `gpu.block_id` operations inserted\n at the start of the body block. Up to three indices are replaced by\n `gpu.block_id` with the position arguments `x`, `y`, and `z` corresponding\n to the first, second, and third block arguments representing procesing\n element indices. Having more than three distribution indices is considered a\n definite error.\n\n All `shared_outs` parameters and well as used-values-defined-above become\n arguments to the created `func.func`. The only exception is scalar and\n vector constants, which are inlined into the body.\n\n The result is a `func.func` that represents a thead-block level SPMD\n program.\n\n If `reuse_existing_gpu_module` is true, then the kernel function will\n be inserted into the first existing `gpu.module` that is found. If\n no existing `gpu.module` is found or if `reuse_existing_gpu_module` is\n false, then a new `gpu.module` will be created.\n\n If `extra_module_attrs` is provided, then the attributes will be added\n to the created `gpu.module` only if `reuse_existing_gpu_module` is true.\n\n #### Example\n\n ```mlir\n func.func @main(%arg0: tensor<1024x1024xf32>,\n %arg1: tensor<1024x1024xf32>,\n %arg2: tensor<1024x1024xf32>) -> tensor<1024x1024xf32> {\n %c8 = arith.constant 8 : index\n %c0 = arith.constant 0 : index\n %0 = scf.forall (%i, %j) in (%c8, %c8) shared_outs(%out = %arg2) -> tensor<1024x1024xf32> {\n ... body ...\n }\n return %0 : tensor<1024x1024xf32>\n }\n ```\n\n is transformed to\n\n ```mlir\n func.func @main(%arg0: tensor<1024x1024xf32>, %arg1: tensor<1024x1024xf32>,\n %arg2: tensor<1024x1024xf32>) -> tensor<1024x1024xf32> {\n %c8 = arith.constant 8 : index\n %0 = kernel.call @kernels::@main_kernel[%c8, %c8] (%arg0, %arg1) outs(%arg2)\n : (tensor<1024x1024xf32>, tensor<1024x1024xf32>) -> tensor<1024x1024xf32>\n return %0 : tensor<1024x1024xf32>\n }\n gpu.module @kernels {\n func.func @main_kernel(%arg0: tensor<1024x1024xf32>, %arg1: tensor<1024x1024xf32>,\n %arg2: tensor<1024x1024xf32>) -> tensor<1024x1024xf32> {\n %0 = gpu.block_id x\n %1 = gpu.block_id y\n ... body ...\n }\n }\n ```\n\n #### Return modes\n\n If `target` is not a top-level `scf.forall` operation, then it is silently\n ignored.\n\n The operation consumes the `target` (`scf.forall`) handle and produces\n handles for the created `kernel.call`, `gpu.module`, and `func.func`\n operations.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "kernel_call", "type": "TransformHandleTypeInterface" }, { "name": "kernel_module", "type": "TransformHandleTypeInterface" }, { "name": "kernel_func", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "num_threads", "type": "I64Attr" }, { "name": "reuse_existing_gpu_module", "type": "DefaultValuedAttr" }, { "name": "extra_module_attrs", "type": "OptionalAttr" } ], "assemblyFormat": "$target `threads` `(` $num_threads `)` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.kernel.forall_to_subgroups", "description": "Inlines the body of an `scf.forall` operation immediately above the op\n itself and then deletes the `scf.forall` operation. The block arguments\n representing distribution indices are replaced by a calculation on\n `gpu.thread_idx x` representing the calculation of the subgroup id and then\n the subgroup id is delinearized to the shape of the total indices in each\n index dimension of the `scf.forall` operation.\n\n Let x = gpu.thread_id x, then the subgroup id will be:\n (x mod (prod(loop_upper_bound) * subgroup_size)) floor_div subgroup_size.\n This subgroup id will be delinearized to the dimension of the\n loop and to replace the loop iterator variable.\n\n Usage:\n `transform.kernel.forall_to_subgroups %forall subgroup_size(s)`\n\n Thus, this transformation assumes that the threadblock is launched as a 1D\n linear array of threads. For example, if the number of threads is `128`,\n then the threadblock shape at launch time should be given as `(NumThreads,\n 1, 1)`, otherwise the result of this transformation is undefined.\n\n #### Example\n\n Given `%1 = transform.kernel.forall_to_subgroups %arg0 subgroup_size(32)`\n ```mlir\n func.func @kernel(%arg0: tensor<128x32xf32>,\n %arg1: tensor<32x128xf32>,\n %arg2: tensor<128x128xf32>) -> tensor<128x128xf32> {\n %c2 = arith.constant 2: index\n %0 = scf.forall (%i, %j) in (%c2, %c2) shared_outs(%out = %arg2) -> tensor<128x128xf32> {\n ... body ...\n }\n return %0 : tensor<128x128xf32>\n }\n ```\n\n is transformed to\n\n ```\n func.func @kernel(%arg0: tensor<128x32xf32>,\n %arg1: tensor<32x128xf32>,\n %arg2: tensor<128x128xf32>) -> tensor<128x128xf32> {\n %c2 = arith.constant 2 : index\n %0 = gpu.thread_id x\n %1 = affine.apply affine_map<()[s0] -> ((s0 mod 128) floordiv 32)>()[%0]\n %2:2 = affine.delinearize_index %1 into (%c2, %c2) : index, index\n ... body ...\n }\n ```\n where the constant 128 in the affine_map is by subgroup_size (32)*%c2*%c2.\n\n #### Return modes\n\n The operatin consumes the `target` (`scf.forall`) handle and produces\n handles for the created operation representing the `group_id` (before\n delinearization to the different dimensions).", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "group_id", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "subgroup_size", "type": "I64Attr" } ], "assemblyFormat": "$target `subgroup_size` `(` $subgroup_size `)` attr-dict `:` functional-type(operands, results)" }, { "name": "transform.kernel.fuse_greedily_op", "description": "The `kernel.fuse_greedily_op` operation loops over all operands in the given\n `target` op and tries to replace any operands that are the result of a\n `tensor.extract_slice` with an equivalent inlined computation based on the\n slices' input operand. An example would be to replace a slice of a\n `linalg.matmul` with an instance of `linalg.matmul` that computes the slice.\n\n This procedure is called \"fusion\" because the target op is typically\n located within the body of a loop nest.\n\n Example:\n\n ```\n %0 = linalg.matmul ins(%arg0, %arg1 : ... ) ... -> tensor\n %1 = scf.forall (...) -> tensor {\n %2 = tensor.extract_slice %0[...][...][...] : tensor to tensor<128x64xf32>\n %3 = linalg.matmul ins(%2, %arg1 : tensor<128x64xf32>, tensor<64x64xf32f32>)\n ... -> tensor <128x64xf32>\n scf.forall.in_parallel {\n tensor.parallel_insert_slice %3 into ...\n }\n }\n ```\n\n can be transformed to\n\n ```\n %1 = scf.forall (...) -> tensor {\n %arg0_slice = tensor.extract_slice %arg0 ....\n %arg1_slice = tensor.extract_slice %arg1 ....\n %2 = linalg.matmul ins(%arg0_slice, %arg1_slice : ... ) ... -> tensor<128x64xf32>\n %3 = linalg.matmul ins(%2, %arg1 : tensor<128x64xf32>, tensor<64x64xf32f32>)\n ... -> tensor <128x64xf32>\n scf.forall.in_parallel {\n tensor.parallel_insert_slice %3 into ...\n }\n }\n ```\n\n The transformation is made generic by leveraging the `TilingInterface`. Any\n operation that implements the `TilingInterface` specifies how to replace a\n slice of the operation's result(s) with a new inlined computation.\n Therefore, any operation that implements `TilingInterface` can potentially\n be fused.\n\n This inlining/fusion process is applied greedily by repeating the procedure\n on all fused operations until no fusions can be made. In the above example,\n the procedure is applied at first to `%3`, which is the initial `target`.\n Then, it would be applied to `%2`. Since `%2`'s operands are slices of block\n arguments, no further fusion is possible and the procedure terminates.\n\n The initial `target` op is usually a `linalg.generic`, but it can be any\n operation that accepts tensor parameters.\n\n More specifically, an operand of the `target` is a fusion candidate if:\n\n 1. It is produced by a `tensor.extract_slice` operation\n 2. The input to the `tensor.extract_slice` is produced by a `TilingInterface` operation.\n\n #### Example usage:\n\n ```\n %1 = transform.kernel.fuse_producers_greedily %0\n ```\n\n #### Return Modes\n\n This operation consumes the `target` handle and returns a new handle\n representing the same operation as the `target`.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.kernel.lower_to_loops", "description": "Lower the given operation to SCF loops.\n\n #### Return modes\n\n This operation consumes the target handle and produces a new handle\n representing the outer-most loop of the `scf.for` loop nest used\n to replace the target.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "loops", "type": "Variadic" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.kernel.nest_scalar_linalg_in_forall", "description": "The `transform.kernel.nest_scalar_linalg_in_forall` operation nests the given\n `linalg.generic` target under a single-iteration `scf.forall` operation.\n The target is replaced by the results of the `scf.forall` operation.\n\n The purpose is to enable generating `scf.forall` that represent single-CTA,\n single-warp kernels for a given `linalg.generic` operation that may have no\n loops (and thus cannot use the `transform.structured.tile_to_forall` op\n to accomplish the same thing).\n\n\n #### Return Modes\n\n The operation returns new handles to the `scf.forall` operation and the\n nested clone of the Linalg target op. The target handle is consumed.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "forall_op", "type": "TransformHandleTypeInterface" }, { "name": "linalg_op", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.kernel.vectorize_children_and_apply_patterns", "description": "This is a clone of the upstream linalg transform op\n \"transform.structured.vectorize_children_and_apply_patterns\", but it\n removes the \"insert slice vectorization\" which was added in upstream\n PR https://github.com/llvm/llvm-project/pull/111349.\n\n It is not allowed for us to \"vectorize\" the `tensor.insert_slice` operation\n in the manner introduced in that PR because we treat `tensor.insert_slice`\n as a concurrent operation in our compiler (e.g. more like\n `tensor.parallel_insert_slice`, which is currently only allowed within\n a \"ParallelCombiningOp\" region).\n\n To resolve these discrepancies we need to fix our usage of\n the `tensor.insert_slice` operation, which we create during outlining\n of `scf.forall`. Instead, we should introduce our own parallel combining\n operation in the Kernel dialect and use `tensor.parallel_insert_slice`.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "vectorize_padding", "type": "UnitAttr" }, { "name": "vectorize_nd_extract", "type": "UnitAttr" }, { "name": "flatten_1d_depthwise_conv", "type": "UnitAttr" }, { "name": "disable_multi_reduction_to_contract_patterns", "type": "UnitAttr" }, { "name": "disable_transfer_permutation_map_lowering_patterns", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:`functional-type(operands, results)" }, { "name": "transform.kernel.verify_post_tiling", "description": "Performs checks that should occur after tiling and fusion have occurred\n but prior to distributing/outlining the `scf.forall` operations.\n\n The `forall` parameter should be the outer-most `scf.forall` (which\n is mapped to blocks in the grid).\n\n #### Return modes\n\n Reads the target handle and produces no results. If errors are discovered,\n an error is emitted and a definite failure is returned.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.loop.coalesce", "summary": "Coalesces the perfect loop nest enclosed by a given loop", "description": "Given a perfect loop nest identified by the outermost loop,\n perform loop coalescing in a bottom-up one-by-one manner.\n\n #### Return modes\n\n The return handle points to the coalesced loop if coalescing happens, or\n the given input loop if coalescing does not happen.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, $transformed)" }, { "name": "transform.loop.coalesce_nested", "summary": "Coalesces nested loops including imperfectly nested ones", "description": "Given a loop, collects all nested loops (including imperfectly nested\n loops with operations between them) and coalesces them directly using\n coalesceLoops.\n\n #### Return modes\n\n The return handle points to the coalesced loop.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, $transformed)" }, { "name": "transform.loop.forall_to_for", "summary": "Converts scf.forall into a nest of scf.for operations", "description": "Converts the `scf.forall` operation pointed to by the given handle into a\n set of nested `scf.for` operations. Each new operation corresponds to one\n induction variable of the original \"multifor\" loop.\n\n The operand handle must be associated with exactly one payload operation.\n\n Loops with shared outputs are currently not supported.\n\n #### Return Modes\n\n Consumes the operand handle. Produces a silenceable failure if the operand\n is not associated with a single `scf.forall` payload operation.\n Returns as many handles as the given `forall` op has induction variables\n that are associated with the generated `scf.for` loops.\n Produces a silenceable failure if another number of resulting handles is\n requested.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "Variadic" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.forall_to_parallel", "summary": "Converts scf.forall into a nest of scf.for operations", "description": "Converts the `scf.forall` operation pointed to by the given handle into an\n `scf.parallel` operation.\n\n The operand handle must be associated with exactly one payload operation.\n\n Loops with outputs are not supported.\n\n #### Return Modes\n\n Consumes the operand handle. Produces a silenceable failure if the operand\n is not associated with a single `scf.forall` payload operation.\n Returns a handle to the new `scf.parallel` operation.\n Produces a silenceable failure if another number of resulting handles is\n requested.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "Variadic" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.fuse_sibling", "summary": "Fuse a loop into another loop, assuming the fusion is legal.", "description": "Fuses the `target` loop into the `source` loop assuming they are\n independent of each other. In the fused loop, the arguments, body and\n results of `target` are placed _before_ those of `source`.\n\n For fusion of two `scf.for` loops, the bounds and step size must match. For\n fusion of two `scf.forall` loops, the bounds and the mapping must match.\n Otherwise a silencable failure is produced.\n\n The `target` and `source` handles must refer to exactly one operation,\n otherwise a definite failure is produced. It is the responsibility of the\n user to ensure that the `target` and `source` loops are independent of each\n other -- this op will only perform rudimentary legality checks.\n\n #### Return modes\n\n This operation consumes the `target` and `source` handles and produces the\n `fused_loop` handle, which points to the fused loop.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "source", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "fused_loop", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target `into` $source attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.hoist_loop_invariant_subsets", "summary": "Hoist loop invariant subset ops", "description": "This transform hoists loop-invariant subset ops out of the targeted\n loop-like op. It looks for matching subset extraction/insertion op pairs and\n hoists them. The loop body operates on a newly introduced region iter_arg.\n\n Subset ops are hoisted only from the targeted op. If subset ops should be\n hoisted from an entire loop nest, this transformation must be applied to\n each loop-like op of the loop nest, starting with the innermost loop and\n ending with the outermost loop.\n\n Example:\n ```\n %r = scf.for ... iter_args(%t = %a) -> (tensor) {\n %0 = tensor.extract_slice %t[0][5][1] : tensor to tensor<5xf32>\n %1 = \"test.foo\"(%0) : (tensor<5xf32>) -> (tensor<5xf32>)\n %2 = tensor.insert_slice %1 into %t[0][5][1]\n : tensor<5xf32> into tensor\n scf.yield %2 : tensor\n }\n ```\n Is transformed to:\n ```\n %0 = tensor.extract_slice %a[0][5][1] : tensor to tensor<5xf32>\n %new_loop:2 = scf.for ... iter_args(%t = %a, %h = %0) -> (tensor) {\n %1 = \"test.foo\"(%h) : (tensor<5xf32>) -> (tensor<5xf32>)\n scf.yield %t, %2 : tensor, tensor<5xf32>\n }\n %r = tensor.insert_slice %new_loop#1 into %new_loop#0\n : tensor<5xf32> into tensor\n ```\n\n Subset ops are hoisted only if there are no conflicting subset ops. E.g.,\n if there were a second overlapping extraction in the above example, no ops\n could be hoisted safely.\n\n This transform reads the target handle and modifies the payload. This\n transform does not invalidate any handles, but loop-like ops are replaced\n with new loop-like ops when a subset op is hoisted. The transform rewriter\n updates all handles accordingly.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.loop.outline", "summary": "Outlines a loop into a named function", "description": "Moves the loop into a separate function with the specified name and replaces\n the loop in the Payload IR with a call to that function. Takes care of\n forwarding values that are used in the loop as function arguments. If the\n operand is associated with more than one loop, each loop will be outlined\n into a separate function. The provided name is used as a _base_ for forming\n actual function names following `SymbolTable` auto-renaming scheme to avoid\n duplicate symbols. Expects that all ops in the Payload IR have a\n `SymbolTable` ancestor (typically true because of the top-level module).\n\n #### Return Modes\n\n Returns a handle to the list of outlined functions and a handle to the\n corresponding function call operations in the same order as the operand\n handle.\n\n Produces a definite failure if outlining failed for any of the targets.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "function", "type": "TransformHandleTypeInterface" }, { "name": "call", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "func_name", "type": "StrAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.parallel_for_to_nested_fors", "summary": "Converts scf.parallel into a nest of scf.for operations", "description": "Converts the `scf.parallel` operation pointed to by the given handle into a\n set of nested `scf.for` operations. Each new operation corresponds to one\n dimension of the original parallel loop.\n\n The operand handle must be associated with exactly one payload operation.\n\n Loops with shared outputs are currently not supported.\n\n #### Return Modes\n\n Consumes the operand handle. Produces a silenceable failure if the operand\n is not associated with a single `scf.parallel` payload operation.\n Returns as many handles as the given `parallel` op has dimensions that are\n associated with the generated `scf.for` loops.\n Produces a silenceable failure if another number of resulting handles is\n requested.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "Variadic" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.peel", "summary": "Peels the first or last iteration of the loop", "description": "Rewrite the given loop with a main loop and a partial (first or last) loop.\n When the `peelFront` option is set to true, the first iteration is peeled off.\n Otherwise, updates the given loop so that its step evenly divides its range and puts\n the remaining iteration into a separate loop or a conditional.\n\n In the absence of sufficient static information, this op may peel a loop,\n even if the step always divides the range evenly at runtime.\n\n #### Return modes\n\n This operation ignores non-scf::ForOp ops and drops them in the return.\n The op returns two loops, the peeled loop which has trip count divisible\n by the step, and the remainder loop.\n\n When `peelFront` is true, the first result (remainder loop) executes all\n but the first iteration of the target loop. The second result (peeled\n loop) corresponds to the first iteration of the loop which can be\n canonicalized away in the following optimizations.\n\n When `peelFront` is false, the first result (peeled loop) is the portion\n of the target loop with the highest upper bound that is divisible by the\n step. The second result (remainder loop) contains the remaining iterations. \n \n Note that even though the Payload IR modification may be performed\n in-place, this operation consumes the operand handle and produces a new one.\n\n #### Return Modes\n\n Produces a definite failure if peeling fails.", "operands": [ { "name": "target", "type": "Transform_ScfForOp" } ], "results": [ { "name": "peeled_loop", "type": "TransformHandleTypeInterface" }, { "name": "remainder_loop", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "peel_front", "type": "DefaultValuedAttr" }, { "name": "fail_if_already_divisible", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.pipeline", "summary": "Applies software pipelining to the loop", "description": "Transforms the given loops one by one to achieve software pipelining for\n each of them. That is, performs some amount of reads from memory before the\n loop rather than inside the loop, the same amount of writes into memory\n after the loop, and updates each iteration to read the data for a following\n iteration rather than the current one.\n\n The amount is specified by the attributes.\n\n The values read and about to be stored are transferred as loop iteration\n arguments. Currently supports memref and vector transfer operations as\n memory reads/writes.\n\n #### Return modes\n\n This operation ignores non-scf::For ops and drops them in the return.\n If all the operations referred to by the `target` PDLOperation pipeline\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure. The return handle points to only the subset of\n successfully produced pipelined loops, which can be empty.", "operands": [ { "name": "target", "type": "Transform_ScfForOp" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "iteration_interval", "type": "DefaultValuedAttr" }, { "name": "read_latency", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.loop.promote_if_one_iteration", "summary": "Promote loop if it has one iteration", "description": "Promotes the given target loop op if it has a single iteration. I.e., the\n loop op is removed and only the body remains.\n\n #### Return modes\n\n This transform fails if the target is mapped to ops that are loops. Ops are\n considered loops if they implement the `LoopLikeOpInterface`. Otherwise,\n this transform always succeeds. The transform consumes the target handle and\n modifies the payload.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.loop.unroll", "summary": "Unrolls the given loop with the given unroll factor", "description": "Unrolls each loop associated with the given handle to have up to the given\n number of loop body copies per iteration. If the unroll factor is larger\n than the loop trip count, the latter is used as the unroll factor instead.\n\n #### Return modes\n\n This operation ignores non-`scf.for`, non-`affine.for` ops and drops them\n in the return. If all the operations referred to by the `target` operand\n unroll properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure.\n\n Does not return handles as the operation may result in the loop being\n removed after a full unrolling.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "factor", "type": "ConfinedAttr" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.loop.unroll_and_jam", "summary": "Unrolls and jam the given loop with the given unroll factor", "description": "Unrolls & jams each loop associated with the given handle to have up to the given\n number of loop body copies per iteration. If the unroll factor is larger\n than the loop trip count, the latter is used as the unroll factor instead.\n\n #### Return modes\n\n This operation ignores non-`scf.for`, non-`affine.for` ops and drops them\n in the return. If all the operations referred to by the `target` operand\n unroll properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure.\n\n Does not return handles as the operation may result in the loop being\n removed after a full unrolling.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "factor", "type": "ConfinedAttr" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.match.my.has_operand_satisfying", "summary": "Succeed if any of the operands matches all nested criteria", "operands": [ { "name": "op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "position", "type": "TransformParamTypeInterface" }, { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "$op `:` functional-type($op, results) attr-dict-with-keyword $body" }, { "name": "transform.match.operation_empty", "summary": "Matches if the handle is not associated to any op", "description": "Succeeds if the handle is not associated to any op.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` type($operand_handle)" }, { "name": "transform.match.operation_name", "summary": "Matches a single operation of one of the given kinds", "description": "Succeeds if the operation associated with the operand handle has one of the\n given operation names. Produces a silenceable failure otherwise.\n\n If more than one payload operation is associated with the operand handle,\n produces a definite failure.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "op_names", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$operand_handle $op_names attr-dict `:` type($operand_handle)" }, { "name": "transform.match.param.cmpi", "summary": "Matches if two parameter lists are associated with the same value", "description": "Succeeds if all of the co-indexed values associated with the given\n parameters relate as specified by the predicate (greater than, less than,\n equal to, or their combinations). Comparison treats all values as signed.\n Produces a silenceable failure otherwise.", "operands": [ { "name": "param", "type": "TransformParamTypeInterface" }, { "name": "reference", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "predicate", "type": "MatchCmpIPredicateAttr{eq|ne|lt|le|gt|ge}" } ], "assemblyFormat": "$predicate $param `,` $reference attr-dict `:` type($param)" }, { "name": "transform.match.structured", "summary": "Matches a structured (linalg) operation with additional conditions", "description": "Checks if the payload operation associated with the operand handle is a\n structured operation, that is, an operation that implements\n `LinalgOpInterface`, and that all conditions listed in the body of this\n operation are satisfied. Produces a silenceable failure if the payload\n operation is not structured.\n\n The transform operations nested in the body region are applied one by one.\n If any of them produces a failure, silenceable or definite, the following\n operations are not applied. If the failure propagation mode is \"propagate\",\n silenceable failures are forwarded as the result of this operation. If it is\n \"suppress\", they are ignored and this operation immediately succeeds.\n Definite failures are always propagated immediately.\n\n In case of success, the transform values produced by this operation are\n associated with the same payload as the operands of the block terminator. If\n any of the nested operations produced a silenceable failure, regardless of\n the failure propagation mode, the transform values produced by this\n operation that correspond to the already defined terminator operands are\n associated with the same payload as the already defined terminator operands.\n Other values produced by this operation are associated with empty payloads.\n\n If the failure propagation mode is not specified, it is considered\n \"propagate\" by default. The \"suppress\" mode can be used to specify optional\n matches.\n\n #### Return modes\n\n This operation only reads all operand handles and produces all resulting\n handles. It succeeds in \"propagate\" mode if the payload operation is a\n structured operation and if all the nested operations succeed. It succeeds\n in \"suppress\" mode as long as the operand handle is associated with exactly\n one payload operation. It produces a definite failure when the handle is\n not associated with exactly one payload operation.", "operands": [ { "name": "current", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "failure_propagation_mode", "type": "OptionalAttr" } ], "regions": [ { "name": "body_region", "type": "SizedRegion<1>" } ], "assemblyFormat": "(`failures` `(` $failure_propagation_mode^ `)`)?$current `:` custom(type($current), type($outputs))attr-dict-with-keyword regions" }, { "name": "transform.match.structured.body", "summary": "Checks if the body of the structured op satisfies some criteria", "description": "Checks if the body of the structured payload op satisfies one of the\n following mutually exclusive criteria specified by attributes:\n\n * `reduction_position`: the body of the structured payload op implements\n a reduction of the `n`-th operand (`n` is the value of the attribute)\n using a single combiner operation;\n\n * `passthrough`: the body of the structured payload op only forwards\n inputs to the outputs (copy or broadcast).\n\n * `elementwise`: the body of the structured payload op represents an\n elementwise operation.\n\n * `contraction`: the body of the structured payload op is a contraction\n of the form `((bbarg0, bbarg1), bbarg2)` where `` and\n `` are binary operations whose names are specified in the attribute\n and operands can be permuted and optionally forwarded through a chain of\n unary side effect-free operations.#### Return modes\n\n Succeeds if the operation body satisfies the specified criteria, produces a\n silenceable failure otherwise. Produces a definite failure if the operand is\n not associated with a single payload op.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "reduction_position", "type": "OptionalAttr" }, { "name": "passthrough", "type": "UnitAttr" }, { "name": "elementwise", "type": "UnitAttr" }, { "name": "contraction", "type": "OptionalAttr>" } ], "assemblyFormat": "$operand_handle attr-dict `:` type($operand_handle)" }, { "name": "transform.match.structured.classify_contraction_dims", "summary": "Checks if an operation has contraction-like dimensions and returns them", "description": "Checks if the structured payload op has contraction-like dimensions as\n follows:\n\n C(batch, m, n) += A(batch, m, k) * B(batch, k, n)\n\n That is:\n \n - 'batch' are parallel dimensions used in inputs and result;\n - 'm' are parallel dimensions used in the LHS and result;\n - 'n' are parallel dimensions used in rhe RHS and result;\n - 'k' are reduction dimensions present only in LHS and RHS.\n\n Note that this doesn't check the operation in the body.#### Return modes\n\n Succeeds if the operation has the contraction-like dimensions, produces a\n silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "batch", "type": "TransformParamTypeInterface" }, { "name": "m", "type": "TransformParamTypeInterface" }, { "name": "n", "type": "TransformParamTypeInterface" }, { "name": "k", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.match.structured.classify_convolution_dims", "summary": "Checks if an operation has convolution-like dimensions and returns them", "description": "Checks if the structured payload op has convolution-like dimensions as\n follows:\n\n C(batch, depth, oi, oc) += A(batch, depth, oi, ic) * B(fl, depth, ic, oc)\n\n That is:\n\n - 'batch' are parallel dimensions used in the input and result;\n - 'output_image' ('oi') are parallel dimensions used in the input and result;\n - 'output_channel' ('oc') are parallel dimensions used in the filter and result;\n - 'filter_loop' ('fl') are reduction dimensions representing the dimensions of the sliding window;\n - 'input_channel' ('ic') are reduction dimensions present only in the input and filter.\n - 'depth' ('ic') are parallel dimensions present in the input, filter, and output.\n\n Additionally this will match stride and dilation information for the convolution:\n - 'strides' are the static strides per convolution window dimension;\n - 'dilations' are the static dilations per convolution window dimension.\n\n Note that this doesn't check the operation in the body.#### Return modes\n\n Succeeds if the operation has the convolution-like dimensions, produces a\n silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "batch", "type": "TransformParamTypeInterface" }, { "name": "output_image", "type": "TransformParamTypeInterface" }, { "name": "output_channel", "type": "TransformParamTypeInterface" }, { "name": "filter_loop", "type": "TransformParamTypeInterface" }, { "name": "input_channel", "type": "TransformParamTypeInterface" }, { "name": "depth", "type": "TransformParamTypeInterface" }, { "name": "strides", "type": "TransformParamTypeInterface" }, { "name": "dilations", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.match.structured.dim", "summary": "Checks if the dimensions of the structured op satisfy some criteria", "description": "Checks if the dimensions (loop ranges) of the structured payload op satisfy\n the criteria specified as attributes. May capture the numeric value of the\n dimension into a parameter that it returns.The following mutually exclusive conditions are available as unit\n attributes:\n\n * `parallel`: the dimension corresponds to a parallel loop;\n * `reduction`: the dimension corresponds to a reduction loop.\n\n If the result type is specified, associates the parameter with the (static)\n values of dimensions in the same order as listed and preserving the natural\n order for `all` and `except`. Specifically, if `-1, -2` are specified, the\n parameter will be associated with the value of the second-to-last dimension\n followed by the last dimension. If the dimension is dynamic, the parameter\n will contain a negative value corresponding to kDynamic in C++.#### Return modes\n\n Succeeds if the specified dimensions satisfy the specified criteria,\n produces a silenceable failure otherwise. Produces a definite failure if\n the operand is not associated with a single payload op.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "raw_dim_list", "type": "DenseI64ArrayAttr" }, { "name": "is_inverted", "type": "UnitAttr" }, { "name": "is_all", "type": "UnitAttr" }, { "name": "parallel", "type": "UnitAttr" }, { "name": "reduction", "type": "UnitAttr" } ], "assemblyFormat": "$operand_handle `[`custom($raw_dim_list, $is_inverted, $is_all)`]` attr-dict `:` custom(type($operand_handle), type($result))" }, { "name": "transform.match.structured.elemental_bitwidth", "summary": "Captures the bitwidth of the value's elemental type as a parameter", "description": "Produces a transform dialect parameter associated with the bitwidth of the\n elemental type of the payload value passed as the operand.#### Return modes\n\n Succeeds if the operand is associated with exactly one payload value of\n `ShapedType`. Produces a silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformValueHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.match.structured.init", "summary": "Captures init operand(s) of a structured operation", "description": "Produces a transform dialect value depending on the result type:\n - If the result type is a value handle, it will be associated with the init\n operand(s) of the payload operation associated with the operand handle.\n - If the result type is an operation handle, it will be associated with the\n operation defining the init operand(s) of the payload operation associated\n with the operand handle.\n - If the result type is an affine map parameter type, it will be associated\n with the indexing map that corresponds to the init operand(s) of the\n payload operation associated with the operand handle.\n\n For example, given the following operation:\n\n ```mlir\n %arg3 = linalg.fill\n linalg.matmul ins(%arg1, %arg2 : ...) outs(%arg3 : ...)\n ```\n\n in case of a successful match for init operand 0 this operation will return,\n for each of the respective cases above:\n\n - A handle to `%arg3` if the result is a value handle.\n - A handle to `linalg.fill` if the result is an operation handle.\n - A parameter containing the result map of the matrix multiplication, i.e.\n `affine_map<(d0, d1, d2) -> (d0, d1)>` if the result is an affine\n map parameter.\n\n The match succeeds if the conditions specified as attributes succeed.#### Return modes\n\n Succeeds if all init(outs) indexes are in bounds, produces a silenceable\n failure otherwise. Additionally, when the result is an operation handle,\n produces a silenceable failure if the init(outs) specification defines\n more than one init(outs) or if the operand is not an operation result.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Optional>" } ], "attributes": [ { "name": "raw_position_list", "type": "DenseI64ArrayAttr" }, { "name": "is_inverted", "type": "UnitAttr" }, { "name": "is_all", "type": "UnitAttr" }, { "name": "permutation", "type": "UnitAttr" }, { "name": "projected_permutation", "type": "UnitAttr" } ], "assemblyFormat": "$operand_handle `[`custom($raw_position_list, $is_inverted, $is_all)`]` attr-dict `:` custom(type($operand_handle), type($result))" }, { "name": "transform.match.structured.input", "summary": "Captures input operand(s) of a structured operation", "description": "Produces a transform dialect value depending on the result type:\n \n - If the result type is a value handle, it will be associated with the input\n operand(s) of the payload operation associated with the operand handle.\n - If the result type is an operation handle, it will be associated with the\n operation defining the input operand(s) of the payload operation associated\n with the operand handle.\n - If the result type is an affine map parameter type, it will be associated\n with the indexing map that corresponds to the input operand(s) of the\n payload operation associated with the operand handle.\n\n For example, given the following operation:\n\n ```mlir\n %arg1 = some.op\n linalg.matmul ins(%arg1, %arg2 : ...) outs(%arg3 : ...)\n ```\n\n in case of a successful match for operand 0 this operation will return, for\n each of the respective cases above:\n\n - A handle to `%arg1` if the result is a value handle.\n - A handle to `some.op` if the result is an operation handle.\n - A parameter containing the LHS map of the matrix multiplication, i.e.\n `affine_map<(d0, d1, d2) -> (d0, d2)>` if the result is an affine\n map parameter.\n\n The match succeeds if the conditions specified as attributes succeed.#### Return modes\n\n Succeeds if all input indexes are in bounds, produces a silenceable failure\n otherwise. Additionally, when the result is an operation handle, produces a\n silenceable failure if the input specification defines more than one input\n or if the operand is not an operation result.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "Optional>" } ], "attributes": [ { "name": "raw_position_list", "type": "DenseI64ArrayAttr" }, { "name": "is_inverted", "type": "UnitAttr" }, { "name": "is_all", "type": "UnitAttr" }, { "name": "permutation", "type": "UnitAttr" }, { "name": "projected_permutation", "type": "UnitAttr" } ], "assemblyFormat": "$operand_handle `[`custom($raw_position_list, $is_inverted, $is_all)`]` attr-dict `:` custom(type($operand_handle), type($result))" }, { "name": "transform.match.structured.num_inits", "summary": "Captures the number of init(outs) operands of a structuredoperation as parameter", "description": "Produces a transform dialect parameter value associated with an integer\n attribute containing the number of init(outs) operands of the payload\n operation associated with the operand handle.#### Return modes\n\n Succeeds if the operand is associated with exactly one structured payload\n operation. Produces a silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.match.structured.num_inputs", "summary": "Captures the number of input operands of a structured operation as parameter", "description": "Produces a transform dialect parameter value associated with an integer\n attribute containing the number of input operands of the payload operation\n associated with the operand handle.#### Return modes\n\n Succeeds if the operand is associated with exactly one structured payload\n operation. Produces a silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.match.structured.rank", "summary": "Captures the rank of a structured operation as parameter", "description": "Produces a transform dialect parameter value associated with an integer\n attribute containing the rank of the structured payload operation associated\n with the operand handle.#### Return modes\n\n Succeeds if the operand is associated with exactly one structured payload\n operation. Produces a silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "rank", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$operand_handle attr-dict `:`\n custom(type($operand_handle), type($rank), \"false\")" }, { "name": "transform.match.structured.result", "summary": "Captures the result of a structured payload operation in an op or value handle", "description": "Produces a transform dialect value handle associated with the payload value\n defined as a result of the payload operation associated with the operand\n handle, or an operation handle to an operation using the produced result\n with additional constraints specified by the attributes as follows.\n\n * If `any` is specified, binds the resulting handle to any operation using\n the result and succeeds.\n * If `single` is specified, binds the resulting handle to the only\n operation using the result or fails if there is more than one (or no)\n such operation.\n\n The number of the result is specified as `position` attribute. It may take\n positive and negative values. Negative values are interpreted as counting\n results from backwards, e.g., `-1` means the last result and `-2` means the\n second-to-last result. In any case, the position must be in bounds for the\n given payload operation. A silenceable failure is produced for out-of-bounds\n positions.#### Return modes\n\n Succeeds if the position is in bounds and if the user operation could be\n found when requested. Produces a silenceable failure otherwise.", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformAnyHandle" } ], "attributes": [ { "name": "position", "type": "I64Attr" }, { "name": "any", "type": "UnitAttr" }, { "name": "single", "type": "UnitAttr" } ], "assemblyFormat": "$operand_handle `[` $position `]` (`any` $any^)? (`single` $single^)?attr-dict `:` functional-type(operands, results)" }, { "name": "transform.match.structured.yield", "summary": "Terminator for transform.match.structured blocks", "description": "Forwards the payload association from the operands to the results of the\n parent op. Always succeeds.", "operands": [ { "name": "handles", "type": "Variadic" } ], "assemblyFormat": "$handles attr-dict (`:` type($handles)^)?" }, { "name": "transform.memref.alloca_to_global", "description": "Inserts a new `memref.global` for each provided `memref.alloca` into the\n nearest symbol table (e.g., a `builtin.module`) and replaces it with a\n `memref.get_global`. This is useful, for example, for allocations that\n should reside in the shared memory of a GPU, which have to be declared as\n globals.\n\n #### Example\n\n Consider the following transform op:\n\n ```mlir\n %get_global, %global =\n transform.memref.alloca_to_global %alloca\n : (!transform.op<\"memref.alloca\">)\n -> (!transform.any_op, !transform.any_op)\n ```\n\n and the following input payload:\n\n ```mlir\n module {\n func.func @func() {\n %alloca = memref.alloca() : memref<2x32xf32>\n // usages of %alloca...\n }\n }\n ```\n\n then applying the transform op to the payload would result in the following\n output IR:\n\n ```mlir\n module {\n memref.global \"private\" @alloc : memref<2x32xf32>\n func.func @func() {\n %alloca = memref.get_global @alloc : memref<2x32xf32>\n // usages of %alloca...\n }\n }\n ```\n\n #### Return modes\n\n Succeeds always. The returned handles refer to the `memref.get_global` and\n `memref.global` ops that were inserted by the transformation.", "operands": [ { "name": "alloca", "type": "Transform_MemRefAllocaOp" } ], "results": [ { "name": "getGlobal", "type": "TransformHandleTypeInterface" }, { "name": "global", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$alloca attr-dict `:` functional-type(operands, results)" }, { "name": "transform.memref.erase_dead_alloc_and_stores", "description": "This applies memory optimization on memref. In particular it does store to\n load forwarding, dead store elimination and dead alloc/alloca elimination.\n\n #### Return modes\n\n This operation applies a set of memory optimization on the whole region of\n the operand.\n\n The transformation does not consume the target handle. It modifies the\n payload. Dead allocations, loads and stores are silently dropped from all\n mappings.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.memref.make_loop_independent", "description": "Rewrite the targeted ops such that their index-typed operands no longer\n depend on any loop induction variable of the `num_loop` enclosing `scf.for`\n loops. I.e., compute an upper bound that is independent of any such loop IV\n for every tensor dimension. The transformed op could then be hoisted from\n the `num_loop` enclosing loops. To preserve the original semantics, place a\n `memref.subview` inside the loop.\n\n Currently supported operations are:\n - memref.alloca: Replaced with a new memref.alloca with upper bound sizes,\n followed by a memref.subview.\n\n #### Return modes\n\n This operation fails if at least one induction variable could not be\n eliminated. In case the targeted op is already independent of induction\n variables, this transform succeeds and returns the unmodified target op.\n\n Otherwise, the returned handle points to a subset of the produced ops:\n - memref.alloca: The returned handle points to the memref.subview op.\n\n This transform op consumes the target handle and produces a result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "num_loops", "type": "I64Attr" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, $transformed)" }, { "name": "transform.memref.multibuffer", "summary": "Multibuffers an allocation", "description": "Transformation to do multi-buffering/array expansion to remove\n dependencies on the temporary allocation between consecutive loop\n iterations. This transform expands the size of an allocation by\n a given multiplicative factor and fixes up any users of the\n multibuffered allocation.\n If skip analysis is not set the transformation will only apply\n if it can prove that there is no data being carried across loop\n iterations.\n\n #### Return modes\n\n This operation returns the new allocation if multi-buffering\n succeeds, and failure otherwise.", "operands": [ { "name": "target", "type": "Transform_MemRefAllocOp" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "factor", "type": "ConfinedAttr" }, { "name": "skip_analysis", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.merge_handles", "summary": "Merges handles into one pointing to the union of payload ops", "description": "Creates a new Transform IR handle value that points to the same Payload IR\n operations/values/parameters as the operand handles. The Payload IR elements\n are listed in the same order as they are in the operand handles, grouped by\n operand handle, e.g., all Payload IR associated with the first handle comes\n first, then all Payload IR associated with the second handle and so on. If\n `deduplicate` is set, do not add the given Payload IR operation, value, or\n parameter more than once to the final list regardless of it coming from the\n same or different handles. Consumes the operands and produces a new handle.", "operands": [ { "name": "handles", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Transform_AnyHandleOrParamType" } ], "attributes": [ { "name": "deduplicate", "type": "UnitAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`deduplicate` $deduplicate^)? $handles attr-dict `:` type($result)" }, { "name": "transform.my.call_to_op", "operands": [ { "name": "call", "type": "CallOpInterfaceHandle" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$call attr-dict `:` functional-type(operands, results)" }, { "name": "transform.my.change_call_target", "summary": "Changes the callee of a call operation to the specified one", "description": "For each `func.call` payload operation associated with the handle, changes its \n callee to be the symbol whose name is provided as an attribute to this operation.\n\n Generates a silenceable failure if the operand is associated with payload operations \n that are not `func.call`.\n Only reads the operand.", "operands": [ { "name": "call", "type": "AnyTypeOf<[Transform_ConcreteOpType, CallOpInterfaceHandle]>" } ], "attributes": [ { "name": "new_target", "type": "StrAttr" } ], "assemblyFormat": "$call `,` $new_target attr-dict `:` qualified(type($call))" }, { "name": "transform.named_sequence", "summary": "Named transform sequence that can be included elsewhere", "description": "Defines a named (callable, function-like) sequence of other Transform\n dialect operations that can be included using `transform.include` as part of\n another Transform dialect construct. This sequence is not processed\n immediately but rather dispatched to when the inclusion is processed. The\n arguments and results can be used to communicate a subset of mapping into\n the named sequence. The sequence must consist of a single block and end with\n a `transform.yield` terminator. The operands of the terminator become the\n results of the `transform.include`.\n\n When dispatched to, the operations in the named sequence are executed one by\n one, similarly to the regular unnamed sequence. The failure propagation mode\n is specified on the `transform.include`. Different inclusions may use\n different failure propagation modes. This transform operation always\n succeeds by itself, but the inclusion may fail if any of the operations\n fail.\n\n Named sequences can only appear at the top-level of the Transform dialect\n nesting structure. That is, they cannot be nested in other Transform dialect\n operations. Furthermore, one of the ancestors must have the `SymbolTable`\n trait and have the `transform.with_named_sequence` attribute attached.\n\n Named sequences may include other named sequences via `transform.include`,\n but recursion is *not* allowed.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrBase<::mlir::FunctionType, function type attribute>" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "MaxSizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "transform.num_associations", "summary": "Returns the number of payload objects associated with the argument", "description": "Given an argument, handle or parameter, returns a new parameter associated\n with a single 64-bit number that corresponds to the number of payload\n objects (operations or values for a handle, attributes for a parameter)\n associated with the argument.\n\n Always succeeds.", "operands": [ { "name": "handle", "type": "Transform_AnyHandleOrParamType" } ], "results": [ { "name": "num", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "$handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.nvgpu.create_async_groups", "description": "Look for global to shared memory copies within the targeted op in the form\n of vector transfer ops and convert them to async copies when possible.\n Consecutive copies are put into the same group. A \"wait\" operation is\n inserted right at the of end the group.\n\n `bypass_l1` specifies whether `bypassL1` attributes should be added to\n the async copies. `bypass_l1` is a compiler hint: only 16 byte transfers\n can bypass the L1 cache, so this attribute is not set for any other transfer\n sizes.\n\n #### Return modes\n\n This op consumes the `target` handle and produces the `result` handle, which\n is mapped to the same payload operations as the `target` handle. The op\n modifies the payload.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "bypass_l1", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.nvgpu.pipeline_shared_memory_copies", "summary": "Applies software pipelining to a given loop with shared memory copies", "description": "Applies software pipelining to a given scf.for loop. The pipelining\n strategy will look for a load into shared memory and pipeline it to overlap\n it with the rest of the loop.\n \n NOTE: It is user responsibility to ensure that there are no dependency\n between `depth` iterations of the loop by using multi-buffering. It is\n also user responsibility to ensure a sufficient amount of shared memory\n is allocated to cover eventual writes by `depth-1` speculative\n iterations.\n\n `depth` will indicate how many stages the software pipeline should have.\n `peel_epilogue` allows to force the epilogue to be peeled out instead of\n potentially using predicated operations for the epilogue phase.\n\n #### Return modes\n\n Consumes the operand handle and produces a result handle pointing to the\n loop, which may or may not have been pipelined. Produces a definite failure\n if the loop pipeliner mutated the IR before failing to pipeline, in\n particular if `peel_epilogue` is not set and the loop body doesn't support\n predication. If failure propagation mode is set to \"propagate\", produces a\n silenceable failure when pipelining preconditions, e.g., loop bound being\n static, are not met or when the loop wasn't pipelined because due to the\n lack of loads into shared memory. If the failure propagation mode is set\n to \"suppress\" (default), succeeds in these case and associates the result\n handle with the original loop.\n\n TODO: the shared memory part and behavior specific to NVGPU should be\n made orthogonal to pipelining so that `transform.loop.pipeline` becomes\n usable here.", "operands": [ { "name": "for_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "depth", "type": "I64Attr" }, { "name": "peel_epilogue", "type": "UnitAttr" }, { "name": "failure_propagation_mode", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`failures` `(` $failure_propagation_mode `)`\n $for_op\n attr-dict \n `:` functional-type(operands, results)" }, { "name": "transform.nvgpu.rewrite_copy_as_tma", "description": "Rewrite a copy operation on memref to tma operations that transit through\n shared memory.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.nvgpu.rewrite_matmul_as_mma_sync", "description": "Rewrite a matmul operation on memref to an mma.sync operation on vectors.\n\n Memory copies with the required access patterns are automatically inserted.\n Operations that do not have a 1-1 mapping to mma.sync operations are left\n unchanged.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.param.constant", "summary": "Produces a new transform dialect parameter value associated with the given attribute", "description": "Produces a new transform dialect parameter associated with the singleton\n list containing the given attribute. The operation itself always succeeds,\n but the general association check may fail if the parameter type does not\n accept the given kind of attribute as valid.", "results": [ { "name": "param", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "assemblyFormat": "$value attr-dict `->` type($param)" }, { "name": "transform.payload", "summary": "Optional container for transform payloads", "description": "Contains payload operations on which transforms operate and serves as a\n storage location for information between multiple transform invocations.\n\n The operations contained in this payload must satisfy the normal forms specified by the `normal_forms` attribute.", "attributes": [ { "name": "normal_forms", "type": "TypedArrayAttrBase" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword regions" }, { "name": "transform.pdl_match", "summary": "Finds ops that match the named PDL pattern", "description": "Find Payload IR ops nested within the Payload IR op associated with the\n operand that match the PDL pattern identified by its name. The pattern is\n expected to be defined in the closest surrounding `WithPDLPatternsOp`.\n\n Produces a Transform IR value associated with the list of Payload IR ops\n that matched the pattern. The order of results in the list is that of the\n Operation::walk, clients are advised not to rely on a specific order though.\n If the operand is associated with multiple Payload IR ops, finds matching\n ops nested within each of those and produces a single list containing all\n of the matched ops.\n\n The transformation is considered successful regardless of whether some\n Payload IR ops actually matched the pattern and only fails if the pattern\n could not be looked up or compiled.", "operands": [ { "name": "root", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "matched", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "pattern_name", "type": "SymbolRefAttr" } ], "assemblyFormat": "$pattern_name `in` $root attr-dict `:` functional-type(operands, results)" }, { "name": "transform.print", "summary": "Dump each payload op", "description": "Prints each payload op that is associated with the `target` operand to\n `stdout`. It also prints the `name` string attribute. If no target is\n specified, the top-level op is dumped.\n\n This op is useful for printf-style debugging.\n\n Supported printing flag attributes:\n * `assume_verified` -- skips verification when the unit attribute is\n specified. This improves performace but may lead to crashes and\n unexpected behavior when the printed payload op is invalid.\n * `use_local_scope` -- prints in local scope when the unit attribute is\n specified. This improves performance but may not be identical to\n printing within the full module.\n * `skip_regions` -- does not print regions of operations when the unit\n attribute is specified.", "operands": [ { "name": "target", "type": "Optional" } ], "attributes": [ { "name": "name", "type": "OptionalAttr" }, { "name": "assume_verified", "type": "OptionalAttr" }, { "name": "use_local_scope", "type": "OptionalAttr" }, { "name": "skip_regions", "type": "OptionalAttr" } ], "assemblyFormat": "$target attr-dict (`:` type($target)^)?" }, { "name": "transform.replicate", "summary": "Lists payload ops multiple times in the new handle", "description": "Produces a new handle associated with a list of payload IR ops that is\n computed by repeating the list of payload IR ops associated with the\n operand handle as many times as the \"pattern\" handle has associated\n operations. For example, if pattern is associated with [op1, op2] and the\n operand handle is associated with [op3, op4, op5], the resulting handle\n will be associated with [op3, op4, op5, op3, op4, op5].\n\n This transformation is useful to \"align\" the sizes of payload IR lists\n before a transformation that expects, e.g., identically-sized lists. For\n example, a transformation may be parameterized by same notional per-target\n size computed at runtime and supplied as another handle, the replication\n allows this size to be computed only once and used for every target instead\n of replicating the computation itself.\n\n Note that it is undesirable to pass a handle with duplicate operations to\n an operation that consumes the handle. Handle consumption often indicates\n that the associated payload IR ops are destroyed, so having the same op\n listed more than once will lead to double-free. Single-operand\n MergeHandlesOp may be used to deduplicate the associated list of payload IR\n ops when necessary. Furthermore, a combination of ReplicateOp and\n MergeHandlesOp can be used to construct arbitrary lists with repetitions.", "operands": [ { "name": "pattern", "type": "TransformHandleTypeInterface" }, { "name": "handles", "type": "Variadic" } ], "results": [ { "name": "replicated", "type": "Variadic" } ], "traits": [ { "type": "AllTypesMatch<['handles', 'replicated']>" } ], "assemblyFormat": "`num` `(` $pattern `)` $handles attr-dict `:` type($pattern) `,` type($handles)" }, { "name": "transform.scf.take_assumed_branch", "description": "Given an scf.if conditional, inject user-defined information that it is\n always safe to execute only the if or else branch.\n\n This is achieved by just replacing the scf.if by the content of one of its\n branches.\n\n This is particularly useful for user-controlled rewriting of conditionals\n that exist solely to guard against out-of-bounds behavior.\n\n At the moment, no assume or assert operation is emitted as it is not always\n desirable. In the future, this may be controlled by a dedicated attribute.\n\n #### Return modes\n\n The transform only consumes its operand and does not produce any result.\n The transform definitely fails if `take_else_branch` is specified and the\n `else` region is empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "take_else_branch", "type": "OptionalAttr" } ], "assemblyFormat": "$target\n (`take_else_branch` $take_else_branch^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.select", "summary": "Select payload ops by name", "description": "The handle defined by this Transform op corresponds to all operations among\n `target` that have the specified properties. Currently the following\n properties are supported:\n\n - `op_name`: The op must have the specified name.\n\n The result payload ops are in the same relative order as the targeted ops.\n This transform op reads the `target` handle and produces the `result`\n handle. It reads the payload, but does not modify it.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "op_name", "type": "StrAttr" } ], "assemblyFormat": "$op_name `in` $target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.sequence", "summary": "Contains a sequence of other transform ops to apply", "description": "The transformations indicated by the sequence are applied in order of their\n appearance. Each value produced by a transformation within the sequence\n corresponds to a group of operations or values in the payload IR, or to a\n group of parameters, depending on the type of the value. The behavior of the\n operation when a nested transformation produces a silenceable error is\n controlled by the `failure_propagation_mode` attribute. When set to\n `propagate`, the failure of any nested transformation in the sequence\n implies immediate failure of the entire sequence with a silenceable error,\n and no further transformation is attempted. When set to `suppress`,\n silenceable errors in nested operations are ignored and further\n transformations are applied. Beware that even silenceable errors may leave\n the payload IR in a state unsuitable for further transformations. It is the\n responsibility of the caller to ensure the following transformations are\n robust enough when errors are suppressed. Definite errors reported by nested\n transformations abort the sequence regardless of the propagation mode. The\n set of modes may be extended in the future, e.g., to collect silenceable\n errors and report them after attempting all transformations in the sequence.\n\n The entry block of this operation has a single argument that maps to either\n the operand if provided or the top-level container operation of the payload\n IR, typically the root operation of the pass interpreting the transform\n dialect. Operand omission is only allowed for sequences not contained in\n another sequence.\n\n The type of the block argument must match the type of the operand. If the\n sequence is a top-level transform (without an operand), it can be used for\n matching operations if the specified type within the top-level container\n payload IR (including the container op itself). E.g.:\n\n ```mlir\n transform.sequence failures(propagate) {\n ^bb1(%arg1: !transform.any_op):\n // %arg1 is mapped to the top-level container of the payload IR, which is\n // typically a module\n }\n\n transform.sequence failures(propagate) {\n ^bb1(%arg1: !transform.op<\"func.func>\"):\n // %arg1 is mapped to all \"func.func\" ops within and including the\n // top-level container of the payload IR. Nested operations that have the\n // specified op type are not included.\n }\n ```\n\n The body of the sequence terminates with an implicit or explicit\n `transform.yield` op. The operands of the terminator are returned as the\n results of the sequence op.", "operands": [ { "name": "root", "type": "Optional" }, { "name": "extra_bindings", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "failure_propagation_mode", "type": "FailurePropagationMode{propagate|suppress}" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "defaultDialect": "transform", "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "custom($root, type($root), $extra_bindings, type($extra_bindings)) (`->` type($results)^)? `failures` `(` $failure_propagation_mode `)` attr-dict-with-keyword regions" }, { "name": "transform.smt.constrain_params", "summary": "Express contraints on params interpreted as symbolic values", "description": "Allows expressing constraints on params using the SMT dialect.\n\n Each Transform-dialect param provided as an operand has a corresponding\n argument of SMT-type in the region. The SMT-Dialect ops in the region use\n these params-as-SMT-vars as operands, thereby expressing relevant\n constraints on their allowed values.\n\n Computations w.r.t. passed-in params can also be expressed through the\n region's SMT-ops. Namely, the constraints express relationships to other\n SMT-variables which can then be yielded from the region (with `smt.yield`).\n\n The semantics of this op is that all the ops in the region together express\n a constraint on the params-interpreted-as-smt-vars. The op fails in case the\n expressed constraint is not satisfiable per SMTLIB semantics. Otherwise the\n op succeeds and any one satisfying assignment is used to map the\n SMT-variables yielded in the region to `transform.param`s.\n\n ---\n\n TODO: currently the operational semantics per the Transform interpreter is\n to always fail. The intention is build out support for hooking in your own\n operational semantics so you can invoke your favourite solver to determine\n satisfiability of the corresponding constraint problem.", "operands": [ { "name": "params", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "`(` $params `)` attr-dict `:` functional-type(operands, results) $body" }, { "name": "transform.sparse_tensor.match.sparse_inout", "description": "Checks if the payload op has any sparse inputs and/or outputs.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:`\n custom(type($target), type($result), \"false\")" }, { "name": "transform.split_handle", "summary": "Splits a handle or parameter into multiple values", "description": "Splits `handle` into one or multiple handles, as specified by the number\n of results of this operation. `handle` should be mapped to as many payload\n ops, values or parameteres as there are results. Otherwise, this transform\n will fail producing a silenceable failure by default. Each result handle\n is mapped to exactly one payload unless specified otherwise by attributes\n described below. The order of the payloads is preserved, i.e., the i-th\n payload is mapped to the i-th result handle.\n\n This operation is useful for ensuring a statically known number of\n payloads are tracked by the source `handle` and to extract them into\n individual handles that can be further manipulated in isolation.\n\n If there are more payloads than results, the remaining payloads are mapped to\n the result with index `overflow_result`. If no `overflow_result` is\n specified, the transform produces a silenceable failure.\n\n If there are fewer payload ops than results, the transform produces a\n silenceable failure if `fail_on_payload_too_small` is set to \"true\".\n Otherwise, it succeeds and the remaining result handles are not mapped to\n anything. It also succeeds if `handle` is empty and\n `pass_through_empty_handle` is set to \"true\", regardless of\n `fail_on_payload_too_small`.", "operands": [ { "name": "handle", "type": "Transform_AnyHandleOrParamType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "pass_through_empty_handle", "type": "DefaultValuedAttr" }, { "name": "fail_on_payload_too_small", "type": "DefaultValuedAttr" }, { "name": "overflow_result", "type": "OptionalAttr" } ], "assemblyFormat": "$handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.bufferize_to_allocation", "description": "This transform bufferizes the targeted operation and materializes the\n result in a new allocation. It replaces all original uses of the target\n result with the newly allocated buffer, wrapped in a\n `bufferization.to_tensor` op. It returns a handle to the newly allocated\n buffer. Furthermore, it returns a handle that is mapped to all newly created\n ops.\n\n Only bufferizable ops are that bufferize to a memory write or have an\n aliasing OpOperand (and do not themselves bufferize to an allocation) are\n supported. They are bufferized using their BufferizableOpInterface\n implementation. E.g.:\n\n ```\n %0 = tensor.insert %f into %dest[%pos] : tensor<10xf32>\n ```\n\n Is bufferized to:\n\n ```\n %alloc = memref.alloc() : memref<10xf32>\n bufferization.materialize_in_destination %dest in %alloc\n memref.store %f, %alloc[%pos] : memref<10xf32>\n %0 = bufferization.to_tensor %alloc restrict writable : memref<10xf32>\n ```\n\n Selected ops that bufferize to an allocation (or need special handling) are\n also supported:\n - `tensor.pad` is lowered to an allocation, followed by a `linalg.fill` and\n and a buffer copy (all on memrefs).\n - `vector.mask` is bufferized together with its region. The allocation is\n placed in front of the `vector.mask` op.\n\n An optional memory space attribute can be specified for the materialized\n buffer allocation.\n\n If a memory copy is needed, a \"bufferization.materialize_in_destination\" is\n used when possible. This is an op with tensor semantics that will bufferize\n to a memory copy later. Which concrete op will be used for the memory copy\n is up to the bufferization framework. Alternatively, a custom memcpy op can\n be specified via `memcpy_op`. Currently supported are \"memref.copy\" and\n \"linalg.copy\". In that case, the source of each memcpy must not have a\n custom memory space. Furthermore, because the future buffer layout unknown\n for a given tensor, a fully dynamic layout is assumed for best\n compatibility. Users should use \"bufferization.materialize_in_destination\"\n when possible.\n\n \"memref.alloc\" is used for new buffer allocations. The buffer is deallocated\n at the end of the block if the \"emit_dealloc\" attribute is present. If this\n attribute is not present, the allocated memory will be leaked. However,\n running the `-buffer-deallocation-pipeline` after all bufferization is done\n will properly insert the corresponding deallocation(s). Custom allocation\n ops can be specified via `alloc_op`. Currently supported are \"memref.alloc\"\n and \"memref.alloca\". In case of a \"memref.alloca\", the buffer is not\n deallocated.\n\n If `bufferize_destination_only` is set, only the destination operands of the\n op are bufferized to a new memory allocation, but not the op itself.\n\n #### Return modes\n\n This operation consumes the `target` handle and produces the\n `allocated_buffer` and `new_ops` handles. It always succeeds.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "allocated_buffer", "type": "Transform_AnyValue" }, { "name": "new_ops", "type": "Transform_AnyOpType" } ], "attributes": [ { "name": "memory_space", "type": "OptionalAttr" }, { "name": "memcpy_op", "type": "DefaultValuedAttr" }, { "name": "alloc_op", "type": "DefaultValuedAttr" }, { "name": "bufferize_destination_only", "type": "UnitAttr" }, { "name": "emit_dealloc", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.structured.continuous_tile_sizes", "description": "This transform emits the IR computing the list of (1) exponentially\n diminishing tile sizes that are powers of 2; and (2) the corresponding\n chunk-sizes the target op should be split into along the given dimension.\n\n For example, for `target_size` 9, and `dimension` 0 for the following\n linalg op as target\n\n ```\n %0 = linalg.matmul ins(%arg0, %arg1: tensor<25x34xf32>, tensor<34x25xf32>)\n outs(%arg2: tensor<25x25xf32>)\n ```\n\n the first result `tile_sizes` will be a list of diminishing tile sizes\n 9, 4, 2, 1; and the second result will be a list of chunk sizes\n 18, 4, 2, 1 that the corresponding dimension should be split into.\n\n After the target op has been split along the given dimension (for example\n using multiway split), each chunk can be tiled with the corresponding tile\n size in the `tile_sizes` list generated as a result of this op.\n\n Specifying the output type as !transform.param will cause `tile_sizes`\n and `chunk_sizes` to be computed statically and not dynamically.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "tile_sizes", "type": "TransformAnyParamTypeOrAnyHandle" }, { "name": "chunk_sizes", "type": "TransformAnyParamTypeOrAnyHandle" } ], "attributes": [ { "name": "dimension", "type": "ConfinedAttr" }, { "name": "target_size", "type": "ConfinedAttr" } ], "assemblyFormat": "$target attr-dict `:` custom(type($target), type($tile_sizes), type($chunk_sizes))" }, { "name": "transform.structured.convert_conv2d_to_img2col", "description": "Convert linalg.conv_2d_xxx into linalg.generic (for img2col packing)\n and linalg.matmul.\n\n A convolution operation can be written as a matrix-matrix multiplication by\n unfolding the cross-correlation between input and filter and explicitly copy\n overlapped sliding window inputs.\n\n Consider 2D input X with single channel input and output and 2x2 filter W:\n ```\n [x(0, 0) , x(0, 1) , ..., x(0, n) ]\n [x(1, 0) , x(1, 1) , ..., x(1, n) ]\n [. , . ,. , . ] [w(0, 0), w(0, 1)]\n [. , . , . , . ] (conv) [w(1, 0), w(1, 1)]\n [. , . , ., . ]\n [x(n-1, 0), x(n-1, 1), ..., x(n-1, n-1)]\n ```\n\n The packed input data (img2col) is a matrix with |rows| = output spatial\n size, |columns| = filter spatial size. To compute the output Y(i, j) we need\n to calculate the dot product between filter window at input X(x, y)) and the\n filter which will look like the following where r.h.s is the img2col matrix\n and l.h.s is the flattned filter:\n ```\n [x(0,0), x(0,1), x(1,0), x(1,1)]\n [x(0,1), x(1,1), x(0,2), x(1,2)] (matmul) [w(0,0), w(0,1), w(1,0), w(1,1)]\n [x(0,1), x(1,1), x(0,2), x(1,2)]\n [ . , . , . , . ]\n ```\n\n In general for 2D case with (N, H, W, C) input and (Kh, Kw, C, D) filter\n and output (N, Ho, Wo, D) the convolution is the following matrix-matrix\n multiplication (Ho x Wo, Kh x Kw x C) * (Kh x Kw x C, D) for each input in\n the N input. For the case where N > 1 its a batched matrxi-matrix\n multplication.\n\n Returns two handles:\n - One on the operation that produces the img2col tensor.\n - One on the final operation of the sequence that replaces the original\n convolution.\n\n #### Return modes:\n\n Returns a definite failure if target is not isolated from above.\n Returns a silenceable failure if the pattern application failed.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "img2col_tensor", "type": "TransformHandleTypeInterface" }, { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.structured.convert_to_loops", "description": "For operations that implement the `TilingInterface`, and implement\n the `generateScalarImplementation` method, lowers the operation to\n loops. The return handle points to all generated loops.\n Fails if the payload ops cannot be lowered to loops.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.decompose", "description": "Decomposes higher-dimensional convolution ops into lower-dimensional\n equivalents when possible. This operates on both named ops and equivalent\n `linalg.generic` ops that have convolution-like structure (as determined\n by `inferConvolutionDims`).\n\n The transformation always attempts to specialize the result back to a named\n op when possible.\n\n #### Return modes\n\n This operation ignores non-Linalg ops and drops them in the return.\n If all the operations referred to by the `target` handle decompose\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure. The return handle points to only the subset of\n successfully produced computational operations, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.decompose_interface", "description": "Decomposes target operations into sequences of simpler ops.\n\n #### Return modes\n\n This operation ignores ops that do not implement the AggregatedOpInterface\n and drops them in the return. If any such op is encountered, the transform\n emits a silenceable failure.\n\n If all the operations referred to by the `target` handle decompose\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure.\n The return handle points to a subset of successfully produced operations.\n For each target, the handle contains one value per its result. That is,\n the handle contains at most as many ops as the targets had results.\n The handle can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.decompose_winograd_op", "description": "Decompose winograd operations. It will convert filter, input and output\n transform operations into a combination of scf, tensor, and linalg\n equivalent operations. Before applying this transform operations, users\n need to tile winograd transform operations into supported sizes.\n\n #### Return modes:\n\n This operation fails if `target` is unsupported. Otherwise, the operation\n succeeds and returns a handle of the sequence that replaces the original\n operations.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.structured.eliminate_empty_tensors", "description": "Try to eliminate all `tensor.empty` op uses that are anchored on a LinalgOp\n within the targeted op.\n\n This op is similar to `bufferization.eliminate_empty_tensors`, but specific\n to LinalgOps.\n\n `tensor.empty` ops cannot be bufferized. They can either be converted to\n `bufferization.alloc_tensor` or replaced with another tensor (via this\n transform). `tensor.empty` does not specify the contents of the returned\n tensor so their results can be replaced with arbitrary tensor values as long\n as the dimensions match.\n\n This transform looks for `tensor.empty` ops where the SSA use-def chain of\n the result ends in a supported LinalgOp (always following the aliasing\n OpOperand/OpResult chain). The following LinalgOps are supported:\n - Only parallel iterator types.\n - The use-def chain ends in an input operand of the LinalgOp.\n - The LinalgOp has an unused output operand with the same shape and\n indexing map.\n\n Example:\n\n ```\n %0 = tensor.empty()\n %1 = linalg.matmul ins(...) outs(%0)\n %2 = linalg.generic ins(%1) outs(%dest) {\n ^bb0(%in: f32, %out: f32):\n // out not used\n }\n ```\n\n Is rewritten with:\n ```\n %0 = tensor.empty()\n %1 = linalg.matmul ins(...) outs(%dest)\n %2 = linalg.generic ins(%0) outs(%1) {\n ^bb0(%in: f32, %out: f32):\n // Use %out instead of %in\n }\n ```\n\n After this transformation, the \"ins\" operand has no uses inside the body of\n the LinalgOp and can be folded away with existing cleanup patterns.\n Afterwards, the tensor::EmptyOp can also fold away, so that the example can\n bufferize without an allocation (in the absence of other conflicts).\n\n #### Return modes\n\n This transform reads the target handle and modifies the payload. It does\n not produce any handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.structured.flatten_elementwise", "description": "Flattens the iteration space and (applicable) operands of elementwise\n linalg ops to a single dimension.\n\n Returns one handle:\n - Flattened linalg operation.\n\n #### Return modes:\n\n Returns a definite failure if target is not isolated from above.\n Returns a silenceable failure if the pattern application failed.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.structured.fuse", "description": "Tiles the operations pointed to by the target handle and fuses their\n producers greedily using the options provided as attributes. Tile sizes\n and loop interchange permutation can be provided as either static\n attributes or dynamic values (transform parameters or payload handles).\n\n Additionally, tile sizes can also be provided as a single handle containing\n variadic number of values. In that case, the number of loops generated is\n determined at runtime from the number of values in the packed handle.\n For each target, created loops are appended to the single return handle in\n the same order as the target operations.\n\n If `apply_cleanup` is true then slice canonicalization is applied between\n fusion steps. If `use_forall` is true then tiling method generates a\n `scf.forall` loop instead of `scf.for` loops.\n\n The optional `inner_tile_alignments` attribute forwards a per-dimension\n `InnerTileAlignment` hint to the tiling driver for pack/unpack tiling.\n These are only used to hint alignment or equality between the pack/unpack\n operations inner tile sizes, and the loop tile sizes. No other operation\n needs them.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "tile_sizes", "type": "Variadic" }, { "name": "tile_interchange", "type": "Variadic" }, { "name": "packed_tile_sizes", "type": "Optional" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "static_tile_sizes", "type": "DefaultValuedOptionalAttr" }, { "name": "static_tile_interchange", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_tile_alignments", "type": "DefaultValuedOptionalAttr" }, { "name": "apply_cleanup", "type": "UnitAttr" }, { "name": "use_forall", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$target oilist(\n `tile_sizes` custom($packed_tile_sizes,\n $tile_sizes,\n $static_tile_sizes) |\n `interchange` custom($tile_interchange, $static_tile_interchange)\n )\n (`inner_tile_alignments` `=`\n custom($inner_tile_alignments)^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.fuse_into_containing_op", "summary": "Fuse a producer into a containing operation.", "description": "Fuses the `producer_op` into the `containing_op`.\n Returns a handle to the fused ops and the `new_containing_op`.\n\n The producer is typically a slice of a tileable op (i.e., implements\n TilingInterface). In that case, this transform computes the accessed\n producer slice inside of the containing op (\"tile and fuse\") and if required,\n creates a new containing op with outputs from the fused producer. Otherwise,\n the entire producer is cloned inside the containing op (\"clone and fuse\").\n\n The containing op handle must be associated with exactly one payload op. The\n producer op handle may be associated with multiple payload ops. This\n transform fuses producers one-by-one, always picking an unspecified producer\n that has at least one use inside the containing op among the\n producers. A producer can be listed multiple times in the handle.\n\n Note: If a producer has multiple uses inside the containing op, it is\n currently tiled and/or cloned multiple times into the containing op.\n TODO: Reuse already fused OpResults instead of tiling/cloning a second time\n when possible. Fuse producers according to a topological sorting to achieve\n the largest amount of reuse.\n\n #### Return modes\n\n If at least one producer could not be fused, this operation produces a\n silenceable failure. This is the case when tiling fails or when no\n producer op could be found among the remaining producers that has at least\n one use within the containing op. I.e., \"producers\" that are not consumed\n within the containing op are rejected by this operation.\n\n This operation consumes the producer handle.\n This operation only reads the containing op handle.\n\n The optional `inner_tile_alignments` attribute forwards a per-dimension\n `InnerTileAlignment` hint to the tiling driver for pack/unpack tiling.\n These are only used to hint alignment or equality between the pack/unpack\n operations inner tile sizes, and the loop tile sizes. No other operation\n needs them.", "operands": [ { "name": "producer_op", "type": "TransformHandleTypeInterface" }, { "name": "containing_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "fused_op", "type": "TransformHandleTypeInterface" }, { "name": "new_containing_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "inner_tile_alignments", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$producer_op `into` $containing_op (`inner_tile_alignments` `=` custom($inner_tile_alignments)^)? attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.generalize", "description": "Transforms a named structured operation into the generic form with the\n explicit attached region.\n\n #### Return modes\n\n This operation ignores non-Linalg ops and drops them in the return.\n If all the operations referred to by the `target` handle generalize\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure. The return handle points to only the subset of\n successfully produced equivalent generic operations, which can be empty or\n contain the original ops if they were already in generic form.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` \n custom(type($target), type($transformed), \"false\")" }, { "name": "transform.structured.gpu.map_copy_to_threads", "description": "Targeted mapping of a linalg.copy / tensor.pad operation on tensors to a GPU\n thread mapping.\n\n This operation implements a greedy heuristic that determines a good\n distribution of threads to break down the copy/pad operation into.\n The heuristic is driven by considerations related to the underlying\n architecture for which good high-level decisions are needed assuming certain\n hardware features. Relevant features are exposed via first-class attributes\n to control the behavior of the transformation at a high level.\n\n For now, a single heuristic is implemented and can be extended on a per-need\n basis.\n\n #### Return modes\n\n This operation fails definitely if there is an unsupported op (i.e., not\n linalg.copy / tensor.pad) among the targeted op. Otherwise, the operation\n always succeeds and returns a handle to the relevant tiled linalg.copy /\n tensor.pad op and the enclosing scf.forall op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "forall_op", "type": "TransformHandleTypeInterface" }, { "name": "tiled_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "total_num_threads", "type": "I64Attr" }, { "name": "desired_bit_alignment", "type": "I64Attr" } ], "assemblyFormat": "$target\n `total_num_threads` `=` $total_num_threads\n `desired_bit_alignment` `=` $desired_bit_alignment\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.hoist_pad", "description": "Hoist the tensor.pad target operation by at most the given number of loops.\n Optionally apply the transpose attribute to the inner dimensions.\n\n TODO: In the future, we should consider rewriting as a linalg.pack after\n hoisting since this abstraction is now available.\n TODO: Maybe also return the linalg.generic transpose created at some point.\n\n #### Return modes\n\n This operation ignores non-tensor.pad ops and drops them in the result.\n If any non-tensor.pad is passed, the transform emits a silenceable failure.\n\n If all the operations referred to by the `target` handle padproperly, the\n transform succeeds. Otherwise the transform produces a silenceable failure.\n\n The return handle points to only the subset of successfully hoisted\n tensor.pad operations, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "num_loops", "type": "I64Attr" }, { "name": "transpose", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target\n `by` $num_loops `loops`\n (`,` `transpose` `by` $transpose^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.hoist_pad.build_packing_loop_nest", "description": "Helper transform used to hoist a tensor.pad target operation. This operation\n creates the packing loop nest required by the hoist_pad operation and makes\n that functionality available independently.\n\n TODO: In the future, we should consider rewriting as a linalg.pack after\n hoisting since this abstraction is now available.\n\n #### Return modes\n\n This operation ignores non-tensor.pad ops and drops them in the result.\n If any non-tensor.pad is passed, the transform emits a silenceable failure.\n\n The return handle points to only the subset of successfully created packing\n loop nests, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "loop", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "packing_loop", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "transpose", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target\n `above` $loop\n (`,` `transpose` `by` $transpose^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.hoist_redundant_vector_broadcasts", "description": "Hoist vector.extract / vector.broadcasts pairs out of immediately\n enclosing scf::ForOp iteratively.\n\n #### Return modes:\n\n The operation always succeeds and returns a handle to the transformed\n function op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.hoist_redundant_vector_transfers", "description": "Hoist vector.transfer_read / vector.transfer_write pairs out of immediately\n enclosing scf::ForOp iteratively, if the following conditions are true:\n 1. The 2 ops access the same memref with the same indices.\n 2. All operands are invariant under the enclosing scf::ForOp.\n 3. No uses of the memref either dominate the transfer_read or are\n dominated by the transfer_write (i.e. no aliasing between the write and\n the read across the loop)\n\n WARNING: This hoisting does not model parallelism and is generally incorrect\n when used on distributed loops with memref semantics!\n TODO: obsolete and should be retired.\n\n #### Return modes:\n\n The operation always succeeds and returns a handle to the transformed\n function op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "verify_non_zero_trip", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.insert_slice_to_copy", "description": "Targeted rewrite of an tensor.insert_slice to linalg.copy.\n This is useful to materialize copies explicitly before bufferization and\n transform them, avoiding the need to rediscover them after bufferization.\n\n If the insert_slice source is already a linalg.copy, only return the source\n op (i.e. do not create an additional linalg.copy op).\n\n #### Return modes:\n\n The operation always succeeds and returns a handle to the relevant\n linalg.copy op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.interchange", "description": "Interchanges the iterators of the operations pointed to by the target handle\n using the iterator interchange attribute.\n\n #### Return modes\n\n This operation ignores non-linalg::Generic ops and drops them in the return.\n This operation fails if the interchange attribute is invalid.\n If all the operations referred to by the `target` handle interchange\n properly, the transform succeeds.\n If any interchange fails, the transform produces a definite failure.\n The return handle points to only the subset of successfully produced\n interchanged operations, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "iterator_interchange", "type": "ConfinedAttr, [DenseArrayNonNegative]>" } ], "assemblyFormat": "$target\n (`iterator_interchange` `=` $iterator_interchange^)? attr-dict\n `:` custom(type($target), type($transformed), \"false\")" }, { "name": "transform.structured.linalg_copy_to_memref", "description": "Targeted rewrite of a linalg.copy on memrefs to a memref.copy.\n This is useful when bufferizing copies to a linalg.copy, later applying some\n transformations, and then rewriting the copy into a memref.copy.\n If the element types of the source and destination differ, or if the source\n is a scalar, the transform produces a silenceable failure.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.lower_pack", "description": "Rewrite a linalg.pack into tensor.pad + tensor.expand_shape + linalg.transpose.\n\n #### Return modes\n\n This operation ignores non-pack ops and drops them in the return. This\n operation produces a silenceable failure if the rewrite fails for any\n reason. If all the operations referred to by the `target` are rewritten,\n the transform succeeds. Return handles to the newly produced pad,\n expand_shape and transpose ops.", "operands": [ { "name": "target", "type": "Transform_ConcreteOpType" } ], "results": [ { "name": "pad_op", "type": "Transform_ConcreteOpType" }, { "name": "expand_shape_op", "type": "Transform_ConcreteOpType" }, { "name": "transpose_op", "type": "Transform_ConcreteOpType" } ], "attributes": [ { "name": "lowerPadLikeWithInsertSlice", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.lower_unpack", "description": "Lower a linalg.unpack into empty + linalg.transpose + tensor.collapse_shape +\n tensor.extract_slice + linalg.copy.\n\n #### Return modes\n\n This operation ignores non-unpack ops and drops them in the return. This\n operation produces a silenceable failure if the rewrite fails for any\n reason. If all the operations referred to by the `target` are rewritten,\n the transform succeeds. Return handles to the newly produced empty,\n transpose, collapse_shape, extract_slice and copy ops.", "operands": [ { "name": "target", "type": "Transform_ConcreteOpType" } ], "results": [ { "name": "empty_op", "type": "Transform_ConcreteOpType" }, { "name": "transpose_op", "type": "Transform_ConcreteOpType" }, { "name": "collapse_shape_op", "type": "Transform_ConcreteOpType" }, { "name": "extract_slice_op", "type": "Transform_ConcreteOpType" }, { "name": "copy_op", "type": "Transform_ConcreteOpType" } ], "attributes": [ { "name": "lowerUnpadLikeWithExtractSlice", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.structured.match", "description": "Match op with the specified constraints, within the target op.\n\n The following constraints are supported:\n - interface: an optional MatchInterfaceEnum specifying an enum\n representation for an interface to target.\n - ops: an optional StrArrayAttr specifying the concrete name of an op.\n Multiple names can be specified. Matched ops must have one of specified\n names.\n - attribute: the matched op must have all specified attributes (with their\n specified values).\n - filter_result_type: the matched op must return exactly this one type.\n - filter_operand_types: all the operands of the matched op must must be of\n this type. If more than a type is specified, then the length of the list\n must be equal to the number of operands in the matched op, and the match\n will succeed only if the operand types match all the types in the list\n in the order in which they are specified.\n\n Note: Only ops that satisfy all specified constraints are matched.\n\n TODO: Extend with regions to allow a limited form of constraints.\n\n #### Return modes\n\n This op traverses the ops nested under `target` and returns the handles to\n all the operations that match the requirements.\n\n This op fails if the target is not a handle to exactly one operation.\n Otherwise it succeeds.\n\n This operation does not consume the target handle and produces new handles:\n it is a navigation op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "results", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "ops", "type": "OptionalAttr>" }, { "name": "interface", "type": "OptionalAttr" }, { "name": "op_attrs", "type": "OptionalAttr" }, { "name": "filter_result_type", "type": "OptionalAttr" }, { "name": "filter_operand_types", "type": "OptionalAttr>" } ], "assemblyFormat": "(`ops` `{` $ops^ `}`)?\n (`interface` `{` $interface^ `}`)?\n (`attributes` $op_attrs^)?\n (`filter_result_type` `=` $filter_result_type^)?\n (`filter_operand_types` `=` $filter_operand_types^)?\n `in` $target attr-dict\n `:` functional-type($target, results)" }, { "name": "transform.structured.multitile_sizes", "description": "Emits the IR computing the tile sizes `s1` and `s2` such that:\n\n - there exists a combination of `n` tiles of size `s1` and `m` tiles of\n size `s2` that covers the entirety of the iteration space `dimension` of\n the target structured op;\n - `s1`, `s2` is less than or equal to `target_size`;\n - `s1` and `s2` are divisible by `divisor.\n\n For example, for a dimension of size 54 with target size 12 and divisor 2,\n this can emit the IR computing the tile size 10, used for 3 tiles, and 12,\n used for 2 tiles, totally 10*3 + 12*2 = 54. Note that when the divisor does\n not divide the original dimension size, it is impossible to compute such\n tile sizes. An assertion is emitted to guard against this in the dynamic\n case.\n\n Expects the target size and the divisor to be strictly positive. Folds the\n IR as much as possible, normally obtaining constant sizes and numbers of\n tiles for a statically known dimension.\n\n This does *not* consume the target handle and produces three handles each\n pointing to single-result index-typed operations (which may be arithmetic\n constant operations) defining the two respective tile sizes and the product\n of the first tile size with the number of tiles of that size (useful for\n splitting the iteration space).\n\n This operation composes with the regular tiling when applied per-dimension:\n\n ```mlir\n %sz1, %sz2, %split = structured.multitile_sizes %target\n { target_size = 10, dimension = 1 }\n : !transform.any_op, !transform.param,\n !transform.param, !transform.param\n %handles = structured.split %target after %split { dimension = 1 }\n : !transform.any_op, !transform.param\n %low, %high = transform.split_handle %handles : (!transform.any_op)\n -> (!transform.any_op, !transform.any_op)\n %tiled_low, %loop1 = structured.tile_using_for %low [0, %sz1]\n : (!transform.any_op, !transform.param)\n -> (!transform.any_op, !transform.any_op)\n %tiled_high, %loop2 = structured.tile_using_for %high [0, %sz2]\n : (!transform.any_op, !transform.param)\n -> (!transform.any_op, !transform.any_op)\n %common = merge_handles %tiled_low, %tiled_high : !transform.any_op\n\n %sz3, %sz4, %split = structured.multitile_size %target\n { target_size = 42, dimension = 0 }\n : !transform.any_op, !transform.any_op,\n !transform.any_op, !transform.any_op\n %sz3r, %sz4r, %splitr = replicate num(%common) %sz3, %sz4, %splitr\n : !transform.any_op, !transform.any_op, !transform.any_op\n structured.split %common after %splitr { dimension = 0 }\n : !transform.any_op, !transform.any_op\n // ...\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "low_size", "type": "TransformAnyParamTypeOrAnyHandle" }, { "name": "high_size", "type": "TransformAnyParamTypeOrAnyHandle" }, { "name": "split_point", "type": "TransformAnyParamTypeOrAnyHandle" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" }, { "name": "target_size", "type": "I64Attr" }, { "name": "divisor", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` custom(type($target), type($low_size), type($high_size), type($split_point))" }, { "name": "transform.structured.pack", "description": "Pack a LinalgOp by applying a data tiling transformation on the op and\n packing the operands according to the `packed_sizes` specification.\n\n Iterator dimensions are tiled in their canonical order in the op spec.\n Operands are packed according to the same canonical order of the op iterator\n dimensions.\n\n Specifying a packed size of 0 for an iterator removes it from consideration\n for packing.\n\n `linalg.pack` (resp. `linalg.unpack`) operations are inserted for the operands\n (resp. results) that need to be packed (resp. unpacked) according to the\n `packed_sizes` specification.\n\n #### Example\n\n Consider a `linalg.matmul` with indexing maps:\n ```\n // M N K M K\n // affine_map<(d0, d1, d2) -> (d0, d2)>\n // K N\n // affine_map<(d0, d1, d2) -> (d2, d1)>\n // M N\n // affine_map<(d0, d1, d2) -> (d0, d1)>\n %0 = linalg.matmul ins(%A, %B: tensor, tensor)\n outs( %C: tensor)\n ```\n\n Specifying packed_sizes [2, 3, 4] results in tiling the iterator dimensions\n M, N and K, in this order, in both the op and its operands.\n ```\n // M N K m n k M K m k\n // affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d2, d3, d5)>\n // K N n k\n // affine_map<(d0, d1, d2, d3, d4, d5) -> (d2, d1, d4, d5)>\n // M N m n\n // affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d3, d4)>\n %0 = linalg.generic_representing_some_higher_d_matmul\n ins(%A, %B: tensor, tensor)\n outs( %C: tensor)\n ```\n In particular, note that the second operand `B` has shape `KxNxnxk` (and not\n `KxNxkxn` as one could expect by looking **only** at the operand).\n\n Other layouts can be obtained unsurprisingly from this canonical\n transformation by composing the resulting operation with a\n `transform.structured.pack_transpose` op.\n This composition allows separating concerns and composes better compared\n to adding additional permutation attributes to this transform op.\n\n #### Return modes\n\n This operation applies to a single Linalg op, otherwise it fails.\n This operation may produce a definite failure if the packing fails for any\n reason.\n\n The returned handle point to the packed LinalgOp.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "packed_sizes", "type": "Variadic" } ], "results": [ { "name": "packed_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "static_packed_sizes", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target\n `packed_sizes` `=` custom($packed_sizes,\n $static_packed_sizes)\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.pack_greedily", "description": "Target a Linalg op and rewrite it into packed LinalgOp form by trying to\n infer whether a known suboperation is embedded\n\n Different packing strategies are applied in order, when one applies\n successfully, the transform returns:\n 1. Matmul packing: Try to infer a matmul operation embedded in the target op.\n Specifically, this looks for 2 parallel dimensions that participate in\n an outer-product and 1 reduction dimension.\n These dimensions are referred as (m, n, k) to match canonical matmul\n terminology.\n\n The packed sizes for (m, n, k) are specified by `matmul_packed_sizes`\n and the optional `matmul_padded_sizes_next_multiple_of`.\n When an entry `matmul_packed_sizes[i]` is non-0, the corresponding\n dimension is packed by `matmul_packed_sizes[i]`.\n Otherwise, the dimension is merely padded to the next multiple of\n `matmul_padded_sizes_next_multiple_of[i]`.\n\n `matmul_padded_sizes_next_multiple_of` is optional and is expected to\n either be empty or of size `3`, matching the size of `matmul_packed_sizes`.\n For each individual element of `matmul_packed_sizes` and\n `matmul_padded_sizes_next_multiple_of`, only one of them is allowed to\n be non-zero.\n\n The ordering of the packed dimensions (mm, nn, kk) is specified by the\n `matmul_inner_dims_order` attribute.\n\n Packing occurs as follows:\n 1. Find the dimensions to pack according to the strategy.\n 2. The target is converted to linalg.generic form.\n 3. An interchange transform is applied to isolate the dimensions to pack as\n the most minor indexing dimensions of the linalg.generic. The most minor\n dimensions are themselves ordered according to `inner_dims_order`.\n 4. An elementwise traversal of `matmul_packed_sizes` and\n `matmul_padded_sizes_next_multiple_of` is performed and for each\n dimension `d`, either pack to `matmul_packed_sizes[d]` or pad to the\n `matmul_padded_sizes_next_multiple_of[d]`.\n 5. Packing/padding is performed by the amounts determined in step 4. and\n following `inner_dims_order`.\n\n By normalizing the most minor dimensions to `inner_dims_order`, the transform\n guarantees that packing immediately generates inner dimensions in a desirable\n layout.\n\n Outer dimension layout permutations are not controlled by this transform op\n at the moment and can be obtained by composing with the pack_transpose\n transformation.\n\n #### Return modes\n\n This operation ignores non-Linalg ops and drops them in the return.\n It returns the list of packed Linalg ops or the original op when all available\n packing strategies failed to apply.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "matmul_packed_sizes", "type": "Variadic" } ], "results": [ { "name": "packed_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "static_matmul_packed_sizes", "type": "ConfinedAttr, [DenseArrayCount<3>]>" }, { "name": "matmul_padded_sizes_next_multiple_of", "type": "ConfinedAttr, [Attr . predicate, DenseArrayCount < 3 > . predicate ]>, with 0 or 3 elements>]>" }, { "name": "matmul_inner_dims_order", "type": "ConfinedAttr, [DenseArrayCount<3>]>" } ], "assemblyFormat": "$target\n oilist(\n `matmul_packed_sizes` `=` custom($matmul_packed_sizes,\n $static_matmul_packed_sizes)\n (`matmul_padded_sizes_next_multiple_of` `=`\n $matmul_padded_sizes_next_multiple_of^)?\n `matmul_inner_dims_order` `=` $matmul_inner_dims_order\n )\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.pack_transpose", "description": "Apply a transposition to a single `linalg.pack` (resp. `linalg.unpack`) and\n update the `linalg.generic` op that consumes (resp. produces) the operation.\n\n This transform allows composing a simple `structured.pack` with additional\n transpositions to e.g. match the data format required by a specific library\n call or ISA instruction.\n\n The transpose spec must specify at least one of `outer_perm` or `inner_perm`\n attributes, which will act upon the `outer_dims_perm` or `inner_dims_pos` of\n the specified `linalg.pack` or `linalg.unpack` op.\n\n If the `target` of this op is a `linalg.pack` then a new `tensor.empty` will\n be created along with transposed versions of the `linalg.pack` and the\n consuming `linalg.generic`, which is expected to be the sole consumer.\n\n If the `target` of this op is a `linalg.unpack` then the whole pack / compute\n / unpack chain will be transposed and transposed clones of `linalg.pack`,\n the consuming `linalg.generic` and the tail `linalg.pack` will be created.\n\n #### Return modes\n\n This operation targets a single `linalg.pack` / `linalg.unpack` op and a\n single matching `linalg.generic` that consumes / produces the op. Otherwise,\n it produces a silenceableFailure.\n\n This operation may produce a silenceableFailure if the transpose spec is\n ill-formed (i.e. `outer_perm` or `inner_perm` are not permutations of the\n proper rank) or if the transposition of all involved operations fails for any\n reason.\n\n This operation returns 3 handles, one to the transformed LinalgOp, one to\n the transformed `linalg.pack` and one to the transformed `linalg.unpack`.\n The last handle for `linalg.unpack` is empty if `target_pack_or_unpack_op`\n was not itself a `linalg.unpack`.", "operands": [ { "name": "target_pack_or_un_pack_op", "type": "TransformHandleTypeInterface" }, { "name": "target_linalg_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "packed_op", "type": "TransformHandleTypeInterface" }, { "name": "pack_op", "type": "TransformHandleTypeInterface" }, { "name": "un_pack_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "outer_perm", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_perm", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target_pack_or_un_pack_op\n `with_compute_op` `(` $target_linalg_op `)`\n (`outer_perm` `=` $outer_perm^ )?\n (`inner_perm` `=` $inner_perm^ )?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.pad", "description": "Pads the operations pointed to by the target handle using the options\n provides as operation attributes. The operation returns a handle to the\n padded operation and to the padding operation (\"tensor.pad\").\n\n To preserve tensor SSA use-def chains, the unpadded result is copied back to\n the original destination tensor of the targeted op. The op that copies back\n the result can be customized with `copy_back_op`:\n\n * \"bufferization.materialize_in_destination\" (default)\n * \"linalg.copy\"\n * \"none\" (no copy back)\n\n #### Return modes\n\n This operation ignores non-Linalg ops and drops them in the return.\n This operation may produce a definite failure if the padding fails for any\n reason.\n\n If all the operations referred to by the `target` handle pad\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure.\n The return handle points to only the subset of successfully produced\n padded operations, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "pad_to_multiple_of", "type": "Variadic" } ], "results": [ { "name": "padded", "type": "TransformHandleTypeInterface" }, { "name": "pad", "type": "TransformHandleTypeInterface" }, { "name": "copy", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "padding_values", "type": "DefaultValuedAttr" }, { "name": "padding_dimensions", "type": "DefaultValuedAttr, {}>" }, { "name": "static_pad_to_multiple_of", "type": "DefaultValuedOptionalAttr" }, { "name": "nofold_flags", "type": "DefaultValuedAttr, {}>" }, { "name": "transpose_paddings", "type": "DefaultValuedAttr, array of arrays of i64>, {}>" }, { "name": "copy_back_op", "type": "DefaultValuedAttr" }, { "name": "use_prescribed_tensor_shapes", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target \n (`pad_to_multiple_of` custom($pad_to_multiple_of, $static_pad_to_multiple_of)^)?\n (`use_prescribed_tensor_shapes` $use_prescribed_tensor_shapes^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.pad_tiling_interface", "description": "Pads the **iteration domain** of the operations pointed to by the target\n handle using the options provided as operation attributes. Padding the\n iteration domain induces a padding of the operands that is consistent\n across the op semantics and, unlike for simple elementwise ops, may not be\n trivially deducible or specifiable on operands only (e.g. convolutions).\n Currently, only a limited set of projected permutation maps are supported.\n \n The specification of `padding_sizes` follows that of `tile_sizes` during\n tiling: the value \"0\" on a particular iterator encode \"no padding\". Like in\n the case of tiling, an automatic completion by 0 to the operation rank\n occurs.\n \n This transformation returns a handle to the padded operation and to the\n padding operation (\"tensor.pad\").\n\n TODO: in the future this should be moved out of a specific Linalg\n implementation file and into a more general \"Structured\" file.\n\n #### Return modes\n\n This operation ignores non-IndexingMapOpInterface ops and drops them in the\n return. In the future, this operation will support all TilingInterfaceOps\n for which the contract between iteration domain and operands can be \n reified. \n\n This operation may produce a definite failure if the padding fails for any\n reason.\n\n If all the operations referred to by the `target` handle pad properly, the\n transform succeeds. Otherwise the transform produces a silenceable failure.\n The return handle points to only the subset of successfully produced\n padded operations, which can be empty.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "padding_sizes", "type": "Variadic" } ], "results": [ { "name": "padded", "type": "TransformHandleTypeInterface" }, { "name": "pad", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "padding_values", "type": "DefaultValuedAttr" }, { "name": "static_padding_sizes", "type": "DefaultValuedOptionalAttr" }, { "name": "pad_to_multiple_of", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target\n `to`\n (`padding_sizes` custom($padding_sizes, $static_padding_sizes)^)?\n (`pad_to_multiple_of` $pad_to_multiple_of^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.promote", "description": "Promotes the specified operands of the target into a separate memory buffer.\n\n At this point, this transform does not allow customizing alloc/dealloc\n functions nor the behavior on copy in/out operations.\n\n #### Return modes\n\n This operation applies to a single Linalg op that satisfies the\n `promoteSubviewsPrecondition`, otherwise it fails.\n\n If the operations referred to by the `target` handle promote\n properly, the transform succeeds.\n\n When successful, the return handle points to the $target operation that\n was modified inplace.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "operands_to_promote", "type": "DefaultValuedAttr, {}>" }, { "name": "use_full_tile_buffers", "type": "DefaultValuedAttr, {}>" }, { "name": "use_full_tiles_by_default", "type": "UnitAttr" }, { "name": "use_original_subview_size", "type": "UnitAttr" }, { "name": "use_alloca", "type": "UnitAttr" }, { "name": "memory_space", "type": "OptionalAttr" }, { "name": "mapping", "type": "OptionalAttr>>" }, { "name": "alignment", "type": "OptionalAttr" } ], "assemblyFormat": "$target attr-dict `:`\n custom(type($target), type($transformed), \"false\")" }, { "name": "transform.structured.promote_tensor", "summary": "Request a tensor value to live in a specific memory space after bufferization", "description": "Requests that a tensor value lives in a specific memory space for its\n lifetime. This is achieved by allocating a new tensor in the desired\n memory space with `bufferization.alloc_tensor` and optionally materializing\n the source value into that allocation with\n `bufferization.materialize_in_destination`. All uses of the original value\n are then redirected to the promoted value.\n\n The generated code for promoting tensor value %0 resembles the following:\n\n %1 = bufferization.alloc_tensor()\n { memory_space = memory_space }\n // Note: the materialization is omitted if %0 is never read and is only\n // written into (i.e., it behaves as a result tensor).\n %2 = bufferization.materialize_in_destination %0 in %1\n // ...\n \n\n Deallocation is not handled by this transform.\n\n Return modes:\n - Produces a silenceable failure if the given handle does not point to\n tensor-typed values.\n - Succeeds otherwise and returns a handle to the promoted value(s), i.e.,\n the result of materialization if present and the allocation otherwise.", "operands": [ { "name": "tensor", "type": "TransformValueHandleTypeInterface" } ], "results": [ { "name": "promoted", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "memory_space", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "(`to` $memory_space^)? $tensor attr-dict `:` type($tensor)" }, { "name": "transform.structured.replace", "description": "Replace all `target` payload ops with the single op that is contained in\n this op's region. All targets must have zero arguments and must be isolated\n from above.\n\n This op is for debugging/experiments only.\n\n #### Return modes\n\n This operation consumes the `target` handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "replacement", "type": "TransformHandleTypeInterface" } ], "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "$target attr-dict-with-keyword regions `:`\n custom(type($target), type($replacement), \"false\")" }, { "name": "transform.structured.rewrite_in_destination_passing_style", "description": "Rewrite a supported tensor operation that is not in destination-passing style\n into a form that is in destination-passing style.\n Currently supported operations are:\n - tensor.pad\n - tensor.generate\n - tensor.from_elements\n This dichotomy hints at a future interface, for now the implementation just\n switches between different implementation.\n\n #### Return modes\n\n This operation ignores non-unsupported ops and drops them from the return.\n If all the operations referred to by the `target` handle generalize\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure.\n The return handle points to a subset of successfully produced operations:\n - `tensor.pad` case, the returned handle points to the tensor.insert_slice.\n - `tensor.generate` case, the returned handle points to the linalg.generic.\n - `tensor.from_elements` case, the returned handle points to the last\n `tensor.insert`.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict\n `:` functional-type($target, results)" }, { "name": "transform.structured.scalarize", "description": "Indicates that ops of a specific kind in the given function should be\n scalarized (i.e. their dynamic dimensions tiled by 1).\n\n #### Return modes:\n\n This operation ignores non-Linalg ops and drops them in the return.\n This operation produces definite failure if the scalarization fails for any\n reason.\n If all the operations referred to by the `target` handle scalarize\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure.\n\n The return handle points to only the subset of successfully produced\n tiled-by-1 operations, which can be empty.\n\n This operation does not return handles to the tiled loop.\n We make this design choice because it is hard to know ahead of time the\n number of loops that will be produced (it depends on the number of dynamic\n dimensions after multiple transformations have been applied).\n Loops can always be recovered by navigating from the tiled operations if\n needed.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:`\n custom(type($target), type($result), \"false\")" }, { "name": "transform.structured.specialize", "description": "Transforms a generic operation into the equivalent named or category form.\n\n By default, operations are specialized into named forms.\n\n #### Return modes\n\n This operation ignores non-Linalg ops and drops them in the return. If all\n the operations referred to by the `target` handle specialize, the transform\n succeeds; otherwise, the operation produces a silenceable failure. The return\n handle points to only the subset of successfully produced equivalent specialized\n operations, which can be empty or contain the original ops if they were already\n in the target form.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "emit_category", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target attr-dict `:` \n custom(type($target), type($transformed), \"false\")" }, { "name": "transform.structured.split", "description": "Splits the given `target` op into two or more complementary\n parts, which combined cover the entire iteration domain of the original op.\n The split is performed along the iteration space dimension provided as\n chunk size attribute specifying the size of the lower part; the remaining\n range in the iteration space is assigned as the upper part. In case of\n dimension overflow, the transformation fails. The split is performed at the\n dimension iterator value specified as either the static chunk size\n attribute when it is known at transform IR construction time or\n as the handle to an operation producing a single index-typed value\n when it is computed by payload IR. In the latter case, the chunk size\n point must be set to `ShapedType::kDynamic` and the dynamic size handle\n must point to as many value-producing operations as there are structured\n operations pointed to by the target handle.\n\n The operation consumes the target handle, but preserves the chunk size\n handle if provided. Without the `multiway` attribute, it produces a\n new handle that is a list of the two parts of the structured op after\n splitting, whose lower index part corresponding to the part with lower\n iteration space indices.\n\n Multiway split mode is enabled by specifying the `multiway` attribute.\n In this mode a single `target` op is split into multiple parts covering\n the iteration space of the specified dimension. `static_chunk_sizes` and\n `dynamic_chunk_sizes` in this case is a list of chunk sizes that the given\n dimension should be split into. With `multiway` it also produces a handle;\n The result handle is a list of the multiple parts of the structured op\n after splitting, where the target dimensions for each linalg op in the\n list corresponds to the chunk sizes specfied in the input split list.\n If the chunk sizes do not cover the entire iteration space, the leftover\n chunk is the last payload in the result handle.\n\n As the result handle is most of time a list, an `transform.split_handle`\n is needed to access individual handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "dynamic_chunk_sizes", "type": "Optional" } ], "results": [ { "name": "split_list", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" }, { "name": "static_chunk_sizes", "type": "I64Attr" }, { "name": "multiway", "type": "UnitAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "transform.structured.split_reduction", "description": "Indicates that the given `target` op should be transformed with the\n `splitReduction` transformation and split factor provided as attribute.\n\n The `splitReduction` transformation splits the first single linalg op\n reduction into a parallel and reduction dimension.\n A new `linalg.generic` op is created to perform the rest of the reduction.\n\n The transformation supports different configurations attributes:\n - split_factor: the factor by which to split (i.e. the size of the\n remaining reduction after splitting).\n - insert_split_dimension: the dimension in the temporary tensor into\n which the new parallel dimension is inserted.\n - inner_parallel: specifies whether the parallel dimension is before or\n after the reduction dimension in the splitting op.\n - use_scaling_algorithm: whether to use a scaling based formulation that\n does not create an ExpandShapeOp (default: do not use scaling)\n - use_alloc: whether to use an alloc op to allocate the temporary\n tensor (default: do not use alloc op)\n\n #### Return modes\n\n This operation ignores non-Linalg ops and drops them in the return.\n This operation produces a definite failure if the splitting fails for any\n reason.\n\n If all the operations referred to by the `target` handle split\n properly, the transform succeeds. Otherwise the transform produces a\n silenceable failure. The 4 returned handles points to only the subset of\n successfully produced computational operations, which can all be empty.\n This 4 returned handles point to:\n - the init op (or tensor_alloc op if use_alloc = true),\n - the fill op used to initialize the neutral element,\n - the split op and\n - the result-combining op.\n\n #### Example (default: `use_scaling_algorithm = false, use_alloc = false`):\n\n ```\n %r = linalg.generic {indexing_maps = [affine_map<(d0) -> (d0)>,\n affine_map<(d0) -> ()>],\n iterator_types = [\"reduction\"]}\n ins(%in : tensor<32xf32>)\n outs(%out : tensor) {\n ^bb0(%arg1: f32, %arg2: f32):\n %y = arith.addf %arg1, %arg2 : f32\n linalg.yield %y : f32\n } -> tensor\n ```\n\n is split into:\n\n ```\n %cst = arith.constant 0.000000e+00 : f32\n %0 = tensor.expand_shape %in [[0, 1]] : tensor<32xf32> into tensor<4x8xf32>\n %1 = tensor.empty() : tensor<4xf32>\n %2 = linalg.fill ins(%cst : f32) outs(%1 : tensor<4xf32>) -> tensor<4xf32>\n %3 = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,\n affine_map<(d0, d1) -> (d0)>],\n iterator_types = [\"parallel\", \"reduction\"]}\n ins(%0 : tensor<4x8xf32>) outs(%2 : tensor<4xf32>) {\n ^bb0(%arg3: f32, %arg5: f32):\n %5 = arith.addf %arg3, %arg4 : f32\n linalg.yield %5 : f32\n } -> tensor<4xf32>\n %r = linalg.generic {indexing_maps = [affine_map<(d0) -> (d0)>,\n affine_map<(d0) -> ()>],\n iterator_types = [\"reduction\"]}\n ins(%3 : tensor<4xf32>) outs(%out : tensor) {\n ^bb0(%arg3: f32, %arg4: f32):\n %5 = arith.addf %arg3, %arg4 : f32\n linalg.yield %5 : f32\n } -> tensor\n ```\n\n #### Example (`use_scaling_algorithm = true, use_alloc = true`):\n\n Instead of introducing an ExpandShapeOp, this scaling-based implementation\n rewrites a reduction dimension `k` into `k * split_factor + kk`.\n The dimension `kk` is added as an extra parallel dimension to the\n intermediate output tensor at position `insert_split_dimension`.\n\n Consider a minimal example where `k` is reduced:\n O(i, j) += I(i, j, k)\n Assume i=3, j=5, k=128, split_factor=16 and insert_split_dimension=0.\n The compute is rewritten as:\n a. O_i(kk, i, j) += I(i, j, 16 * k + kk)\n b. O(i, j) += O_i(kk, i, j)\n The intermediate tensor O_i is of shape (128/16)x3x5 == 8x3x5.\n\n #### Example:\n\n ```\n %0 = linalg.matmul ins(%A, %B: tensor<16x256xf32>, tensor<256x32xf32>)\n outs(%C: tensor<16x32xf32>) -> tensor<16x32xf32>\n ```\n\n Is transformed to:\n\n ```\n #map0 = affine_map<(d0, d1, d2, d3) -> (d0, d2 * 4 + d3)>\n #map1 = affine_map<(d0, d1, d2, d3) -> (d2 * 4 + d3, d1)>\n #map2 = affine_map<(d0, d1, d2, d3) -> (d2, d3)>\n #map3 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)>\n #map4 = affine_map<(d0, d1, d2) -> (d0, d1, d2)>\n #map5 = affine_map<(d0, d1, d2) -> (d0, d1)>\n %0 = tensor.empty() : tensor<16x32x64xf32>\n %cst = arith.constant 0.000000e+00 : f32\n %1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<16x32x64xf32>) ->\n tensor<16x32x64xf32>\n %2 = tensor.empty() : tensor<64x4xi1>\n\n %3 = linalg.generic {indexing_maps = [#map0, #map1, #map2, #map3],\n iterator_types = [\"parallel\", \"parallel\", \"parallel\", \"reduction\"]}\n ins(%A, %B, %2 : tensor<16x256xf32>, tensor<256x32xf32>, tensor<64x4xi1>)\n outs(%1 : tensor<16x32x64xf32>) {\n ^bb0(%arg3: f32, %arg4: f32, %arg5: i1, %arg6: f32):\n %5 = arith.mulf %arg3, %arg4 : f32\n %6 = arith.addf %arg6, %5 : f32\n linalg.yield %6 : f32\n } -> tensor<16x32x64xf32>\n\n %4 = linalg.generic {indexing_maps = [#map4, #map5],\n iterator_types = [\"parallel\", \"parallel\", \"reduction\"]}\n ins(%3 : tensor<16x32x64xf32>)\n outs(%C : tensor<16x32xf32>) {\n ^bb0(%arg3: f32, %arg4: f32):\n %5 = arith.addf %arg3, %arg4 : f32\n linalg.yield %5 : f32\n } -> tensor<16x32xf32>\n\n return %4 : tensor<16x32xf32>\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "init_or_alloc_op", "type": "TransformHandleTypeInterface" }, { "name": "fill_op", "type": "TransformHandleTypeInterface" }, { "name": "split_linalg_op", "type": "TransformHandleTypeInterface" }, { "name": "combining_linalg_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "split_factor", "type": "DefaultValuedAttr" }, { "name": "insert_split_dimension", "type": "DefaultValuedAttr" }, { "name": "inner_parallel", "type": "UnitAttr" }, { "name": "use_scaling_algorithm", "type": "UnitAttr" }, { "name": "use_alloc", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:`functional-type(operands, results)" }, { "name": "transform.structured.tile_reduction_using_for", "description": "Indicates that the given `target` op should be transformed with the\n `tileReduction` transformation with the tile size provided as attribute.\n\n This transformation tiles the `target` along the reduction dimensions. It\n creates a tensor initialized with the identity value. Then it creates nested\n loops with a parallel version of `target` op inside. The parallel op\n dimensions are less or equal to the tile size passed by user.\n After the loop a merge operation is created to do a final reduction with the\n partial reductions.\n The initial tensor always uses the tile size dimension. This may overallocate\n if the tile size is greater than the reduction dimension.\n\n #### Return modes\n\n Returns 4 handles associated with (in order):\n - the fill op used to initialize the neutral element,\n - the parallel tiled op and\n - the result-combining op,\n - the parent `for` op.\n\n The `reduction_dims` can be used to specify the subset of reduction dimensions\n of the operation to tile. If left unspecified, all reduction dimensions are\n tiled.\n\n #### Example:\n\n ```\n %red = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,\n affine_map<(d0, d1) -> (d0)>],\n iterator_types = [\"parallel\", \"reduction\"]}\n ins(%arg0 : tensor)\n outs(%out : tensor) {\n ^bb0(%arg7: f32, %arg9: f32):\n %1 = arith.addf %arg7, %arg9 : f32\n linalg.yield %1 : f32\n } -> tensor\n return %red : tensor\n ```\n\n is transformed into:\n\n ```\n %0 = tensor.empty(%dim_1) : tensor\n %1 = linalg.fill ins(%cst : f32) outs(%0 : tensor) -> tensor\n %2 = scf.for %arg2 = %c0 to %dim_0 step %c5 iter_args(%arg3 = %1) -> (tensor) {\n %extracted_slice = tensor.extract_slice %1[0, 0] [%dim, 5] [1, 1] : tensor to tensor\n %extracted_slice_2 = tensor.extract_slice %arg0[0, %arg2] [%dim, 5] [1, 1] : tensor to tensor\n %4 = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,\n affine_map<(d0, d1) -> (d0, d1)>],\n iterator_types = [\"parallel\", \"parallel\"]}\n ins(%extracted_slice_2 : tensor)\n outs(%extracted_slice : tensor) {\n ^bb0(%in: f32, %out: f32):\n %5 = arith.addf %in, %out : f32\n linalg.yield %5 : f32\n } -> tensor\n %dim_3 = tensor.dim %1, %c0 : tensor\n %inserted_slice = tensor.insert_slice %4 into %arg3[0, 0] [%dim_3, 5] [1, 1] : tensor into tensor\n scf.yield %inserted_slice : tensor\n }\n %3 = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,\n affine_map<(d0, d1) -> (d0)>],\n iterator_types = [\"parallel\", \"reduction\"]}\n ins(%2 : tensor)\n outs(%arg1 : tensor) {\n ^bb0(%in: f32, %out: f32):\n %4 = arith.addf %in, %out : f32\n linalg.yield %4 : f32\n } -> tensor\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "fill_op", "type": "Variadic" }, { "name": "split_op", "type": "TransformHandleTypeInterface" }, { "name": "combining_op", "type": "TransformHandleTypeInterface" }, { "name": "for_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "reduction_dims", "type": "DefaultValuedAttr, {}>" }, { "name": "tile_sizes", "type": "DefaultValuedAttr, {}>" } ], "assemblyFormat": "$target\n (`reduction_dims` `=` $reduction_dims^)?\n `by` `tile_sizes` `=` $tile_sizes\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.tile_reduction_using_forall", "description": "Tile a PartialReductionOpInterface op to a tiled `scf.forall` doing\n partial reduction.\n\n This transformation tiles the `target` along the reduction dimensions. It\n creates a tensor initialized with the identity value. Then it creates a\n `scf.forall` loops with the number threads given by `num_threads`.\n The op is tiled op with a size equal to `floordiv(size, num_threads)`.\n All the partial reduction value is are parallel inserted to create a new\n tensor. After the loop a merge operation is created to do a final reduction\n with the partial reductions tensor.\n If an extra `tile_sizes` parameter is passed the tiles are cyclically\n distributed on the threads of the `scf.foralls` loop.\n\n #### Return modes\n\n Returns 4 handles associated with (in order):\n - the fill op used to initialize the neutral element,\n - the parallel tiled op and\n - the result-combining op,\n - the parent `forall` op.\n\n #### Example:\n\n ```\n %red = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,\n affine_map<(d0, d1) -> (d0)>],\n iterator_types = [\"parallel\", \"reduction\"]}\n ins(%arg0 : tensor)\n outs(%out : tensor) {\n ^bb0(%arg7: f32, %arg9: f32):\n %1 = arith.addf %arg7, %arg9 : f32\n linalg.yield %1 : f32\n } -> tensor\n return %red : tensor\n ```\n\n is transformed into:\n\n ```\n %0 = tensor.empty(%dim_1) : tensor\n %1 = linalg.fill ins(%cst : f32) outs(%0 : tensor) -> tensor\n %2 = scf.forall (%arg2) in (%c5) shared_outs(%arg3 = %1) -> (tensor) {\n %4 = affine.min #map(%arg2)[%dim_0]\n %5 = affine.max #map1(%4)\n %extracted_slice = tensor.extract_slice %arg3[0, %arg2] [%dim, 1] [1, 1] : tensor to tensor\n %6 = affine.apply #map2(%arg2)[%dim_0]\n %extracted_slice_2 = tensor.extract_slice %arg0[0, %6] [%dim, %5] [1, 1] : tensor to tensor\n %extracted_slice_3 = tensor.extract_slice %extracted_slice[0] [%dim] [1] : tensor to tensor\n %7 = linalg.generic {indexing_maps = [#map3, #map4], iterator_types = [\"parallel\", \"reduction\"]} ins(%extracted_slice_2 : tensor) outs(%extracted_slice_3 : tensor) {\n ^bb0(%in: f32, %out: f32):\n %9 = arith.addf %in, %out : f32\n linalg.yield %9 : f32\n } -> tensor\n scf.forall.in_parallel {\n tensor.parallel_insert_slice %7 into %arg3[0, %arg2] [%dim, 1] [1, 1] : tensor into tensor\n }\n } {mapping = []}\n %3 = linalg.generic {indexing_maps = [#map3, #map4], iterator_types = [\"parallel\", \"reduction\"]} ins(%2 : tensor) outs(%arg1 : tensor) {\n ^bb0(%in: f32, %out: f32):\n %4 = arith.addf %in, %out : f32\n linalg.yield %4 : f32\n } -> tensor\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "fill_op", "type": "Variadic" }, { "name": "split_op", "type": "TransformHandleTypeInterface" }, { "name": "combining_op", "type": "TransformHandleTypeInterface" }, { "name": "forall_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "reduction_dims", "type": "DefaultValuedAttr, {}>" }, { "name": "num_threads", "type": "DefaultValuedAttr" }, { "name": "tile_sizes", "type": "DefaultValuedAttr" }, { "name": "mapping", "type": "OptionalAttr>>" } ], "assemblyFormat": "$target\n (`reduction_dims` `=` $reduction_dims^)?\n `by`\n (`num_threads` `=` $num_threads^)?\n (`tile_sizes` `=` $tile_sizes^)?\n (`mapping` `=` $mapping^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.tile_using_for", "description": "Indicates that the given `target` op should be tiled with the given sizes.\n This transform generates a loop nest with a smaller (\"tiled\") target\n operation in its body. Currently limited to LinalgOps.\n\n Tile sizes may be known at transformation time, in which case they are\n expected to be provided in the `static_size` attribute, or not, in which\n case the tile value must be computed by the payload IR and the handle to the\n operation computing it must be provided through `dynamic_sizes`. When the\n sizes are not known statically, the corresponding entry in the\n `static_sizes` attribute must be set to `ShapedType::kDynamic`. Only\n the dynamic sizes must be provided in `dynamic_sizes`, i.e., there should\n be as many handles as `ShapedType::kDynamic` values in the\n `static_sizes` attribute. A static size of `0` indicates that the dimension\n should not be tiled. No loop will be generated for such dimensions. If all\n tile sizes are `0`, this transform is effectively a no-op.\n\n This op returns handles to the tiled op (in the generated loop nest) and the\n generated loops. The number of loops is the number of tile sizes that are\n statically known to be non-zero.\n\n #### Return modes\n\n On success, the resulting handles are associated with co-indexed lists of\n tiled operations and loops around them.\n\n This operation only supports Linalg ops and produces a silenceable failure\n if the input contains any non-Linalg ops. The ops preceding it in the list\n associated with the `target` handle will have been tiled.\n\n This operation produces a silenceable failure if the `dynamic_sizes` handles\n are associated with lists of payload operations of a size different than\n that of the list associated with the `target` handle.\n\n If the internal implementation of tiling for any of the operations fails,\n produces a definite failure.\n\n The optional `inner_tile_alignments` attribute forwards a per-dimension\n `InnerTileAlignment` hint to the tiling driver for pack/unpack tiling.\n These are only used to hint alignment or equality between the pack/unpack\n operations inner tile sizes, and the loop tile sizes. No other operation\n needs them.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "dynamic_sizes", "type": "Variadic" } ], "results": [ { "name": "tiled_linalg_op", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "static_sizes", "type": "DefaultValuedOptionalAttr" }, { "name": "interchange", "type": "DefaultValuedOptionalAttr" }, { "name": "scalable_sizes", "type": "DefaultValuedOptionalAttr" }, { "name": "inner_tile_alignments", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target\n `tile_sizes` custom(\n $dynamic_sizes,\n $static_sizes,\n $scalable_sizes)\n (`interchange` `=` $interchange^)?\n (`inner_tile_alignments` `=`\n custom($inner_tile_alignments)^)?\n attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.tile_using_forall", "description": "Tile a TilingInterface op to a tiled `scf.forall`.\n\n Tiling is applied by either specifying `num_threads` or `tile_size`. If\n `num_threads` is specified, then the tile size for each dimension `i` is\n calculated dynamically via `ceilDiv(dimSize[i], num_threads[i])`.\n `num_threads` and `tile_size` can be either static index attributes or\n operation handles (or a mix thereof). Operation handles must be mapped to\n exactly one op that has exactly one result of index type.\n\n Static zero tile sizes indicate that the dimension is not tiled and can be\n thought of as tiling by the full size of data.\n\n It is the user's responsibility to ensure that `num_threads/tile_sizes` is\n a valid tiling specification (i.e. that only tiles parallel dimensions,\n e.g. in the Linalg case). If the dimension is not parallelizable, a warning\n is issued to notify the user that the generated code is not safe to\n parallelize.\n\n If non-empty, the `mapping` is added as an attribute to the\n resulting `scf.forall`.\n\n Note: `tile_sizes` and `num_threads` are variadic. Each tile size/number of\n threads can be an index attribute or a transform handle that is mapped to\n exactly one payload op with exactly one index result.\n\n #### Return modes\n\n This operation ignores ops that do not implement the TilingInterface and\n drops them in the return.\n\n If all the operations referred to by the `target` handle tile\n successfully, the transform succeeds.\n Otherwise the transform produces a silenceable failure.\n\n The two returned handles point to only the subset of successfully produced\n tiled operations, which can all be empty.\n\n These two returned handles point to:\n - the tiled op that implements TilingInterface,\n - the new scf.forall op.\n\n #### Example using `num_threads`\n\n ```\n %0 = transform.structured.match ops{[\"linalg.matmul\"]} in %arg1\n : (!transform.any_op) -> !transform.any_op\n %3:2 = transform.structured.tile_using_forall %0 num_threads [10, 20]\n : (!transform.any_op) -> (!transform.any_op, !transform.any_op)\n ```\n\n #### Example using `tile_sizes`\n\n ```\n %0 = transform.structured.match ops{[\"linalg.matmul\"]} in %arg1\n : (!transform.any_op) -> !transform.any_op\n %sz = transform.structured.match ...\n %3:2 = transform.structured.tile_using_forall %0 tile_sizes [0, %sz, 20]\n : (!transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op)\n ```", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "num_threads", "type": "Variadic" }, { "name": "tile_sizes", "type": "Variadic" }, { "name": "packed_num_threads", "type": "Optional" }, { "name": "packed_tile_sizes", "type": "Optional" } ], "results": [ { "name": "tiled_op", "type": "TransformHandleTypeInterface" }, { "name": "forall_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "static_num_threads", "type": "DefaultValuedOptionalAttr" }, { "name": "static_tile_sizes", "type": "DefaultValuedOptionalAttr" }, { "name": "mapping", "type": "OptionalAttr>>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$target oilist(\n `num_threads` custom($packed_num_threads,\n $num_threads,\n $static_num_threads) |\n `tile_sizes` custom($packed_tile_sizes,\n $tile_sizes,\n $static_tile_sizes))\n (`(` `mapping` `=` $mapping^ `)`)? attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.structured.transpose_conv2d", "description": "Convert linalg.conv_2d_nhwc_fhwc into linalg.conv_2d_nhwc_hwcf by introducing\n a linalg.transpose on the filter tensor/memref.\n\n Whilst the fhwc filter channel ordering can be desirable for certain targets\n and is a more direct mapping to higher level dialects such as TOSA (which only\n supports this ordering) hwcf is better suited for transformations such as\n img2col which can make use of optimized BLAS routines such as GEMM.\n\n Returns one handle:\n - The final operation of the sequence that replaces the original\n convolution.\n\n #### Return modes:\n\n Returns a definite failure if target is not isolated from above.\n Returns a silenceable failure if the pattern application failed.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.structured.transpose_matmul", "description": "Convert Linalg matmul ops to transposed variants.\n\n By default the LHS matrix is transposed. Specify `` to instead\n transpose RHS matrix.\n\n #### Return modes:\n\n This operation fails if `target` is unsupported, i.e., not a\n `linalg.matmul` or `linalg.batch_matmul`. Otherwise, the operation succeeds\n and returns a handle to the transposed matmul op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "inputToTranspose", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target (`<` $inputToTranspose^ `>`)?\n attr-dict `:` functional-type($target, results)" }, { "name": "transform.structured.vectorize", "description": "Vectorize the target ops, which must be Linalg ops.\n\n Use the optional vector sizes to specify exactly what configuration the\n vectorizer should use. It will then use masked vectors of the specified\n size to enforce this configuration (\"masked vectorization\"). If no vector\n sizes are specified, the vectorizer will infer the shapes to use from the\n target Linalg ops (\"regular vectorization\"). More specifically:\n\n ```mlir\n # Masked vectorization - vector sizes are specified explicitly\n transform.structured.vectorize %target vector_sizes [1, 4] : !transform.any_op\n # Regular vectorization - vector sizes are inferred from the target Op\n transform.structured.vectorize %target : !transform.any_op\n ```\n\n The vector sizes can be either static or dynamic (SSA values). In case of\n SSA values, the handle must be mapped to exactly one payload op with\n exactly one index-typed result.\n\n Note: The input vector sizes must be bigger than or equal to their\n counterpart iteration space sizes.\n\n Typically this operator should be applied to linalg operations that have\n already been tiled to the appropriate sizes.\n\n #### Return modes:\n\n This operation produces a silenceable failure if at least one target op is\n not a Linalg op or fails to vectorize. It produces a definite failure if\n the dynamic vector sizes (SSA values) do not satisfy the constraints\n mentioned above.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "vector_sizes", "type": "Variadic" } ], "attributes": [ { "name": "static_vector_sizes", "type": "DefaultValuedOptionalAttr" }, { "name": "vectorize_nd_extract", "type": "OptionalAttr" }, { "name": "assume_dynamic_dims_match_vec_sizes", "type": "OptionalAttr" }, { "name": "create_named_contraction", "type": "OptionalAttr" }, { "name": "scalable_sizes", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target oilist(\n `vector_sizes` custom(\n $vector_sizes,\n $static_vector_sizes,\n $scalable_sizes))\n attr-dict\n `:` type($target)(`,`type($vector_sizes)^)?" }, { "name": "transform.structured.vectorize_children_and_apply_patterns", "description": "Vectorizes all children contained in the given `target` using the\n configuration specified by the attributes of this op. This only vectorizes\n structured ops that operate on shaped types and does not vectorize loops or\n straight-line. Internally, it applies a set of rewrite patterns, some of\n which enable vectorization and some of which clean up the results.\n Therefore, it can only be applied to an op with the \"isolated from above\"\n property. This transformation only fails if the entire pattern rewriting\n failed, i.e., it does **not** fail when no ops were vectorized.\n\n Finer granularity can be achieved either with the `VectorizeOp` for\n individual ops or by outlining the target part of the payload IR into, e.g.,\n a function, performing this transformation, and inlining it back.\n\n Note that this transformation invalidates the handles to any payload IR\n operation that is contained inside the vectorization target.\n\n This transformation supports the following attributes:\n - `fold_type_extensions_into_contract`: a `UnitAttr` to enable the folding of\n type extension operations into `vector.contract` to create a mixed precision\n operation.\n - `vectorize_padding`: a `UnitAttr` to activate the vectorization of\n `tensor.pad` ops. Different pipelines may prefer to lower such ops to\n loops.\n - `disable_multi_reduction_to_contract_patterns`: a `UnitAttr` to deactivate\n the rewrite of `vector.multi_reduction` to `vector.contract`. This is\n intended to be used in tests only.\n - `disable_transfer_permutation_map_lowering_patterns`: a `UnitAttr` to\n deactivate the rewrite of `vector.transfer` with permutation maps into\n explicit `vector.transpose` operations. This is intended to be used in\n tests only but may be promoted to a first class attribute in the future.\n\n #### Return modes:\n\n This operation produces a definite failure if vectorization fails for any\n reason.\n The operation always returns the handle to the target op that is expected\n to be isolated from above.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "fold_type_extensions_into_contract", "type": "UnitAttr" }, { "name": "vectorize_padding", "type": "UnitAttr" }, { "name": "vectorize_nd_extract", "type": "UnitAttr" }, { "name": "flatten_1d_depthwise_conv", "type": "UnitAttr" }, { "name": "disable_multi_reduction_to_contract_patterns", "type": "UnitAttr" }, { "name": "disable_transfer_permutation_map_lowering_patterns", "type": "UnitAttr" } ], "assemblyFormat": "$target attr-dict `:`functional-type(operands, results)" }, { "name": "transform.structured.winograd_conv2d", "description": "Winograd Conv2D algorithm will convert linalg Conv2D operation into batched\n matrix multiply. Before the matrix multiply, it will convert filter and\n input into a format suitable for batched matrix multiply. After the matrix\n multiply, it will convert output to the final result tensor.\n\n The algorithm F(m x m, r x r) is\n\n Y = A^T x [(G x g x G^T) @ (B^T x d x B)] x A\n\n The size of output Y is m x m. The size of filter g is r x r. The size of\n input d is (m + r - 1) x (m + r - 1). A^T, A, G^T, G, B^T, and B are\n transformation matrices.\n\n #### Return modes:\n\n This operation produces a silenceable failure if `target` is unsupported.\n Otherwise, the operation succeeds and returns a handle of the sequence that\n replaces the original convolution.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "fmr", "type": "WinogradConv2DFmr{F_2_3|F_4_3|F_2_5}" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, results)" }, { "name": "transform.tensor.make_loop_independent", "description": "Rewrite the targeted ops such that their index-typed operands no longer\n depend on any loop induction variable of the `num_loop` enclosing `scf.for`\n loops. I.e., compute an upper bound that is independent of any such loop IV\n for every tensor dimension. The transformed op could then be hoisted from\n the `num_loop` enclosing loops. To preserve the original semantics, place a\n `tensor.extract_slice` inside the loop.\n\n Currently supported operations are:\n - tensor.empty: Replaced with a new tensor.empty with upper bound sizes,\n followed by a tensor.extract_slice.\n - tensor.pad: Replaced by an upper bound padding, followed by a\n tensor.extract_slice.\n\n #### Return modes\n\n This operation fails if at least one induction variable could not be\n eliminated. In case the targeted op is already independent of induction\n variables, this transform succeeds and returns the unmodified target op.\n\n Otherwise, the returned handle points to a subset of the produced ops:\n - tensor.empty: The returned handle points to the tensor.extract_slice op.\n - tensor.pad: The returned handle points to the tensor.extract_slice op.\n\n This transform op consumes the target handle and produces a result handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "num_loops", "type": "I64Attr" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, $transformed)" }, { "name": "transform.test_add_test_extension", "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$message attr-dict" }, { "name": "transform.test_add_to_param", "operands": [ { "name": "param", "type": "Optional" } ], "results": [ { "name": "result", "type": "TestTransformTestDialectParamType" } ], "attributes": [ { "name": "addendum", "type": "I32Attr" } ], "assemblyFormat": "($param^ `,`)? $addendum attr-dict" }, { "name": "transform.test_branching_transform_op_terminator", "successors": [ { "name": "succ", "type": "VariadicSuccessor" } ] }, { "name": "transform.test_check_if_test_extension_present", "operands": [ { "name": "operand", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)" }, { "name": "transform.test_consume_operand", "operands": [ { "name": "operand", "type": "Transform_AnyHandleOrParamType" }, { "name": "second_operand", "type": "Optional" } ], "attributes": [ { "name": "allow_repeated_handles", "type": "UnitAttr" } ], "assemblyFormat": "$operand (`,` $second_operand^)? attr-dict `:` type($operand)(`,` type($second_operand)^)?" }, { "name": "transform.test_consume_operand_each", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.test_consume_operand_of_op_kind_or_fail", "operands": [ { "name": "operand", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "op_kind", "type": "StrAttr" } ], "assemblyFormat": "$operand `,` $op_kind attr-dict `:` type($operand)" }, { "name": "transform.test_copy_payload", "operands": [ { "name": "handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "copy", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$handle attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_correct_number_of_multi_results", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result1", "type": "TransformHandleTypeInterface" }, { "name": "result2", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_dummy_payload_op", "operands": [ { "name": "args", "type": "Variadic" } ], "results": [ { "name": "outs", "type": "Variadic" } ], "attributes": [ { "name": "fail_to_verify", "type": "UnitAttr" } ], "assemblyFormat": "$args attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_emit_remark_and_erase_operand", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "remark", "type": "StrAttr" }, { "name": "fail_after_erase", "type": "UnitAttr" } ], "assemblyFormat": "$target `,` $remark attr-dict `:` type($target)" }, { "name": "transform.test_initializer_extension", "attributes": [ { "name": "type", "type": "StrAttr" } ], "assemblyFormat": "$type attr-dict" }, { "name": "transform.test_mixed_null_and_non_null_results", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "null", "type": "TransformHandleTypeInterface" }, { "name": "non_null", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_mixed_success_and_silenceable", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.test_notify_payload_op_replaced", "operands": [ { "name": "original", "type": "TransformHandleTypeInterface" }, { "name": "replacement", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$original `,` $replacement attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_produce_empty_payload", "results": [ { "name": "out", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "attr-dict `:` type($out)" }, { "name": "transform.test_produce_invalid_ir", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.test_produce_null_param", "results": [ { "name": "out", "type": "TransformParamTypeInterface" } ], "assemblyFormat": "attr-dict `:` type($out)" }, { "name": "transform.test_produce_null_payload", "results": [ { "name": "out", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "attr-dict `:` type($out)" }, { "name": "transform.test_produce_null_value", "results": [ { "name": "out", "type": "TransformValueHandleTypeInterface" } ], "assemblyFormat": "attr-dict `:` type($out)" }, { "name": "transform.test_produce_param", "results": [ { "name": "result", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "attr", "type": "AnyAttr" } ], "assemblyFormat": "`(` $attr `)` attr-dict `:` type($result)" }, { "name": "transform.test_produce_param_with_number_of_test_ops", "operands": [ { "name": "handle", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TestTransformTestDialectParamType" } ], "assemblyFormat": "$handle attr-dict `:` type($handle)" }, { "name": "transform.test_produce_self_handle_or_forward_operand", "operands": [ { "name": "operand", "type": "Optional" } ], "results": [ { "name": "res", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "($operand^)? attr-dict `:` functional-type($operand, $res)" }, { "name": "transform.test_produce_transform_param_or_forward_operand", "operands": [ { "name": "in", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "out", "type": "AnyType" }, { "name": "param", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "first_result_is_param", "type": "UnitAttr" }, { "name": "first_result_is_null", "type": "UnitAttr" }, { "name": "second_result_is_handle", "type": "UnitAttr" } ], "assemblyFormat": "$in attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_produce_value_handle_to_argument_of_parent_block", "operands": [ { "name": "in", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "out", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "number", "type": "I64Attr" } ], "assemblyFormat": "$in `,` $number attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_produce_value_handle_to_result", "operands": [ { "name": "in", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "out", "type": "TransformValueHandleTypeInterface" } ], "attributes": [ { "name": "number", "type": "I64Attr" } ], "assemblyFormat": "$in `,` $number attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_produce_value_handle_to_self_operand", "operands": [ { "name": "in", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "out", "type": "TransformValueHandleTypeInterface" } ], "assemblyFormat": "$in attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_re_enter_region", "operands": [ { "name": "args", "type": "Variadic" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "($args^ `:` type($args))? attr-dict-with-keyword regions" }, { "name": "transform.test_remap_operand_to_self", "operands": [ { "name": "operand", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "out", "type": "Optional" } ], "assemblyFormat": "$operand attr-dict `:` functional-type($operand, $out)" }, { "name": "transform.test_remove_test_extension", "assemblyFormat": "attr-dict" }, { "name": "transform.test_report_number_of_tracked_handles_nested_under", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.test_required_memory_effects", "operands": [ { "name": "in", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "out", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "has_operand_effect", "type": "UnitAttr" }, { "name": "has_result_effect", "type": "UnitAttr" }, { "name": "modifies_payload", "type": "UnitAttr" } ], "assemblyFormat": "$in attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_reverse_payload_ops", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_succeed_if_operand_of_op_kind", "operands": [ { "name": "operand_handle", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "op_kind", "type": "StrAttr" } ], "assemblyFormat": "$operand_handle `,` $op_kind attr-dict `:` type($operand_handle)" }, { "name": "transform.test_tracked_rewrite", "operands": [ { "name": "in", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$in attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test_transform_op" }, { "name": "transform.test_transform_op_with_regions", "regions": [ { "name": "first", "type": "AnyRegion" }, { "name": "second", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword regions" }, { "name": "transform.test_wrong_number_of_multi_results", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type($target, $result)" }, { "name": "transform.test_wrong_number_of_results", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "a", "type": "TransformHandleTypeInterface" }, { "name": "b", "type": "TransformHandleTypeInterface" }, { "name": "c", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.fuse_and_yield", "description": "Tiles the operations pointed to by the target handle, fuses their\n producers greedily using the options provided as attributes.\n It also yields some of the fused producers for testing.\n\n On success returns the tiled operations as well as generated loops. Emits\n a definite failure if tiling fails.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "transfomed", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "tile_sizes", "type": "DefaultValuedAttr, {}>" }, { "name": "tile_interchange", "type": "DefaultValuedAttr, {}>" }, { "name": "use_forall", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$target ($tile_sizes^)? (`interchange` $tile_interchange^)?\n (`use_forall` $use_forall^)? attr-dict \n `:` functional-type(operands, results)" }, { "name": "transform.test.fuse_consumer", "description": "For the `consumer` that uses the result of the outer-most loop of a loop nest passed in \n as `loops` (that are typically generated through tiling), fuse the consumer into the\n loop.\n\n Returns a handle to the consumer operation after fusion and the loops that might be\n modified.\n\n The optional `inner_tile_alignments` array is supplied to the SCF driver as a\n constant `scf::InnerTileAlignmentFnTy` control function (returning it for\n every op, see `InnerTileAlignment`).", "operands": [ { "name": "consumer", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "results": [ { "name": "fused_consumer", "type": "TransformHandleTypeInterface" }, { "name": "result_loops", "type": "Variadic" } ], "attributes": [ { "name": "inner_tile_alignments", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$consumer `into` `(` $loops `)`\n (`inner_tile_alignments` `=`\n custom($inner_tile_alignments)^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.fuse_consumer_using_slice", "description": "For the `insert_slice`-like operations (that are typically generated through tiling),\n within the loop nests passed in as `loops` (that are typically generated through tiling),\n find the consumer that these slices map to (have to be the same consumer) and fuse\n the consumer into the loop.\n\n Returns a handle to the original consumer operation and the consumer operation after\n fusion.", "operands": [ { "name": "targets", "type": "Variadic" }, { "name": "loops", "type": "Variadic" } ], "results": [ { "name": "consumer", "type": "TransformHandleTypeInterface" }, { "name": "fused_consumer", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "num_consumer_to_fuse", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$targets `in` `(` $loops `)`\n (`num_consumer_to_fuse` `=` $num_consumer_to_fuse^)? \n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.fuse_using_forall", "description": "Test operation to tile the operation pointed to by the target handle and\n fuses their producers greedily using the options provided as attributes.\n This operation uses scf.forall for the loop construct.", "operands": [ { "name": "root_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "tiled_ops", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "tile_sizes", "type": "DefaultValuedAttr, {}>" }, { "name": "interchange", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "mapping", "type": "OptionalAttr>>" } ], "assemblyFormat": "$root_op ($tile_sizes^)? (`interchange` $interchange^)?\n (`mapping` `=` $mapping^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.make_composed_folded_affine_apply", "description": "Rewrite an affine_apply by using the makeComposedFoldedAffineApply API.", "operands": [ { "name": "op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "composed", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$op attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.move_operand_deps", "description": "Moves all dependencies of on operation before another operation.", "operands": [ { "name": "op", "type": "TransformHandleTypeInterface" }, { "name": "insertion_point", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$op `before` $insertion_point attr-dict\n `:` type($op) `,` type($insertion_point)" }, { "name": "transform.test.move_value_defns", "description": "Moves all dependencies of a list of values before another operation.\n Only pure operations are moved. If there is a side effecting op in the\n dependency chain no operations are moved.", "operands": [ { "name": "values", "type": "Variadic" }, { "name": "insertion_point", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$values `before` $insertion_point attr-dict\n `:` `(` type($values) `)` `` `,` type($insertion_point)" }, { "name": "transform.test.query_consumer_fusability", "description": "Test operation for the consumer fusability query method in the\n TilingInterface.\n\n For each operation in the target handle, this looks for tensor.extract_slice\n ops that consume results of the tilable op. The offset/sizes from those\n extracts is used as the arguments to `isOpFusableWithConsumerSlice` and\n emits a remark with the result of the query.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.test.query_producer_fusability", "description": "Test operation for the producer fusability query method in the\n TilingInterface.\n\n For each operation in the target handle, this looks for tensor.insert_slice\n ops that produce operands to the tilable op. The offset/sizes from those\n inserts is used as the arguments to `isOpFusableWithProducerSlices` and\n emits a remark with the result of the query.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.test.tile_and_fuse_outer_parallel_partial_reduction", "description": "Test operation to tile an operation using partial reduction with\n outer parallel strategy, and to fuse its producers.", "operands": [ { "name": "root_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "tiled_ops", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "reduction_dims", "type": "DefaultValuedAttr, {}>" }, { "name": "tile_sizes", "type": "DefaultValuedAttr, {}>" }, { "name": "mapping", "type": "OptionalAttr>>" } ], "assemblyFormat": "$root_op (`reduction_dims` `=` $reduction_dims^)?\n (`tile_sizes` `=` $tile_sizes^)? (`mapping` `=` $mapping^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.tile_using_custom_loop", "description": "Test Transform op to tile an operation using custom loops.\n\n The test just folds all the loops and into a single loop and then\n delinearizes the indices.", "operands": [ { "name": "root_op", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "tiled_ops", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "tile_sizes", "type": "DefaultValuedAttr, {}>" } ], "assemblyFormat": "$root_op `tile_sizes` `=` $tile_sizes\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.test.tile_using_forall", "description": "Test operation use to test tiling using TilingInterface and scf.forall for\n the loop constructs. This is similar to\n `transform.structured.tile_using_for`. Use of this operation is an\n intermediate state and will be replaced in due course with either\n `transform.structured.tile_using_for` or\n `transform.structured.tile_using_forall`.\n\n On success returns the tiled operations as well as generated loops. Emits\n a definite failure if tiling fails.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "tiled_op", "type": "TransformHandleTypeInterface" }, { "name": "loops", "type": "Variadic" } ], "attributes": [ { "name": "tile_sizes", "type": "DefaultValuedAttr, {}>" }, { "name": "interchange", "type": "DefaultValuedOptionalAttr, {}>" }, { "name": "mapping", "type": "OptionalAttr>>" } ], "assemblyFormat": "$target ($tile_sizes^)? (`interchange` `=` $interchange^)?\n (`mapping` `=` $mapping^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.tune.alternatives", "summary": "Represents a choice among its regions, i.e. sub-schedules", "description": "This op represents a choice over which of its regions is to be used.\n\n When `selected_region` is provided, the semantics are that this op is to be\n substituted for by the selected region, meaning the region's results become\n the results of this op. Without a provided `selected_region`, the semantics\n are that this non-deterministic choice is yet to be resolved -- which in\n terms of the op's interpreted semantics is a failure.\n\n The `selected_region` argument is either an `IntegerAttr` or a param holding\n an `IntegerAttr`, which should provide a valid zero-based index with respect\n to the number of alternatives, i.e. regions.", "operands": [ { "name": "selected_region_param", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "Builtin_StringAttr" }, { "name": "selected_region_attr", "type": "OptionalAttr" } ], "regions": [ { "name": "alternatives", "type": "VariadicRegion>" } ], "assemblyFormat": "`<` $name `>`\n (`selected_region` `=` custom(\n $selected_region_attr, $selected_region_param)^)?\n attr-dict-with-keyword\n (`:` type($selected_region_param)^)?\n (`->` type($results)^)?\n regions" }, { "name": "transform.tune.knob", "summary": "Represents a tunable parameter with a set of options", "description": "Provides a representation for \"tunables\" within schedules.\n\n Each op represents a single tunable, which has a `name` and a set\n of valid `options` described by an attribute. Without a specified\n `selected` option, this op represents a non-deterministic choice\n that has yet to be resolved -- as such, the interpreter runtime\n semantics is to raise a failure.\n\n The non-deterministic choice is resolved through providing a\n `selected` attribute. When provided, the interpreter runtime\n semantics are to return the `selected` attribute as a param through\n the op's result.\n\n -----\n\n In case the `options` attribute is an `ArrayAttr`, the verifier\n checks that the provided `selected` attribute occurs in `options`.", "results": [ { "name": "result", "type": "TransformParamTypeInterface" } ], "attributes": [ { "name": "name", "type": "Builtin_StringAttr" }, { "name": "options", "type": "AnyAttr" }, { "name": "selected", "type": "OptionalAttr" } ], "assemblyFormat": "`<` $name `>` (`=` $selected^ `from`)? `options` `=` $options attr-dict `->` type(results)" }, { "name": "transform.type_conversion.tensor.cast_shape_dynamic_dims", "description": "Populates a type converter with conversion materialization functions that\n cast a tensor value between two cast-compatible tensors. See `tensor.cast`\n for more information on cast compatibility between tensors.\n\n If `ignore_dynamic_info` is not set, this will set an additional constraint\n that source materializations do not cast dynamic dimensions to static ones.", "attributes": [ { "name": "ignore_dynamic_info", "type": "UnitAttr" } ], "assemblyFormat": "(`ignore_dynamic_info` $ignore_dynamic_info^)? attr-dict" }, { "name": "transform.util.cast_and_call", "summary": "Casts values to the signature of a function and replaces them with a call.", "description": "This transform takes value handles to a set of `inputs` and `outputs` and\n attempts to cast them to the function signature of the attached function\n op, then builds a call to the function and replaces the users of the\n outputs. It is the responsibility of the user to ensure that the slice of\n the program replaced by this operation makes sense, i.e. there is no\n verification that the inputs to this operation have any relation to the\n outputs outside of basic dominance requirements needed for the call.\n\n The casting materialization functions are specified in the graph region of\n this op. They must implement the `TypeConverterBuilderOpInterface`. The\n order of ops within the region is irrelevant.\n\n The target function can be specified by a symbol name or by a handle to the\n operation.\n\n If |inline_call| is set, the function body will be inlined at the insertion\n point instead of called. This will lead to a definite failure if the\n function exists but does not contain a single basic block (0 or > 1).\n\n This transform only reads the operand handles and only replaces the users of\n the outputs with the results of the call. No handles are consumed and no\n operations are removed. Users are expected to run cleanup separately if\n desired.\n\n Warning: The replacement of the uses of the outputs could invalidate certain\n restricted value handle types (e.g. `transform.block_arg` if it existed, by\n replacing the use with something not coming from a block argument). The\n value will still exist in such cases but wouldn't verify against the type.\n See the discussion here for more information:\n https://github.com/llvm/llvm-project/pull/78398#discussion_r1455070087\n\n This transform will emit a silenceable failure if:\n - The set of outputs isn't unique\n - The handle for the insertion point does not include exactly one operation\n - The insertion point op does not dominate any of the output users\n - The insertion point op is not dominated by any of the inputs\n - The function signature does not match the number of inputs/outputs\n\n This transform will emit a definite failure if it fails to resolve the\n target function, or if it fails to materialize the conversion casts of\n either the inputs to the function argument types, or the call results to\n the output types.", "operands": [ { "name": "insertion_point", "type": "TransformHandleTypeInterface" }, { "name": "inputs", "type": "Optional" }, { "name": "outputs", "type": "Optional" }, { "name": "function", "type": "Optional" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "insert_after", "type": "UnitAttr" }, { "name": "inline_call", "type": "UnitAttr" }, { "name": "function_name", "type": "OptionalAttr" } ], "regions": [ { "name": "conversions", "type": "MaxSizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`inline_call` $inline_call^)?\n ($function_name^)? ($function^)?\n ( `(` $inputs^ `)` )?\n ( `->` $outputs^ )?\n (`after` $insert_after^):(`before`)? $insertion_point\n ($conversions^)? attr-dict `:` functional-type(operands, results)" }, { "name": "transform.util.create_serialized_module", "summary": "Creates a serialized module op using the transform region.", "description": "This op creates an owning op reference to a module op and executes the\n transforms contained within this operations body on it. Then the serialized\n module is returned.\n\n The body of this op provides a single block argument providing the temporary\n module for modification. No transform on the module is allowed to consume\n it.", "results": [ { "name": "result", "type": "TransformParamTypeInterface" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "assemblyFormat": "attr-dict-with-keyword regions `->` type($result)" }, { "name": "transform.util.deserialize_module", "description": "Deserializes |module| to a ModuleOp and inserts it at the end of\n |container|. This operation is currently only used for testing purposes.", "operands": [ { "name": "module", "type": "TransformParamTypeInterface" }, { "name": "container", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$module `into` $container attr-dict `:` type($module) `,` type($container)" }, { "name": "transform.util.eliminate_hoistable_conversions", "description": "Hoists and cancels matching `util.hoistable_conversion` pairs on the\n target op. See the op documentation for the optimizations performed and the\n requirements on the op contents.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.util.get_nearest_symbol_table", "description": "Returns the nearest symbol table op for each op in the payload, inclusive.\n\n This operation reads the `target` handle and produces the `result`\n handle. This operation emits a definite failure if the nearest symbol table\n is unknown.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "result", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.util.import_symbol", "description": "Clones the op defined by the given symbol into the given symbol table and\n returns the cloned symbol. If `force_import` is set, this will (unsafely)\n overwrite any pre-existing definitions of the same symbol. If\n `if_undefined` is set, this will return a handle to the pre-existing symbol\n in the payload if found instead of failing.\n\n #### Return modes\n\n This operation reads the `symbol_table` handle and produces the\n `cloned_symbol` handle. This operation emits a definite failure if the if\n the `symbol_table` op does not define a symbol table.\n\n This will emit a definite failure if the symbol already exists in the\n symbol table and neither `force_import` and `if_undefined` are set.", "operands": [ { "name": "symbol_table", "type": "TransformHandleTypeInterface" } ], "results": [ { "name": "cloned_symbol", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "symbol", "type": "SymbolRefAttr" }, { "name": "if_undefined", "type": "UnitAttr" }, { "name": "force_import", "type": "UnitAttr" } ], "assemblyFormat": "(`force` $force_import^)? $symbol `into` $symbol_table\n (`if` `undefined` $if_undefined^)? attr-dict\n `:` functional-type(operands, results)" }, { "name": "transform.util.lookup_nearest_symbol_from_self", "description": "Returns a reference to the symbol with the specified name within the nearest\n symbol table to this operation.\n\n #### Return modes\n\n This operation produces the `target_symbol` handle based on `symbol` and\n the nearest symbol table. This operation emits a definite failure if the\n symbol does not exist.", "results": [ { "name": "target_symbol", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "symbol", "type": "SymbolRefAttr" } ], "assemblyFormat": "$symbol attr-dict `:` type($target_symbol)" }, { "name": "transform.verify", "summary": "Verifies the targeted ops", "description": "This transform verifies the targeted ops. If at least one op fails to\n verify, the transform produces a definite failure.\n\n Note: This op was designed for debugging purposes and should be used like an\n assertion. It is intentional that this op produces a definite failure and\n not a silenceable one. Correctness of the program should not depend on this\n op.\n\n This transform reads the target handle.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` type($target)" }, { "name": "transform.with_pdl_patterns", "summary": "Contains PDL patterns available for use in transforms", "description": "This op contains a set of named PDL patterns that are available for the\n Transform dialect operations to be used for pattern matching. For example,\n PDLMatchOp can be used to produce a Transform IR value associated with all\n Payload IR operations that match the pattern as follows:\n\n ```mlir\n transform.with_pdl_patterns {\n ^bb0(%arg0: !transform.any_op):\n pdl.pattern @my_pattern : benefit(1) {\n %0 = pdl.operation //...\n // Regular PDL goes here.\n pdl.rewrite %0 with \"transform.dialect\"\n }\n\n sequence %arg0 failures(propagate) {\n ^bb0(%arg1: !transform.any_op):\n %1 = pdl_match @my_pattern in %arg1\n // Use %1 as handle\n }\n }\n ```\n\n Note that the pattern is expected to finish with a `pdl.rewrite` terminator\n that points to the custom rewriter named \"transform.dialect\". The rewriter\n actually does nothing, but the transform application will keep track of the\n operations that matched the pattern.\n\n This op is expected to contain `pdl.pattern` operations and exactly one\n another Transform dialect operation that gets executed with all patterns\n available. This op is a possible top-level Transform IR op, the argument of\n its entry block corresponds to either the root op of the payload IR or the\n ops associated with its operand when provided.", "operands": [ { "name": "root", "type": "Optional" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "defaultDialect": "transform", "assemblyFormat": "($root^ `:` type($root))? attr-dict-with-keyword regions" }, { "name": "transform.xegpu.convert_layout", "summary": "Convert xegpu.layout attribute for a value.", "description": "Adds an `xegpu.convert_layout` op to convert the `xegpu.layout` attribute\n of a value before its first use. The input and target layouts are defined\n by the `*sg_layout`, `*sg_data` and optional `*inst_data` and `*order`\n attributes. Returns a handle to the emitted `xegpu.convert_layout` op.", "operands": [ { "name": "target", "type": "TransformValueHandleTypeInterface" }, { "name": "input_sg_layout", "type": "Variadic" }, { "name": "input_sg_data", "type": "Variadic" }, { "name": "input_inst_data", "type": "Variadic" }, { "name": "target_sg_layout", "type": "Variadic" }, { "name": "target_sg_data", "type": "Variadic" }, { "name": "target_inst_data", "type": "Variadic" } ], "results": [ { "name": "newConvertOp", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "input_order", "type": "DefaultValuedOptionalAttr" }, { "name": "static_input_sg_layout", "type": "DefaultValuedOptionalAttr" }, { "name": "static_input_sg_data", "type": "DefaultValuedOptionalAttr" }, { "name": "static_input_inst_data", "type": "DefaultValuedOptionalAttr" }, { "name": "static_target_sg_layout", "type": "DefaultValuedOptionalAttr" }, { "name": "static_target_sg_data", "type": "DefaultValuedOptionalAttr" }, { "name": "static_target_inst_data", "type": "DefaultValuedOptionalAttr" }, { "name": "target_order", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$target\n `input_sg_layout` `=` custom($input_sg_layout, $static_input_sg_layout)\n `input_sg_data` `=` custom($input_sg_data, $static_input_sg_data)\n (`input_inst_data` `=` custom($input_inst_data, $static_input_inst_data)^)?\n (`input_order` `=` $input_order^)?\n `target_sg_layout` `=` custom($target_sg_layout, $static_target_sg_layout)\n `target_sg_data` `=` custom($target_sg_data, $static_target_sg_data)\n (`target_inst_data` `=` custom($target_inst_data, $static_target_inst_data)^)?\n (`target_order` `=` $target_order^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.xegpu.get_desc_op", "summary": "Get a handle to the descriptor op of a value.", "description": "Traces the producers of the given value until an `xegpu.create_nd_tdesc`\n descriptor op is found. Returns a handle to it. Currently traces\n producers by following only the first operand of producer ops.", "operands": [ { "name": "target", "type": "TransformValueHandleTypeInterface" } ], "results": [ { "name": "descHandle", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.xegpu.get_load_op", "summary": "Get a handle to the load_nd op in producer chain of a value.", "description": "Traces the producers of the given value until an `xegpu.load_nd` or\n `xegpu.load` op is found. Returns a handle to it. Currently traces\n producers by following only the first operand of producer ops.", "operands": [ { "name": "target", "type": "TransformValueHandleTypeInterface" } ], "results": [ { "name": "loadNdHandle", "type": "TransformHandleTypeInterface" } ], "assemblyFormat": "$target attr-dict `:` functional-type(operands, results)" }, { "name": "transform.xegpu.insert_prefetch", "summary": "Adds xegpu prefetch ops to a load op.", "description": "Inserts `xegpu.prefetch_nd` operations for the given `xegpu.load_nd` op.\n The load op must reside within the `scf.for` loop. Number of prefetch steps\n is set by the `nb_prefetch` argument (default value is 1). Returns a handle\n to the created `xegpu.create_nd_desc` op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "dynamic_nb_prefetch", "type": "Optional" } ], "results": [ { "name": "desc_op", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "static_nb_prefetch", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target\n `nb_prefetch` `=` ($dynamic_nb_prefetch^):($static_nb_prefetch)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.xegpu.set_anchor_layout", "summary": "Set anchor layout of an op.", "description": "Sets the `xegpu.layout` anchor layout for XeGPU ops that support it. The\n target operand value can be set by the `index` argument (currently only\n applicable to a DPAS op). The layout is defined by the `sg_layout`,\n `sg_data` and optional `inst_data` and `order` attributes. If `slice_dims`\n is provided, the `xegpu.layout` attribute is wrapped in an\n `xegpu.slice<..., dims=slice_dims>` attribute. Emits a silenceable failure\n if the target op does not support anchor layouts.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "sg_layout", "type": "Variadic" }, { "name": "sg_data", "type": "Variadic" }, { "name": "inst_data", "type": "Variadic" } ], "attributes": [ { "name": "index", "type": "DefaultValuedOptionalAttr" }, { "name": "static_sg_layout", "type": "DefaultValuedOptionalAttr" }, { "name": "static_sg_data", "type": "DefaultValuedOptionalAttr" }, { "name": "static_inst_data", "type": "DefaultValuedOptionalAttr" }, { "name": "order", "type": "DefaultValuedOptionalAttr" }, { "name": "slice_dims", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$target (`index` `=` $index^)?\n `sg_layout` `=` custom($sg_layout, $static_sg_layout)\n `sg_data` `=` custom($sg_data, $static_sg_data)\n (`inst_data` `=` custom($inst_data, $static_inst_data)^)?\n (`order` `=` $order^)?\n (`slice_dims` `=` $slice_dims^)?\n attr-dict `:` qualified(type(operands))" }, { "name": "transform.xegpu.set_desc_layout", "summary": "Set xegpu.layout attribute to a xegpu.create_nd_desc op result.", "description": "Given an `xegpu.create_nd_desc` operation, this transform adds\n `xegpu.layout` attribute to the result tensor descriptor. The layout is\n defined by the `sg_layout`, and `sg_data` and optional `inst_data`\n attributes. If `slice_dims` is provided, the `xegpu.layout` attribute is\n wrapped in an `xegpu.slice<..., dims=slice_dims>` attribute. Returns a handle to\n the transformed op.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "sg_layout", "type": "Variadic" }, { "name": "sg_data", "type": "Variadic" }, { "name": "inst_data", "type": "Variadic" } ], "results": [ { "name": "transformed", "type": "TransformHandleTypeInterface" } ], "attributes": [ { "name": "static_sg_layout", "type": "DefaultValuedOptionalAttr" }, { "name": "static_sg_data", "type": "DefaultValuedOptionalAttr" }, { "name": "static_inst_data", "type": "DefaultValuedOptionalAttr" }, { "name": "order", "type": "DefaultValuedOptionalAttr" }, { "name": "slice_dims", "type": "DefaultValuedOptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$target\n `sg_layout` `=` custom($sg_layout, $static_sg_layout)\n `sg_data` `=` custom($sg_data, $static_sg_data)\n (`inst_data` `=` custom($inst_data, $static_inst_data)^)?\n (`order` `=` $order^)?\n (`slice_dims` `=` $slice_dims^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "transform.xegpu.set_gpu_launch_threads", "summary": "Set number of threads for a given gpu.launch operation", "description": "Overrides the x,y,z threads operands of a given `gpu.launch` operation in-place.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "threads", "type": "Variadic" } ], "attributes": [ { "name": "static_threads", "type": "DefaultValuedOptionalAttr" } ], "assemblyFormat": "$target\n `threads` `=` custom($threads, $static_threads)\n attr-dict `:` qualified(type(operands))" }, { "name": "transform.xegpu.set_op_layout_attr", "summary": "Set xegpu.layout attribute of an op.", "description": "Sets the `xegpu.layout` attribute of an op. By default it sets the anchor\n layout for XeGPU ops that support it. If `result=true` or `operand=true`,\n it sets the `layout_result_{index}` or `layout_operand_{index}` attribute,\n respectively, applicable to any op. The target operand/result value is\n defined by the `index` argument. The layout is defined by the `sg_layout`,\n `sg_data` and optional `inst_data` attributes. If `slice_dims` is provided,\n the `xegpu.layout` attribute is wrapped in an `xegpu.slice<..., dims=slice_dims>`\n attribute.", "operands": [ { "name": "target", "type": "TransformHandleTypeInterface" }, { "name": "sg_layout", "type": "Variadic" }, { "name": "sg_data", "type": "Variadic" }, { "name": "inst_data", "type": "Variadic" } ], "attributes": [ { "name": "index", "type": "DefaultValuedOptionalAttr" }, { "name": "static_sg_layout", "type": "DefaultValuedOptionalAttr" }, { "name": "static_sg_data", "type": "DefaultValuedOptionalAttr" }, { "name": "static_inst_data", "type": "DefaultValuedOptionalAttr" }, { "name": "order", "type": "DefaultValuedOptionalAttr" }, { "name": "slice_dims", "type": "DefaultValuedOptionalAttr" }, { "name": "result", "type": "DefaultValuedAttr" }, { "name": "operand", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$target (`result` $result^)? (`operand` $operand^)? (`index` `=` $index^)?\n `sg_layout` `=` custom($sg_layout, $static_sg_layout)\n `sg_data` `=` custom($sg_data, $static_sg_data)\n (`inst_data` `=` custom($inst_data, $static_inst_data)^)?\n (`order` `=` $order^)?\n (`slice_dims` `=` $slice_dims^)?\n attr-dict `:` qualified(type(operands))" }, { "name": "transform.yield", "summary": "Yields operation handles from a transform IR region", "description": "This terminator operation yields operation handles from regions of the\n transform IR ops back to the containing op. It is not itself associated with\n any transformation on the payload IR and is used for flow purposes only.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "operands attr-dict (`:` type($operands)^)?" }, { "name": "triton_xla.atomic_spin_wait", "summary": "Spin-wait while reading u32 value(s) atomically.", "description": "Atomically read u32 value(s) from the memory location(s) specified by\n $ptr. The memory ordering guarantees are specified by the\n $mem_sync_(scope|semantic) attributes.\n\n The operation will spin-wait until the loaded value satisfies the\n condition specified by the $comparator relative to the $expected value.\n The loaded value is compared to $expected using the $comparator.\n As long as the comparison returns false, the spin-wait loop continues.\n If the comparison returns true, the spin-wait loop is finished.\n\n NB: In the end only a single lane/thread within a program will\n write to (or read from) a given memory location so the synchronization\n happens between a single writing lane with a single reading lane. However,\n the operation will wait until all lanes within the block have synchronized\n so the end result is a block level memory synchronization.\n\n For Memory Synchronization Scope, see comment on TTXLA_AtomicWriteOp.\n The following memory synchronization semantics are allowed:\n - relaxed: No memory ordering guarantees.\n - acquire: No reads or writes in the current block/program can be\n reordered before this wait. All writes in other programs that\n `release` the same memory location are visible in the current block.\n\n Internally this operation expands into an elementwise\n `ld.global...u32` and a labelled loop.", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "expected", "type": "TT_I32Like" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "mem_sync_scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" }, { "name": "mem_sync_semantic", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "comparator", "type": "TTXLA_ComparatorAttr{equal_to|less_than|less_than_or_equal_to|greater_than|greater_than_or_equal_to}" } ], "assemblyFormat": "$mem_sync_scope `,` $mem_sync_semantic `,`\n $ptr `,` $comparator `,` $expected (`,` $mask^) ? attr-dict `:`\n functional-type(operands, results)" }, { "name": "triton_xla.atomic_write", "summary": "Atomically write u32 value(s) to memory location(s).", "description": "Atomically write u32 value(s) to the memory location(s) specified by\n $ptr. The memory ordering guarantees are specified by the\n $mem_sync_(scope|semantic) attribute.\n\n An optional $mask argument can be provided to specify which of the\n sublanes/threads should be updated. The mask must be the same shape as\n the $ptr.\n\n Memory Synchronization Scope:\n - cta: The write is visible to all threads within the same compute\n thread-block.\n - gpu: The write is visible to all threads within the same GPU.\n - sys: The write is visible to all threads within the system.\n\n The following memory synchronization semantics are allowed:\n - relaxed: No memory ordering guarantees.\n - release: All writes that are issued before this one will be\n completed before the store is visible to other threads.\n\n Internally this operation expands into st.global...u32", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "value", "type": "TT_I32Like" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "mem_sync_scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" }, { "name": "mem_sync_semantic", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" } ], "assemblyFormat": "$mem_sync_scope `,` $mem_sync_semantic `,`\n $ptr `,` $value (`,` $mask^) ? attr-dict `:`\n functional-type(operands, results)" }, { "name": "triton_xla.block_barrier", "summary": "A block-level barrier for inter-GPU synchronization.", "description": "This operation implements a block-level barrier between multiple GPUs.\n It takes a pointer of pointers to signal buffers (one from each\n participating GPU), the rank of the current device, and a signal value to\n write/wait for. The signal values on consequent calls to this operation must\n increase monotonically for the same signal buffers pointer. A block on one\n GPU synchronizes with blocks on other GPUs with the same block id.\n\n *NOTE* Block orchestration order is not guaranteed across GPUs,\n so there is a chance of a deadlock should the number of blocks be greater\n than the number of SMs on a GPU. That is to say that if BlockN is launched\n on GPU0 and BlockM on GPU1 and they both wait for each other to finish,\n and there is no place to schedule more blocks on either GPU, then we\n will have a deadlock. In general, the user of this operation should avoid\n this by not oversubscribing the number of available SMs on a GPU. There is\n also a secondary restriction that the number of threads per block must\n exceed the number of participating GPUs. In the nominal case, where we are\n within a single NV Link domain, this should not be an issue since the number\n of participating GPUs would usually be much smaller than the number of\n threads per block.\n\n The synchronization logic is as follows:\n 1. Each GPU (identified by `device_rank`) writes the `signal` value to an\n index `blockId * world_size + device_rank` in *every* buffer provided in\n `$signal_buffers`.\n 2. After writing, GPU `r` polls its own buffer (`$signal_buffers[r]`).\n 3. It waits until the values at locations corresponding to all other ranks\n (i.e., `blockId * world_size + [0..world_size)` are greater than or equal\n to the `signal` value.\n 4. When the wait is over, all GPUs working on the same `blockId` have\n successfully synchronized.\n\n This operation ensures that GPUs in the same synchronization group do not\n get more than one \"wave\" (or chunk) of data processing ahead of each other.\n For clarity, a wave here is a set of work items that are processed together.\n A single thread block for instance can process multiple waves. In such a\n scenario, any given GPU can be at most 1 wave ahead of the other GPUs for\n the same block id.\n\n Internally, this operation uses TTXLA_Atomic(Write|SpinWait)Op on signal\n buffers to synchronize all participating GPUs.", "operands": [ { "name": "signal_buffers", "type": "TT_PtrOf<[TT_PtrOf<[I32]>]>" }, { "name": "device_rank", "type": "I32" }, { "name": "signal_value", "type": "I32" } ], "attributes": [ { "name": "world_size", "type": "I32Attr" } ], "assemblyFormat": "$signal_buffers `,` $device_rank `,` $signal_value `,` attr-dict `:`\n functional-type(operands, results)" }, { "name": "triton_xla.extract", "summary": "Extract a tile from a pointer.", "description": "Offsets, strides, and sizes operands specify the result tensor tile\n to extract. Shape and minor-to-major layout specify the layout of the source\n pointer.\n\n Assembly format:\n from %src as memref<...> [%offsets] [%sizes] [%strides] : tensor_type\n\n Example:\n ```\n %extracted_tensor = triton_xla.extract from %src\n as memref<512x128xbf16, #xtile.layout<[1, 0]>>\n [0, 0] [16, 64] [128, 1] : tensor<16x64xbf16>\n ```", "operands": [ { "name": "src", "type": "TT_Ptr" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" }, { "name": "src_shape", "type": "DenseI64ArrayAttr" }, { "name": "src_layout", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`from` $src `as` custom(type($src), $src_shape, $src_layout)\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($result)" }, { "name": "triton_xla.get_peer_ptr", "summary": "Extract the pointer to the given symmetric memory `address` on the given\n `peer` device. An `address` should point to the memory of the given kernel\n argument with `argument_index`. The result is calculated using the symmetric\n memory `metadata` constructed at the runtime.\n To calculate offsets operation also need to know the number of devices\n participating in the collective operation (`world_size`).", "operands": [ { "name": "address", "type": "TT_PtrLike" }, { "name": "peer_id", "type": "I64" }, { "name": "metadata", "type": "TT_PtrLike" } ], "results": [ { "name": "result", "type": "TT_PtrLike" } ], "attributes": [ { "name": "argument_index", "type": "I32Attr" }, { "name": "world_size", "type": "I32Attr" } ], "assemblyFormat": "$address `,` $peer_id `,` $metadata `,` attr-dict `:`\n functional-type(operands, results)" }, { "name": "triton_xla.get_rank", "summary": "Extract the device rank from the collectives metadata.", "operands": [ { "name": "metadata", "type": "TT_PtrLike" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$metadata attr-dict `:` type($metadata) `->` type($result)" }, { "name": "triton_xla.get_tid", "summary": "Get the thread ID within a triton kernel.", "description": "This operation returns the thread ID within a kernel.\n Only the X dimension is supported. The result is a 32-bit\n integer which in CUDA terms is threadIdx.x.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict `:` functional-type(operands, $result)" }, { "name": "triton_xla.insert", "summary": "Insert a tile into a pointer.", "description": "Offsets, strides, and source tensor size are used to specify the tile to\n insert. Shape and minor-to-major layout specify the layout of the\n destination pointer.\n\n Assembly format:\n %src into %dst as memref<...> [%offsets] [%sizes] [%strides] : tensor_type\n\n Example:\n ```\n triton_xla.insert %src into %dst\n as memref<512x128xbf16, #xtile.layout<[1, 0]>>\n [0, 0] [8, 8] [1, 1] : tensor<8x8xbf16>\n ```", "operands": [ { "name": "src", "type": "AnyStaticShapeTensor" }, { "name": "dst", "type": "TT_Ptr" }, { "name": "offsets", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "attributes": [ { "name": "static_offsets", "type": "DenseI64ArrayAttr" }, { "name": "static_sizes", "type": "DenseI64ArrayAttr" }, { "name": "static_strides", "type": "DenseI64ArrayAttr" }, { "name": "dst_shape", "type": "DenseI64ArrayAttr" }, { "name": "dst_layout", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$src `into`\n $dst `as` custom(type($dst), $dst_shape, $dst_layout)\n custom($offsets, $static_offsets)\n custom($sizes, $static_sizes)\n custom($strides, $static_strides)\n attr-dict `:` type($src)" }, { "name": "triton_xla.memref_to_ptr", "summary": "A specialized version of unrealized_conversion_cast that converts a\n memref to a pointer.", "operands": [ { "name": "src", "type": "AnyMemRef" } ], "results": [ { "name": "result", "type": "TT_Ptr" } ], "assemblyFormat": "$src `from` type($src) `to` type($result) attr-dict" }, { "name": "triton_xla.ptr_to_memref", "summary": "A specialized version of unrealized_conversion_cast that converts a\n pointer to a memref.", "operands": [ { "name": "src", "type": "TT_Ptr" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "$src `from` type($src) `to` type($result) attr-dict" }, { "name": "triton_xla.squeeze_dims", "summary": "Remove a size-1 dimension from a tensor.", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "trtrt.compiled_func", "summary": "represents a serialized TensorRT plan file", "description": "The `trtrt.compiled_func` op is a global operation that represents\n a compiled TensorRT function (an \"engine\" or \"plan file\")\n Its binary data is contained in `value`, which is the output of the\n TensorRT builder.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "value", "type": "ElementsAttr" } ], "assemblyFormat": "attr-dict $sym_name $value" }, { "name": "trtrt.enqueue", "description": "Asynchronously executes the computation represented by the\n `execution_context` on the specified CUDA stream. This operation\n is a bufferizable destination-passing-style (DPS) operation.\n\n This means that the `inputs` and `outputs` can accept either\n all `tensor` types or all `memref` types. If the types are `tensor`\n types, then the the values passed to the `outs` parameter must\n be equal in type and number to the operation's results.\n\n When the `inputs` and `outputs` are `memref` types, then the\n operation should have no results.\n\n The `host_tensor_args` attribute is a list of indices into the\n `inputs` list indicating which arguments should be host tensors.", "operands": [ { "name": "execution_context", "type": "TensorRTRuntime_Context" }, { "name": "stream", "type": "CUDA_Stream" }, { "name": "inputs", "type": "Variadic" }, { "name": "outs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "host_tensor_args", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$execution_context `stream` `(` $stream `)` ` `\n (`host_tensor_args` $host_tensor_args^ ` ` )?\n `(` $inputs `)` `outs` `(` $outs `)`\n attr-dict `:` functional-type($inputs, $outs)" }, { "name": "trtrt.enqueue_alloc", "description": "Asynchronously executes the computation represented by the\n `execution_context` on the specified CUDA stream. This operation\n can accept inputs of either tensor or memref types and returns\n results of either tensor or memref types.", "operands": [ { "name": "execution_context", "type": "TensorRTRuntime_Context" }, { "name": "stream", "type": "CUDA_Stream" }, { "name": "inputs", "type": "Variadic>" } ], "results": [ { "name": "results", "type": "Variadic>" } ], "attributes": [ { "name": "host_tensor_args", "type": "OptionalAttr" } ], "assemblyFormat": "$execution_context `stream` `(` $stream `)` ` `\n (`host_tensor_args` $host_tensor_args^ ` ` )?\n `(` $inputs `)`\n attr-dict `:` functional-type($inputs, $results)" }, { "name": "trtrt.get_function", "summary": "retrieves a TensorRT function handle from a compiled module", "description": "The `cuda.get_function` operation references a `trtrt.compiled_func`\n and returns an opaque `func.func` (representing an \"execution context\"\n from the TensorRT runtime API).", "results": [ { "name": "result", "type": "TensorRTRuntime_Context" } ], "attributes": [ { "name": "module", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "attr-dict $module `:` type($result)" }, { "name": "ts.as_fixed_rank_shape.0", "summary": "Convert TensorShape to FixedRankShape operation", "description": "An operation that converts a TensorShape to a FixedRankShape", "results": [ { "name": "output", "type": "TS_FixedRankShape<0>" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.as_fixed_rank_shape.1", "summary": "Convert TensorShape to FixedRankShape operation", "description": "An operation that converts a TensorShape to a FixedRankShape", "results": [ { "name": "output", "type": "TS_FixedRankShape<1>" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.as_fixed_rank_shape.2", "summary": "Convert TensorShape to FixedRankShape operation", "description": "An operation that converts a TensorShape to a FixedRankShape", "results": [ { "name": "output", "type": "TS_FixedRankShape<2>" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.as_fixed_rank_shape.3", "summary": "Convert TensorShape to FixedRankShape operation", "description": "An operation that converts a TensorShape to a FixedRankShape", "results": [ { "name": "output", "type": "TS_FixedRankShape<3>" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.build_partial_shape", "summary": "Build partial tensor shape operation", "description": "An operation that builds a partial tensor shape.", "results": [ { "name": "output", "type": "TS_PartialShape" } ], "attributes": [ { "name": "value", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$value attr-dict" }, { "name": "ts.build_shape", "summary": "Build tensor shape operation", "description": "An operation that builds a tensor shape of a given rank and extents.", "results": [ { "name": "output", "type": "TS_Shape" } ], "attributes": [ { "name": "value", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$value attr-dict" }, { "name": "ts.build_unranked_partial_shape", "summary": "Build unranked partial tensor shape operation", "description": "An operation that builds an unranked partial tensor shape.", "results": [ { "name": "output", "type": "TS_PartialShape" } ], "assemblyFormat": "attr-dict" }, { "name": "ts.equal_shape", "summary": "Checks if two tensor shapes are equal", "description": "An operation that checks if two tensor shapes are equal.", "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.get_dimension", "summary": "Returns the dimension size at the given shape index", "description": "An operation that returns the dimension size at the given shape index.", "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.get_num_elements", "summary": "Returns the number of elements in the shape", "description": "An operation that returns the number of elements in the shape.", "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.print_fixed_rank_shape.0", "summary": "Print FixedRankShape operation", "description": "An operation that prints a FixedRankShape.", "operands": [ { "name": "shape", "type": "TS_FixedRankShape<0>" }, { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.print_fixed_rank_shape.1", "summary": "Print FixedRankShape operation", "description": "An operation that prints a FixedRankShape.", "operands": [ { "name": "shape", "type": "TS_FixedRankShape<1>" }, { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.print_fixed_rank_shape.2", "summary": "Print FixedRankShape operation", "description": "An operation that prints a FixedRankShape.", "operands": [ { "name": "shape", "type": "TS_FixedRankShape<2>" }, { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.print_fixed_rank_shape.3", "summary": "Print FixedRankShape operation", "description": "An operation that prints a FixedRankShape.", "operands": [ { "name": "shape", "type": "TS_FixedRankShape<3>" }, { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.print_partial_shape", "summary": "Prints the shape of the given partial tensor shape", "description": "An operation that prints the shape of the given partial tensor shape.", "operands": [ { "name": "shape", "type": "TS_PartialShape" }, { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.print_shape", "summary": "Print tensor shape operation", "description": "An operation that prints a tensor shape.", "operands": [ { "name": "shape", "type": "TS_Shape" }, { "name": "in_ch", "type": "TFRT_ChainType" } ], "results": [ { "name": "out_ch", "type": "TFRT_ChainType" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.to_partial_shape", "summary": "Converts tensor shape to partial tensor shape operation", "description": "An operation that converts a tensor shape to partial tensor shape.", "operands": [ { "name": "shape", "type": "TS_Shape" } ], "results": [ { "name": "output", "type": "TS_PartialShape" } ], "assemblyFormat": "operands attr-dict" }, { "name": "ts.to_shape", "summary": "Converts partial tensor shape to tensor shape operation", "description": "An operation that converts a partial tensor shape to tensor shape.", "operands": [ { "name": "shape", "type": "TS_PartialShape" } ], "results": [ { "name": "output", "type": "TS_Shape" } ], "assemblyFormat": "operands attr-dict" }, { "name": "tt.addptr", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "offset", "type": "TT_IntLike" } ], "results": [ { "name": "result", "type": "TT_PtrLike" } ], "traits": [ { "type": "TypesMatchWith<'result', 'ptr', '$_self'>" } ], "assemblyFormat": "$ptr `,` $offset attr-dict `:` type($result) `,` type($offset)" }, { "name": "tt.advance", "summary": "Advance a tensor pointer by offsets", "operands": [ { "name": "ptr", "type": "TT_TensorPtr" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TT_TensorPtr" } ], "traits": [ { "type": "TypesMatchWith<'result', 'ptr', '$_self'>" } ], "assemblyFormat": "$ptr `,` `[` $offsets `]` attr-dict `:` type($result)" }, { "name": "tt.assert", "summary": "Device-side assert, as in CUDA for correctness checking", "description": "`tt.assert` takes a condition tensor and a message string.\n If the condition is false, the message is printed, and the program is aborted.", "operands": [ { "name": "condition", "type": "AnyTypeOf<[I1, I1Tensor]>" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$condition `,` $message attr-dict `:` type($condition)" }, { "name": "tt.atomic_cas", "summary": "atomic cas", "description": "compare $cmp with data $old at location $ptr,\n\n if $old == $cmp, store $val to $ptr,\n\n else store $old to $ptr,\n\n return $old", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "cmp", "type": "TT_Type" }, { "name": "val", "type": "TT_Type" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "attributes": [ { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'cmp', 'ptr', 'getPointerTypeSameShape($_self)'>" }, { "type": "TypesMatchWith<'val', 'ptr', 'getPointerTypeSameShape($_self)'>" } ], "assemblyFormat": "$sem `,` $scope `,` $ptr `,` $cmp `,` $val attr-dict `:`\n functional-type(operands, $result)" }, { "name": "tt.atomic_poll", "summary": "poll an atomic value", "description": "Repeatedly load from $ptr with relaxed semantics on a single thread\n until the loaded value equals $expected. For acquire semantics, issue\n an acquire fence only after a successful poll. Other threads wait for\n the polling thread to finish.", "operands": [ { "name": "ptr", "type": "TT_Ptr" }, { "name": "expected", "type": "TT_Int" }, { "name": "timeout", "type": "Optional" } ], "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'expected', 'ptr', 'getPointerTypeSameShape($_self)'>" } ], "assemblyFormat": "$sem `,` $scope `,` $ptr `,` $expected (`timeout` $timeout^)?\n attr-dict `:` qualified(type($ptr)) `,` type($expected) `->` type($result)" }, { "name": "tt.atomic_rmw", "summary": "atomic rmw", "description": "load data at $ptr, do $rmw_op with $val, and store result to $ptr.\n\n return old value at $ptr", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "val", "type": "TT_Type" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "attributes": [ { "name": "atomic_rmw_op", "type": "TT_AtomicRMWAttr{and|or|xor|add|fadd|max|min|umax|umin|exch}" }, { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'val', 'ptr', 'getPointerTypeSameShape($_self)'>" }, { "type": "TypesMatchWith<'val', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$atomic_rmw_op `,` $sem `,` $scope `,` $ptr `,` $val (`,` $mask^)? attr-dict `:`\n functional-type(operands, $result)" }, { "name": "tt.bitcast", "summary": "Cast between types of the same bitwidth", "operands": [ { "name": "src", "type": "TT_Type" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.broadcast", "summary": "broadcast a tensor", "description": "For a given tensor, broadcast changes one or more dimensions with size 1\n to a new size, e.g. tensor<1x32x1xf32> -> tensor<2x32x4xf32>. You cannot\n change the size of a non-1 dimension.", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.call", "summary": "call operation", "description": "The `tt.call` operation represents a direct call to a function that is\n within the same symbol scope as the call. The operands and result types of\n the call must match the specified function type. The callee is encoded as a\n symbol reference attribute named \"callee\".\n\n Example:\n\n ```mlir\n %2 = tt.call @my_add(%0, %1) : (f32, f32) -> f32\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "tt.cat", "summary": "concatenate 2 tensors", "operands": [ { "name": "lhs", "type": "TT_Tensor" }, { "name": "rhs", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `->` type($result)" }, { "name": "tt.clampf", "summary": "Clamp operation for floating point types", "description": "Clamp operation for floating point types.\n\n The operation takes three arguments: x, min, and max. It returns a tensor of the same shape as x with its values clamped to the range [min, max].", "operands": [ { "name": "x", "type": "TT_FloatLike" }, { "name": "min", "type": "TT_FloatLike" }, { "name": "max", "type": "TT_FloatLike" } ], "results": [ { "name": "result", "type": "TT_FloatLike" } ], "attributes": [ { "name": "propagateNan", "type": "TT_PropagateNanAttr{none|all}" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$x `,` $min `,` $max `,` `propagateNan` `=` $propagateNan attr-dict `:` type($result)" }, { "name": "tt.descriptor_gather", "summary": "gather multiple rows from a descriptor into a single tensor", "description": "The `tt.descriptor_gather` op will be lowered to NVIDIA TMA\n gather operations on targets that support it.\n\n `desc_ptr` is a pointer to the TMA descriptor allocated in global memory.\n The descriptor block must have 1 row and the indices must be a 1D tensor.\n Accordingly, the result is a 2D tensor multiple rows.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "x_offsets", "type": "RankedTensorOf<[I16, I32]>" }, { "name": "y_offset", "type": "I32" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$desc `[` $x_offsets `,` $y_offset `]`\n attr-dict `:` functional-type(operands, results)" }, { "name": "tt.descriptor_load", "summary": "Load from descriptor", "description": "This operation will be lowered to Nvidia TMA load operation on targets supporting it.\n `desc` is a tensor descriptor object.\n The destination tensor type and shape must match the descriptor otherwise the result is undefined.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$desc `[` $indices `]`\n oilist(\n `cacheModifier` `=` $cache |\n `evictionPolicy` `=` $evict\n )\n attr-dict `:` qualified(type($desc)) `->` type($result)" }, { "name": "tt.descriptor_reduce", "summary": "performs a reducing store operation based on a descriptor", "description": "This operation will be lowered to Nvidia TMA store operation on targets supporting it.\n `desc` is a tensor descriptor object.\n The shape and types of `src` must match the descriptor otherwise the result is undefined.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "src", "type": "TT_Tensor" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "kind", "type": "TT_DescriptorReduceKindAttr{add|min|max|inc|dec|and|or|xor}" } ], "assemblyFormat": "$kind `,` $desc `[` $indices `]` `,` $src\n attr-dict `:` qualified(type($desc)) `,` type($src)" }, { "name": "tt.descriptor_scatter", "summary": "scatter multiple rows to a descriptor from a single tensor", "description": "The `tt.descriptor_scatter` op will be lowered to NVIDIA TMA\n scatter operations on targets that support it.\n\n `desc_ptr` is a pointer to the TMA descriptor allocated in global memory.\n The descriptor block must have 1 row and the indices must be a 1D tensor.\n Accordingly, the result is a 2D tensor multiple rows.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "x_offsets", "type": "RankedTensorOf<[I16, I32]>" }, { "name": "y_offset", "type": "I32" }, { "name": "src", "type": "TT_Tensor" } ], "assemblyFormat": "$desc `[` $x_offsets `,` $y_offset `]` `,` $src\n attr-dict `:` type(operands)" }, { "name": "tt.descriptor_store", "summary": "store value based on descriptor", "description": "This operation will be lowered to Nvidia TMA store operation on targets supporting it.\n `desc` is a tensor descriptor object.\n The shape and types of `src` must match the descriptor otherwise the result is undefined.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "src", "type": "TT_Tensor" }, { "name": "indices", "type": "Variadic" } ], "assemblyFormat": "$desc `[` $indices `]` `,` $src\n attr-dict `:` qualified(type($desc)) `,` type($src)" }, { "name": "tt.dot", "summary": "dot", "description": "$d = matrix_multiply($a, $b) + $c. $inputPrecision describes how to exercise the TC\n when the inputs are f32. It can be one of: tf32, tf32x3, ieee, bf16x3, bf16x6.\n tf32: use TC with tf32 ops.\n tf32x3: implement the 3xTF32 trick. For more info see the pass in F32DotTC.cpp\n bf16x3: implement the 3xBF16 trick. For more info see the pass in F32DotTC.cpp\n bf16x6: implement the 6xBF16 trick. For more info see the pass in F32DotTC.cpp\n ieee: don't use TC, implement dot in software.\n If the GPU does not have Tensor cores or the inputs are not f32, this flag is ignored.", "operands": [ { "name": "a", "type": "TT_FpIntTensor" }, { "name": "b", "type": "TT_FpIntTensor" }, { "name": "c", "type": "TT_FpIntTensor" } ], "results": [ { "name": "d", "type": "TT_FpIntTensor" } ], "attributes": [ { "name": "inputPrecision", "type": "DefaultValuedAttr" }, { "name": "maxNumImpreciseAcc", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'d', 'c', '$_self'>" } ], "assemblyFormat": "$a`,` $b`,` $c (`,` `inputPrecision` `=` $inputPrecision^)? attr-dict `:`\n type($a) `*` type($b) `->` type($d)" }, { "name": "tt.dot_scaled", "summary": "dot_scaled", "description": "$d = matrix_multiply(scale($a, $a_scale), scale($b, $b_scale)) + $c.\n Where scale(x, s) is a function that applies the scale per block following microscaling spec.", "operands": [ { "name": "a", "type": "RankedTensorOf<[TT_Float, I8]>" }, { "name": "b", "type": "RankedTensorOf<[TT_Float, I8]>" }, { "name": "c", "type": "TT_FloatTensor" }, { "name": "a_scale", "type": "Optional>" }, { "name": "b_scale", "type": "Optional>" } ], "results": [ { "name": "d", "type": "TT_FloatTensor" } ], "attributes": [ { "name": "a_elem_type", "type": "TT_ScaleDotElemTypeAttr{e4m3|e5m2|e2m3|e3m2|e2m1|bf16|fp16}" }, { "name": "b_elem_type", "type": "TT_ScaleDotElemTypeAttr{e4m3|e5m2|e2m3|e3m2|e2m1|bf16|fp16}" }, { "name": "fastMath", "type": "BoolAttr" }, { "name": "lhs_k_pack", "type": "DefaultValuedAttr" }, { "name": "rhs_k_pack", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'d', 'c', '$_self'>" } ], "assemblyFormat": "$a (`scale` $a_scale^)? `,` $b (`scale` $b_scale^)? `,` $c\n `lhs` `=` $a_elem_type `rhs` `=` $b_elem_type attr-dict\n `:` type($a) (`,` type($a_scale)^)? `*` type($b) (`,` type($b_scale)^)? `->` type($d)" }, { "name": "tt.elementwise_inline_asm", "summary": "inline assembly applying an elementwise operation to a group of packed elements.", "description": "Runs an inline asm block to generate one or more tensors.\n\n The asm block is given `packed_element` elements at a time. Exactly which\n elems it receives is unspecified.", "operands": [ { "name": "args", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "asm_string", "type": "StrAttr" }, { "name": "constraints", "type": "StrAttr" }, { "name": "pure", "type": "BoolAttr" }, { "name": "packed_element", "type": "I32Attr" } ], "assemblyFormat": "$asm_string attr-dict ($args^ `:` type($args))? `->` type($result)" }, { "name": "tt.expand_dims", "summary": "expand_dims", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.extern_elementwise", "description": "call an external function $symbol implemented in $libpath/$libname with $args\n return $libpath/$libname:$symbol($args...)", "operands": [ { "name": "srcs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "attributes": [ { "name": "libname", "type": "StrAttr" }, { "name": "libpath", "type": "StrAttr" }, { "name": "symbol", "type": "StrAttr" }, { "name": "pure", "type": "BoolAttr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, $result)" }, { "name": "tt.fp_to_fp", "summary": "Floating point casting for custom types", "description": "Floating point casting for custom types (F8), and non-default rounding modes.\n\n F8 <-> FP16, BF16, FP32, FP64", "operands": [ { "name": "src", "type": "TT_FloatLike" } ], "results": [ { "name": "result", "type": "TT_FloatLike" } ], "attributes": [ { "name": "rounding", "type": "OptionalAttr" } ], "assemblyFormat": "$src attr-dict (`,` `rounding` `=` $rounding^)? `:` type($src) `->` type($result)" }, { "name": "tt.func", "summary": "An operation with a name containing a single `SSACFG` region", "description": "Operations within the function cannot implicitly capture values defined\n outside of the function, i.e. Functions are `IsolatedFromAbove`. All\n external references must use function arguments or attributes that establish\n a symbolic connection (e.g. symbols referenced by name via a string\n attribute like SymbolRefAttr). An external function declaration (used when\n referring to a function declared in some other module) has no body. While\n the MLIR textual form provides a nice inline syntax for function arguments,\n they are internally represented as “block arguments” to the first block in\n the region.\n\n Only dialect attribute names may be specified in the attribute dictionaries\n for function arguments, results, or the function itself.\n\n Example:\n\n ```mlir\n // External function definitions.\n tt.func @abort()\n tt.func @scribble(i32, i64, memref) -> f64\n\n // A function that returns its argument twice:\n tt.func @count(%x: i64) -> (i64, i64)\n attributes {fruit: \"banana\"} {\n return %x, %x: i64, i64\n }\n\n // A function with an argument attribute\n tt.func @example_fn_arg(%x: i32 {swift.self = unit})\n\n // A function with a result attribute\n tt.func @example_fn_result() -> (f64 {dialectName.attrName = 0 : i64})\n\n // A function with an attribute\n tt.func @example_fn_attr() attributes {dialectName.attrName = false}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "tt.gather", "summary": "local gather operation", "description": "Gather elements from the input tensor using the indices tensor along a\n single specified axis. The output tensor has the same shape as the indices\n tensor. The input and indices tensors must have the same number of\n dimension, and each dimension of the indices tensor that is not the gather\n dimension cannot be greater than the corresponding dimension in the input\n tensor.\n\n The `efficient_layout` attribute is set when the compiler has determined an\n optimized layout for the operation, indicating that it should not be\n changed.", "operands": [ { "name": "src", "type": "TT_Tensor" }, { "name": "indices", "type": "TT_IntTensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "efficient_layout", "type": "UnitAttr" } ], "assemblyFormat": "$src `[` $indices `]` attr-dict `:`\n functional-type(operands, results)" }, { "name": "tt.get_num_programs", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "axis", "type": "TT_ProgramDim{x|y|z}" } ], "assemblyFormat": "$axis attr-dict `:` type($result)" }, { "name": "tt.get_program_id", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "axis", "type": "TT_ProgramDim{x|y|z}" } ], "assemblyFormat": "$axis attr-dict `:` type($result)" }, { "name": "tt.histogram", "summary": "return a histogram of the inputs.", "description": "Return the histogram of the input tensor. The number of bins is equal to\n the dimension of the output tensor. Each bins has a width of 1 and bins\n start at 0.", "operands": [ { "name": "src", "type": "TT_IntTensor" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_IntTensor" } ], "traits": [ { "type": "TypesMatchWith<'src', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$src (`,` $mask^)? attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.int_to_ptr", "summary": "Cast int64 to pointer", "operands": [ { "name": "src", "type": "TT_I64Like" } ], "results": [ { "name": "result", "type": "TT_PtrLike" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.join", "summary": "join two tensors along a new, minor dimension", "description": "For example, if the two input tensors are 4x8xf32, returns a tensor of\n shape 4x8x2xf32.\n\n Because Triton tensors always have a power-of-two number of elements,\n the two input tensors must have the same shape.", "operands": [ { "name": "lhs", "type": "TT_Tensor" }, { "name": "rhs", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `->` type($result)" }, { "name": "tt.load", "summary": "Load from a pointer or tensor of pointers", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "mask", "type": "Optional" }, { "name": "other", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" }, { "name": "isVolatile", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'ptr', 'result', 'getPointeeType($_self)'>" }, { "type": "TypesMatchWith<'ptr', 'mask', 'getI1SameShape(getPointeeType($_self))'>" }, { "type": "TypesMatchWith<'ptr', 'other', 'getPointeeType($_self)'>" } ], "assemblyFormat": "$ptr (`,` $mask^)? (`,` $other^)?\n oilist(\n `cacheModifier` `=` $cache |\n `evictionPolicy` `=` $evict\n )\n attr-dict `:` type($ptr)" }, { "name": "tt.make_range", "summary": "make range", "description": "Returns an 1D int32 tensor.\n\n Values span from $start to $end (exclusive), with step = 1", "results": [ { "name": "result", "type": "TT_IntTensor" } ], "attributes": [ { "name": "start", "type": "I32Attr" }, { "name": "end", "type": "I32Attr" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "tt.make_tensor_descriptor", "summary": "Make a tensor descriptor type with meta information of the parent tensor and block size", "description": "`tt.make_tensor_descriptor` takes both meta information of the parent tensor and the block size,\n and returns a descriptor object which can be used to load/store from the tensor in global memory.", "operands": [ { "name": "base", "type": "TT_Ptr" }, { "name": "shape", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TT_TensorDescType" } ], "attributes": [ { "name": "padding", "type": "DefaultValuedAttr" } ], "assemblyFormat": "$base `,` `[` $shape `]` `,` `[` $strides `]` attr-dict `:` type($base) `,` type($result)" }, { "name": "tt.make_tensor_ptr", "summary": "Make a tensor pointer type with meta information of the parent tensor and the block specified", "description": "`tt.make_tensor_ptr` takes both meta information of the parent tensor and the block tensor, then it returns a\n pointer to the block tensor, e.g. returns a type of `tt.ptr>`.", "operands": [ { "name": "base", "type": "TT_Ptr" }, { "name": "shape", "type": "Variadic" }, { "name": "strides", "type": "Variadic" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TT_TensorPtr" } ], "attributes": [ { "name": "order", "type": "DenseI32ArrayAttr" } ], "traits": [ { "type": "TypesMatchWith<'result', 'base', 'getPointerType(getElementTypeOfTensorPointerType($_self), getAddressSpace($_self))'>" } ], "assemblyFormat": "$base `,` `[` $shape `]` `,` `[` $strides `]` `,` `[` $offsets `]` attr-dict `:` type($result)" }, { "name": "tt.map_elementwise", "summary": "Map a scalar subregion over a tensor", "operands": [ { "name": "srcs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "pack", "type": "I32Attr" } ], "regions": [ { "name": "scalarOp", "type": "AnyRegion" } ] }, { "name": "tt.map_elementwise.return", "summary": "terminator for map elementwise operator", "operands": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($result^ `:` type($result))?" }, { "name": "tt.mulhiui", "summary": "Most significant N bits of the 2N-bit product of two integers", "description": "Most significant N bits of the 2N-bit product of two integers.", "operands": [ { "name": "x", "type": "TT_IntLike" }, { "name": "y", "type": "TT_IntLike" } ], "results": [ { "name": "result", "type": "TT_IntLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$x `,` $y attr-dict `:` type($x)" }, { "name": "tt.precise_divf", "summary": "Precise div for floating point types", "description": "Precise div for floating point types.", "operands": [ { "name": "x", "type": "TT_FloatLike" }, { "name": "y", "type": "TT_FloatLike" } ], "results": [ { "name": "result", "type": "TT_FloatLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$x `,` $y attr-dict `:` type($x)" }, { "name": "tt.precise_sqrt", "summary": "Precise sqrt for floating point types", "description": "Precise sqrt for floating point types.", "operands": [ { "name": "x", "type": "TT_FloatLike" } ], "results": [ { "name": "result", "type": "TT_FloatLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$x attr-dict `:` type($x)" }, { "name": "tt.print", "summary": "Device-side print, as in CUDA for debugging", "description": "`tt.print` takes a literal string prefix and an arbitrary number of scalar or tensor arguments that should be printed.\n format are generated automatically from the arguments.", "operands": [ { "name": "args", "type": "Variadic>" } ], "attributes": [ { "name": "prefix", "type": "StrAttr" }, { "name": "hex", "type": "BoolAttr" }, { "name": "isSigned", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "$prefix attr-dict (`:` $args^ `:` type($args))?" }, { "name": "tt.ptr_to_int", "summary": "Cast pointer to int64", "operands": [ { "name": "src", "type": "TT_PtrLike" } ], "results": [ { "name": "result", "type": "TT_I64Like" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.reduce", "summary": "Reduction using generic combination algorithm", "operands": [ { "name": "srcs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "regions": [ { "name": "combineOp", "type": "SizedRegion<1>" } ] }, { "name": "tt.reduce.return", "summary": "terminator for reduce operator", "operands": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "tt.reshape", "summary": "reinterpret a tensor to a different shape. It may change elements order if the attribute is set.", "description": "reinterpret a tensor to a different shape.\n\n If allow_reorder is set the compiler is free to change the order of\n elements to generate more efficient code.\n\n If efficient_layout is set, this is a hint that the destination layout should be kept for performance reason.\n The compiler is still free to change it for better performance.", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "allow_reorder", "type": "UnitAttr" }, { "name": "efficient_layout", "type": "UnitAttr" } ], "assemblyFormat": "$src (`allow_reorder` $allow_reorder^)? (`efficient_layout` $efficient_layout^)? attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.return", "summary": "Function return operation", "description": "The `tt.return` operation represents a return operation within a function.\n The operation takes variable number of operands and produces no results.\n The operand number and types must match the signature of the function\n that contains the operation.\n\n Example:\n\n ```mlir\n tt.func @foo() : (i32, f8) {\n ...\n tt.return %0, %1 : i32, f8\n }\n ```", "operands": [ { "name": "srcs", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($srcs^ `:` type($srcs))?" }, { "name": "tt.scan", "summary": "Associative scan using generic combination algorithm", "operands": [ { "name": "srcs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "axis", "type": "I32Attr" }, { "name": "reverse", "type": "BoolAttr" } ], "regions": [ { "name": "combineOp", "type": "SizedRegion<1>" } ] }, { "name": "tt.scan.return", "summary": "terminator for scan operator", "operands": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "tt.splat", "summary": "splat", "operands": [ { "name": "src", "type": "TT_Type" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.split", "summary": "splits a tensor into two, along its last dimension", "description": "The input must be a tensor whose last dimension has size 2. Returns two\n tensors, src[..., 0] and src[..., 1].\n\n For example, if the input shape is 4x8x2xf32, returns two tensors of\n shape 4x8xf32.", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "outLHS", "type": "TT_Tensor" }, { "name": "outRHS", "type": "TT_Tensor" } ], "traits": [ { "type": "TypesMatchWith<'outLHS', 'outRHS', '$_self'>" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($outLHS)" }, { "name": "tt.store", "summary": "Store through a pointer or tensor of pointers", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "value", "type": "TT_Type" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" }, { "name": "ignore_cta", "type": "UnitAttr" } ], "traits": [ { "type": "TypesMatchWith<'ptr', 'value', 'getPointeeType($_self)'>" }, { "type": "TypesMatchWith<'ptr', 'mask', 'getI1SameShape(getPointeeType($_self))'>" } ], "assemblyFormat": "$ptr `,` $value (`,` $mask^)?\n oilist(`cacheModifier` `=` $cache | `evictionPolicy` `=` $evict)\n attr-dict `:` type($ptr)" }, { "name": "tt.trans", "summary": "rearrange the dimensions of a tensor", "description": "For example, given a tensor x with shape [1,2,4], transpose(x) with\n order=[2,0,1] rearranges the tensor to have shape [4,1,2].\n\n Although this op is called \"trans\", it implements both tl.trans() and\n tl.permute(). (\"permute\" might be a better name, but it's called \"trans\"\n because originally it only supported 2D tensors.)\n\n ## Implementation note on encodings:\n\n In the TritonGPU dialect (and probably others), an encoding is chosen for\n this op's output so it's a nop from the perspective of code generation.\n\n For example, suppose tensor x has an encoding such that GPU thread [i,j,k]\n has a register containing element [i,j,k] of the tensor. Now we transpose\n x with order [2,1,0], i.e. we reverse the order of its dimensions. In\n TritonGPU, we will choose a layout for the output of the transpose so that\n GPU thread [i,j,k] has element [k,j,i] of transpose(x). But this is the\n same element it had before! All we've done is \"rename\" the element that\n thread [i,j,k] has.\n\n The \"real\" transpose -- i.e. moving data between GPU threads -- occurs in\n convertLayout ops that appear before and/or after the operation.\n\n We do this so that you can chain multiple data-movement ops (e.g.\n transpose+reshape+concat) without going to shared memory after each one.", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "order", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "tt.unsplat", "summary": "convert a tensor with a single element to a scalar", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "assemblyFormat": "$src attr-dict `:` type($src)" }, { "name": "ttcore.composite", "summary": "A named composite operation with an inlineable decomposition.", "description": "A composite operation that carries a named fused pattern along with a\n reference to a decomposition function. During lowering, the composite is\n either promoted to a typed backend op (if validation succeeds) or its\n decomposition body is inlined as a fallback.\n\n Example:\n ```mlir\n %indices, %weights = ttcore.composite \"topk_router_gpt\"\n (%input, %weight, %bias)\n decomposition(@topk_router_gpt_decomp)\n composite_attributes = {k = 4 : i32, num_experts = 128 : i32}\n : (tensor<32x64xbf16>, tensor<64x128xbf16>, tensor<32x128xbf16>)\n -> (tensor<32x4xui16>, tensor<32x4xbf16>)\n\n func.func private @topk_router_gpt_decomp(\n %arg0: tensor<32x64xbf16>,\n %arg1: tensor<64x128xbf16>,\n %arg2: tensor<32x128xbf16>)\n -> (tensor<32x4xui16>, tensor<32x4xbf16>) {\n // ... sequence of primitive ops ...\n }\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "composite_name", "type": "StrAttr" }, { "name": "decomposition", "type": "FlatSymbolRefAttr" }, { "name": "composite_attributes", "type": "OptionalAttr" } ] }, { "name": "ttcore.cpu_module", "summary": "Module-wrapper operation for CPU ops", "description": "Custom module operation that can a single ModuleOp, which should contain all funcs which should be run on CPU.\n\n Example:\n ```mlir\n ttcore.cpu_module {\n module {\n func.func foo() { ... }\n }\n }\n ```", "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict-with-keyword regions" }, { "name": "ttcore.device", "summary": "Named device", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "device_attr", "type": "TTCore_DeviceAttr" } ], "assemblyFormat": "$sym_name `=` $device_attr attr-dict" }, { "name": "ttcore.device_module", "summary": "Module-wrapper operation for device ops", "description": "Custom module operation that can a single ModuleOp, which should contain all funcs which should be run on device.\n\n Example:\n ```mlir\n ttcore.device_module {\n module {\n func.func foo() { ... }\n }\n }\n ```", "regions": [ { "name": "bodyRegion", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "attr-dict-with-keyword $bodyRegion" }, { "name": "ttcore.get_global", "summary": "Named global", "description": "Retrieves a named global value declared with `ttcore.global`", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" } ], "assemblyFormat": "$sym_name attr-dict `:` type($result)" }, { "name": "ttcore.get_key_value", "summary": "Get dictionary value", "description": "Retrieves the value(s) stored under the given key from the dictionary.\n The key can either be a string or an index.\n\n Example:\n ```mlir\n %0 = ttcore.get_key_value %dict[3 : index] : (!ttcore.dict) -> tensor<32x32xbf16>\n %0, %1 = ttcore.get_key_value %dict[\"key\"]\n : (!ttcore.dict) -> (tensor<32x32xbf16>, tensor<64x64xbf16>)\n ```", "operands": [ { "name": "dict", "type": "TTCore_DictType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "AnyAttrOf<[StrAttr, IndexAttr]>" } ], "assemblyFormat": "$dict `[` $key `]` attr-dict `:`\n functional-type(operands, results)" }, { "name": "ttcore.get_tuple_element", "summary": "GetTupleElement operation", "description": "Extracts element at `index` position of the `operand` tuple and produces a `result`.\n\n Example:\n ```mlir\n %result = ttcore.get_tuple_element %operand[0] : (tuple, tensor<1x32xf32>>) -> tensor<32x32xbf16>\n ```", "operands": [ { "name": "operand", "type": "TTCore_Tuple" } ], "results": [ { "name": "result", "type": "TTCore_TupleMemberType" } ], "attributes": [ { "name": "index", "type": "ConfinedAttr" } ], "assemblyFormat": "$operand `[` $index `]` attr-dict `:` functional-type(operands, results)" }, { "name": "ttcore.global", "summary": "Named global", "description": "Declares a global variable with an optional index.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "index", "type": "OptionalAttr" } ], "assemblyFormat": "$sym_name `=` $type (` ` `[` $index^ `]`)? attr-dict" }, { "name": "ttcore.load_cached", "summary": "Load cached results from a previously computed function", "description": "The load_cached operation calls a precomputed function with given arguments\n and returns its results. This is typically used to load constant or hoisted\n computation results.\n\n Example:\n ```mlir\n %0, %1, %2 = \"ttcore.load_cached\"(@forward_const_eval_1, [%arg0, %arg2])\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "`(` $callee `,` `[` $inputs `]` `)` attr-dict `:` functional-type($inputs, $results)" }, { "name": "ttcore.optimization_barrier", "summary": "Optimization barrier operation.", "description": "The `optimization_barrier` operation prevents compiler optimizations from reordering or eliminating\n the values passed through it. It acts as a barrier for optimization passes.\n\n Inputs:\n - `inputs` (Variadic): Values of tensor type.\n\n Outputs:\n - `results` (Variadic): Same values as inputs, passed through unchanged.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ] }, { "name": "ttcore.set_key_value", "summary": "Set or update dictionary value", "description": "Sets or updates a value(s) for the given key in the dictionary.\n The key can either be a string or an index.\n\n Example:\n ```mlir\n ttcore.set_key_value %dict[3 : index] = %0\n : !ttcore.dict, tensor<32x32xbf16>\n ttcore.set_key_value %dict[\"key\"] = %0, %1\n : !ttcore.dict, tensor<32x32xbf16>, tensor<64x64xbf16>\n ```", "operands": [ { "name": "dict", "type": "TTCore_DictType" }, { "name": "values", "type": "Variadic" } ], "attributes": [ { "name": "key", "type": "AnyAttrOf<[StrAttr, IndexAttr]>" } ], "assemblyFormat": "$dict `[` $key `]` `=` $values attr-dict `:`\n type($dict) `,` type($values)" }, { "name": "ttcore.tuple", "summary": "Tuple operation", "description": "Produces a `result` tuple from operands `operands`.\n\n Example:\n ```mlir\n %result = ttcore.tuple %operand0, %operand1 : tuple>\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TTCore_Tuple" } ], "assemblyFormat": "$operands attr-dict `:` custom(type($operands), type($result))" }, { "name": "ttg.async_commit_group", "summary": "Commit pending async copies into an async group that can be waited on", "description": "Closes the current batch of async_copy_* operations\n and allows for them to be waited on with `ttg.async_wait`.\n This is required in order to ensure async copy operations can be waited on.", "operands": [ { "name": "inputTokens", "type": "Variadic" } ], "results": [ { "name": "asyncToken", "type": "TTG_AsyncToken" } ], "assemblyFormat": "(`tokens` $inputTokens^)? attr-dict" }, { "name": "ttg.async_copy_global_to_local", "summary": "Copy data from global memory to local memory asynchronously", "description": "This operation copies data from global memory to local memory asynchronously.\n This is analogue to `tt.load` except the data are copied to local memory pointed\n to by the memory descriptor instead of a distributed tensor. The rest of the\n operands are the same as `tt.load`.\n Contiguity is the maximum number of elements that can be loaded in a single vector with\n the given layout and mask.\n This allows op to use `async_copy_global_to_local` even if the alignment cannot be proven based on IR.\n\n The data will only be available in local memory after `ttg.async_wait` is issued to wait on the\n completion of `async_copy_global_to_local`. The async copy operations must be committed using\n `ttg.async_commit_group` to close the batch and allow for them to be waited on.", "operands": [ { "name": "src", "type": "TT_PtrTensor" }, { "name": "result", "type": "TTG_MemDescType" }, { "name": "mask", "type": "Optional" }, { "name": "other", "type": "Optional" } ], "results": [ { "name": "token", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" }, { "name": "isVolatile", "type": "DefaultValuedAttr" }, { "name": "contiguity", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" }, { "type": "TypesMatchWith<'src', 'mask', 'getI1SameShape($_self)'>" }, { "type": "TypesMatchWith<'src', 'other', 'getPointeeType($_self)'>" } ], "assemblyFormat": "$src `,` $result (`mask` $mask^)? (`other` $other^)?\n oilist(`cacheModifier` `=` $cache | `evictionPolicy` `=` $evict)\n attr-dict `:` type($src) `->` type($result)" }, { "name": "ttg.async_wait", "summary": "Ensure all specified async_copy_* operations are complete.", "description": "The `async_wait` op waits until at most \"num\" async copy groups are outstanding without synchronising CTA execution.\n It takes zero or more `asyncToken` plus an integer `num` that specifies how many async copy groups can remain\n outstanding after the `async_wait` op is completed. `num = 0` waits until all groups of async copies are complete.\n\n This operation does not provide any synchronization in the CTA, if synchronization is needed use `ttg.local_barrier`\n in addition to this operation.", "operands": [ { "name": "asyncToken", "type": "Variadic" } ], "results": [ { "name": "retToken", "type": "TTG_AsyncToken" } ], "attributes": [ { "name": "num", "type": "I32Attr" } ], "assemblyFormat": "($asyncToken^)? attr-dict" }, { "name": "ttg.barrier", "summary": "Synchronizes execution and reads/writes to the selected address spaces for all threads in the CTA.", "description": "The `barrier` op synchronises the execution and all operations between the selected address spaces for all\n threads in the CTA. It is used to coordinate communication between threads in the CTA.\n\n This operation waits until all threads in the CTA have reached a `barrier` (for synchronization) and operations\n between the selected address spaces made by these threads prior to the op are visible to all threads in the CTA.\n\n Data hazards between threads accessing the same memory can be avoided by synchronising the\n specified scope in-between these accesses with a `barrier`.\n\n A `barrier` operation only provides synchronization and memory guarantees on the selected address spaces in the CTA.\n\n The mandatory `addrspace` attribute is a bitmask describing which address spaces will be visible when the `barrier` completes:\n\n * `none` control-only synchronization (no memory ordering).\n * `local` shared-memory operations are complete and visible CTA-wide.\n * `global_read` global memory reads are complete and visible CTA-wide.\n * `global_write` global memory writes are complete and visible CTA-wide.\n * `tensor_read` tensor memory read operations are complete and visible CTA-wide.\n * `tensor_write` tensor memory write operations are complete and visible CTA-wide.\n * `all` convenience alias for `[\"local\", \"global_read\", \"global_write\", \"tensor_read\", \"tensor_write\"]`.\n\n Multiple address spaces can be combined (e.g. `local|tensor_write`). `none` cannot be combined with other address spaces.\n\n Example:\n\n ```mlir\n ttg.barrier local\n ttg.barrier local|global_read|global_write\n ```", "attributes": [ { "name": "addrSpace", "type": "TTG_AddrSpace{none|local|global_read|global_write|tensor_read|tensor_write|all}" } ], "hasCustomAssemblyFormat": true }, { "name": "ttg.convert_layout", "summary": "convert layout", "operands": [ { "name": "src", "type": "TT_Tensor" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "ttg.fp4_to_fp", "summary": "Upcast fp4 (e2m1) to fp", "description": "Upcast fp4 (e2m1) represented packed as i8s to fp.\n\n The lower 4 bits of the i8s represent the first fp4 element, and the upper 4 bits\n the second fp4 element.\n\n The `axis` attribute specifies the axis along which the fp4 elements are packed.", "operands": [ { "name": "src", "type": "RankedTensorOf<[I8]>" } ], "results": [ { "name": "result", "type": "TT_FloatTensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$src attr-dict `:` type($src) `->` type($result)" }, { "name": "ttg.global_scratch_alloc", "summary": "allocate a global memory buffer", "description": "This operation allocates a buffer in global memory that is private to the current program.\n A custom third-party allocation can be marked using the optional\n `third_party_allocation` unit attribute.\n Concurrency sanitizer allocations that hold cluster-wide state can be marked\n using the optional `shared_cluster_state` unit attribute.", "results": [ { "name": "result", "type": "TT_Ptr" } ], "attributes": [ { "name": "nbytes", "type": "I32Attr" }, { "name": "alignment", "type": "I32Attr" }, { "name": "third_party_allocation", "type": "OptionalAttr" }, { "name": "shared_cluster_state", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict `:` qualified(type($result))" }, { "name": "ttg.local_alloc", "summary": "allocate tensor", "description": "This operation allocates buffer in shared memory and return a descriptor\n containing the address and a view of the buffer.\n\n Explicitly deallocating a buffer is optional; see local_dealloc.\n\n The `src` operand is an optional initializer for the allocated buffer. It\n must have the element type as the buffer. If `src` is not specified, the\n returned buffer must be mutable.", "operands": [ { "name": "src", "type": "Optional" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" } ], "assemblyFormat": "($src^)? attr-dict `:` functional-type(operands, results)" }, { "name": "ttg.local_atomic_scatter_add", "summary": "Atomically scatter-add elements into shared memory along a specified axis", "description": "Atomically scatter-adds elements to a shared memory descriptor using an indices tensor\n along a single specified axis. The values tensor has the same shape as the\n indices tensor and the result returns the previous values observed at each\n updated location.\n\n For each input position I, the operation atomically updates dst where the\n coordinate at the axis is replaced by indices[I]:\n dst[I[0], ..., indices[I], ..., I[n]] += values[I]\n\n If mask is present, the update is performed only for positions where\n mask[I] is true. Masked-off positions do not update shared memory and return\n an undefined old value.", "operands": [ { "name": "dst", "type": "TTG_MemDescType" }, { "name": "values", "type": "TT_Tensor" }, { "name": "indices", "type": "TT_IntTensor" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "traits": [ { "type": "TypesMatchWith<'values', 'result', '$_self'>" }, { "type": "TypesMatchWith<'values', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$dst `[` $indices `]` `,` $values (`,` $mask^)? attr-dict `:`\n functional-type(operands, results)" }, { "name": "ttg.local_atomic_scatter_rmw", "summary": "Atomically scatter RMW elements into shared memory along a specified axis", "description": "Atomically updates elements in a shared memory descriptor using an indices tensor\n along a single specified axis. The values tensor has the same shape as the\n indices tensor and the result returns the previous values observed at each\n updated location.\n\n For each input position I, the operation atomically updates dst where the\n coordinate at the axis is replaced by indices[I]:\n dst[I[0], ..., indices[I], ..., I[n]] =\n rmw(dst[I[0], ..., indices[I], ..., I[n]], values[I])\n\n If mask is present, the update is performed only for positions where\n mask[I] is true. Masked-off positions do not update shared memory and return\n an undefined old value.", "operands": [ { "name": "dst", "type": "TTG_MemDescType" }, { "name": "values", "type": "TT_Tensor" }, { "name": "indices", "type": "TT_IntTensor" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "atomic_rmw_op", "type": "TT_AtomicRMWAttr{and|or|xor|add|fadd|max|min|umax|umin|exch}" }, { "name": "axis", "type": "I32Attr" } ], "traits": [ { "type": "TypesMatchWith<'values', 'result', '$_self'>" }, { "type": "TypesMatchWith<'values', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$atomic_rmw_op `,` $dst `[` $indices `]` `,` $values (`,` $mask^)? attr-dict `:`\n functional-type(operands, results)" }, { "name": "ttg.local_barrier", "summary": "Synchronizes execution and shared memory reads/writes for all threads in a CTA.", "description": "The `local_barrier` op synchronizes the execution and all operations\n between shared memory and registers for all threads in a CTA.\n It is used to coordinate communication between the threads of the CTA.\n\n This operation waits until all threads in the CTA have reached a `local_barrier`\n and operations between shared memory and registers made by these threads prior\n to the op are visible to all threads in the CTA.\n\n Data hazards between threads accessing the same memory can be avoided by synchronizing the\n CTA in-between these accesses with a `local_barrier`.\n\n A `local_barrier` operation does not provide syncronization guarantees on global memory.", "assemblyFormat": "attr-dict" }, { "name": "ttg.local_dealloc", "summary": "dealloc buffer", "description": "This operation deallocates a buffer explicitly. Using the buffer after this\n operation is undefined.\n\n This operation is optional. If you don't explicitly dealloc a buffer, the\n compiler assumes it's deallocated at the first point that post-dominates all\n uses of the alloc.\n\n Because we assume a memdesc is dead at the first point that post-dominates\n its uses, ops that wait for an async operation on a memdesc to complete\n (such as ttng.warp_group_dot_wait) should also take the memdesc as an\n operand.", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src attr-dict `:` qualified(type($src))" }, { "name": "ttg.local_gather", "summary": "Gather elements from shared memory along a specified axis", "description": "Gather elements from a shared memory descriptor using an indices tensor along a\n single specified axis. The output tensor has the same shape as the indices tensor.\n\n For each output position I, the operation reads from src where the coordinate at\n the gather axis is replaced by indices[I]:\n result[I] = src[I[0], ..., indices[I], ..., I[n]]\n where the axis dimension is replaced by the index value.\n\n This matches the behavior of tt.gather but operates on shared memory descriptors.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "indices", "type": "TT_IntTensor" }, { "name": "token", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$src `[` $indices `]` (`token` $token^)? attr-dict `:` qualified(type($src)) `,` type($indices) `->` type($result)" }, { "name": "ttg.local_load", "summary": "Load a buffer from local memory into a distributed tensor", "description": "Load a tensor from the local memory descriptor into a distributed tensor.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "token", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "assemblyFormat": "$src (`token` $token^)? attr-dict `:` qualified(type($src)) `->` type($result)" }, { "name": "ttg.local_scatter", "summary": "Scatter elements to shared memory along a specified axis", "description": "Scatter elements to a shared memory descriptor using an indices tensor along a\n single specified axis. The values tensor has the same shape as the indices tensor.\n\n For each input position I, the operation writes to dst where the coordinate at\n the scatter axis is replaced by indices[I]:\n dst[I[0], ..., indices[I], ..., I[n]] = values[I]\n where the axis dimension is replaced by the index value.\n\n This is the inverse of local_gather and writes to shared memory at runtime-computed indices.", "operands": [ { "name": "dst", "type": "TTG_MemDescType" }, { "name": "values", "type": "TT_Tensor" }, { "name": "indices", "type": "TT_IntTensor" }, { "name": "token", "type": "Optional" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$dst `[` $indices `]` `,` $values (`token` $token^)? attr-dict `:` qualified(type($dst)) `,` type($indices) `,` type($values)" }, { "name": "ttg.local_store", "summary": "Store a distributed tensor into a buffer in local memory", "description": "Store a distributed tensor into a buffer in local memory.", "operands": [ { "name": "src", "type": "TT_Tensor" }, { "name": "dst", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src `,` $dst attr-dict `:` type($src) `->` qualified(type($dst))" }, { "name": "ttg.mask", "summary": "mask op for pipelining", "operands": [ { "name": "pred", "type": "I1" } ], "results": [ { "name": "result", "type": "Variadic" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ] }, { "name": "ttg.mask.return", "summary": "terminator for mask operator", "operands": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "ttg.memdesc_index", "summary": "take a subview of the descriptor.", "description": "This operation returns a new descriptor pointing to the `i`-th element of the\n input descriptor along the 0-th dimension.\n\n It doesn't affect the underlying memory.\n\n For example, suppose that\n - the input shape is 2x4x16xf16,\n - the output shape is 4x16xf16, and\n - index = 1.\n Then the output descriptor is equivalent to input[1], where input is the logical tensor.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "index", "type": "I32" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src `[` $index `]` attr-dict `:` qualified(type($src)) `->` qualified(type($result))" }, { "name": "ttg.memdesc_reinterpret", "summary": "reinterpret a memory descriptor as a different type and shape", "description": "The `ttg.memdesc_reinterpret` operation reinterprets a memory descriptor\n as one with a different shape and element type. Because memory descriptors\n lack strides, this operation is only valid if the original memory descriptor\n is contiguous. Reinterpretation of subviews is not allowed; reinterpret the\n parent descriptor and then take a subview of the reinterpreted descriptor\n instead.", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src attr-dict `:` qualified(type($src)) `->` qualified(type($result))" }, { "name": "ttg.memdesc_reshape", "summary": "creates a descriptor for the new shape", "description": "This operation returns a new descriptor representing a reshaped view of the underlying buffer.\n This doesn't affect the memory.", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src attr-dict `:` qualified(type($src)) `->` qualified(type($result))" }, { "name": "ttg.memdesc_subslice", "summary": "take a subview of the descriptor.", "description": "This operation returns a new descriptor representing a subview of the logical tensor.\n It doesn't affect the underlying memory.\n\n For example, suppose that\n - the input shape is 32x16xf16,\n - the output shape is 8x16xf16, and\n - offsets = [2, 1].\n Then in Python syntax, the subview covers input[2:8+2, 1:16+1] where input is\n the logical tensor.\n\n The offsets must be larger or equal to the tile of the tensor (or zero).", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "offsets", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "$src `[` custom($offsets) `]` attr-dict `:` qualified(type($src))\n `->` qualified(type($result))" }, { "name": "ttg.memdesc_trans", "summary": "transpose the descriptor", "description": "This operation returns a new descriptor\n representing a transposed view of the buffer.", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "order", "type": "DenseI32ArrayAttr" } ], "assemblyFormat": "$src attr-dict `:` qualified(type($src)) `->` qualified(type($result))" }, { "name": "ttg.predicate_stage", "summary": "pipeliner stage predicate", "operands": [ { "name": "iv", "type": "AnySignlessIntegerOrIndex" }, { "name": "ub", "type": "AnySignlessIntegerOrIndex" }, { "name": "step", "type": "AnySignlessIntegerOrIndex" } ], "results": [ { "name": "result", "type": "I1" } ], "attributes": [ { "name": "maxStage", "type": "I32Attr" }, { "name": "stage", "type": "I32Attr" } ], "traits": [ { "type": "AllTypesMatch<['iv', 'ub', 'step']>" } ], "assemblyFormat": "$iv `,` $ub `,` $step `maxStage` $maxStage `stage` $stage attr-dict `:` type($iv) `->` type($result)" }, { "name": "ttg.warp_id", "summary": "Return the GPU warp ID", "description": "This operation returns the GPU warp ID. This can translate to reading\n hardware registers if there are, or just thread ID divided by warp size.\n\n The `omitUniformHint` attribute is indicating in NVIDIA backend whether to\n omit emitting nvvm.shfl.sync idx 0 for LLVM.", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "omitUniformHint", "type": "UnitAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "ttg.warp_return", "summary": "implicit terminator from partition regions", "description": "The `ttg.warp_return` operation is the implicit terminator that ends the\n partition regions of a `ttg.warp_specialize` op. It has no operands as these\n regions cannot return anything.\n\n TODO: Support returning uniform values from partition regions.", "assemblyFormat": "attr-dict" }, { "name": "ttg.warp_specialize", "summary": "asynchronously execute code on multiple warpgroups", "description": "The `ttg.warp_specialize` op represents executing different code\n simultaneously on different warp groups. A warp group is a group of\n power-of-2 warps, which can be a different number of warps than in the\n enclosing region.\n\n The \"default\" region of the op represents the code executed by the currently\n executing warp group. This region is allowed to implicitly capture. The op\n contains a number of \"partition\" regions that are isolated from above. They\n must be isolated because these regions represent different layout domains,\n as the number of warps is different.\n\n Semantically, execution of each region starts simultaneously for each warp\n group, and all warp groups are joined at the end of the op.\n\n Example:\n\n ```mlir\n %0 = ttg.warp_specialize(%a, %b)\n default {\n %out = some_operation(%a) // implicit capture of `%a`\n ttg.warp_yield %out : i32\n }\n partition0(%arg0: i32, %arg1: i32) num_warps(8) {\n some_async_dispatch(%arg0, %arg1)\n ttg.warp_return\n }\n partition1(%arg0: i32, %arg1: i32) num_warps(1) {\n some_async_dispatch(%arg0, %arg1)\n ttg.warp_return\n } : (i32, i32) -> i32\n ```", "results": [ { "name": "defaultPassthrough", "type": "Variadic" } ], "attributes": [ { "name": "partitionNumWarps", "type": "DenseI32ArrayAttr" }, { "name": "warpGroupStartIds", "type": "OptionalAttr" }, { "name": "requestedRegisters", "type": "OptionalAttr" }, { "name": "actualRegisters", "type": "OptionalAttr" } ], "regions": [ { "name": "defaultRegion", "type": "MinSizedRegion<1>" }, { "name": "partitionOpHolder", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "ttg.warp_specialize.partitions", "summary": "container op for `ttg.warp_specialize`", "description": "Because MLIR requires entire operations be isolated from above, this op\n contains the actual isolated from above regions of `ttg.warp_specialize`.", "operands": [ { "name": "explicitCaptures", "type": "Variadic" } ], "regions": [ { "name": "partitionRegions", "type": "VariadicRegion>" } ], "traits": [ { "type": "IsolatedFromAbove" } ] }, { "name": "ttg.warp_yield", "summary": "yield from the default region of `ttg.warp_specialize`", "description": "The `ttg.warp_yield` operation is the terminator for the \"default\" region of\n a `ttg.warp_specialize` operation. The operands are passed transparently as\n the SSA results of the `ttg.warp_specialize` operation.\n\n Example:\n\n ```mlir\n ttg.warp_yield %a, %b : i32, tensor<32xbf16, #blocked>\n ```", "operands": [ { "name": "values", "type": "Variadic" } ], "assemblyFormat": "($values^)? attr-dict (`:` type($values)^)?" }, { "name": "tti.dot_i8", "summary": "non-saturating NVIDIA MMAv2 i8 dot", "description": "Performs a wrapping i8 matrix multiplication into an i32 accumulator using\n NVIDIA MMAv2. The A and B operands have independent signedness.", "operands": [ { "name": "a", "type": "RankedTensorOf<[I8]>" }, { "name": "b", "type": "RankedTensorOf<[I8]>" }, { "name": "c", "type": "RankedTensorOf<[I32]>" } ], "results": [ { "name": "d", "type": "RankedTensorOf<[I32]>" } ], "attributes": [ { "name": "aSigned", "type": "BoolAttr" }, { "name": "bSigned", "type": "BoolAttr" } ], "traits": [ { "type": "TypesMatchWith<'d', 'c', '$_self'>" } ], "assemblyFormat": "$a `,` $b `,` $c `,` `aSigned` `=` $aSigned `,` `bSigned` `=` $bSigned\n attr-dict `:` type($a) `*` type($b) `->` type($d)" }, { "name": "tti.experimental_assert_in_thread", "summary": "assert the condition within the current thread", "description": "Assert that the condition is true given all the values are available in the current thread.\n If the condition is false, the message is printed, and the program is aborted.\n If check_any is true, any of the values in the condition must be true. Otherwise, all the\n values in the condition must be true.", "operands": [ { "name": "condition", "type": "AnyTypeOf<[I1, I1Tensor]>" } ], "attributes": [ { "name": "message", "type": "StrAttr" }, { "name": "check_any", "type": "BoolAttr" } ], "assemblyFormat": "$condition `,` $message attr-dict `:` type($condition)" }, { "name": "tti.experimental_assert_uniform", "summary": "assert the uniform condition", "description": "Assert that the condition is true given all threads in the warp group have\n the same value, so only one thread needs to evaluate the assert and print\n the message.", "operands": [ { "name": "condition", "type": "I1" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$condition `,` $message attr-dict-with-keyword" }, { "name": "tti.experimental_buffer_descriptors", "summary": "define an array of buffer descriptors", "description": "Create a tensor of buffer descriptors packing 32-bit pointer offsets and\n 32-bit lengths into 64-bit elements.", "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "offsets", "type": "DenseI32ArrayAttr" }, { "name": "lengths", "type": "DenseI32ArrayAttr" }, { "name": "memType", "type": "TT_MemTypeAttr{shared_mem|tensor_mem}" } ], "assemblyFormat": "$offsets `,` $lengths `,` $memType attr-dict `:` type($result)" }, { "name": "tti.experimental_cluster_cta_id", "summary": "Get the CTA id within the current cluster", "description": "Return the cluster-local CTA id used to index ConSan's multi-CTA scratch\n slabs. For single-CTA kernels this is always zero.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "tti.experimental_fpsan_embed", "summary": "Embed float value in the fpsan integer ring", "operands": [ { "name": "val", "type": "TT_FloatLike" } ], "results": [ { "name": "result", "type": "TT_IntLike" } ], "assemblyFormat": "$val attr-dict `:` functional-type(operands, $result)" }, { "name": "tti.experimental_fpsan_unembed", "summary": "Unembed fpsan integer payload as a float value", "operands": [ { "name": "val", "type": "TT_IntLike" } ], "results": [ { "name": "result", "type": "TT_FloatLike" } ], "assemblyFormat": "$val attr-dict `:` functional-type(operands, $result)" }, { "name": "tti.experimental_gsan_atomic_cas", "summary": "Lower a GSan-instrumented atomic cas", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "cmp", "type": "TT_Type" }, { "name": "val", "type": "TT_Type" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "attributes": [ { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'cmp', 'ptr', 'getPointerTypeSameShape($_self)'>" }, { "type": "TypesMatchWith<'val', 'ptr', 'getPointerTypeSameShape($_self)'>" } ], "assemblyFormat": "$sem `,` $scope `,` $ptr `,` $cmp `,` $val attr-dict `:`\n functional-type(operands, $result)" }, { "name": "tti.experimental_gsan_atomic_poll", "summary": "Instrument a completed atomic poll for GSan", "description": "Records the successful read performed by an atomic poll after the hardware\n polling loop has completed.", "operands": [ { "name": "ptr", "type": "TT_Ptr" }, { "name": "matched", "type": "I1" } ], "attributes": [ { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "assemblyFormat": "$sem `,` $scope `,` $ptr `,` $matched attr-dict `:` qualified(type($ptr))" }, { "name": "tti.experimental_gsan_atomic_rmw", "summary": "Lower a GSan-instrumented atomic rmw", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "val", "type": "TT_Type" }, { "name": "mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Type" } ], "attributes": [ { "name": "atomic_rmw_op", "type": "TT_AtomicRMWAttr{and|or|xor|add|fadd|max|min|umax|umin|exch}" }, { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'val', 'ptr', 'getPointerTypeSameShape($_self)'>" }, { "type": "TypesMatchWith<'val', 'mask', 'getI1SameShape($_self)'>" } ], "assemblyFormat": "$atomic_rmw_op `,` $sem `,` $scope `,` $ptr `,` $val (`,` $mask^)? attr-dict `:`\n functional-type(operands, $result)" }, { "name": "tti.experimental_gsan_atomic_tensor_access", "summary": "Instrument a tensor atomic access for GSan", "description": "Emits runtime instrumentation for a tensor pointer access whose individual\n elements are atomic read-modify-write operations.", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "sem", "type": "TT_MemSemanticAttr{relaxed|acquire|release|acq_rel}" }, { "name": "scope", "type": "TT_MemSyncScopeAttr{gpu|cta|sys}" } ], "traits": [ { "type": "TypesMatchWith<'ptr', 'mask', 'getI1SameShape(getPointeeType($_self))'>" } ], "assemblyFormat": "$sem `,` $scope `,` $ptr (`,` $mask^)? attr-dict `:` type($ptr)" }, { "name": "tti.experimental_gsan_init", "summary": "Initialize GSan thread" }, { "name": "tti.experimental_gsan_tensor_access", "summary": "Instrument a tensor load/store access for GSan", "description": "Emits runtime instrumentation for a tensor pointer access. The pointer and\n optional mask are consumed by the GSan runtime.", "operands": [ { "name": "ptr", "type": "TT_PtrLike" }, { "name": "mask", "type": "Optional" } ], "attributes": [ { "name": "isStore", "type": "BoolAttr" } ], "traits": [ { "type": "TypesMatchWith<'ptr', 'mask', 'getI1SameShape(getPointeeType($_self))'>" } ], "assemblyFormat": "$ptr `,` $isStore (`,` $mask^)? attr-dict `:` type($ptr)" }, { "name": "tti.experimental_gsan_tensordesc_info", "summary": "Decode GSan descriptor metadata from a native tensor descriptor", "description": "Decodes a native tensor descriptor into the underlying\n base pointer, shape and stride values.", "operands": [ { "name": "desc", "type": "TT_AnyTensorDescType" } ], "results": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$desc attr-dict `:` qualified(type($desc)) `->` type($result)" }, { "name": "tti.experimental_local_gather", "summary": "Gather elements from shared memory with logical base offsets", "description": "Gather elements from a shared memory descriptor using an index tensor along\n one axis, after shifting the logical source coordinates by rank-sized scalar\n offsets. This is intentionally private to instrumentation passes.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "indices", "type": "TT_IntTensor" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "result", "type": "TT_Tensor" } ], "attributes": [ { "name": "axis", "type": "I32Attr" } ], "assemblyFormat": "$src `[` $indices `]` `offsets` `=` `[` $offsets `]`\n attr-dict `:` qualified(type($src)) `,` type($indices) `->` type($result)" }, { "name": "tti.experimental_lock_acquire", "summary": "Acquire a lock.", "description": "Enter a critical section by acquiring a lock with single thread.", "operands": [ { "name": "lock", "type": "TT_PtrLike" }, { "name": "pred", "type": "Optional" } ], "assemblyFormat": "$lock (`,` $pred^)? attr-dict `:` type($lock)" }, { "name": "tti.experimental_lock_release", "summary": "Release a lock.", "description": "Leave a critical section by releasing a lock with single thread.", "operands": [ { "name": "lock", "type": "TT_PtrLike" }, { "name": "pred", "type": "Optional" } ], "assemblyFormat": "$lock (`,` $pred^)? attr-dict `:` type($lock)" }, { "name": "tti.experimental_memdesc_to_i32", "summary": "Convert a memdesc into its base pointer as i32", "description": "Extract the base pointer from the given memdesc and return it as a 32-bit\n integer. This can be used to compare the memdesc against tensors of barrier\n pointers maintained by the concurrency sanitizer.", "operands": [ { "name": "memdesc", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$memdesc attr-dict `:` type($memdesc)" }, { "name": "ttir.abs", "summary": "Elementwise absolute value operation.", "description": "The `abs` operation computes the absolute value of each element in the input tensor.\n\n For each element, it returns the magnitude of the value without regard to its sign:\n - For real numbers, it returns |x| (the non-negative value without sign)\n\n This operation has the idempotence property, meaning that applying it multiple times\n produces the same result as applying it once: abs(abs(x)) = abs(x). The operation\n preserves the data type of the input.\n\n Example:\n ```mlir\n // Compute absolute values of all elements in %input\n %result = ttir.abs(%input) : tensor<4x4xf32> -> tensor<4x4xf32>\n // Input tensor:\n // [[-2.5, 3.7, 0.0, 1.2], ... ]\n // Output tensor:\n // [[2.5, 3.7, 0.0, 1.2], ... ]\n\n // Example with integer tensor\n %result = ttir.abs(%int_input) : (tensor<10xi32>) -> tensor<10xi32>\n // Input tensor:\n // [-5, 0, 3, -2, ...]\n // Output tensor:\n // [5, 0, 3, 2, ...]\n ```\n\n Mathematical definition: abs(x) = |x| = {\n x if x ≥ 0\n -x if x < 0\n }", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.acos", "summary": "Eltwise arccosine op.", "description": "The `acos` operation computes the arccosine (inverse cosine) of each element in the input tensor.\n\n For each element, it returns the angle in radians whose cosine is the input value. The operation\n returns values in the range [0, π]. Inputs are expected to lie in [-1, 1].\n\n Example:\n ```mlir\n // Compute arccosine of all elements in %input\n %result = ttir.acos(%input) : (tensor<4xf32>) -> tensor<4xf32>\n // Input tensor:\n // [1.0, 0.5, 0.0, -1.0]\n // Output tensor:\n // [0.0, 1.047, 1.571, 3.142] // values in radians\n\n // Example with different values\n %result = ttir.acos(%float_input) : (tensor<3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [0.707, 0.0, -0.5]\n // Output tensor:\n // [0.785, 1.571, 2.094] // acos(√2/2) = π/4, acos(0) = π/2, acos(-0.5) = 2π/3\n ```\n\n Mathematical definition: acos(x) = cos⁻¹(x), where the result is in the range [0, π]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.add", "summary": "Elementwise addition operation.", "description": "The `add` operation performs an elementwise addition between two tensors.\n\n For each pair of corresponding elements, it adds the elements and places the result in the output tensor.\n\n Example:\n ```mlir\n // Addition operation\n %result = ttir.add(%lhs, %rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi32>\n // Input tensors:\n // %lhs: [10, 20, 30]\n // %rhs: [1, 2, 3]\n // Output tensor:\n // [11, 22, 33]\n\n // Example with floating point values\n %result = ttir.add(%float_lhs, %float_rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %float_lhs: [3.5, 0.0, -1.2]\n // %float_rhs: [1.5, 2.0, -3.2]\n // Output tensor:\n // [5.0, 2.0, -2.0]\n ```\n\n Note: The data type of the output tensor matches the data type of the input tensors.\n\n Mathematical definition: add(x, y) = x + y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.all_gather", "summary": "All gather operation.", "description": "All gather op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "all_gather_dim", "type": "SI32Attr" }, { "name": "cluster_axis", "type": "UI32Attr" } ] }, { "name": "ttir.all_reduce", "summary": "AllReduce operation.", "description": "AllReduce op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" }, { "name": "cluster_axis", "type": "UI32Attr" } ] }, { "name": "ttir.all_reduce_async", "summary": "Asynchronous AllReduce operation.", "description": "Asynchronous all-reduce collective communication operation. Performs a\n reduction (e.g. sum) across all devices in a mesh and distributes the\n result back to all devices, using async execution to overlap\n communication with computation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" }, { "name": "cluster_axis", "type": "UI32Attr" } ] }, { "name": "ttir.all_to_all", "summary": "All to All operation.", "description": "The all_to_all operation redistributes slices of a tensor across a cluster of devices. It splits each local tensor along split_dimension, sends\n the resulting slices to other devices along cluster_axis, and then concatenates the received slices along concat_dimension.\n\n Example:\n For a 1x2 mesh and a local input of shape [8, 4]:\n - split_dimension = 1\n - concat_dimension = 0\n - split_count = 2\n - cluster_axis = 1\n\n Each device splits its [8, 4] tensor into two [8, 2] slices. After the exchange, each device concatenates the two received [8, 2] slices\n into a [16, 2] output tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "split_dim", "type": "SI32Attr" }, { "name": "concat_dim", "type": "SI32Attr" }, { "name": "split_count", "type": "SI32Attr" }, { "name": "replica_groups", "type": "I64ElementsAttr" } ] }, { "name": "ttir.all_to_all_combine", "summary": "Combine expert outputs back to original token positions.", "description": "Inverse of dispatch: gathers expert computation results from expert devices\n and restores tokens to their original device and order.\n\n Input shapes:\n - input_tensor: [E_local, B*D, S, H]\n - expert_metadata: [1, B*D, S, K]\n - expert_mapping: [1, 1, E, D]\n\n Output shape:\n - result: [K, B, S, H]", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_metadata", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_devices", "type": "I64Attr" }, { "name": "cluster_axis", "type": "I64Attr" }, { "name": "num_experts_per_tok", "type": "I64Attr" }, { "name": "output_shard_dim", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.all_to_all_dispatch", "summary": "Dispatch tokens to expert devices for MoE computation.", "description": "Routes tokens to devices holding their selected experts via all-to-all\n communication. Used before sparse_matmul in the MoE dispatch/combine flow.\n\n Input shapes:\n - input_tensor: [B, S, 1, H]\n - expert_indices: [B, S, 1, K]\n - expert_mapping: [1, 1, E, D]\n\n Output shapes:\n - dispatched: [1, B*D, S, H]\n - metadata: [1, B*D, S, K]", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" } ], "results": [ { "name": "dispatched", "type": "AnyRankedTensor" }, { "name": "metadata", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_devices", "type": "I64Attr" }, { "name": "cluster_axis", "type": "I64Attr" } ] }, { "name": "ttir.all_to_all_dispatch_metadata", "summary": "Dispatch tokens with metadata to expert devices for MoE computation.", "description": "Routes tokens along with expert scores to devices holding their selected\n experts via all-to-all communication within a ring (cluster_axis).\n Returns dispatched tokens (sparse — only routed token slots are filled),\n all-gathered expert indices, and all-gathered expert scores.\n\n Dimensions:\n M = tokens per ring device\n K = selected experts per token\n D = total devices\n E = total experts\n\n Input shapes (per device, after mesh sharding):\n - input_tensor: [1, 1, M, H]\n - expert_indices: [1, 1, M, K]\n - expert_scores: [1, 1, M, K]\n - expert_mapping: [1, 1, D, E]\n Each entry [d, e] is the device ID that owns expert e.\n\n Output shapes (3D, per device, num_devices * M = tokens_global):\n - dispatched: [1, tokens_global, H]\n - indices: [1, tokens_global, K] (all-gathered across ring)\n - scores: [1, tokens_global, K] (all-gathered across ring)", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_scores", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" } ], "results": [ { "name": "dispatched", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "scores", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_devices", "type": "I64Attr" }, { "name": "cluster_axis", "type": "I64Attr" } ] }, { "name": "ttir.alloc", "summary": "Alloc op.", "description": "Tensor Alloc operation", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "address", "type": "I64Attr" }, { "name": "size", "type": "I64Attr" }, { "name": "memory_space", "type": "TTCore_MemorySpaceAttr{system|mmio|dram|l1|dst}" } ] }, { "name": "ttir.arange", "summary": "Tensor range generation operation.", "description": "The `arange` operation generates a tensor with evenly spaced values within a given interval.\n\n This operation creates a tensor with values from `start` to `end` (exclusive) with a step size of `step`,\n along the dimension specified by `arange_dimension`. It's similar to NumPy's arange function and is useful\n for creating tensors with regular sequences of values.\n\n Example:\n ```mlir\n // Generate a 1D tensor with values [0, 1, 2, 3, 4]\n %result = ttir.arange() {\n start = 0 : si64,\n end = 5 : si64,\n step = 1 : si64,\n arange_dimension = 0 : i64\n } : () -> tensor<5xi64>\n\n // Generate a 1D tensor with values [0.0, 2.0, 4.0, 6.0, 8.0]\n %result = ttir.arange() {\n start = 0 : si64,\n end = 10 : si64,\n step = 2 : si64,\n arange_dimension = 0 : i64\n } : () -> tensor<5xf32>\n\n // Generate a 2D tensor with the sequence along dimension 0\n %result = ttir.arange() {\n start = 0 : si64,\n end = 5 : si64,\n step = 1 : si64,\n arange_dimension = 0 : i64\n } : () -> tensor<5x3xi64>\n // Result:\n // [[0, 0, 0],\n // [1, 1, 1],\n // [2, 2, 2],\n // [3, 3, 3],\n // [4, 4, 4]]\n\n // Generate a 2D tensor with the sequence along dimension 1\n %result = ttir.arange() {\n start = 0 : si64,\n end = 3 : si64,\n step = 1 : si64,\n arange_dimension = 1 : i64\n } : () -> tensor<5x3xi64>\n // Result:\n // [[0, 1, 2],\n // [0, 1, 2],\n // [0, 1, 2],\n // [0, 1, 2],\n // [0, 1, 2]]\n ```\n\n Attributes:\n - `start` (Integer): The start value of the sequence.\n - `end` (Integer): The end value of the sequence (exclusive).\n - `step` (Integer): The step size between values in the sequence.\n - `arange_dimension` (Integer): The dimension along which to generate the sequence.\n\n Output:\n - `result` (Tensor): The generated tensor containing the sequence.", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "start", "type": "SI64Attr" }, { "name": "end", "type": "SI64Attr" }, { "name": "step", "type": "SI64Attr" }, { "name": "arange_dimension", "type": "I64Attr" } ] }, { "name": "ttir.argmax", "summary": "Argmax reduction op.", "description": "Determine the indices of the maximum values along a specified dimension of a tensor or over all elements\n in a tensor.\n\n This operation reduces the input tensor by finding the index of the maximum value along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the argmax is computed over all dimensions,\n resulting in a scalar index. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n ### Example IR Usage:\n ```mlir\n // Argmax along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.argmax(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<2x3xf32>) -> tensor<2xi32>\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [2.0, 4.0, 6.0]]\n // Output tensor:\n // [1, 2] // Index of maximum value in each row (5.0 in first row, 6.0 in second row)\n\n // Argmax along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.argmax(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<2x3xf32>) -> tensor<3xi32>\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [2.0, 4.0, 6.0]]\n // Output tensor:\n // [1, 0, 1] // Index of maximum value in each column\n\n // Argmax over all dimensions\n %input = ... : tensor<2x3xf32>\n %result = ttir.argmax(%input) {keep_dim = false} : (tensor<2x3xf32>) -> tensor\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [2.0, 4.0, 6.0]]\n // Output tensor:\n // 5 // Flattened index of the maximum value (6.0)\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.asin", "summary": "Eltwise arcsine op.", "description": "The `asin` operation computes the arcsine (inverse sine) of each element in the input tensor.\n\n For each element, it returns the angle in radians whose sine is the input value. The operation\n returns values in the range [-π/2, π/2]. Inputs are expected to lie in [-1, 1].\n\n Example:\n ```mlir\n // Compute arcsine of all elements in %input\n %result = ttir.asin(%input) : (tensor<4xf32>) -> tensor<4xf32>\n // Input tensor:\n // [0.0, 0.5, 1.0, -1.0]\n // Output tensor:\n // [0.0, 0.524, 1.571, -1.571] // values in radians\n\n // Example with different values\n %result = ttir.asin(%float_input) : (tensor<3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [-0.5, 0.0, 0.707]\n // Output tensor:\n // [-0.524, 0.0, 0.785] // asin(√2/2) = π/4\n ```\n\n Mathematical definition: asin(x) = sin⁻¹(x), where the result is in the range [-π/2, π/2]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.asinh", "summary": "Eltwise inverse hyperbolic sine op.", "description": "The `asinh` operation computes the inverse hyperbolic sine of each element in the input tensor.\n\n For each element, it returns the value whose hyperbolic sine is the input value. Unlike `asin`,\n this function accepts all real numbers as input.\n\n Example:\n ```mlir\n // Compute inverse hyperbolic sine of all elements in %input\n %result = ttir.asinh(%input) : (tensor<4xf32>) -> tensor<4xf32>\n // Input tensor:\n // [0.0, 1.0, -1.0, 10.0]\n // Output tensor:\n // [0.0, 0.8814, -0.8814, 2.9982]\n ```\n\n Mathematical definition: asinh(x) = ln(x + √(x² + 1))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.atan", "summary": "Eltwise arctangent op.", "description": "The `atan` operation computes the arctangent (inverse tangent) of each element in the input tensor.\n\n For each element, it returns the angle in radians whose tangent is the input value. The operation\n returns values in the range [-π/2, π/2].\n\n Example:\n ```mlir\n // Compute arctangent of all elements in %input\n %result = ttir.atan(%input) : (tensor<4xf32>) -> tensor<4xf32>\n // Input tensor:\n // [1.0, 0.5, 0.0, -1.0]\n // Output tensor:\n // [0.785, 0.464, 0.0, -0.785] // values in radians\n\n // Example with different values\n %result = ttir.atan(%float_input) : (tensor<3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [0.0, 1.0, 1000.0]\n // Output tensor:\n // [0.0, 0.785, 1.571] // values approach π/2 as input grows\n ```\n\n Mathematical definition: atan(x) = tan⁻¹(x), where the result is in the range [-π/2, π/2]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.atan2", "summary": "Elementwise atan2 operation.", "description": "The `atan2` operation performs an elementwise arc tangent (inverse tangent) operation between two tensors.\n\n For each pair of corresponding elements, it computes the angle in radians between the positive x-axis\n and the vector from the origin to the point (x, y) in the Cartesian plane. This operation is\n typically used in trigonometric calculations and supports partial broadcasting, allowing operands\n of different shapes to be combined.\n\n Example:\n ```mlir\n // %lhs: [0.0, 1.0, -1.0]\n // %rhs: [1.0, 0.0, 0.0]\n %result = ttir.atan2(%lhs, %rhs) : (tensor<3xf64>, tensor<3xf64>) -> tensor<3xf64>\n // %result: [0.0, 1.57079637, -1.57079637] // [0.0, pi/2, -pi/2]\n ```\n Mathematical definition: atan2(x, y) = arctan(y / x)", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.avg_pool2d", "summary": "2D average pooling operation.", "description": "The `avg_pool2d` operation applies a 2D average pooling over an input tensor composed of several input planes.\n\n This operation performs downsampling by dividing the input into local regions and computing the average value\n of each region. It reduces the spatial dimensions (height and width) of an input tensor while preserving the\n batch and channel dimensions. This is commonly used in neural networks to reduce the spatial size of feature maps.\n\n Example:\n ```mlir\n // Basic 2D average pooling with a 2x2 kernel and stride 1\n %input = ... : tensor<1x3x3x1xf32> // 3x3 input tensor with values:\n // [[[1, 2, 3],\n // [4, 5, 6],\n // [7, 8, 9]]]\n %result = ttir.avg_pool2d(%input) {\n kernel = [2, 2],\n stride = [1, 1],\n dilation = [1, 1],\n padding = [0, 0, 0, 0],\n ceil_mode = false\n } : (tensor<1x3x3x1xf32>) -> tensor<1x2x2x1xf32>\n // Result: [[[3, 4],\n // [6, 7]]]\n // Where: 3 = (1+2+4+5)/4, 4 = (2+3+5+6)/4, 6 = (4+5+7+8)/4, 7 = (5+6+8+9)/4\n ```\n\n Inputs:\n - `input` (Tensor): Input tensor in NHWC format (batch, height, width, channels).\n\n Attributes:\n - `kernel` (i32 | array<2xi32>):\n - i32: Same kernel size for height and width dimensions (kH = kW = value).\n - array<2xi32>: [kH, kW] where kH is kernel size for height and kW is kernel size for width.\n - `stride` (i32 | array<2xi32>):\n - i32: Same stride for height and width dimensions (sH = sW = value).\n - array<2xi32>: [sH, sW] where sH is stride for height and sW is stride for width.\n - `dilation` (i32 | array<2xi32>):\n - i32: Same dilation for height and width dimensions (dH = dW = value).\n - array<2xi32>: [dH, dW] where dH is dilation for height and dW is dilation for width.\n - `padding` (i32 | array<2xi32> | array<4xi32>):\n - i32: Same padding for all sides (pT = pL = pB = pR = value).\n - array<2xi32>: [pH, pW] where pH is padding for height (top/bottom) and pW is padding for width (left/right).\n - array<4xi32>: [pT, pL, pB, pR] for top, left, bottom, and right padding respectively.\n - `ceil_mode` (Boolean): When true, uses ceil instead of floor for output shape calculation.\n - `count_include_pad` (Boolean): When true, include padding in the average calculation (default: True)\n\n Output:\n - `result` (Tensor): Output tensor after average pooling.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "stride", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "dilation", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "flattened_compat_info", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.batch_norm_inference", "summary": "BatchNormInference operation", "description": "Performs batch normalization inference on the input tensor. Normalizes the `operand` tensor\n across all dimensions except for the specified `dimension` (feature dimension) and\n produces the normalized result using pre-computed mean and variance.\n\n Inputs:\n - `operand` (Tensor): The input tensor to be normalized.\n - `scale` (Tensor): The scale parameter (gamma).\n - `offset` (Tensor): The offset parameter (beta).\n - `mean` (Tensor): The pre-computed mean of the input.\n - `variance` (Tensor): The pre-computed variance of the input.\n\n Attributes:\n - `epsilon` is a small constant added to variance for numerical stability.\n - `dimension` specifies which dimension represents the features/channels.\n\n Output:\n - `result` (Tensor): The normalized output tensor.\n\n Example:\n ```mlir\n // Normalize a batch of activations\n %result = ttir.batch_norm(%operand, %scale, %offset, %mean, %variance,\n epsilon = 0.001, dimension = 1) :\n (tensor<8x16x32x32xf32>, tensor<16xf32>, tensor<16xf32>,\n tensor<16xf32>, tensor<16xf32>) -> tensor<8x16x32x32xf32>\n ```\n\n Mathematical definition: batch_norm(x, scale, offset, mean, variance, epsilon, dimension) =\n (x - mean) / sqrt(variance + epsilon) * scale + offset", "operands": [ { "name": "operand", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "offset", "type": "AnyRankedTensor" }, { "name": "mean", "type": "AnyRankedTensor" }, { "name": "variance", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "dimension", "type": "I32Attr" } ] }, { "name": "ttir.batch_norm_training", "summary": "BatchNormTraining operation", "description": "Performs batch normalization during training on the input tensor. Normalizes the `operand` tensor\n across all dimensions except for the specified `dimension` (feature dimension) and\n produces the normalized result along with batch statistics. Updates the running mean and variance.\n\n Inputs:\n - `operand` (Tensor): The input tensor to be normalized.\n - `scale` (Tensor): The scale parameter (gamma).\n - `offset` (Tensor): The offset parameter (beta).\n - `running_mean` (Tensor): The running mean (updated during training).\n - `running_variance` (Tensor): The running variance (updated during training).\n\n Attributes:\n - `epsilon` is a small constant added to variance for numerical stability.\n - `dimension` specifies which dimension represents the features/channels.\n - `momentum` is the momentum factor for updating running statistics.\n\n Outputs:\n - `result` (Tensor): The normalized output tensor.\n - `batch_mean` (Tensor): The computed batch mean.\n - `batch_variance` (Tensor): The computed batch variance.\n\n Example:\n ```mlir\n // Normalize a batch of activations (training)\n %result, %batch_mean, %batch_variance = ttir.batch_norm_training(%operand, %scale, %offset, %running_mean, %running_variance,\n %output, %batch_mean_output, %batch_variance_output :\n epsilon = 0.001, dimension = 1, momentum = 0.1) :\n (tensor<8x16x32x32xf32>, tensor<16xf32>, tensor<16xf32>,\n tensor<16xf32>, tensor<16xf32>, tensor<8x16x32x32xf32>,\n tensor<16xf32>, tensor<16xf32>, tensor<16xf32>, tensor<16xf32>) ->\n (tensor<8x16x32x32xf32>, tensor<16xf32>, tensor<16xf32>)\n ```\n\n Mathematical definition:\n batch_mean = mean(x, dimension)\n batch_variance = variance(x, dimension)\n normalized = (x - batch_mean) / sqrt(batch_variance + epsilon) * scale + offset\n running_mean = momentum * batch_mean + (1 - momentum) * running_mean\n running_variance = momentum * batch_variance + (1 - momentum) * running_variance", "operands": [ { "name": "operand", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "offset", "type": "AnyRankedTensor" }, { "name": "running_mean", "type": "AnyRankedTensor" }, { "name": "running_variance", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" }, { "name": "batch_mean", "type": "AnyRankedTensor" }, { "name": "batch_variance", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "F32Attr" }, { "name": "dimension", "type": "I32Attr" }, { "name": "momentum", "type": "F32Attr" } ] }, { "name": "ttir.bitcast_convert", "summary": "Elementwise bitcast operation.", "description": "The `bitcast_convert` operation reinterprets the bits of each element in\n the input tensor as a data type of the output tensor. This leads to change\n in numerical values in data.\n Only same-bit-width element types are supported (e.g. ui32 -> f32).\n\n Example:\n ```mlir\n // Reinterpret the raw bits of each ui32 element as f32.\n // Input: [0x3F800000, 0x40000000] (ui32)\n // Output: [1.0, 2.0 ] (f32) — same bits, read as float\n %result = ttir.bitcast_convert(%input) : (tensor<16384xui32>) -> tensor<16384xf32>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.bitwise_and", "summary": "Elementwise bitwise AND.", "description": "The `bitwise_and` operation performs an elementwise bitwise AND operation between two tensors.\n\n For each pair of corresponding elements, it computes the bitwise AND of their binary\n representations. This operation is typically used with integer data types and has the\n idempotence property, meaning that applying it twice with the same second operand\n returns the original result: bitwise_and(bitwise_and(x, y), y) = bitwise_and(x, y).\n\n Example:\n ```mlir\n // Bitwise AND operation\n %result = ttir.bitwise_and(%lhs, %rhs) : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n // Input tensors:\n // %lhs: [[1, 2], [3, 4]]\n // %rhs: [[5, 6], [7, 8]]\n // Output tensor:\n // [[1, 2], [3, 0]]\n\n // Example with binary representation (for 8-bit integers)\n %result = ttir.bitwise_and(%int8_lhs, %int8_rhs) : (tensor<4xi8>, tensor<4xi8>) -> tensor<4xi8>\n // Input tensors:\n // %int8_lhs: [0x0F, 0xAA, 0xFF, 0x00] (binary: [00001111, 10101010, 11111111, 00000000])\n // %int8_rhs: [0xF0, 0x55, 0xFF, 0x00] (binary: [11110000, 01010101, 11111111, 00000000])\n // Output tensor:\n // [0x00, 0x00, 0xFF, 0x00] (binary: [00000000, 00000000, 11111111, 00000000])\n ```\n\n Mathematical definition: bitwise_and(x, y) = x & y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.bitwise_not", "summary": "Elementwise bitwise NOT.", "description": "The `bitwise_not` operation computes the bitwise NOT (one's complement) of each element in the input tensor.\n\n For each element, it flips all the bits in the binary representation of the value. This operation\n is typically used with integer data types and has the involution property, meaning that\n applying it twice returns the original value: bitwise_not(bitwise_not(x)) = x.\n\n Example:\n ```mlir\n // Bitwise operation with with integer tensors\n %result = \"ttir.bitwise_not\"(%operand) : (tensor<2x2xi32>) -> tensor<2x2xi32>\n // %operand: [[1, 2], [3, 4]]\n // %result: [[-2, -3], [-4, -5]]\n\n // Example with binary representation (for 8-bit integers)\n %result = ttir.bitwise_not(%int8_input) : (tensor<3xi8>) -> tensor<3xi8>\n // Input %int8_input:\n // [0, 5, 255] (binary: [00000000, 00000101, 11111111])\n // Output %int8_output:\n // [255, 250, 0] (binary: [11111111, 11111010, 00000000])\n ```\n\n Mathematical definition: bitwise_not(x) = ~x", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.bitwise_or", "summary": "Elementwise bitwise OR operation.", "description": "The `bitwise_or` operation performs an elementwise bitwise OR operation between two tensors.\n\n For each pair of corresponding elements, it computes the bitwise OR of their binary\n representations. This operation is typically used with integer data types and has the\n idempotence property, meaning that applying it twice with the same second operand\n returns the original result: bitwise_or(bitwise_or(x, y), y) = bitwise_or(x, y).\n\n Example:\n ```mlir\n // Bitwise OR operation\n %result = ttir.bitwise_or(%lhs, %rhs) : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n // Input tensors:\n // %lhs: [[1, 2], [3, 4]]\n // %rhs: [[5, 6], [7, 8]]\n // Output tensor:\n // [[5, 6], [7, 12]]\n\n // Example with binary representation (for 8-bit integers)\n %result = ttir.bitwise_or(%int8_lhs, %int8_rhs) : (tensor<4xi8>, tensor<4xi8>) -> tensor<4xi8>\n // Input tensors:\n // %int8_lhs: [0x0F, 0xAA, 0x00, 0x55] (binary: [00001111, 10101010, 00000000, 01010101])\n // %int8_rhs: [0xF0, 0x55, 0x00, 0xAA] (binary: [11110000, 01010101, 00000000, 10101010])\n // Output tensor:\n // [0xFF, 0xFF, 0x00, 0xFF] (binary: [11111111, 11111111, 00000000, 11111111])\n ```\n\n Mathematical definition: bitwise_or(x, y) = x | y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.bitwise_xor", "summary": "Elementwise bitwise XOR operation.", "description": "The `bitwise_xor` operation performs an elementwise bitwise XOR (exclusive OR) operation between two tensors.\n\n For each pair of corresponding elements, it computes the bitwise XOR of their binary\n representations. This operation is typically used with integer data types and has the\n property that when applied twice with the same second operand, it returns the original input:\n bitwise_xor(bitwise_xor(x, y), y) = x.\n\n Example:\n ```mlir\n // Bitwise XOR operation\n %result = ttir.bitwise_xor(%lhs, %rhs) : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n // Input tensors:\n // %lhs: [[1, 2], [3, 4]]\n // %rhs: [[5, 6], [7, 8]]\n // Output tensor:\n // [[4, 4], [4, 12]]\n\n // Example with binary representation (for 8-bit integers)\n %result = ttir.bitwise_xor(%int8_lhs, %int8_rhs) : (tensor<4xi8>, tensor<4xi8>) -> tensor<4xi8>\n // Input tensors:\n // %int8_lhs: [0x0F, 0xAA, 0xFF, 0x00] (binary: [00001111, 10101010, 11111111, 00000000])\n // %int8_rhs: [0xF0, 0x55, 0xFF, 0x00] (binary: [11110000, 01010101, 11111111, 00000000])\n // Output tensor:\n // [0xFF, 0xFF, 0x00, 0x00] (binary: [11111111, 11111111, 00000000, 00000000])\n ```\n\n Mathematical definition: bitwise_xor(x, y) = x ^ y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.broadcast", "summary": "Broadcast operation.", "description": "The `broadcast` operation expands the dimensions of an input tensor according to specified broadcast dimensions.\n\n This operation takes an input tensor and broadcasts it to a larger shape by repeating elements along\n dimensions where the input has size 1 and the output has a larger size. This is commonly used to\n make tensors compatible for elementwise operations.\n\n Example:\n ```mlir\n // Broadcast a tensor from shape [1, 1, 32] to [1, 16, 32]\n %input = ... : tensor<1x1x32xf32>\n %result = ttir.broadcast(%input) {broadcast_dimensions = [1, 16, 1]} : (tensor<1x1x32xf32>) -> tensor<1x16x32xf32>\n // The input tensor is repeated 16 times along the second dimension\n\n // Broadcast a tensor from shape [1, 3] to [2, 3]\n %input = ... : tensor<1x3xf32>\n %result = ttir.broadcast(%input) {broadcast_dimensions = [2, 1]} : (tensor<1x3xf32>) -> tensor<2x3xf32>\n // The input tensor is repeated 2 times along the first dimension\n ```\n\n Note: Currently, when generating a TTNN executable, the broadcast and repeat operations share the same\n semantics due to the lack of tensor view support in TTNN. As a result, the broadcast operation is\n lowered to a repeat operation in the TTNN compilation pipeline.\n\n Inputs:\n - `input` (Tensor): The input tensor to broadcast.\n\n Attributes:\n - `broadcast_dimensions` (Array of Integer): The number of times to broadcast the tensor along each dimension.\n\n Output:\n - `result` (Tensor): The broadcasted tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.cbrt", "summary": "Elementwise cubic root operation.", "description": "The `cbrt` operation computes the cubic root (∛) of each element in the input tensor.\n\n For each element, it returns the real-valued number that, when cubed, equals the input value.\n Unlike square root, cubic root is defined for negative numbers as well as positive numbers.\n\n Example:\n ```mlir\n // Compute cubic root of all elements in %input\n %result = ttir.cbrt(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[8.0, 27.0, -8.0, 1.0], ... ]\n // Output tensor:\n // [[2.0, 3.0, -2.0, 1.0], ... ]\n\n // Example with different values\n %result = ttir.cbrt(%float_input) : (tensor<3x2xf32>) -> tensor<3x2xf32>\n // Input tensor:\n // [[125.0, -27.0],\n // [0.0, 0.001],\n // [1000.0, -1.0]]\n // Output tensor:\n // [[5.0, -3.0],\n // [0.0, 0.1],\n // [10.0, -1.0]]\n ```\n\n Mathematical definition: cbrt(x) = ∛x = x^(1/3)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.ceil", "summary": "Elementwise ceiling operation.", "description": "The `ceil` operation computes the ceiling (smallest integer greater than or equal to x)\n of each element in the input tensor.\n\n For each element, it rounds the value up to the nearest integer. The operation preserves\n the data type of the input.\n\n This operation has the idempotence property, meaning that applying it multiple times\n produces the same result as applying it once: ceil(ceil(x)) = ceil(x).\n\n Example:\n ```mlir\n // Compute ceiling of all elements in %input\n %result = ttir.ceil(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[2.0, 2.0, 0.0, 5.0], ... ]\n\n // Example with different values\n %result = ttir.ceil(%float_input) : (tensor<3x2xf32>) -> tensor<3x2xf32>\n // Input tensor:\n // [[3.14, -2.5],\n // [0.0, 0.001],\n // [9.999, -0.0]]\n // Output tensor:\n // [[4.0, -2.0],\n // [0.0, 1.0],\n // [10.0, 0.0]]\n ```\n\n Mathematical definition: ceil(x) = ⌈x⌉ = min{n ∈ ℤ | n ≥ x}", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.chunked_scaled_dot_product_attention", "summary": "Chunked prefill scaled dot product attention over a paged KV cache.", "description": "Chunked-prefill attention. A prefill chunk of `query` attends\n causally over the prefix tokens `[0, chunk_start_idx + chunk_len)` that are\n resident in the paged K/V cache, read on device via `page_table`. The prefix\n offset is supplied by the device tensor `chunk_start_idx` (`[1]` int32). Causal\n masking is handled internally; no host attention mask.\n\n Args:\n query (AnyRankedTensor): `[B x Hq x chunk_len x D]`.\n key (AnyRankedTensor): paged K cache `[num_blocks x Hkv x block_size x D]`.\n value (AnyRankedTensor): paged V cache, same layout as `key`.\n page_table (AnyRankedTensor): `[B x num_blocks_per_user]` int32.\n chunk_start_idx (AnyRankedTensor): `[1]` int32 prefix offset.\n scale (float, optional): Softmax scale. Defaults to `1 / sqrt(D)`.\n\n Returns:\n AnyRankedTensor: same shape/type as `query`.", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "chunk_start_idx", "type": "AnyRankedTensor" }, { "name": "output", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "OptionalAttr" } ] }, { "name": "ttir.clamp_scalar", "summary": "Scalar value clamping operation.", "description": "The `clamp_scalar` operation constrains all elements of a tensor to be within a specified range.\n\n This operation applies element-wise clamping to the input tensor, ensuring that all values fall within\n the range [min, max]. Values less than `min` are set to `min`, and values greater than `max` are set to `max`.\n This is commonly used to ensure that tensor values stay within a valid range.\n\n Example:\n ```mlir\n // Clamp values to the range [2.0, 5.0]\n %input = ... : tensor<1x8xf32> // Input tensor with values:\n // [[0, 1, 2, 3, 4, 5, 6, 7]]\n %result = ttir.clamp_scalar(%input) {\n min = 2.0 : f32, // Minimum value\n max = 5.0 : f32 // Maximum value\n } : (tensor<1x8xf32>) -> tensor<1x8xf32>\n // Result: [[2, 2, 2, 3, 4, 5, 5, 5]]\n // Values < 2.0 are clamped to 2.0, values > 5.0 are clamped to 5.0\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to clamp.\n\n Attributes:\n - `min` (Float): The minimum value for clamping.\n - `max` (Float): The maximum value for clamping.\n\n Output:\n - `result` (Tensor): The clamped tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "min", "type": "AnyAttrOf<[F32Attr, I32Attr]>" }, { "name": "max", "type": "AnyAttrOf<[F32Attr, I32Attr]>" } ] }, { "name": "ttir.clamp_tensor", "summary": "Tensor value clamping operation.", "description": "The `clamp_tensor` operation constrains elements of a tensor to be within ranges specified by min and max tensors.\n\n Unlike `clamp_scalar`, which uses scalar values for min and max, this operation uses tensor values for\n element-wise clamping. Each element in the input tensor is clamped between the corresponding elements\n in the min and max tensors. This allows for different clamping ranges for different elements.\n\n Example:\n ```mlir\n // Clamp values using min and max tensors\n %input = ... : tensor<1x8xf32> // Input tensor with values:\n // [[0, 1, 2, 3, 4, 5, 6, 7]]\n %min = ... : tensor<1x8xf32> // Min tensor with values:\n // [[2, 2, 2, 3, 3, 3, 0, 0]]\n %max = ... : tensor<1x8xf32> // Max tensor with values:\n // [[5, 5, 5, 9, 9, 9, 6, 6]]\n %result = ttir.clamp_tensor(%input, %min, %max) :\n (tensor<1x8xf32>, tensor<1x8xf32>, tensor<1x8xf32>) -> tensor<1x8xf32>\n // Result: [[2, 2, 2, 3, 4, 5, 6, 6]]\n // Each element is clamped between its corresponding min and max values\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to clamp.\n - `min` (Tensor): The tensor containing minimum values for clamping.\n - `max` (Tensor): The tensor containing maximum values for clamping.\n\n Output:\n - `result` (Tensor): The clamped tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "min", "type": "AnyRankedTensor" }, { "name": "max", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.collective_broadcast", "summary": "Collective Broadcast op", "description": "The collective_broadcast operation distributes a tensor from a single source device to all\n other devices within each replica group. Each replica group defines a subset of devices that\n participate in the broadcast, and the operation is applied independently within each group.\n\n By convention, the first device listed in each replica group is treated as the broadcast source.\n The value of the `input` tensor on that source device is sent to all other devices in the same\n group. The `input` tensor values on non-source devices are ignored and will be overwritten\n during the operation.\n\n Inputs:\n - input: The tensor to broadcast. Only the value on the first device of each replica group\n (the source) is used; values on other devices are ignored.\n - replica_groups: A list of replica groups. Each group is a list of device IDs, and the first\n ID in each group is treated as the broadcast source for that group.\n\n Result:\n - result: The output tensor containing the broadcasted value, identical across all devices\n in the same replica group.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "replica_groups", "type": "I64ElementsAttr" } ] }, { "name": "ttir.collective_permute", "summary": "Collective permute operation.", "description": "Collective permute op. This operation ingests a multi-device tensor spread across multi-devices and will shuffle the data according to source_target_pairs [['src', 'dest']].\n\n Example:\n For a 1x2 mesh, the following will take the device shard living in device 0 and move it to device 1. The device shard living in device 1 will move to device 0.\n %source_target_pairs: [[0, 1], [1, 0]]\n\n In the case of missing 'dest', the device shard living on that device will contain values of 0. For example, device shard living in device 0 will contain 0 values.\n %source_target_pairs: [[0, 1]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "source_target_pairs", "type": "I64ElementsAttr" } ] }, { "name": "ttir.concat", "summary": "Tensor concatenation operation.", "description": "The `concat` operation joins multiple tensors along a specified dimension.\n\n This operation concatenates a list of tensors along the dimension specified by `dim`.\n All input tensors must have the same shape except for the dimension being concatenated,\n and the output tensor's shape will match the input tensors except for the concatenated\n dimension, which will be the sum of the input dimensions.\n\n Example:\n ```mlir\n // Concatenate along dimension 0\n %input1 = ... : tensor<2x3xf32>\n %input2 = ... : tensor<3x3xf32>\n %result = ttir.concat(%input1, %input2) {dim = 0 : i32} : (tensor<2x3xf32>, tensor<3x3xf32>) -> tensor<5x3xf32>\n // Input1 shape: [2, 3]\n // Input2 shape: [3, 3]\n // Output shape: [5, 3]\n\n // Concatenate along dimension 1\n %input1 = ... : tensor<2x3xf32>\n %input2 = ... : tensor<2x2xf32>\n %result = ttir.concat(%input1, %input2) {dim = 1 : i32} : (tensor<2x3xf32>, tensor<2x2xf32>) -> tensor<2x5xf32>\n // Input1 shape: [2, 3]\n // Input2 shape: [2, 2]\n // Output shape: [2, 5]\n ```\n\n Inputs:\n - `inputs` (Variadic Tensor): A list of input tensors to concatenate.\n\n Attributes:\n - `dim` (Integer): The dimension along which to concatenate the tensors.\n\n Output:\n - `result` (Tensor): The concatenated tensor.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttir.concatenate_heads", "summary": "Concatenate heads operation.", "description": "The `concatenate_heads` operation concatenates multiple heads of a multi-head attention tensor into a single tensor.\n\n This operation is typically used in transformer models where the attention mechanism is split into multiple heads.\n It combines the outputs of these heads into a single tensor, allowing further processing.\n\n It takes an input tensor with shape `[batch_size, num_heads, sequence_size, head_size]`\n and produces an output tensor with shape `[batch_size, sequence_size, num_heads * head_size]`.\n\n It corresponds to a sequence of permute and reshape operations.\n\n Example:\n ```mlir\n // Concatenate heads from a multi-head attention output\n %input = ... : tensor<1x24x32x128xbf16> // batch_size: 1, num_heads: 24, sequence_size: 32, head_size: 128\n %result = ttir.concatenate_heads(%input) : (tensor<1x24x32x128xbf16>) -> tensor<1x32x3072xbf16>\n // Input tensor shape: [1, 24, 32, 128]\n // Output tensor shape: [1, 32, 3072]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor containing multiple heads.\n\n Output:\n - `result` (Tensor): The concatenated output tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.constant", "summary": "Tensor constant creation operation.", "description": "The `constant` operation creates a tensor with values specified by a constant attribute.\n\n This operation is used to create tensors with predefined values that remain constant\n throughout program execution. It's commonly used for initializing model weights, biases,\n and other fixed parameters in neural networks.\n\n Example:\n ```mlir\n // Create a 2D tensor of zeros\n %result = ttir.constant() {\n value = dense<0> : tensor<2x3xi32>\n } : () -> tensor<2x3xi32>\n // Result: [[0, 0, 0], [0, 0, 0]]\n\n // Create a 1D tensor with specific floating-point values\n %result = ttir.constant() {\n value = dense<[0.2, 1.3]> : tensor<2xf32>\n } : () -> tensor<2xf32>\n // Result: [0.2, 1.3]\n\n // Create a scalar constant\n %result = ttir.constant() {\n value = dense<5.0> : tensor\n } : () -> tensor\n // Result: 5.0\n\n // Create a 2D tensor with different values\n %result = ttir.constant() {\n value = dense<[[1, 2, 3], [4, 5, 6]]> : tensor<2x3xi32>\n } : () -> tensor<2x3xi32>\n // Result: [[1, 2, 3], [4, 5, 6]]\n ```\n\n Attributes:\n - `value` (DenseElementsAttr): The constant value of the tensor.\n\n Output:\n - `result` (Tensor): The tensor with the specified constant values.\n\n Note: The shape and element type of the result tensor are determined by the `value` attribute.\n The `constant` operation is typically folded during compilation, allowing for optimizations\n such as constant propagation.", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ] }, { "name": "ttir.conv_transpose2d", "summary": "ConvTranspose2d operation.", "description": "Applies a 2D transposed convolution operator over an input image composed of several input planes.\n\n This operation performs the gradient of a 2D convolution with respect to the input, which is useful\n for tasks like upsampling feature maps in neural networks. It supports configurable stride, padding,\n dilation, output padding, and grouping parameters.\n\n Example:\n ```mlir\n // Basic 2D transposed convolution\n %input = ... : tensor<1x14x14x16xf32> // Batch size 1, 14x14 feature map, 16 channels\n %weight = ... : tensor<16x8x3x3xf32> // 16 input channels, 8 output channels, 3x3 kernel\n %bias = ... : tensor<1x1x1x8xf32> // Bias for 8 output channels\n %result = ttir.conv_transpose2d(%input, %weight, %bias) {\n stride = [2, 2],\n padding = [0, 0, 0, 0],\n dilation = [1, 1],\n output_padding = [0, 0],\n groups = 1\n } : (tensor<1x14x14x16xf32>, tensor<16x8x3x3xf32>, tensor<1x1x1x8xf32>) -> tensor<1x28x28x8xf32>\n\n // Transposed convolution with padding and output padding\n %input = ... : tensor<1x14x14x16xf32> // Batch size 1, 14x14 feature map, 16 channels\n %weight = ... : tensor<16x8x4x4xf32> // 16 input channels, 8 output channels, 4x4 kernel\n %bias = ... : tensor<1x1x1x8xf32> // Bias for 8 output channels\n %result = ttir.conv_transpose2d(%input, %weight, %bias) {\n stride = [2, 2],\n padding = [1, 1, 1, 1],\n dilation = [1, 1],\n output_padding = [1, 1],\n groups = 1\n } : (tensor<1x14x14x16xf32>, tensor<16x8x4x4xf32>, tensor<1x1x1x8xf32>) -> tensor<1x29x29x8xf32>\n ```\n\n Inputs:\n - `input` AnyRankedTensor: 4D tensor where dimension indices are controlled by `batch_dim`, `height_dim`,\n `width_dim`, and `channel_dim` attributes. Default layout is NHWC (N, H_in, W_in, C) where:\n - N is the batch size\n - H_in is the height of the input planes\n - W_in is the width of the input planes\n - C is the number of channels\n - `weight` (AnyRankedTensor): expected in the following format (C, O/G, K_H, K_W) where:\n - C is the number of input channels\n - O is the number of output channels\n - G is the number of groups\n - K_H is the height of the kernel\n - K_W is the width of the kernel\n - `bias` Optional: bias tensor with output channels at position specified by `channel_dim`.\n Default format is (1, 1, 1, O).\n\n Attributes:\n - `stride` (i32 | array<2xi32>): Controls the stride for the cross-correlation.\n - `padding` (i32 | array<2xi32> | array<4xi32>): Controls the amount of implicit zero padding on both sides for dilation * (kernel_size - 1) - padding number of points.\n - `output_padding` (i32 | array<2xi32>): Controls the additional size added to one side of the output shape.\n - `dilation` (i32 | array<2xi32>): Controls the spacing between the kernel points\n - `groups` i32: Controls the connections between inputs and outputs. Must be divisible by input and output channels.\n - `batch_dim` (i64): Index of the batch dimension in input/output tensors. Default: 0.\n - `height_dim` (i64): Index of the height dimension in input/output tensors. Default: 1.\n - `width_dim` (i64): Index of the width dimension in input/output tensors. Default: 2.\n - `channel_dim` (i64): Index of the channel dimension in input/output tensors. Default: 3.\n\n Output:\n - `result` AnyRankedTensor: 4D tensor with same layout as input (controlled by dimension attributes).\n Default format is (N, H_out, W_out, O) where:\n - H_out = (H_in - 1) * stride[0] - (padding_top + padding_bottom) + dilation[0] * (K_H - 1) + output_padding[0] + 1\n - W_out = (W_in - 1) * stride[1] - (padding_left + padding_right) + dilation[1] * (K_W - 1) + output_padding[1] + 1", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "stride", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "output_padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "dilation", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "groups", "type": "I32Attr" }, { "name": "batch_dim", "type": "DefaultValuedAttr" }, { "name": "height_dim", "type": "DefaultValuedAttr" }, { "name": "width_dim", "type": "DefaultValuedAttr" }, { "name": "channel_dim", "type": "DefaultValuedAttr" }, { "name": "flattened_compat_info", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.conv2d", "summary": "Conv2d operation.", "description": "Applies a 2D convolution over an input image composed of several input planes.\n\n This operation performs a 2D convolution on the input tensor using the provided weight tensor\n and optional bias. It supports configurable stride, padding, dilation, and grouping parameters\n to control the convolution behavior.\n\n Example:\n ```mlir\n // Basic 2D convolution\n %input = ... : tensor<1x28x28x3xf32> // Batch size 1, 28x28 image, 3 channels\n %weight = ... : tensor<16x3x3x3xf32> // 16 output channels, 3 input channels, 3x3 kernel\n %bias = ... : tensor<1x1x1x16xf32> // Bias for 16 output channels\n %result = ttir.conv2d(%input, %weight, %bias) {\n stride = [1, 1],\n padding = [0, 0, 0, 0],\n dilation = [1, 1],\n groups = 1\n } : (tensor<1x28x28x3xf32>, tensor<16x3x3x3xf32>, tensor<1x1x1x16xf32>) -> tensor<1x26x26x16xf32>\n\n // Convolution with stride 2 and padding\n %input = ... : tensor<1x28x28x3xf32> // Batch size 1, 28x28 image, 3 channels\n %weight = ... : tensor<16x3x3x3xf32> // 16 output channels, 3 input channels, 3x3 kernel\n %bias = ... : tensor<1x1x1x16xf32> // Bias for 16 output channels\n %result = ttir.conv2d(%input, %weight, %bias) {\n stride = [2, 2],\n padding = [1, 1, 1, 1],\n dilation = [1, 1],\n groups = 1\n } : (tensor<1x28x28x3xf32>, tensor<16x3x3x3xf32>, tensor<1x1x1x16xf32>) -> tensor<1x14x14x16xf32>\n ```\n\n Inputs:\n - `input` (AnyRankedTensor): 4D tensor where dimension indices are controlled by `batch_dim`, `height_dim`,\n `width_dim`, and `channel_dim` attributes. Default layout is NHWC (N, H_in, W_in, C) where:\n - N is the batch size\n - H_in is the height of the input planes\n - W_in is the width of the input planes\n - C is the number of channels\n - `weight` (AnyRankedTensor): expected in the following format (O, C/G, K_H, K_W) where:\n - C is the number of input channels\n - O is the number of output channels\n - G is the number of groups\n - K_H is the height of the kernel\n - K_W is the width of the kernel\n - `bias` Optional: bias tensor with output channels at position specified by `channel_dim`.\n Default format is (1, 1, 1, O).\n\n Attributes:\n - `stride` (i32 | array<2xi32>):\n - i32: Same stride for height and width dimensions (sH = sW = value).\n - array<2xi32>: [sH, sW] where sH is stride for height and sW is stride for width.\n - `padding` (i32 | array<2xi32> | array<4xi32>):\n - i32: Same padding for all sides (pT = pL = pB = pR = value).\n - array<2xi32>: [pH, pW] where pH is padding for height (top/bottom) and pW is padding for width (left/right).\n - array<4xi32>: [pT, pL, pB, pR] for top, left, bottom, and right padding respectively.\n - `dilation` (i32 | array<2xi32>): Spacing between kernel elements.\n - i32: Same dilation for height and width dimensions (dH = dW = value).\n - array<2xi32>: [dH, dW] where dH is dilation for height and dW is dilation for width.\n - `groups` (i32): Number of blocked connections from input channels to output channels. Input and output channels must both be divisible by groups.\n - `batch_dim` (i64): Index of the batch dimension in input/output tensors. Default: 0.\n - `height_dim` (i64): Index of the height dimension in input/output tensors. Default: 1.\n - `width_dim` (i64): Index of the width dimension in input/output tensors. Default: 2.\n - `channel_dim` (i64): Index of the channel dimension in input/output tensors. Default: 3.\n\n Output:\n - `result` AnyRankedTensor: 4D tensor with same layout as input (controlled by dimension attributes).\n Default format is (N, H_out, W_out, O) where:\n - `H_out = (H_in + pT + pB - dH * (K_H - 1) - 1) / sH + 1`\n - `W_out = (W_in + pL + pR - dW * (K_W - 1) - 1) / sW + 1`", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "stride", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "dilation", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "groups", "type": "I32Attr" }, { "name": "batch_dim", "type": "DefaultValuedAttr" }, { "name": "height_dim", "type": "DefaultValuedAttr" }, { "name": "width_dim", "type": "DefaultValuedAttr" }, { "name": "channel_dim", "type": "DefaultValuedAttr" }, { "name": "flattened_compat_info", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.conv3d", "summary": "Conv3d operation.", "description": "Applies a 3D convolution over an input volume composed of several input planes.\n\n This operation performs a 3D convolution on the input tensor using the provided weight tensor\n and optional bias. It supports configurable stride, padding, padding_mode and grouping parameters\n to control the convolution behavior. This is commonly used for video or volumetric data processing.\n\n Example:\n ```mlir\n // Basic 3D convolution with 3x3x3 kernel\n %input = ... : tensor<1x8x28x28x4xf32> // Batch=1, Depth=8, H=28, W=28, Channels=4\n %weight = ... : tensor<16x4x3x3x3xf32> // 16 output channels, 4 input channels, 3x3x3 kernel\n %bias = ... : tensor<1x1x1x1x16xf32> // Bias for 16 output channels\n %result = ttir.conv3d(%input, %weight, %bias) {\n stride = [1, 1, 1],\n padding = [0, 0, 0],\n groups = 1,\n padding_mode = \"zeros\"\n } : (tensor<1x8x28x28x4xf32>, tensor<16x4x3x3x3xf32>, tensor<1x1x1x1x16xf32>) -> tensor<1x6x26x26x16xf32>\n\n // Convolution with stride 2 and padding\n %input = ... : tensor<1x8x28x28x4xf32> // Batch size 1, Depth=8, H=28, W=28, Channels=4\n %weight = ... : tensor<16x4x3x3x3xf32> // 16 output channels, 4 input channels, 3x3x3 kernel\n %bias = ... : tensor<1x1x1x1x16xf32> // Bias for 16 output channels\n %result = ttir.conv3d(%input, %weight, %bias) {\n stride = [2, 2, 2],\n padding = [1, 1, 1],\n groups = 1,\n padding_mode = \"zeros\"\n } : (tensor<1x8x28x28x4xf32>, tensor<16x4x3x3x3xf32>, tensor<1x1x1x1x16xf32>) -> tensor<1x4x14x14x16xf32>\n ```\n\n Inputs:\n - `input` (AnyRankedTensor): expected in the following format (N, D, H, W, C) where:\n - N is the batch size\n - D is the depth of the input volume\n - H is the height of the input planes\n - W is the width of the input planes\n - C is the number of input channels\n - `weight` (AnyRankedTensor): expected in the following format (C_out, C_in, K_D, K_H, K_W) where:\n - C_out is the number of output channels\n - C_in is the number of input channels\n - K_D is the depth of the kernel\n - K_H is the height of the kernel\n - K_W is the width of the kernel\n - `bias` Optional: expected in the following format (1, 1, 1, 1, C_out).\n\n Attributes:\n - `stride` (i32 | array<3xi32>): [sD, sH, sW] where sD is stride for depth, sH for height, sW for width.\n - `padding` (i32 |array<3xi32>): [pD, pH, pW] where pD is padding for depth, pH for height, pW for width.\n Padding is symmetric (same on both sides of each dimension).\n - `padding_mode` (StrAttr): \"zeros\" or \"replicate\" - padding fill strategy.\n - `groups` (i32): Number of blocked connections from input channels to output channels.\n\n Output:\n - `result` AnyRankedTensor: 5D tensor in format (N, D_out, H_out, W_out, C_out) where:\n - `D_out = (D_in + 2*pD - K_D) / sD + 1`\n - `H_out = (H_in + 2*pH - K_H) / sH + 1`\n - `W_out = (W_in + 2*pW - K_W) / sW + 1`", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "stride", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "groups", "type": "I32Attr" }, { "name": "batch_dim", "type": "DefaultValuedAttr" }, { "name": "depth_dim", "type": "DefaultValuedAttr" }, { "name": "height_dim", "type": "DefaultValuedAttr" }, { "name": "width_dim", "type": "DefaultValuedAttr" }, { "name": "channel_dim", "type": "DefaultValuedAttr" }, { "name": "padding_mode", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.cos", "summary": "Elementwise cosine operation.", "description": "The `cos` operation computes the cosine of each element in the input tensor.\n\n For each element, it returns the cosine of the angle in radians.\n\n Example:\n ```mlir\n // Compute cosine of all elements in %input\n %result = ttir.cos(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.9601, 0.5403, -0.9553, -0.1365], ... ]\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.cumprod", "summary": "Cumulative product operation.", "description": "The `cumprod` operation computes the cumulative product of elements along a specified dimension of the input tensor.\n\n For each position in the output tensor, this operation computes the product of all elements in the input tensor\n along the specified dimension up to and including that position. The shape of the output tensor matches\n the shape of the input tensor.\n\n Example:\n ```mlir\n // Cumulative product along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.cumprod(%input) {dim = 0 : i64} : (tensor<2x3xf32>) -> tensor<2x3xf32>\n // Input tensor:\n // [[2, 3, 4],\n // [5, 6, 7]]\n // Output tensor:\n // [[2, 3, 4], // first row remains the same\n // [10, 18, 28]] // each element is the product of the corresponding column up to this point\n\n // Cumulative product along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.cumprod(%input) {dim = 1 : i64} : (tensor<2x3xf32>) -> tensor<2x3xf32>\n // Input tensor:\n // [[2, 3, 4],\n // [5, 6, 7]]\n // Output tensor:\n // [[2, 6, 24], // each element is the product of the corresponding row up to this point\n // [5, 30, 210]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `dim` (Integer): The dimension along which to compute the cumulative product.\n\n Output:\n - `result` (Tensor): The tensor containing the cumulative products.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" } ] }, { "name": "ttir.cumsum", "summary": "Cumulative sum operation.", "description": "The `cumsum` operation computes the cumulative sum of elements along a specified dimension of the input tensor.\n\n For each position in the output tensor, this operation computes the sum of all elements in the input tensor\n along the specified dimension up to and including that position. The shape of the output tensor matches\n the shape of the input tensor.\n\n Example:\n ```mlir\n // Cumulative sum along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.cumsum(%input) {dim = 0 : i64} : (tensor<2x3xf32>) -> tensor<2x3xf32>\n // Input tensor:\n // [[1, 2, 3],\n // [4, 5, 6]]\n // Output tensor:\n // [[1, 2, 3], // first row remains the same\n // [5, 7, 9]] // each element is the sum of the corresponding column up to this point\n\n // Cumulative sum along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.cumsum(%input) {dim = 1 : i64} : (tensor<2x3xf32>) -> tensor<2x3xf32>\n // Input tensor:\n // [[1, 2, 3],\n // [4, 5, 6]]\n // Output tensor:\n // [[1, 3, 6], // each element is the sum of the corresponding row up to this point\n // [4, 9, 15]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `dim` (Integer): The dimension along which to compute the cumulative sum.\n\n Output:\n - `result` (Tensor): The tensor containing the cumulative sums.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" } ] }, { "name": "ttir.dealloc", "summary": "Dealloc op.", "description": "Tensor Dealloc operation", "operands": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.dequantize", "summary": "Dequantize operation.", "description": "The Dequantize operation converts a quantized tensor back into a floating-point tensor using the `quant.uniform` type from the MLIR Quant dialect.\n The input tensor is expected to be of type `quant.uniform.`\n The output tensor will be a floating-point tensor, where each element is computed as:\n ```\n output[i] = (input[i] - zero_point) * scale\n ```\n Example:\n ```mlir\n %input = ttir.empty() : () -> tensor<64x128x!quant.uniform>\n %dequantized = \"ttir.dequantize\"(%input) : (tensor<64x128x!quant.uniform>) -> tensor<64x128xf32>\n\n // In this example:\n // - The input is a 64x128 tensor of 32-bit quantized values\n // - The output is a 64x128 tensor of 32-bit floating-point values\n // - The scale is 0.1 (each step represents 0.1 in the original scale)\n // - The zero point is 128 (the value 128 in the quantized space represents 0.0 in the original space)\n ```\n\n Inputs:\n - `input` (Quantized Tensor): The quantized tensor to be dequantized.\n\n Results:\n - `result` (Tensor): The floating-point tensor after dequantization.\n\n Note: The quantization parameters (scale and zero point) are specified in the input tensor type.\n Dequantization is the reverse process of quantization, converting quantized values back to floating-point values.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.dequantize_unrolled", "summary": "Dequantize operation unrolled (scale and zero point as input operands).", "description": "The DequantizeUnrolledOp dequantizes a tensor using the scale and zero point provided as input operands.\n\n Inputs:\n - `input` AnyRankedTensor: The input tensor to be dequantized. Must have quantized element type.\n - `scale` AnyRankedTensor: The scale factor (or factors for per-axis quantization).\n - `zero_point` AnyRankedTensor: The zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `axis` Optional: The axis along which quantization is applied. Must be in range [0, rank) where rank is the rank of the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "zero_point", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ] }, { "name": "ttir.distributed_layer_norm", "summary": "Distributed layer normalization with all-gather operation", "description": "Fused distributed layer normalization across mesh devices. Each device\n computes local partial statistics (sum of x and sum of x²), the statistics are all-gathered along cluster_axis to obtain\n globally-correct mean and variance, and each device then normalizes its\n local shard. The steps are:\n 1. Optional residual addition: norm_input = input + residual\n 2. Compute local partial statistics and all-gather across cluster_axis\n 3. Layer normalization: output = (norm_input - mean) / sqrt(var + epsilon) * weight + bias\n\n Only statistics are communicated across devices — the input data itself\n is not all-gathered. Each device's output shape equals its input shape.\n\n This is a multi-device operation that requires the tensor to be sharded\n across a device mesh along the normalized (last) dimension.\n\n Decomposes in the TTNN dialect into:\n layer_norm_pre_all_gather → all_gather → layer_norm_post_all_gather.\n\n Inputs:\n - `input` (Tensor): The input tensor to be normalized.\n - `weight` (Optional Tensor): The scale parameter (gamma).\n - `bias` (Optional Tensor): The shift parameter (beta).\n - `residual` (Optional Tensor): Residual tensor for fused add before\n normalization.\n\n Attributes:\n - `cluster_axis` specifies which mesh dimension to all-gather the\n statistics across (0 or 1).\n - `epsilon` is a small constant added for numerical stability\n (default: 1e-05).\n\n Output:\n - `result` (Tensor): The normalized output tensor (same shape as input).", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" }, { "name": "residual", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.distributed_rms_norm", "summary": "Distributed RMS normalization with all-gather operation", "description": "Fused distributed RMS normalization across mesh devices. Each device\n computes local RMS statistics (E(x²)), the statistics are all-gathered\n along cluster_axis to obtain globally-correct values, and each device\n then normalizes its local shard. The steps are:\n 1. Optional residual addition (input + residual)\n 2. Compute local E(x²) and all-gather statistics across cluster_axis\n 3. RMS normalization: output = input * rsqrt(E(x²) + epsilon) * weight\n\n Only statistics are communicated across devices — the input data itself\n is not all-gathered. Each device's output shape equals its input shape.\n\n This is a multi-device operation that requires the tensor to be sharded\n across a device mesh.\n\n Inputs:\n - `input` (Tensor): The input tensor to be normalized.\n - `weight` (Optional Tensor): The scale parameter (gamma).\n - `residual` (Optional Tensor): Residual tensor for fused add before\n normalization.\n\n Attributes:\n - `cluster_axis` specifies which mesh dimension to all-gather the\n statistics across (0 or 1).\n - `epsilon` is a small constant added for numerical stability\n (default: 1e-05).\n\n Output:\n - `result` (Tensor): The normalized output tensor (same shape as input).", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "residual", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.div", "summary": "Elementwise division operation.", "description": "The `div` operation performs an elementwise division between two tensors.\n\n For each pair of corresponding elements, it divides the element in the first tensor (dividend) by\n the element in the second tensor (divisor) and places the result in the output tensor.\n\n Example:\n ```mlir\n // Division operation\n %result = ttir.div(%lhs, %rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi32>\n // Input tensors:\n // %lhs: [10, 20, 20]\n // %rhs: [1, 2, 3]\n // Output tensor:\n // [10, 10, 6]\n\n // Example with floating point values\n %result = ttir.div(%float_lhs, %float_rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %float_lhs: [3.5, 0.0, -1.2]\n // %float_rhs: [1.5, 2.0, -3.2]\n // Output tensor:\n // [2.333333333, 0.0, -0.375]\n ```\n\n Note: Division by zero typically results in undefined behavior or NaN for floating-point types.\n\n Mathematical definition: div(x, y) = x / y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.dot_general", "summary": "Dot general operation.", "description": "Flexible tensor operation that generalizes matrix multiplication by allowing user to specify which\n dimensions of two tensors to contract. Matrix multiplication is a special case of this operation,\n where the contraction happens along the last axis of the first tensor and the second-to-last axis of the second tensor.\n From StableHLO DotGeneral Op https://openxla.org/stablehlo/spec#dot_general", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_dims_lhs", "type": "DenseI64ArrayAttr" }, { "name": "contract_dims_lhs", "type": "DenseI64ArrayAttr" }, { "name": "batch_dims_rhs", "type": "DenseI64ArrayAttr" }, { "name": "contract_dims_rhs", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.dropout", "summary": "Dropout operation.", "description": "Applies dropout to the input tensor element-wise.\n\n During training, randomly zeroes some elements of the input tensor with\n probability `prob` using samples from a Bernoulli distribution. The\n remaining elements are scaled by `scale` (typically 1/(1-prob)) to maintain\n the expected sum.\n\n Example:\n %result = \"ttir.dropout\"(%input) <{prob = 0.2 : f32, scale = 1.25 : f32, seed = 42 : ui32}> : (tensor<64x128xbf16>) -> tensor<64x128xbf16>\n\n Attributes:\n - `prob` (Float): Dropout probability. Elements are zeroed with this probability [Default: 0.0].\n - `scale` (Float): Scale factor applied to non-zeroed elements. Typically 1/(1-prob) [Default: 1.0].\n - `seed` (Integer): Seed for the random number generator [Default: 0].\n - `use_per_device_seed` (Bool): Whether to use a different seed per device [Default: true].\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Output:\n - `result` (Tensor): The output tensor with dropout applied.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "prob", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "DefaultValuedAttr" }, { "name": "use_per_device_seed", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.embedding", "summary": "Embedding lookup operation.", "description": "The `embedding` operation performs a lookup in an embedding table (weight matrix) using integer indices.\n\n This operation takes an input tensor of indices and a weight tensor representing the embedding table.\n For each index in the input tensor, it retrieves the corresponding row from the weight tensor.\n The result is a tensor where each input index is replaced by its corresponding embedding vector.\n\n Example:\n ```mlir\n // Embedding lookup\n %input = ... : tensor<2x3xi32> // Batch of indices\n %weight = ... : tensor<10x4xf32> // Embedding table with 10 entries of dimension 4\n %result = ttir.embedding(%input, %weight) : (tensor<2x3xi32>, tensor<10x4xf32>) -> tensor<2x3x4xf32>\n\n // Input tensor (indices):\n // [[0, 2, 5],\n // [7, 1, 9]]\n\n // Weight tensor (embedding table):\n // [[0.1, 0.2, 0.3, 0.4], // embedding vector for index 0\n // [0.5, 0.6, 0.7, 0.8], // embedding vector for index 1\n // [0.9, 1.0, 1.1, 1.2], // embedding vector for index 2\n // ...\n // [1.7, 1.8, 1.9, 2.0]] // embedding vector for index 9\n\n // Output tensor:\n // [[[0.1, 0.2, 0.3, 0.4], // embedding for index 0\n // [0.9, 1.0, 1.1, 1.2], // embedding for index 2\n // [...]], // embedding for index 5\n // [[...], // embedding for index 7\n // [0.5, 0.6, 0.7, 0.8], // embedding for index 1\n // [...]]] // embedding for index 9\n ```\n\n Note: The indices in the input tensor must be valid indices into the first dimension of the weight tensor.\n\n Inputs:\n - `input` (Tensor): The input tensor containing indices.\n - `weight` (Tensor): The embedding table tensor.\n\n Output:\n - `result` (Tensor): The resulting tensor containing the embeddings.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.embedding_backward", "summary": "Embedding backward operation.", "description": "The `embedding_backward` operation computes the gradient of the embedding operation with respect to the weight tensor.\n\n This operation takes an input tensor of indices, the original weight tensor, and the gradient tensor from previous backpropagation steps.\n It computes how the embedding weights should be updated during backpropagation by accumulating gradients at the appropriate\n indices in the weight tensor.\n\n Example:\n ```mlir\n // Embedding backward\n %input = ... : tensor<2x3xi32> // Original indices used in the forward pass\n %weight = ... : tensor<10x4xf32> // Original embedding table\n %in_gradient = ... : tensor<2x3x4xf32> // Gradient from previous backpropagation steps\n %result = ttir.embedding_backward(%input, %weight, %in_gradient) :\n (tensor<2x3xi32>, tensor<10x4xf32>, tensor<2x3x4xf32>) -> tensor<10x4xf32>\n\n // Input tensor (indices):\n // [[0, 2, 5],\n // [7, 1, 9]]\n\n // Input gradient tensor (from previous backpropagation steps):\n // [[[0.1, 0.2, 0.3, 0.4], // gradient for embedding of index 0\n // [0.5, 0.6, 0.7, 0.8], // gradient for embedding of index 2\n // [...]], // gradient for embedding of index 5\n // [[...], // gradient for embedding of index 7\n // [0.9, 1.0, 1.1, 1.2], // gradient for embedding of index 1\n // [...]]] // gradient for embedding of index 9\n\n // Output tensor (gradient for the embedding table):\n // The gradients are accumulated at the corresponding indices in the weight tensor.\n // For example, at index 0, the gradient is [0.1, 0.2, 0.3, 0.4]\n ```\n\n Note: If the same index appears multiple times in the input tensor, the gradients are accumulated (added) at that index in the output tensor.\n\n Inputs:\n - `input` (Tensor): The original input tensor containing indices used in the forward pass.\n - `weight` (Tensor): The original embedding table tensor.\n - `in_gradient` (Tensor): The gradient tensor from the forward pass.\n\n Output:\n - `result` (Tensor): The gradient tensor for the embedding table.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "in_gradient", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.empty", "summary": "Empty tensor allocation operation.", "description": "The `empty` operation creates an uninitialized tensor with the specified shape and element type.\n\n This operation allocates memory for a tensor but does not initialize its values. It's commonly used\n as a first step before filling the tensor with computed values. The shape and element type of the\n tensor are determined by the return type.\n\n Example:\n ```mlir\n // Create an uninitialized 2D tensor with shape [3, 4]\n %result = ttir.empty() : tensor<3x4xf32>\n\n // Create an uninitialized 3D tensor with shape [2, 3, 4]\n %result = ttir.empty() : tensor<2x3x4xi32>\n\n // Use empty to create a tensor for storing computation results\n %input = ... : tensor<10x20xf32>\n %result = ttir.some_computation(%input) : (tensor<10x20xf32>) -> tensor<10x20xf32>\n ```\n\n Output:\n - `result` (Tensor): The uninitialized tensor.\n\n Note: Since the tensor is uninitialized, reading from it before writing may yield undefined values.\n This operation is typically used in conjunction with other operations that will fill the tensor with\n meaningful values. The `empty` operation is more efficient than `zeros` or `ones` when the tensor\n will be completely overwritten, as it avoids the initialization step.", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "assemblyFormat": "`(` `)` attr-dict `:` type($result)" }, { "name": "ttir.eq", "summary": "Elementwise equality comparison operation.", "description": "The `eq` operation performs an elementwise equality comparison between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if the elements are equal\n - 0 (false) if the elements are not equal\n\n Note that special handling may be required for floating-point NaN values, as NaN is not\n equal to any value, including itself.\n\n Example:\n ```mlir\n // Compare elements for equality\n %result = ttir.eq(%lhs, %rhs) : (tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1.0, 2.0, 3.0, 2.0], ... ]\n // %rhs: [[1.0, 2.0, 4.0, 5.0], ... ]\n // Output tensor:\n // [[1, 1, 0, 0], ... ] // 1 where equal, 0 where not equal\n\n // Example with integer tensors\n %result = ttir.eq(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, -5, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [1, 0, 0] // Only the first elements are equal\n ```\n\n Mathematical definition: equal(x, y) = x == y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.erf", "summary": "Element-wise error function operation.", "description": "Element-wise error function (erf) operation. Calculates erf(x) for each element of the input tensor.\n\n Example:\n ```mlir\n // Compute error function for all elements in %input\n %result = ttir.erf(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor with values [0.0, 1.0, -1.0, 2.0]\n // Output tensor with values [0.0, 0.8427, -0.8427, 0.9953]\n ```\n\n Mathematical definition: erf(x) = (2/√π) ∫₀ˣ e^(-t²) dt", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.erfc", "summary": "Element-wise complementary error function operation.", "description": "Element-wise complementary error function (erfc) operation. Calculates erfc(x) = 1 - erf(x) for each element of the input tensor.\n\n Example:\n ```mlir\n // Compute complementary error function for all elements in %input\n %result = ttir.erfc(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor with values [0.0, 1.0, -1.0, 2.0]\n // Output tensor with values [1.0, 0.1573, 1.8427, 0.0047]\n ```\n\n Mathematical definition: erfc(x) = 1 - erf(x) = 1 - (2/√π) ∫ₓ^∞ e^(-t²) dt", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.exp", "summary": "Elementwise exponential op.", "description": "The `exp` operation computes the exponential of each element in the input tensor.\n\n For each element, it returns e^x, where e is the base of natural logarithms (approximately 2.71828).\n\n Example:\n ```mlir\n // Compute exponential of all elements in %input\n %result = ttir.exp(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.0, 2.0, -3.0, 4.0], ... ]\n // Output tensor:\n // [[2.71828, 7.389056, 0.090031, 54.59815], ... ]\n ```\n\n Mathematical definition: exp(x) = e^x", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.exp2", "summary": "Elementwise base-2 exponential.", "description": "For each element x, returns 2^x.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.expm1", "summary": "Elementwise exponential minus one operation.", "description": "The `expm1` operation computes the exponential of each element in the input tensor and subtracts one.\n\n For each element x, it returns e^x - 1. This operation is more accurate than computing\n exp(x) - 1 directly for x values close to zero, where catastrophic cancellation can occur\n in the subtraction.\n\n Example:\n ```mlir\n // Compute expm1 of all elements in %input\n %result = ttir.expm1(%input) : (tensor<2x2xf32>) -> tensor<2x2xf32>\n // Input tensor:\n // [[0.0, 1.0],\n // [0.0, 0.0]]\n // Output tensor:\n // [[0.0, 1.71828],\n // [0.0, 0.0]]\n\n // Example with small values where expm1 is more accurate than exp(x)-1\n %result = ttir.expm1(%small_input) : (tensor<3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [1e-10, 1e-7, 1e-5]\n // Output tensor:\n // [1e-10, 1e-7, 1e-5] // Approximately equal to the input for very small values\n ```\n\n Mathematical definition: expm1(x) = e^x - 1", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.fill_cache", "summary": "Cache filling operation.", "description": "The `fill_cache` operation fills a cache tensor with values from an input tensor.\n\n Unlike `update_cache` which updates specific positions, this operation fills the entire cache\n or a contiguous section of it with values from the input tensor. This is commonly used to\n initialize a cache in sequence models.\n\n Example:\n ```mlir\n // Fill cache with input values\n %cache = ... : tensor<2x16x64xf32> // Batch size 2, sequence length 16, hidden dim 64\n %input = ... : tensor<2x16x64xf32> // Initial values for the entire cache\n %result = ttir.fill_cache(%cache, %input) {batch_offset = 0 : i32} :\n tensor<2x16x64xf32>, tensor<2x16x64xf32> -> tensor<2x16x64xf32>\n // The entire cache tensor is filled with values from input\n\n // Fill a portion of the cache\n %cache = ... : tensor<2x16x64xf32> // Batch size 2, sequence length 16, hidden dim 64\n %input = ... : tensor<2x8x64xf32> // Values for half of the cache\n %result = ttir.fill_cache(%cache, %input) {batch_offset = 0 : i32} :\n tensor<2x16x64xf32>, tensor<2x8x64xf32> -> tensor<2x16x64xf32>\n // The first 8 positions of the cache are filled with values from input\n ```\n\n Inputs:\n - `cache` (Tensor): The cache tensor to be filled.\n - `input` (Tensor): The input tensor containing the values to fill the cache with.\n\n Attributes:\n - `batch_offset` (Integer): Offset in the batch dimension.\n\n Output:\n - `result` (Tensor): The filled cache tensor.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_offset", "type": "I32Attr" } ] }, { "name": "ttir.floor", "summary": "Elementwise floor operation.", "description": "The `floor` operation computes the floor (greatest integer less than or equal to x)\n of each element in the input tensor.\n\n For each element, it rounds the value down to the nearest integer. The operation preserves\n the data type of the input.\n\n This operation has the idempotence property, meaning that applying it multiple times\n produces the same result as applying it once: floor(floor(x)) = floor(x).\n\n Example:\n ```mlir\n // Compute floor of all elements in %input\n %result = ttir.floor(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[1.0, 2.0, -1.0, 4.0], ... ]\n ```\n\n Mathematical definition: floor(x) = ⌊x⌋ = max{n ∈ ℤ | n ≤ x}", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.frac", "summary": "Elementwise fractional part operation.", "description": "For each element x, returns the fractional part x - trunc(x), matching common\n floating-point library semantics.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.full", "summary": "Creates a tensor filled with the specified value", "description": "Tensor operation to create a tensor filled with a specified value.\n\n Given a `shape` and a `fill_value`, produces a tensor with the shape, filled with the specified value.\n\n Example:\n %0 = \"ttir.full\"() <{shape = array, fill_value = 7 : i32}> : () -> tensor<64x32x32xi32>\n // %0: [[[7, 7, 7, ..., 7], [7, 7, 7, ..., 7], ..., [7, 7, 7, ..., 7]]]", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "DenseI32ArrayAttr" }, { "name": "fill_value", "type": "AnyAttrOf<[F32Attr, I32Attr]>" } ] }, { "name": "ttir.gather", "summary": "Gather operation along a single dimension", "description": "The `gather` operation gathers values from an input tensor along a\n given dimension using an index tensor. This corresponds to torch.gather\n semantics and maps directly to the tt-metal `ttnn::gather` device op.\n\n Parameters:\n - `input` (Tensor): The source tensor to gather from.\n - `index` (Tensor): Indices specifying which values to gather.\n - `dim` (int32_t): The dimension along which to gather.\n\n Example:\n ```mlir\n %result = \"ttir.gather\"(%input, %index)\n <{dim = 0 : i32}> : (tensor<4x4xbf16>, tensor<2x4xi32>) -> tensor<2x4xbf16>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "index", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I32Attr" } ] }, { "name": "ttir.gather_dim", "summary": "Gather operation along a single dimension", "description": "The `gather_dim` operation gathers values from an input tensor along a\n given dimension using an index tensor. This corresponds to torch.gather\n semantics and maps directly to the tt-metal `ttnn::gather` device op.\n\n This is distinct from the StableHLO-style `gather` op which has complex\n multi-dimensional semantics.\n\n Parameters:\n - `input` (Tensor): The source tensor to gather from.\n - `index` (Tensor): Indices specifying which values to gather.\n - `dim` (int32_t): The dimension along which to gather.\n\n Example:\n ```mlir\n %result = \"ttir.gather_dim\"(%input, %index)\n <{dim = 0 : i32}> : (tensor<4x4xbf16>, tensor<2x4xi32>) -> tensor<2x4xbf16>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "index", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I32Attr" } ] }, { "name": "ttir.ge", "summary": "Elementwise greater than or equal to.", "description": "The `ge` operation performs an elementwise greater than or equal to comparison between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if the left element is greater than or equal to the right element\n - 0 (false) if the left element is less than the right element\n\n Example:\n ```mlir\n // Compare elements for greater than or equal to\n %result = ttir.ge(%lhs, %rhs) : (tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1.0, 2.0, 3.0, 2.0], ... ]\n // %rhs: [[1.0, 2.0, 4.0, 5.0], ... ]\n // Output tensor:\n // [[1, 1, 0, 0], ... ] // 1 where greater or equal, 0 where less\n\n // Example with integer tensors\n %result = ttir.ge(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, -5, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [1, 0, 0] // Only the first elements are greater or equal\n ```\n\n Mathematical definition: greater_equal(x, y) = x >= y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.gelu", "summary": "Elementwise GELU operation.", "description": "The `gelu` operation computes the GELU (Gaussian Error Linear Unit) of each element in the input tensor.\n\n For each element, it returns the GELU value, which is a smooth, non-monotonic function that approximates the\n cumulative distribution function of a standard normal distribution. The operation preserves the data type of the\n input.\n\n Example:\n ```mlir\n // Compute GELU of all elements in %input\n %result = ttir.gelu(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.9601, 0.5403, -0.3, 4.5], ... ]\n ```\n\n Mathematical definition: gelu(x) = 0.5 * x * (1 + erf(x / sqrt(2)))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.gelu_bw", "summary": "Backward pass operation for the GELU activation function.", "description": "The `gelu_bw` operation computes the gradient of the GELU (Gaussian Error Linear Unit)\n activation function with respect to its input during backpropagation. This is an elementwise\n binary operation that multiplies the incoming gradient with the derivative of GELU.\n\n Inputs:\n - `lhs` (Tensor): The gradient tensor flowing back from the loss (grad_output).\n - `rhs` (Tensor): The original input tensor that was fed to the forward GELU operation.\n\n Attributes:\n - `approximate` (string): The GELU approximation algorithm to use. Can be \"none\" (exact)\n or \"tanh\" (tanh approximation). Defaults to \"none\".\n\n Output:\n - `result` (Tensor): The gradient with respect to the input tensor.\n\n Example:\n ```mlir\n // Compute GELU backward pass\n %result = ttir.gelu_bw(%grad, %input) :\n (tensor<4x4xf32>, tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xf32>\n\n // With tanh approximation\n %result = ttir.gelu_bw(%grad, %input) {approximate = \"tanh\"} :\n (tensor<4x4xf32>, tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xf32>\n ```\n\n Mathematical definition (approximate = \"none\"):\n gelu_bw(grad, x) = grad * (cdf(x) + x * pdf(x))\n where cdf is the cumulative distribution function and pdf is the probability density\n function of the standard normal distribution.\n\n Mathematical definition (approximate = \"tanh\"):\n gelu_bw(grad, x) = grad * d/dx[0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "approximate", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.get_dimension_size", "summary": "GetDimensionSize op.", "description": "Produces the size of the given `dimension` of the `operand`.\n\n Example:\n %operand: [[3, 2, 7], [1, 4, 4]]\n \"ttir.get_dimension_size\"(%operand, value = dense<0>, %out) -> %out: [[3]]", "operands": [ { "name": "operand", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dimension", "type": "I32Attr" } ] }, { "name": "ttir.global_avg_pool2d", "summary": "A global average pooling 2d operation", "description": "The `global_avg_pool2d` operation applies global average pooling over the spatial dimensions\n (height and width) of a 4D input tensor. In essence, it should be realised as the sum-reduce style operation\n under the hood, for performance reasons (since we include all elements, there is no need for kernel allocation).\n It reduces spatial dimensions to 1.\n\n This operation yields the same result as the standard avg_pool_2d operation when kernel_size == [input_height, input_width].\n However, it is much more memory efficient, as the underlying implementation doesn't need to allocate\n the kernel for pooling (since the operation boils down to a simple sum-reduce).\n\n Example:\n ```mlir\n // Basic global average pooling reducing 32x32 spatial dimensions to 1x1\n %input = ... : tensor<1x32x32x64xbf16> // Input tensor with values in NHWC format\n // N=1 (batch), H=32 (height), W=32 (width), C=64 (channels)\n %result = \"ttir.global_avg_pool2d\"(%input) : (tensor<1x32x32x64xbf16>) -> tensor<1x1x1x64xbf16>\n // Result: tensor<1x1x1x64xbf16> where each channel contains the average of all 32*32=1024 spatial locations\n\n // Example with different input sizes\n %large_input = ... : tensor<1x128x128x32xbf16> // Large spatial dimensions\n %large_result = \"ttir.global_avg_pool2d\"(%large_input) : (tensor<1x128x128x32xbf16>) -> tensor<1x1x1x32xbf16>\n // Each output channel averages across 128*128=16384 spatial locations\n ```\n\n Inputs:\n - `input`: 4D tensor with shape [N, H, W, C] where N is batch size, H is height, W is width, and C is channels\n - `output`: Pre-allocated output tensor with shape [N, 1, 1, C] to store the result\n\n Attributes:\n - None (this operation has no configurable attributes, unlike regular pooling operations)\n\n Outputs:\n - `result`: 4D tensor with shape [N, 1, 1, C] containing the global average pooled values\n\n Note: The operation reduces spatial dimensions (H, W) to (1, 1) by computing the average across\n all spatial locations for each channel independently. This is equivalent to avg_pool2d with\n kernel_size=[H, W], stride=[1, 1], and no padding, but implemented more efficiently.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.group_norm", "summary": "Group normalization operation", "description": "Computes group normalization over the input tensor. The input tensor's channels\n are split into groups, and mean and variance are computed per group. The result\n is normalized by subtracting the mean and dividing by the standard deviation,\n then optionally scaled and shifted by weight (gamma) and bias (beta).\n\n Input tensor must be at least 4D. Common shapes include [N, C, H, W] (4D) and\n [N, C, D, H, W] (5D for 3D convolutions). During TTIR-to-TTNN conversion, inputs\n are permuted and reshaped to [N, 1, H*W, C] based on the channel_dim attribute.\n\n Inputs:\n - `input` (Tensor): The input tensor to be normalized (at least 4D).\n - `input_mask` (Optional Tensor): When processing the inputs, the mask is used to\n only look at the elements of the current group. Defaults to None.\n - `weight` (Optional Tensor): The scale parameter (gamma). If provided, the\n normalized result is element-wise multiplied by this weight.\n - `bias` (Optional Tensor): The shift parameter (beta). If provided, this bias\n is added to the scaled result.\n\n Attributes:\n - `num_groups` (int): Number of groups to split the tensor's channels into.\n C must divide evenly into num_groups.\n - `epsilon`: Small constant added for numerical stability (default: 1e-12).\n - `channel_dim` (int): The index of the channel dimension in the input\n tensor. Default is 3 (channels-last / NHWC). Set to 1 for NCHW layout.\n During TTIR-to-TTNN conversion, the input is permuted and reshaped to\n [N, 1, H*W, C] based on this attribute.\n\n Output:\n - `result` (Tensor): The group normalized output tensor.\n\n Example:\n ```mlir\n // Group norm with 8 groups, input shape [1, 1, 64, 480]\n %result = ttir.group_norm(%input, %input_mask, %weight, %bias) : <{ num_groups = 8, epsilon = 1e-12 }> :\n (tensor<1x1x64x480xf32>, tensor<1x8x32x32xf32>, tensor<1x1x15x32xf32>, tensor<1x1x15x32xf32>) -> tensor<1x1x64x480xf32>\n ```\n\n Mathematical definition: group_norm(x, weight, bias, epsilon) =\n ((x - mu) / sqrt(sigma^2 + epsilon)) * weight + bias\n where mu and sigma^2 are the mean and variance computed per group.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "input_mask", "type": "Optional" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_groups", "type": "I64Attr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "channel_dim", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.gt", "summary": "Elementwise greater than.", "description": "The `gt` operation performs an elementwise greater than comparison between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if the left element is greater than the right element\n - 0 (false) if the left element is less than or equal to the right element\n\n Example:\n ```mlir\n // Compare elements for greater than\n %result = ttir.gt(%lhs, %rhs) : (tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1.0, 2.0, 3.0, 2.0], ... ]\n // %rhs: [[1.0, 2.0, 4.0, 5.0], ... ]\n // Output tensor:\n // [[0, 0, 0, 1], ... ] // 1 where greater, 0 where less or equal\n\n // Example with integer tensors\n %result = ttir.gt(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, -5, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [0, 0, 0] // Only the last element is greater\n ```\n\n Mathematical definition: greater_than(x, y) = x > y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.hardsigmoid", "summary": "Elementwise hard sigmoid operation.", "description": "The `hardsigmoid` operation computes the hard sigmoid activation function of each element in the input tensor.\n\n The hard sigmoid function is a piecewise linear approximation of the sigmoid function that is computationally\n more efficient. It is defined as:\n - 0 if x <= -3\n - (x + 3) / 6 if -3 < x < 3\n - 1 if x >= 3\n\n This activation function is commonly used in neural networks as a computationally efficient alternative to\n the standard sigmoid function, particularly in mobile and embedded applications where computational resources\n are limited.\n\n Example:\n ```mlir\n // Compute hard sigmoid of all elements in %input\n %result = ttir.hardsigmoid(%input, %output) : tensor<4x4xf32>, tensor<4x4xf32> -> tensor<4x4xf32>\n // Input tensor:\n // [-3.0, -1.0, 0.0, 3.0]\n // Output tensor:\n // [0.0, 0.333, 0.5, 1.0]\n ```\n\n Mathematical definition: hardsigmoid(x) = max(0, min(1, (x + 3) / 6))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.index", "summary": "Tensor indexing operation.", "description": "The `index` operation extracts a sub-tensor (slice) from the input tensor along a specified dimension.\n\n This operation selects elements from the input tensor along a single dimension based on the specified\n begin, end, and step indices. It's similar to Python's slicing notation `tensor[:, begin:end:step, :]`\n where the slicing is applied only to the specified dimension.\n\n Example:\n ```mlir\n // Extract elements with indices 1, 3, 5 from dimension 0 of a 1D tensor\n %input = ... : tensor<6xf32> // Input tensor with values: [1, 2, 3, 4, 5, 6]\n %result = ttir.index(%input) {\n dim = 0 : i32, // Dimension to index\n begin = 1 : i32, // Start index\n end = 6 : i32, // End index (exclusive)\n step = 2 : i32 // Step size\n } : (tensor<6xf32>) -> tensor<3xf32>\n // Result: [2, 4, 6]\n\n // Extract columns 0 and 2 from a 2D tensor\n %input = ... : tensor<3x4xf32> // Input tensor with values:\n // [[1, 2, 3, 4],\n // [5, 6, 7, 8],\n // [9, 10, 11, 12]]\n %result = ttir.index(%input) {\n dim = 1 : i32, // Index along columns (dimension 1)\n begin = 0 : i32, // Start from first column\n end = 3 : i32, // End at third column (exclusive)\n step = 2 : i32 // Take every other column\n } : (tensor<3x4xf32>) -> tensor<3x2xf32>\n // Result:\n // [[1, 3],\n // [5, 7],\n // [9, 11]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to index.\n\n Attributes:\n - `dim` (Integer): The dimension along which to index.\n - `begin` (Integer): The starting index.\n - `end` (Integer): The ending index (exclusive).\n - `step` (Integer): The step size between indices.\n\n Output:\n - `result` (Tensor): The indexed tensor.\n\n Note: The shape of the output tensor is the same as the input tensor except for the indexed dimension,\n which will have size `ceil((end - begin) / step)`. The indices selected will be `begin`, `begin + step`,\n `begin + 2*step`, etc., up to but not including `end`.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I32Attr" }, { "name": "begin", "type": "I32Attr" }, { "name": "end", "type": "I32Attr" }, { "name": "step", "type": "I32Attr" } ] }, { "name": "ttir.index_select", "summary": "Tensor selection operation.", "description": "The `index_select` operation extracts a sub-tensor (slice) from the input tensor along a specified dimension.\n\n Unlike the more general `slice` operation, `index_select` operates on a single dimension with a specified\n starting index, length, and optional stride. This is useful for extracting specific segments of a tensor\n along a particular axis.\n\n Example:\n ```mlir\n // Select elements 2, 3, 4 from a 1D tensor along dimension 0\n %input = ... : tensor<6xf32> // Input tensor with values: [1, 2, 3, 4, 5, 6]\n %result = ttir.index_select(%input) {\n dim = 0 : i32, // Dimension to select from\n begin = 2 : i32, // Start index\n length = 3 : i32, // Number of elements to select\n stride = 0 : i32 // No stride (consecutive elements)\n } : (tensor<6xf32>) -> tensor<3xf32>\n // Result: [3, 4, 5]\n\n // Select every other row from a 2D tensor\n %input = ... : tensor<4x3xf32> // Input tensor with values:\n // [[1, 2, 3],\n // [4, 5, 6],\n // [7, 8, 9],\n // [10, 11, 12]]\n %result = ttir.index_select(%input) {\n dim = 0 : i32, // Select along rows\n begin = 0 : i32, // Start from the first row\n length = 2 : i32, // Select 2 rows\n stride = 2 : i32 // Select every other row\n } : (tensor<4x3xf32>) -> tensor<2x3xf32>\n // Result:\n // [[1, 2, 3],\n // [7, 8, 9]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to select from.\n\n Attributes:\n - `dim` (Integer): The dimension along which to select elements.\n - `begin` (Integer): The starting index for selection.\n - `length` (Integer): The number of elements to select.\n - `stride` (Integer, default=0): The step size for selection. A value of 0 means no stride (consecutive elements).\n\n Output:\n - `result` (Tensor): The selected tensor.\n\n Note: The shape of the output tensor is the same as the input tensor except for the selected dimension,\n which will have size `length`. If `stride` is non-zero, the elements selected will be at indices\n `begin`, `begin + stride`, `begin + 2*stride`, etc., up to `length` elements.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" }, { "name": "begin", "type": "SI32Attr" }, { "name": "length", "type": "SI32Attr" }, { "name": "stride", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "ttir.isfinite", "summary": "Elementwise isfinite operation.", "description": "The `isfinite` operation checks if each element in the input tensor is finite (neither infinite nor NaN).\n\n For each element, it returns a boolean value indicating whether the element is finite.\n\n Example:\n ```mlir\n // Check if all elements in %input are finite\n %result = ttir.isfinite(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, Inf, 4.5], ... ]\n // Output tensor:\n // [[true, true, false, true], ... ]\n ```\n\n Mathematical definition: isfinite(x) = x ∈ ℝ", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.layer_norm", "summary": "Layer normalization operation", "description": "Performs layer normalization on the input tensor. This operation normalizes\n the input tensor by computing the mean and variance of elements across\n the specified dimensions, then normalizes by subtracting the mean and\n dividing by the standard deviation, optionally scaling and shifting the result.\n\n Inputs:\n - `input` (Tensor): The input tensor to be normalized.\n - `weight` (Optional Tensor): The scale parameter (gamma). If provided, the normalized\n result is element-wise multiplied by this weight.\n - `bias` (Optional Tensor): The shift parameter (beta). If provided, this bias is\n added to the scaled result.\n\n Attributes:\n - `normalized_shape` specifies the dimensions over which to normalize. Typically\n the last few dimensions of the input tensor.\n - `epsilon` is a small constant added for numerical stability (default: 1e-05).\n\n Output:\n - `result` (Tensor): The layer normalized output tensor.\n\n Example:\n ```mlir\n // Layer normalization over last dimension (shape: [2, 4, 8] -> normalize over [8])\n %result = ttir.layer_norm(%input, %weight, %bias) : <{ normalized_shape = [8], epsilon = 1e-05 }> :\n (tensor<2x4x8xf32>, tensor<2x4x8xf32>, tensor<8xf32>) -> tensor<2x4x8xf32>\n\n // Layer normalization over last two dimensions (shape: [2, 4, 8] -> normalize over [4, 8])\n %result = ttir.layer_norm(%input, %weight, %bias) : <{ normalized_shape = [4, 8], epsilon = 1e-05 }> :\n (tensor<2x4x8xf32>, tensor<2x4x8xf32>, tensor<4x8xf32>) -> tensor<2x4x8xf32>\n ```\n\n Mathematical definition: layer_norm(x, weight, bias, epsilon) =\n ((x - mean(x, dims=normalized_dims)) / sqrt(var(x, dims=normalized_dims) + epsilon)) * weight + bias", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "normalized_shape", "type": "DenseI64ArrayAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.le", "summary": "Elementwise less than or equal to.", "description": "The `le` operation performs an elementwise less than or equal to comparison between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if the left element is less than or equal to the right element\n - 0 (false) if the left element is greater than the right element\n\n Example:\n ```mlir\n // Compare elements for less than or equal to\n %result = ttir.le(%lhs, %rhs) : (tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1.0, 2.0, 3.0, 2.0], ... ]\n // %rhs: [[1.0, 2.0, 4.0, 5.0], ... ]\n // Output tensor:\n // [[1, 1, 1, 0], ... ] // 1 where less or equal, 0 where greater\n\n // Example with integer tensors\n %result = ttir.le(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, -5, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [1, 1, 1] // All elements are less or equal\n ```\n\n Mathematical definition: less_equal(x, y) = x <= y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.leaky_relu", "summary": "Eltwise leaky relu operation.", "description": "The Leaky ReLU (Rectified Linear Unit) operation computes an element-wise\n activation function over its input tensor. It is defined as:\n\n y = x if x > 0\n y = parameter * x if x <= 0\n\n where `parameter` is a small, user-defined constant that determines the slope for\n negative inputs.\n\n Inputs:\n - `input` (Tensor): The input tensor to be activated.\n\n Output:\n - `result` (Tensor): The tensor after applying the Leaky ReLU activation.\n\n Attributes:\n - `parameter` (float): The slope for negative values.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "parameter", "type": "F32Attr" } ] }, { "name": "ttir.linear", "summary": "Linear transformation operation.", "description": "The `linear` operation performs a linear transformation by computing the matrix multiplication\n of tensors `a` and `b` with an optional addition of a `bias` tensor.\n\n This operation is commonly used in neural networks to implement fully connected layers. It computes\n the matrix multiplication of the input tensor with a weight tensor and adds an optional bias.\n\n Example:\n ```mlir\n // Linear transformation with bias\n %a = ... : tensor<10x64x32xbf16> // Input tensor: batch_size=10, sequence_length=64, input_dim=32\n %b = ... : tensor<32x128xbf16> // Weight tensor: input_dim=32, output_dim=128\n %bias = ... : tensor<128xbf16> // Bias tensor: output_dim=128\n %result = ttir.linear(%a, %b, %bias) :\n (tensor<10x64x32xbf16>, tensor<32x128xbf16>, tensor<128xbf16>) -> tensor<10x64x128xbf16>\n\n // Linear transformation without bias\n %a = ... : tensor<10x64x32xf32> // Input tensor\n %b = ... : tensor<32x128xf32> // Weight tensor\n %result = ttir.linear(%a, %b) :\n (tensor<10x64x32xf32>, tensor<32x128xf32>) -> tensor<10x64x128xf32>\n ```\n\n Inputs:\n - `a` (Tensor): The input tensor.\n - `b` (Tensor): The weight tensor.\n - `bias` (Optional Tensor): The bias tensor to add to the result of the matrix multiplication.\n\n Attributes:\n - `transpose_a` (Boolean, default=false): Whether to transpose tensor `a` before multiplication.\n - `transpose_b` (Boolean, default=false): Whether to transpose tensor `b` before multiplication.\n\n Output:\n - `result` (Tensor): The result of the linear transformation.\n\n The operation computes: result = matmul(a, b) + bias\n\n Note: The shapes of the tensors must be compatible for matrix multiplication. For a 3D input tensor\n with shape [batch_size, sequence_length, input_dim], the weight tensor should have shape [input_dim, output_dim],\n and the bias tensor should have shape [output_dim]. The resulting tensor will have shape\n [batch_size, sequence_length, output_dim].", "operands": [ { "name": "a", "type": "AnyRankedTensor" }, { "name": "b", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedAttr" }, { "name": "transpose_b", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.log", "summary": "Elementwise natural logarithm operation.", "description": "The `log` operation computes the natural logarithm of each element in the input tensor.\n\n For each element, it returns the natural logarithm (base e) of the value. This operation\n is defined only for positive values; the behavior for zero or negative inputs\n depends on the implementation (may return NaN, infinity, or other special values).\n\n Example:\n ```mlir\n // Compute natural logarithm of all elements in %input\n %result = ttir.log(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.0, 2.718, 7.389, 20.086], ... ]\n // Output tensor:\n // [[0.0, 1.0, 2.0, 3.0], ... ]\n\n // Example with different values\n %result = ttir.log(%float_input) : (tensor<3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [10.0, 100.0, 1000.0]\n // Output tensor:\n // [2.303, 4.605, 6.908] // ln(10), ln(100), ln(1000)\n ```\n\n Mathematical definition: log(x) = ln(x), where ln is the natural logarithm", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.log1p", "summary": "Elementwise natural logarithm of one plus input operation.", "description": "The `log1p` operation computes the natural logarithm of one plus each element in the input tensor.\n\n For each element x, it returns ln(1 + x). This operation is more accurate than computing\n log(1 + x) directly for x values close to zero, and it is defined for x > -1. For values\n less than or equal to -1, the behavior depends on the implementation (may return NaN or\n negative infinity).\n\n Example:\n ```mlir\n // Compute log1p of all elements in %input\n %result = ttir.log1p(%input) : (tensor<5xf32>) -> tensor<5xf32>\n // Input tensor:\n // [0.0, -0.999, 7.0, 6.38905621, 15.0]\n // Output tensor:\n // [0.0, -6.90776825, 2.07944155, 2.0, 2.77258873]\n\n // Example with small values where log1p is more accurate than log(1+x)\n %result = ttir.log1p(%small_input) : (tensor<3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [1e-10, 1e-7, 1e-5]\n // Output tensor:\n // [1e-10, 1e-7, 1e-5] // Approximately equal to the input for very small values\n ```\n\n Mathematical definition: log1p(x) = ln(1 + x)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.logical_and", "summary": "Elementwise logical and.", "description": "The `logical_and` operation performs an elementwise logical AND operation between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if both elements are 1 (true)\n - 0 (false) if at least one element is 0 (false)\n\n Example:\n ```mlir\n // Logical AND operation\n %result = ttir.logical_and(%lhs, %rhs) : (tensor<4x4xi1>, tensor<4x4xi1>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1, 0, 1, 0], ... ]\n // %rhs: [[1, 1, 0, 1], ... ]\n // Output tensor:\n // [[1, 0, 0, 0], ... ] // 1 where both are 1, 0 otherwise\n\n // Example with integer tensors\n %result = ttir.logical_and(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, 0, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [1, 0, 0] // Only the first element is true\n ```\n\n Mathematical definition: logical_and(x, y) = x && y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.logical_left_shift", "summary": "Eltwise Logical Left Shift operation", "description": "The `logical_left_shift` operation performs an elementwise logical left shift\n on the elements of the first tensor by the corresponding shift amounts in the\n second tensor.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.logical_not", "summary": "Elementwise logical not operation.", "description": "The `logical_not` operation computes the logical negation of each element in the input tensor.\n\n For each element, it returns a boolean value indicating whether the element is false (zero) or true (non-zero).\n\n Example:\n ```mlir\n // Compute logical negation of all elements in %input\n %result = ttir.logical_not(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.0, 4.5], ... ]\n // Output tensor:\n // [[false, false, true, false], ... ]\n ```\n\n Mathematical definition: logical_not(x) = !x", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.logical_or", "summary": "Elementwise logical or.", "description": "The `logical_or` operation performs an elementwise logical OR operation between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if at least one element is 1 (true)\n - 0 (false) if both elements are 0 (false)\n\n Example:\n ```mlir\n // Logical OR operation\n %result = ttir.logical_or(%lhs, %rhs) : (tensor<4x4xi1>, tensor<4x4xi1>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1, 0, 1, 0], ... ]\n // %rhs: [[1, 1, 0, 1], ... ]\n // Output tensor:\n // [[1, 1, 1, 1], ... ] // 1 where at least one is 1, 0 otherwise\n\n // Example with integer tensors\n %result = ttir.logical_or(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, 0, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [1, 1, 1] // All elements are true\n ```\n\n Mathematical definition: logical_or(x, y) = x || y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.logical_right_shift", "summary": "Eltwise Logical Right Shift operation", "description": "The `logical_right_shift` operation performs an elementwise logical right shift\n on the elements of the first tensor by the corresponding shift amounts in the\n second tensor.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.logical_xor", "summary": "Elementwise logical xor.", "description": "The `logical_xor` operation performs an elementwise logical XOR operation between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if exactly one element is 1 (true)\n - 0 (false) if both elements are 0 (false) or both are 1 (true)\n\n Example:\n ```mlir\n // Logical XOR operation\n %result = ttir.logical_xor(%lhs, %rhs) : (tensor<4x4xi1>, tensor<4x4xi1>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1, 0, 1, 0], ... ]\n // %rhs: [[1, 1, 0, 1], ... ]\n // Output tensor:\n // [[0, 1, 1, 1], ... ] // 1 where exactly one is 1, 0 otherwise\n\n // Example with integer tensors\n %result = ttir.logical_xor(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, 0, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [0, 1, 1] // Only the last element is true\n ```\n\n Mathematical definition: logical_xor(x, y) = x ^^ y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.lt", "summary": "Elementwise less than.", "description": "The `lt` operation performs an elementwise less than comparison between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if the left element is less than the right element\n - 0 (false) if the left element is greater than or equal to the right element\n\n Example:\n ```mlir\n // Compare elements for less than\n %result = ttir.lt(%lhs, %rhs) : (tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1.0, 2.0, 3.0, 2.0], ... ]\n // %rhs: [[1.0, 2.0, 4.0, 5.0], ... ]\n // Output tensor:\n // [[0, 0, 0, 1], ... ] // 1 where less, 0 where greater or equal\n\n // Example with integer tensors\n %result = ttir.lt(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, -5, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [0, 0, 0] // Only the last element is less\n ```\n\n Mathematical definition: less_than(x, y) = x < y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.matmul", "summary": "Matrix multiplication operation.", "description": "The `matmul` operation computes the matrix multiplication of two tensors.\n\n This operation performs matrix multiplication between tensors `a` and `b`. It supports optional\n transposition of either input tensor before multiplication. For 2D tensors, this computes the standard\n matrix product. For tensors with more dimensions, it applies batched matrix multiplication.\n\n Example:\n ```mlir\n // Basic matrix multiplication of 2D tensors\n %a = ... : tensor<3x4xf32> // Matrix A with shape [3,4]\n %b = ... : tensor<4x5xf32> // Matrix B with shape [4,5]\n %result = ttir.matmul(%a, %b) :\n (tensor<3x4xf32>, tensor<4x5xf32>) -> tensor<3x5xf32>\n\n // Batched matrix multiplication with transposition\n %a = ... : tensor<2x3x4xf32> // Batch of 2 matrices with shape [3,4]\n %b = ... : tensor<2x5x4xf32> // Batch of 2 matrices with shape [5,4]\n %result = ttir.matmul(%a, %b) {\n transpose_a = false, // Don't transpose A\n transpose_b = true // Transpose B before multiplication\n } : (tensor<2x3x4xf32>, tensor<2x5x4xf32>) -> tensor<2x3x5xf32>\n ```\n\n Inputs:\n - `a` (Tensor): The first input tensor.\n - `b` (Tensor): The second input tensor.\n\n Attributes:\n - `transpose_a` (Boolean, default=false): Whether to transpose tensor `a` before multiplication.\n - `transpose_b` (Boolean, default=false): Whether to transpose tensor `b` before multiplication.\n\n Output:\n - `result` (Tensor): The result of the matrix multiplication.\n\n Note: The inner dimensions of the input tensors must be compatible for matrix multiplication.\n If `a` has shape [..., m, k] and `b` has shape [..., k, n], then the result will have shape [..., m, n].\n If `transpose_a` is true, then `a` is treated as having shape [..., k, m].\n If `transpose_b` is true, then `b` is treated as having shape [..., n, k].", "operands": [ { "name": "a", "type": "AnyRankedTensor" }, { "name": "b", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedAttr" }, { "name": "transpose_b", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.max", "summary": "Maximum reduction operation.", "description": "The `max` operation computes the maximum value of elements along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by finding the maximum value of all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the maximum is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n Example:\n ```mlir\n // Maximum along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.max(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<2x3xf32>) -> tensor<2xf32>\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [4.0, 2.0, 6.0]]\n // Output tensor:\n // [5.0, 6.0] // Maximum of each row\n\n // Maximum along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.max(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<2x3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [4.0, 2.0, 6.0]]\n // Output tensor:\n // [4.0, 5.0, 6.0] // Maximum of each column\n\n // Maximum over all dimensions\n %input = ... : tensor<2x3xf32>\n %result = ttir.max(%input) {keep_dim = false} : (tensor<2x3xf32>) -> tensor\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [4.0, 2.0, 6.0]]\n // Output tensor:\n // 6.0 // Maximum of all elements\n ```\n\n Note: When comparing with NaN values, NaN is typically not selected as the maximum value.\n\n Mathematical definition: max(x, dim) = max(x[i]) for all i in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.max_pool2d", "summary": "2D maximum pooling operation.", "description": "The `max_pool2d` operation applies a 2D maximum pooling over an input tensor composed of several input planes.\n\n This operation performs downsampling by dividing the input into local regions and computing the maximum value\n of each region. It reduces the spatial dimensions (height and width) of an input tensor while preserving the\n batch and channel dimensions. This is commonly used in neural networks to reduce the spatial size of feature\n maps while retaining the most important features.\n\n Example:\n ```mlir\n // Basic 2D max pooling with a 2x2 kernel and stride 1\n %input = ... : tensor<1x3x3x1xf32> // 3x3 input tensor with values:\n // [[[1, 2, 3],\n // [4, 5, 6],\n // [7, 8, 9]]]\n %result = ttir.max_pool2d(%input) {\n kernel = [2, 2],\n stride = [1, 1],\n dilation = [1, 1],\n padding = [0, 0, 0, 0],\n ceil_mode = false\n } : (tensor<1x3x3x1xf32>) -> tensor<1x2x2x1xf32>\n // Result: [[[5, 6],\n // [8, 9]]]\n // Where: 5 = max(1,2,4,5), 6 = max(2,3,5,6), 8 = max(4,5,7,8), 9 = max(5,6,8,9)\n ```\n\n Inputs:\n - `input` (Tensor): Input tensor in NHWC format (batch, height, width, channels).\n\n Attributes:\n - `kernel` (i32 | array<2xi32>):\n - i32: Same kernel size for height and width dimensions (kH = kW = value).\n - array<2xi32>: [kH, kW] where kH is kernel size for height and kW is kernel size for width.\n - `stride` (i32 | array<2xi32>):\n - i32: Same stride for height and width dimensions (sH = sW = value).\n - array<2xi32>: [sH, sW] where sH is stride for height and sW is stride for width.\n - `dilation` (i32 | array<2xi32>):\n - i32: Same dilation for height and width dimensions (dH = dW = value).\n - array<2xi32>: [dH, dW] where dH is dilation for height and dW is dilation for width.\n - `padding` (i32 | array<2xi32> | array<4xi32>):\n - i32: Same padding for all sides (pT = pL = pB = pR = value).\n - array<2xi32>: [pH, pW] where pH is padding for height (top/bottom) and pW is padding for width (left/right).\n - array<4xi32>: [pT, pL, pB, pR] for top, left, bottom, and right padding respectively.\n - `ceil_mode` (Boolean): When true, uses ceil instead of floor for output shape calculation.\n\n Output:\n - `result` (Tensor): Output tensor after maximum pooling.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "stride", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "dilation", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "flattened_compat_info", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.max_pool2d_with_indices", "summary": "2D maximum pooling operation with indices.", "description": "The `max_pool2d_with_indices` operation applies a 2D maximum pooling over an input tensor composed of several input planes\n and also returns the indices of the maximum values within each pooling window.\n\n This operation performs downsampling by dividing the input into local regions and computing the maximum value\n of each region, along with the index (location) of that maximum value within the original input tensor. It reduces the\n spatial dimensions (height and width) of an input tensor while preserving the batch and channel dimensions.\n This is commonly used in neural networks to reduce the spatial size of feature maps while retaining the most\n important features, and the indices can be used for unpooling operations or gradient computation.\n\n Example:\n ```mlir\n // Basic 2D max pooling with indices using a 2x2 kernel and stride 1\n %input = ... : tensor<1x3x3x1xf32> // 3x3 input tensor with values:\n // [[[1, 2, 3],\n // [4, 5, 6],\n // [7, 8, 9]]]]\n %output = ttir.empty() : tensor<1x2x2x1xf32>\n %indices_output = ttir.empty() : tensor<1x2x2x1xi32>\n %result, %indices = ttir.max_pool2d_with_indices(%input, %output, %indices_output) {\n kernel = [2, 2],\n stride = [1, 1],\n dilation = [1, 1],\n padding = [0, 0, 0, 0],\n ceil_mode = false\n } : tensor<1x3x3x1xf32>, tensor<1x2x2x1xf32>, tensor<1x2x2x1xi32> -> tensor<1x2x2x1xf32>, tensor<1x2x2x1xi32>\n // Result values: [[[5, 6],\n // [8, 9]]]]\n // Result indices: [[[4, 5], // 5 is at index 4, 6 is at index 5\n // [7, 8]]]] // 8 is at index 7, 9 is at index 8\n // Where: 5 = max(1,2,4,5), 6 = max(2,3,5,6), 8 = max(4,5,7,8), 9 = max(5,6,8,9)\n ```\n\n Inputs:\n - `input` (Tensor): Input tensor in NHWC format (batch, height, width, channels).\n - `output` (Tensor): Output tensor for the pooled values.\n - `indices_output` (Tensor): Output tensor for the indices of maximum values.\n\n Attributes:\n - `kernel` (i32 | array<2xi32>):\n - i32: Same kernel size for height and width dimensions (kH = kW = value).\n - array<2xi32>: [kH, kW] where kH is kernel size for height and kW is kernel size for width.\n - `stride` (i32 | array<2xi32>):\n - i32: Same stride for height and width dimensions (sH = sW = value).\n - array<2xi32>: [sH, sW] where sH is stride for height and sW is stride for width.\n - `dilation` (i32 | array<2xi32>):\n - i32: Same dilation for height and width dimensions (dH = dW = value).\n - array<2xi32>: [dH, dW] where dH is dilation for height and dW is dilation for width.\n - `padding` (i32 | array<2xi32> | array<4xi32>):\n - i32: Same padding for all sides (pT = pL = pB = pR = value).\n - array<2xi32>: [pH, pW] where pH is padding for height (top/bottom) and pW is padding for width (left/right).\n - array<4xi32>: [pT, pL, pB, pR] for top, left, bottom, and right padding respectively.\n - `ceil_mode` (Boolean): When true, uses ceil instead of floor for output shape calculation.\n\n Outputs:\n - `result` (Tensor): Output tensor after maximum pooling.\n - `indices` (Tensor): Output tensor containing the indices of the maximum values in the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "output", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" }, { "name": "result_indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "kernel", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "stride", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "dilation", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "padding", "type": "AnyAttrOf<[I32Attr, DenseI32ArrayAttr]>" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "flattened_compat_info", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.maximum", "summary": "Elementwise maximum operation.", "description": "The `maximum` operation calculates the elementwise maximum between two tensors.\n\n For each pair of corresponding elements, it selects the larger value and places it in the\n output tensor. This operation has the idempotence property, meaning that applying it twice\n with the same second operand returns the original result: maximum(maximum(x, y), y) = maximum(x, y).\n\n Example:\n ```mlir\n // Maximum operation\n %result = ttir.maximum(%lhs, %rhs) : (tensor<3x3xi32>, tensor<3x3xi32>) -> tensor<3x3xi32>\n // Input tensors:\n // %lhs: [[3, 2, 7], [1, 4, 4]]\n // %rhs: [[1, 4, 2], [1, 2, 3]]\n // Output tensor:\n // [[3, 4, 7], [1, 4, 4]]\n ```\n\n Note: When comparing with NaN values, NaN is typically not selected as the maximum value.\n\n Mathematical definition: maximum(x, y) = max(x, y)", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.mean", "summary": "Mean reduction op.", "description": "The `mean` operation computes the arithmetic mean of elements along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by computing the average of all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the mean is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n Example:\n ```mlir\n // Mean along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.mean(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<2x3xf32>) -> tensor<2xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // [2.0, 5.0] // Mean of each row\n\n // Mean along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.mean(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<2x3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // [2.5, 3.5, 4.5] // Mean of each column\n\n // Mean over all dimensions\n %input = ... : tensor<2x3xf32>\n %result = ttir.mean(%input) {keep_dim = false} : (tensor<2x3xf32>) -> tensor\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // 3.5 // Mean of all elements\n ```\n\n Note: For integer input tensors, the result is typically rounded to the nearest integer according to the rounding mode.\n\n Mathematical definition: mean(x, dim) = (∑ x[i]) / n for all i in dimension dim, where n is the number of elements in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.mesh_partition", "summary": "Mesh partition operation.", "description": "Mesh partition op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" }, { "name": "cluster_axis", "type": "OptionalAttr" } ] }, { "name": "ttir.mesh_shard", "summary": "Mesh shard operation.", "description": "MeshShard op shards the inputs (FullToShard) or concatnates the outputs (ShardToFull) for ccl ops.\n\n shard_direction attribute determines whether to shard or concat.\n\n shard_type attribute determines how to shard or concat.\n manual: no sharding\n replicate: all devices have identical data\n maximal: only one device contains full data\n devices: shard_shape/shard_dims determine particular sharding\n\n shard_dims attribute determines row and column sharding dimension of input tensor\n\n For example, on 2x4 mesh hardware, following op shards arg0 to 8 slices, row divided by 2\n and col divided by 4.\n\n %1 = \"ttir.mesh_shard\"(%arg0) <\n {... shard_direction = #ttcore.shard_direction,\n shard_shape = array,\n shard_dims = array,\n shard_type = #ttcore.shard_type}> : (tensor<8192x784xf32>, ...) -> tensor<4096x196xf32>\n\n On the other hand, this op concatnates %4 to single tensor by concatnating\n one of the top row tensor with one of the bottom row tensor.\n\n %6 = \"ttir.mesh_shard\"(%4) <\n {..., shard_direction = #ttcore.shard_direction,\n shard_shape = array,\n shard_dims = array,\n shard_type = #ttcore.shard_type}> : (tensor<4096x16384xf32>, ...) -> tensor<8192x16384xf32>", "operands": [ { "name": "input", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "result", "type": "AnyRankedTensorOrMemRef" } ], "attributes": [ { "name": "shard_type", "type": "TTCore_MeshShardTypeAttr{replicate|maximal|devices}" }, { "name": "shard_direction", "type": "TTCore_MeshShardDirectionAttr{full_to_shard|shard_to_full}" }, { "name": "shard_shape", "type": "DenseI64ArrayAttr" }, { "name": "shard_dims", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.min", "summary": "Minimum reduction operation.", "description": "The `min` operation computes the minimum value of elements along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by finding the minimum value of all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the minimum is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n Example:\n ```mlir\n // Minimum along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.min(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<2x3xf32>) -> tensor<2xf32>\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [4.0, 2.0, 6.0]]\n // Output tensor:\n // [1.0, 2.0] // Minimum of each row\n\n // Minimum along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.min(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<2x3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [4.0, 2.0, 6.0]]\n // Output tensor:\n // [1.0, 2.0, 3.0] // Minimum of each column\n\n // Minimum over all dimensions\n %input = ... : tensor<2x3xf32>\n %result = ttir.min(%input) {keep_dim = false} : (tensor<2x3xf32>) -> tensor\n // Input tensor:\n // [[1.0, 5.0, 3.0],\n // [4.0, 2.0, 6.0]]\n // Output tensor:\n // 1.0 // Minimum of all elements\n ```\n\n Note: When comparing with NaN values, NaN is typically not selected as the minimum value.\n\n Mathematical definition: min(x, dim) = min(x[i]) for all i in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.minimum", "summary": "Elementwise minimum operation.", "description": "The `minimum` operation computes the elementwise minimum between two tensors.\n\n For each pair of corresponding elements, it selects the smaller value and places it in the\n output tensor. This operation has the idempotence property, meaning that applying it twice\n with the same second operand returns the original result: minimum(minimum(x, y), y) = minimum(x, y).\n\n Example:\n ```mlir\n // Minimum operation\n %result = ttir.minimum(%lhs, %rhs) : (tensor<2x3xi32>, tensor<2x3xi32>) -> tensor<2x3xi32>\n // Input tensors:\n // %lhs: [[3, 2, 7], [1, 4, 4]]\n // %rhs: [[1, 4, 2], [1, 2, 3]]\n // Output tensor:\n // [[1, 2, 2], [1, 2, 3]]\n\n // Example with floating point values\n %result = ttir.minimum(%float_lhs, %float_rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %float_lhs: [3.5, -2.1, 0.0]\n // %float_rhs: [1.2, -5.0, 0.0]\n // Output tensor:\n // [1.2, -5.0, 0.0]\n ```\n\n Note: When comparing with NaN values, NaN is typically not selected as the minimum value.\n\n Mathematical definition: minimum(x, y) = min(x, y)", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.mish", "summary": "Elementwise Mish activation operation.", "description": "The `mish` operation computes the Mish activation function of each element in the input tensor.\n\n Mish is a smooth, self-regularized, non-monotonic activation function that combines\n properties of both ReLU-like and smooth activation functions. It has been shown to improve\n performance in deep learning applications, particularly in computer vision tasks.\n\n Example:\n ```mlir\n // Compute Mish of all elements in %input\n %result = ttir.mish(%input, %output) : tensor<4x4xf32>, tensor<4x4xf32> -> tensor<4x4xf32>\n // Input tensor:\n // [[-2.0, -1.0, 0.0, 1.0], ... ]\n // Output tensor:\n // [[-0.252, -0.303, 0.0, 0.865], ... ]\n ```\n\n Mathematical definition: mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + e^x))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.moe_compute", "summary": "Fused MoE expert compute (selective tilize + experts + combine).", "description": "Composite operation that performs the MoE expert FFN in a single fused\n kernel: selective tilize of dispatched tokens, the gate/up matmul (W0/W1)\n followed by SILU or SwiGLU activation, the down matmul (W2), and an\n A2A selective-reduce-combine. Maps to\n `ttnn.experimental.moe_compute` at runtime.\n\n Takes the raw per-expert weights `w0` / `w1` / `w2` (logical shapes\n `(L, E, K, N)`, `(L, E, K, N)`, `(L, E, N, K)` with `K = hidden_size`,\n `N = intermediate_size`) and optional per-expert biases `bias_0` /\n `bias_1` / `bias_2`.\n\n Inputs:\n - `tilize_input_tensor`: dense per-token activations dispatched via\n all_to_all_dispatch.\n - `tilize_expert_indices_tensor`: per-token expert indices.\n - `tilize_expert_scores_tensor`: per-token expert routing scores.\n - `tilize_expert_mapping_tensor`: global expert-to-device mapping.\n - `w0` / `w1` / `w2`: raw per-expert gate / up / down weights.\n - `bias_0` / `bias_1` / `bias_2`: optional per-expert biases.\n\n Outputs (6, in declaration order):\n 0. `per_expert_total_tokens` routing metadata: per-expert token counts\n 1. `expert_activation` routing metadata: per-token activation records\n 2. `expert_to_token` routing metadata: per-expert token lists\n 3. `tilize_output` selective-tilize staging buffer\n 4. `matmul_output` expert-FFN result (final output in compute_only)\n 5. `combine_output` A2A-combined result (aliases matmul_output\n in compute_only)", "operands": [ { "name": "tilize_input_tensor", "type": "AnyRankedTensor" }, { "name": "tilize_expert_indices_tensor", "type": "AnyRankedTensor" }, { "name": "tilize_expert_scores_tensor", "type": "AnyRankedTensor" }, { "name": "tilize_expert_mapping_tensor", "type": "AnyRankedTensor" }, { "name": "w0", "type": "AnyRankedTensor" }, { "name": "w1", "type": "AnyRankedTensor" }, { "name": "w2", "type": "AnyRankedTensor" }, { "name": "bias_0", "type": "Optional" }, { "name": "bias_1", "type": "Optional" }, { "name": "bias_2", "type": "Optional" } ], "results": [ { "name": "per_expert_total_tokens", "type": "AnyRankedTensor" }, { "name": "expert_activation", "type": "AnyRankedTensor" }, { "name": "expert_to_token", "type": "AnyRankedTensor" }, { "name": "tilize_output", "type": "AnyRankedTensor" }, { "name": "matmul_output", "type": "AnyRankedTensor" }, { "name": "combine_output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "layer_id", "type": "UI32Attr" }, { "name": "output_height_shard_dim", "type": "UI32Attr" }, { "name": "intermediate_size", "type": "UI32Attr" }, { "name": "activation_function", "type": "DefaultValuedAttr" }, { "name": "compute_only", "type": "DefaultValuedAttr" }, { "name": "cluster_axis", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.moe_expert_token_remap", "summary": "Remap global expert routing to local device experts with sparsity.", "description": "Converts global expert routing scores to local per-device expert mapping\n and creates a sparsity pattern for efficient sparse_matmul. Used after\n all_to_all_dispatch in the MoE dispatch/compute/combine flow.\n\n Input shapes:\n - topk_tensor: [D, B, S, E] (bf16 routing scores)\n - expert_mapping: [1, 1, E, D] (uint16 one-hot mapping)\n - expert_metadata: [D, B, S, K] (uint16 expert indices)\n\n Output shapes:\n - mapping: [1, B, S, E_local] (bf16 local routing weights)\n - reduced: [1, 1, ceil(B*S/reduction_size), E_local] (uint16 sparsity)", "operands": [ { "name": "topk_tensor", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" }, { "name": "expert_metadata", "type": "AnyRankedTensor" } ], "results": [ { "name": "mapping", "type": "AnyRankedTensor" }, { "name": "reduced", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduction_size", "type": "I64Attr" } ] }, { "name": "ttir.moe_gpt", "summary": "Fused MoE compute kernel for GPT-OSS models.", "description": "Fused Mixture-of-Experts compute kernel for GPT-OSS-style models.\n Performs the full MoE compute pipeline in a single kernel: selective\n tilize, gate/up projection (w0_w1), SwiGLU activation, all-to-all ring\n exchange, down projection (w2), and combine. Typically follows\n all_to_all_dispatch_metadata in the MoE dispatch/compute/combine flow.\n\n Dimensions:\n T = total_tokens across the dispatch ring\n K = hidden_size\n N = intermediate_size\n K_sel = selected experts per token (top-k)\n E = experts per device\n D = total devices\n C_dram = DRAM-bank-aligned compute cores used for weight sharding\n C_worker = worker cores in the compute grid\n L = layers per weight tensor (typically 1)\n G = weight groups per core (gate/up interleaved pairs)\n TILE_SIZE = compute tile size\n L1_ALIGN = L1 alignment\n\n Input shapes (per device, after mesh sharding):\n - input_tensor: [T, K] (bf16)\n - expert_indices: [T, K_sel] (uint16)\n - expert_scores: [T, K_sel] (bf16)\n - expert_mapping: [1, E*D] (uint16;\n flattened mapping, entry [0, i] = device ID owning expert i)\n - w0_w1_tensor: [C_dram, L, E, G, K, 4*TILE_SIZE] (interleaved gate+up)\n - w2_tensor: [C_dram, L, E, 2, N, 4*TILE_SIZE] (down projection)\n\n Output shapes:\n - token_counts: [1, align(E*sizeof(u32), L1_ALIGN) / sizeof(u32)] (uint32)\n - activation_records: [1, (T+1) * align((2*E+1)*sizeof(u32), L1_ALIGN) / sizeof(u32)] (uint32)\n - token_indices: [E, (T+1) * align(sizeof(u32), L1_ALIGN) / sizeof(u32)] (uint32)\n - tilize_out: [C_worker, 2, TILE_SIZE, K] (bf16, tiled)\n - tilize_out_rm: [C_worker, 2, TILE_SIZE, K] (bf16, row-major)\n where align(n, a) = ceil(n/a) * a.", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_scores", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" }, { "name": "w0_w1_tensor", "type": "AnyRankedTensor" }, { "name": "w2_tensor", "type": "AnyRankedTensor" } ], "results": [ { "name": "token_counts", "type": "AnyRankedTensor" }, { "name": "activation_records", "type": "AnyRankedTensor" }, { "name": "token_indices", "type": "AnyRankedTensor" }, { "name": "tilize_out", "type": "AnyRankedTensor" }, { "name": "tilize_out_rm", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "output_height_shard_dim", "type": "DefaultValuedAttr" }, { "name": "output_width_shard_dim", "type": "DefaultValuedAttr" }, { "name": "hidden_size", "type": "DefaultValuedAttr" }, { "name": "cluster_axis", "type": "OptionalAttr" } ] }, { "name": "ttir.multiply", "summary": "Elementwise multiplication operation.", "description": "The `multiply` operation performs an elementwise multiplication between two tensors.\n\n For each pair of corresponding elements, it multiplies the elements and places the result in the output tensor.\n\n Example:\n ```mlir\n // Multiplication operation\n %result = ttir.multiply(%lhs, %rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi32>\n // Input tensors:\n // %lhs: [10, 20, 30]\n // %rhs: [1, 2, 3]\n // Output tensor:\n // [10, 40, 90]\n\n // Example with floating point values\n %result = ttir.multiply(%float_lhs, %float_rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %float_lhs: [3.5, 0.0, -1.2]\n // %float_rhs: [1.5, 2.0, -3.2]\n // Output tensor:\n // [5.25, 0.0, -3.84]\n ```\n\n Note: The data type of the output tensor matches the data type of the input tensors.\n\n Mathematical definition: multiply(x, y) = x * y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.ne", "summary": "Elementwise inequality comparison operation.", "description": "The `ne` operation performs an elementwise inequality comparison between two tensors.\n\n For each pair of corresponding elements, it returns:\n - 1 (true) if the elements are not equal\n - 0 (false) if the elements are equal\n\n Note that special handling may be required for floating-point NaN values, as NaN is not\n equal to any value, including itself. This means ne(NaN, NaN) should return true.\n\n Example:\n ```mlir\n // Compare elements for inequality\n %result = ttir.ne(%lhs, %rhs) : (tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xi1>\n // Input tensors:\n // %lhs: [[1.0, 2.0, 3.0, 2.0], ... ]\n // %rhs: [[1.0, 2.0, 4.0, 5.0], ... ]\n // Output tensor:\n // [[0, 0, 1, 1], ... ] // 0 where equal, 1 where not equal\n\n // Example with integer tensors\n %result = ttir.ne(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi1>\n // Input tensors:\n // %int_lhs: [10, -5, 0]\n // %int_rhs: [10, 5, 1]\n // Output tensor:\n // [0, 1, 1] // Only the first elements are equal, so their result is 0\n ```\n\n Mathematical definition: not_equal(x, y) = x != y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.neg", "summary": "Elementwise negate operation.", "description": "The `neg` operation negates each element in the input tensor.\n\n For each element, it returns the negation of the value. The operation preserves\n the data type of the input.\n\n Example:\n ```mlir\n // Compute negation of all elements in %input\n %result = ttir.neg(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[-1.7, -2.0, 0.3, -4.5], ... ]\n ```\n\n Mathematical definition: neg(x) = -x", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.ones", "summary": "Creates a tensor filled with ones.", "description": "The `ones` operation creates a tensor filled with ones of the specified shape.\n\n This operation is commonly used to initialize tensors with one values. It takes a shape attribute\n and produces a tensor of that shape with all elements set to one.\n\n Example:\n ```mlir\n // Create a 3D tensor of ones with shape [64, 28, 28]\n %result = ttir.ones() {\n shape = [64, 28, 28]\n } : () -> tensor<64x28x28xbf16>\n // Result: A tensor of shape [64, 28, 28] filled with ones\n\n // Create a 2D tensor of ones with shape [3, 4]\n %result = ttir.ones() {\n shape = [3, 4]\n } : () -> tensor<3x4xf32>\n // Result: [[1.0, 1.0, 1.0, 1.0],\n // [1.0, 1.0, 1.0, 1.0],\n // [1.0, 1.0, 1.0, 1.0]]\n ```\n\n Attributes:\n - `shape` (Array of Integer): The shape of the tensor to create.\n\n Output:\n - `result` (Tensor): The tensor filled with ones.\n\n Note: The element type of the result tensor is determined by the return type specified in the operation.\n This operation is useful for initializing tensors before scaling them or as a starting point for\n operations that require tensors filled with ones, such as creating masks or constant multipliers.", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "DenseI32ArrayAttr" } ] }, { "name": "ttir.pad", "summary": "Tensor padding operation.", "description": "The `pad` operation adds padding to the edges of an input tensor with a specified constant value.\n\n This operation extends the dimensions of the input tensor by adding padding elements with a constant value.\n The padding is specified for each dimension as the number of elements to add at the beginning (low) and\n end (high) of that dimension.\n\n The `padding` attribute must be a sequence of integers that is twice the size as the rank of the input.\n Each pair of integers in the padding attribute represents the amount of padding to add to the low and high\n of that dimension. For example, for a 2D tensor, the padding attribute would have 4 values: [dim0_low, dim0_high, dim1_low, dim1_high].\n\n Example:\n ```mlir\n // Pad a 2x3 tensor with different padding on each dimension\n %input = ... : tensor<2x3xf32> // Input tensor with values:\n // [[1, 2, 3],\n // [4, 5, 6]]\n %result = ttir.pad(%input) {\n padding = [1, 0, 1, 1], // Format: [dim0_low, dim0_high, dim1_low, dim1_high]\n value = 0.0 : f32\n } : (tensor<2x3xf32>) -> tensor<3x5xf32>\n // Result:\n // [[0, 0, 0, 0, 0],\n // [0, 1, 2, 3, 0],\n // [0, 4, 5, 6, 0]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to pad.\n\n Attributes:\n - `padding` (Array of Integer): The padding values for each dimension, specified as [dim0_low, dim0_high, dim1_low, dim1_high, ...].\n - `value` (Float): The constant value to use for the padding elements.\n\n Output:\n - `result` (Tensor): The padded tensor.\n\n Note: The shape of the output tensor must match the shape of the input tensor plus the padding specified\n in the padding attribute. For example, if the input shape is [2,3] and the padding is [1,0,1,1], then\n the output shape must be [3,5].", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "value", "type": "F32Attr" } ] }, { "name": "ttir.paged_fill_cache", "summary": "Paged fill cache op.", "description": "Fills the `cache` tensor in-place with values from `input` at `batch_idx_tensor`.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "batch_idx_tensor", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.paged_flash_multi_latent_attention_decode", "summary": "Paged flash multi-latent attention decode operation.", "description": "Paged flash Multi-Latent Attention (MLA) for the decode phase. This is a\n specialized attention kernel that combines flash attention with multi-latent\n attention and paged KV cache support, optimized for single-token decode.\n\n MLA compresses the KV cache using low-rank projections, significantly\n reducing memory requirements for long-context inference. The paged variant\n manages cache memory in fixed-size pages.\n\n Key difference from PagedScaledDotProductAttentionDecode: the value tensor\n is optional (may be null for latent-only MLA) and head_dim_v specifies the\n value head dimension separately.\n\n The key/value cache is laid out as `[max_num_blocks, nkv, block_size,\n head_dim]`. MLA keeps a single compressed latent KV cache shared across all\n query heads, so the number of KV heads `nkv` (dim 1) must be 1.", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "Optional" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "cur_pos_tensor", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "head_dim_v", "type": "UI32Attr" }, { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.paged_scaled_dot_product_attention_decode", "summary": "Paged scaled dot product attention decode operation.", "description": "Paged scaled dot product attention decode operation.", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "output", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "cur_pos_tensor", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "sliding_window_size", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.paged_update_cache", "summary": "Paged update cache op.", "description": "Inputs:\n - `cache`: The cache tensor to be updated. This tensor is modified in place [max_num_blocks, num_heads, block_size, head_dim]\n - `input`: The input tensor containing new values. [1, num_users, num_heads (padded to 32), head_dim]\n - `update_index`: Indices specifying where to update the cache. [num_users]\n - `share_cache`: Whether the cache tensors share memory regions. Defaults to False.\n - `page_table`: The page table for managing memory regions during updates. [num_users, max_num_blocks_per_seq]\n\n Outputs:\n - `result`: The updated cache tensor.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" }, { "name": "update_index", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "share_cache", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.permute", "summary": "Tensor dimension permutation operation.", "description": "The `permute` operation reorders the dimensions of the input tensor according to the specified permutation.\n\n This operation is similar to transpose but generalizes to tensors of any rank. It rearranges the\n dimensions of the input tensor based on the permutation attribute, which specifies the new order\n of dimensions.\n\n Example:\n ```mlir\n // Transpose a 2D tensor (swap dimensions 0 and 1)\n %input = ... : tensor<3x4xf32> // Input tensor with shape [3,4]\n %result = ttir.permute(%input) {\n permutation = [1, 0] // Swap dimensions 0 and 1\n } : (tensor<3x4xf32>) -> tensor<4x3xf32>\n // Result: tensor with shape [4,3], equivalent to transposing the input\n\n // Permute a 3D tensor\n %input = ... : tensor<2x3x4xf32> // Input tensor with shape [2,3,4]\n %result = ttir.permute(%input) {\n permutation = [1, 2, 0] // Reorder dimensions to [1,2,0]\n } : (tensor<2x3x4xf32>) -> tensor<3x4x2xf32>\n // Result: tensor with shape [3,4,2]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to permute.\n\n Attributes:\n - `permutation` (Array of Integer): The permutation of the input tensor dimensions.\n This must be a valid permutation of the indices [0, 1, ..., rank-1].\n\n Output:\n - `result` (Tensor): The permuted tensor.\n\n Note: The permutation attribute must contain exactly one occurrence of each integer in the range\n [0, rank-1], where rank is the number of dimensions in the input tensor. The shape of the output\n tensor is determined by permuting the dimensions of the input tensor according to the permutation.\n For example, if the input shape is [2,3,4] and the permutation is [1,2,0], then the output shape\n will be [3,4,2].", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "permutation", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.pooling", "summary": "General pooling operation.", "description": "The `pooling` operation is a generalized pooling operation that can implement various pooling methods\n such as max pooling, average pooling, and sum pooling.\n\n Pooling operations are commonly used in neural networks to reduce the spatial dimensions of feature maps\n by applying a specific function (like maximum or average) over local regions of the input tensor.\n\n Example:\n ```mlir\n // Max pooling with 2x2 window and stride 2\n %input = ... : tensor<1x32x32x16xf32> // Batch size 1, 32x32 feature map, 16 channels\n %result = ttir.pooling(%input) {\n pooling_method = \"MAX\",\n window_dimensions = [1, 2, 2, 1],\n window_strides = [1, 2, 2, 1],\n base_dilations = [1, 1, 1, 1],\n window_dilations = [1, 1, 1, 1],\n padding = [0, 0, 0, 0, 0, 0, 0, 0]\n } : (tensor<1x32x32x16xf32>) -> tensor<1x16x16x16xf32>\n\n // Average pooling with 3x3 window and stride 2\n %input = ... : tensor<1x32x32x16xf32> // Batch size 1, 32x32 feature map, 16 channels\n %result = ttir.pooling(%input) {\n pooling_method = \"AVG\",\n window_dimensions = [1, 3, 3, 1],\n window_strides = [1, 2, 2, 1],\n base_dilations = [1, 1, 1, 1],\n window_dilations = [1, 1, 1, 1],\n padding = [0, 0, 0, 0, 0, 0, 0, 0]\n } : (tensor<1x32x32x16xf32>) -> tensor<1x15x15x16xf32>\n ```\n\n Inputs:\n - `inputs` (Variadic Tensor): Input tensors to be pooled.\n\n Attributes:\n - `pooling_method` (Enum): The pooling method to use (MAX, AVG, SUM).\n - `window_dimensions` (Array of Integer): Dimensions of the pooling window. The rank of this array is the same as the rank of the input tensors.\n - `window_strides` (Array of Integer): Stride of the pooling window. The rank of this array is the same as the rank of the input tensors.\n - `base_dilations` (Array of Integer): Dilation factors for the input. The rank of this array is the same as the rank of the input tensors.\n - `window_dilations` (Array of Integer): Dilation factors for the pooling window. The rank of this array is the same as the rank of the input tensors.\n - `padding` (Array of Integer): Padding to apply to the input. The rank of this array is twice the rank of the input tensors, representing padding for each dimension.\n\n Outputs:\n - `results` (Variadic Tensor): Output tensors after pooling.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "pooling_method", "type": "TTIR_PoolingMethodAttr{Average|Max|Sum}" }, { "name": "window_dimensions", "type": "DenseI64ArrayAttr" }, { "name": "window_strides", "type": "DenseI64ArrayAttr" }, { "name": "base_dilations", "type": "DenseI64ArrayAttr" }, { "name": "window_dilations", "type": "DenseI64ArrayAttr" }, { "name": "padding", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.pow", "summary": "Elementwise power operation.", "description": "The `pow` operation performs an elementwise exponentiation between two tensors.\n\n For each pair of corresponding elements, it raises the element in the first tensor (base)\n to the power of the element in the second tensor (exponent) and places the result in the\n output tensor.\n\n Example:\n ```mlir\n // Power operation\n %result = ttir.pow(%lhs, %rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %lhs: [2.0, 3.0, 4.0] // Bases\n // %rhs: [2.0, 2.0, 0.5] // Exponents\n // Output tensor:\n // [4.0, 9.0, 2.0]\n\n // Example with integer values\n %result = ttir.pow(%int_lhs, %int_rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi32>\n // Input tensors:\n // %int_lhs: [2, 3, 5]\n // %int_rhs: [3, 2, 1]\n // Output tensor:\n // [8, 9, 5]\n ```\n\n Special cases:\n - 0^0 is typically defined as 1\n - For integer types, negative bases with non-integer exponents may result in complex numbers,\n which are typically not supported and may result in undefined behavior\n\n Mathematical definition: pow(x, y) = x^y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.prod", "summary": "Product reduction op.", "description": "The `prod` operation computes the product of elements along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by multiplying all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the product is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n Example:\n ```mlir\n // Product along dimension 0\n %input = ... : tensor<2x3xi32>\n %result = ttir.prod(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<2x3xi32>) -> tensor<3xi32>\n // Input tensor:\n // [[1, 2, 3],\n // [4, 5, 6]]\n // Output tensor:\n // [4, 10, 18] // Product of each column\n\n // Product along dimension 1\n %input = ... : tensor<2x3xi32>\n %result = ttir.prod(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<2x3xi32>) -> tensor<2xi32>\n // Input tensor:\n // [[1, 2, 3],\n // [4, 5, 6]]\n // Output tensor:\n // [6, 120] // Product of each row\n\n // Product over all dimensions\n %input = ... : tensor<2x3xi32>\n %result = ttir.prod(%input) {keep_dim = false} : (tensor<2x3xi32>) -> tensor\n // Input tensor:\n // [[1, 2, 3],\n // [4, 5, 6]]\n // Output tensor:\n // 720 // Product of all elements\n ```\n\n Note: For floating-point inputs, the order of multiplication may affect the result due to floating-point precision issues.\n\n Mathematical definition: prod(x, dim) = ∏ x[i] for all i in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.quantize", "summary": "Quantize operation.", "description": "The Quantize operation converts a tensor into a quantized tensor using the `quant.uniform` type from the MLIR Quant dialect.\n This type encapsulates the scale and zero-point metadata directly within the tensor type.\n The output tensor will be of type 'quant.uniform', where each element is computed as:\n ```\n output[i] = (input[i] / scale) + zero_point\n ```\n\n Example:\n ```mlir\n %input = ttir.empty() : () -> tensor<64x128xf32>\n %quantized = \"ttir.quantize\"(%input) : (tensor<64x128xf32>) -> tensor<64x128x!quant.uniform>\n\n // In this example:\n // - The input is a 64x128 tensor of 32-bit floating-point values\n // - The output is a 64x128 tensor of 32-bit quantized values\n // - The scale is 0.1 (each step represents 0.1 in the original scale)\n // - The zero point is 128 (the value 128 in the quantized space represents 0.0 in the original space)\n ```\n\n Inputs:\n - `input` (Tensor): Input tensor to be quantized.\n\n Results:\n - `result` (Quantized Tensor): The quantized tensor with type `quant.uniform`.\n\n Note: The quantization parameters (scale and zero point) are specified in the result type.\n Quantization helps reduce model size and computational requirements by representing\n floating-point values with lower-precision integers, which is particularly useful for\n deployment on resource-constrained devices.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.quantize_unrolled", "summary": "Quantize operation unrolled (scale and zero point as input operands).", "description": "The QuantizeUnrolledOp quantizes a tensor using the scale and zero point provided as input operands.\n\n Inputs:\n - `input` AnyRankedTensor: The input tensor to be quantized. Must have floating-point element type.\n - `scale` AnyRankedTensor: The scale factor (or factors for per-axis quantization). Must be either a scalar (for per-tensor quantization) or a 1D tensor with size matching the dimension of the specified axis (for per-axis quantization).\n - `zero_point` AnyRankedTensor: The zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `axis` Optional: The axis along which quantization is applied. Must be in range [0, rank) where rank is the rank of the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "zero_point", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ] }, { "name": "ttir.rand", "summary": "Random number generation operation.", "description": "Returns a tensor filled with random numbers drawn from a uniform distribution over given interval [low, high) [Default: [0, 1)].\n\n Example:\n %0 = \"ttir.rand\"() <{high = 1.000000e+00 : f32, low = 0.000000e+00 : f32, seed = 0 : ui32, size = [32 : i32, 32 : i32]}> : () -> tensor<32x32xbf16>\n\n Attributes:\n - `size` (Array of Integer): The shape of the tensor to create.\n - `low` (Float): The lower bound of the range (inclusive) [Default: 0.0].\n - `high` (Float): The upper bound of the range (exclusive) [Default: 1.0].\n - `seed` (Integer): Value to initialize the random number generator for reproducible results [Default: 0].\n\n Output:\n - `result` (Tensor): The generated tensor containing the random values.", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "size", "type": "TypedArrayAttrBase" }, { "name": "low", "type": "DefaultValuedAttr" }, { "name": "high", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.rearrange", "summary": "Tensor rearrange operation.", "description": "The `rearrange` operation reshapes, transposes, and reorganizes tensor dimensions using an\n intuitive notation inspired by Einstein notation. This operation takes an input tensor and\n transforms it according to a pattern string that describes how dimensions should be rearranged.\n The pattern uses named axes and supports splitting, merging, and reordering dimensions in a\n single operation. This operation is commonly used in neural networks for dimension manipulation,\n such as converting between different data layouts, splitting/merging dimensions, or transposing\n axes.\n\n Example:\n ```mlir\n // Transpose a 2D tensor (equivalent to transpose)\n %input = ... : tensor<2x3xf32> // Input tensor with shape [2,3]\n %result = ttir.rearrange(%input) {pattern = \"h w -> w h\"} : (tensor<2x3xf32>) -> tensor<3x2xf32>\n\n // Flatten spatial dimensions of a 4D tensor (batch, channel, height, width)\n %input = ... : tensor<1x3x4x4xf32> // Input tensor with shape [1,3,4,4]\n %result = ttir.rearrange(%input) {pattern = \"b c h w -> b c (h w)\"} :\n (tensor<1x3x4x4xf32>) -> tensor<1x3x16xf32>\n\n // Split a dimension into two dimensions\n %input = ... : tensor<2x12xf32> // Input tensor with shape [2,12]\n %result = ttir.rearrange(%input) {pattern = \"b (h w) -> b h w\", axes_lengths = {h = 3, w = 4}} :\n (tensor<2x12xf32>) -> tensor<2x3x4xf32>\n\n // Rearrange image patches (batch, height, width, channels) to sequence format\n %input = ... : tensor<8x16x16x3xf32> // Input tensor with shape [8,16,16,3]\n %result = ttir.rearrange(%input) {pattern = \"b h w c -> b (h w) c\"} :\n (tensor<8x16x16x3xf32>) -> tensor<8x256x3xf32>\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to rearrange.\n\n Attributes:\n - `pattern` (String): A string describing the rearrangement pattern. The pattern consists of\n two parts separated by \"->\": the left side describes the input axes and the right side\n describes the output axes. Named axes can be reordered, merged using parentheses \"()\",\n or split using parentheses with known dimensions. Examples: \"b c h w -> b (c h w)\",\n \"b (h w) -> b h w\", \"h w c -> c h w\".\n - `axes_lengths` (UNSUPPORTED #6339): A mapping of axis names to their lengths when splitting\n dimensions. Required when decomposing a dimension into multiple dimensions. Example:\n {h = 3, w = 4} when splitting a dimension of size 12 into h and w.\n\n Output:\n - `result` (Tensor): The rearranged tensor.\n\n Note: The total number of elements in the input tensor must equal the total number of elements\n in the output tensor. When merging dimensions, their sizes are multiplied. When splitting\n dimensions, the product of the split dimensions must equal the original dimension size. All\n axis names in the pattern must be unique within each side of the arrow, and axes can be\n reordered freely between input and output patterns.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "pattern", "type": "Builtin_StringAttr" } ] }, { "name": "ttir.reciprocal", "summary": "Eltwise reciprocal.", "description": "The `reciprocal` operation computes the reciprocal (1/x) of each element in the input tensor.\n\n For each element, it returns the reciprocal of the value.\n\n Example:\n ```mlir\n // Compute reciprocal of all elements in %input\n %result = ttir.reciprocal(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.5882, 0.5, -3.3333, 0.2173], ... ]\n ```\n\n Mathematical definition: reciprocal(x) = 1 / x", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.reduce_and", "summary": "Logical AND reduction operation.", "description": "The `reduce_and` operation performs a logical AND reduction along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by applying a logical AND operation to all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the reduction is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n The operation treats non-zero values as True and zero values as False when performing the logical AND.\n\n Example:\n ```mlir\n // Logical AND reduction along dimension 0\n %input = ... : tensor<4x4xi1>\n %result = ttir.reduce_and(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<4x4xi1>) -> tensor<4xi1>\n // Input tensor (where 1 represents True and 0 represents False):\n // [[1, 0, 1, 0],\n // [1, 1, 1, 1],\n // [0, 0, 1, 1],\n // [0, 1, 1, 0]]\n // Output tensor:\n // [0, 0, 1, 0] // Logical AND of each column\n\n // Logical AND reduction along dimension 1\n %input = ... : tensor<4x4xi1>\n %result = ttir.reduce_and(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<4x4xi1>) -> tensor<4xi1>\n // Input tensor:\n // [[1, 0, 1, 0],\n // [1, 1, 1, 1],\n // [0, 0, 1, 1],\n // [0, 1, 1, 0]]\n // Output tensor:\n // [0, 1, 0, 0] // Logical AND of each row\n\n // Logical AND reduction over all dimensions\n %input = ... : tensor<4x4xi1>\n %result = ttir.reduce_and(%input) {keep_dim = false} : (tensor<4x4xi1>) -> tensor\n // Input tensor:\n // [[1, 0, 1, 0],\n // [1, 1, 1, 1],\n // [0, 0, 1, 1],\n // [0, 1, 1, 0]]\n // Output tensor:\n // 0 // Logical AND of all elements\n ```\n\n Mathematical definition: reduce_and(x, dim) = AND(x[i]) for all i in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.reduce_or", "summary": "Logical OR reduction operation.", "description": "The `reduce_or` operation performs a logical OR reduction along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by applying a logical OR operation to all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the reduction is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n The operation treats non-zero values as True and zero values as False when performing the logical OR.\n\n Example:\n ```mlir\n // Logical OR reduction along dimension 0\n %input = ... : tensor<4x4xi1>\n %result = ttir.reduce_or(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<4x4xi1>) -> tensor<4xi1>\n // Input tensor (where 1 represents True and 0 represents False):\n // [[1, 0, 0, 0],\n // [1, 1, 0, 1],\n // [0, 0, 0, 1],\n // [0, 0, 0, 0]]\n // Output tensor:\n // [1, 1, 0, 1] // Logical OR of each column\n\n // Logical OR reduction along dimension 1\n %input = ... : tensor<4x4xi1>\n %result = ttir.reduce_or(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<4x4xi1>) -> tensor<4xi1>\n // Input tensor:\n // [[1, 0, 0, 0],\n // [1, 1, 0, 1],\n // [0, 0, 0, 1],\n // [0, 0, 0, 0]]\n // Output tensor:\n // [1, 1, 1, 0] // Logical OR of each row\n\n // Logical OR reduction over all dimensions\n %input = ... : tensor<4x4xi1>\n %result = ttir.reduce_or(%input) {keep_dim = false} : (tensor<4x4xi1>) -> tensor\n // Input tensor:\n // [[1, 0, 0, 0],\n // [1, 1, 0, 1],\n // [0, 0, 0, 1],\n // [0, 0, 0, 0]]\n // Output tensor:\n // 1 // Logical OR of all elements\n ```\n\n Mathematical definition: reduce_or(x, dim) = OR(x[i]) for all i in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.reduce_scatter", "summary": "Reduce scatter operation.", "description": "Reduce scatter op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" }, { "name": "scatter_dim", "type": "SI32Attr" }, { "name": "cluster_axis", "type": "UI32Attr" } ] }, { "name": "ttir.relu", "summary": "Eltwise ReLU.", "description": "The `relu` operation computes the rectified linear unit (ReLU) of each element in the input tensor.\n\n For each element, it returns the maximum of 0 and the value. The operation preserves\n the data type of the input.\n\n Example:\n ```mlir\n // Compute ReLU of all elements in %input\n %result = ttir.relu(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[1.7, 2.0, 0.0, 4.5], ... ]\n ```\n\n Mathematical definition: relu(x) = max(0, x)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.relu6", "summary": "Eltwise ReLU6.", "description": "The `relu6` operation computes the ReLU6 activation function of each element in the input tensor.\n\n For each element, it returns the minimum of 6 and the maximum of 0 and the value. The operation preserves\n the data type of the input.\n\n This operation has the idempotence property, meaning that applying it multiple times\n produces the same result as applying it once: relu6(relu6(x)) = relu6(x).\n\n Example:\n ```mlir\n // Compute ReLU6 of all elements in %input\n %result = ttir.relu6(%input, %output) : tensor<4x4xf32>, tensor<4x4xf32> -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 7.0], ... ]\n // Output tensor:\n // [[1.7, 2.0, 0.0, 6.0], ... ]\n ```\n\n Mathematical definition: relu6(x) = min(6, max(0, x))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.remainder", "summary": "Elementwise remainder operation.", "description": "The `remainder` operation performs an elementwise remainder (modulo) operation between two tensors.\n\n For each pair of corresponding elements, it computes the remainder when dividing the element\n in the first tensor (dividend) by the element in the second tensor (divisor) and places the\n result in the output tensor.\n\n Example:\n ```mlir\n // Remainder operation\n %result = ttir.remainder(%lhs, %rhs) : (tensor<4xi64>, tensor<4xi64>) -> tensor<4xi64>\n // Input tensors:\n // %lhs: [17, -17, 17, -17] // Dividends\n // %rhs: [3, 3, -3, -3] // Divisors\n // Output tensor:\n // [2, -2, 2, -2]\n\n // Example with floating point values\n %result = ttir.remainder(%float_lhs, %float_rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %float_lhs: [10.5, -10.5, 3.0]\n // %float_rhs: [3.0, 3.0, 2.0]\n // Output tensor:\n // [1.5, -1.5, 1.0]\n ```\n\n Note: Division by zero typically results in undefined behavior or NaN for floating-point types.\n\n Mathematical definition: remainder(x, y) = x % y (where % is the remainder operator)", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.repeat", "summary": "Repeat operation.", "description": "The `repeat` operation creates a new tensor by replicating the input tensor's elements\n along specified dimensions.\n\n This operation repeats the entire input tensor along each dimension according to the\n values specified in the `repeat_dimensions` attribute. The resulting tensor's shape\n is the product of the input tensor's shape and the corresponding repeat values.\n\n Example:\n ```mlir\n // Repeat a 2x3 tensor with repeat dimensions [2, 2]\n %input = ... : tensor<2x3xf32>\n %result = ttir.repeat(%input) {repeat_dimensions = [2, 2]} : (tensor<2x3xf32>) -> tensor<4x6xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // [[1.0, 2.0, 3.0, 1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0, 4.0, 5.0, 6.0],\n // [1.0, 2.0, 3.0, 1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0, 4.0, 5.0, 6.0]]\n\n // Repeat a 2x2 tensor with repeat dimensions [1, 3]\n %input = ... : tensor<2x2xf32>\n %result = ttir.repeat(%input) {repeat_dimensions = [1, 3]} : (tensor<2x2xf32>) -> tensor<2x6xf32>\n // Input tensor:\n // [[1.0, 2.0],\n // [3.0, 4.0]]\n // Output tensor:\n // [[1.0, 2.0, 1.0, 2.0, 1.0, 2.0],\n // [3.0, 4.0, 3.0, 4.0, 3.0, 4.0]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to repeat.\n\n Attributes:\n - `repeat_dimensions` (Array of Integer): The number of times to repeat the tensor along each dimension.\n\n Output:\n - `result` (Tensor): The repeated tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "repeat_dimensions", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.repeat_interleave", "summary": "Tensor repeat interleave operation.", "description": "The `repeat_interleave` operation repeats elements of a tensor along a specified dimension.\n\n Unlike the `repeat` operation which repeats the entire tensor, this operation repeats each individual\n element of the input tensor the specified number of times along the given dimension. This creates an\n interleaved pattern of repeated values.\n\n Example:\n ```mlir\n // Repeat interleave along dimension 0 with repeats=2\n %input = ... : tensor<2x3xf32>\n %result = ttir.repeat_interleave(%input) {repeats = 2 : ui32, dim = 0 : i32} : (tensor<2x3xf32>) -> tensor<4x3xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // [[1.0, 2.0, 3.0], // First row repeated\n // [1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0], // Second row repeated\n // [4.0, 5.0, 6.0]]\n\n // Repeat interleave along dimension 1 with repeats=3\n %input = ... : tensor<2x2xf32>\n %result = ttir.repeat_interleave(%input) {repeats = 3 : ui32, dim = 1 : i32} : (tensor<2x2xf32>) -> tensor<2x6xf32>\n // Input tensor:\n // [[1.0, 2.0],\n // [3.0, 4.0]]\n // Output tensor:\n // [[1.0, 1.0, 1.0, 2.0, 2.0, 2.0], // Each element repeated 3 times\n // [3.0, 3.0, 3.0, 4.0, 4.0, 4.0]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `repeats` (Integer): The number of times to repeat each element.\n - `dim` (Integer): The dimension along which to repeat elements.\n\n Output:\n - `result` (Tensor): The tensor with repeated elements.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "repeats", "type": "UI32Attr" }, { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttir.requantize", "summary": "Requantize operation.", "description": "The Requantize operation converts a quantized tensor from one scale and zero-point to another, using the `quant.uniform` type from the MLIR Quant dialect.\n The input tensor is expected to be of type `quant.uniform.`\n The output tensor will also be of type `quant.uniform.`\n Each element in the output tensor is computed as:\n ```\n output[i] = round((input[i] - input_zero_point) * (input_scale / output_scale)) + output_zero_point\n ```\n Example:\n ```mlir\n %input = ttir.empty() : () -> tensor<64x128x!quant.uniform>\n %requantized = \"ttir.requantize\"(%input) : (tensor<64x128x!quant.uniform>) -> tensor<64x128x!quant.uniform>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.requantize_unrolled", "summary": "Requantize operation unrolled (scale and zero point as input operands).", "description": "The RequantizeUnrolledOp requantizes a tensor using the scale and zero point provided as input operands.\n\n Inputs:\n - `input` AnyRankedTensor: The input tensor to be requantized. Must have quantized element type.\n - `in_scale` AnyRankedTensor: The input scale factor (or factors for per-axis quantization). Must be either a scalar (for per-tensor quantization) or a 1D tensor with size matching the dimension of the specified axis (for per-axis quantization).\n - `in_zero_point` AnyRankedTensor: The input zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `out_scale` AnyRankedTensor: The output scale factor (or factors for per-axis quantization). Must be either a scalar (for per-tensor quantization) or a 1D tensor with size matching the dimension of the specified axis (for per-axis quantization).\n - `out_zero_point` AnyRankedTensor: The output zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `axis` Optional: The axis along which quantization is applied. Must be in range [0, rank) where rank is the rank of the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "in_scale", "type": "AnyRankedTensor" }, { "name": "in_zero_point", "type": "AnyRankedTensor" }, { "name": "out_scale", "type": "AnyRankedTensor" }, { "name": "out_zero_point", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" } ] }, { "name": "ttir.reshape", "summary": "Tensor reshape operation.", "description": "The `reshape` operation changes the shape of a tensor without changing the data or number of elements.\n\n This operation takes an input tensor and reshapes it to a new shape specified by the shape attribute.\n The total number of elements in the tensor must remain the same after reshaping. This operation is\n commonly used in neural networks to change the dimensionality of tensors between layers.\n\n Example:\n ```mlir\n // Reshape a 2x3 tensor to a 1x6 tensor\n %input = ... : tensor<2x3xf32> // Input tensor with shape [2,3]\n %result = ttir.reshape(%input) {shape = [1, 6]} : (tensor<2x3xf32>) -> tensor<1x6xf32>\n\n // Reshape a 3D tensor to a 2D tensor\n %input = ... : tensor<2x3x4xf32> // Input tensor with shape [2,3,4]\n %result = ttir.reshape(%input) {shape = [6, 4]} : (tensor<2x3x4xf32>) -> tensor<6x4xf32>\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to reshape.\n\n Attributes:\n - `shape` (Array of Integer): The new shape for the tensor.\n\n Output:\n - `result` (Tensor): The reshaped tensor.\n\n Note: The total number of elements in the input tensor must equal the total number of elements\n in the output tensor. For example, a tensor of shape [2,3] (6 elements) can be reshaped to [1,6],\n [6,1], [2,1,3], etc., but not to [2,4] (8 elements).", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ] }, { "name": "ttir.reverse", "summary": "Tensor reversal operation.", "description": "The `reverse` operation reverses the order of elements in the input tensor along the specified dimensions.\n\n This operation flips the elements of a tensor along one or more axes, which is useful for operations\n like sequence reversal, matrix transposition with reversal, and other tensor manipulations that require\n changing the order of elements.\n\n Example:\n ```mlir\n // Reverse a 3x2 tensor along dimension 1 (columns)\n %input = ... : tensor<3x2xi32> // Input tensor with values:\n // [[1, 2],\n // [3, 4],\n // [5, 6]]\n %result = ttir.reverse(%input) {\n dimensions = [1] // Reverse along columns\n } : (tensor<3x2xi32>) -> tensor<3x2xi32>\n // Result:\n // [[2, 1],\n // [4, 3],\n // [6, 5]]\n\n // Reverse a 3x2 tensor along both dimensions\n %input = ... : tensor<3x2xi64> // Input tensor with values:\n // [[1, 2],\n // [3, 4],\n // [5, 6]]\n %result = ttir.reverse(%input) {\n dimensions = [0, 1] // Reverse along both rows and columns\n } : (tensor<3x2xi64>) -> tensor<3x2xi64>\n // Result:\n // [[6, 5],\n // [4, 3],\n // [2, 1]]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to reverse.\n\n Attributes:\n - `dimensions` (Array of Integer): The dimensions along which to reverse the tensor.\n\n Output:\n - `result` (Tensor): The reversed tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dimensions", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttir.right_shift", "summary": "Eltwise Arithmetic Right Shift operation", "description": "The `right_shift` operation performs an elementwise arithmetic right shift\n on the elements of the first tensor by the corresponding shift amounts in the\n second tensor.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.rms_norm", "summary": "RMS normalization operation", "description": "Performs RMS (Root Mean Square) normalization on the input tensor. This operation\n normalizes the input tensor by computing the root mean square of elements across\n the specified dimensions and dividing by that value, optionally scaling and\n shifting the result.\n\n Inputs:\n - `input` (Tensor): The input tensor to be normalized.\n - `weight` (Optional Tensor): The scale parameter (gamma). If provided, the normalized\n result is element-wise multiplied by this weight.\n - `bias` (Optional Tensor): The shift parameter (beta). If provided, this bias is\n added to the scaled result.\n\n Attributes:\n - `normalized_shape` specifies the dimensions over which to normalize. Typically\n the last few dimensions of the input tensor.\n - `epsilon` is a small constant added for numerical stability (default: 1e-05).\n\n Output:\n - `result` (Tensor): The RMS normalized output tensor.\n\n Example:\n ```mlir\n // RMS normalization over last dimension (shape: [2, 4, 8] -> normalize over [8])\n %result = ttir.rms_norm(%input, %weight, %bias) : <{ normalized_shape = [8], epsilon = 1e-05 }> :\n (tensor<2x4x8xf32>, tensor<2x4x8xf32>, tensor<8xf32>) -> tensor<2x4x8xf32>\n\n // RMS normalization over last two dimensions (shape: [2, 4, 8] -> normalize over [4, 8])\n %result = ttir.rms_norm(%input, %weight, %bias) : <{ normalized_shape = [4, 8], epsilon = 1e-05) }> :\n (tensor<2x4x8xf32>, tensor<2x4x8xf32>, tensor<4x8xf32>) -> tensor<2x4x8xf32>\n ```\n\n Mathematical definition: rms_norm(x, weight, bias, epsilon) =\n (x / sqrt(mean(x^2, dims=normalized_dims) + epsilon)) * weight + bias", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "normalized_shape", "type": "DenseI64ArrayAttr" }, { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.rotary_embedding", "summary": "Rotary position embedding operation.", "description": "Applies rotary position embedding (RoPE) to the input tensor using\n precomputed cosine and sine caches.\n\n Formula:\n result = x * cos + rotate_half(x) * sin\n where rotate_half(x) = concat(neg(x[D/2:]), x[:D/2])\n\n The input tensor must be 4D [batch, heads, seq_len, head_dim].\n cos_cache and sin_cache must be 4D and broadcastable to the input shape,\n with the last dimension (head_dim) matching the input exactly.\n\n Example:\n %result = \"ttir.rotary_embedding\"(%input, %cos_cache, %sin_cache)\n : (tensor<1x32x128x64xbf16>, tensor<1x1x128x64xbf16>,\n tensor<1x1x128x64xbf16>) -> tensor<1x32x128x64xbf16>", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "cos_cache", "type": "AnyRankedTensor" }, { "name": "sin_cache", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.rsqrt", "summary": "Eltwise reciprocal square root.", "description": "The `rsqrt` operation computes the reciprocal square root of each element in the input tensor.\n\n For each element, it returns the reciprocal of the square root of the value.\n\n Example:\n ```mlir\n // Compute reciprocal square root of all elements in %input\n %result = ttir.rsqrt(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.5882, 0.5, -3.3333, 0.2173], ... ]\n ```\n\n Mathematical definition: rsqrt(x) = 1 / sqrt(x)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.sampling", "summary": "Sampling operation.", "description": "Performs fused top-k + top-p + multinomial sampling on pre-filtered\n candidate logits. Takes the top-k values and their global vocab indices\n (from a prior topk stage), per-request top-k, top-p, temperature\n parameters, and an optional random seed. Returns one sampled global\n token index per request.\n\n Inputs:\n - `input_values`: Pre-filtered candidate logit values [batch, candidates] bf16\n - `input_indices`: Global vocab indices for each candidate [batch, candidates] int32\n - `k`: Per-request top-k values [batch] uint32\n - `p`: Per-request top-p values [batch] bf16\n - `temp`: Per-request temperature values [batch] bf16\n - `seed`: Optional random seed (uint32 scalar attribute)\n\n Output:\n - `result`: Sampled global token indices [batch] int32", "operands": [ { "name": "input_values", "type": "AnyRankedTensor" }, { "name": "input_indices", "type": "AnyRankedTensor" }, { "name": "k", "type": "AnyRankedTensor" }, { "name": "p", "type": "AnyRankedTensor" }, { "name": "temp", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "ttir.scaled_dot_product_attention", "summary": "Scaled dot product attention operation.", "description": "FlashAttention-2 SDPA. Supports MHA, MQA, and GQA.\n\n Lowering to TTNN dispatches on `Sq`: `Sq > 1` lowers to\n `ttnn.scaled_dot_product_attention` (prefill), while `Sq == 1` lowers to\n `ttnn.scaled_dot_product_attention_decode` (decode, with the necessary Q\n and mask permutations applied at the conversion boundary).\n\n Shapes use `B` (batch), `Hq`/`Hkv` (query/kv heads), `Sq`/`Sk` (query/kv\n seq len), `D` (head size).\n\n Args:\n query (AnyRankedTensor): `[B x Hq x Sq x D]`.\n key (AnyRankedTensor): `[B x Hkv x Sk x D]`.\n value (AnyRankedTensor): `[B x Hkv x Sk x D]`. Same type as `key`.\n attention_mask (AnyRankedTensor, optional): `[1|B x 1|Hq x Sq x Sk]`.\n Dim 0 broadcasts batch, dim 1 broadcasts heads. Only valid when\n `is_causal` is `false`. Defaults to `None`.\n is_causal (bool): Defaults to `true`. Requires `Sq == Sk` and no\n `attention_mask`.\n scale (float, optional): Softmax scale. Defaults to `1 / sqrt(D)`.\n sliding_window_size (uint, optional): If `is_causal`, attends to the\n last N tokens; otherwise attends to a window of size N centered at\n the current position. Defaults to `None`.\n attention_sink (AnyRankedTensor, optional): `[1 x Hq x 1 x 1]`, one\n value per query head broadcast across batch and tile dims.\n Defaults to `None`.\n\n Returns:\n AnyRankedTensor: `[B x Hq x Sq x D]` (same type as `query`).", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "sliding_window_size", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.scaled_dot_product_attention_decode", "summary": "A version of scaled dot product attention specifically for decode.", "description": "Flash-Decode SDPA for single-query-token decode. Supports MQA and GQA.\n\n Shapes use `B` (batch), `Hq`/`Hkv` (query/kv heads), `Sk` (kv seq len),\n `D` (head size).\n\n Args:\n query (AnyRankedTensor): `[1 x B x Hq x D]`. Dim 0 must be 1.\n key (AnyRankedTensor): `[B x Hkv x Sk x D]`.\n value (AnyRankedTensor): `[B x Hkv x Sk x D]`. Same type as `key`.\n is_causal (bool, optional): Defaults to `true`. Mutually exclusive\n with `attention_mask`.\n attention_mask (AnyRankedTensor, optional): `[1|B x 1 x 1|Hq x Sk]`.\n Dim 0 broadcasts batch, dim 2 broadcasts heads. Only valid when\n `is_causal` is `false`.\n cur_pos_tensor (AnyRankedTensor): 1D `[B]` integer tensor of decode\n positions.\n attention_sink (AnyRankedTensor, optional): `[Hq x 32]`, single tile\n wide.\n scale (float, optional): Softmax scale. Defaults to `1 / sqrt(D)`.\n\n Returns:\n AnyRankedTensor: `[1 x B x Hq x D]` (same type as `query`).", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "cur_pos_tensor", "type": "AnyRankedTensor" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttir.scatter", "summary": "Scatter operation with simplified dimension attributes", "description": "The `scatter` operation introduces torch style scatter in TTIR so that\n we can lower ttir scatter -> ttnn scatter.\n\n Embeds the values of the source tensor into the input tensor at locations specified by the index tensor along the given dimension.\n\n This is a simplified scatter operation that operates along a single dimension, making it more straightforward\n to use than the general scatter operation when you only need to scatter along one axis.\n\n Parameters:\n - `input` (Tensor): The tensor being updated.\n - `index` (Tensor): Indices where values will be written to.\n - `source` (Tensor): The values to scatter into the input tensor.\n - `dim` (int32_t): The dimension along which to scatter.\n - `scatter_reduce_type` (Enum): The scatter reduce type to use (SUM, PROD, MIN, MAX, INVALID).\n\n\n Example:\n ```mlir\n // Scatter values along dimension 0\n %input = ... : tensor<8xf32> // Input tensor\n %indices = ... : tensor<3xi32> // Indices tensor\n %source = ... : tensor<3xf32> // Source values to scatter\n %result = ttir.scatter_in_dim(%input, %indices, %source) {\n dim = 0, scatter_reduce_type = \"SUM\"\n } : tensor<8xf32>, tensor<3xi32>, tensor<3xf32> -> tensor<8xf32>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "index", "type": "AnyRankedTensor" }, { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I32Attr" }, { "name": "scatter_reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" } ] }, { "name": "ttir.selective_reduce_combine", "summary": "Reduce and combine phase of the MoE pipeline.", "description": "Takes dense blocks of expert-computed tokens from the MoE compute kernel,\n sparsifies them, and sends tokens back to their originating devices via\n fabric.\n\n Input shapes:\n - dense_input_tensor: dense expert output\n - dense_activations_tensor: activation metadata\n - dense_token_maps_tensor: token routing maps\n - dense_token_counts_tensor: token counts per expert\n\n Output shape:\n - result: combined expert contributions", "operands": [ { "name": "dense_input_tensor", "type": "AnyRankedTensor" }, { "name": "dense_activations_tensor", "type": "AnyRankedTensor" }, { "name": "dense_token_maps_tensor", "type": "AnyRankedTensor" }, { "name": "dense_token_counts_tensor", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "hidden_size", "type": "UI32Attr" }, { "name": "batch_size", "type": "UI32Attr" }, { "name": "seq_size", "type": "UI32Attr" }, { "name": "select_experts_k", "type": "UI32Attr" }, { "name": "experts", "type": "UI32Attr" } ] }, { "name": "ttir.selu", "summary": "Elementwise scaled exponential linear unit (SELU).", "description": "Applies SELU activation elementwise. `scale` and `alpha` follow the same role as in\n the standard SELU definition and default to PyTorch's `torch.nn.functional.selu` values.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "alpha", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.sigmoid", "summary": "Eltwise sigmoid.", "description": "The `sigmoid` operation computes the sigmoid of each element in the input tensor.\n\n For each element, it returns the sigmoid of the value.\n\n Example:\n ```mlir\n // Compute sigmoid of all elements in %input\n %result = ttir.sigmoid(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.8391, 0.9641, 0.5793, 0.9899], ... ]\n ```\n\n Mathematical definition: sigmoid(x) = 1 / (1 + exp(-x))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.sign", "summary": "Eltwise sign operation.", "description": "The `sign` operation computes the sign of each element in the input tensor.\n\n For each element, it returns:\n - 1 if the value is positive\n - 0 if the value is zero\n - -1 if the value is negative\n\n This operation has the idempotence property, meaning that applying it multiple times\n produces the same result as applying it once: sign(sign(x)) = sign(x).\n\n Example:\n ```mlir\n // Compute sign of all elements in %input\n %result = ttir.sign(%input) : (tensor<2x3xi32>) -> tensor<2x3xi32>\n // Input tensor:\n // [[3, -2, 0],\n // [1, -4, 4]]\n // Output tensor:\n // [[1, -1, 0],\n // [1, -1, 1]]\n\n // Example with floating-point values\n %result = ttir.sign(%float_input) : (tensor<4xf32>) -> tensor<4xf32>\n // Input tensor:\n // [5.7, -0.0, 0.001, -3.14]\n // Output tensor:\n // [1.0, 0.0, 1.0, -1.0]\n ```\n\n Mathematical definition: sign(x) = {\n 1 if x > 0\n 0 if x = 0\n -1 if x < 0\n }", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.signbit", "summary": "Elementwise IEEE-754 sign bit as 0.0 or 1.0.", "description": "For each element, returns 0.0 if the sign bit is clear and 1.0 if set,\n matching IEEE 754 signbit semantics in the element type of the result tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.silu", "summary": "Elementwise SiLU (Sigmoid Linear Unit) operation.", "description": "The `silu` operation computes the SiLU (Sigmoid Linear Unit) activation function of each element in the input tensor.\n\n SiLU, also known as Swish, is defined as x * sigmoid(x). It combines the properties of both\n linear and sigmoid functions, providing smooth, non-monotonic activation that has shown good\n performance in deep learning applications.\n\n Example:\n ```mlir\n // Compute SiLU of all elements in %input\n %result = ttir.silu(%input, %output) : tensor<4x4xf32>, tensor<4x4xf32> -> tensor<4x4xf32>\n // Input tensor:\n // [[-2.0, -1.0, 0.0, 1.0], ... ]\n // Output tensor:\n // [[-0.238, -0.269, 0.0, 0.731], ... ]\n ```\n\n Mathematical definition: silu(x) = x * sigmoid(x) = x * (1 / (1 + exp(-x)))", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.sin", "summary": "Eltwise sin operation.", "description": "The `sin` operation computes the sine of each element in the input tensor.\n\n For each element, it returns the sine of the angle in radians.\n\n Example:\n ```mlir\n // Compute sine of all elements in %input\n %result = ttir.sin(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.9601, 0.5403, -0.3, 4.5], ... ]\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.slice_dynamic", "summary": "Tensor slice operation with dynamic parameters.", "description": "The `slice_dynamic` operation extracts a sub-tensor (slice) from the input tensor across one or more dimensions.\n\n This operation selects a subset of elements from the input tensor based on the specified begin, end, and\n step indices for each dimension. It's similar to Python's slicing notation `tensor[begin:end:step]` but\n extended to multiple dimensions. The `begins` and `ends` parameters are tensor inputs determined at runtime.\n\n Example:\n ```mlir\n // Extract a 2x2 slice from a 4x4 tensor with dynamic begin/end indices\n %input = ... : tensor<4x4xf32> // Input tensor with values:\n // [[1, 2, 3, 4],\n // [5, 6, 7, 8],\n // [9, 10, 11, 12],\n // [13, 14, 15, 16]]\n %begins = ... : tensor<2xi32> // Tensor with values [1, 1]\n %ends = ... : tensor<2xi32> // Tensor with values [3, 3]\n %result = ttir.slice_dynamic(%input, %begins, %ends) <{\n step = [1, 1] // Step size for each dimension\n }> : (tensor<4x4xf32>, tensor<2xi32>, tensor<2xi32>) -> tensor<2x2xf32>\n // Result:\n // [[6, 7],\n // [10, 11]]\n\n // Extract elements with a step of 2 using dynamic indices\n %input = ... : tensor<5xf32> // Input tensor with values: [1, 2, 3, 4, 5]\n %begins = ... : tensor<1xi32> // Tensor with values [0]\n %ends = ... : tensor<1xi32> // Tensor with values [5]\n %result = ttir.slice_dynamic(%input, %begins, %ends) <{\n step = [2] // Step size\n }> : (tensor<5xf32>, tensor<1xi32>, tensor<1xi32>) -> tensor<3xf32>\n // Result: [1, 3, 5]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to slice.\n - `begins` (Tensor): The starting indices for the slice in each dimension.\n - `ends` (Tensor): The ending indices (exclusive) for the slice in each dimension.\n\n Attributes:\n - `step` (Array of Integer): The step sizes for the slice in each dimension.\n\n Outputs:\n - `result` (Tensor): The sliced tensor.\n\n Note: The `begins` and `ends` tensors must have the same length as the rank of the input tensor.\n The output tensor shape may contain dynamic dimensions when slice parameters are runtime-determined.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "begins", "type": "AnyRankedTensor" }, { "name": "ends", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "step", "type": "OptionalAttr>" } ] }, { "name": "ttir.slice_static", "summary": "Tensor slice operation with constant parameters.", "description": "The `slice_static` operation extracts a sub-tensor (slice) from the input tensor across one or more dimensions.\n\n This operation selects a subset of elements from the input tensor based on the specified begin, end, and\n step indices for each dimension. It's similar to Python's slicing notation `tensor[begin:end:step]` but\n extended to multiple dimensions. The `begins` and `ends` parameters are attributes with fixed values.\n\n Example:\n ```mlir\n // Extract a 2x2 slice from a 4x4 tensor\n %input = ... : tensor<4x4xf32> // Input tensor with values:\n // [[1, 2, 3, 4],\n // [5, 6, 7, 8],\n // [9, 10, 11, 12],\n // [13, 14, 15, 16]]\n %result = ttir.slice_static(%input) {\n begins = [1, 1], // Start indices for each dimension\n ends = [3, 3], // End indices for each dimension (exclusive)\n step = [1, 1] // Step size for each dimension\n } : (tensor<4x4xf32>) -> tensor<2x2xf32>\n // Result:\n // [[6, 7],\n // [10, 11]]\n\n // Extract elements with a step of 2\n %input = ... : tensor<5xf32> // Input tensor with values: [1, 2, 3, 4, 5]\n %result = ttir.slice_static(%input) {\n begins = [0], // Start index\n ends = [5], // End index (exclusive)\n step = [2] // Step size\n } : (tensor<5xf32>) -> tensor<3xf32>\n // Result: [1, 3, 5]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to slice.\n\n Attributes:\n - `begins` (Array of Integer): The starting indices for the slice in each dimension.\n - `ends` (Array of Integer): The ending indices (exclusive) for the slice in each dimension.\n - `step` (Array of Integer): The step sizes for the slice in each dimension.\n\n Output:\n - `result` (Tensor): The sliced tensor.\n\n Note: The shape of the output tensor is determined by the slice parameters. For each dimension i,\n the output size is calculated as `ceil((ends[i] - begins[i]) / step[i])`. The `begins`, `ends`, and\n `step` arrays must have the same length as the rank of the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "begins", "type": "TypedArrayAttrBase" }, { "name": "ends", "type": "TypedArrayAttrBase" }, { "name": "step", "type": "TypedArrayAttrBase" } ] }, { "name": "ttir.softmax", "summary": "Softmax normalization operation.", "description": "The `softmax` operation applies the softmax function along a specified dimension of the input tensor.\n\n The softmax function transforms each element of the input tensor to a value between 0 and 1, such that\n the sum of all elements along the specified dimension equals 1. This is commonly used to convert a vector\n of real numbers into a probability distribution.\n\n The softmax function is defined as:\n softmax(x_i) = exp(x_i) / sum(exp(x_j)) for all j in the specified dimension\n\n Example:\n ```mlir\n // Softmax along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.softmax(%input) {dimension = 1 : i32} : (tensor<2x3xf32>) -> tensor<2x3xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 1.0, 2.0]]\n // Output tensor (approximate values):\n // [[0.09, 0.24, 0.67], // sum = 1.0\n // [0.71, 0.09, 0.20]] // sum = 1.0\n ```\n\n Note: For numerical stability, the implementation typically subtracts the maximum value in each slice\n before applying the exponential function.\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `dimension` (Integer): The dimension along which to apply the softmax function.\n - `numericStable` (Boolean, default=false): Whether to use numerically stable computation.\n\n Output:\n - `result` (Tensor): The tensor after applying the softmax function.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dimension", "type": "SI32Attr" }, { "name": "numericStable", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.softsign", "summary": "Elementwise softsign activation.", "description": "For each element x, returns x / (1 + |x|).", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.sort", "summary": "Sort operation.", "description": "Sorts elements of a tensor along a given dimension.\n\n Input:\n - input: AnyRankedTensor\n\n Attributes:\n - dim (int32): The dimension to sort along (default: -1, the last dim).\n - descending (bool): If True, sort in descending order (default: False).\n - stable (bool): If True, ensures stable sort (equal elements keep order).\n\n Returns a tuple:\n - values: the sorted tensor.\n - indices: the original indices of the sorted values.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "values", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "DefaultValuedAttr" }, { "name": "descending", "type": "DefaultValuedAttr" }, { "name": "stable", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.sparse_matmul", "summary": "Sparse block matrix multiplication with sparsity mask.", "description": "The `sparse_matmul` operation performs batched matrix multiplication where\n computation is selectively skipped for blocks marked as zero in the sparsity\n tensor. Input `b` is organized as a collection of weight matrices indexed by\n a block dimension (dim 1), and the sparsity tensor controls which blocks\n participate in the computation.\n\n The operation supports three sparsity modes that determine which input\n carries the block structure:\n\n Inputs:\n - `a` (Tensor): The first input tensor (activations or sparse input).\n - `b` (Tensor): The second input tensor, always [1, num_blocks, K, N].\n - `sparsity` (Tensor): 4D binary mask indicating active blocks.\n\n Attributes:\n - `is_input_a_sparse` (Boolean, default=false): Whether `a` has block structure.\n - `is_input_b_sparse` (Boolean, default=true): Whether `b` has block structure.\n - `nnz` (Optional Integer): Number of non-zero blocks per row. If absent, it is\n inferred at runtime.\n\n Supported Modes:\n - is_input_a_sparse=false, is_input_b_sparse=true (column-parallel):\n a: [A, B, M, K], b: [1, E, K, N], sparsity: [A, B, 1, E]\n -> output: [A, B, 1, E, M, N]\n - is_input_a_sparse=true, is_input_b_sparse=false (row-parallel):\n a: [A, E, M, K], b: [1, E, K, N], sparsity: [1, 1, A, E]\n -> output: [A, E, M, N]\n - is_input_a_sparse=true, is_input_b_sparse=true (both sparse):\n a: [1, E, M, K], b: [1, E, K, N], sparsity: [1, 1, 1, E]\n -> output: [1, E, M, N]\n\n Example (Mixture of Experts gate/up projection):\n ```mlir\n %result = \"ttir.sparse_matmul\"(%activations, %expert_weights, %sparsity) <{\n is_input_a_sparse = false, is_input_b_sparse = true, nnz = 2\n }> : (tensor<2x4x32x2880xbf16>, tensor<1x4x2880x5760xbf16>,\n tensor<2x4x1x4xbf16>) -> tensor<2x4x1x4x32x5760xbf16>\n ```", "operands": [ { "name": "a", "type": "AnyRankedTensor" }, { "name": "b", "type": "AnyRankedTensor" }, { "name": "sparsity", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_input_a_sparse", "type": "DefaultValuedAttr" }, { "name": "is_input_b_sparse", "type": "DefaultValuedAttr" }, { "name": "nnz", "type": "OptionalAttr" } ] }, { "name": "ttir.split_query_key_value_and_split_heads", "summary": "Split query, key, values and split heads op used in attention layer.", "description": "Splits input_tensor of shape [batch_size, sequence_size, 3 * hidden_size] into 3 tensors (Query, Key, Value) of shape [batch_size, sequence_size, hidden_size]. Then, reshapes and permutes the output tensors, to make them ready for computing attention scores.\n If kv_input_tensor is passed in, then input_tensor of shape [batch_size, sequence_size, hidden_size] is only used for Query, and kv_input_tensor of shape [batch_size, sequence_size, 2 * hidden_size] is used for Key and Value.\n For the sharded implementation, the input query, key and value are expected to be concatenated such that the heads are interleaved (q1 k1 v1…qn kn vn).", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "kv_input_tensor", "type": "Optional" } ], "results": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_heads", "type": "UI32Attr" }, { "name": "num_kv_heads", "type": "OptionalAttr" }, { "name": "transpose_key", "type": "BoolAttr" } ] }, { "name": "ttir.sqrt", "summary": "Eltwise square root.", "description": "The `sqrt` operation computes the square root of each element in the input tensor.\n\n For each element, it returns the square root of the value.\n\n Example:\n ```mlir\n // Compute square root of all elements in %input\n %result = ttir.sqrt(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.5882, 0.5, -3.3333, 0.2173], ... ]\n ```\n\n Mathematical definition: sqrt(x) = √x", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.square", "summary": "Eltwise square.", "description": "The `square` operation computes the square of each element in the input tensor (x * x).\n\n Example:\n ```mlir\n %result = ttir.square(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.squeeze", "summary": "Tensor dimension squeezing operation.", "description": "The `squeeze` operation removes a dimension of size 1 from the shape of a tensor.\n\n This operation is commonly used to eliminate unnecessary singleton dimensions from a tensor's shape.\n It specifies which dimension to remove using the `dim` attribute. The specified dimension must have size 1.\n\n Example:\n ```mlir\n // Squeeze dimension 0 from a tensor of shape [1, 3, 4]\n %input = ... : tensor<1x3x4xf32> // Input tensor with shape [1, 3, 4]\n %result = ttir.squeeze(%input) {\n dim = 0 : i32 // Dimension to squeeze\n } : (tensor<1x3x4xf32>) -> tensor<3x4xf32>\n // Result: tensor with shape [3, 4]\n\n // Squeeze dimension 1 from a tensor of shape [2, 1, 3]\n %input = ... : tensor<2x1x3xf32> // Input tensor with shape [2, 1, 3]\n %result = ttir.squeeze(%input) {\n dim = 1 : i32 // Dimension to squeeze\n } : (tensor<2x1x3xf32>) -> tensor<2x3xf32>\n // Result: tensor with shape [2, 3]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to squeeze.\n\n Attributes:\n - `dim` (Integer): The dimension to squeeze.\n\n Output:\n - `result` (Tensor): The squeezed tensor.\n\n Note: The specified dimension must have size 1. The shape of the output tensor is the same as the\n input tensor with the specified dimension removed. For example, squeezing dimension 1 of a tensor\n with shape [2, 1, 3] results in a tensor with shape [2, 3].", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttir.subtract", "summary": "Elementwise subtract operation.", "description": "The `subtract` operation performs an elementwise subtraction between two tensors.\n\n For each pair of corresponding elements, it subtracts the element in the second tensor from\n the element in the first tensor and places the result in the output tensor.\n\n Example:\n ```mlir\n // Subtraction operation\n %result = ttir.subtract(%lhs, %rhs) : (tensor<3xi32>, tensor<3xi32>) -> tensor<3xi32>\n // Input tensors:\n // %lhs: [10, 20, 30]\n // %rhs: [1, 2, 3]\n // Output tensor:\n // [9, 18, 27]\n\n // Example with floating point values\n %result = ttir.subtract(%float_lhs, %float_rhs) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32>\n // Input tensors:\n // %float_lhs: [3.5, 0.0, -1.2]\n // %float_rhs: [1.5, 2.0, -3.2]\n // Output tensor:\n // [2.0, -2.0, 2.0]\n ```\n\n Note: The data type of the output tensor matches the data type of the input tensors.\n\n Mathematical definition: subtract(x, y) = x - y", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.sum", "summary": "Sum reduction operation.", "description": "The `sum` operation computes the sum of elements along specified dimensions of the input tensor.\n\n This operation reduces the input tensor by computing the sum of all elements along the dimensions\n specified in `dim_arg`. If `dim_arg` is not provided, the sum is computed over all dimensions,\n resulting in a scalar value. If `keep_dim` is set to true, the reduced dimensions are retained\n with a size of 1.\n\n Example:\n ```mlir\n // Sum along dimension 1\n %input = ... : tensor<2x3xf32>\n %result = ttir.sum(%input) {keep_dim = false, dim_arg = [1: i32]} : (tensor<2x3xf32>) -> tensor<2xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // [6.0, 15.0] // Sum of each row\n\n // Sum along dimension 0\n %input = ... : tensor<2x3xf32>\n %result = ttir.sum(%input) {keep_dim = false, dim_arg = [0: i32]} : (tensor<2x3xf32>) -> tensor<3xf32>\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // [5.0, 7.0, 9.0] // Sum of each column\n\n // Sum over all dimensions\n %input = ... : tensor<2x3xf32>\n %result = ttir.sum(%input) {keep_dim = false} : (tensor<2x3xf32>) -> tensor\n // Input tensor:\n // [[1.0, 2.0, 3.0],\n // [4.0, 5.0, 6.0]]\n // Output tensor:\n // 21.0 // Sum of all elements\n ```\n\n Mathematical definition: sum(x, dim) = ∑ x[i] for all i in dimension dim\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `keep_dim` (Bool): Whether to keep the reduced dimensions or not.\n - `dim_arg` (Array of Int32): Dimensions to reduce along.\n\n Output:\n - `result` (Tensor): The result tensor after applying the reduction.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" } ] }, { "name": "ttir.tan", "summary": "Elementwise tan operation.", "description": "The `tan` operation computes the tangent of each element in the input tensor.\n\n For each element, it returns the tangent of the angle in radians.\n\n Example:\n ```mlir\n // Compute tangent of all elements in %input\n %result = ttir.tan(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.9601, 0.5403, -0.3, 4.5], ... ]\n ```\n\n Mathematical definition: tan(x) = sin(x) / cos(x)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.tanh", "summary": "Elementwise hyperbolic tangent operation.", "description": "The `tanh` operation computes the hyperbolic tangent of each element in the input tensor.\n\n For each element, it returns the hyperbolic tangent of the value.\n\n Example:\n ```mlir\n // Compute hyperbolic tangent of all elements in %input\n %result = ttir.tanh(%input) : (tensor<4x4xf32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1.7, 2.0, -0.3, 4.5], ... ]\n // Output tensor:\n // [[0.9601, 0.5403, -0.3, 4.5], ... ]\n ```\n\n Mathematical definition: tanh(x) = (e^x - e^-x) / (e^x + e^-x)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.to_layout", "summary": "Layout op.", "description": "ToLayout operation, transition tensors from one layout to another. Some examples include:\n - Transitioning between different memory spaces, e.g. DRAM to L1.\n - Transitioning between different data types, e.g. f32 to f16.\n - Transitioning between different tile sizes, e.g. 1x16 to 32x32\n - Transitioning between different tensor sharding\n - Some combination of the above\n\n ```llvm\n #layout = #ttcore.metal_layout : tensor<2x2xi64>, system, sharded>\n #layout1 = #ttcore.metal_layout : tensor<2x2xi64>, l1, sharded>\n %1 = \"ttir.to_layout\"(%arg0, %0) : (tensor<64x128xf32, #layout>, tensor<64x128xf32, #layout1>) -> tensor<64x128xf32, #layout1>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensorOrMemRef" }, { "name": "output", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$input `,` $output `:` type($input) `into` type($output) (`hostInfo` `=` $layout^)? attr-dict (`->` type($results)^)?" }, { "name": "ttir.topk", "summary": "Top-K selection operation.", "description": "Returns the `k` largest or `k` smallest elements of the `input_tensor` along a given dimension `dim`.\n If `dim` is not provided, the last dimension of the input_tensor is used.\n If `largest` is True, the `k` largest elements are returned. Otherwise, the `k` smallest elements are returned.\n The boolean option `sorted` if True, will make sure that the returned `k` elements are sorted.", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" } ], "results": [ { "name": "values", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "k", "type": "I32Attr" }, { "name": "dim", "type": "DefaultValuedAttr" }, { "name": "largest", "type": "DefaultValuedAttr" }, { "name": "sorted", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.topk_router_gpt", "summary": "Fused router linear layer for GPT-style mixture-of-experts models.", "description": "A fused multi-core matmul + top-k for the GPT-OSS MoE router. Computes the\n router logits via a linear projection (input @ weight + bias) and returns\n the top-k expert indices and weights for each token.\n\n Inputs:\n - input: [B, hidden_dim] bf16 hidden states\n - weight: [hidden_dim, num_experts] bf16 router weight matrix\n - bias: [B, num_experts] bf16 router bias (pre-broadcast across batch)\n\n Outputs:\n - expert_indices: [B, k_padded] ui16 top-k expert indices\n - expert_weights: [B, k_padded] bf16 top-k router weights\n\n where k_padded = round_up(k, 8).", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyRankedTensor" } ], "results": [ { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_weights", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "k", "type": "I32Attr" }, { "name": "num_experts", "type": "I32Attr" } ] }, { "name": "ttir.transpose", "summary": "Tensor transpose operation.", "description": "The `transpose` operation swaps two dimensions of a tensor.\n\n This operation exchanges the positions of two specified dimensions in the input tensor,\n effectively transposing those dimensions. The shape of the output tensor is the same as\n the input tensor, except that the dimensions specified by `dim0` and `dim1` are swapped.\n\n Example:\n ```mlir\n // Transpose dimensions 0 and 1\n %input = ... : tensor<2x3x4xf32>\n %result = ttir.transpose(%input) {dim0 = 0 : i32, dim1 = 1 : i32} : (tensor<2x3x4xf32>) -> tensor<3x2x4xf32>\n // Input tensor shape: [2, 3, 4]\n // Output tensor shape: [3, 2, 4]\n\n // Transpose dimensions 1 and 2\n %input = ... : tensor<2x3x4xf32>\n %result = ttir.transpose(%input) {dim0 = 1 : i32, dim1 = 2 : i32} : (tensor<2x3x4xf32>) -> tensor<2x4x3xf32>\n // Input tensor shape: [2, 3, 4]\n // Output tensor shape: [2, 4, 3]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Attributes:\n - `dim0` (Integer): The first dimension to swap.\n - `dim1` (Integer): The second dimension to swap.\n\n Output:\n - `result` (Tensor): The transposed tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim0", "type": "SI32Attr" }, { "name": "dim1", "type": "SI32Attr" } ] }, { "name": "ttir.trunc", "summary": "Elementwise truncation toward zero.", "description": "For each element x, returns the value truncated toward zero (round toward zero),\n preserving the tensor element type.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.tt_lang_op", "summary": "Opaque tt-lang custom kernel placeholder.", "description": "Represents an invocation of a user-defined tt-lang operation registered via\n `@tt_torch.tt_lang_operation`. The kernel body is opaque to TTIR: its operands and\n results are fully typed so type / shape / layout inference on adjacent ops\n still works (in particular through Shardy and shape refinement), but TTIR\n does not look inside the kernel body. The kernel is materialised later by\n the tt-xla plugin via a Python bridge into tt-lang.\n\n NOTE: tt-lang kernels expect 32x32 tile layout. Attaching `TTIROpInterface`\n allows TTNN's `TTNNLayoutRewriter` to correct this ops operands and output\n to have the same matching correct layout type.\n\n Lowered from `stablehlo.custom_call @tt.tt_lang_op` (carrying the same\n metadata in `mhlo.frontend_attributes`) and to `ttnn.tt_lang_op` by the\n TTIR -> TTNN conversion.\n\n Attributes:\n - `kernel_id`: stable identifier of the @tt_torch.tt_lang_operation registration\n (e.g. `\"my_module.my_kernel::v1\"`).\n - `version_tag`: identifier the kernel author bumps to force recompile.\n - `arg_roles`: comma-separated roles for `inputs` (e.g. `\"in,in,out\"`).\n Constrained to the form `in* out+` (all inputs first, then all\n outputs). The `out`-roled operands are the trailing\n destination-passing-style init operands and tie positionally to\n `results`.\n - `shard_spec`: optional opaque shard description forwarded to the\n resolver. Empty string means \"no spec\".\n\n Example:\n ```mlir\n %0 = ttir.tt_lang_op(%a, %b) {\n kernel_id = \"my_pkg.softmax::v1\",\n version_tag = \"1.0\",\n arg_roles = \"in,out\",\n shard_spec = \"\"\n } : (tensor<1x32xf32>, tensor<1x32xf32>) -> (tensor<1x32xf32>)\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "kernel_id", "type": "StrAttr" }, { "name": "version_tag", "type": "StrAttr" }, { "name": "arg_roles", "type": "StrAttr" }, { "name": "shard_spec", "type": "DefaultValuedStrAttr" } ], "assemblyFormat": "`(` $inputs `)` attr-dict `:` `(` type($inputs) `)` `->` `(` type($results) `)`" }, { "name": "ttir.ttnn_metal_layout_cast", "summary": "Cast TTNN layout-encoded tensor to/from TTCore metal layout-encoded tensor", "description": "Purely representational op that reinterprets a tensor's layout encoding from `#ttnn.ttnn_layout<...>`\n to/from `#ttcore.metal_layout<...>` without modifying the underlying data.\n\n Pre-bufferization, the input and output must be a RankedTensorType where one holds a\n `ttnn::TTNNLayoutAttr` and the other, a `ttcore::MetalLayoutAttr`. Post bufferization,\n the tensor encoded with a `ttcore::MetalLayoutAttr` is bufferized to a memref.\n\n Examples:\n ```\n %cast_to_metal = ttir.ttnn_metal_layout_cast %arg0\n : tensor<32x32xf32, #ttnn.ttnn_layout<...>>\n -> tensor<32x32xf32, #ttcore.metal_layout<...>>\n\n %cast_to_metal_bufferized = ttir.ttnn_metal_layout_cast %arg0\n : tensor<32x32xf32, #ttnn.ttnn_layout<...>>\n -> memref<32x32xf32, ...>\n\n %cast_to_ttnn = ttir.ttnn_metal_layout_cast %arg0\n : tensor<32x32xf32, #ttcore.metal_layout<...>>\n -> tensor<32x32xf32, #ttnn.ttnn_layout<...>>\n\n %cast_to_ttnn_bufferized = ttir.ttnn_metal_layout_cast %arg0\n : memref<32x32xf32, ...>\n -> tensor<32x32xf32, #ttnn.ttnn_layout<...>>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensorOrMemRef" } ], "results": [ { "name": "result", "type": "AnyRankedTensorOrMemRef" } ], "attributes": [ { "name": "virtual_grid_inverse_mapping", "type": "OptionalAttr" }, { "name": "virtual_grid_forward_mapping", "type": "OptionalAttr" } ], "assemblyFormat": "$input attr-dict `:` type($input) `->` type($result)" }, { "name": "ttir.typecast", "summary": "Elementwise type casting operation.", "description": "The `typecast` operation converts each element in the input tensor to a different data type.\n\n This operation performs element-wise type conversion, such as converting from integers to\n floating-point values or between different floating-point precisions. The conversion follows\n the standard type conversion rules for the target platform.\n\n Example:\n ```mlir\n // Cast from int32 to float32\n %result = ttir.typecast(%input) : (tensor<4x4xi32>) -> tensor<4x4xf32>\n // Input tensor:\n // [[1, 2, -3, 4], ... ]\n // Output tensor:\n // [[1.0, 2.0, -3.0, 4.0], ... ]\n\n // Cast from float32 to int32\n %result = ttir.typecast(%float_input) : (tensor<3xf32>) -> tensor<3xi32>\n // Input tensor:\n // [1.7, -2.3, 3.0]\n // Output tensor:\n // [1, -2, 3] // Note: truncation, not rounding\n\n // Cast from float32 to float64 (higher precision)\n %result = ttir.typecast(%f32_input) : (tensor<2xf32>) -> tensor<2xf64>\n // Input tensor:\n // [3.14159, 2.71828]\n // Output tensor:\n // [3.14159, 2.71828] // Same values but with higher precision\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "conservative_folding", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.unsqueeze", "summary": "Tensor dimension insertion operation.", "description": "The `unsqueeze` operation inserts a dimension of size 1 into the shape of a tensor.\n\n This operation is the inverse of the `squeeze` operation and is commonly used to add a singleton dimension\n to a tensor's shape. It specifies which position to insert the new dimension using the `dim` attribute.\n\n Example:\n ```mlir\n // Insert a dimension at position 0 of a tensor with shape [3, 4]\n %input = ... : tensor<3x4xf32> // Input tensor with shape [3, 4]\n %result = ttir.unsqueeze(%input) {\n dim = 0 : i32 // Position to insert the new dimension\n } : (tensor<3x4xf32>) -> tensor<1x3x4xf32>\n // Result: tensor with shape [1, 3, 4]\n\n // Insert a dimension at position 1 of a tensor with shape [2, 3]\n %input = ... : tensor<2x3xf32> // Input tensor with shape [2, 3]\n %result = ttir.unsqueeze(%input) {\n dim = 1 : i32 // Position to insert the new dimension\n } : (tensor<2x3xf32>) -> tensor<2x1x3xf32>\n // Result: tensor with shape [2, 1, 3]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to unsqueeze.\n\n Attributes:\n - `dim` (Integer): The position to insert the new dimension.\n\n Output:\n - `result` (Tensor): The unsqueezed tensor.\n\n Note: The shape of the output tensor is the same as the input tensor with a new dimension of size 1\n inserted at the specified position. For example, unsqueezing at position 1 of a tensor with shape [2, 3]\n results in a tensor with shape [2, 1, 3].", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttir.update_cache", "summary": "Cache update operation.", "description": "The `update_cache` operation updates a cache tensor with values from an input tensor at specific indices.\n\n This operation is commonly used in sequence models like transformers to update a key-value cache\n with new token information. It takes a cache tensor, an input tensor, and update indices, and\n updates the cache at the specified positions.\n\n Example:\n ```mlir\n // Update cache at specific indices\n %cache = ... : tensor<2x16x64xf32> // Batch size 2, sequence length 16, hidden dim 64\n %input = ... : tensor<2x1x64xf32> // New token embeddings\n %update_index = ... : tensor<1xi32> // Update at position [15]\n %result = ttir.update_cache(%cache, %input, %update_index) {batch_offset = 0 : i32} :\n tensor<2x16x64xf32>, tensor<2x1x64xf32>, tensor<1xi32> -> tensor<2x16x64xf32>\n // The cache tensor is updated at position 15 for both batches with the values from input\n ```\n\n Inputs:\n - `cache` (Tensor): The cache tensor to be updated.\n - `input` (Tensor): The input tensor containing new values.\n - `update_index` (Tensor): Indices specifying where to update the cache.\n\n Attributes:\n - `batch_offset` (Integer): Offset in the batch dimension.\n\n Output:\n - `result` (Tensor): The updated cache tensor.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" }, { "name": "update_index", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_offset", "type": "I32Attr" } ] }, { "name": "ttir.upsample2d", "summary": "Upsample 2D operation.", "description": "The `upsample2d` operation increases the spatial dimensions (height and width) of an input tensor.\n\n This operation is commonly used in neural networks to increase the spatial resolution of feature maps.\n It supports different upsampling algorithms such as \"nearest\" and \"bilinear\" interpolation.\n The input tensor is assumed to be in NHWC format (batch, height, width, channels).\n\n Example:\n ```mlir\n // Upsample a tensor with different scale factors for height and width\n %input = ... : tensor<10x64x32x3xbf16> // Input tensor: [batch=10, height=64, width=32, channels=3]\n %result = ttir.upsample2d(%input) {\n scale_factor = [2, 4], // Scale height by 2, width by 4\n mode = \"bilinear\" // Use bilinear interpolation\n } : (tensor<10x64x32x3xbf16>) -> tensor<10x128x128x3xbf16>\n // Result: tensor with shape [10,128,128,3]\n\n // Upsample with the same scale factor for both dimensions\n %input = ... : tensor<1x32x32x16xf32> // Input tensor\n %result = ttir.upsample2d(%input) {\n scale_factor = 2, // Scale both height and width by 2\n mode = \"nearest\" // Use nearest neighbor interpolation\n } : (tensor<1x32x32x16xf32>) -> tensor<1x64x64x16xf32>\n // Result: tensor with shape [1,64,64,16]\n ```\n\n Inputs:\n - `input` (Tensor): The input tensor to upsample, in NHWC format.\n\n Attributes:\n - `scale_factor` (Integer or Array of Integer): The scale factor for upsampling in height and width dimensions.\n If a single integer is provided, it's used for both dimensions. If an array is provided, the first value\n is used for height and the second for width.\n - `mode` (String, default=\"nearest\"): The upsampling algorithm to use. Currently supported values are\n \"nearest\" for nearest neighbor interpolation and \"bilinear\" for bilinear interpolation.\n\n Output:\n - `result` (Tensor): The upsampled tensor.\n\n Note: The output height is calculated as input_height * scale_factor[0] and the output width as\n input_width * scale_factor[1]. The batch and channel dimensions remain unchanged.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale_factor", "type": "AnyAttrOf<[SI32Attr, DenseI32ArrayAttr]>" }, { "name": "mode", "type": "DefaultValuedAttr" } ] }, { "name": "ttir.where", "summary": "Elementwise conditional selection operation based on a predicate.", "description": "The `where` operation performs element-wise conditional selection based on a predicate.\n\n For each element position, it selects between two values based on a boolean condition in first tensor:\n - If the condition is true (non-zero), it selects the corresponding element from the second tensor\n - If the condition is false (zero), it selects the corresponding element from the third tensor\n\n This operation supports broadcasting, allowing inputs of different shapes to be combined\n according to standard broadcasting rules.\n\n Example:\n ```mlir\n // Select elements from %true_values where %condition is true,\n // otherwise select from %false_values\n %result = ttir.where(%condition, %true_values, %false_values) : (tensor<4x4xi1>, tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xf32>\n\n // With broadcasting (condition is a scalar)\n %result = ttir.where(%scalar_condition, %true_values, %false_values) : (tensor<1xi1>, tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xf32>\n ```\n\n This operation is equivalent to the ternary conditional operator (`condition ? true_value : false_value`)\n in many programming languages, applied elementwise across tensors.", "operands": [ { "name": "first", "type": "AnyRankedTensor" }, { "name": "second", "type": "AnyRankedTensor" }, { "name": "third", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttir.zeros", "summary": "Creates a tensor filled with zeros.", "description": "The `zeros` operation creates a tensor filled with zeros of the specified shape.\n\n This operation is commonly used to initialize tensors with zero values. It takes a shape attribute\n and produces a tensor of that shape with all elements set to zero.\n\n Example:\n ```mlir\n // Create a 3D tensor of zeros with shape [64, 28, 28]\n %result = ttir.zeros() {\n shape = [64, 28, 28]\n } : () -> tensor<64x28x28xbf16>\n // Result: A tensor of shape [64, 28, 28] filled with zeros\n\n // Create a 2D tensor of zeros with shape [3, 4]\n %result = ttir.zeros() {\n shape = [3, 4]\n } : () -> tensor<3x4xf32>\n // Result: [[0.0, 0.0, 0.0, 0.0],\n // [0.0, 0.0, 0.0, 0.0],\n // [0.0, 0.0, 0.0, 0.0]]\n ```\n\n Attributes:\n - `shape` (Array of Integer): The shape of the tensor to create.\n\n Output:\n - `result` (Tensor): The tensor filled with zeros.\n\n Note: The element type of the result tensor is determined by the return type specified in the operation.\n This operation is useful for initializing tensors before filling them with computed values or as a\n starting point for accumulation operations.", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "DenseI32ArrayAttr" } ] }, { "name": "ttkernel.abs_tile", "summary": "Absolute value tile in the DST at specified index.", "description": "Performs element-wise computation of absolute value operation\n DST[dst0_index] <- abs(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.abs_tile_init", "summary": "Init function for abs_tile operation. Refer to documentation for any init function.", "description": "Must be run before abs_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.abs_tile_int32", "summary": "Absolute value i32 tile in the DST at specified index.", "description": "Performs element-wise computation of absolute value operation\n DST[dst0_index] <- abs(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.acos_tile", "summary": "Arccosine tile in the DST at specified index.", "description": "Performs element-wise computation of arccosine operation\n DST[dst0_index] <- acos(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.acos_tile_init", "summary": "Init function for acos_tile operation. Refer to documentation for any init function.", "description": "Must be run before acos_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_binary_tile", "summary": "Addition operation between two tiles", "description": "Performs element-wise computation of addition operation\n DST[odst_index] <- DST[dst0_index] + DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_binary_tile_init", "summary": "Short init function", "description": "Must be run before add_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_int_tile", "summary": "Integer addition operation between two tiles", "description": "Performs element-wise computation of integer addition operation\n DST[odst_index] <- DST[dst0_index] + DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n Supported data formats are: Int32, UInt32, UInt16.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_int_tile_init", "summary": "Short init function", "description": "Must be run before add_int_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_tiles", "summary": "Add operation", "description": "Performs element-wise addition C=A+B of tiles in two CBs at given indices\n and writes the result to the DST register at index dst_tile_index. The DST\n register buffer must be in acquired state via *tile_regs_acquire* call. This call\n is blocking and is only available on the compute engine.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "in0_tile_index", "type": "IndexLike" }, { "name": "in1_tile_index", "type": "IndexLike" }, { "name": "dst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `,` $in0_tile_index `,` $in1_tile_index `,` $dst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_tiles_init", "summary": "Short init function", "description": "Must be run before add_tiles.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_unary_tile", "summary": "Add by scalar operation", "description": "Performs element-wise addition of a tile by a scalar value.\n DST[dst0_index] <- DST[dst0_index] + scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.add_unary_tile_int32", "summary": "Add by int32 scalar operation", "description": "Performs element-wise addition of an int32 tile by an int32 scalar value.\n DST[dst0_index] <- DST[dst0_index] + scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.asin_tile", "summary": "Arcsine tile in the DST at specified index.", "description": "Performs element-wise computation of arcsine operation\n DST[dst0_index] <- asin(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.asin_tile_init", "summary": "Init function for asin_tile operation. Refer to documentation for any init function.", "description": "Must be run before asin_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.atan_tile", "summary": "Arctangent tile in the DST at specified index.", "description": "Performs element-wise computation of arctangent operation\n DST[dst0_index] <- atan(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.atan_tile_init", "summary": "Init function for atan_tile operation. Refer to documentation for any init function.", "description": "Must be run before atan_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.atan2_binary_tile", "summary": "Elementwise atan2 operation between two tiles", "description": "Performs element-wise computation of atan2 operation\n DST[odst_index] <- atan2(DST[dst0_index], DST[dst1_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *acquire_dst* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.atan2_binary_tile_init", "summary": "Short init function", "description": "Must be run before atan2_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.bfloat16_greater", "summary": "Compare two bfloat16 values using integer arithmetic.", "description": "Returns true if bf16_a > bf16_b. Operates on raw bits in int16 format\n representation. Maps to bfloat16_greater() in device code.", "operands": [ { "name": "bf16_a", "type": "I16" }, { "name": "bf16_b", "type": "I16" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $bf16_a `,` $bf16_b `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_bitwise_tile_init", "summary": "Init function for binary bitwise operations (AND, OR, XOR). Refer to documentation for any init function.", "description": "Must be run before bitwise_and_binary_tile, bitwise_or_binary_tile, or bitwise_xor_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_dest_reuse_tiles", "summary": "Binary op with one operand from DST", "description": "Performs element-wise binary op where one operand comes from DST and one\n from a CB. If reuse_type is dest_to_srca, DST[dst_tile_index] is loaded\n to SRCA and CB tile is loaded to SRCB. If dest_to_srcb, the opposite.\n Result is written back to DST[dst_tile_index].\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n `eltwise_binary_type` specifies the operation (add/sub/mul).", "operands": [ { "name": "in_cb", "type": "TTKernel_CB" }, { "name": "in_tile_index", "type": "IndexLike" }, { "name": "dst_tile_index", "type": "IndexLike" } ], "attributes": [ { "name": "eltwise_binary_type", "type": "TTKernel_EltwiseBinaryTypeAttr{add|sub|mul}" }, { "name": "reuse_type", "type": "TTKernel_BinaryDestReuseTypeAttr{dest_to_srca|dest_to_srcb}" } ], "assemblyFormat": "`(` $in_cb `,` $in_tile_index `,` $dst_tile_index `,` $eltwise_binary_type `,` $reuse_type `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_dest_reuse_tiles_init", "summary": "Init for binary op with dest reuse", "description": "Init function for binary_dest_reuse_tiles operation.\n Must be run before binary_dest_reuse_tiles.\n `eltwise_binary_type` specifies the operation (add/sub/mul).\n `reuse_type` specifies which source register gets the DST operand.", "operands": [ { "name": "in_cb", "type": "TTKernel_CB" } ], "attributes": [ { "name": "eltwise_binary_type", "type": "TTKernel_EltwiseBinaryTypeAttr{add|sub|mul}" }, { "name": "reuse_type", "type": "TTKernel_BinaryDestReuseTypeAttr{dest_to_srca|dest_to_srcb}" } ], "assemblyFormat": "`(` $in_cb `,` $eltwise_binary_type `,` $reuse_type `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_left_shift_tile", "summary": "Elementwise left shift between two tiles", "description": "Performs element-wise computation of a left shift operation\n DST[odst_index] <- DST[dst0_index] << DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_logical_right_shift_tile", "summary": "Elementwise logical right shift between two tiles", "description": "Performs element-wise computation of a logical right shift operation\n DST[odst_index] <- DST[dst0_index] >> DST[dst1_index] (zero-filled)\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_max_int32_tile", "summary": "Integer elementwise maximum operation between two tiles", "description": "Performs element-wise computation of integer maximum operation\n DST[odst_index] <- max(DST[dst0_index], DST[dst1_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *acquire_dst* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_max_int32_tile_init", "summary": "Short init function", "description": "Must be run before binary_max_int32_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_max_tile", "summary": "Elementwise maximum operation", "description": "Performs element-wise computation of maximum operation\n DST[odst_index] <- max(DST[dst0_index], DST[dst1_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *acquire_dst* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_max_tile_init", "summary": "Short init function", "description": "Must be run before binary_max_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_min_int32_tile", "summary": "Integer elementwise minimum operation between two tiles", "description": "Performs element-wise computation of integer minimum operation\n DST[odst_index] <- min(DST[dst0_index], DST[dst1_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *acquire_dst* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_min_int32_tile_init", "summary": "Short init function", "description": "Must be run before binary_min_int32_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_min_tile", "summary": "Elementwise minimum operation", "description": "Performs element-wise computation of minimum operation\n DST[odst_index] <- min(DST[dst0_index], DST[dst1_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *acquire_dst* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_min_tile_init", "summary": "Short init function", "description": "Must be run before binary_min_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_op_init_common", "summary": "Init function for all binary ops", "description": "Followed by the specific init required with an opcode (binrary_op_specific_init).", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "out_cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `,` $out_cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_right_shift_tile", "summary": "Elementwise arithmetic right shift between two tiles", "description": "Performs element-wise computation of an arithmetic right shift\n operation DST[odst_index] <- DST[dst0_index] >> DST[dst1_index]\n (sign-preserving) on DST register operands. The DST register buffer must\n be in acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binary_shift_tile_init", "summary": "Init function for binary shift tile operations (left / right / logical right). Refer to documentation for any init function.", "description": "Must be run before binary_left_shift_tile, binary_right_shift_tile, or binary_logical_right_shift_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.binop_with_scalar_tile_init", "summary": "Init function for binary operations with scalar tile operations.", "description": "Must be run before binary operations with scalar like mul_unary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.bitcast", "summary": "Reinterpret a ui32 compile-time arg value as a scalar type.", "description": "Reinterprets the bits of a ui32 compile-time arg as the given type.\n Used to recover typed scalar kernel arguments after reading them from\n the compile-time arg slot (which always stores ui32).", "operands": [ { "name": "input", "type": "UI32" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "ttkernel.bitwise_and_binary_tile", "summary": "Bitwise AND operation between two tiles", "description": "Performs element-wise computation of bitwise AND operation\n DST[odst_index] <- DST[dst0_index] & DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.bitwise_not_tile", "summary": "Bitwise Not operation on tile in the DST at specified index.", "description": "Performs element-wise computation of sign operation\n DST[tile_index] <- bitwise_not(DST[tile_index])\n on DST register operands.\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.bitwise_not_tile_init", "summary": "Init function for bitwise_not_tile operation. Refer to documentation for any init function.", "description": "Must be run before bitwise_not_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.bitwise_or_binary_tile", "summary": "Bitwise OR operation between two tiles", "description": "Performs element-wise computation of bitwise OR operation\n DST[odst_index] <- DST[dst0_index] | DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.bitwise_xor_binary_tile", "summary": "Bitwise XOR operation between two tiles", "description": "Performs element-wise computation of bitwise XOR operation\n DST[odst_index] <- DST[dst0_index] ^ DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.cb_pop_front", "summary": "CBPopFront call.", "description": "CBPopFront operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" }, { "name": "numPages", "type": "I32" } ], "assemblyFormat": "`(` $cb `,` $numPages `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.cb_port", "summary": "Get a CB by its hardware port index.", "description": "Produces a CB value for the given hardware port index. Unlike\n `get_compile_time_arg_val`, the port is resolved directly at\n code-generation time rather than going through the compile-time\n argument indirection.", "results": [ { "name": "result", "type": "TTKernel_CB" } ], "attributes": [ { "name": "port", "type": "I32Attr" } ], "assemblyFormat": "`(` $port `)` attr-dict `:` type($result)" }, { "name": "ttkernel.cb_push_back", "summary": "CBPushBack call.", "description": "CBPushBack operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" }, { "name": "numPages", "type": "I32" } ], "assemblyFormat": "`(` $cb `,` $numPages `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.cb_reserve_back", "summary": "CBReserveBack call.", "description": "CBReserveBack operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" }, { "name": "numPages", "type": "I32" } ], "assemblyFormat": "`(` $cb `,` $numPages `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.cb_wait_front", "summary": "CBWaitFront call.", "description": "CBWaitFront operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" }, { "name": "numPages", "type": "I32" } ], "assemblyFormat": "`(` $cb `,` $numPages `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ceil_tile", "summary": "Ceil tile in the DST at specified index.", "description": "Performs element-wise computation of ceil operation\n DST[dst0_index] <- ceil(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.clamp_tile", "summary": "Clamp tile elements to scalar range", "description": "Performs element-wise clamping of tile values to the range [min, max]\n DST[dst_index] <- clamp(DST[dst_index], min, max)\n on DST register operand. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n min and max are uint 32-bit representations of the float values.", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "min_param", "type": "I32" }, { "name": "max_param", "type": "I32" } ], "assemblyFormat": "`(` $dst_index `,` $min_param `,` $max_param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.clamp_tile_init", "summary": "Init function for clamp_scalar_tile operation.", "description": "Must be run before clamp_scalar_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.clamp_tile_int32", "summary": "Clamp int32 tile elements to scalar range", "description": "Performs element-wise clamping of int32 tile values to the range [min, max]\n DST[dst_index] <- clamp(DST[dst_index], min, max)\n on DST register operand. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n min and max are int32 values.", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "min_param", "type": "I32" }, { "name": "max_param", "type": "I32" } ], "assemblyFormat": "`(` $dst_index `,` $min_param `,` $max_param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.compute_kernel_hw_startup", "summary": "compute_kernel_hw_startup", "description": "Must be run at the start of compute kernel.", "operands": [ { "name": "icb0", "type": "TTKernel_CB" }, { "name": "icb1", "type": "Optional" }, { "name": "ocb", "type": "TTKernel_CB" } ], "hasCustomAssemblyFormat": true }, { "name": "ttkernel.copy_block_matmul_partials", "summary": "CopyBlockMatmulPartials op.", "description": "Copies ntiles consecutive tiles from a specified circular buffer starting\n at start_tile_index to consecutive DST register slots starting at\n start_dst_index. The function employs the unpacker to first unpack into\n SRC registers and then move into DST registers.\n\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.\n\n A typical use case is reloading partial matmul results from a CB back\n into DST for further accumulation. The consumer first calls cb_wait_front\n to ensure tiles are available, then calls copy_block_matmul_partials to\n load the block into DST, accumulates with subsequent matmul operations,\n and finally packs the results back to a CB.", "operands": [ { "name": "cb", "type": "TTKernel_CB" }, { "name": "start_tile_index", "type": "IndexLike" }, { "name": "start_dst_index", "type": "IndexLike" }, { "name": "ntiles", "type": "IndexLike" } ], "assemblyFormat": "`(` $cb `,` $start_tile_index `,` $start_dst_index `,` $ntiles `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.copy_dest_values", "summary": "Copies all values from the tile at idst_in to the tile at idst_out in the DST register buffer.", "description": "Copies all values from the tile at idst_in to the tile at idst_out in the DST\n register buffer. Performs element-wise copy: DST[idst_out] <- DST[idst_in].\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.\n\n Lowers to: copy_dest_values(idst_in, idst_out).", "operands": [ { "name": "idst_in", "type": "IndexLike" }, { "name": "idst_out", "type": "IndexLike" } ], "attributes": [ { "name": "data_format", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $idst_in `,` $idst_out `,` $data_format `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.copy_dest_values_init", "summary": "Short init function", "description": "Must be run before copy_dest_values.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.copy_tile", "summary": "Copy tile from specified CB to DST.", "description": "Copies a single tile from the specified input CB and writes the result to\n DST at a specified index. The function will employ unpacker to first unpack into SRC\n registers and then perform move into DST registers, at a specified index.\n For the in_tile_index to be valid for this call, cb_wait_front(n) had to be\n previously called to ensure that at least some number n>0 of tiles are available\n in the input CB. The CB index 0 then references the first tile in the received section of the CB,\n up to index n-1 (in a FIFO order). The DST register buffer must be in acquired state via\n tile_regs_acquire call. This call is blocking and is only available on the compute\n engine.", "operands": [ { "name": "cb0", "type": "TTKernel_CB" }, { "name": "tile_index_cb", "type": "IndexLike" }, { "name": "tile_index_dst", "type": "IndexLike" } ], "assemblyFormat": "`(` $cb0 `,` $tile_index_cb `,` $tile_index_dst `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.copy_tile_init", "summary": "Perform the init for copy tile. This does not reconfigure the unpacker data types.", "description": "Must be called before copy_tile.", "operands": [ { "name": "cb0", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cb0 `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.cos_tile", "summary": "Cos operation", "description": "Performs element-wise computation of the trigonometric cosine operation on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.cos_tile_init", "summary": "Short init function which configures compute unit for execution of cos_tile.", "description": "Must be run before cos_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.div_binary_tile", "summary": "Divide operation between two tiles", "description": "Performs element-wise computation of division operation\n DST[odst_index] <- DST[dst0_index] / DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.div_binary_tile_init", "summary": "Short init function", "description": "Must be run before div_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.div_unary_tile", "summary": "Divide by scalar operation", "description": "Performs element-wise division of a tile by a scalar value.\n DST[dst0_index] <- DST[dst0_index] / scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.dprint", "summary": "Print to output stream from kernel.", "description": "std::format style format string:\n ```c++\n rewriter.create(loc, \"nocY={} nocX={} addr={}\\\\n\",\n nocY, nocX, addr);\n ```\n ```\n ttkernel.dprint(\"virtY {} virtX {} addr {}\\\\n\", %14, %15, %13) : (index, index, i32)\n ```\n Notes:\n - Only trivial format specifier currently supported, i.e. `{}`.\n - Must double escape newline character or other special characters.\n - When a CB operand is provided, calls print_cb_details, printing underlying CB pointers and details.", "operands": [ { "name": "argv", "type": "Variadic" } ], "attributes": [ { "name": "fmt", "type": "StrAttr" } ], "assemblyFormat": "`(` $fmt (`,` $argv^)? `)` attr-dict `:` functional-type($argv, results)" }, { "name": "ttkernel.eq_binary_tile", "summary": "Equality operation between two tiles", "description": "Performs element-wise computation of equality operation\n DST[odst_index] <- DST[dst0_index] == DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.eq_binary_tile_init", "summary": "Short init function", "description": "Must be run before eq_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.eqz_tile", "summary": "Equal to zero tile in the DST at specified index.", "description": "Performs element-wise equality on DST register tiles.\n DST[dst0_index] <- (DST[dst0_index] == 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.eqz_tile_init", "summary": "Init function for eqz() operation. Refer to documentation for any init function.", "description": "Must be run before eqz_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.eqz_tile_int32", "summary": "Equal to zero tile in the DST at specified index.", "description": "Performs element-wise equality on DST register tiles for int32 data type.\n DST[dst0_index] <- (DST[dst0_index] == 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.erf_tile", "summary": "Erf operation", "description": "Performs element-wise computation of error function (erf) on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.erf_tile_init", "summary": "Short init function which configures compute unit for execution of erf_tile.", "description": "Must be run before erf_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.erfc_tile", "summary": "Erfc operation", "description": "Performs element-wise computation of complementary error function (erfc) on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.erfc_tile_init", "summary": "Short init function which configures compute unit for execution of erfc_tile.", "description": "Must be run before erfc_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.exp_tile", "summary": "Exp operation", "description": "Performs element-wise computation of exponential on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.\n\n The optional attributes map onto the metal template parameters\n `exp_tile(idst, vector_mode, scale)`.\n When all attributes are omitted the op lowers to a bare `exp_tile(idst)`\n call, preserving the metal defaults\n (approx=false, scale_en=false, input_clamping=ClampToNegative, iterations=8).\n `scale` holds the runtime scale argument; when present and not equal to\n the default 1.0 value it enables metal's `scale_en` template parameter and\n is emitted as the third positional argument with `vector_mode` defaulted\n to `VectorMode::RC`.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "attributes": [ { "name": "approx", "type": "OptionalAttr" }, { "name": "input_clamping", "type": "OptionalAttr" }, { "name": "iterations", "type": "OptionalAttr" }, { "name": "scale", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.exp_tile_init", "summary": "Short init function which configures compute unit for execution of exp_tile.", "description": "Must be run before exp_tile.\n\n The optional attributes map onto the metal template parameters\n `exp_tile_init()`.\n When all attributes are omitted the op lowers to a bare `exp_tile_init()`\n call, preserving the metal defaults\n (approx=false, scale=0x3F800000, input_clamping=ClampToNegative).", "attributes": [ { "name": "approx", "type": "OptionalAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "input_clamping", "type": "OptionalAttr" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.exp2_tile", "summary": "Exp2 operation", "description": "Performs element-wise computation of base-2 exponential (2^x) on each\n element of a tile in DST register at index tile_index. The DST register\n buffer must be in acquired state via *tile_regs_acquire* call. This call\n is blocking and is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.exp2_tile_init", "summary": "Short init function which configures compute unit for execution of exp2_tile.", "description": "Must be run before exp2_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::close_fabric_connections", "summary": "CloseFabricConnections", "description": "Close fabric connections.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" } ], "assemblyFormat": "`(` $fabric_connection_manager `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::convert_logical_x_to_translated", "summary": "ConvertLogicalToTranslatedX", "description": "this converts the x coordinate from the LOGICAL coordinate system to TRANSLATED", "operands": [ { "name": "logical_x", "type": "IndexLike" } ], "results": [ { "name": "virtual_x", "type": "IndexLike" } ], "assemblyFormat": "`(` $logical_x `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::convert_logical_y_to_translated", "summary": "ConvertLogicalToTranslatedY", "description": "this converts the y coordinate from the LOGICAL coordinate system to TRANSLATED", "operands": [ { "name": "logical_y", "type": "IndexLike" } ], "results": [ { "name": "virtual_y", "type": "IndexLike" } ], "assemblyFormat": "`(` $logical_y `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::create_fabric_connection_manager", "summary": "CreateFabricConnectionManager", "description": "Create fabric connection manager. The fabric connection manager is required for all fabric operations.", "results": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::fabric_fast_write_any_len", "summary": "FabricWriteOp", "description": "FabricWriteOp", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id", "type": "I16" }, { "name": "dst_addr", "type": "TTKernel_NocAddr" }, { "name": "src_addr", "type": "I32" }, { "name": "len_bytes", "type": "I32" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id `,` $dst_addr `,` $src_addr `,` $len_bytes `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::fabric_mcast_fast_write_any_len", "summary": "FabricMulticastWriteOp", "description": "FabricMulticastWriteOp", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id_start", "type": "I16" }, { "name": "dst_dev_id_end", "type": "I16" }, { "name": "dst_addr", "type": "TTKernel_NocAddr" }, { "name": "src_addr", "type": "I32" }, { "name": "len_bytes", "type": "I32" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id_start `,` $dst_dev_id_end `,` $dst_addr `,` $src_addr `,` $len_bytes `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::fabric_mcast_sem_inc", "summary": "FabricMulticastSemIncOp", "description": "FabricMulticastSemIncOp. This operation increments a semaphore on a range of remote devices.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id_start", "type": "I16" }, { "name": "dst_dev_id_end", "type": "I16" }, { "name": "semaphore_addr", "type": "TTKernel_NocAddr" }, { "name": "incr", "type": "IndexLike" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id_start `,` $dst_dev_id_end `,` $semaphore_addr `,` $incr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::fabric_sem_inc", "summary": "FabricSemIncOp", "description": "FabricSemIncOp. This operation increments a semaphore on a remote device.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id", "type": "I16" }, { "name": "semaphore_addr", "type": "TTKernel_NocAddr" }, { "name": "incr", "type": "IndexLike" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id `,` $semaphore_addr `,` $incr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::fill_arange_tile", "summary": "Experimental Write Full Linear Index Tile Op", "description": "Writes a full linear index tile pattern to a CB, where element[i,j] = i * 32 + j\n (0-1023) in the CB's native data format (Float32, Float16_b, or Int32).\n\n The resulting tile looks like:\n [[ 0, 1, 2, ..., 31],\n [ 32, 33, 34, ..., 63],\n ...\n [992, 993, 994, ..., 1023]]", "operands": [ { "name": "cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::get_device_id_from_logical_mesh_position", "summary": "GetDeviceIdFromLogicalMeshPosition", "description": "Get the device ID for a given logical mesh position.\n Takes a list of indices representing the logical mesh position and returns the corresponding device ID.\n Maps to get_device_id_from_logical_mesh_position(fcm, position) in device code.", "operands": [ { "name": "fcm", "type": "TTKernel_FabricConnectionManager" }, { "name": "position_indices", "type": "Variadic" } ], "results": [ { "name": "device_id", "type": "I16" } ], "assemblyFormat": "`(` $fcm `,` $position_indices `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::get_logical_mesh_position", "summary": "GetLogicalMeshPosition", "description": "Get the logical mesh position for a given device ID.", "operands": [ { "name": "fcm", "type": "TTKernel_FabricConnectionManager" }, { "name": "device_id", "type": "I32" } ], "results": [ { "name": "position", "type": "TTKernel_MeshPosition" } ], "assemblyFormat": "`(` $fcm `,` $device_id `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::get_my_device_id", "summary": "GetMyDeviceId", "description": "Get my device id. This is a 16 bit value.", "results": [ { "name": "my_device_id", "type": "I16" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::get_my_logical_mesh_position", "summary": "GetMyLogicalMeshPosition", "description": "Get the mesh position for the current device at the given dimension.", "operands": [ { "name": "fcm", "type": "TTKernel_FabricConnectionManager" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`(` $fcm `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::get_noc_multicast_addr", "summary": "Experimental GetNocMulticastAddr", "description": "Default tt-metal get_noc_multicast_addr, but flips mcast start and end coordinates on NOC1.", "operands": [ { "name": "noc_x_start", "type": "IndexLike" }, { "name": "noc_y_start", "type": "IndexLike" }, { "name": "noc_x_end", "type": "IndexLike" }, { "name": "noc_y_end", "type": "IndexLike" }, { "name": "addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "mcastNocAddr", "type": "TTKernel_NocAddr" } ], "assemblyFormat": "`(` $noc_x_start `,` $noc_y_start `,` $noc_x_end `,` $noc_y_end `,` $addr (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::matmul_block", "summary": "Matmul tiles operation", "description": "Performs block-sized matrix multiplication *C=A\\*B* between the blocks in two\n different input CBs and writes the result to DST. The DST register buffer\n must be in acquired state via *acquire_dst* call. `in1_k_stride` is the\n source-tile stride between consecutive K tiles in input 1. This call is\n blocking and is only available on the compute engine.", "operands": [ { "name": "in0_cb_id", "type": "TTKernel_CB" }, { "name": "in1_cb_id", "type": "TTKernel_CB" }, { "name": "in0_tile_idx", "type": "IndexLike" }, { "name": "in1_tile_idx", "type": "IndexLike" }, { "name": "dst_tile_idx", "type": "IndexLike" }, { "name": "transpose", "type": "I32" }, { "name": "ct_dim", "type": "I32" }, { "name": "rt_dim", "type": "I32" }, { "name": "kt_dim", "type": "I32" }, { "name": "in1_k_stride", "type": "I32" } ] }, { "name": "ttkernel.experimental::pack_untilize_block", "summary": "Experimental PackUntilizeBlockOp call.", "description": "Custom pack untilize block LLK that takes the dimensions of the block.\n Uses `pack_untilize_init` for initialization and calls\n `pack_untilize_block(icb, ocb, block_r, block_c)`.\n `cols_per_dst_pass` is the number of column tiles processed per DST pass\n (constrained by DST capacity), and `total_col_tiles` is the total number\n of column tiles in the untilized row.\n For correctness, `cols_per_dst_pass` must divide `total_col_tiles`, and\n `block_c` is expected to be compatible with the chosen\n `cols_per_dst_pass` (the implementation processes\n `block_c / cols_per_dst_pass` column blocks).\n Use this op in the sequence:\n `pack_untilize_init -> experimental::pack_untilize_block -> pack_untilize_uninit`.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" }, { "name": "blockR", "type": "I32" }, { "name": "blockC", "type": "I32" } ], "attributes": [ { "name": "colsPerDstPass", "type": "I32Attr" }, { "name": "totalColTiles", "type": "I32Attr" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `,` $blockR `,` $blockC `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::semaphore_wait", "summary": "SemaphoreWait", "description": "A blocking call that waits until the value of a local L1 memory address on\n the Tensix core executing this function becomes equal to a target value.\n This L1 memory address is used as a semaphore of size 4 Bytes, as a\n synchronization mechanism. Also, see *noc_semaphore_set*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "IndexLike" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::semaphore_wait_min", "summary": "SemaphoreWaitMin", "description": "A blocking call that waits until the value of a local L1 memory address on\n the Tensix core executing this function becomes equal or greater than a target value.\n This L1 memory address is used as a semaphore of size 4 Bytes, as a\n synchronization mechanism. Also, see *noc_semaphore_set*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "I32" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::setup_fabric_connections", "summary": "SetupFabricConnections", "description": "Setup fabric connections for inter-device communication. The connection scheme\n is derived from the attribute `TTMetal_FabricConnectionConfigAttr` in the\n `EnqueueProgramOp`.\n\n `TTMetal_FabricConnectionConfigAttr` specifies:\n - `noc_index`: Which NOC the fabric uses (must match kernel's NocConfig)\n - `topology`: The routing scheme to use for the mesh device (e.g. Line, Ring)\n - `cluster_axis`: The axis along which the to route for 1D topologies\n - `num_links`: Number of routing planes (connections to fabric routers)\n\n After setup, the `FabricConnectionManager` can be used with ops like\n `fabric_fast_write_any_len` to send data to other devices in the mesh.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" } ], "assemblyFormat": "`(` $fabric_connection_manager `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::tile_fill", "summary": "Experimental Tile Fill Op", "description": "Creates a tile in DST filled with a constant scalar value. All elements in the\n resulting tile will have the same value as the input scalar. The DST register\n buffer must be in acquired state via *tile_regs_acquire* call. This call is\n blocking and is only available on the compute engine.", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "value", "type": "AnyFloat" } ], "assemblyFormat": "`(` $dst_index `,` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::tilize_block", "summary": "Experimental TilizeBlockOp call.", "description": "This is a custom tilize block LLK that takes the dimensions of the block, and properly tilizes each row.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" }, { "name": "blockR", "type": "I32" }, { "name": "blockC", "type": "I32" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `,` $blockR `,` $blockC `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::unpack_stall_on_pack", "summary": "Stall UNPACK thread until previous PACK write is committed to L1.", "description": "Issues a hardware semaphore wait on the MATH_PACK semaphore from the\n UNPACK thread, blocking until the previous packer cycle's write to L1\n is visible. Used between consecutive linalg.generics sharing an\n intermediate L1 buffer in the single-tile shard path.", "assemblyFormat": "attr-dict" }, { "name": "ttkernel.experimental::untilize_block", "summary": "Experimental UntilizeBlockOp call.", "description": "This is a custom untilize block LLK that takes the dimensions of the block.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" }, { "name": "blockR", "type": "I32" }, { "name": "blockC", "type": "I32" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `,` $blockR `,` $blockC `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::write_col_mask_tile", "summary": "Experimental Write Col Mask Tile Op", "description": "Writes a column mask tile pattern to a CB, where element[i,j] = 1.0 if j < validCols, else 0.0.\n This is used in dataflow kernels to generate OOB mask tiles directly in L1 memory,\n avoiding DST register pressure in the compute kernel.", "operands": [ { "name": "validCols", "type": "I32" }, { "name": "cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $validCols `,` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental::write_row_mask_tile", "summary": "Experimental Write Row Mask Tile Op", "description": "Writes a row mask tile pattern to a CB, where element[i,j] = 1.0 if i < validRows, else 0.0.\n This is used in dataflow kernels to generate OOB mask tiles directly in L1 memory,\n avoiding DST register pressure in the compute kernel.", "operands": [ { "name": "validRows", "type": "I32" }, { "name": "cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $validRows `,` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.close_fabric_connections", "summary": "CloseFabricConnections", "description": "Close fabric connections.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" } ], "assemblyFormat": "`(` $fabric_connection_manager `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.convert_logical_x_to_translated", "summary": "ConvertLogicalToTranslatedX", "description": "this converts the x coordinate from the LOGICAL coordinate system to TRANSLATED", "operands": [ { "name": "logical_x", "type": "IndexLike" } ], "results": [ { "name": "virtual_x", "type": "IndexLike" } ], "assemblyFormat": "`(` $logical_x `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.convert_logical_y_to_translated", "summary": "ConvertLogicalToTranslatedY", "description": "this converts the y coordinate from the LOGICAL coordinate system to TRANSLATED", "operands": [ { "name": "logical_y", "type": "IndexLike" } ], "results": [ { "name": "virtual_y", "type": "IndexLike" } ], "assemblyFormat": "`(` $logical_y `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.create_fabric_connection_manager", "summary": "CreateFabricConnectionManager", "description": "Create fabric connection manager. The fabric connection manager is required for all fabric operations.", "results": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.fabric_fast_write_any_len", "summary": "FabricWriteOp", "description": "FabricWriteOp", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id", "type": "I16" }, { "name": "dst_addr", "type": "TTKernel_NocAddr" }, { "name": "src_addr", "type": "I32" }, { "name": "len_bytes", "type": "I32" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id `,` $dst_addr `,` $src_addr `,` $len_bytes `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.fabric_mcast_fast_write_any_len", "summary": "FabricMulticastWriteOp", "description": "FabricMulticastWriteOp", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id_start", "type": "I16" }, { "name": "dst_dev_id_end", "type": "I16" }, { "name": "dst_addr", "type": "TTKernel_NocAddr" }, { "name": "src_addr", "type": "I32" }, { "name": "len_bytes", "type": "I32" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id_start `,` $dst_dev_id_end `,` $dst_addr `,` $src_addr `,` $len_bytes `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.fabric_mcast_sem_inc", "summary": "FabricMulticastSemIncOp", "description": "FabricMulticastSemIncOp. This operation increments a semaphore on a range of remote devices.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id_start", "type": "I16" }, { "name": "dst_dev_id_end", "type": "I16" }, { "name": "semaphore_addr", "type": "TTKernel_NocAddr" }, { "name": "incr", "type": "IndexLike" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id_start `,` $dst_dev_id_end `,` $semaphore_addr `,` $incr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.fabric_sem_inc", "summary": "FabricSemIncOp", "description": "FabricSemIncOp. This operation increments a semaphore on a remote device.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" }, { "name": "dst_mesh_id", "type": "I16" }, { "name": "dst_dev_id", "type": "I16" }, { "name": "semaphore_addr", "type": "TTKernel_NocAddr" }, { "name": "incr", "type": "IndexLike" } ], "assemblyFormat": "`(` $fabric_connection_manager `,` $dst_mesh_id `,` $dst_dev_id `,` $semaphore_addr `,` $incr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.fill_arange_tile", "summary": "Experimental Write Full Linear Index Tile Op", "description": "Writes a full linear index tile pattern to a CB, where element[i,j] = i * 32 + j\n (0-1023) in the CB's native data format (Float32, Float16_b, or Int32).\n\n The resulting tile looks like:\n [[ 0, 1, 2, ..., 31],\n [ 32, 33, 34, ..., 63],\n ...\n [992, 993, 994, ..., 1023]]", "operands": [ { "name": "cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.get_device_id_from_logical_mesh_position", "summary": "GetDeviceIdFromLogicalMeshPosition", "description": "Get the device ID for a given logical mesh position.\n Takes a list of indices representing the logical mesh position and returns the corresponding device ID.\n Maps to get_device_id_from_logical_mesh_position(fcm, position) in device code.", "operands": [ { "name": "fcm", "type": "TTKernel_FabricConnectionManager" }, { "name": "position_indices", "type": "Variadic" } ], "results": [ { "name": "device_id", "type": "I16" } ], "assemblyFormat": "`(` $fcm `,` $position_indices `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.get_my_device_id", "summary": "GetMyDeviceId", "description": "Get my device id. This is a 16 bit value.", "results": [ { "name": "my_device_id", "type": "I16" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.get_my_logical_mesh_position", "summary": "GetMyLogicalMeshPosition", "description": "Get the mesh position for the current device at the given dimension.", "operands": [ { "name": "fcm", "type": "TTKernel_FabricConnectionManager" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dim", "type": "ConfinedAttr]>" } ], "assemblyFormat": "`(` $fcm `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.matmul_block", "summary": "Matmul tiles operation", "description": "Performs block-sized matrix multiplication *C=A\\*B* between the blocks in two\n different input CBs and writes the result to DST. The DST register buffer\n must be in acquired state via *acquire_dst* call. `in1_k_stride` is the\n source-tile stride between consecutive K tiles in input 1. This call is\n blocking and is only available on the compute engine.", "operands": [ { "name": "in0_cb_id", "type": "TTKernel_CB" }, { "name": "in1_cb_id", "type": "TTKernel_CB" }, { "name": "in0_tile_idx", "type": "IndexLike" }, { "name": "in1_tile_idx", "type": "IndexLike" }, { "name": "dst_tile_idx", "type": "IndexLike" }, { "name": "transpose", "type": "I32" }, { "name": "ct_dim", "type": "I32" }, { "name": "rt_dim", "type": "I32" }, { "name": "kt_dim", "type": "I32" }, { "name": "in1_k_stride", "type": "I32" } ] }, { "name": "ttkernel.experimental.pack_untilize_block", "summary": "Experimental PackUntilizeBlockOp call.", "description": "Custom pack untilize block LLK that takes the dimensions of the block.\n Uses `pack_untilize_init` for initialization and calls\n `pack_untilize_block(icb, ocb, block_r, block_c)`.\n `cols_per_dst_pass` is the number of column tiles processed per DST pass\n (constrained by DST capacity), and `total_col_tiles` is the total number\n of column tiles in the untilized row.\n For correctness, `cols_per_dst_pass` must divide `total_col_tiles`, and\n `block_c` is expected to be compatible with the chosen\n `cols_per_dst_pass` (the implementation processes\n `block_c / cols_per_dst_pass` column blocks).\n Use this op in the sequence:\n `pack_untilize_init -> experimental.pack_untilize_block -> pack_untilize_uninit`.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" }, { "name": "blockR", "type": "I32" }, { "name": "blockC", "type": "I32" } ], "attributes": [ { "name": "colsPerDstPass", "type": "I32Attr" }, { "name": "totalColTiles", "type": "I32Attr" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `,` $blockR `,` $blockC `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.semaphore_wait", "summary": "SemaphoreWait", "description": "A blocking call that waits until the value of a local L1 memory address on\n the Tensix core executing this function becomes equal to a target value.\n This L1 memory address is used as a semaphore of size 4 Bytes, as a\n synchronization mechanism. Also, see *noc_semaphore_set*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "IndexLike" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.semaphore_wait_min", "summary": "SemaphoreWaitMin", "description": "A blocking call that waits until the value of a local L1 memory address on\n the Tensix core executing this function becomes equal or greater than a target value.\n This L1 memory address is used as a semaphore of size 4 Bytes, as a\n synchronization mechanism. Also, see *noc_semaphore_set*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "I32" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.setup_fabric_connections", "summary": "SetupFabricConnections", "description": "Setup fabric connections for inter-device communication. The connection scheme\n is derived from the attribute `TTMetal_FabricConnectionConfigAttr` in the\n `EnqueueProgramOp`.\n\n `TTMetal_FabricConnectionConfigAttr` specifies:\n - `noc_index`: Which NOC the fabric uses (must match kernel's NocConfig)\n - `topology`: The routing scheme to use for the mesh device (e.g. Line, Ring)\n - `cluster_axis`: The axis along which the to route for 1D topologies\n - `num_links`: Number of routing planes (connections to fabric routers)\n\n After setup, the `FabricConnectionManager` can be used with ops like\n `fabric_fast_write_any_len` to send data to other devices in the mesh.", "operands": [ { "name": "fabric_connection_manager", "type": "TTKernel_FabricConnectionManager" } ], "assemblyFormat": "`(` $fabric_connection_manager `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.tilize_block", "summary": "Experimental TilizeBlockOp call.", "description": "This is a custom tilize block LLK that takes the dimensions of the block, and properly tilizes each row.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" }, { "name": "blockR", "type": "I32" }, { "name": "blockC", "type": "I32" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `,` $blockR `,` $blockC `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.unpack_stall_on_pack", "summary": "Stall UNPACK thread until previous PACK write is committed to L1.", "description": "Issues a hardware semaphore wait on the MATH_PACK semaphore from the\n UNPACK thread, blocking until the previous packer cycle's write to L1\n is visible. Used between consecutive linalg.generics sharing an\n intermediate L1 buffer in the single-tile shard path.", "assemblyFormat": "attr-dict" }, { "name": "ttkernel.experimental.untilize_block", "summary": "Experimental UntilizeBlockOp call.", "description": "This is a custom untilize block LLK that takes the dimensions of the block.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" }, { "name": "blockR", "type": "I32" }, { "name": "blockC", "type": "I32" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `,` $blockR `,` $blockC `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.write_col_mask_tile", "summary": "Experimental Write Col Mask Tile Op", "description": "Writes a column mask tile pattern to a CB, where element[i,j] = 1.0 if j < validCols, else 0.0.\n This is used in dataflow kernels to generate OOB mask tiles directly in L1 memory,\n avoiding DST register pressure in the compute kernel.", "operands": [ { "name": "validCols", "type": "I32" }, { "name": "cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $validCols `,` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.experimental.write_row_mask_tile", "summary": "Experimental Write Row Mask Tile Op", "description": "Writes a row mask tile pattern to a CB, where element[i,j] = 1.0 if i < validRows, else 0.0.\n This is used in dataflow kernels to generate OOB mask tiles directly in L1 memory,\n avoiding DST register pressure in the compute kernel.", "operands": [ { "name": "validRows", "type": "I32" }, { "name": "cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $validRows `,` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.expm1_tile", "summary": "Expm1 operation", "description": "Performs element-wise computation of exp(x)-1 on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is\n only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.expm1_tile_init", "summary": "Short init function which configures compute unit for execution of expm1_tile.", "description": "Must be run before expm1_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.fill_tile", "summary": "Fill tile with specified value.", "description": "Fills supplied DST register tile with a supplied f32 value. The DST\n register must be in acquired state via *tile_regs_acquire* call.\n\n Example:\n ```\n ttkernel.fill_tile(%dst_index, %value);\n ```", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "value", "type": "F32" } ], "assemblyFormat": "`(` $dst_index `,` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.fill_tile_init", "summary": "Init function for fill_tile operation. Refer to documentation for any init function.", "description": "Must be run before fill_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.fill_tile_int", "summary": "Fill tile with specified int32 value.", "description": "Fills supplied DST register tile with a supplied i32 value. The DST\n register must be in acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "value", "type": "I32" } ], "assemblyFormat": "`(` $dst_index `,` $value `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.float32_greater", "summary": "Compare two float32 values using integer arithmetic.", "description": "Returns true if f32_a > f32_b. Operates on raw bits in int32 format. Maps to float32_greater() in device code.", "operands": [ { "name": "f32_a", "type": "I32" }, { "name": "f32_b", "type": "I32" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $f32_a `,` $f32_b `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.floor_tile", "summary": "Floor tile in the DST at specified index.", "description": "Performs element-wise computation of floor operation\n DST[dst0_index] <- floor(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.frac_tile", "summary": "Frac operation", "description": "Performs element-wise computation of the fractional part (x - trunc(x))\n on each element of a tile in DST register at index tile_index.\n Requires rounding_op_tile_init to be called first. The DST register\n buffer must be in acquired state via *tile_regs_acquire* call. This call\n is blocking and is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ge_binary_tile", "summary": "Greater-than-or-equal operation between two tiles", "description": "Performs element-wise computation of greater-than-or-equal operation\n DST[odst_index] <- DST[dst0_index] >= DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ge_binary_tile_init", "summary": "Short init function", "description": "Must be run before ge_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.gelu_tile", "summary": "GELU operation", "description": "Performs element-wise computation of GELU on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gelu_tile_init", "summary": "Short init function which configures compute unit for execution of gelu_tile.", "description": "Must be run before gelu_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_arg_val", "summary": "Get runtime arg value.", "description": "Get runtime argument value at specified index.", "operands": [ { "name": "arg_index", "type": "IndexLike" } ], "results": [ { "name": "arg_val", "type": "TTKernel_ArgResultType" } ], "assemblyFormat": "`(` $arg_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_common_arg_val", "summary": "Get common runtime arg value.", "description": "Get runtime argument value at specified index. (Indexes from different location compared to get_arg_val)", "operands": [ { "name": "arg_index", "type": "IndexLike" } ], "results": [ { "name": "arg_val", "type": "TTKernel_ArgResultType" } ], "assemblyFormat": "`(` $arg_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_compile_time_arg_val", "summary": "Get compile-time arg value.", "description": "Get compile-time argument value at specified index.", "results": [ { "name": "arg_val", "type": "TTKernel_ArgResultType" } ], "attributes": [ { "name": "arg_index", "type": "I32Attr" } ], "assemblyFormat": "`(` $arg_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_dataformat", "summary": "Get the data format of a given CB", "description": "get_dataformat operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" } ], "results": [ { "name": "dataFormat", "type": "TTKernel_DataFormat" } ], "assemblyFormat": "`(` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_interleaved_addr_gen_fast", "summary": "GetInterleavedAddrGenFastOp", "description": "Returns an InterleavedAddrGenFast type.", "operands": [ { "name": "DRAM", "type": "I1" }, { "name": "bank_base_address", "type": "I32" }, { "name": "page_size", "type": "I32" }, { "name": "data_format", "type": "TTKernel_DataFormat" } ], "results": [ { "name": "result", "type": "TTKernel_InterleavedAddrGenFast" } ], "assemblyFormat": "`(` $DRAM `,` $bank_base_address `,` $page_size `,` $data_format `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_noc_addr", "summary": "GetNocAddr", "description": "GetNocAddr api including core coordinates.", "operands": [ { "name": "x", "type": "IndexLike" }, { "name": "y", "type": "IndexLike" }, { "name": "l1Address", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "nocAddr", "type": "TTKernel_NocAddr" } ], "assemblyFormat": "`(` $x `,` $y `,` $l1Address (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_noc_addr_from_bank_id", "summary": "GetNocAddrFromBankID", "description": "GetNocAddrFromBankID api", "operands": [ { "name": "bank_id", "type": "I32" }, { "name": "bankAddressOffset", "type": "I32" } ], "results": [ { "name": "nocAddr", "type": "TTKernel_NocAddr" } ], "assemblyFormat": "`(` $bank_id `,` $bankAddressOffset `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_noc_multicast_addr", "summary": "GetNocMulticastAddr", "description": "Default tt-metal get_noc_multicast_addr.\n\n The caller must make sure the start and end coordinates are flipped on\n WH/BH's NoC1, especially when the optional `noc` operand is absent.", "operands": [ { "name": "noc_x_start", "type": "IndexLike" }, { "name": "noc_y_start", "type": "IndexLike" }, { "name": "noc_x_end", "type": "IndexLike" }, { "name": "noc_y_end", "type": "IndexLike" }, { "name": "addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "mcastNocAddr", "type": "TTKernel_NocAddr" } ], "assemblyFormat": "`(` $noc_x_start `,` $noc_y_start `,` $noc_x_end `,` $noc_y_end `,` $addr (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_read_ptr", "summary": "GetReadPtr", "description": "GetReadPtr operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" } ], "results": [ { "name": "readPtr", "type": "I32" } ], "assemblyFormat": "`(` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_semaphore", "summary": "GetSemaphoreOp", "description": "Get L1 addr of the semaphore with specified semaphore id", "operands": [ { "name": "semaphore", "type": "IndexLike" } ], "results": [ { "name": "sem_addr", "type": "TTKernel_LocalSemaphore" } ], "assemblyFormat": "`(` $semaphore `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_tile_size", "summary": "Get the tile size in bytes of a given CB", "description": "get_tile_size operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" } ], "results": [ { "name": "tileSizeBytes", "type": "I32" } ], "assemblyFormat": "`(` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.get_write_ptr", "summary": "GetWritePtr", "description": "GetWritePtr operation", "operands": [ { "name": "cb", "type": "TTKernel_CB" } ], "results": [ { "name": "writePtr", "type": "I32" } ], "assemblyFormat": "`(` $cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gez_tile", "summary": "Greater than or equal to zero tile in the DST at specified index.", "description": "Performs element-wise greater than or equal to zero comparison on DST register tiles.\n DST[dst0_index] <- (DST[dst0_index] >= 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gez_tile_init", "summary": "Init function for gez() operation. Refer to documentation for any init function.", "description": "Must be run before gez_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gez_tile_int32", "summary": "Greater than or equal to zero tile in the DST at specified index.", "description": "Performs element-wise greater than or equal to zero comparison on DST register tiles for int32 data type.\n DST[dst0_index] <- (DST[dst0_index] >= 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gt_binary_tile", "summary": "Greater-than operation between two tiles", "description": "Performs element-wise computation of greater-than operation\n DST[odst_index] <- DST[dst0_index] > DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gt_binary_tile_init", "summary": "Short init function", "description": "Must be run before gt_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.gtz_tile", "summary": "Greater than zero tile in the DST at specified index.", "description": "Performs element-wise greater than zero comparison on DST register tiles.\n DST[dst0_index] <- (DST[dst0_index] > 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gtz_tile_init", "summary": "Init function for gtz() operation. Refer to documentation for any init function.", "description": "Must be run before gtz_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.gtz_tile_int32", "summary": "Greater than zero tile in the DST at specified index.", "description": "Performs element-wise greater than zero comparison on DST register tiles for int32 data type.\n DST[dst0_index] <- (DST[dst0_index] > 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.hardsigmoid_tile", "summary": "Hardsigmoid operation", "description": "Performs element-wise computation of hardsigmoid on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.hardsigmoid_tile_init", "summary": "Short init function which configures compute unit for execution of hardsigmoid_tile.", "description": "Must be run before hardsigmoid_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.init_sfpu", "summary": "Initialization function for SFPU operations.", "description": "This operation initializes all necessary components for SFPU operations,\n including unpacking, packing, and math configurations.", "operands": [ { "name": "icb", "type": "TTKernel_CB" }, { "name": "ocb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $icb `,` $ocb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.interleaved_addr_gen_fast.get_noc_addr", "summary": "InterleavedAddrGenFastGetNocAddr", "description": "Returns an raw noc address from an interleaved addr gen struct.", "operands": [ { "name": "self", "type": "TTKernel_InterleavedAddrGenFast" }, { "name": "id", "type": "I32" }, { "name": "offset", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "result", "type": "TTKernel_NocAddr" } ], "assemblyFormat": "`(` $self `,` $id `,` $offset `,` $noc `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.invoke_sfpi", "regions": [ { "name": "region", "type": "AnyRegion" } ], "assemblyFormat": "attr-dict-with-keyword $region" }, { "name": "ttkernel.le_binary_tile", "summary": "Less-than-or-equal operation between two tiles", "description": "Performs element-wise computation of less-than-or-equal operation\n DST[odst_index] <- DST[dst0_index] <= DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.le_binary_tile_init", "summary": "Short init function", "description": "Must be run before le_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.lez_tile", "summary": "Less than or equal to zero tile in the DST at specified index.", "description": "Performs element-wise less than or equal to zero comparison on DST register tiles.\n DST[dst0_index] <- (DST[dst0_index] <= 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.lez_tile_init", "summary": "Init function for lez() operation. Refer to documentation for any init function.", "description": "Must be run before lez_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.lez_tile_int32", "summary": "Less than or equal to zero tile in the DST at specified index.", "description": "Performs element-wise less than or equal to zero comparison on DST register tiles for int32 data type.\n DST[dst0_index] <- (DST[dst0_index] <= 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.load_from_l1", "summary": "LoadFromL1", "description": "Load value from L1.", "operands": [ { "name": "l1_ptr", "type": "TTKernel_L1AddrPtr" }, { "name": "offset", "type": "I32" } ], "results": [ { "name": "value", "type": "AnyTypeOf<[I8, I16, I32]>" } ], "assemblyFormat": "`(` $l1_ptr `,` $offset `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.log_tile", "summary": "Log operation", "description": "Performs element-wise computation of log on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.log_tile_init", "summary": "Short init function which configures compute unit for execution of log_tile.", "description": "Must be run before log_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.log1p_tile", "summary": "Log1p operation", "description": "Performs element-wise computation of log(1+x) on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is\n only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.log1p_tile_init", "summary": "Short init function which configures compute unit for execution of log1p_tile.", "description": "Must be run before log1p_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.logical_not_tile", "summary": "Logical negation tile in the DST at specified index.", "description": "Performs element-wise computation of logical negation operation\n DST[dst0_index] <- !DST[dst0_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n The DataFormat template parameter specifies the data type.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.logical_not_tile_init", "summary": "Init function for logical_not_tile operation. Refer to documentation for any init function.", "description": "Must be run before logical_not_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.logical_not_unary_tile", "summary": "Logical negation tile in the DST at specified index.", "description": "Performs element-wise computation of logical negation operation\n DST[dst0_index] <- !DST[dst0_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.logical_not_unary_tile_init", "summary": "Init function for logical_not_unary_tile(_int32) operation. Refer to documentation for any init function.", "description": "Must be run before logical_not_unary_tile(_int32).", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.logical_not_unary_tile_int32", "summary": "Logical negation tile in the DST at specified index.", "description": "Performs element-wise computation of logical negation operation for the int32 data type\n DST[dst0_index] <- !DST[dst0_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.lt_binary_tile", "summary": "Less-than operation between two tiles", "description": "Performs element-wise computation of less-than operation\n DST[odst_index] <- DST[dst0_index] < DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.lt_binary_tile_init", "summary": "Short init function", "description": "Must be run before lt_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.ltz_tile", "summary": "Less than zero tile in the DST at specified index.", "description": "Performs element-wise less than zero comparison on DST register tiles.\n DST[dst0_index] <- (DST[dst0_index] < 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ltz_tile_init", "summary": "Init function for ltz() operation. Refer to documentation for any init function.", "description": "Must be run before ltz_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ltz_tile_int32", "summary": "Less than zero tile in the DST at specified index.", "description": "Performs element-wise less than zero comparison on DST register tiles for int32 data type.\n DST[dst0_index] <- (DST[dst0_index] < 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.matmul_block", "summary": "Block matmul operation", "description": "Performs block-sized matrix multiplication *C=A\\*B* between blocks of tiles\n in two input CBs and accumulates the result into DST. Block dimensions are\n specified by ct_dim (output columns in tiles), rt_dim (output rows in tiles),\n and kt_dim (inner dimension in tiles). The transpose flag controls whether\n input 1 is transposed. The DST register buffer must be in acquired state via\n ttkernel.tile_regs_acquire. Blocking; compute engine only.", "operands": [ { "name": "in0_cb_id", "type": "TTKernel_CB" }, { "name": "in1_cb_id", "type": "TTKernel_CB" }, { "name": "in0_tile_idx", "type": "IndexLike" }, { "name": "in1_tile_idx", "type": "IndexLike" }, { "name": "dst_tile_idx", "type": "IndexLike" }, { "name": "transpose", "type": "I32" }, { "name": "ct_dim", "type": "I32" }, { "name": "rt_dim", "type": "I32" }, { "name": "kt_dim", "type": "I32" } ], "assemblyFormat": "`(` $in0_cb_id `,` $in1_cb_id `,` $in0_tile_idx `,` $in1_tile_idx `,` $dst_tile_idx `,` $transpose `,` $ct_dim `,` $rt_dim `,` $kt_dim `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.matmul_tiles", "summary": "Matmul tiles operation", "description": "Performs tile-sized matrix multiplication *C=A\\*B* between the tiles in two\n specified input CBs and writes the result to DST. The DST register buffer\n must be in acquired state via ttkernel.tile_regs_acquire call. This call is blocking and\n is only available on the compute engine.", "operands": [ { "name": "in0_cb_id", "type": "TTKernel_CB" }, { "name": "in1_cb_id", "type": "TTKernel_CB" }, { "name": "in0_tile_idx", "type": "IndexLike" }, { "name": "in1_tile_idx", "type": "IndexLike" }, { "name": "dst_tile_idx", "type": "IndexLike" } ], "assemblyFormat": "`(` $in0_cb_id `,` $in1_cb_id `,` $in0_tile_idx `,` $in1_tile_idx `,` $dst_tile_idx `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mem_zeros_base", "summary": "Op corresponding to MEM_ZEROS_BASE macro in kernels.", "description": "Op corresponding to MEM_ZEROS_BASE macro in kernels.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mem_zeros_size", "summary": "Op corresponding to MEM_ZEROS_SIZE macro in kernels.", "description": "Op corresponding to MEM_ZEROS_SIZE macro in kernels.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mm_block_init", "summary": "Matmul init function", "description": "Initialization for matmul_block operation. Must be called before matmul_block.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "out_cb", "type": "TTKernel_CB" }, { "name": "transpose", "type": "I32" }, { "name": "ct_dim", "type": "I32" }, { "name": "rt_dim", "type": "I32" }, { "name": "kt_dim", "type": "I32" } ] }, { "name": "ttkernel.mm_block_init_short", "summary": "Matmul short init function", "description": "A short version of matmul_block initialization.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "transpose", "type": "I32" }, { "name": "ct_dim", "type": "I32" }, { "name": "rt_dim", "type": "I32" }, { "name": "kt_dim", "type": "I32" } ] }, { "name": "ttkernel.mm_init", "summary": "Matmul init function", "description": "Can only be run ONCE per kernel. Should be run before matmul.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "out_cb", "type": "TTKernel_CB" }, { "name": "transpose", "type": "I32" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `,` $out_cb `,` $transpose `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mm_init_short", "summary": "Matmul short init function", "description": "Can be run MULTIPLE times per kernel. Should be run before matmul. Use this if some other init was called between mm_init and matmul_tiles. (i.e. in a loop)", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "transpose", "type": "I32" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `,` $transpose `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_binary_tile", "summary": "Multiplication operation between two tiles", "description": "Performs element-wise computation of multiplication operation\n DST[odst_index] <- DST[dst0_index] * DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_binary_tile_init", "summary": "Short init function", "description": "Must be run before mul_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_int_tile", "summary": "Integer multiplication operation between two tiles", "description": "Performs element-wise computation of integer multiplication operation\n DST[odst_index] <- DST[dst0_index] * DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n Supported data formats are: Int32, UInt32, UInt16.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_int_tile_init", "summary": "Short init function", "description": "Must be run before mul_int_tile.", "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_tiles", "summary": "Mul operation", "description": "Performs element-wise multiplication C=A*B of tiles in two CBs at given\n indices and writes the result to the DST register at index dst_tile_index.\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "in0_tile_index", "type": "IndexLike" }, { "name": "in1_tile_index", "type": "IndexLike" }, { "name": "dst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `,` $in0_tile_index `,` $in1_tile_index `,` $dst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_tiles_init", "summary": "Short init function", "description": "Must be run before mul_tiles.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.mul_unary_tile", "summary": "Multiply by scalar operation", "description": "Performs element-wise multiplication of a tile by a scalar value.\n DST[dst0_index] <- DST[dst0_index] * scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.my_logical_x_", "summary": "MyLogicalX", "description": "Lowers to the tt-metal supported my_logical_x_ global. This represents the logical X coordinate of the current core.", "results": [ { "name": "x", "type": "Index" } ], "assemblyFormat": "attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.my_logical_y_", "summary": "MyLogicalY", "description": "Lowers to the tt-metal supported my_logical_y_ global. This represents the logical Y coordinate of the current core.", "results": [ { "name": "y", "type": "Index" } ], "assemblyFormat": "attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.my_x", "summary": "MyX", "description": "Lowers to the tt-metal supported MY_X macro. This represents the virtual X coordinate of the current core.", "operands": [ { "name": "noc", "type": "Optional" } ], "results": [ { "name": "x", "type": "Index" } ], "assemblyFormat": "`(` ($noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.my_y", "summary": "MyY", "description": "Lowers to the tt-metal supported MY_Y macro. This represents the virtual Y coordinate of the current core.", "operands": [ { "name": "noc", "type": "Optional" } ], "results": [ { "name": "y", "type": "Index" } ], "assemblyFormat": "`(` ($noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ne_binary_tile", "summary": "Inequality operation between two tiles", "description": "Performs element-wise computation of inequality operation\n DST[odst_index] <- DST[dst0_index] != DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.ne_binary_tile_init", "summary": "Short init function", "description": "Must be run before ne_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:`functional-type(operands, results)" }, { "name": "ttkernel.negative_tile", "summary": "Negative operation", "description": "Performs element-wise computation of the negative on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.negative_tile_init", "summary": "Short init function which configures compute unit for execution of negative_tile.", "description": "Must be run before negative_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.negative_tile_int32", "summary": "Negative i32 tile in the DST at specified index.", "description": "Performs element-wise computation of negation operation\n DST[dst0_index] <- -DST[dst0_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.nez_tile", "summary": "Not equal to zero tile in the DST at specified index.", "description": "Performs element-wise inequality on DST register tiles.\n DST[dst0_index] <- (DST[dst0_index] != 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.nez_tile_init", "summary": "Init function for nez() operation. Refer to documentation for any init function.", "description": "Must be run before nez_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.nez_tile_int32", "summary": "Not equal to zero tile in the DST at specified index.", "description": "Performs element-wise inequality on DST register tiles for int32 data type.\n DST[dst0_index] <- (DST[dst0_index] != 0)\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_atomic_barrier", "summary": "NocAsyncAtomicBarrier", "description": "Block until all outstanding non-posted atomic operations on the given\n NOC have flushed. Pairs with `noc_semaphore_inc` and\n `noc_semaphore_inc_multicast`.", "operands": [ { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` ($noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read", "summary": "NocAsyncRead", "description": "NocAsyncRead from either an L1 core coordinate or a DRAM bank.", "operands": [ { "name": "srcCoreXY", "type": "Variadic" }, { "name": "srcBankId", "type": "Variadic" }, { "name": "srcAddress", "type": "I32" }, { "name": "dstLocalL1Addr", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "(`core` `[` $srcCoreXY^ `]`)? (`bank` `[` $srcBankId^ `]`)? `,` $srcAddress `,` $dstLocalL1Addr `,` $size (`,` `noc` $noc^)? attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_barrier", "summary": "NocAsyncReadBarrier", "description": "Waits for all outstanding read transactions on the given NOC.", "operands": [ { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` ($noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_barrier_with_trid", "summary": "NocAsyncReadBarrierWithTrid", "description": "Waits for outstanding read transactions matching a transaction ID. TRID is 0-15, NOC is 0 or 1.\n\n Example:\n ```\n ttkernel.noc_async_read_barrier_with_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "trid", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $trid (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_one_packet_set_state", "summary": "NocAsyncReadOnePacketSetState", "description": "NocAsyncReadOnePacketSetState", "operands": [ { "name": "srcCoreXY", "type": "Variadic" }, { "name": "srcBankId", "type": "Variadic" }, { "name": "srcAddress", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` (`core` `[` $srcCoreXY^ `]`)? (`bank` `[` $srcBankId^ `]`)? `,` $srcAddress `,` $size (`,` `noc` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_one_packet_with_state", "summary": "NocAsyncReadOnePacketWithState", "description": "NocAsyncReadOnePacketWithState", "operands": [ { "name": "srcCoreXY", "type": "Variadic" }, { "name": "srcBankId", "type": "Variadic" }, { "name": "srcAddress", "type": "I32" }, { "name": "dstLocalL1Addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr]>" }, { "name": "size", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` (`core` `[` $srcCoreXY^ `]`)? (`bank` `[` $srcBankId^ `]`)? `,` $srcAddress `,` $dstLocalL1Addr `,` $size (`,` `noc` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_one_packet_with_state_with_trid", "summary": "NocAsyncReadOnePacketWithStateWithTrid", "description": "Issues a one-packet NOC read with a specific transaction ID. TRID is 0-15, NOC is 0 or 1.\n\n Example:\n ```\n // Must set TRID before calling.\n // ttkernel.noc_async_read_set_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ttkernel.noc_async_read_one_packet_with_state_with_trid(%src_base, %src_addr, %dst_l1, %trid, %noc_idx) : (i32, i32, i32, i32, i8) -> ()\n // TRID-specific barrier should follow.\n // ttkernel.noc_async_read_barrier_with_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "srcBaseAddr", "type": "I32" }, { "name": "srcAddr", "type": "I32" }, { "name": "dstLocalL1Addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr]>" }, { "name": "trid", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $srcBaseAddr `,` $srcAddr `,` $dstLocalL1Addr `,` $trid (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_set_trid", "summary": "NocAsyncReadSetTrid", "description": "Sets the transaction ID for subsequent NOC reads. TRID is 0-15, NOC is 0 or 1.\n\n Example:\n ```\n ttkernel.noc_async_read_set_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "trid", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $trid (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_read_tile", "summary": "NocAsyncReadTile", "description": "NocAsyncReadTile", "operands": [ { "name": "id", "type": "I32" }, { "name": "addrGenStruct", "type": "TTKernel_TensorAccessor" }, { "name": "dstLocalL1Addr", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $id `,` $addrGenStruct `,` $dstLocalL1Addr (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write", "summary": "NocAsyncWrite", "description": "NocAsyncWrite to either an L1 core coordinate or a DRAM bank.", "operands": [ { "name": "srcLocalL1Addr", "type": "I32" }, { "name": "dstCoreXY", "type": "Variadic" }, { "name": "dstBankId", "type": "Variadic" }, { "name": "dstAddress", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$srcLocalL1Addr `,` (`core` `[` $dstCoreXY^ `]`)? (`bank` `[` $dstBankId^ `]`)? `,` $dstAddress `,` $size (`,` `noc` $noc^)? attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_barrier", "summary": "NocAsyncWriteBarrier", "description": "Waits for all outstanding write transactions on the given NOC.", "operands": [ { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` ($noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_barrier_with_trid", "summary": "NocAsyncWriteBarrierWithTrid", "description": "Waits for outstanding write transactions matching a transaction ID. TRID is 0-15, NOC is 0 or 1.\n\n Example:\n ```\n ttkernel.noc_async_write_barrier_with_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "trid", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $trid (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_multicast", "summary": "NocAsyncWriteMulticast", "description": "Initiates an asynchronous write from a source address in L1 memory on the\n Tensix core executing this function call to a rectangular destination grid.\n The destinations are specified using an on-chip grid of nodes located at\n NOC coordinate range (x_start,y_start,x_end,y_end) and a local address.\n Also, *see noc_async_write_barrier*.\n\n The caller must make sure the start and end coordinates are flipped on\n WH/BH's NoC1, especially when the optional `noc` operand is absent.\n\n The destination nodes can only be a set of Tensix cores + L1 memory address.\n The destination nodes must form a rectangular grid. The destination L1\n memory address must be the same on all destination nodes.\n\n With this API, the multicast sender cannot be part of the multicast\n destinations. If the multicast sender has to be in the multicast\n destinations (i.e. must perform a local L1 write), the other API variant\n *noc_async_write_multicast_loopback_src* can be used.\n\n Note: The number of destinations needs to be non-zero. Besides that,\n there is no restriction on the number of destinations, i.e. the\n multicast destinations can span the full chip. However, as mentioned\n previously, the multicast source cannot be part of the destinations. So, the\n maximum number of destinations is 119.", "operands": [ { "name": "srcLocalL1Addr", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "num_dests", "type": "I32" }, { "name": "dstNocXStart", "type": "IndexLike" }, { "name": "dstNocYStart", "type": "IndexLike" }, { "name": "dstNocXEnd", "type": "IndexLike" }, { "name": "dstNocYEnd", "type": "IndexLike" }, { "name": "dstLocalL1Addr", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "attributes": [ { "name": "linked", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $srcLocalL1Addr `,` $size `,` $num_dests `,`\n `start_xy` `[` $dstNocXStart `,` $dstNocYStart `]` `,`\n `end_xy` `[` $dstNocXEnd `,` $dstNocYEnd `]` `,`\n $dstLocalL1Addr (`,` `noc` $noc^)? (`,` `linked` $linked^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_multicast_loopback_src", "summary": "NocAsyncWriteMulticastLoopbackSrc", "description": "Multicast write that allows the sender to be part of the destinations.\n\n The caller must make sure the start and end coordinates are flipped on\n WH/BH's NoC1, especially when the optional `noc` operand is absent.", "operands": [ { "name": "srcLocalL1Addr", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "num_dests", "type": "I32" }, { "name": "dstNocXStart", "type": "IndexLike" }, { "name": "dstNocYStart", "type": "IndexLike" }, { "name": "dstNocXEnd", "type": "IndexLike" }, { "name": "dstNocYEnd", "type": "IndexLike" }, { "name": "dstLocalL1Addr", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "attributes": [ { "name": "linked", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $srcLocalL1Addr `,` $size `,` $num_dests `,`\n `start_xy` `[` $dstNocXStart `,` $dstNocYStart `]` `,`\n `end_xy` `[` $dstNocXEnd `,` $dstNocYEnd `]` `,`\n $dstLocalL1Addr (`,` `noc` $noc^)? (`,` `linked` $linked^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_multicast_one_packet", "summary": "NocAsyncWriteMulticastOnePacket", "description": "NocAsyncWriteMulticastOnePacket\n this issues only a single packet with size <= NOC_MAX_BURST_SIZE (ie maximum packet size)", "operands": [ { "name": "srcLocalL1Addr", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "num_dests", "type": "I32" }, { "name": "dstNocXStart", "type": "IndexLike" }, { "name": "dstNocYStart", "type": "IndexLike" }, { "name": "dstNocXEnd", "type": "IndexLike" }, { "name": "dstNocYEnd", "type": "IndexLike" }, { "name": "dstLocalL1Addr", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "attributes": [ { "name": "linked", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $srcLocalL1Addr `,` $size `,` $num_dests `,`\n `start_xy` `[` $dstNocXStart `,` $dstNocYStart `]` `,`\n `end_xy` `[` $dstNocXEnd `,` $dstNocYEnd `]` `,`\n $dstLocalL1Addr (`,` `noc` $noc^)? (`,` `linked` $linked^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_one_packet_with_trid", "summary": "NocAsyncWriteOnePacketWithTrid", "description": "Issues a one-packet NOC write with a specific transaction ID. TRID is 0-15, NOC is 0 or 1.\n\n Example:\n ```\n ttkernel.noc_async_write_one_packet_with_trid(%l1_src, core[%x, %y], %dst_addr, %size, %trid, noc %noc_idx) : (i32, index, index, i32, i32, i32, i8) -> ()\n // TRID-specific barrier should follow.\n // ttkernel.noc_async_write_barrier_with_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "srcLocalL1Addr", "type": "I32" }, { "name": "dstCoreXY", "type": "Variadic" }, { "name": "dstBankId", "type": "Variadic" }, { "name": "dstAddress", "type": "I32" }, { "name": "size", "type": "I32" }, { "name": "trid", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $srcLocalL1Addr `,` (`core` `[` $dstCoreXY^ `]`)? (`bank` `[` $dstBankId^ `]`)? `,` $dstAddress `,` $size `,` $trid (`,` `noc` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_set_trid", "summary": "NocAsyncWriteSetTrid", "description": "Sets the transaction ID for subsequent NOC writes. TRID is 0-15, NOC is 0 or 1.\n\n Example:\n ```\n ttkernel.noc_async_write_set_trid(%trid, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "trid", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $trid (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_async_write_tile", "summary": "NocAsyncWriteTile", "description": "NocAsyncWriteTilie", "operands": [ { "name": "id", "type": "IndexLike" }, { "name": "addrGenStruct", "type": "TTKernel_TensorAccessor" }, { "name": "srcLocalL1Addr", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $id `,` $addrGenStruct `,` $srcLocalL1Addr (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_inline_dw_write", "summary": "NocInlineDwWrite", "description": "Initiates an inline 32-bit NOC write to a remote L1 address. The value is\n provided as an SSA value, so the operation does not require a local SRAM\n staging word.", "operands": [ { "name": "dstNocX", "type": "IndexLike" }, { "name": "dstNocY", "type": "IndexLike" }, { "name": "dstAddress", "type": "I32" }, { "name": "val", "type": "I32" }, { "name": "byte_enable", "type": "I8" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` `core` `[` $dstNocX `,` $dstNocY `]` `,` $dstAddress `,` $val `,` $byte_enable (`,` `noc` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_inc", "summary": "NocSemaphoreInc", "description": "The Tensix core executing this function call initiates an atomic increment\n (with 32-bit wrap) of a remote Tensix core L1 memory address. This L1 memory\n address is used as a semaphore of size 4 Bytes, as a synchronization\n mechanism.\n\n The `posted` attribute selects the NOC transaction response mode and\n maps to the homonymous template parameter of `noc_semaphore_inc` in\n tt-metal. When unset or false, the transaction is non-posted: the\n receiver returns an acknowledgement and the sender's outstanding-atomics\n counter tracks completion. When true, the transaction is posted: no\n acknowledgement is returned, the sender's counter is not updated, and\n synchronization must be receiver-driven.", "operands": [ { "name": "addr", "type": "TTKernel_NocAddr" }, { "name": "incr", "type": "IndexLike" }, { "name": "noc", "type": "Optional" } ], "attributes": [ { "name": "posted", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $addr `,` $incr (`,` $noc^)? `)` (`posted` $posted^)? attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_inc_multicast", "summary": "NocSemaphoreIncMulticast", "description": "Initiates an atomic increment (with 32-bit wrap) of a 4-byte L1 semaphore\n on every core in a rectangular destination grid. The destinations are\n encoded in a uint64_t produced by *get_noc_multicast_addr* covering the\n NOC coordinate range (x_start, y_start, x_end, y_end) and the target L1\n address. Used for cumulative synchronization across multiple senders\n sharing receivers, paired with *experimental.semaphore_wait_min*.\n\n The sender must not be a member of the multicast destination set; for\n including the sender there is no corresponding loopback variant in\n tt-metal at this time.\n\n The `posted` attribute mirrors the semantics of `noc_semaphore_inc`'s\n `posted` template parameter. Posted multicast is currently restricted\n on some architectures in the underlying tt-metal (cf. the assertion in\n the v2 `Noc::async_write_multicast` API); leave unset when in doubt.", "operands": [ { "name": "addr", "type": "TTKernel_NocAddr" }, { "name": "incr", "type": "IndexLike" }, { "name": "num_dests", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "attributes": [ { "name": "posted", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $addr `,` $incr `,` $num_dests (`,` $noc^)? `)` (`posted` $posted^)? attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_set", "summary": "NocSemaphoreSet", "description": "Sets the value of a local L1 memory address on the Tensix core executing\n this function to a specific value. This L1 memory address is used as a\n semaphore of size 4 Bytes, as a synchronization mechanism. Also, see\n *noc_semaphore_wait*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "IndexLike" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_set_multicast", "summary": "NocSemaphoreSetMulticast", "description": "Initiates an asynchronous write from a source address in L1 memory on the\n Tensix core executing this function call to a rectangular destination grid.\n The destinations are specified using a uint64_t encoding referencing an\n on-chip grid of nodes located at NOC coordinate range\n (x_start,y_start,x_end,y_end) and a local address created using\n *get_noc_multicast_addr* function. The size of data that is sent is 4 Bytes.\n This is usually used to set a semaphore value at the destination nodes, as a\n way of a synchronization mechanism. The same as *noc_async_write_multicast*\n with preset size of 4 Bytes.\n With this API, the multicast sender cannot be part of the multicast\n destinations. If the multicast sender has to be in the multicast\n destinations (i.e. must perform a local L1 write), the other API variant\n *noc_semaphore_set_multicast_loopback_src* can be used.", "operands": [ { "name": "src_local_l1_addr", "type": "AnyTypeOf<[TTKernel_L1Addr, TTKernel_LocalSemaphore]>" }, { "name": "dst_noc_addr_multicast", "type": "TTKernel_NocAddr" }, { "name": "num_dests", "type": "I32" } ], "attributes": [ { "name": "linked", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $src_local_l1_addr `,` $dst_noc_addr_multicast `,` $num_dests (`,` $linked^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_set_multicast_loopback_src", "summary": "NocSemaphoreSetMulticastLoopback", "description": "Initiates an asynchronous write from a source address in L1 memory on the\n Tensix core executing this function call to a rectangular destination grid.\n The destinations are specified using a uint64_t encoding referencing an\n on-chip grid of nodes located at NOC coordinate range\n (x_start,y_start,x_end,y_end) and a local address created using\n *get_noc_multicast_addr* function. The size of data that is sent is 4 Bytes.\n This is usually used to set a semaphore value at the destination nodes, as a\n way of a synchronization mechanism. The same as *noc_async_write_multicast*\n with preset size of 4 Bytes.\n Note: With this API, sending data only to the source node (when num_dests\n is 1) may result in unexpected behaviour. For some parameters, hangs have\n been observed. For some other parameters, nothing may happen. Consider using\n regular non multicast operations such as *noc_async_write* in this case.", "operands": [ { "name": "src_local_l1_addr", "type": "AnyTypeOf<[TTKernel_L1Addr, TTKernel_LocalSemaphore]>" }, { "name": "dst_noc_addr_multicast", "type": "TTKernel_NocAddr" }, { "name": "num_dests", "type": "I32" } ], "attributes": [ { "name": "linked", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $src_local_l1_addr `,` $dst_noc_addr_multicast `,` $num_dests (`,` $linked^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_wait", "summary": "NocSemaphoreWait", "description": "A blocking call that waits until the value of a local L1 memory address on\n the Tensix core executing this function becomes equal to a target value.\n This L1 memory address is used as a semaphore of size 4 Bytes, as a\n synchronization mechanism. Also, see *noc_semaphore_set*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "IndexLike" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.noc_semaphore_wait_min", "summary": "NocSemaphoreWaitMin", "description": "A blocking call that waits until the value of a local L1 memory address on\n the Tensix core executing this function becomes equal or greater than a target value.\n This L1 memory address is used as a semaphore of size 4 Bytes, as a\n synchronization mechanism. Also, see *noc_semaphore_set*.", "operands": [ { "name": "sem_addr", "type": "TTKernel_L1AddrPtr" }, { "name": "val", "type": "I32" } ], "assemblyFormat": "`(` $sem_addr `,` $val `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.pack_reconfig_data_format", "summary": "Reconfigure packer data format for the given output CB.", "description": "Reconfigures the packer data format to match the output circular buffer.\n Must be called before pack_reconfig_l1_acc to ensure format consistency\n during L1 accumulation.", "operands": [ { "name": "out_cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $out_cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.pack_reconfig_l1_acc", "summary": "Reconfigure packer to L1 accumulation mode.", "description": "Reconfigures the packer to accumulate when packing from DST to L1.", "operands": [ { "name": "l1_acc_en", "type": "I32" } ], "assemblyFormat": "`(` $l1_acc_en `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.pack_tile", "summary": "PackTile op.", "description": "Copies a single tile from the DST register buffer at a specified index to a\n specified CB at a given index. For the out_tile_index to be valid for this\n call, cb_reserve_back(n) has to be called first to reserve at least some\n number n > 0 of tiles in the output CB. out_tile_index = 0 then references\n the first tile in the reserved section of the CB, up to index n - 1, which will\n then be visible to the consumer in the same order after a cb_push_back call.\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.\n\n Each subsequent pack call will increment the write pointer in the cb by single\n tile size. The pointer is then again set to a valid position with space for n\n reserved tiles by another cb_reserve_back call.\n\n Operates in tandem with functions cb_reserve_back and cb_push_back.\n\n A typical use case is first the producer ensures that there is a number of\n tiles available in the buffer via cb_reserve_back, then the producer uses\n the pack_tile call to copy a tile from one of DST slots to a slot in\n reserved space and finally cb_push_back is called to announce visibility of\n the reserved section of the circular buffer to the consumer.", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "out_cb", "type": "TTKernel_CB" }, { "name": "out_index", "type": "IndexLike" } ], "attributes": [ { "name": "out_of_order", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` $dst_index `,` $out_cb `,` $out_index `,` $out_of_order`)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.pack_tile_block", "summary": "PackTileBlock op.", "description": "Copies a contiguous block of ntiles tiles from the DST register buffer,\n starting at dst_index through dst_index + ntiles - 1, to a specified\n output CB. Unlike pack_tile, which copies a single tile and supports\n out-of-order packing, this copies tiles sequentially from contiguous DST\n slots. The CB write pointer advances by ntiles after each call and resets\n after cb_push_back.\n\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.\n\n Operates in tandem with functions cb_reserve_back and cb_push_back.\n\n A typical use case is packing an entire block of computed tiles from DST\n to an output CB in one call, rather than issuing pack_tile for each tile\n individually. The producer first reserves space via cb_reserve_back, then\n calls pack_tile_block to copy all ntiles at once, and finally calls\n cb_push_back to make the block visible to the consumer.", "operands": [ { "name": "dst_index", "type": "IndexLike" }, { "name": "out_cb", "type": "TTKernel_CB" }, { "name": "ntiles", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst_index `,` $out_cb `,` $ntiles `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.pack_untilize_init", "summary": "PackUntilizeInitOp call.", "description": "Initializes UNPACK, MATH, and PACK threads for the pack untilize\n operation. Maps to the official tt-metal\n `pack_untilize_init(icb, ocb)` API.\n `cols_per_dst_pass` is the number of column tiles processed per DST pass\n (`block_ct_dim` in the tt-metal template), and `total_col_tiles` is the\n total number of column tiles (`full_ct_dim` in the tt-metal template).\n For correctness, `cols_per_dst_pass` must divide `total_col_tiles`, and\n `cols_per_dst_pass` must fit\n in DST capacity for the target data type. Both default to 1.\n This op is expected to be paired with\n `experimental.pack_untilize_block` and finalized by\n `pack_untilize_uninit`.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "attributes": [ { "name": "colsPerDstPass", "type": "DefaultValuedAttr" }, { "name": "totalColTiles", "type": "DefaultValuedAttr" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.pack_untilize_uninit", "summary": "PackUntilizeUninitOp call.", "description": "Uninitializes the pack untilize operation. Maps to the official tt-metal\n `pack_untilize_uninit(ocb)` API.", "operands": [ { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.power_binary_tile", "summary": "Power operation between two tiles", "description": "Performs element-wise computation of power operation\n DST[odst_index] <- DST[dst0_index] ^ DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.power_binary_tile_init", "summary": "Short init function which configures compute unit for execution of power_binary_tile.", "description": "Must be run before power_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.power_tile", "summary": "Power by scalar operation", "description": "Performs element-wise exponentiation of a tile by a scalar value.\n DST[dst0_index] <- DST[dst0_index] ^ scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.power_tile_init", "summary": "Init function for power_tile operation.", "description": "Must be run before power_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.rand_tile", "summary": "Rand tile operation", "description": "Performs element-wise rand on each element of a tile in DST register at\n index tile_index. That is each element is overwritten with a randomly\n generated float in the range [from, from + scale).\n\n `from` and `scale` are passed as the uint32_t bit pattern of their\n corresponding f32 values. The DST register buffer must be in acquired\n state via *tile_regs_acquire* call.", "operands": [ { "name": "tile_index", "type": "IndexLike" }, { "name": "from", "type": "IndexLike" }, { "name": "scale", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `,` $from `,` $scale `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.rand_tile_init", "summary": "Init function for rand_tile operation. Refer to documentation for any init function.", "description": "Initializes the PRNG seed for the SFPU. Must be run before rand_tile.", "operands": [ { "name": "seed", "type": "IndexLike" } ], "assemblyFormat": "`(` $seed `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.recip_tile", "summary": "Recip tile in the DST at specified index.", "description": "Performs element-wise computation of the reciprocal on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.\n Only works for Float32, Float16_b, Bfp8_b data formats for full accuracy.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.recip_tile_init", "summary": "Init function for recip_tile operation. Refer to documentation for any init function.", "description": "Must be called before recip_tile function.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reduce_init", "summary": "Init function", "description": "Must be run before reduce_tile.", "operands": [ { "name": "in_cb", "type": "TTKernel_CB" }, { "name": "scaling_cb", "type": "TTKernel_CB" }, { "name": "out_cb", "type": "TTKernel_CB" } ], "attributes": [ { "name": "reduce_type", "type": "TTKernel_ReduceTypeAttr{reduce_sum|reduce_max|reduce_avg}" }, { "name": "reduce_dim", "type": "TTKernel_ReduceDimAttr{reduce_dim_row|reduce_dim_col|reduce_dim_scalar}" } ], "assemblyFormat": "`(` $in_cb `,` $scaling_cb `,` $out_cb `,` $reduce_type `,` $reduce_dim `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reduce_tile", "summary": "Reduce operation", "description": "Performs a reduction operation *B = reduce(A)* using reduce_func for\n dimension reduction on a tile in the CB at a given index and writes the\n result to the DST register at index *dst_tile_index*. Reduction can be\n either of type *Reduce::R*, *Reduce::C* or *Reduce::RC*, identifying the\n dimension(s) to be reduced in size to 1. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n The templates takes reduce_type which can be ReduceFunc::Sum, ReduceFunc::Max\n and reduce_dim which can be Reduce::R, Reduce::C, Reduce::RC.\n They can also be specified by defines REDUCE_OP and REDUCE_DIM.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "in_cb", "type": "TTKernel_CB" }, { "name": "scaling_cb", "type": "TTKernel_CB" }, { "name": "in_tile_index", "type": "IndexLike" }, { "name": "scaling_tile_index", "type": "IndexLike" }, { "name": "dst_index", "type": "IndexLike" } ], "attributes": [ { "name": "reduce_type", "type": "TTKernel_ReduceTypeAttr{reduce_sum|reduce_max|reduce_avg}" }, { "name": "reduce_dim", "type": "TTKernel_ReduceDimAttr{reduce_dim_row|reduce_dim_col|reduce_dim_scalar}" } ], "assemblyFormat": "`(` $in_cb `,` $scaling_cb `,` $in_tile_index `,` $scaling_tile_index `,` $dst_index `,` $reduce_type `,` $reduce_dim `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reduce_uninit", "summary": "Init function for reduce_uninit operation.", "description": "Resets the packer edge mask configuration to its default state by clearing any previously set masks. Needs to be called after\n reduce_tile if the next operation requires default packer state. In case that the next operation is reduce operation across the\n same dimension, this call can be omitted. If this function is not called, the packer will continue to use the edge masks set\n by the latest reduce_init call, which may lead to incorrect packing behavior in subsequent operations.\n\n This function is not in line with our programming mode. To be removed by end of 2025. tt-metal#22904.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reinterpret_cast", "summary": "CastToL1Ptr", "description": "Cast specified addr to L1 pointer.", "operands": [ { "name": "addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" } ], "results": [ { "name": "l1_ptr", "type": "TTKernel_L1AddrPtr" } ], "assemblyFormat": "`(` $addr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reinterpret_cast", "summary": "CastToL1Ptr", "description": "Cast specified addr to L1 pointer.", "operands": [ { "name": "addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" } ], "results": [ { "name": "l1_ptr", "type": "TTKernel_L1AddrPtr" } ], "assemblyFormat": "`(` $addr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reinterpret_cast", "summary": "CastToL1Ptr", "description": "Cast specified addr to L1 pointer.", "operands": [ { "name": "addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" } ], "results": [ { "name": "l1_ptr", "type": "TTKernel_L1AddrPtr" } ], "assemblyFormat": "`(` $addr `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.relu_tile", "summary": "Relu operation", "description": "Performs element-wise computation of relu on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.relu_tile_init", "summary": "Short init function which configures compute unit for execution of relu_tile(_int32).", "description": "Must be run before relu_tile(_int32).", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.relu_tile_int32", "summary": "Relu operation (for int32 type)", "description": "Performs element-wise computation of relu on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.remote_sram_write_u32", "summary": "RemoteSramWriteU32", "description": "Initiates a 4-byte remote SRAM write of the u32 value stored at a local\n SRAM address on the Tensix core executing this function call. The source\n SRAM word may be referenced by a typed SRAM address, a computed i32 SRAM\n address, or a local semaphore handle.", "operands": [ { "name": "src_sram_addr", "type": "AnyTypeOf<[I32, TTKernel_L1Addr, TTKernel_LocalSemaphore]>" }, { "name": "dst_remote_addr", "type": "TTKernel_NocAddr" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $src_sram_addr `,` $dst_remote_addr (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.reset_noc_trid_barrier_counter", "summary": "ResetNocTridBarrierCounter", "description": "Resets the barrier counters for a set of transaction IDs on a given NOC. Mask bits correspond to TRIDs 0-15; NOC is 0 or 1.\n\n Example:\n ```\n ttkernel.reset_noc_trid_barrier_counter(%mask, %noc_idx) : (i32, i8) -> ()\n ```", "operands": [ { "name": "idMask", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "assemblyFormat": "`(` $idMask (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.rounding_op_tile_init", "summary": "Init function for ceil/floor/round_tile operation. Refer to documentation for any init function.", "description": "Must be run before ceil/floor/round_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.rsqrt_tile", "summary": "Rsqrt operation", "description": "Performs element-wise computation of reciprocal sqrt on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.rsqrt_tile_init", "summary": "Short init function which configures compute unit for execution of rsqrt_tile.", "description": "Must be run before rsqrt_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.selu_tile", "summary": "Selu operation", "description": "Performs element-wise SELU activation: scale*(max(0,x) + min(0,alpha*(exp(x)-1)))\n on each element of a tile in DST register at index tile_index.\n scale and alpha are uint32 bit-cast representations of bf16 float values.\n The DST register buffer must be in acquired state via *tile_regs_acquire*\n call. This call is blocking and is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" }, { "name": "scale", "type": "I32" }, { "name": "alpha", "type": "I32" } ], "assemblyFormat": "`(` $tile_index `,` $scale `,` $alpha `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.selu_tile_init", "summary": "Short init function which configures compute unit for execution of selu_tile.", "description": "Must be run before selu_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sfpu_reduce", "summary": "SFPU reduce operation on a tile in DST.", "description": "Performs an intra-tile reduction on the tile at index `dst_index` in the\n DST register using the SFPU path. The input tile must already be loaded\n into DST (e.g. via copy_tile). The reduction is performed in-place on\n that DST slot, writing the result into the first row (REDUCE_COL) or\n first column (REDUCE_ROW) of the same tile.\n\n Only 32x32 tile dimensions are supported.\n\n Only Sum/Max reductions over Int32 tiles are supported today, and\n reduce_dim must be Row or Col (Scalar must be decomposed into Col + Row\n by the caller); the verifier enforces these constraints.\n\n Lowers to: sfpu_reduce(dst_index).", "operands": [ { "name": "dst_index", "type": "IndexLike" } ], "attributes": [ { "name": "reduce_type", "type": "TTKernel_ReduceTypeAttr{reduce_sum|reduce_max|reduce_avg}" }, { "name": "data_format", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "reduce_dim", "type": "TTKernel_ReduceDimAttr{reduce_dim_row|reduce_dim_col|reduce_dim_scalar}" } ], "assemblyFormat": "`(` $dst_index `,` $reduce_type `,` $data_format `,` $reduce_dim `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sfpu_reduce_init", "summary": "Init for sfpu_reduce.", "description": "Initializes the SFPU reduce kernel. Must be called before sfpu_reduce.\n Unlike reduce_init this call carries no CB/DST operands: it only\n configures the SFPU for the given PoolType and DataFormat.\n\n Only Sum/Max reductions over Int32 tiles are supported today; the\n verifier enforces this.\n\n Lowers to: sfpu_reduce_init().", "attributes": [ { "name": "reduce_type", "type": "TTKernel_ReduceTypeAttr{reduce_sum|reduce_max|reduce_avg}" }, { "name": "data_format", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $reduce_type `,` $data_format `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sigmoid_tile", "summary": "Sigmoid operation", "description": "Performs element-wise computation of sigmoid on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sigmoid_tile_init", "summary": "Short init function which configures compute unit for execution of sigmoid_tile.", "description": "Must be run before sigmoid_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sign_tile", "summary": "Sign operation", "description": "Performs element-wise computation of sign on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sign_tile_init", "summary": "Init function for sign_tile operation. Refer to documentation for any init function.", "description": "Must be run before sign_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.signbit_tile", "summary": "Signbit operation", "description": "Performs element-wise sign bit extraction on each element of a tile\n in DST register at index tile_index, returning 0.0 if the sign bit is\n clear and 1.0 if it is set (matching IEEE 754 signbit semantics).\n The DST register buffer must be in acquired state via *tile_regs_acquire*\n call. This call is blocking and is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.signbit_tile_init", "summary": "Short init function which configures compute unit for execution of signbit_tile.", "description": "Must be run before signbit_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.silu_tile", "summary": "Silu operation", "description": "Performs element-wise computation of silu on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.silu_tile_init", "summary": "Short init function which configures compute unit for execution of silu_tile.", "description": "Must be run before silu_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sin_tile", "summary": "Sine tile in the DST at specified index.", "description": "Performs element-wise computation of sine operation\n DST[dst0_index] <- sin(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sin_tile_init", "summary": "Init function for sin_tile operation. Refer to documentation for any init function.", "description": "Must be run before sin_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.softsign_tile", "summary": "Softsign operation", "description": "Performs element-wise computation of x/(1+|x|) on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and is\n only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.softsign_tile_init", "summary": "Short init function which configures compute unit for execution of softsign_tile.", "description": "Must be run before softsign_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sqrt_tile", "summary": "Sqrt operation", "description": "Performs element-wise computation of sqrt on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sqrt_tile_init", "summary": "Short init function which configures compute unit for execution of sqrt_tile.", "description": "Must be run before sqrt_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.square_tile", "summary": "Square operation", "description": "Performs element-wise computation of x^2 on each element of a tile in\n DST register at index tile_index. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call. This call is blocking and\n is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.square_tile_init", "summary": "Short init function which configures compute unit for execution of square_tile.", "description": "Must be run before square_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.store_to_l1", "summary": "StoreToL1", "description": "Store value to L1.", "operands": [ { "name": "value", "type": "AnyTypeOf<[I8, I16, I32]>" }, { "name": "l1_ptr", "type": "TTKernel_L1AddrPtr" }, { "name": "offset", "type": "I32" } ], "assemblyFormat": "`(` $value `,` $l1_ptr `,` $offset `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_binary_tile", "summary": "Subtraction operation between two tiles", "description": "Performs element-wise computation of subtraction operation\n DST[odst_index] <- DST[dst0_index] - DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_binary_tile_init", "summary": "Short init function", "description": "Must be run before sub_binary_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_int_tile", "summary": "Integer subtraction operation between two tiles", "description": "Performs element-wise computation of integer subtraction operation\n DST[odst_index] <- DST[dst0_index] - DST[dst1_index]\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.\n Supported data formats are: Int32, UInt32, UInt16.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "dst1_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $dst1_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_int_tile_init", "summary": "Short init function", "description": "Must be run before sub_int_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_tiles", "summary": "Sub operation", "description": "Performs element-wise subtraction C=A-B of tiles in two CBs at given\n indices and writes the result to the DST register at index dst_tile_index.\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" }, { "name": "in0_tile_index", "type": "IndexLike" }, { "name": "in1_tile_index", "type": "IndexLike" }, { "name": "dst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `,` $in0_tile_index `,` $in1_tile_index `,` $dst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_tiles_init", "summary": "Short init function", "description": "Must be run before sub_tiles.", "operands": [ { "name": "in0_cb", "type": "TTKernel_CB" }, { "name": "in1_cb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $in0_cb `,` $in1_cb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_unary_tile", "summary": "Subtract by scalar operation", "description": "Performs element-wise subtraction of a tile by a scalar value.\n DST[dst0_index] <- DST[dst0_index] - scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.sub_unary_tile_int32", "summary": "Subtract by int32 scalar operation", "description": "Performs element-wise subtraction of an int32 tile by an int32 scalar value.\n DST[dst0_index] <- DST[dst0_index] - scalar\n The DST register buffer must be in acquired state via *tile_regs_acquire* call.\n This call is blocking and is only available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" }, { "name": "param", "type": "I32" } ], "assemblyFormat": "`(` $dst0_index `,` $param `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tan_tile", "summary": "Tan operation", "description": "Performs element-wise computation of the trigonometric tangent operation on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tan_tile_init", "summary": "Short init function which configures compute unit for execution of tan_tile.", "description": "Must be run before tan_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tanh_tile", "summary": "Tanh operation", "description": "Performs element-wise computation of the hyperbolic tangent operation on each element of a tile\n in DST register at index tile_index. The DST register buffer must be in\n acquired state via *acquire_dst* call. This call is blocking and is only\n available on the compute engine.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst0_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tanh_tile_init", "summary": "Short init function which configures compute unit for execution of tanh_tile.", "description": "Must be run before tanh_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.get_bank_and_offset", "summary": "TensorAccessor's get_bank_and_offset", "description": "Returns bank id and page offset.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "page_id", "type": "I32" } ], "results": [ { "name": "bank_id_and_offset", "type": "TTKernel_TensorAccessorPageMapping" } ], "assemblyFormat": "`(` $tensor_accessor `,` $page_id `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.get_noc_addr", "summary": "TensorAccessor's get_noc_addr", "description": "get_noc_addr using information stored in the TensorAccessor.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "id", "type": "I32" }, { "name": "offset", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "nocAddr", "type": "TTKernel_NocAddr" } ], "assemblyFormat": "`(` $tensor_accessor `,` $id `,` $offset (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.get_shard_noc_addr", "summary": "TensorAccessor's get_shard_noc_addr", "description": "Returns noc addr of a shard.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "shard_id", "type": "I32" }, { "name": "offset", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "shardNocAddr", "type": "I32" } ], "assemblyFormat": "`(` $tensor_accessor `,` $shard_id `,` $offset (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.is_local_addr", "summary": "TensorAccessor's is_local_addr", "description": "Returns bool indicating addr locality.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "virtual_x", "type": "I32" }, { "name": "virtual_y", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $tensor_accessor `,` $virtual_x `,` $virtual_y (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.is_local_bank", "summary": "TensorAccessor's is_local_bank", "description": "Returns bool indicating bank locality.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "id", "type": "I32" }, { "name": "offset", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $tensor_accessor `,` $id `,` $offset (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.is_local_page", "summary": "TensorAccessor's is_local_page", "description": "Returns bool indicating page locality.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "page_id", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $tensor_accessor `,` $page_id (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tensor_accessor.is_local_shard", "summary": "TensorAccessor's is_local_shard", "description": "Returns bool indicating shard locality.", "operands": [ { "name": "tensor_accessor", "type": "TTKernel_TensorAccessor" }, { "name": "shard_id", "type": "I32" }, { "name": "noc", "type": "Optional" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "`(` $tensor_accessor `,` $shard_id (`,` $noc^)? `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.TensorAccessor", "summary": "MakeTensorAccessorFromArgs", "description": "TensorAccessor constructor.", "operands": [ { "name": "args", "type": "TTKernel_TensorAccessorArgs" }, { "name": "bank_base_address_in", "type": "I32" }, { "name": "page_size_in", "type": "I32" } ], "results": [ { "name": "result", "type": "TTKernel_TensorAccessor" } ], "assemblyFormat": "`(` $args `,` $bank_base_address_in `,` $page_size_in `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.TensorAccessorArgs", "summary": "TensorAccessorArgs", "description": "TensorAccessorArgs struct constructor.\n\n CTA (compile-time args) and CRTA (compile/runtime args) offsets are determined as follows.\n 1. If cta_expr is provided: use the constexpr string expression.\n 2. Else if `prev_args` is provided, use chaining:\n `prev_args.next_compile_time_args_offset()` (for CTA) or\n `prev_args.next_common_runtime_args_offset()` (for CRTA).\n 3. Otherwise, use cta_base/crta_base integer constants.\n\n Examples:\n ```mlir\n // Literal offsets\n %c0 = arith.constant 0 : i32\n %args = ttkernel.TensorAccessorArgs(%c0, %c0) : (i32, i32) -> !ttkernel.TensorAccessorArgs\n // Generates: TensorAccessorArgs<0, 0>()\n\n // CTA+CRTA chaining (common pattern)\n %args_src = ttkernel.TensorAccessorArgs(%c0, %c0) : (i32, i32) -> !ttkernel.TensorAccessorArgs\n %args_dst = ttkernel.TensorAccessorArgs(prev = %args_src) : (!ttkernel.TensorAccessorArgs) -> !ttkernel.TensorAccessorArgs\n // Generates: TensorAccessorArgs()\n\n // Selective override: chain CTA from prev, use literal CRTA\n %args_custom = ttkernel.TensorAccessorArgs(prev = %args_src) {crta_expr = \"0\"} : (!ttkernel.TensorAccessorArgs) -> !ttkernel.TensorAccessorArgs\n // Generates: TensorAccessorArgs()\n\n // Constexpr expression (no chaining)\n %args_expr = ttkernel.TensorAccessorArgs(%c0, %c0) {cta_expr = \"get_offset()\"} : (i32, i32) -> !ttkernel.TensorAccessorArgs\n // Generates: TensorAccessorArgs()\n ```", "operands": [ { "name": "cta_base", "type": "Optional" }, { "name": "crta_base", "type": "Optional" }, { "name": "prev_args", "type": "Optional" } ], "results": [ { "name": "result", "type": "TTKernel_TensorAccessorArgs" } ], "attributes": [ { "name": "cta_expr", "type": "OptionalAttr" }, { "name": "crta_expr", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "ttkernel.tile_regs_acquire", "summary": "tile_regs_acquire", "description": "Acquire an exclusive lock on the DST register for the MATH thread.\n This register is an array of 16 tiles of 32x32 elements each.\n This is a blocking function, i.e. this function will wait until the lock is acquired.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tile_regs_commit", "summary": "tile_regs_commit", "description": "Release lock on DST register by MATH thread. The lock had to be previously acquired with tile_regs_acquire.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tile_regs_release", "summary": "tile_regs_release", "description": "Release lock on DST register by PACK thread. The lock had to be previously acquired with tile_regs_wait.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tile_regs_wait", "summary": "tile_regs_wait", "description": "Acquire an exclusive lock on the DST register for the PACK thread.\n It waits for the MATH thread to commit the DST register.\n This is a blocking function, i.e. this function will wait until the lock is acquired.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tilize_block", "summary": "TilizeBlockOp call.", "description": "TilizeBlockOp operation", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "numTiles", "type": "I32" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `,` $numTiles `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tilize_init", "summary": "TilizeInitOp call.", "description": "Initialize the tilize operation. To be called once at beginning of a\n kernel.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "numTiles", "type": "I32" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `,` $numTiles `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.tilize_uninit", "summary": "TilizeUninitOp call.", "description": "Uninitialize tilize operation before re-initializing for another operation.", "operands": [ { "name": "cbI", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbI `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.topk_local_sort", "summary": "TopK local sort operation", "description": "Bitonic local-sort stage of TopK over the value and index tiles pre-loaded in DST. Compute engine only.", "operands": [ { "name": "idst", "type": "IndexLike" }, { "name": "idir", "type": "I32" }, { "name": "i_end_phase", "type": "I32" }, { "name": "i_start_phase", "type": "I32" } ], "assemblyFormat": "`(` $idst `,` $idir `,` $i_end_phase `,` $i_start_phase `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.topk_merge", "summary": "TopK merge operation", "description": "Merge stage of TopK combining length-K subsequences in DST. Compute engine only.", "operands": [ { "name": "idst", "type": "IndexLike" }, { "name": "m_iter", "type": "I32" }, { "name": "k", "type": "I32" } ], "assemblyFormat": "`(` $idst `,` $m_iter `,` $k `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.topk_rebuild", "summary": "TopK rebuild operation", "description": "Rebuild stage of TopK re-sorting the surviving subsequences in DST. Compute engine only.", "operands": [ { "name": "idst", "type": "IndexLike" }, { "name": "idir", "type": "I32" }, { "name": "m_iter", "type": "I32" }, { "name": "k", "type": "I32" }, { "name": "logk", "type": "I32" }, { "name": "skip_second", "type": "I32" } ], "assemblyFormat": "`(` $idst `,` $idir `,` $m_iter `,` $k `,` $logk `,` $skip_second `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.topk_tile_init", "summary": "TopK tile init function", "description": "Initialization for the topk operations. Must be called before\n topk_local_sort/topk_merge/topk_rebuild.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.transpose_wh_init", "summary": "TransposeInitOp call.", "description": "Initialize the transpose operation. To be called once at beginning of a\n kernel before transpose operations.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.transpose_wh_tile", "summary": "Transpose WH tile operation", "description": "Performs a 32x32 transpose operation on a tile in the CB\n at a given index and writes the result to the DST register at index\n dst_tile_index.", "operands": [ { "name": "icb", "type": "TTKernel_CB" }, { "name": "itile", "type": "IndexLike" }, { "name": "idst", "type": "IndexLike" } ], "assemblyFormat": "`(` $icb `,` $itile `,` $idst `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.transpose_wh_uninit", "summary": "TransposeUninitOp call.", "description": "Uninitialize transpose operation before re-initializing for another operation.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.trunc_tile", "summary": "Trunc operation", "description": "Performs element-wise truncation toward zero on each element of a tile\n in DST register at index tile_index.\n Requires rounding_op_tile_init to be called first. The DST register\n buffer must be in acquired state via *tile_regs_acquire* call. This call\n is blocking and is only available on the compute engine.", "operands": [ { "name": "tile_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $tile_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.typecast_tile", "summary": "Cast the dataformat of the tile in the DST at specified index.", "description": "Performs element-wise typecast operation\n DST[dst0_index] <- typecast(DST[dst0_index])\n on DST register operands. The DST register buffer must be in\n acquired state via *tile_regs_acquire* call.", "operands": [ { "name": "dst0_index", "type": "IndexLike" } ], "attributes": [ { "name": "in_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "out_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst0_index `,` $in_dtype `,` $out_dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.typecast_tile_init", "summary": "Init function for typecast_tile operation. Refer to documentation for any init function.", "description": "Must be run before typecast_tile.", "attributes": [ { "name": "in_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "out_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $in_dtype `,` $out_dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.unary_bcast", "summary": "Broadcast operation", "description": "Performs a broadcast operation *B = broadcast(A)* using bcast_dim for\n dimension expansion on a tile in the CB at a given index and writes the\n result to the DST register at index *dst_tile_index*. The supported\n broadcast dimensions are `row`, `col`, `scalar` (both row and column). The\n DST register buffer must be in acquired state via *tile_regs_acquire*\n call. This call is blocking and is only available on the compute engine.", "operands": [ { "name": "in_cb", "type": "TTKernel_CB" }, { "name": "in_tile_index", "type": "IndexLike" }, { "name": "dst_tile_index", "type": "IndexLike" } ], "attributes": [ { "name": "bcast_type", "type": "TTKernel_BcastTypeAttr{none|col|row|scalar}" } ], "assemblyFormat": "`(` $in_cb `,` $in_tile_index `,` $dst_tile_index `,` $bcast_type `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.unary_bcast_init", "summary": "Init function", "description": "Must be run before bcast_tile.", "operands": [ { "name": "in_cb", "type": "TTKernel_CB" }, { "name": "out_cb", "type": "TTKernel_CB" } ], "attributes": [ { "name": "bcast_type", "type": "TTKernel_BcastTypeAttr{none|col|row|scalar}" } ], "assemblyFormat": "`(` $in_cb `,` $out_cb `,` $bcast_type `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.unary_op_init_common", "summary": "Initialization function for unary operations.", "description": "This operation initializes all necessary components for unary operations,\n including unpacking, packing, and math configurations.", "operands": [ { "name": "icb", "type": "TTKernel_CB" }, { "name": "ocb", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $icb `,` $ocb `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.unreachable", "summary": "Unreachable op.", "description": "Unreachable operation", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.untilize_block", "summary": "UntilizeBlockOp call.", "description": "UntilizeBlockOp operation", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" }, { "name": "numTiles", "type": "I32" }, { "name": "cbOut", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `,` $numTiles `,` $cbOut `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.untilize_init", "summary": "UntilizeInitOp call.", "description": "Init function for untilize operations, to be used at the beginning of the\n kernel.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.untilize_uninit", "summary": "UntilizeUninitOp call.", "description": "Uninitialize untilize operation, to allow initializing another operation.", "operands": [ { "name": "cbIn", "type": "TTKernel_CB" } ], "assemblyFormat": "`(` $cbIn `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.where_fp32_tile", "summary": "Conditional selection operation", "description": "Performs element-wise conditional selection\n DST[odst_index] <- condition ? DST[dst_true_index] : DST[dst_false_index]\n For each element, if condition is non-zero, selects from dst_true_index,\n otherwise selects from dst_false_index.\n The DST register buffer must be in acquired state via *acquire_dst* call.", "operands": [ { "name": "dst_cond_index", "type": "IndexLike" }, { "name": "dst_true_index", "type": "IndexLike" }, { "name": "dst_false_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "assemblyFormat": "`(` $dst_cond_index `,` $dst_true_index `,` $dst_false_index `,` $odst_index `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.where_tile", "summary": "Conditional selection operation", "description": "Performs element-wise conditional selection\n DST[odst_index] <- condition ? DST[dst_true_index] : DST[dst_false_index]\n For each element, if condition is non-zero, selects from dst_true_index,\n otherwise selects from dst_false_index.\n The DST register buffer must be in acquired state via *acquire_dst* call.", "operands": [ { "name": "dst_cond_index", "type": "IndexLike" }, { "name": "dst_true_index", "type": "IndexLike" }, { "name": "dst_false_index", "type": "IndexLike" }, { "name": "odst_index", "type": "IndexLike" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ], "assemblyFormat": "`(` $dst_cond_index `,` $dst_true_index `,` $dst_false_index `,` $odst_index `,` $dtype `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttkernel.where_tile_init", "summary": "Short init function", "description": "Must be run before where_tile.", "assemblyFormat": "`(` `)` attr-dict `:` functional-type(operands, results)" }, { "name": "ttmetal.create_buffer", "summary": "Create buffer op.", "description": "Create buffer operation.\n\n When this buffer uses a virtual grid, `virtualGridInverseMapping` stores the\n inverse affine map (physical to virtual grid coordinates) and\n `virtualGridForwardMapping` stores the forward affine map (virtual to\n physical grid coordinates). Both are propagated from d2m.empty through\n bufferization.", "results": [ { "name": "result", "type": "AnyNon0RankedMemRef" } ], "attributes": [ { "name": "address", "type": "I64Attr" }, { "name": "virtualGridInverseMapping", "type": "OptionalAttr" }, { "name": "virtualGridForwardMapping", "type": "OptionalAttr" } ] }, { "name": "ttmetal.create_global_semaphore", "summary": "Create global semaphore op.", "description": "Create global semaphore operation", "results": [ { "name": "result", "type": "TTMetal_GlobalSemaphore" } ], "attributes": [ { "name": "address", "type": "I64Attr" }, { "name": "initial_value", "type": "OptionalAttr" }, { "name": "core_range", "type": "TTMetal_CoreRangeAttr" } ] }, { "name": "ttmetal.create_local_semaphore", "summary": "Create local semaphore op.", "description": "Create local semaphore operation", "results": [ { "name": "result", "type": "TTMetal_LocalSemaphore" } ], "attributes": [ { "name": "initial_value", "type": "OptionalAttr" } ] }, { "name": "ttmetal.deallocate_buffer", "summary": "Deallocate buffer op.", "description": "Deallocate buffer operation", "operands": [ { "name": "input", "type": "AnyNon0RankedMemRef" } ] }, { "name": "ttmetal.enqueue_program", "summary": "Enqueue program op.", "description": "Enqueue program operation", "operands": [ { "name": "args", "type": "Variadic" }, { "name": "cbs", "type": "Variadic" } ], "attributes": [ { "name": "cb_ports", "type": "DenseI64ArrayAttr" }, { "name": "kernelConfigs", "type": "TypedArrayAttrBase" }, { "name": "fabricConnectionConfig", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttmetal.enqueue_read_buffer", "summary": "Enqueue read buffer op.", "description": "Enqueue read buffer operation", "operands": [ { "name": "input", "type": "AnyNon0RankedMemRef" }, { "name": "output", "type": "AnyMemRef" } ] }, { "name": "ttmetal.enqueue_write_buffer", "summary": "Enqueue write buffer op.", "description": "Enqueue write buffer operation", "operands": [ { "name": "input", "type": "AnyMemRef" }, { "name": "output", "type": "AnyNon0RankedMemRef" } ] }, { "name": "ttmetal.finish", "summary": "Finish op for command queue.", "description": "Global barrier op, used to wait for all commands on queue to finish." }, { "name": "ttmetal.mesh_shard", "summary": "Nd sharding or (partial) concat op", "description": "Nd sharding or (partial) concat op in D2M runtime.\n ShardToFull: Nd sharding in host memory.\n FullToshard: (partial) concat in host memory.", "operands": [ { "name": "input", "type": "AnyNon0RankedMemRef" } ], "results": [ { "name": "result", "type": "AnyNon0RankedMemRef" } ], "attributes": [ { "name": "shard_type", "type": "TTCore_MeshShardTypeAttr{replicate|maximal|devices}" }, { "name": "shard_direction", "type": "TTCore_MeshShardDirectionAttr{full_to_shard|shard_to_full}" }, { "name": "shard_shape", "type": "DenseI64ArrayAttr" }, { "name": "shard_dims", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttmetal.reset_global_semaphore", "summary": "Reset global semaphore op.", "description": "Reset global semaphore operation", "operands": [ { "name": "semaphore", "type": "TTMetal_GlobalSemaphore" } ], "attributes": [ { "name": "value", "type": "UI32Attr" } ] }, { "name": "ttng.arrive_barrier", "summary": "perform the arrive operation on an mbarrier", "description": "The `ttng.arrive_barrier` operation performs the \"arrive\" operation on an\n mbarrier object in shared memory. The operation requires a `count` attribute\n of at least 1 and decreases the pending arrival count of the mbarrier by\n the specified count.\n\n The operation accepts an optional predicate.\n\n Example:\n\n ```mlir\n ttng.arrive_barrier %barrier, 2 : !ttg.memdesc<1xi64, #shared, #smem, mutable>\n ttng.arrive_barrier %barrier, 1, %pred : !ttg.memdesc<1xi64, #shared, #smem, mutable>\n ```", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" }, { "name": "pred", "type": "Optional" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ], "assemblyFormat": "$alloc `,` $count (`,` $pred^)? attr-dict `:` qualified(type($alloc))" }, { "name": "ttng.async_copy_mbarrier_arrive", "summary": "arrive on mbarrier once all previously issued copies are completed", "operands": [ { "name": "barrier", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "noIncrement", "type": "UnitAttr" } ], "assemblyFormat": "$barrier attr-dict `:` qualified(type($barrier))" }, { "name": "ttng.async_shared_store", "summary": "store a distributed tensor to shared memory asynchronously", "description": "Store a distributed tensor into shared memory using PTX st.async.shared.\n The store completion decrements the transaction count of `mbarrier`.\n This op requires a CTA cluster with at least two CTAs.", "operands": [ { "name": "src", "type": "TT_Tensor" }, { "name": "dst", "type": "TTG_MemDescType" }, { "name": "mbarrier", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src `,` $dst `,` $mbarrier attr-dict `:` type($src) `->`\n qualified(type($dst)) `,` qualified(type($mbarrier))" }, { "name": "ttng.async_tma_copy_global_to_local", "summary": "copy data based on descriptor from global memory to local memory asynchronously", "description": "This operation copies data from global memory to local memory\n asynchronously. This is analogous to tt.load except the data is copied to\n local memory pointed to by the memory descriptor instead of to a distributed\n tensor. The copied data depends on the global memory descriptor pointed to\n by `desc`.\n\n The tensor mode is determined by the descriptor type:\n - tt.tensordesc: TILED mode - Regular tiled tensor memory access\n - See: https://docs.nvidia.com/cuda/parallel-thread-execution/#tensor-tiled-mode\n - ttng.tensordesc_im2col: IM2COL mode - Im2col mode for convolution-friendly access patterns\n - In IM2COL mode, 'coord' is the coordinate in the input tensor\n - For example, for a 4D tensor (NHWC), 'coord' is [batch_idx, channel_idx, h, w]\n - In IM2COL mode, additional `offsets` must be provided (uint16 values)\n - For 3D tensors (NWC): 1 offset (offset_w)\n - For 4D tensors (NHWC): 2 offsets (offset_w, offset_h)\n - For 5D tensors (NDHWC): 3 offsets (offset_w, offset_h, offset_d)\n - General rule: number of offsets = coord.size() - 2\n - See: https://docs.nvidia.com/cuda/parallel-thread-execution/#tensor-im2col-mode", "operands": [ { "name": "desc", "type": "TT_AnyTensorDescType" }, { "name": "coord", "type": "Variadic" }, { "name": "offsets", "type": "Variadic" }, { "name": "barrier", "type": "TTG_MemDescType" }, { "name": "result", "type": "TTG_MemDescType" }, { "name": "pred", "type": "I1" } ], "attributes": [ { "name": "multicast", "type": "UnitAttr" }, { "name": "cache", "type": "DefaultValuedAttr" }, { "name": "evict", "type": "DefaultValuedAttr" }, { "name": "isVolatile", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$desc `[` $coord `]` (`offsets` `=` `[` $offsets^ `]`)? $result `,` $barrier `,` $pred\n oilist(`cacheModifier` `=` $cache | `evictionPolicy` `=` $evict)\n attr-dict `:` qualified(type($desc)) `,` qualified(type($barrier)) `->` qualified(type($result))" }, { "name": "ttng.async_tma_copy_local_to_global", "summary": "copy data based on descriptor from local memory to global memory asynchronously", "description": "This operation copies data from local memory to global memory\n asynchronously. This is analogous to tt.store except the data is copied from\n local memory pointed to by the memory descriptor instead of from a\n distributed tensor. The copied data depends on the global memory descriptor\n pointed to by `desc`.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "coord", "type": "Variadic" }, { "name": "src", "type": "TTG_MemDescType" } ], "assemblyFormat": "$desc `[` $coord `]` $src\n attr-dict `:` qualified(type($desc)) `,` qualified(type($src))" }, { "name": "ttng.async_tma_gather", "summary": "gather data based on descriptor from global memory to local memory asynchronously", "description": "This operation gathers multiple rows of data from a global memory matrix to\n local memory asynchronously. This is similar to\n async_tma_copy_global_to_local except that each row is indexed independently.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "x_offsets", "type": "RankedTensorOf<[I32]>" }, { "name": "y_offset", "type": "I32" }, { "name": "barrier", "type": "TTG_MemDescType" }, { "name": "result", "type": "TTG_MemDescType" }, { "name": "pred", "type": "I1" } ], "attributes": [ { "name": "multicast", "type": "UnitAttr" } ], "assemblyFormat": "$desc `[` $x_offsets `,` $y_offset `]` $result `,` $barrier `,` $pred\n attr-dict `:` type(operands)" }, { "name": "ttng.async_tma_reduce", "summary": "reduce result in gmem based on a TMA descriptor", "description": "This operation copies data from local memory to global memory\n asynchronously, and atomically performs the specified reduction kind.\n Atomicity is at the granularity of individual elements, and only relaxed\n semantics are implied.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "coord", "type": "Variadic" }, { "name": "src", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "kind", "type": "TT_DescriptorReduceKindAttr{add|min|max|inc|dec|and|or|xor}" } ], "assemblyFormat": "$kind `,` $desc `[` $coord `]` $src\n attr-dict `:` qualified(type($desc)) `,` qualified(type($src))" }, { "name": "ttng.async_tma_scatter", "summary": "scatter data from local memory into global memory based on a descriptor asynchronously", "description": "The `ttng.async_tma_scatter` operation scatters multiple separately-indexed\n rows of data from local memory into global memory asynchronously. The\n operation scatters a 2D tensor in shared memory, laid out using the core\n tensor tiles nvmma_shared layout, into separately indexed rows in global\n memory at a given `y` offset.", "operands": [ { "name": "desc", "type": "TT_TensorDescType" }, { "name": "x_offsets", "type": "RankedTensorOf<[I32]>" }, { "name": "y_offset", "type": "I32" }, { "name": "src", "type": "TTG_MemDescType" } ], "assemblyFormat": "$desc `[` $x_offsets `,` $y_offset `]` $src\n attr-dict `:` type(operands)" }, { "name": "ttng.async_tma_store_wait", "summary": "wait for pending TMA store operations.", "description": "Wait for the associated store operations to complete. When `read_only` is\n set, only wait until their reads from shared memory have completed. This is\n needed before shared memory can be written to again.", "attributes": [ { "name": "pendings", "type": "I32Attr" }, { "name": "read_only", "type": "UnitAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "ttng.barrier_expect", "summary": "Signal a barrier of an expected number of bytes to be copied.", "description": "This signals the barrier that `size` bytes are expected to be copied. The\n associated barrier wait will block until the expected number of bytes has\n been copied.", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" }, { "name": "pred", "type": "I1" } ], "attributes": [ { "name": "size", "type": "I32Attr" } ], "assemblyFormat": "$alloc `,` $size attr-dict `,` $pred `:` qualified(type($alloc))" }, { "name": "ttng.clc_get_program_id", "summary": "Get program ID coordinate from CLC response", "description": "Decodes the CLC response to get the program ID coordinate of the\n canceled cluster. The dim attribute specifies which dimension (0=x, 1=y, 2=z).", "operands": [ { "name": "clcResult", "type": "I128" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "dim", "type": "TT_ProgramDim{x|y|z}" } ], "assemblyFormat": "$clcResult `,` $dim attr-dict `:` type($clcResult) `->` type($result)" }, { "name": "ttng.clc_is_canceled", "summary": "Check if CLC response indicates successful cancellation", "description": "Decodes the CLC response to check if a cluster was successfully\n canceled. Returns true if canceled, false otherwise.", "operands": [ { "name": "clcResult", "type": "I128" } ], "results": [ { "name": "is_canceled", "type": "I1" } ], "assemblyFormat": "$clcResult attr-dict `:` type($clcResult) `->` type($is_canceled)" }, { "name": "ttng.clc_load_result", "summary": "Load CLC response from shared memory into registers", "description": "Loads the 128-bit CLC response from shared memory into an i128 value.\n This allows subsequent clc_is_canceled and clc_get_program_id operations to\n operate on registers without re-reading shared memory.", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "results": [ { "name": "clcResult", "type": "I128" } ], "assemblyFormat": "$src attr-dict `:` qualified(type($src)) `->` type($clcResult)" }, { "name": "ttng.clc_try_cancel", "summary": "Issue CLC try_cancel to cancel a pending cluster", "description": "Issues a clusterlaunchcontrol.try_cancel instruction to atomically cancel\n a pending cluster launch. The result is written asynchronously to the\n result buffer and the mbarrier is signaled on completion.\n\n This is used for dynamic persistent kernels on Blackwell (SM100+).\n\n The result buffer must be a 16-byte aligned `2xi64` shared memory memdesc.\n The mbarrier must be 8-byte aligned shared memory.", "operands": [ { "name": "result", "type": "TTG_MemDescType" }, { "name": "mbarrier", "type": "TTG_MemDescType" } ], "assemblyFormat": "$result `,` $mbarrier attr-dict `:` qualified(type($result)) `,` qualified(type($mbarrier))" }, { "name": "ttng.cluster_arrive", "attributes": [ { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "ttng.cluster_barrier", "summary": "Synchronize all warps at cluster scope", "description": "Lowers to a cluster arrive/wait pair.\n\n In warp-specialized kernels, lowering wraps the barrier in a synthetic\n `ttg.warp_specialize` region so worker warps also execute a barrier outside\n existing warp-specialized code. A barrier inside `ttg.warp_specialize`\n lowers through a cluster-scoped mbarrier.", "attributes": [ { "name": "relaxed", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "ttng.cluster_wait", "assemblyFormat": "attr-dict" }, { "name": "ttng.fence_async_shared", "summary": "fence proxy async", "attributes": [ { "name": "bCluster", "type": "BoolAttr" } ], "assemblyFormat": "attr-dict" }, { "name": "ttng.fence_mbarrier_init_release_cluster", "summary": "fence mbarrier init release.cluster", "assemblyFormat": "attr-dict" }, { "name": "ttng.init_barrier", "summary": "Initialize a barrier in the given shared memory allocation.", "description": "Initializes a shared memory allocation with mbarrier information.\n `alloc` is a descriptor to the shared memory allocation. `count` is the\n number of arrives expected by the barrier.\n\n This lowers to PTX mbarrier.init.shared::cta.b64.", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "count", "type": "I32Attr" } ], "assemblyFormat": "$alloc `,` $count attr-dict `:` qualified(type($alloc))" }, { "name": "ttng.inval_barrier", "summary": "Invalidate a barrier allocation.", "description": "Invalidate a barrier allocation so that it can be re-used. According to PTX\n spec this has to be done before any reuse of the memory used by mbarrier.\n\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-inval", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" } ], "assemblyFormat": "$alloc attr-dict `:` qualified(type($alloc))" }, { "name": "ttng.reinterpret_tensor_descriptor", "summary": "Reinterpret a pointer as a tensor descriptor", "description": "This op exists to help the transition from untyped raw TMA objects to typed tensor descriptor objects.\n Ideally, we can remove this once the APIs are fully fleshed out.", "operands": [ { "name": "rawDesc", "type": "TT_Ptr" } ], "results": [ { "name": "result", "type": "TT_TensorDescType" } ], "assemblyFormat": "$rawDesc attr-dict `:` qualified(type($rawDesc)) `to` qualified(type($result))" }, { "name": "ttng.tc_gen5_commit", "summary": "make an mbarrier track completion of all prior async tcgen5 ops", "description": "The `ttng.tc_gen5_commit` is an asynchronous operation that makes the\n mbarrier object track the completion of all prior asynchronous tcgen5\n operations. Upon completion of all asynchronous operations, the mbarrier\n arrive operation is performed on the mbarrier with a count of 1.\n\n If `descs` are provided, the commit will be multicast across the CTA cluster\n based on the shared layouts of those descriptors. This should be used when\n the inputs to the tcgen5 MMA, including scaled-MMA scale inputs, come from\n TMA descriptors using multicast.\n\n Note that the completion mechanisms are guaranteed to occur sequentially in\n the order the commit operations were issued. This means, for example:\n\n ```mlir\n ttng.tmem_copy\n ttng.tc_gen5_mma\n ttng.tc_gen5_commit %barrierA\n ttng.tc_gen5_commit %barrierB\n ```\n\n `%barrierA` tracks the completion of the previous TMEM copy and MMA\n operations, but since the commit groups are sequential, the arrive-on\n operation on `%barrierA` is guaranteed to be performed before the arrive-on\n operation on `%barrierB`, even though its commit group is empty.", "operands": [ { "name": "barrier", "type": "TTG_MemDescType" }, { "name": "pred", "type": "Optional" }, { "name": "descs", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$barrier (`,` $pred^)? (`descs` $descs^)? attr-dict `:`\n qualified(type($barrier)) (`,` qualified(type($descs))^)?" }, { "name": "ttng.tc_gen5_mma", "summary": "block-level op mapping to Tensor Core Gen5 MMA", "description": "$d += matrix_multiply($a, $b).\n If `is_async` is false, the op executes synchronously. The barrier operands\n must not be present in that case. Otherwise, if a barrier is given, the op\n will trigger a commit/arrive on it. The result will be safe to read after a\n barrier wait. If `$two_ctas` is set, the op will execute a matmul across two\n contiguous CTAs and read the data distributed across the two CTAs. It will\n also synchronize both CTAs if the op is synchronous.\n\n This operation takes and produces an optional token to indicate TMEM read\n and write on its accumulator operand. When the tokens are present, they can\n be used to check aliasing and modref on the accumulator memory.\n\n The `isUnsigned` attribute is only relevant when performing an integer MMA operation.\n If true, the integer values are treated as unsigned, otherwise they are treated as signed.", "operands": [ { "name": "a", "type": "TTG_MemDescType" }, { "name": "b", "type": "TTG_MemDescType" }, { "name": "d", "type": "TTG_MemDescType" }, { "name": "acc_dep", "type": "Optional" }, { "name": "useD", "type": "I1" }, { "name": "pred", "type": "I1" }, { "name": "barriers", "type": "Variadic" }, { "name": "barrier_preds", "type": "Variadic" } ], "results": [ { "name": "token", "type": "Optional" } ], "attributes": [ { "name": "is_async", "type": "UnitAttr" }, { "name": "two_ctas", "type": "UnitAttr" }, { "name": "multicast", "type": "UnitAttr" }, { "name": "is_unsigned", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$a `,` $b `,` $d `` custom($acc_dep, type($token)) `,` $useD`,`\n $pred `` custom($barriers, $barrier_preds)\n attr-dict `:` qualified(type($a)) `,` qualified(type($b)) `,`\n qualified(type($d)) (`,` qualified(type($barriers))^)?" }, { "name": "ttng.tc_gen5_mma_scaled", "summary": "block-level op mapping to Tensor Core Gen5 MMA", "description": "$d += matrix_multiply(scale($a, $a_scale), scale($b, $b_scale))\n If `$two_ctas` is set, the op will execute a matmul across two contiguous\n CTAs, read the data distributed across the two CTAs, and synchronize both\n CTAs if the op is synchronous.\n If `is_async` is false, the op executes synchronously. The barrier operands\n must not be present in that case.\n Otherwise, if a barrier is given, the op will trigger a commit/arrive on it.\n The result will be safe to read after a barrier wait.\n\n This operation takes and produces an optional token to indicate TMEM read\n and write on its accumulator operand. When the tokens are present, they can\n be used to check aliasing and modref on the accumulator memory.", "operands": [ { "name": "a", "type": "TTG_MemDescType" }, { "name": "b", "type": "TTG_MemDescType" }, { "name": "d", "type": "TTG_MemDescType" }, { "name": "acc_dep", "type": "Optional" }, { "name": "a_scale", "type": "TTG_MemDescType" }, { "name": "b_scale", "type": "TTG_MemDescType" }, { "name": "useD", "type": "I1" }, { "name": "pred", "type": "I1" }, { "name": "barriers", "type": "Variadic" }, { "name": "barrier_preds", "type": "Variadic" } ], "results": [ { "name": "token", "type": "Optional" } ], "attributes": [ { "name": "a_type", "type": "TT_ScaleDotElemTypeAttr{e4m3|e5m2|e2m3|e3m2|e2m1|bf16|fp16}" }, { "name": "b_type", "type": "TT_ScaleDotElemTypeAttr{e4m3|e5m2|e2m3|e3m2|e2m1|bf16|fp16}" }, { "name": "two_ctas", "type": "UnitAttr" }, { "name": "multicast", "type": "UnitAttr" }, { "name": "is_async", "type": "UnitAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$a `,` $b `,` $d `` custom($acc_dep, type($token)) `,` $a_scale `,`\n $b_scale `,` $useD `,` $pred `lhs` `=` $a_type `rhs` `=` $b_type\n `` custom($barriers, $barrier_preds)\n attr-dict `:` qualified(type($a)) `,` qualified(type($b)) `,`\n qualified(type($d)) `,` qualified(type($a_scale)) `,`\n qualified(type($b_scale)) (`,` qualified(type($barriers))^)?" }, { "name": "ttng.tensormap_create", "summary": "Create a new TMA descriptor on device", "operands": [ { "name": "desc_ptr", "type": "TT_PtrType" }, { "name": "global_address", "type": "TT_PtrType" }, { "name": "box_dim", "type": "Variadic" }, { "name": "global_dim", "type": "Variadic" }, { "name": "global_stride", "type": "Variadic" }, { "name": "element_stride", "type": "Variadic" } ], "attributes": [ { "name": "elem_type", "type": "ConfinedAttr]>" }, { "name": "interleave_layout", "type": "ConfinedAttr]>" }, { "name": "swizzle_mode", "type": "ConfinedAttr]>" }, { "name": "fill_mode", "type": "ConfinedAttr]>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$desc_ptr `,` $global_address `,`\n `[` $box_dim `]` `,`\n `[` $global_dim `]` `,`\n `[` $global_stride `]` `,`\n `[` $element_stride `]`\n attr-dict `:` functional-type(operands, results)" }, { "name": "ttng.tensormap_fenceproxy_acquire", "summary": "Acquire fence on a tensormap object", "operands": [ { "name": "desc_ptr", "type": "TT_PtrType" } ], "assemblyFormat": "$desc_ptr attr-dict `:` qualified(type($desc_ptr))" }, { "name": "ttng.tmem_alloc", "summary": "allocate tensor memory", "description": "This operation allocates a buffer in tensor memory and returns a descriptor\n containing the address and a view of the buffer.\n This is similar to ttg.local_alloc except the buffer is allocated in tensor memory.\n\n Explicitly deallocating a buffer is optional; see local_dealloc.", "operands": [ { "name": "src", "type": "Optional" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" }, { "name": "token", "type": "Optional" } ], "assemblyFormat": "($src^)? attr-dict `:` functional-type(operands, results)" }, { "name": "ttng.tmem_copy", "summary": "Initiate an asynchronous copy operation from shared memory to tensor memory.", "description": "2D blocks stored contiguously in SMEM are copied into TMEM as specified by the destination address.\n This op lowers to the PTX instruction tcgen05.cp. This supports writing to\n the scales TMEM layout as well as the default TMEM layout.\n Currently, the semantics are different when writing to the TMEM scale layout.\n\n In the case of the default layout, the copy doesn't change the logical\n elements between the source and destination memdesc.\n\n In the case of the scale layout:\n Each 32x128b block in SMEM is duplicated over 4 warps and stored into 128 rows\n and 4 columns of TMEM. The primary use case of this op is to copy blocked scales from SMEM to TMEM.\n\n The shape of the input SMEM can be flexibly chosen depending on use cases. In the simplest case (e.g. unit test),\n the source SMEM can be of shape (32 x num_blocks, 16), and the destination TMEM should be of shape (128, 16 x num_blocks),\n for copying 8-bit values. For scaled GEMM, rep_m x rep_k copies of a 32x128b block need to be stored in SMEM, where\n rep_m = BLOCK_M / 128, rep_k = BLOCK_K / scale_vec_size / 4, and scale_vec_size = 32 for MXFP.\n Conceptually, the SMEM is organized in a high-dimensional layout, (rep_m, rep_k, 32, 4, 4B).\n Some axes can be flattened into one to reduce the rank of the load. For example, the following patterns are supported:\n * (rep_m, rep_k * 32 x 4 x 4B), 2D scale load with cp.async\n * (rep_m, rep_k, 32, 16B), 4D scale load with TMA\n * (rep_m, rep_k, 32, 4, 4B), 5D scale load with cp.async\n Since rep_m blocks are not contiguous in SMEM, this axis cannot be flattened into inner ones.\n\n In Triton, the TMEM memdesc for blocked scales must be of the following form:\n * Its shape must be (BLOCK_MN, BLOCK_K / scale_vec_size), representing the logical shape of blocked scales.\n * It must be attached with `tensor_memory_scales_encoding` to indicate the chunk-based layout and its duplication over 4 warps.\n\n In contrast, the source SMEM must be in the explicit chunk-based layout as\n described above. Therefore, the IR might look like this:\n\n %0 = ttng.tmem_alloc : () -> !ttg.memdesc<128x4xi8, #tmem_scales, #ttng.tensor_memory>\n ttng.tmem_copy %1, %0 : !ttg.memdesc<1x1x32x4x4xi8, #shared1, #smem>, !ttg.memdesc<128x4xi8, #tmem_scales, #ttng.tensor_memory>\n\n We interpret the semantics of this copy operation as follows. The chunk-based layout in SMEM implies that\n the logical shape (BLOCK_MN, BLOCK_K / scale_vec_size) in TMEM is the result of certain reshape and transpose operations.\n In practice, to take advantage of the native scale layout and the TMEM copy op, users need to do\n `scales5D.trans(0, 3, 2, 1, 4).reshape(BLOCK_M, BLOCK_K // scale_vec_size)` before feeding scales into dot_scaled.\n When we use tmem_copy in the IR, such reshape and transpose operations are removed. But the change in the logical shape they have caused in\n registers is now understood to be incorporated into tmem_copy itself. Ideally, we would lift reshape / transpose done on registers onto\n the SMEM memdesc, making tmem_copy a straightforward 2D copy operation: (BLOCK_MN, BLOCK_K / scale_vec_size) -> (BLOCK_MN, BLOCK_K / scale_vec_size).\n In the absence of such operations on memdesc, we resort to implicitly encoding the reshape/transpose semantics in tmem_copy.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "dst", "type": "TTG_MemDescType" } ], "assemblyFormat": "$src `,` $dst attr-dict `:` qualified(type(operands))" }, { "name": "ttng.tmem_load", "summary": "Load a buffer from tensor memory into a distributed tensor", "description": "This is similar to ttg.local_load except the result layout is restricted to\n only a few possibilities. Therefore, we cannot combine this op with layout\n conversions like local_load.\n\n This operation takes and produces an optional token to indicate TMEM read\n on its source operand. When the tokens are present, they can\n be used to check aliasing and modref on the TMEM buffer.\n\n Optional reduction modifier:\n When `redOp` is specified, the load operation additionally performs an\n element-wise reduction along the N-dimension of the input and produces a\n second result tensor `red`. For an input of shape `[M, N]`, the\n reduced result has shape `[M]`, containing one reduced value per \"slice\"\n of the N-dimension.\n\n Currently restricted to f32 element type.\n\n - redOp: Specifies the reduction operation (MIN or MAX) to apply along\n the N-dimension. When set, the `red` result must be present.\n - abs: When true, applies absolute value to each element before performing\n the reduction. Only valid when `redOp` is specified.\n - NaN: When true, the reduction propagates NaN values (if any input element\n in a slice is NaN, the corresponding reduced value is NaN).\n When false, NaN values are ignored during reduction.\n Only valid when `redOp` is specified.\n\n Example:\n Input in TMEM of shape [M=2, N=4]:\n [[ 1.0, 3.0, 2.0, 4.0],\n [-5.0, 1.0, 8.0, 2.0]]\n\n With redOp=MAX:\n result = [[ 1.0, 3.0, 2.0, 4.0], // unchanged\n [-5.0, 1.0, 8.0, 2.0]]\n red = [4.0, 8.0] // max along N per row\n\n With redOp=MIN, abs=true:\n red = [1.0, 1.0] // min of |values| per row\n\n This operation lowers to hardware-accelerated reduction via the PTX\n tcgen05.ld.red instruction on supported architectures, e.g. Blackwell Ultra.", "operands": [ { "name": "src", "type": "TTG_MemDescType" }, { "name": "dep", "type": "Optional" } ], "results": [ { "name": "result", "type": "TT_Tensor" }, { "name": "token", "type": "Optional" }, { "name": "red", "type": "Optional" } ], "attributes": [ { "name": "redOp", "type": "OptionalAttr" }, { "name": "abs", "type": "OptionalAttr" }, { "name": "NaN", "type": "OptionalAttr" } ], "assemblyFormat": "$src `` custom($dep, type($token))\n attr-dict `:` qualified(type($src)) `->` type($result) (`,` type($red)^)?" }, { "name": "ttng.tmem_store", "summary": "Store a distributed tensor into a buffer in tensor memory", "description": "This is similar to ttg.local_store except the source layout is restricted to\n only a few possibilities.\n\n This operation takes and produces an optional token to indicate TMEM write\n on its destination operand. When the tokens are present, they can\n be used to check aliasing and modref on the TMEM buffer.", "operands": [ { "name": "dst", "type": "TTG_MemDescType" }, { "name": "dep", "type": "Optional" }, { "name": "src", "type": "TT_Tensor" }, { "name": "pred", "type": "I1" } ], "results": [ { "name": "token", "type": "Optional" } ], "assemblyFormat": "$src `,` $dst `` custom($dep, type($token)) `,` $pred\n attr-dict `:` type($src) `->` qualified(type($dst))" }, { "name": "ttng.tmem_subslice", "summary": "Take a subslice of a tensor memory allocation", "description": "This operation takes a subslice of a tensor memory allocation and returns a\n new descriptor containing the address and a view of the subslice.\n This is similar to ttg.memdesc_subslice except we can only slice along the\n inner dimension of a 2D memdesc, as this is the only supported slice for\n TMEM.", "operands": [ { "name": "src", "type": "TTG_MemDescType" } ], "results": [ { "name": "result", "type": "TTG_MemDescType" } ], "attributes": [ { "name": "N", "type": "I32Attr" } ], "assemblyFormat": "$src attr-dict `:` qualified(type($src)) `->` qualified(type($result))" }, { "name": "ttng.wait_barrier", "summary": "wait until the mbarrier phase completes.", "description": "Blocks the program progress until the mbarrier object in `alloc` completes\n its current phase.\n\n This lowers a waitloop using PTX instruction\n mbarrier.try_wait.parity.shared::cta.b64.\n\n Accepts an optional list of memory dependencies. If present, it is assumed\n that any of the dependencies may be accessed until the barrier completes.\n\n The barrier behavior is described here:\n https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-asynchronous-copy-completion-mechanisms", "operands": [ { "name": "alloc", "type": "TTG_MemDescType" }, { "name": "phase", "type": "I32" }, { "name": "pred", "type": "Optional" }, { "name": "deps", "type": "Variadic" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$alloc `,` $phase (`,` $pred^)? (`deps` $deps^)?\n attr-dict `:` qualified(type($alloc)) (`,` type($deps)^)?" }, { "name": "ttng.warp_group_dot", "summary": "warp group dot", "description": "$d = matrix_multiply($a, $b) + $c. For docs on InputPrecisionAttr, see TT_DotOp", "operands": [ { "name": "a", "type": "TTG_TensorOrMemDesc" }, { "name": "b", "type": "TTG_MemDescType" }, { "name": "c", "type": "TT_FpIntTensor" }, { "name": "useC", "type": "Optional" } ], "results": [ { "name": "d", "type": "TT_FpIntTensor" } ], "attributes": [ { "name": "inputPrecision", "type": "DefaultValuedAttr" }, { "name": "maxNumImpreciseAcc", "type": "DefaultValuedAttr" }, { "name": "isAsync", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'d', 'c', '$_self'>" } ], "assemblyFormat": "$a`,` $b`,` $c (`,` $useC^)? attr-dict\n `:` type($a) `*` qualified(type($b)) `->` type($d)" }, { "name": "ttng.warp_group_dot_wait", "summary": "warp group dot wait", "description": "Waits until there are $pendings or fewer outstanding async dot operations.\n\n $inputs must be the tensors corresponding to the async dot ops that we're\n waiting on. For example, if there are N pending async dot ops and we wait\n until one remains pending, then $inputs must include the results of the\n first N - 1 dot ops.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" } ], "attributes": [ { "name": "pendings", "type": "I32Attr" } ], "traits": [ { "type": "AllTypesMatch<['inputs', 'outputs']>" } ], "assemblyFormat": "$inputs attr-dict `:` type($inputs)" }, { "name": "ttnn.abs", "summary": "Eltwise absolute.", "description": "Eltwise absolute operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.acos", "summary": "Eltwise arccosine op.", "description": "Performs an elementwise arccosine (`acos`) on the input tensor; result\n range [0, π] for inputs in [-1, 1]. Floating-point tensors.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.add", "summary": "Eltwise add.", "description": "Eltwise add operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.aggregate_tensor", "summary": "Aggregate distributed tensor back to host", "description": "Aggregates a multi-device tensor back into a single host-side tensor\n according to the specified composer configuration.\n\n This operation takes a distributed tensor and creates a single-device\n host tensor aggregated according to the MeshComposerConfig configuration.\n\n // Note: In the ttnn API, the aggregate_tensor op takes an input tensor and a MeshToTensor object as its arguments.\n // To create a MeshToTensor object, the API create_mesh_composer is used, which requires both MeshComposerConfig and MeshDevice.\n // Instead of modeling create_mesh_composer as a separate op in the IR, these two strongly coupled APIs are combined into one aggregate_tensor op\n // to keep the IR simple and less cluttered. If a clear need arises in the future, splitting them into separate ops can be considered.\n\n Example:\n ```mlir\n %result = \"ttnn.aggregate_tensor\"(%input, %device) <{\n composer_config = #ttnn.mesh_composer_config<\n dims = [1],\n mesh_shape_override = #ttnn.mesh_shape<2x2>\n >\n }> : (tensor<32x64xbf16>, !ttnn.device) -> tensor<32x64xbf16>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "mesh_device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "composer_config", "type": "TTNN_MeshComposerConfigAttr" } ] }, { "name": "ttnn.all_gather", "summary": "All gather op.", "description": "Tensor All Gather operation", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "all_gather_dim", "type": "SI32Attr" }, { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "sub_device_id", "type": "OptionalAttr" }, { "name": "num_links", "type": "OptionalAttr" }, { "name": "topology", "type": "OptionalAttr" } ] }, { "name": "ttnn.all_reduce", "summary": "All reduce op.", "description": "Tensor All Reduce operation", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" }, { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "sub_device_id", "type": "OptionalAttr" }, { "name": "num_links", "type": "OptionalAttr" }, { "name": "topology", "type": "OptionalAttr" } ] }, { "name": "ttnn.all_reduce_async", "summary": "Asynchronous all reduce op.", "description": "Asynchronous all-reduce collective communication operation. Performs a\n reduction (e.g. sum) across all devices in a mesh and distributes the\n result back to all devices, using async execution to overlap\n communication with computation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" }, { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "sub_device_id", "type": "OptionalAttr" }, { "name": "num_links", "type": "OptionalAttr" }, { "name": "topology", "type": "OptionalAttr" } ] }, { "name": "ttnn.all_to_all_combine", "summary": "Combine expert outputs back to original token positions.", "description": "Inverse of dispatch: gathers expert computation results from expert devices\n and restores tokens to their original device and order.", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_metadata", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_devices", "type": "I64Attr" }, { "name": "cluster_axis", "type": "I64Attr" }, { "name": "num_experts_per_tok", "type": "I64Attr" }, { "name": "output_shard_dim", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.all_to_all_dispatch", "summary": "Dispatch tokens to expert devices for MoE computation.", "description": "Routes tokens to devices holding their selected experts via all-to-all\n communication. Used before sparse_matmul in the MoE dispatch/combine flow.", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" } ], "results": [ { "name": "dispatched", "type": "AnyRankedTensor" }, { "name": "metadata", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_devices", "type": "I64Attr" }, { "name": "cluster_axis", "type": "I64Attr" } ] }, { "name": "ttnn.all_to_all_dispatch_metadata", "summary": "Dispatch tokens with metadata to expert devices for MoE computation.", "description": "Routes tokens along with expert scores to devices holding their selected\n experts via all-to-all communication within a ring (cluster_axis).\n Returns dispatched tokens (sparse — only routed token slots are filled),\n all-gathered expert indices, and all-gathered expert scores.\n\n Dimensions:\n M = tokens per ring device\n K = selected experts per token\n D = total devices, E = total experts\n\n Input shapes (per device, after mesh sharding):\n - input_tensor: [1, 1, M, H]\n - expert_indices: [1, 1, M, K]\n - expert_scores: [1, 1, M, K]\n - expert_mapping: [D, E] entry [d, e] = device ID owning expert e\n\n Output shapes (per device, num_devices * M = tokens_global):\n - dispatched: [1, tokens_global, H]\n - indices: [1, tokens_global, K] (all-gathered across ring)\n - scores: [1, tokens_global, K] (all-gathered across ring)", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_scores", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" } ], "results": [ { "name": "dispatched", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" }, { "name": "scores", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_devices", "type": "I64Attr" }, { "name": "cluster_axis", "type": "I64Attr" }, { "name": "drain_core", "type": "OptionalAttr" } ] }, { "name": "ttnn.alloc", "summary": "Alloc op.", "description": "Tensor Alloc operation", "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "address", "type": "I64Attr" }, { "name": "size", "type": "I64Attr" }, { "name": "buffer_type", "type": "TTNN_BufferTypeAttr{dram|l1|system_memory|l1_small|trace}" } ] }, { "name": "ttnn.arange", "summary": "Arange operation.", "description": "Tensor arange operation.\n\n Produces a (1, 1, 1, N)-shaped tensor with values from `start` to `end` (exclusive) with a step size of `step`.\n\n Examples:\n %0 = \"ttnn.arange\"() {start = 0 : i64, end = 5 : i64 step = 1 : i64} : () -> tensor<1x1x1x5xi64>\n // %0: [[[[0, 1, 2, 3, 4]]]]\n\n %1 = \"ttnn.arange\"() {start = 0 : i64, end = 10 : i64, step = 2 : i64} : () -> tensor<1x1x1x5xf32>\n // %1: [[[[0.0, 2.0, 4.0, 6.0, 8.0]]]]", "operands": [ { "name": "device", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "start", "type": "SI64Attr" }, { "name": "end", "type": "SI64Attr" }, { "name": "step", "type": "SI64Attr" } ] }, { "name": "ttnn.argmax", "summary": "Argmax reduction op.", "description": "Determine the indices of the maximum values along a specified dimension of a tensor or over all elements in a tensor.\n\n Parameters:\n - `input`: The input tensor.\n - `dim`: Specifies the dimension along which the argmax is applied.\n - `keep_dim`: If set to true, the output tensor will have the same number of dimensions as the input tensor.\n\n IR usage:\n // Input tensor of shape (128, 28, 28, 64)\n %input = ... : tensor<128x28x28x64xbf16>\n\n %empty = \"ttnn.empty\"(%0) <{....}> : -> tensor<128x28x28xi32>\n %4 = \"ttnn.argmax\"(%input, %empty) <{dim = 3 : i32}> : (tensor<128x28x28xbf16>, tensor<128x28x28xi32) -> tensor<128x28x28xi32>\n\n Example:\n input: [[1, 5, 3],\n [2, 4, 6]]\n\n // Computing along dim 0\n output: [1, 0, 1]\n\n // Computing along dim 1\n output: [1, 2]\n\n // Computing for entire tensor\n output: 5", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "OptionalAttr" }, { "name": "keep_dim", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.asin", "summary": "Eltwise arcsine op.", "description": "Performs an elementwise arcsine (`asin`) on the input tensor; result\n range [-π/2, π/2] for inputs in [-1, 1]. Floating-point tensors.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.asinh", "summary": "Eltwise inverse hyperbolic sine op.", "description": "Performs an elementwise inverse hyperbolic sine (`asinh`) on the input\n tensor. Accepts all real-valued inputs. Floating-point tensors.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.assign", "summary": "Assign Tensor", "description": "Returns a new tensor which is a new copy of input tensor.\n Alternatively, copies input tensor ``input`` to ``optional_output_tensor``\n if their shapes and memory layouts match, and returns input_b tensor.\n Input tensors can be of any data type.\n Output tensor will be of same data type as Input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.atan", "summary": "Eltwise arctangent op.", "description": "Performs an elementwise arctangent (`atan`) operation on the input tensor.\n This operation computes the inverse tangent of each element, returning\n values in the range [-π/2, π/2]. Supports floating-point tensor types.\n\n Example:\n\n ```mlir\n %input = tensor<4xf32> {1.0, 0.5, 0.0, -1.0}\n %result = \"ttir.atan\"(%input) : (tensor<4xf32>) -> tensor<4xf32>\n ```\n\n Given the input `[1.0, 0.5, 0.0, -1.0]`, the result would be approximately:\n `[0.785, 0.464, 0.0, -0.785]` (values in radians).", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.atan2", "summary": "Eltwise atan2 OP.", "description": "Performs element-wise atan2 operation on lhs and rhs tensor and produces a result\n tensor.\n\n Example:\n ```\n // %lhs: [0.0, 1.0, -1.0]\n // %rhs: [1.0, 0.0, 0.0]\n %result = \"ttnn.atan2\"(%lhs, %rhs) : (tensor<3xf64>, tensor<3xf64>) -> tensor<3xf64>\n // %result: [0.0, 1.57079637, -1.57079637] // [0.0, pi/2, -pi/2]\n ```", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.avg_pool2d", "summary": "Applies a 2D average pooling over an input signal composed of several input planes.", "description": "It is a downsampling operation to reduce the spatial dimensions (height and width) of a input tensor by computing averages with in a window.\n\n Example:\n // 3x3 input tensor\n input: [[1, 2, 3],\n [4, 5, 6],\n [7, 8, 9]]\n kernel_height: 2\n kernel_width: 2\n stride_height: 1\n stride_width: 1\n dilation_height: 1\n dilation_width: 1\n output: [[3, 4],\n [6, 7]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_size", "type": "SI32Attr" }, { "name": "input_height", "type": "SI32Attr" }, { "name": "input_width", "type": "SI32Attr" }, { "name": "channels", "type": "SI32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "applied_shard_scheme", "type": "OptionalAttr" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "reallocate_halo_output", "type": "DefaultValuedAttr" }, { "name": "count_include_pad", "type": "DefaultValuedAttr" }, { "name": "config_tensors_in_dram", "type": "OptionalAttr" } ] }, { "name": "ttnn.batch_norm_inference", "summary": "Batch normalization inference op.", "description": "Batch normalization operation for inference over each channel on input tensor.\n Uses pre-computed mean and variance.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "running_mean", "type": "Optional" }, { "name": "running_var", "type": "Optional" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.batch_norm_training", "summary": "Batch normalization training op.", "description": "Batch normalization operation for training over each channel on input tensor.\n Computes batch statistics and updates running mean and variance.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "running_mean", "type": "Optional" }, { "name": "running_var", "type": "Optional" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "momentum", "type": "DefaultValuedAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.begin_trace_capture", "summary": "Begin trace capture.", "description": "Begins trace capture. Returns a scalar tensor containing the trace id.\n Inputs:\n - `device` TTNN_Device: The device to capture the trace on.\n - `cq_id` ui32: The command queue to capture the trace with. Must be 0 or 1.\n Outputs:\n - `trace_id` AnyRankedTensor: The scalar trace id tensor containing the trace id.", "operands": [ { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "trace_id", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cq_id", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.bitcast_convert", "summary": "Bitcast_convert op.", "description": "This op reinterprets the bits of each element in\n the input tensor as a data type of the output tensor.\n\n The output data type is derived from the result tensor's TTNNLayoutAttr\n encoding via the TTNN_DtypeOpInterface.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.bitwise_and", "summary": "Eltwise bitwise AND.", "description": "Performs element-wise bitwise AND of two tensors `lhs` and `rhs`\n and produces a `result` tensor.\n\n Example:\n // %lhs: [[1, 2], [3, 4]]\n // %rhs: [[5, 6], [7, 8]]\n %result = \"ttnn.bitwise_and\"(%lhs, %rhs) : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n // %result: [[1, 2], [3, 0]]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.bitwise_not", "summary": "Eltwise bitwise NOT.", "description": "Performs element-wise NOT of tensor `operand` and produces a `result` tensor.\n\n Example:\n // Bitwise operation with with integer tensors\n // %operand: [[1, 2], [3, 4]]\n %result = \"ttnn.bitwise_not\"(%operand) : (tensor<2x2xi32>) -> tensor<2x2xi32>\n // %result: [[-2, -3], [-4, -5]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.bitwise_or", "summary": "Eltwise bitwise OR.", "description": "Performs element-wise bitwise OR of two tensors `lhs` and `rhs`\n and produces a `result` tensor.\n\n Example:\n // %lhs: [[1, 2], [3, 4]]\n // %rhs: [[5, 6], [7, 8]]\n %result = \"ttnn.bitwise_or\"(%lhs, %rhs) : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n // %result: [[5, 6], [7, 12]]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.bitwise_xor", "summary": "Eltwise bitwise XOR.", "description": "Performs element-wise bitwise XOR of two tensors `lhs` and `rhs`\n and produces a `result` tensor.\n\n Example:\n // %lhs: [[1, 2], [3, 4]]\n // %rhs: [[5, 6], [7, 8]]\n %result = \"ttnn.bitwise_xor\"(%lhs, %rhs) : (tensor<2x2xi32>, tensor<2x2xi32>) -> tensor<2x2xi32>\n // %result: [[4, 4], [4, 12]]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.capture_or_execute_trace", "summary": "Capture or execute trace.", "description": "Captures or executes the trace. Will have read/write memory effects on the cached trace data.\n If the trace data exists (meaning the trace was captured previously), it will be executed with\n the execute_callee function. Otherwise, the trace will be captured with the capture_callee function.\n\n Inputs:\n - `device` TTNN_Device: The device where the trace was captured.\n - `capture_callee` FlatSymbolRefAttr: The symbol of the capture trace function.\n - `execute_callee` FlatSymbolRefAttr: The symbol of the execute trace function.\n - `inputs` Variadic: The input tensors to the trace function.\n - `semaphore_inputs` Variadic: Global semaphores forwarded into the capture/execute programs.\n Outputs:\n - `results` Variadic: The output tensors from the trace function.", "operands": [ { "name": "device", "type": "TTNN_Device" }, { "name": "inputs", "type": "Variadic" }, { "name": "semaphore_inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "capture_callee", "type": "FlatSymbolRefAttr" }, { "name": "execute_callee", "type": "FlatSymbolRefAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.cbrt", "summary": "Eltwise cubic root.", "description": "Eltwise cubic root operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.ceil", "summary": "Eltwise ceil.", "description": "Eltwise ceil operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.chunked_scaled_dot_product_attention", "summary": "Chunked prefill scaled dot product attention over a paged KV cache.", "description": "Chunked-prefill attention. A prefill chunk of `query` attends\n causally over the prefix `[0, chunk_start_idx + chunk_len)` resident in the\n paged K/V cache, read on device via `page_table`, with the prefix offset given\n by the device tensor `chunk_start_idx` (`[1]` int32).\n\n Because the prefix offset is a device tensor (not a host scalar) and the page\n table is consumed on device, the op holds no host-side state: it can be\n captured inside a trace and replayed across invocations with a different\n `chunk_start_idx` without recompiling.", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "chunk_start_idx", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.clamp_scalar", "summary": "Clamp op.", "description": "Clamp tensor values to a specified range.\n\n Example:\n min: 2.000000+00\n input: [[0, 1, 2, 3, 4, 5, 6, 7]]\n max: 5.000000+00\n\n \"ttnn.clamp_scalar\"(%arg0) <{max = 2.000000e+00 : f32, min = 5.000000e+00 : f32}>\n -> %out = [[2, 2, 2, 3, 4, 5, 5, 5]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "min", "type": "AnyAttrOf<[F32Attr, I32Attr]>" }, { "name": "max", "type": "AnyAttrOf<[F32Attr, I32Attr]>" } ] }, { "name": "ttnn.clamp_tensor", "summary": "Clamp op.", "description": "Clamp tensor values to a specified range using min/max as tensor.\n\n Example:\n min: [[2, 2, 2, 3, 3, 3, 0, 0]]\n input: [[0, 1, 2, 3, 4, 5, 6, 7]]\n max: [[5, 5, 5, 9, 9, 9, 6, 6]]\n\n \"ttnn.clamp_tensor\"(%input, %min, %max)\n %out: [[2, 2, 2, 3, 4, 5, 6, 6]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "min", "type": "AnyRankedTensor" }, { "name": "max", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.concat", "summary": "Concat op.", "description": "Concat tensors along a given dimension.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttnn.concatenate_heads", "summary": "Concatenate heads op used in attention layer.", "description": "Takes in a tensor of shape [batch_size, num_heads, sequence_size, head_size],\n concatenates heads back along the width dimension and returns the tensor\n of shape [batch_size, sequence_size, num_heads * head_size].", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.constant", "summary": "Constant op.", "description": "Produces tensor filled with given constant value.\n\n Examples:\n %0 = \"ttnn.constant\"() {value = dense<[[3, 4, 2], [1, 7, 8]]> : tensor<2x3xui16>} : () -> tensor<2x3xui16>\n // %0: [[3, 4, 2], [1, 7, 8]]\n %1 = \"ttnn.constant\"() {value = dense<[0.2, 1.3]> : tensor<2xf32>} : () -> tensor<2xf32>\n // %1: [0.2, 1.3]", "operands": [ { "name": "device", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "value", "type": "ElementsAttr" } ] }, { "name": "ttnn.conv_transpose2d", "summary": "ConvTranspose2d operation.", "description": "Applies a 2D transposed convolution operator over an input image composed of several input planes.\n\n Inputs:\n - `input` AnyRankedTensor: expected in the following format (N, H_in, W_in, C) where:\n - N is the batch size\n - H_in is the height of the input planes\n - W_in is the width of the input planes\n - C is the number of channels\n\n - `weight` AnyRankedTensor: expected in the following format (C, O/G, K_H, K_W).\n - `bias` Optional: expected in the following format (1, 1, 1, O) where:\n - C is the number of input channels\n - O is the number of output channels\n - G is the number of groups\n - K_H is the height of the kernel\n - K_W is the width of the kernel\n\n - `output` AnyRankedTensor: expected in the following format (N, H_out, W_out, O) where:\n - H_out = (H_in - 1) * stride[0] - 2 * padding[0] + dilation[0] * (K_H - 1) + output_padding[0] + 1\n - W_out = (W_in - 1) * stride[1] - 2 * padding[1] + dilation[1] * (K_W - 1) + output_padding[1] + 1\n\n Attributes:\n - `in_channels` i32: The number of input channels.\n - `out_channels` i32: The number of output channels.\n - `batch_size` i32: The batch size.\n - `input_height` i32: The input height.\n - `input_width` i32: The input width.\n - `kernel_size` array<2xi32>: The kernel size.\n - `stride` array<2xi32>: Controls the stride for the cross-correlation.\n - `padding` array<2xi32>: Controls the amount of implicit zero padding on both sides for dilation * (kernel_size - 1) - padding number of points.\n - `output_padding` array<2xi32>: Controls the additional size added to one side of the output shape.\n - `dilation` array<2xi32>: Controls the spacing between the kernel points\n - `groups` i32: Controls the connections between inputs and outputs. Must be divisible by input and output channels.\n\n Example:\n // %input: tensor<3x8x8x256xbf16>\n // %weight: tensor<256x256x3x3xbf16>\n // %bias: tensor<1x1x1x256xbf16>\n // %output: tensor<3x10x10x256xbf16>\n %0 = \"ttnn.conv_transpose2d\"(%input, %weight, %bias, %output, %device)\n <{\n batch_size = 3: i32,\n dilation = array,\n groups = 1: i32,\n in_channels = 256: i32,\n input_height = 8: i32,\n input_width = 8: i32,\n kernel_size = array,\n out_channels = 256: i32,\n output_padding = array,\n padding = array,\n stride = array\n }> : (tensor<3x8x8x256xbf16>, tensor<256x256x3x3xbf16>, tensor<1x1x1x256xbf16>, tensor<3x10x10x256xbf16>) -> tensor<3x10x10x256xbf16>", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "output_padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "conv2d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "conv2d_slice_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.conv2d", "summary": "Conv2d operation.", "description": "Applies a 2D convolution over an input image composed of several input planes.\n\n Inputs:\n - `input` (AnyRankedTensor): expected in the following flattened format (1, 1, N * H_in * W_in, C) where:\n - N is the batch size\n - H_in is the height of the input planes\n - W_in is the width of the input planes\n - C is the number of channels\n - `weight` (AnyRankedTensor): expected in the following format (O, C/G, K_H, K_W).\n - `bias` (Optional): expected in the following format (1, 1, 1, O) where:\n - C is the number of input channels\n - O is the number of output channels\n - G is the number of groups\n - K_H is the height of the kernel\n - K_W is the width of the kernel\n\n Attributes:\n - `in_channels` (i32): The number of input channels.\n - `out_channels` (i32): The number of output channels.\n - `batch_size` (i32): The batch size.\n - `input_height` (i32): The input height.\n - `input_width` (i32): The input width.\n - `kernel_size` (array<2xi32>): [K_H, K_W] where K_H is the kernel height and K_W is the kernel width.\n - `stride` (array<2xi32>): [sH, sW] where sH is stride for height and sW is stride for width.\n - `padding` (array<2xi32> | array<4xi32>):\n - array<2xi32>: [pH, pW] where pH is padding for height (top/bottom) and pW is padding for width (left/right).\n - array<4xi32>: [pT, pB, pL, pR] for top, bottom, left, and right padding respectively.\n - `dilation` (array<2xi32>): [dH, dW] where dH is dilation for height and dW is dilation for width.\n - `groups` (i32): Number of blocked connections from input channels to output channels. Input and output channels must both be divisible by groups.\n\n Outputs:\n - `result` (AnyRankedTensor): returned in the following flattened format (1, 1, N * H_out * W_out, O) where:\n - `H_out = (H_in + pT + pB - dH * (K_H - 1) - 1) / sH + 1`\n - `W_out = (W_in + pL + pR - dW * (K_W - 1) - 1) / sW + 1`\n\n Example:\n %input = ttir.empty() : () -> tensor<1x1x1024x64xbf16>\n %weight = ttir.empty() : () -> tensor<64x64x3x3xbf16>\n %bias = ttir.empty() : () -> tensor<1x1x1x64xbf16>\n %device = \"ttnn.get_device\"() <{mesh_shape = #ttnn}> : () -> !ttnn.device\n %0 = \"ttnn.conv2d\"(%input, %weight, %bias, %device)\n <{\n in_channels = 64: i32,\n out_channels = 64: i32,\n batch_size = 1: i32,\n input_height = 32: i32,\n input_width = 32: i32,\n kernel_size = array,\n stride = array,\n padding = array,\n dilation = array,\n groups = 1: i32\n }> : (tensor<1x1x1024x64xbf16>, tensor<64x64x3x3xbf16>, tensor<1x1x1x64xbf16>, !ttnn.device) -> tensor<1x1x900x64xbf16>", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "conv2d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "conv2d_slice_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.conv3d", "summary": "Conv3d operation.", "description": "Applies a 3D convolution over an input volume composed of several input planes.\n\n Inputs:\n - `input` (AnyRankedTensor): expected in the following format (N, D, H, W, C) where:\n - N is the batch size\n - D is the depth of the input volume\n - H is the height of the input planes\n - W is the width of the input planes\n - C is the number of input channels\n - `weight` (AnyRankedTensor): expected in the following format (K_D * K_H * K_W * C / G, O) where:\n - K_D is the depth of the kernel\n - K_H is the height of the kernel\n - K_W is the width of the kernel\n - C is the number of input channels\n - O is the number of output channels\n - G is the number of groups\n The spatial kernel dimensions and input channels are flattened together into a 2D tensor.\n - `bias` (Optional): expected in the following format (1, O) where:\n - O is the number of output channels\n\n Attributes:\n - `in_channels` (i32): The number of input channels.\n - `out_channels` (i32): The number of output channels.\n - `batch_size` (i32): The batch size.\n - `input_depth` (i32): The input depth.\n - `input_height` (i32): The input height.\n - `input_width` (i32): The input width.\n - `kernel_size` (array<3xi32>): [K_D, K_H, K_W] where K_D is the kernel depth, K_H is the kernel height and K_W is the kernel width.\n - `stride` (array<3xi32>): [sD, sH, sW] where sD is stride for depth, sH for height and sW is stride for width.\n - `padding` (array<3xi32>): [pD, pH, pW] where pD is padding for depth, pH is padding for height and pW is padding for width.\n Padding is symmetric (same on both sides of each dimension).\n - `padding_mode` (StrAttr): \"zeros\" or \"replicate\" - padding fill strategy.\n - `groups` (i32): Number of blocked connections from input channels to output channels. Input and output channels must both be divisible by groups.\n\n Outputs:\n - `result` (AnyRankedTensor): returned in the following format (N, D_out, H_out, W_out, O) where:\n - `D_out = (D_in + 2*pD - K_D) / sD + 1`\n - `H_out = (H_in + 2*pH - K_H) / sH + 1`\n - `W_out = (W_in + 2*pW - K_W) / sW + 1`\n\n Example:\n %input = ttir.empty() : () -> tensor<1x28x28x28x32xbf16>\n %weight = ttir.empty() : () -> tensor<864x64xbf16> // 864 = 3*3*3*32 (2D tensor)\n %bias = ttir.empty() : () -> tensor<1x64xbf16> // 2D tensor\n %device = \"ttnn.get_device\"() <{mesh_shape = #ttnn}> : () -> !ttnn.device\n %0 = \"ttnn.conv3d\"(%input, %weight, %bias, %device)\n <{\n in_channels = 32: i32,\n out_channels = 64: i32,\n batch_size = 1: i32,\n input_depth = 28: i32,\n input_height = 28: i32,\n input_width = 28: i32,\n kernel_size = array,\n stride = array,\n padding = array,\n padding_mode = \"zeros\",\n groups = 1: i32\n }> : (tensor<1x28x28x28x32xbf16>, tensor<864x64xbf16>, tensor<1x64xbf16>, !ttnn.device) -> tensor<1x26x26x26x64xbf16>", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_depth", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "padding_mode", "type": "DefaultValuedAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "conv3d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.cos", "summary": "Eltwise cosine.", "description": "Eltwise cosine operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.create_global_semaphore", "summary": "Create global semaphore op.", "description": "Creates a global semaphore with the specified core range and initial value.\n\n Global semaphores are similar to normal semaphores but differ in a couple of ways:\n 1) their lifetime exists beyond the scope of an op (and thus must created/deallocated separately like tensors)\n 2) they can be initialized before an op is even dispatched (whereas normal semaphores are initialized at dispatch time)\n\n This is needed for CCLs (and multichip communication in general) to synchronize devices or for normal signalling where normal semaphores\n cannot be used. This is because the different devices in a mesh are not running ops in a synchronized manner\n (devices can be running different ops in the program) so the existence/initialization of normal semaphores\n cannot be guaranteed on a different device that we need to communicate with.\n\n For example, if we have to run a matmul then an all gather,\n device x could be doing the matmul whereas device y has completed the matmul and begun an all gather.\n Now, if device y has to do a remote semaphore increment on device x as part of the all gather,\n this would lead to undefined behaviour\n since device x is still executing the matmul and it's semaphore for the all gather op does not even exist yet.\n\n Example:\n ```mlir\n %semaphore = \"ttnn.create_global_semaphore\"(%device) <{core_range_set = #ttnn.core_range_set<[#ttnn.core_range<(0,0), (7,7)>]>, initial_value = 0 : ui32}> : (!ttnn.device) -> !ttnn.global_semaphore\n ```", "operands": [ { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "TTNN_GlobalSemaphore" } ], "attributes": [ { "name": "initial_value", "type": "OptionalAttr" }, { "name": "core_range_set", "type": "TTNN_CoreRangeSetAttr" } ] }, { "name": "ttnn.cumprod", "summary": "Cumulative product op.", "description": "Computes the cumulative product of elements of a tensor along specified dimension.\n\n Example:\n input: [[2, 3, 4],\n [5, 6, 7]]\n\n // Cumulative product along dim=0:\n output: [[2, 3, 4],\n [10, 18, 28]]\n\n // Cumulative product along dim=1:\n output: [[2, 6, 24],\n [5, 30, 210]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttnn.cumsum", "summary": "Cumulative sum op.", "description": "Computes the cumulative sum of elements of a tensor along specified dimension.\n\n Example:\n input: [[1, 2, 3],\n [4, 5, 6]]\n\n // Cumulative sum along dim=0:\n output: [[1, 2, 3],\n [5, 7, 9]]\n\n // Cumulative sum along dim=1:\n output: [[1, 3, 6],\n [4, 9, 15]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttnn.d2m_subgraph", "summary": "Dispatch D2M compiled subgraph.", "description": "References a D2M-compiled subgraph function containing ttnn.generic ops.\n The function is a private function in the same module.\n\n Before TTNNMaterializeD2M runs, the referenced function contains a TTNN subgraph\n to be compiled via D2M.\n\n After TTNNMaterializeD2M runs, the referenced function contains:\n - ttnn.generic ops (the compiled subgraph)\n - Kernel functions are generated at module scope\n\n TTNNCollaspeD2M will inline the D2M function body at the call site.\n\n Example:\n ```mlir\n // Before D2M compilation\n %result = ttnn.d2m_subgraph @d2m_subgraph\n ins(%a : tensor<...>)\n outs(%out : tensor<...>) : tensor<...>\n\n func.func private @d2m_subgraph(...) -> tensor<...> {\n // ttnn subgraph\n }\n\n // After D2M compilation\n %result = ttnn.d2m_subgraph @d2m_subgraph\n ins(%a : tensor<...>)\n outs(%out : tensor<...>) : tensor<...>\n\n func.func private @d2m_subgraph(...) -> tensor<...> {\n ttnn.generic ...\n // more generic ops if subgraph didn't fully fuse\n }\n func.func private @kernel0() { ... }\n ... other kernel functions at module scope\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "outputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "d2m_func", "type": "SymbolRefAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$d2m_func attr-dict `\\n`\n `ins` `(` $inputs `:` type($inputs) `)` `\\n`\n `outs` `(` $outputs `:` type($outputs) `)` (`:` type($results)^)?" }, { "name": "ttnn.deallocate", "summary": "Deallocate op.", "description": "Tensor Deallocate operation", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "force", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.dequantize", "summary": "Dequantize operation.", "description": "Applies dequantization to the input tensor.\n\n Inputs:\n - `input` AnyRankedTensor: The input tensor to be dequantized. Must have quantized element type.\n - `scale` AnyRankedTensor: The scale factor (or factors for per-axis quantization).\n - `zero_point` AnyRankedTensor: The zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `axis` Optional: The axis along which quantization is applied. Must be in range [0, rank) where rank is the rank of the input tensor.\n - `output_dtype` Optional: The data type of the output tensor.\n ```\n // For per-tensor dequantization:\n output[i] = (input[i] - zero_point) * scale\n // For per-axis dequantization:\n output[i0, i1, ..., ia, ..., in] = (input[i0, i1, ..., ia, ..., in] - zero_point[ia]) * scale[ia]\n ```\n Example:\n ```mlir\n %input = ttir.empty() : () -> tensor<64x128x!quant.uniform>\n %output = ttir.empty() : () -> tensor<64x128xf32>\n %dequantized = \"ttnn.dequantize\"(%input, %output) : (tensor<64x128x!quant.uniform, tensor<64x128xf32>) -> tensor<64x128xf32>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "zero_point", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" }, { "name": "output_dtype", "type": "OptionalAttr" } ] }, { "name": "ttnn.distribute_tensor", "summary": "Distribute tensor across mesh devices", "description": "Distributes a host-side tensor across multiple devices in a mesh\n according to the specified mapping configuration.\n\n This operation takes a single-device tensor and creates a multi-device\n tensor distributed according to the MeshMapperConfig configuration.\n\n // Note: In the ttnn API, the distribute_tensor op takes an input tensor and a TensorToMesh object as its arguments.\n // To create a TensorToMesh object, the API create_mesh_mapper is used, which requires both MeshMapperConfig and MeshDevice.\n // Instead of modeling create_mesh_mapper as a separate op in the IR, these two strongly coupled APIs are combined into one distribute_tensor op\n // to keep the IR simple and less cluttered. If a clear need arises in the future, splitting them into separate ops can be considered.\n\n Example:\n ```mlir\n %result = \"ttnn.distribute_tensor\"(%input, %device) <{\n mapper_config = #ttnn.mesh_mapper_config<\n placements = [#ttnn.placement, #ttnn.placement],\n mesh_shape_override = #ttnn.mesh_shape<2x2>\n >,\n cq_id = 0 : ui32\n }> : (tensor<32x64xbf16>, !ttnn.device) -> tensor<32x64xbf16>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "mesh_device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "mapper_config", "type": "TTNN_MeshMapperConfigAttr" }, { "name": "cq_id", "type": "OptionalAttr" } ] }, { "name": "ttnn.distributed_layer_norm", "summary": "Distributed layer normalization with all-gather op.", "description": "Intermediate TTNN op for distributed layer normalization across mesh devices.\n\n Always decomposes into:\n layer_norm_pre_all_gather + all_gather + layer_norm_post_all_gather.\n\n Does not reach serialization — no flatbuffer/runtime/EmitC needed.\n\n Inputs:\n - input: Input tensor, width-sharded across mesh devices along the\n normalized (last) dimension.\n - weight: Optional gamma (scale) tensor applied after normalization.\n - bias: Optional beta (shift) tensor applied after normalization.\n - residual: Optional residual tensor to add to input before\n normalization. norm_input = input + residual.\n\n Attributes:\n - cluster_axis: Mesh dimension (0 or 1) along which to all-gather\n the partial statistics across devices.\n - epsilon: Small constant added to the denominator for numerical\n stability. Defaults to 1e-05.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" }, { "name": "residual", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.distributed_rms_norm", "summary": "Distributed RMS normalization with all-gather op.", "description": "Fused distributed RMS normalization operation across mesh devices.\n Computes local RMS statistics (the mean of squared values, E(x²)),\n all-gathers the statistics along the specified cluster_axis to obtain\n globally-correct values, then normalizes each element by\n x / sqrt(E(x²) + epsilon) and applies optional weight scaling locally\n on each device.\n\n Only statistics are communicated across devices — the input data itself\n is not all-gathered. Each device's output shape equals its input shape.\n\n Maps to ttnn::fused_rms_minimal at runtime.\n\n This operation requires the input tensor to be width-sharded across devices.\n\n Inputs:\n - input: Input tensor. Must be width-sharded in L1 with shape\n (1,1,32,M) where M is a multiple of 32. Tiled layout required.\n - weight: Optional gamma (scale) tensor applied after normalization.\n Must be in ROW_MAJOR layout with width equal to tile_width (32),\n i.e. reshaped from 1D (N,) to 2D (N/32, 32).\n - residual: Optional residual tensor to add to input before\n normalization (x + residual). Must have the same shard spec as\n input.\n - stats: Scratch tensor for intermediate RMS statistics exchanged\n across devices via all-gather. Shape (1,1,32,32), width-sharded\n on core (0,0) in L1. Dtype is Float32 when fp32_dest_acc_en is\n set, otherwise BFloat16.\n\n Attributes:\n - cluster_axis: Mesh dimension (0 or 1) along which to all-gather\n the RMS statistics across devices.\n - epsilon: Small constant added to the denominator for numerical\n stability. Defaults to 1e-12.\n - sub_device_id: Optional sub-device targeting for kernel placement.\n - num_links: Optional number of links for the all-gather\n communication.\n - topology: CCL topology for all-gather (Linear or Ring).\n - compute_config: Device compute kernel configuration. Controls math\n fidelity, fp32_dest_acc_en, and packer L1 accumulation.\n - program_config: LayerNormShardedMultiCoreProgramConfig derived from\n the input's shard spec (core grid, block_h, block_w).", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "residual", "type": "Optional" }, { "name": "stats", "type": "Optional" }, { "name": "semaphore", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "sub_device_id", "type": "OptionalAttr" }, { "name": "num_links", "type": "OptionalAttr" }, { "name": "topology", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.divide", "summary": "Eltwise divide.", "description": "Eltwise divide operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.dropout", "summary": "Dropout operation.", "description": "Applies dropout to the input tensor element-wise.\n\n Example:\n %result = \"ttnn.dropout\"(%input) <{prob = 0.2 : f32, scale = 1.25 : f32, seed = 42 : ui32}> : (tensor<64x128xbf16>) -> tensor<64x128xbf16>\n\n Attributes:\n - `prob` (Float): Dropout probability. Elements are zeroed with this probability [Default: 0.0].\n - `scale` (Float): Scale factor applied to non-zeroed elements. Typically 1/(1-prob) [Default: 1.0].\n - `seed` (Integer): Seed for the random number generator [Default: 0].\n - `use_per_device_seed` (Bool): Whether to use a different seed per device [Default: true].\n\n Inputs:\n - `input` (Tensor): The input tensor.\n\n Output:\n - `result` (Tensor): The output tensor with dropout applied.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "prob", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "DefaultValuedAttr" }, { "name": "use_per_device_seed", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.dump_tensor", "summary": "Saves a tensor to disk in the TTNN binary format", "description": "Saves a tensor to disk in the TTNN binary format. Files must use the `.tensorbin` extension.\n\n Inputs:\n - `file_path` StrAttr: Path of the file where tensor should be dumped. Must end with `.tensorbin` extension.\n - `input` AnyRankedTensor: Tensor to serialize.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "file_path", "type": "StrAttr" } ] }, { "name": "ttnn.embedding", "summary": "Embedding op.", "description": "Embedding operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.embedding_bw", "summary": "Embedding backward op.", "description": "Embedding backward operation. Generates the gradient of the embedding operation with respect to the input.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "in_gradient", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.empty", "summary": "Empty op.", "description": "Tensor empty operation", "operands": [ { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TTNN_ShapeAttr" } ] }, { "name": "ttnn.end_trace_capture", "summary": "End trace capture.", "description": "Ends trace capture for the given trace id. Consumes a scalar tensor containing the trace id.\n Has no output, but will have memory effects on the trace region of the device, modelled by\n trace resource in the compiler.\n Inputs:\n - `device` TTNN_Device: The device to end the trace capture on.\n - `trace_id` AnyRankedTensor: The trace id tensor to end the capture for. Must be a scalar.\n - `cq_id` ui32: The command queue to end the capture with. Must be 0 or 1.", "operands": [ { "name": "device", "type": "TTNN_Device" }, { "name": "trace_id", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cq_id", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.eq", "summary": "Eltwise equal to.", "description": "Eltwise equal to operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.erf", "summary": "Eltwise erf op.", "description": "Eltwise erf operation. Calculates erf(x) for each element of the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.erfc", "summary": "Eltwise erfc op.", "description": "Eltwise erfc operation. Calculates erfc(x) for each element of the input tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.execute_trace", "summary": "Execute trace.", "description": "Executes the captured trace. Consumes a scalar tensor containing the trace id.\n Has no output, but will have read/write memory effects on the cached trace input/output tensors\n created when capturing the trace.\n Inputs:\n - `device` TTNN_Device: The device where the trace was captured.\n - `trace_id` AnyRankedTensor: The trace id tensor to execute. Must be a scalar.\n - `cq_id` ui32: The command queue to execute the trace with. Must be 0 or 1.\n - `blocking` bool: Whether the trace should be executed synchronously.", "operands": [ { "name": "device", "type": "TTNN_Device" }, { "name": "trace_id", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "cq_id", "type": "DefaultValuedAttr" }, { "name": "blocking", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.exp", "summary": "Eltwise exponential.", "description": "Eltwise exponential operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.expm1", "summary": "Eltwise unary op.", "description": "Performs element-wise exponential minus one operation on `operand` tensor\n and stores the result in the output tensor.\n\n Example:\n %a: [[0, 1], [0, 0]]\n \"ttnn.exmp1\"(%a, %out) -> %out: [[0, 1.71828], [0, 0]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.fill_cache", "summary": "Fill static cache tensor.", "description": "Fills the `cache` tensor in-place with values from `input` at `batch_offset`.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_offset", "type": "I32Attr" } ] }, { "name": "ttnn.flash_mla_prefill", "summary": "Flash Multi-head Latent Attention prefill operation.", "description": "Multi-head Latent Attention (MLA) prefill. Mirrors\n `ttnn::transformer::flash_mla_prefill`.\n\n Shapes use `B` (batch), `Hq`/`Hkv` (query/kv heads), `Sq` (sequence\n length; must equal `Sk` for prefill), `dh_qk` (Q/K head size), and\n `head_dim_v` (V/output head size).\n\n Args:\n query (AnyRankedTensor): `[B x Hq x Sq x dh_qk]`.\n key (AnyRankedTensor): `[B x Hkv x Sq x dh_qk]`.\n value (AnyRankedTensor, optional): `[B x Hkv x Sq x head_dim_v]`.\n When absent (MLA-from-latent), V is taken from the first\n `head_dim_v` features of K.\n attention_mask (AnyRankedTensor, optional): `[1|B x 1 x Sq x Sq]`.\n Only valid when `is_causal` is `false`.\n head_dim_v (uint): Head dimension of V/output.\n is_causal (bool): Defaults to `true`. Cannot be `true` when\n `attention_mask` is provided.\n scale (float, optional): Softmax scale. Defaults to `1 / sqrt(dh_qk)`.\n\n Returns:\n AnyRankedTensor: `[B x Hq x Sq x head_dim_v]` (same dtype as `query`).", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "Optional" }, { "name": "attention_mask", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "head_dim_v", "type": "UI32Attr" }, { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.floor", "summary": "Eltwise floor op.", "description": "Eltwise floor operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.from_device", "summary": "FromDevice op.", "description": "This op retrieves the input tensor from the given device.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.full", "summary": "Creates a tensor filled with the specified value", "description": "Tensor operation to create a tensor filled with a specified value.\n\n Given a `shape` and a `fill_value`, produces a tensor with the shape, filled\n with the specified value.\n\n Example:\n %0 = \"ttnn.full\"() <{\n fill_value = 7 : i32,\n shape = #ttnn.shape<64x128>\n }> : () -> tensor<64x128xui32, #ttnn_layout>\n // %0: [[[7, 7, 7, ..., 7], [7, 7, 7, ..., 7], ..., [7, 7, 7, ..., 7]]]", "operands": [ { "name": "device", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TTNN_ShapeAttr" }, { "name": "fill_value", "type": "AnyAttrOf<[F32Attr, I32Attr]>" } ] }, { "name": "ttnn.gather", "summary": "Gather op.", "description": "Gathers values from the input tensor along the given dimension using an\n index tensor. This corresponds to torch.gather semantics and maps\n directly to the tt-metal `ttnn::gather` device op.\n\n Parameters:\n - `input` (ttnn.Tensor): The source tensor to gather from.\n - `index` (ttnn.Tensor): Indices specifying which values to gather.\n - `dim` (int32_t): The dimension along which to gather.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "index", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttnn.ge", "summary": "Eltwise greater than or equal to.", "description": "Eltwise greater than or equal to operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.gelu", "summary": "Eltwise GELU.", "description": "Eltwise GELU operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.gelu_bw", "summary": "Backward pass operation for the GELU activation function.", "description": "Computes the gradient of the GELU (Gaussian Error Linear Unit) activation\n function with respect to its input during backpropagation.\n\n This operation corresponds to ttnn.experimental.gelu_bw.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "approximate", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.generic", "summary": "Generic operation.", "description": "Generic operation capable of running a program with custom kernels. Each kernel is described with a\n symbol reference to its function in EmitC dialect plus compile and runtime arguments. Generic operation\n is supplied with concatenated input and output `ios` tensors.\n\n Inputs:\n - `inputs_and_outputs` Variadic: The input and output tensors.\n - `program` ProgramAttr: Program descriptor that includes a description of each kernels, array of CBs and array of semaphores.", "operands": [ { "name": "inputs_and_outputs", "type": "Variadic" }, { "name": "additional_args", "type": "Variadic" } ], "attributes": [ { "name": "program", "type": "TTNN_GenericProgramAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.get_device", "summary": "Get Device op.", "description": "This op returns a submesh carved out from the parent runtime device.\n Mesh shape and mesh offset define the size and offset of the submesh.", "results": [ { "name": "device", "type": "TTNN_Device" } ], "attributes": [ { "name": "mesh_shape", "type": "OptionalAttr" }, { "name": "mesh_offset", "type": "OptionalAttr" } ] }, { "name": "ttnn.global_avg_pool2d", "summary": "A global average pooling 2d operation", "description": "The `global_avg_pool2d` operation applies global average pooling over the spatial dimensions\n (height and width) of a 4D input tensor. In essence, it should be realised as the sum-reduce style operation\n under the hood, for performance reasons (since we include all elements, there is no need for kernel allocation).\n It reduces spatial dimensions to 1.\n\n Example:\n ```mlir\n %device = \"ttnn.get_device\"() <{mesh_shape = #ttnn}> : () -> !ttnn.device\n\n %result = \"ttnn.global_avg_pool2d\"(%input)\n : (tensor<1x128x128x32xbf16>) -> tensor<1x1x1x32xbf16>\n ```\n\n Inputs:\n - `input`: 4D tensor with shape [N, H, W, C] where N is batch size, H is height, W is width, and C is channels\n\n Outputs:\n - `result`: 4D tensor with shape [N, 1, 1, C] containing the global average pooled values\n\n Note: The operation reduces spatial dimensions (H, W) to (1, 1) by computing the average across\n all spatial locations for each channel independently.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.group_norm", "summary": "Group normalization op.", "description": "Computes group normalization over the input tensor. The input tensor's channels\n are split into groups, and mean and variance are computed per group. The result\n is normalized by subtracting the mean and dividing by the standard deviation,\n then optionally scaled and shifted by weight (gamma) and bias (beta).", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "input_mask", "type": "Optional" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_groups", "type": "I64Attr" }, { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.gt", "summary": "Eltwise greater than.", "description": "Eltwise greater than operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.hardsigmoid", "summary": "Eltwise hardsigmoid.", "description": "Eltwise hardsigmoid operation. Computes hardsigmoid(x) = max(0, min(1, (x + 3) / 6)).", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.isfinite", "summary": "Eltwise isfinite op.", "description": "Eltwise isfinite operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.layer_norm", "summary": "Layer normalization op.", "description": "Performs layer normalization on the input tensor. This operation normalizes\n the input tensor by computing the mean and variance of elements across\n the specified dimensions, then normalizes by subtracting the mean and\n dividing by the standard deviation, optionally scaling and shifting the result.\n\n This operation performs normalization over the last dimension of the input tensor,\n matching the TTNN runtime implementation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.layer_norm_post_all_gather", "summary": "Layer normalization post-all-gather op.", "description": "Applies normalization using gathered statistics from a distributed\n layer normalization pipeline. Takes the original input tensor and\n the all-gathered partial statistics, computes the final normalized\n output, and optionally scales by weight and shifts by bias.\n\n Inputs:\n - input: Original input tensor.\n - stats: All-gathered statistics tensor from pre-all-gather phase.\n - weight: Optional scale (gamma) tensor.\n - bias: Optional shift (beta) tensor.\n\n Attributes:\n - epsilon: Small constant for numerical stability (default 1e-12).\n - compute_config: Optional device compute kernel configuration.\n - program_config: Optional LayerNormShardedMultiCoreProgramConfig.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "stats", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.layer_norm_pre_all_gather", "summary": "Layer normalization pre-all-gather op.", "description": "Computes local partial statistics (Welford) for distributed layer\n normalization on a width-sharded input tensor. Produces partial\n statistics that should be all-gathered across devices before being\n consumed by a post-all-gather normalization op.\n\n Inputs:\n - input: Input tensor (width-sharded in L1).\n - residual_input: Optional residual tensor to add before computing\n statistics. Must have the same shape as input.\n - recip: Optional precomputed reciprocal tensor.\n\n Attributes:\n - compute_config: Optional device compute kernel configuration.\n - program_config: Optional LayerNormShardedMultiCoreProgramConfig.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "residual_input", "type": "Optional" }, { "name": "recip", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "compute_config", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.le", "summary": "Eltwise less than or equal to.", "description": "Eltwise less than or equal to operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.leaky_relu", "summary": "Eltwise leaky relu operation.", "description": "The Leaky ReLU (Rectified Linear Unit) operation computes an element-wise\n activation function over its input tensor. It is defined as:\n\n y = x if x > 0\n y = parameter * x if x <= 0\n\n where `parameter` is a small, user-defined constant that determines the slope for\n negative inputs.\n\n Attributes:\n - `parameter` (float): The slope for negative values.\n\n Inputs:\n - `input` (Tensor): The input tensor to be activated.\n\n Outputs:\n - `output` (Tensor): The tensor after applying the Leaky ReLU activation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "parameter", "type": "F32Attr" } ] }, { "name": "ttnn.linear", "summary": "Linear transformation of inputs.", "description": "Produces the matmul of tensors `a` and `b` with optional addition with `bias`.\n\n Example:\n // %a = [[1., 2.], [2., 1.]]\n // %b = [[0., 1.], [1., 0.]]\n // %bias = [[1.]]\n \"ttnn.linear\"(%a, %b, %bias, %result) : (tensor<2x2xf16>, tensor<2x2xf16>, tensor<1xf16>, tensor<2x2xf16>) -> tensor<2x2xf16>\n // %result = [[3., 2.], [2., 3.]]", "operands": [ { "name": "a", "type": "AnyRankedTensor" }, { "name": "b", "type": "AnyRankedTensor" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedAttr" }, { "name": "transpose_b", "type": "DefaultValuedAttr" }, { "name": "matmul_program_config", "type": "OptionalAttr>" }, { "name": "activation", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.load_tensor", "summary": "Loads a tensor from disk", "description": "Loads a tensor from disk, optionally placing it directly on a device.\n\n Inputs:\n - `file_path` StrAttr: Path of the file of the serialized tensor. Must end with `.tensorbin` extension.\n - `device` Optional: Device where tensor should be deserialized. It has to be provided iff the serialized tensor is a device tensor.\n Outputs:\n - `result` AnyRankedTensor: Deserialized tensor from the `file_path`.", "operands": [ { "name": "device", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "file_path", "type": "StrAttr" } ] }, { "name": "ttnn.log", "summary": "Eltwise logarithm.", "description": "Eltwise logarithm operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.log1p", "summary": "Eltwise log1p operation.", "description": "Performs element-wise logarithm plus one operation on `operand` tensor and\n puts the result in the output tensor.\n\n Example:\n %a: [0.0, -0.999, 7.0, 6.38905621, 15.0]\n \"ttnn.logp1\"(%a, %out) -> %out: [0.0, -6.90776825, 2.07944155, 2.0, 2.77258873]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.logical_and", "summary": "Eltwise logical and.", "description": "Eltwise logical and operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.logical_left_shift", "summary": "Eltwise Logical Left Shift operation", "description": "The `logical_left_shift` operation performs an elementwise logical left shift\n on the elements of the first tensor by the corresponding shift amounts in the\n second tensor.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.logical_not", "summary": "Eltwise logical not op.", "description": "Eltwise logical not operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.logical_or", "summary": "Eltwise logical or.", "description": "Eltwise logical or operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.logical_right_shift", "summary": "Eltwise Logical Right Shift operation", "description": "The `logical_right_shift` operation performs an elementwise logical right shift\n on the elements of the first tensor by the corresponding shift amounts in the\n second tensor.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.logical_xor", "summary": "Eltwise logical xor.", "description": "Eltwise logical xor operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.lt", "summary": "Eltwise less than.", "description": "Eltwise less than operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.matmul", "operands": [ { "name": "a", "type": "AnyRankedTensor" }, { "name": "b", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "transpose_a", "type": "DefaultValuedAttr" }, { "name": "transpose_b", "type": "DefaultValuedAttr" }, { "name": "matmul_program_config", "type": "OptionalAttr>" }, { "name": "activation", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.max", "summary": "Max reduction op.", "description": "Max reduction op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.max_pool2d", "summary": "Applies a 2D max pooling over an input signal composed of several input planes.", "description": "Applies a 2D max pooling over an input signal composed of several input planes.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_size", "type": "SI32Attr" }, { "name": "input_height", "type": "SI32Attr" }, { "name": "input_width", "type": "SI32Attr" }, { "name": "channels", "type": "SI32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "applied_shard_scheme", "type": "OptionalAttr" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "reallocate_halo_output", "type": "DefaultValuedAttr" }, { "name": "config_tensors_in_dram", "type": "OptionalAttr" } ] }, { "name": "ttnn.max_pool2d_with_indices", "summary": "Applies a 2D max pooling over an input signal composed of several input planes, returning both values and indices.", "description": "Applies a 2D max pooling over an input signal composed of several input planes.\n Returns both the maximum values and the indices of where those values were found in the input tensor.\n The indices can be used for unpooling operations or gradient computation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" }, { "name": "result_indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_size", "type": "SI32Attr" }, { "name": "input_height", "type": "SI32Attr" }, { "name": "input_width", "type": "SI32Attr" }, { "name": "channels", "type": "SI32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "applied_shard_scheme", "type": "OptionalAttr" }, { "name": "ceil_mode", "type": "BoolAttr" }, { "name": "reallocate_halo_output", "type": "DefaultValuedAttr" }, { "name": "config_tensors_in_dram", "type": "OptionalAttr" } ] }, { "name": "ttnn.maximum", "summary": "Eltwise maximum OP.", "description": "Calculates maximum of input tensors' values element-wise and stores result in output tensor.\n\n Example:\n %lhs: [[3, 2, 7], [1, 4, 4]]\n %rhs: [[1, 4, 2], [1, 2, 3]]\n \"ttnn.maximum\"(%lhs, %rhs, %out) -> %out: [[3, 4, 7], [1, 4, 4]]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.mean", "summary": "Mean reduction op.", "description": "Mean reduction op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.mesh_partition", "summary": "Mesh partition operation.", "description": "Mesh partition op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" }, { "name": "cluster_axis", "type": "OptionalAttr" } ] }, { "name": "ttnn.mesh_shard", "summary": "Mesh shard op.", "description": "Tensor Mesh Shard operation", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shard_direction", "type": "TTCore_MeshShardDirectionAttr{full_to_shard|shard_to_full}" }, { "name": "shard_type", "type": "TTCore_MeshShardTypeAttr{identity|replicate|maximal|devices}" }, { "name": "shard_shape", "type": "DenseI64ArrayAttr" }, { "name": "shard_dims", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttnn.min", "summary": "Min reduction op.", "description": "This op computes the minimum of all elements of the tensor or along\n specified dimension.\n\n Example:\n input: [[1, 5, 3],\n [4, 2, 6]]\n\n // Computing along dim 0\n output: [1, 2, 3]\n\n // Computing along dim 1\n output: [1, 2]\n\n // Computing for entire tensor\n output: 1", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.minimum", "summary": "Eltwise minimum OP.", "description": "Calculates minimum of input tensors' values element-wise and stores result\n in output tensor.\n\n Example:\n %lhs: [[3, 2, 7], [1, 4, 4]]\n %rhs: [[1, 4, 2], [1, 2, 3]]\n \"ttnn.minimum\"(%lhs, %rhs, %out) -> %out: [[1, 2, 2], [1, 2, 3]]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.mish", "summary": "Eltwise Mish.", "description": "Eltwise Mish operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.moe_compute", "summary": "Fused MoE expert compute (selective tilize + experts + combine).", "description": "Composite operation that performs the MoE expert FFN in a single fused\n kernel: selective tilize of dispatched tokens, the gate/up matmul (W0/W1)\n followed by SILU or SwiGLU activation, the down matmul (W2), and an\n A2A selective-reduce-combine. Maps to\n `ttnn::experimental::moe_compute` at runtime.\n\n `optional_output_tensor` is the caller-allocated combine-output buffer;\n `cross_device_semaphore` synchronizes the A2A combine across devices.\n Both are optional in source MLIR but must be bound before the runtime\n can lower the op. They are populated by the\n `TTNNAllocateDistributedOpBuffers` / `TTNNAllocateDistributedOpSemaphores`\n passes via the `DistributedOpInterface`.\n\n When `compute_only` is set, the A2A combine is skipped (single-device /\n no-CCL bring-up): tt-metal returns only the first five tensors and\n `matmul_output` is the final user-visible output. In that mode\n `cluster_axis`, `topology`, `num_links`, `mux_core_range_set`,\n `optional_output_tensor`, and `cross_device_semaphore` are unused, and\n `combine_output` aliases `matmul_output`.\n\n See `TTIR_MoeComputeOp` for input/output shapes and dtypes.", "operands": [ { "name": "tilize_input_tensor", "type": "AnyRankedTensor" }, { "name": "tilize_expert_indices_tensor", "type": "AnyRankedTensor" }, { "name": "tilize_expert_scores_tensor", "type": "AnyRankedTensor" }, { "name": "tilize_expert_mapping_tensor", "type": "AnyRankedTensor" }, { "name": "matmul_w0_w1_tensor", "type": "AnyRankedTensor" }, { "name": "matmul_w2_tensor", "type": "AnyRankedTensor" }, { "name": "optional_output_tensor", "type": "Optional" }, { "name": "cross_device_semaphore", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "per_expert_total_tokens", "type": "AnyRankedTensor" }, { "name": "expert_activation", "type": "AnyRankedTensor" }, { "name": "expert_to_token", "type": "AnyRankedTensor" }, { "name": "tilize_output", "type": "AnyRankedTensor" }, { "name": "matmul_output", "type": "AnyRankedTensor" }, { "name": "combine_output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "layer_id", "type": "UI32Attr" }, { "name": "output_height_shard_dim", "type": "UI32Attr" }, { "name": "intermediate_size", "type": "UI32Attr" }, { "name": "has_bias", "type": "BoolAttr" }, { "name": "activation_function", "type": "DefaultValuedAttr" }, { "name": "compute_only", "type": "DefaultValuedAttr" }, { "name": "cluster_axis", "type": "OptionalAttr" }, { "name": "num_links", "type": "OptionalAttr" }, { "name": "topology", "type": "OptionalAttr" }, { "name": "mux_core_range_set", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.moe_expert_token_remap", "summary": "Remap global expert routing to local device experts with sparsity.", "description": "Converts global expert routing scores to local per-device expert mapping\n and creates a sparsity pattern for efficient sparse_matmul.", "operands": [ { "name": "topk_tensor", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" }, { "name": "expert_metadata", "type": "AnyRankedTensor" } ], "results": [ { "name": "mapping", "type": "AnyRankedTensor" }, { "name": "reduced", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduction_size", "type": "I64Attr" } ] }, { "name": "ttnn.moe_gpt", "summary": "Fused MoE compute kernel for GPT-OSS models.", "description": "Fused Mixture-of-Experts compute kernel for GPT-OSS-style models. Runs\n the full MoE compute pipeline in a single kernel: selective tilize,\n gate/up projection (w0_w1), SwiGLU activation, all-to-all ring exchange\n along cluster_axis, down projection (w2), and combine. Typically follows\n ttnn.all_to_all_dispatch_metadata in the MoE dispatch/compute/combine flow.\n\n Dimensions:\n T = total_tokens across the dispatch ring\n K = hidden_size\n N = intermediate_size\n K_sel = selected experts per token (top-k)\n E = experts per device\n D = total devices\n C_dram = DRAM-bank-aligned compute cores used for weight sharding\n C_worker = worker cores in the compute grid\n L = layers per weight tensor (typically 1)\n G = weight groups per core (gate/up interleaved pairs)\n TILE_SIZE = compute tile size\n L1_ALIGN = L1 alignment\n\n Input shapes and layouts (per device, after mesh sharding; enforced by\n TTNNWorkaroundsPass to match kernel expectations):\n - input_tensor: [T, K] bf16, ROW_MAJOR\n (kernel tilizes internally)\n - expert_indices: [T, K_sel] uint16, ROW_MAJOR, L1 HEIGHT_SHARDED\n - expert_scores: [T, K_sel] bf16, ROW_MAJOR, L1 HEIGHT_SHARDED\n - expert_mapping: [1, E*D] uint16, ROW_MAJOR\n (flattened mapping, entry [0, i] = device ID owning expert i;\n the tilize_reader kernel casts the buffer to uint16_t*)\n - w0_w1_tensor: [C_dram, L, E, G, K, 4*TILE_SIZE] (interleaved gate+up)\n - w2_tensor: [C_dram, L, E, 2, N, 4*TILE_SIZE] (down projection)\n\n Output shapes:\n - token_counts: [1, align(E*sizeof(u32), L1_ALIGN) / sizeof(u32)] uint32\n - activation_records: [1, (T+1) * align((2*E+1)*sizeof(u32), L1_ALIGN) / sizeof(u32)] uint32\n - token_indices: [E, (T+1) * align(sizeof(u32), L1_ALIGN) / sizeof(u32)] uint32\n - tilize_out: [C_worker, 2, TILE_SIZE, K] bf16, TILE\n - tilize_out_rm: [C_worker, 2, TILE_SIZE, K] bf16, ROW_MAJOR\n where align(n, a) = ceil(n/a) * a.", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_scores", "type": "AnyRankedTensor" }, { "name": "expert_mapping", "type": "AnyRankedTensor" }, { "name": "w0_w1_tensor", "type": "AnyRankedTensor" }, { "name": "w2_tensor", "type": "AnyRankedTensor" } ], "results": [ { "name": "token_counts", "type": "AnyRankedTensor" }, { "name": "activation_records", "type": "AnyRankedTensor" }, { "name": "token_indices", "type": "AnyRankedTensor" }, { "name": "tilize_out", "type": "AnyRankedTensor" }, { "name": "tilize_out_rm", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "output_height_shard_dim", "type": "DefaultValuedAttr" }, { "name": "output_width_shard_dim", "type": "DefaultValuedAttr" }, { "name": "hidden_size", "type": "DefaultValuedAttr" }, { "name": "cluster_axis", "type": "OptionalAttr" } ] }, { "name": "ttnn.moreh_cumsum", "summary": "Moreh cumulative sum op.", "description": "Computes the cumulative sum of elements of a tensor along specified dimension.\n\n Example:\n input: [[1, 2, 3],\n [4, 5, 6]]\n\n // Cumulative sum along dim=0:\n output: [[1, 2, 3],\n [5, 7, 9]]\n\n // Cumulative sum along dim=1:\n output: [[1, 3, 6],\n [4, 9, 15]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "I64Attr" }, { "name": "memory_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.multiply", "summary": "Eltwise multiply.", "description": "Eltwise multiply operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.ne", "summary": "Eltwise not equal to.", "description": "Eltwise not equal to operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.neg", "summary": "Eltwise negate.", "description": "Eltwise negate operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.nlp_concat_heads", "summary": "nlp_concat_heads op in TTNN dialect.", "description": "\"This op targets specific case of concatenate heads operation where input tensor\n [B, num_heads, S, head_dim] is permuted and reshaped into [B, 1, S, num_heads * head_dim].\"", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.nlp_concat_heads_decode", "summary": "Concatenate heads op used in attention layer.", "description": "Shuffles [S=1, B=32, 32(num_heads), head_dim] tensor into tensor with shape [S=1, 1, B=32, num_heads * head_dim].\n This operation assumes that input num_heads is padded to at most 32. When invoking this op,\n we specify the actual num_heads via the attribute `num_heads` and it should be less than input padded num_heads.\n Operation will unpad the input num_heads to the actual num_heads.\n The output is default width sharded by num heads.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_heads", "type": "UI32Attr" } ] }, { "name": "ttnn.nlp_create_qkv_heads_decode", "summary": "nlp_create_qkv_heads_decode op in TTNN dialect.", "description": "Shuffles [1, S=1, B, head_dim * (num_heads + 2*num_kv_heads)] fused qkv matrix into Q, K, and V heads with shape [S, B, num_heads, head_dim] for Q and [S, B, num_kv_heads, head_dim] for K and V, where num_heads and num_kv_heads will be padded to nearest 32.\n - Input must be sharded, B=32 and S=1.\n - overlap_qk_coregrid is a boolean flag that determines whether the output Q and K heads are on same core grid. If true, then Q, K, and V heads are on the same core grid. If false, the Q and K heads are on non-overlapping core-grid useful for processing Q and K in parallel.\n - Batch offset is used to fuse batch slicing. If provided slice size must also be provided in which batch dim of QKV output will be slice_size.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "batch_offset", "type": "Optional" } ], "results": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_heads", "type": "UI32Attr" }, { "name": "num_kv_heads", "type": "OptionalAttr" }, { "name": "overlap_qk_coregrid", "type": "OptionalAttr" }, { "name": "slice_size", "type": "OptionalAttr" } ] }, { "name": "ttnn.ones", "summary": "Creates a tensor filled with ones.", "description": "Tensor operation to create a tensor filled with ones.\n\n Given a ShapeAttr `shape`, produces a tensor with the same shape, filled with ones.\n\n Example:\n %0 = \"ttnn.ones\"() <{shape = array}> : () -> tensor<64x28x28xbf16>\n // %0: [[[1, 1, 1, ..., 1], [1, 1, 1, ..., 1], ..., [1, 1, 1, ..., 1]]]", "operands": [ { "name": "device", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TTNN_ShapeAttr" } ] }, { "name": "ttnn.pad", "summary": "Pad op.", "description": "Pad input tensor by padding the input_shape to output_shape using the provided value.\n\n The `padding` attribute must be a sequence of integers that is twice the size as the rank of the input.\n Each pair of integers in the padding attribute represents the amount of padding to add to the low and high of that dimension.\n I.e: an input tensor of shape <1x30x30x64xf32> with padding attribute <0, 0, 1, 1, 1, 1, 0, 0> will return a tensor of shape <1x32x32x64xf32>,\n and so will a padding attribute of <0, 0, 0, 2, 0, 2, 0, 0>.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "value", "type": "F32Attr" }, { "name": "use_multicore", "type": "BoolAttr" } ] }, { "name": "ttnn.paged_fill_cache", "summary": "Paged fill cache op.", "description": "Fills the `cache` tensor in-place with values from `input` at `batch_offset`.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "batch_idx_tensor", "type": "Optional" } ] }, { "name": "ttnn.paged_flash_multi_latent_attention_decode", "summary": "Paged flash multi-latent attention decode operation.", "description": "Paged flash Multi-Latent Attention (MLA) for the decode phase. Combines\n flash attention with multi-latent attention and paged KV cache support,\n optimized for single-token decode.\n\n Key difference from PagedScaledDotProductAttentionDecode: the value tensor\n is optional (may be null for latent-only MLA) and head_dim_v specifies the\n value head dimension separately.\n\n The key/value cache is laid out as `[max_num_blocks, nkv, block_size,\n head_dim]`. MLA keeps a single compressed latent KV cache shared across all\n query heads, so the number of KV heads `nkv` (dim 1) must be 1.", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "Optional" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "cur_pos_tensor", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "head_dim_v", "type": "UI32Attr" }, { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.paged_scaled_dot_product_attention_decode", "summary": "Paged scaled dot product attention decode operation.", "description": "Paged scaled dot product attention decode operation.", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "cur_pos_tensor", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "sliding_window_size", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.paged_update_cache", "summary": "Paged update cache op.", "description": "Inputs:\n - `cache`: The cache tensor to be updated. This tensor is modified in place [max_num_blocks, num_heads, block_size, head_dim]\n - `input`: The input tensor containing new values. [1, num_users, num_heads (padded to 32), head_dim]\n - `update_index`: Indices specifying where to update the cache. [num_users]\n - `share_cache`: Whether the cache tensors share memory regions. Defaults to False.\n - `page_table`: The page table for managing memory regions during updates. [num_users, max_num_blocks_per_seq]", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" }, { "name": "update_index", "type": "AnyRankedTensor" }, { "name": "page_table", "type": "Optional" } ], "attributes": [ { "name": "share_cache", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.permute", "summary": "Permute operation.", "description": "Permute input tensor dimensions.\n\n Attributes:\n - `permutation` array: The permutation of the input tensor dimensions.\n\n Example:\n %a = ttir.empty() : () -> tensor<2x3x4xi32>\n %0 = \"ttir.permute\"(%a) {permutation = array} : (tensor<2x3x4xi32>) -> tensor<3x4x2xi32>", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "permutation", "type": "DenseI64ArrayAttr" }, { "name": "pad_value", "type": "DefaultValuedOptionalAttr" } ] }, { "name": "ttnn.point_to_point", "summary": "Point To Point operation.", "description": "Performs point-to-point communication by copying a tensor shard from one device to another\n within a multi-device mesh. This operation is typically used for explicit data movement in\n distributed tensor computations, where a specific device (send_coord) sends its local tensor\n data to a target device (receive_coord).\n\n If `optional_output_tensor` is not provided, a new output tensor will be allocated automatically\n at the receiver. If provided, the data will be written into the specified output tensor.\n\n The operation returns a multi-device tensor whose buffer layout follows the mesh configuration.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "optional_output_tensor", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "sender_coord", "type": "DenseI64ArrayAttr" }, { "name": "receiver_coord", "type": "DenseI64ArrayAttr" } ] }, { "name": "ttnn.pow_scalar", "summary": "Eltwise power OP.", "description": "The `pow_scalar` operation performs an exponentiation of each element of an\n input tensor with a scalar exponent and returns the result.\n\n Example:\n ```mlir\n %result = ttnn.pow_scalar(%input) <{exponent = 2.0 : f32}> : tensor<4xf32>, tensor<4xf32> -> tensor<4xf32>\n // Input tensors:\n // %input: [2.0, 3.0, 4.0, 5.0] // Bases\n // %exponent: 2.0 // Power\n // Output tensor: [4.0, 9.0, 16.0, 25.0]\n ```\n\n Restriction: TTNN API supports expoenent ≥ 0 only.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "rhs", "type": "AnyAttrOf<[F32Attr, I32Attr]>" } ] }, { "name": "ttnn.pow_tensor", "summary": "Eltwise power OP.", "description": "Performs element-wise exponentiation of lhs tensor by rhs tensor and produces a\n result tensor. Tensors must be of same shape.\n\n Example:\n ```\n %result = \"ttnn.pow_tensor\"(%lhs, %rhs) : (tensor<6xf64>, tensor<6xf64>) -> tensor<6xf64>\n\n %lhs: [-2.0, -0.0, -36.0, 5.0, 3.0, 10000.0]\n %rhs: [2.0, 2.0, 1.1, 2.0, -1.0, 10.0]\n %result: [4.0, 0.0, -nan, 25.0, 0.333333343, inf]\n ```", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.prepare_conv_transpose2d_bias", "summary": "Prepares conv_transpose2d bias so that it can be consumed by the conv_transpose2d op.", "operands": [ { "name": "bias_tensor", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "input_memory_config", "type": "TTNN_MemoryConfigAttr" }, { "name": "input_tensor_layout", "type": "TTNN_LayoutAttr{row_major|tile|invalid}" }, { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "input_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "output_dtype", "type": "OptionalAttr" }, { "name": "conv2d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "conv2d_slice_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.prepare_conv_transpose2d_weights", "summary": "Prepares conv_transpose2d weights so that they can be consumed by the conv_transpose2d op.", "operands": [ { "name": "weight_tensor", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "input_memory_config", "type": "TTNN_MemoryConfigAttr" }, { "name": "input_tensor_layout", "type": "TTNN_LayoutAttr{row_major|tile|invalid}" }, { "name": "weights_format", "type": "StrAttr" }, { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "output_padding", "type": "DefaultValuedAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "has_bias", "type": "BoolAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "input_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "output_dtype", "type": "OptionalAttr" }, { "name": "conv2d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "conv2d_slice_config", "type": "OptionalAttr" }, { "name": "mirror_kernel", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.prepare_conv2d_bias", "summary": "Prepares conv2d bias so that it can be consumed by the conv2d op.", "operands": [ { "name": "bias_tensor", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "input_memory_config", "type": "TTNN_MemoryConfigAttr" }, { "name": "input_tensor_layout", "type": "TTNN_LayoutAttr{row_major|tile|invalid}" }, { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "input_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "output_dtype", "type": "OptionalAttr" }, { "name": "conv2d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "conv2d_slice_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.prepare_conv2d_weights", "summary": "Prepares conv2d weights so that they can be consumed by the conv2d op.", "operands": [ { "name": "weight_tensor", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "input_memory_config", "type": "TTNN_MemoryConfigAttr" }, { "name": "input_tensor_layout", "type": "TTNN_LayoutAttr{row_major|tile|invalid}" }, { "name": "weights_format", "type": "StrAttr" }, { "name": "in_channels", "type": "I32Attr" }, { "name": "out_channels", "type": "I32Attr" }, { "name": "batch_size", "type": "I32Attr" }, { "name": "input_height", "type": "I32Attr" }, { "name": "input_width", "type": "I32Attr" }, { "name": "kernel_size", "type": "DenseI32ArrayAttr" }, { "name": "stride", "type": "DenseI32ArrayAttr" }, { "name": "padding", "type": "DenseI32ArrayAttr" }, { "name": "dilation", "type": "DenseI32ArrayAttr" }, { "name": "has_bias", "type": "BoolAttr" }, { "name": "groups", "type": "I32Attr" }, { "name": "input_dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" }, { "name": "output_dtype", "type": "OptionalAttr" }, { "name": "conv2d_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" }, { "name": "conv2d_slice_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.prepare_conv3d_weights", "summary": "Prepares conv3d weights so that they can be consumed by the conv3d op.", "operands": [ { "name": "weight_tensor", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "groups", "type": "I32Attr" }, { "name": "c_in_block", "type": "I32Attr" }, { "name": "alignment", "type": "I32Attr" } ] }, { "name": "ttnn.prepare_moe_compute_w0_w1_weights", "summary": "Prepack gate (W0) and up (W1) expert weights for moe_compute.", "description": "Interleaves W0 / W1 and reorders the result into the bank-aware sharded\n layout `ttnn.moe_compute`'s `matmul_w0_w1_tensor` operand consumes.\n Optional `bias_0` / `bias_1` fuse per-expert biases along K (their\n presence must match `has_bias` on the downstream `moe_compute`). The\n result shape and memory layout are derived at compile time by the\n TTNNDeduceMoEComputeLayouts pass via a TTNN graph-capture query.", "operands": [ { "name": "w0", "type": "AnyRankedTensor" }, { "name": "w1", "type": "AnyRankedTensor" }, { "name": "bias_0", "type": "Optional" }, { "name": "bias_1", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "hidden_size", "type": "UI32Attr" }, { "name": "intermediate_size", "type": "UI32Attr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.prepare_moe_compute_w2_weights", "summary": "Prepack down (W2) expert weight for moe_compute.", "description": "Reorders W2 into the bank-aware sharded layout `ttnn.moe_compute`'s\n `matmul_w2_tensor` operand consumes. Optional `bias_2` fuses the\n per-expert bias along N without ring-rotation (its presence must match\n `has_bias` on the downstream `moe_compute`). Result shape comes from the\n TTNN graph capture query.", "operands": [ { "name": "w2", "type": "AnyRankedTensor" }, { "name": "bias_2", "type": "Optional" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "hidden_size", "type": "UI32Attr" }, { "name": "intermediate_size", "type": "UI32Attr" } ] }, { "name": "ttnn.prod", "summary": "Product reduction op.", "description": "This op computes the product of all elements of the tensor (full product)\n or along a specific dimension.\n\n Example:\n input: [[1, 2, 3],\n [4, 5, 6]]\n\n // Computing along dim 0\n output: [4, 10, 18]\n\n // Computing along dim 1\n output: [6, 120]\n\n // Computing full product\n output: 720", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim_arg", "type": "OptionalAttr" }, { "name": "keep_dim", "type": "BoolAttr" } ] }, { "name": "ttnn.quantize", "summary": "Quantize operation.", "description": "Applies quantization to the input tensor.\n\n Inputs:\n - `input` AnyRankedTensor: The input tensor to be quantized. Must have floating-point element type.\n - `scale` AnyRankedTensor: The scale factor (or factors for per-axis quantization). Must be either a scalar (for per-tensor quantization) or a 1D tensor with size matching the dimension of the specified axis (for per-axis quantization).\n - `zero_point` AnyRankedTensor: The zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `axis` Optional: The axis along which quantization is applied. Must be in range [0, rank) where rank is the rank of the input tensor.\n - `output_dtype` Optional: The data type of the output tensor.\n\n ```\n // For per-tensor quantization:\n output[i] = round(input[i] / scale) + zero_point\n // For per-axis quantization:\n output[i0, i1, ..., ia, ..., in] = round(input[i0, i1, ..., ia, ..., in] / scale[ia]) + zero_point[ia]\n ```\n Example:\n ```mlir\n %input = ttir.empty() : () -> tensor<64x128xf32>\n %output = ttir.empty() : () -> tensor<64x128x!quant.uniform>\n %quantized = \"ttir.quantize\"(%input, %output) : (tensor<64x128xf32>, tensor<64x128x!quant.uniform>) -> tensor<64x128x!quant.uniform>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "scale", "type": "AnyRankedTensor" }, { "name": "zero_point", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" }, { "name": "output_dtype", "type": "OptionalAttr" } ] }, { "name": "ttnn.rand", "summary": "Random number generation operation.", "description": "Returns a tensor filled with random numbers drawn from a uniform distribution over given interval [low, high) [Default: [0, 1)].\n\n Example:\n %0 = \"ttnn.get_device\"() <{mesh_offset = #ttnn, mesh_shape = #ttnn}> : () -> !ttnn.device\n %1 = \"ttnn.rand\"(%0) <{high = 1.000000e+00 : f32, layout = #ttnn.layout, low = 0.000000e+00 : f32, seed = 0 : ui32, size = [32 : i32, 32 : i32]}> : (!ttnn.device) -> tensor<32x32xbf16, #ttnn_layout1>\n\n Attributes:\n - `size` (TTNN_ShapeAttr): The shape of the tensor to create.\n - `device` (TTNN_Device): The device where the trace was captured.\n - `low` (Float): The lower bound of the range (inclusive) [Default: 0.0].\n - `high` (Float): The upper bound of the range (exclusive) [Default: 1.0].\n - `seed` (Integer): Value to initialize the random number generator for reproducible results [Default: 0].\n\n Outputs:\n - `result` (Tensor): The generated tensor containing the random values.", "operands": [ { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "size", "type": "TTNN_ShapeAttr" }, { "name": "low", "type": "DefaultValuedAttr" }, { "name": "high", "type": "DefaultValuedAttr" }, { "name": "seed", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.reciprocal", "summary": "Eltwise reciprocal.", "description": "Eltwise reciprocal operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.reduce_scatter", "summary": "Reduce scatter op.", "description": "Tensor Reduce Scatter operation", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" }, { "name": "scatter_dim", "type": "SI32Attr" }, { "name": "cluster_axis", "type": "UI32Attr" }, { "name": "sub_device_id", "type": "OptionalAttr" }, { "name": "num_links", "type": "OptionalAttr" }, { "name": "topology", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.relu", "summary": "Eltwise ReLU.", "description": "Eltwise ReLU operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.relu6", "summary": "Eltwise ReLU6.", "description": "Eltwise ReLU6 operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.remainder", "summary": "Eltwise remainder.", "description": "Performs element-wise remainder of dividend lhs and divisor rhs tensors and produces a\n result tensor.\n\n Example:\n\n // %lhs: [17, -17, 17, -17]\n // %rhs: [3, 3, -3, -3]\n %result = \"ttnn.remainder\"(%lhs, %rhs) : (tensor<4xi64>, tensor<4xi64>) -> tensor<4xi64>\n // %result: [2, -2, 2, -2]", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.repeat", "summary": "Repeat op.", "description": "Returns a new tensor filled with repetition of input tensor according to number of times specified in repeat_dims.\n\n Parameters:\n - `input_tensor` (ttnn.Tensor): the input tensor.\n - `repeat_dims` (number): The number of repetitions for each element.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "repeat_dims", "type": "TTNN_ShapeAttr" } ] }, { "name": "ttnn.repeat_interleave", "summary": "Repeat interleave op.", "description": "Repeats elements of a tensor along a specified dimension.\n It allows for flexible repetition patterns, where each element can be repeated a different number of times.\n This is particularly useful for tasks that require duplicating elements in a non-uniform manner.\n\n Parameters:\n - `input`: The input tensor.\n - `repeats`: Specifies the number of repetitions for each element, each element is repeated that number of times.\n - `dim`: The dimension along which to repeat values.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "repeats", "type": "UI32Attr" }, { "name": "dim", "type": "SI32Attr" } ] }, { "name": "ttnn.requantize", "summary": "Requantize operation.", "description": "Applies requantization to the input tensor.\n\n Inputs:\n - `input` AnyRankedTensor: The input tensor to be requantized. Must have quantized element type.\n - `in_scale` AnyRankedTensor: The input scale factor (or factors for per-axis quantization). Must be either a scalar (for per-tensor quantization) or a 1D tensor with size matching the dimension of the specified axis (for per-axis quantization).\n - `in_zero_point` AnyRankedTensor: The input zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `out_scale` AnyRankedTensor: The output scale factor (or factors for per-axis quantization). Must be either a scalar (for per-tensor quantization) or a 1D tensor with size matching the dimension of the specified axis (for per-axis quantization).\n - `out_zero_point` AnyRankedTensor: The output zero point value (or values for per-axis quantization). Must be in range of the quantized storage type.\n - `axis` Optional: The axis along which quantization is applied. Must be in range [0, rank) where rank is the rank of the input tensor.\n - `output_dtype` Optional: The data type of the output tensor.\n ```\n // For per-tensor requantization:\n output[i] = round((input[i] - input_zero_point) * (input_scale / output_scale)) + output_zero_point\n // For per-axis requantization:\n output[i0, i1, ..., ia, ..., in] = round((input[i0, i1, ..., ia, ..., in] - in_zero_point[ia]) * (in_scale[ia] / out_scale[ia])) + out_zero_point[ia]\n ```\n Example:\n ```mlir\n %input = ttir.empty() : () -> tensor<64x128x!quant.uniform>\n %output = ttir.empty() : () -> tensor<64x128x!quant.uniform>\n %requantized = \"ttnn.requantize\"(%input, %output) : (tensor<64x128x!quant.uniform, tensor<64x128x!quant.uniform>) -> tensor<64x128x!quant.uniform>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "in_scale", "type": "AnyRankedTensor" }, { "name": "in_zero_point", "type": "AnyRankedTensor" }, { "name": "out_scale", "type": "AnyRankedTensor" }, { "name": "out_zero_point", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "OptionalAttr" }, { "name": "output_dtype", "type": "OptionalAttr" } ] }, { "name": "ttnn.reset_global_semaphore", "summary": "Reset global semaphore op.", "description": "Resets a global semaphore to the specified value.\n\n Example:\n ```mlir\n \"ttnn.reset_global_semaphore\"(%semaphore) <{value = 0 : ui32}> : (!ttnn.global_semaphore) -> ()\n ```", "operands": [ { "name": "semaphore", "type": "TTNN_GlobalSemaphore" } ], "attributes": [ { "name": "value", "type": "UI32Attr" } ] }, { "name": "ttnn.reshape", "summary": "Reshape op.", "description": "Reshape tensor.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TypedArrayAttrBase" } ] }, { "name": "ttnn.rms_norm", "summary": "RMS normalization op.", "description": "RMS (Root Mean Square) normalization operation over the input tensor.\n Normalizes the input by computing the root mean square of elements and\n dividing by that value, optionally scaling and shifting the result.\n\n This operation performs normalization over the last dimension of the input tensor,\n matching the TTNN runtime implementation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "Optional" }, { "name": "bias", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "epsilon", "type": "DefaultValuedAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.rms_norm_pre_all_gather", "summary": "Pre all-gather RMS normalization op.", "description": "Computes local partial statistics for distributed RMS normalization across mesh devices.\n This op performs the local pre-processing stage of RMSNorm when the normalized dimension\n is sharded across devices. It computes the local RMS statistics (partial/local sum(x) and\n sum(x²)) needed to form the globally-correct RMS normalization factor,\n before an all-gather collects these statistics along the specified cluster_axis.\n\n The gathered statistics are then consumed by the corresponding post-all-gather op, which\n computes the final normalization factor ( x / sqrt(E(x²) + epsilon) ) and applies normalization\n and optional weight scaling locally on each device.\n\n Only statistics are communicated across devices; the input tensor itself is not all-gathered.\n\n Maps to ttnn::rms_norm_pre_all_gather at runtime.\n\n This operation requires the input tensor to be width-sharded across devices.\n\n Inputs:\n - input: Input tensor. Must be width-sharded in L1. Tiled layout required.\n - residual: Optional Residual Input Tensor to add to input\n before normalization (x + residual). If provided, it must match\n input's padded shape and sharding.\n\n Outputs:\n - result: Intermediate/local statistics tensor that is later aggregated across\n devices via all-gather. The result is in TILE layout.\n\n Attributes:\n - compute_config: Device compute kernel configuration. Controls math\n fidelity, fp32_dest_acc_en, and packer L1 accumulation.\n - program_config: LayerNormShardedMultiCoreProgramConfig derived from\n the input's shard spec (core grid, block_h, block_w).\n - use_2d_core_grid: Optional flag controlling 2D core-grid execution.\n Defaults to None", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "residual", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "compute_config", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" }, { "name": "use_2d_core_grid", "type": "OptionalAttr" } ] }, { "name": "ttnn.rotary_embedding", "summary": "Rotary embedding op in TTNN dialect.", "description": "Applies rotary embedding to the input tensor using precomputed cosine and sine caches.\n Formula used:\n x_rotated = x * cos + rotate_half(x) * sin\n where rotate_half(x) swaps the first and second halves of the last dimension of x.\n\n Example:\n ```mlir\n %result = ttnn.rotary_embedding(%input, %cos_cache, %sin_cache)\n : tensor<1x32x1024x64xf16>, tensor<1x1x1024x64xf16>, tensor<1x1x1024x64xf16>\n -> tensor<1x32x1024x64xf16>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "cos_cache", "type": "AnyRankedTensor" }, { "name": "sin_cache", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "token_index", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.rotary_embedding_llama", "summary": "Rotary embedding llama operation.", "description": "Applies rotary embedding to the input tensor using precomputed cosine and sine caches along with a transformation matrix.\n\n The operation supports both prefill and decode modes:\n - Prefill mode: Uses interleaved memory layout\n - Decode mode: Uses height-sharded memory layout\n\n Example:\n ```mlir\n %result = ttnn.rotary_embedding_llama(%input, %cos_cache, %sin_cache, %trans_mat)\n {is_decode_mode = false}\n : tensor<1x32x128xbf16>, tensor<1x32x128xbf16>, tensor<1x32x128xbf16>,\n tensor<1x1x32x32xbf16> -> tensor<1x32x128xbf16>\n ```", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "cos_cache", "type": "AnyRankedTensor" }, { "name": "sin_cache", "type": "AnyRankedTensor" }, { "name": "trans_mat", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_decode_mode", "type": "DefaultValuedAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.rsqrt", "summary": "Eltwise rsqrt.", "description": "Eltwise rsqrt operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.sampling", "summary": "Sampling operation.", "description": "Performs fused top-k + top-p + multinomial sampling on pre-filtered\n candidate logits using the ttnn::sampling kernel.\n\n The op accepts two SHAPE forms; SamplingOpRank2RewritePattern (a\n decomposition workaround) transforms the first into the second so the\n ttnn::sampling kernel sees the rank it requires. Dtype and layout\n adaptation are handled separately by operand workarounds.\n\n Pre-decomposition (matches TTIR view):\n - `input_values`: [batch, candidates] bf16\n - `input_indices`: [batch, candidates] int32\n - `result`: [batch] int32\n\n Post-decomposition (rank matches the kernel; dtype/layout are still the\n IR's user-facing types — operand workarounds insert any needed to_layout\n and typecast ops, e.g. retyping the result to uint32 to match the kernel\n and converting back to int32 for consumers):\n - `input_values`: [1, 1, batch, candidates] bf16\n - `input_indices`: [1, 1, batch, candidates] int32\n - `result`: [1, 1, 1, batch] int32\n\n Common to both forms:\n - `k`: Per-request top-k values [batch] uint32\n - `p`: Per-request top-p values [batch] bf16\n - `temp`: Per-request temperature values [batch] bf16\n - `seed`: Optional random seed (uint32 scalar attribute)", "operands": [ { "name": "input_values", "type": "AnyRankedTensor" }, { "name": "input_indices", "type": "AnyRankedTensor" }, { "name": "k", "type": "AnyRankedTensor" }, { "name": "p", "type": "AnyRankedTensor" }, { "name": "temp", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "seed", "type": "OptionalAttr" } ] }, { "name": "ttnn.scaled_dot_product_attention", "summary": "Scaled dot product attention operation.", "description": "FlashAttention-2 SDPA. Supports MHA, MQA, and GQA.\n\n Shapes use `B` (batch), `Hq`/`Hkv` (query/kv heads), `Sq`/`Sk` (query/kv\n seq len), `D` (head size).\n\n Args:\n query (AnyRankedTensor): `[B x Hq x Sq x D]`.\n key (AnyRankedTensor): `[B x Hkv x Sk x D]`.\n value (AnyRankedTensor): `[B x Hkv x Sk x D]`. Same type as `key`.\n attention_mask (AnyRankedTensor, optional): `[1|B x 1|Hq x Sq x Sk]`.\n Dim 0 broadcasts batch, dim 1 broadcasts heads. Only valid when\n `is_causal` is `false`. Defaults to `None`.\n is_causal (bool): Defaults to `true`. Requires `Sq == Sk` and no\n `attention_mask`.\n scale (float, optional): Softmax scale. Defaults to `1 / sqrt(D)`.\n sliding_window_size (uint, optional): If `is_causal`, attends to the\n last N tokens; otherwise attends to a window of size N centered at\n the current position. Defaults to `None`.\n attention_sink (AnyRankedTensor, optional): `[1 x Hq x 1 x 1]`, one\n value per query head broadcast across batch and tile dims.\n Defaults to `None`.\n\n Returns:\n AnyRankedTensor: `[B x Hq x Sq x D]` (same type as `query`).", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "sliding_window_size", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.scaled_dot_product_attention_decode", "summary": "A version of scaled dot product attention specifically for decode.", "description": "Flash-Decode SDPA for single-query-token decode. Supports MQA and GQA.\n\n Shapes use `B` (batch), `Hq`/`Hkv` (query/kv heads), `Sk` (kv seq len),\n `D` (head size).\n\n Args:\n query (AnyRankedTensor): `[1 x B x Hq x D]`. Dim 0 must be 1.\n key (AnyRankedTensor): `[B x Hkv x Sk x D]`.\n value (AnyRankedTensor): `[B x Hkv x Sk x D]`. Same type as `key`.\n is_causal (bool, optional): Defaults to `true`. Mutually exclusive\n with `attention_mask`.\n attention_mask (AnyRankedTensor, optional): `[1|B x 1 x 1|Hq x Sk]`.\n Dim 0 broadcasts batch, dim 2 broadcasts heads. Only valid when\n `is_causal` is `false`.\n cur_pos_tensor (AnyRankedTensor): 1D `[B]` integer tensor of decode\n positions.\n attention_sink (AnyRankedTensor, optional): `[Hq x 32]`, single tile\n wide.\n scale (float, optional): Softmax scale. Defaults to `1 / sqrt(D)`.\n\n Returns:\n AnyRankedTensor: `[1 x B x Hq x D]` (same type as `query`).", "operands": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" }, { "name": "attention_mask", "type": "Optional" }, { "name": "cur_pos_tensor", "type": "Optional" }, { "name": "attention_sink", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_causal", "type": "DefaultValuedAttr" }, { "name": "scale", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "ttnn.scatter", "summary": "Scatter op.", "description": "Embeds the values of the source tensor into the input tensor at locations specified by the index tensor along the given dimension.\n\n Parameters:\n - `input` (ttnn.Tensor): The tensor being updated.\n - `index` (ttnn.Tensor): Indices where values will be written to.\n - `source` (ttnn.Tensor): The values to scatter into the input tensor.\n - `dim` (int32_t): The dimension along which to scatter.\n - `scatter_reduce_type` (Enum): The scatter reduce type to use (SUM, PROD, MIN, MAX, INVALID).", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "index", "type": "AnyRankedTensor" }, { "name": "source", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "SI32Attr" }, { "name": "scatter_reduce_type", "type": "TTCore_ReduceTypeAttr{sum|mean|max|min|std|var|prod|invalid}" } ] }, { "name": "ttnn.selective_reduce_combine", "summary": "Reduce and combine phase of the MoE pipeline.", "description": "Takes dense blocks of expert-computed tokens from the MoE compute kernel,\n sparsifies them, and sends tokens back to their originating devices via\n fabric.", "operands": [ { "name": "dense_input_tensor", "type": "AnyRankedTensor" }, { "name": "dense_activations_tensor", "type": "AnyRankedTensor" }, { "name": "dense_token_maps_tensor", "type": "AnyRankedTensor" }, { "name": "dense_token_counts_tensor", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "hidden_size", "type": "UI32Attr" }, { "name": "batch_size", "type": "UI32Attr" }, { "name": "seq_size", "type": "UI32Attr" }, { "name": "select_experts_k", "type": "UI32Attr" }, { "name": "experts", "type": "UI32Attr" } ] }, { "name": "ttnn.sigmoid", "summary": "Eltwise sigmoid.", "description": "Eltwise sigmoid operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.sign", "summary": "Eltwise sign operation.", "description": "Returns the sign of the `operand` element-wise and produces a `result`\n tensor.\n\n Example:\n %a: [[3, -2, 0], [1, -4, 4]]\n \"ttnn.sign\"(%a, %out) -> %out: [[1, -1, 0], [1, -1, 1]]", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.silu", "summary": "Eltwise SiLU.", "description": "Eltwise SiLU (Swish) operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.sin", "summary": "Eltwise sine.", "description": "Eltwise sine operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.slice_dynamic", "summary": "Dynamic slice op.", "description": "Extract a portion of a tensor based on the specified start (`begins`), stop (`ends`), and step\n indices for each dimension. Maps to ttnn::slice.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "begins", "type": "AnyRankedTensor" }, { "name": "ends", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "step", "type": "OptionalAttr>" } ] }, { "name": "ttnn.slice_static", "summary": "Slice op.", "description": "Extract a portion of a tensor based on the specified start (`begins`), stop (`ends`), and step\n indices for each dimension. The `begins` and `ends` parameters are attributes with fixed values.\n Maps to ttnn::slice.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "begins", "type": "TypedArrayAttrBase" }, { "name": "ends", "type": "TypedArrayAttrBase" }, { "name": "step", "type": "TypedArrayAttrBase" } ] }, { "name": "ttnn.softmax", "summary": "Softmax op.", "description": "Softmax operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dimension", "type": "SI32Attr" }, { "name": "numericStable", "type": "DefaultValuedAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.sort", "summary": "Sort op.", "description": "Sorts elements of a tensor along a given dimension.\n\n Input:\n - input: AnyRankedTensor\n\n Attributes:\n - dim (int8): The dimension to sort along (default: -1, the last dim).\n - descending (bool): If True, sort in descending order (default: False).\n - stable (bool): If True, ensures stable sort (equal elements keep order).\n\n Returns a tuple:\n - values: the sorted tensor.\n - indices: the original indices of the sorted values.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "values", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim", "type": "DefaultValuedAttr" }, { "name": "descending", "type": "DefaultValuedAttr" }, { "name": "stable", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.sparse_matmul", "summary": "Sparse block matrix multiplication with sparsity mask.", "description": "The `sparse_matmul` operation performs batched matrix multiplication where\n computation is selectively skipped for blocks marked as zero in the sparsity\n tensor. Input `b` is organized as a collection of weight matrices indexed by\n a block dimension (dim 1), and the sparsity tensor controls which blocks\n participate in the computation.\n\n Supported Modes:\n - is_input_a_sparse=false, is_input_b_sparse=true (column-parallel):\n a: [A, B, M, K], b: [1, E, K, N], sparsity: [A, B, 1, E]\n -> output: [A, B, 1, E, M, N]\n - is_input_a_sparse=true, is_input_b_sparse=false (row-parallel):\n a: [A, E, M, K], b: [1, E, K, N], sparsity: [1, 1, A, E]\n -> output: [A, E, M, N]\n - is_input_a_sparse=true, is_input_b_sparse=true (both sparse):\n a: [1, E, M, K], b: [1, E, K, N], sparsity: [1, 1, 1, E]\n -> output: [1, E, M, N]\n\n Example:\n ```mlir\n %result = \"ttnn.sparse_matmul\"(%activations, %weights, %sparsity) <{\n is_input_a_sparse = false, is_input_b_sparse = true, nnz = 2\n }> : (tensor<2x4x32x2880xbf16>, tensor<1x4x2880x5760xbf16>,\n tensor<2x4x1x4xbf16>) -> tensor<2x4x1x4x32x5760xbf16>\n ```", "operands": [ { "name": "a", "type": "AnyRankedTensor" }, { "name": "b", "type": "AnyRankedTensor" }, { "name": "sparsity", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "is_input_a_sparse", "type": "DefaultValuedAttr" }, { "name": "is_input_b_sparse", "type": "DefaultValuedAttr" }, { "name": "nnz", "type": "OptionalAttr" }, { "name": "program_config", "type": "OptionalAttr" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.split_query_key_value_and_split_heads", "summary": "Split query, key, values and split heads op used in attention layer.", "description": "Splits input_tensor of shape [batch_size, sequence_size, 3 * hidden_size] into 3 tensors (Query, Key, Value) of shape [batch_size, sequence_size, hidden_size]. Then, reshapes and permutes the output tensors, to make them ready for computing attention scores.\n If kv_input_tensor is passed in, then input_tensor of shape [batch_size, sequence_size, hidden_size] is only used for Query, and kv_input_tensor of shape [batch_size, sequence_size, 2 * hidden_size] is used for Key and Value.\n For the sharded implementation, the input query, key and value are expected to be concatenated such that the heads are interleaved (q1 k1 v1…qn kn vn).", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" }, { "name": "kv_input_tensor", "type": "Optional" } ], "results": [ { "name": "query", "type": "AnyRankedTensor" }, { "name": "key", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "num_heads", "type": "UI32Attr" }, { "name": "num_kv_heads", "type": "OptionalAttr" }, { "name": "transpose_key", "type": "BoolAttr" } ] }, { "name": "ttnn.sqrt", "summary": "Eltwise sqrt.", "description": "Eltwise sqrt operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.subtract", "summary": "Eltwise subtract.", "description": "Eltwise subtract operation.", "operands": [ { "name": "lhs", "type": "AnyRankedTensor" }, { "name": "rhs", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.sum", "summary": "Sum reduction op.", "description": "Sum reduction op.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "keep_dim", "type": "BoolAttr" }, { "name": "dim_arg", "type": "OptionalAttr>" }, { "name": "compute_config", "type": "OptionalAttr" } ] }, { "name": "ttnn.tan", "summary": "Eltwise tan op.", "description": "Eltwise tan operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.tanh", "summary": "Eltwise tanh op.", "description": "Eltwise tanh operation.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.to_device", "summary": "ToDevice op.", "description": "This op sends the input tensor to the given device with the given memory config.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "device", "type": "TTNN_Device" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.to_dtype", "summary": "ToDType op.", "description": "This op converts the data type of the input tensor based on the given data type on the host.\n\n Args:\n - :attr:`input`: the ttnn.Tensor\n - :attr:`dtype`: `ttnn` data type.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dtype", "type": "TTCore_DataTypeAttr{f32|f16|bf16|bfp_f8|bfp_bf8|bfp_f4|bfp_bf4|bfp_f2|bfp_bf2|u32|u16|u8|si32|i1}" } ] }, { "name": "ttnn.to_layout", "summary": "ToLayout op.", "description": "This op wraps all layout information gathered from ttir.toLayout. It is used/updated by the optimizer\n to perform optimizations, and later broken down into specific memory/layout operations (toDevice, toMemoryConfig etc.).\n Currently in the TTNN backend, we use this op solely for tilize/untilize, therefore marking all other attrs as optional.\n Once ttnn::to_layout supports other attrs, we can remove the optional tag.\n\n The output data type is derived from the result tensor's TTNNLayoutAttr\n encoding via the TTNN_DtypeOpInterface. The target page layout (tile vs\n row-major) is also derived from the encoding. Whether this op actually\n changes dtype can be queried via `hasDtypeChange()`.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.to_memory_config", "summary": "ToMemoryConfig op.", "description": "This op converts the memory config of the input tensor based on the given memory config.\n It handles:\n - Dram to L1\n - L1 to Dram\n - Interleaved to sharded\n - Sharded to interleaved\n - Sharded to sharded (reshard)", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.topk", "summary": "Top-K selection operation.", "description": "Returns the `k` largest or `k` smallest elements of the `input_tensor` along a given dimension `dim`.\n If `dim` is not provided, the last dimension of the input_tensor is used.\n If `largest` is True, the `k` largest elements are returned. Otherwise, the `k` smallest elements are returned.\n The boolean option `sorted` if True, will make sure that the returned `k` elements are sorted.", "operands": [ { "name": "input_tensor", "type": "AnyRankedTensor" } ], "results": [ { "name": "values", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "k", "type": "I32Attr" }, { "name": "dim", "type": "DefaultValuedAttr" }, { "name": "largest", "type": "DefaultValuedAttr" }, { "name": "sorted", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.topk_router_gpt", "summary": "Fused router linear layer for GPT-style mixture-of-experts models.", "description": "A fused multi-core matmul + top-k for the GPT-OSS MoE router. Computes the\n router logits via a linear projection (input @ weight + bias) and returns\n the top-k expert indices and weights for each token.\n\n Inputs:\n - input: [B, hidden_dim] bf16 hidden states\n - weight: [hidden_dim, num_experts] bf16 router weight matrix\n - bias: [B, num_experts] bf16 router bias (pre-broadcast across batch)\n\n Outputs:\n - expert_indices: [B, k] ui16 top-k expert indices (ROW_MAJOR)\n - expert_weights: [B, k] bf16 top-k router weights (ROW_MAJOR)\n\n num_experts must be 128. B must be 32.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "weight", "type": "AnyRankedTensor" }, { "name": "bias", "type": "AnyRankedTensor" } ], "results": [ { "name": "expert_indices", "type": "AnyRankedTensor" }, { "name": "expert_weights", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "k", "type": "I32Attr" }, { "name": "num_experts", "type": "I32Attr" } ] }, { "name": "ttnn.transpose", "summary": "Transpose op.", "description": "Transpose tensor along two given dimensions.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "dim0", "type": "SI32Attr" }, { "name": "dim1", "type": "SI32Attr" } ] }, { "name": "ttnn.tt_lang_op", "summary": "Opaque tt-lang custom kernel call.", "description": "TTNN-level representation for a user-defined tt-lang kernel. Lowered from\n `ttir.tt_lang_op` and carries the same `kernel_id` / `version_tag` /\n `arg_roles` / `shard_spec` attributes verbatim. The kernel body is\n deferred: the optional `kernel_artifact` attribute is empty post-conversion\n and is populated by the `--ttnn-resolve-tt-lang-kernels` pass (driven from\n the tt-xla plugin's `ModuleBuilder::resolveTTLangKernels`) after the\n TTIR -> TTNN pipeline finishes by calling the tt-lang Python resolver with\n the now-final shard-local operand types. The artifact is the resolver's\n JSON payload stored as a `StringAttr`. Subsequent flatbuffer emission\n consumes `kernel_artifact` to embed the compiled kernel into the\n executable.\n\n This op is intentionally opaque to the TTNN optimizer: it is exempt\n from the op-model cost interface via the `OpModelExempt` trait (its\n kernel body is not authored in TTNN dialects, so neither op constraints\n nor runtime can be queried from inside tt-mlir). TT-Lang kernels expect\n 32x32 tile layout so there is a hard `Layout::Tile` requirement on\n every input and result so the layout pipeline materialises tilized\n buffers for the kernel's reader/writer threads.\n\n The op is destination-passing style (`DestinationStyleOpInterface`):\n the `\"out\"`-roled operands are the trailing DPS init operands and tie\n positionally to the op's results (result `i` aliases the `i`-th `\"out\"`\n operand's buffer). `arg_roles` is therefore constrained to the form\n `in* out+` -- all `\"in\"` operands first, then all `\"out\"` operands --\n which is enforced by the verifier and by the `@tt_torch.tt_lang_operation`\n decorator. Generic MLIR analyses (the TTNN deallocate pass, etc.)\n follow the DPS operand->result tie directly, so the op needs no\n name-keyed special-casing.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "kernel_id", "type": "StrAttr" }, { "name": "version_tag", "type": "StrAttr" }, { "name": "arg_roles", "type": "StrAttr" }, { "name": "shard_spec", "type": "DefaultValuedStrAttr" }, { "name": "kernel_artifact", "type": "OptionalAttr" } ], "assemblyFormat": "`(` $inputs `)` attr-dict `:` `(` type($inputs) `)` `->` `(` type($results) `)`" }, { "name": "ttnn.typecast", "summary": "Typecast op.", "description": "This op converts the data type of the input tensor based on the given data type.\n It handles:\n - conversions of data types.\n\n The output data type is derived from the result tensor's TTNNLayoutAttr\n encoding via the TTNN_DtypeOpInterface.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.update_cache", "summary": "Update static cache tensor.", "description": "Updates the `cache` tensor in-place with values from `input` at `update_index` and `batch_offset`.", "operands": [ { "name": "cache", "type": "AnyRankedTensor" }, { "name": "input", "type": "AnyRankedTensor" }, { "name": "update_index", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "batch_offset", "type": "I32Attr" } ] }, { "name": "ttnn.upsample", "summary": "Upsample 2D op.", "description": "Upsample 2D operation. Input tensor is assumed to be in NHWC format.\n\n Attributes:\n - `scale_factor` (si32 | array): The scale factor for upsampling in H and W dimensions respectively.\n - `mode` (str): The upsampling algorithm. Currently only \"nearest\" and \"bilinear\" are supported. Default is \"nearest\".\n\n Example:\n // %a: tensor<10x64x32xbf16>\n %0 = \"ttnn.upsample\"(%a) <{scale_factor = array}> : (tensor<10x64x32x3xbf16>) -> tensor<10x128x128x3xbf16>", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "scale_factor", "type": "AnyAttrOf<[SI32Attr, DenseI32ArrayAttr]>" }, { "name": "mode", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.where", "summary": "Eltwise where.", "description": "Eltwise where operation.", "operands": [ { "name": "first", "type": "AnyRankedTensor" }, { "name": "second", "type": "AnyRankedTensor" }, { "name": "third", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ] }, { "name": "ttnn.write_tensor", "summary": "Write tensor op.", "description": "Copies host_tensor data into device_tensor through cq_id.\n Memory copy is done in place, thus no output is returned.\n Inputs:\n - `host_tensor` AnyRankedTensor: The host tensor to copy.\n - `device_tensor` AnyRankedTensor: The device tensor to copy into.\n - `blocking` bool: Whether the copy should be executed synchronously.\n - `cq_id` i32: The command queue to copy the tensor with. Must be 0 or 1.", "operands": [ { "name": "host_tensor", "type": "AnyRankedTensor" }, { "name": "device_tensor", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "blocking", "type": "DefaultValuedAttr" }, { "name": "cq_id", "type": "DefaultValuedAttr" } ] }, { "name": "ttnn.zeros", "summary": "Creates a tensor filled with zeros.", "description": "Tensor operation to create a tensor filled with zeros.\n\n Given a ShapeAttr `shape`, produces a tensor with the same shape, filled with zeros.\n\n Example:\n %0 = \"ttnn.zeros\"() <{shape = array}> : () -> tensor<64x28x28xbf16>\n // %0: [[[0, 0, 0, ..., 0], [0, 0, 0, ..., 0], ..., [0, 0, 0, ..., 0]]]", "operands": [ { "name": "device", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "shape", "type": "TTNN_ShapeAttr" } ] }, { "name": "ub.poison", "summary": "Poisoned constant operation.", "description": "The `poison` operation materializes a compile-time poisoned constant value\n to indicate deferred undefined behavior.\n `value` attribute is needed to indicate an optional additional poison\n semantics (e.g. partially poisoned vectors), default value indicates results\n is fully poisoned.\n\n Examples:\n\n ```\n // Short form\n %0 = ub.poison : i32\n // Long form\n %1 = ub.poison <#custom_poison_elements_attr> : vector<4xi64>\n ```", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value", "type": "DefaultValuedAttr" } ], "assemblyFormat": "attr-dict (`<` $value^ `>`)? `:` type($result)" }, { "name": "ub.unreachable", "summary": "Unreachable operation.", "description": "The `unreachable` operation triggers immediate undefined behavior if\n executed.\n\n Example:\n\n ```\n ub.unreachable\n ```", "assemblyFormat": "attr-dict" }, { "name": "util.align", "summary": "Aligns up to a power-of-two alignment if required.", "description": "Aligns |value| up to the given power-of-two |alignment| if required.", "operands": [ { "name": "value", "type": "SignlessIntegerOrIndexLike" }, { "name": "alignment", "type": "SignlessIntegerOrIndexLike" } ], "results": [ { "name": "result", "type": "SignlessIntegerOrIndexLike" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$value `,` $alignment attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.assume.int", "summary": "Memorializes assumptions about index/integer values.", "description": "This op is used to memorialize the result of some integer analysis or\n outside knowledge across a boundary beyond which such information can\n not be easily recovered. Assumptions are made per op/result pair.\n\n Assumptions are tied to operands as rows of permutations of an\n `#util.assume.int` per operand. The number of permutations is the rank.\n Typically multiple permutations record a specific subset of assumptions\n broken down per call-site in some way that is meaningful to the receiver.\n Implementations can use this information to specialize on each\n permutation if it is meaningful to do so (i.e. vs unioning across them).\n In such cases, there will typically be one such op at the top of a\n function or scope which passes all covered operands through it.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "assumptions", "type": "TypedArrayAttrBase>" } ], "traits": [ { "type": "AllTypesMatch<['operands', 'results']>" } ], "hasCustomAssemblyFormat": true }, { "name": "util.buffer.alloc", "summary": "Allocates a buffer with undefined contents.", "description": "Allocates a buffer with undefined contents. Consumers of the allocated\n result must assume nothing of the contents.", "operands": [ { "name": "storage_size", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "Util_BufferType" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" } ], "assemblyFormat": "`uninitialized`\n attr-dict\n `:`\n type($result) `` `{` $storage_size `}`", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.compare", "summary": "Compares a range of two buffers.", "description": "Returns true if the two ranges are bitwise equivalent, somewhat like memcmp.", "operands": [ { "name": "lhs", "type": "Util_BufferType" }, { "name": "lhs_size", "type": "Util_Size" }, { "name": "lhs_offset", "type": "Util_Offset" }, { "name": "rhs", "type": "Util_BufferType" }, { "name": "rhs_size", "type": "Util_Size" }, { "name": "rhs_offset", "type": "Util_Offset" }, { "name": "length", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "I1" } ], "assemblyFormat": "$lhs `[` $lhs_offset `]` `,`\n $rhs `[` $rhs_offset `]` `,`\n $length `:`\n type($lhs) `` `{` $lhs_size `}` `,`\n type($rhs) `` `{` $rhs_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.constant", "summary": "Constant host-side byte buffer.", "description": "Defines a compile-time byte buffer based on the given attribute value.\n The attribute will be serialized into the canonical IREE format for the\n chosen host target.", "results": [ { "name": "result", "type": "Util_BufferType" } ], "attributes": [ { "name": "name", "type": "OptionalAttr" }, { "name": "value", "type": "Util_AnySerializableAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "mime_type", "type": "OptionalAttr" } ], "assemblyFormat": "($name^)? attr-dict `:` type($result) `=` $value", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.copy", "summary": "Copies a range of bytes between buffers.", "description": "Copies a range of bytes as with memcpy (no overlapping).", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Util_Offset" }, { "name": "target", "type": "Util_BufferType" }, { "name": "target_size", "type": "Util_Size" }, { "name": "target_offset", "type": "Util_Offset" }, { "name": "length", "type": "Util_Size" } ], "assemblyFormat": "$source `[` $source_offset `]` `,`\n $target `[` $target_offset `]` `,`\n $length `:`\n type($source) `` `{` $source_size `}` `->`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.dealloc", "summary": "Deallocates a buffer.", "description": "Hints that the buffer contents can be discarded. Buffers are reference\n counted and other owners may keep it live beyond the dealloc.", "operands": [ { "name": "operand", "type": "Util_BufferType" }, { "name": "operand_size", "type": "Util_Size" } ], "assemblyFormat": "$operand `:` type($operand) `{` $operand_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.fill", "summary": "Fills a range of bytes with a value.", "description": "Fills the contents of the buffer in the given byte range with a pattern.\n The offset and length must match the natural alignment of the pattern type.", "operands": [ { "name": "pattern", "type": "Util_FillPattern" }, { "name": "target", "type": "Util_BufferType" }, { "name": "target_size", "type": "Util_Size" }, { "name": "target_offset", "type": "Util_Offset" }, { "name": "length", "type": "Util_Size" } ], "assemblyFormat": "$pattern `,`\n $target `[` $target_offset `for` $length `]` `:`\n type($pattern) `->`\n type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.hash", "summary": "Computes the hash of a byte range of a buffer.", "description": "Computes the SipHash-2-4 of a value at a byte offset with the given length.\n This always uses a seed of `0x0001020304...0e0f` and produces a single 64\n bit value.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Util_Offset" }, { "name": "length", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$source `[` $source_offset `for` $length `]`\n `:` type($source) `` `{` $source_size `}` `->` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.load", "summary": "Loads a value from a buffer.", "description": "Loads a value at a byte offset. Must be aligned to the natural size of the\n result type.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Util_Offset" }, { "name": "length", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "Util_Primitive" } ], "assemblyFormat": "$source `[` $source_offset `for` $length `]`\n `:` type($source) `` `{` $source_size `}` `->` type($result)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.size", "summary": "Returns the total buffer storage size in bytes.", "description": "Returns the total length of the buffer in bytes from its base offset.", "operands": [ { "name": "operand", "type": "Util_BufferType" } ], "results": [ { "name": "result", "type": "Util_Size" } ], "assemblyFormat": "$operand\n `:` type($operand)\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.slice", "summary": "Clones a subregion of a buffer.", "description": "Returns a copy of the contents from the source buffer.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Util_Offset" }, { "name": "result_size", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "Util_BufferType" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "$source `[` $source_offset `]` attr-dict `:`\n type($source) `` `{` $source_size `}` `->`\n type($result) `` `{` $result_size `}`", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.storage", "summary": "Returns the underlying buffer storage range.", "description": "Returns the buffer storage as a memref that must be offset and restricted to\n the returned range. The memref may be of any type and the user is\n responsible for ensuring that the reinterpret_cast-like behavior makes sense\n for the data they are accessing.", "operands": [ { "name": "operand", "type": "Util_BufferType" }, { "name": "operand_size", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "AnyMemRef" }, { "name": "offset", "type": "Util_Offset" } ], "assemblyFormat": "$operand\n `:` type($operand) `` `{` $operand_size `}` `->` `(` type($result) `,` type($offset) `)`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.store", "summary": "Stores a value into a buffer.", "description": "Stores a value at a byte offset. Must be aligned to the natural size of the\n source type.", "operands": [ { "name": "source", "type": "Util_Primitive" }, { "name": "target", "type": "Util_BufferType" }, { "name": "target_size", "type": "Util_Size" }, { "name": "target_offset", "type": "Util_Offset" }, { "name": "length", "type": "Util_Size" } ], "assemblyFormat": "$source `,`\n $target `[` $target_offset `for` $length `]`\n `:` type($source) `->` type($target) `` `{` $target_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.buffer.subspan", "summary": "Returns a reference to a subrange of a buffer.", "description": "Returns a logical view into an underlying source buffer. This induces\n aliasing and multiple SSA values may allow access to the same underlying\n buffer storage.\n\n Subspans are a compiler-only concept and are propagated by an analysis pass\n to result in absolute offsets on accesses any place the subrange would have\n been used.", "operands": [ { "name": "source", "type": "Util_BufferType" }, { "name": "source_size", "type": "Util_Size" }, { "name": "source_offset", "type": "Util_Offset" }, { "name": "result_size", "type": "Util_Size" } ], "results": [ { "name": "result", "type": "Util_BufferType" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "$source `[` $source_offset `]` `:`\n type($source) `` `{` $source_size `}` `->`\n type($result) `` `{` $result_size `}`\n attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.call", "summary": "Function call operation.", "description": "Represents a direct call to a function that is within the same symbol scope\n as the call. The operands and result types of the call must match the\n specified function type.\n\n Calls support tied operands which indicate that specific results alias\n a specific operand. The operand and result types are allowed to differ if\n a cast is performed within the callee.\n\n Example:\n ```mlir\n util.func @fn(%arg0: i32, %arg1: tensor) -> (f32, %arg1 as tensor)\n ...\n %0 = util.call @fn(%0, %1) : (i32, tensor) -> (f32, %1 as tensor)\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` $operands `)`\n attr-dict `:`\n custom(type($operands))\n `->`\n custom(ref($operands),\n ref(type($operands)),\n type($results),\n $tied_operands)", "hasCustomAssemblyFormat": true }, { "name": "util.cast", "summary": "Casts one util type to another ala static_cast/dynamic_cast.", "description": "Performs a type cast between object types known to the util dialect.", "operands": [ { "name": "operand", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `to` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.cmp.eq", "summary": "Compares two values for equality.", "description": "Compares two operands for equality. This is intended for comparing IREE\n reference types (like !util.buffer) that cannot be used with std.cmpi.", "operands": [ { "name": "lhs", "type": "AnyType" }, { "name": "rhs", "type": "AnyType" } ], "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "util.cmp.ne", "summary": "Compares two values for inequality.", "description": "Compares two operands for inequality. This is intended for comparing IREE\n reference types (like !util.buffer) that cannot be used with std.cmpi.", "operands": [ { "name": "lhs", "type": "AnyType" }, { "name": "rhs", "type": "AnyType" } ], "results": [ { "name": "result", "type": "I1" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "util.func", "summary": "Function operation containing a CFG region.", "description": "An operation declaring a callable function.\n\n An external function declaration (used when referring to a function declared\n in some other module) has no body.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "tied_operands", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "inlining_policy", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "util.global", "summary": "Stateful global variable declaration.", "description": "Declares a global variable that maintains its value across invocations.\n The value is tied to the execution context of the module and different\n contexts will have different variable storage.\n\n Globals can be initialized with an `initial_value` attribute that specifies\n their value at module initialization time. This initial value is evaluated\n in module definition order: a global with an initial value is considered\n initialized at its definition point in the module, not when first accessed.\n\n During module initialization:\n * Globals with `initial_value` attributes conceptually have their value\n materialized and stored before any subsequent initialization points\n * Initialization order follows module definition order exactly\n * Globals are visible to initializers but only after their definition point\n\n Example:\n ```mlir\n // A is initialized to 1 at this point in module initialization.\n util.global @A = 1 : i32\n\n // This initializer can read A (it's defined above).\n util.initializer {\n %a = util.global.load @A : i32 // Loads 1\n }\n\n // B is initialized to 2 here, after the above initializer runs.\n util.global @B = 2 : i32\n ```\n\n Globals marked as mutable can be modified by stores anywhere in the program.\n Immutable globals have strict initialization rules:\n * Can only be initialized once - either by `initial_value` or by stores\n in initializers, never both.\n * Stores to immutable globals are only allowed in:\n - `util.initializer` ops directly\n - Functions that are only called from initializers (initializer-only)\n * Stores from externally-reachable functions are forbidden.\n * Initialization must respect module order - initializers can only\n access globals defined before them.\n\n Stores to immutable globals inside control flow regions (scf.if, scf.for,\n scf.while, etc) in initializer-only functions will generate warnings as\n they may indicate complex initialization patterns that could be fragile:\n ```mlir\n util.func private @init_func() {\n scf.if %cond {\n // Warning: conditional store in initializer-only function\n util.global.store %val, @immutable_global : i32\n }\n }\n ```\n While such patterns are allowed they should be used with caution as the\n initialization behavior depends on runtime control flow and the compiler\n may disable optimizations on those globals.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "initial_value", "type": "OptionalAttr" }, { "name": "inlining_policy", "type": "OptionalAttr" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name\n attr-dict\n custom($type, $initial_value)", "hasCustomAssemblyFormat": true }, { "name": "util.global.address", "summary": "Returns an address reference to a global.", "description": "Returns the address of a global as a typed reference. Can be used with the\n global load and store indirect ops.", "results": [ { "name": "result", "type": "Util_AnyGlobalPtr" } ], "attributes": [ { "name": "global", "type": "Util_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` qualified(type($result))", "hasCustomAssemblyFormat": true }, { "name": "util.global.load", "summary": "Loads a value from a global variable.", "description": "Returns a global variable value. |is_immutable| is a reflection of the\n mutability of the loaded global to minimize the need to traverse symbol\n tables.", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "global", "type": "Util_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.global.load.indirect", "summary": "Loads a value from a global variable.", "description": "Returns a copy of the global variable value.", "operands": [ { "name": "global", "type": "Util_AnyGlobalPtr" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` qualified(type($global)) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.global.store", "summary": "Stores a value into a global variable.", "description": "Stores a copy of the value into a global variable.", "operands": [ { "name": "value", "type": "AnyType" } ], "attributes": [ { "name": "global", "type": "Util_GlobalRefAttr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "util.global.store.indirect", "summary": "Stores a value into a global variable.", "description": "Stores a copy of the value into a global variable.", "operands": [ { "name": "value", "type": "AnyType" }, { "name": "global", "type": "Util_AnyGlobalPtr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value) `->` qualified(type($global))", "hasCustomAssemblyFormat": true }, { "name": "util.hoistable_conversion", "summary": "Defines a hoistable conversion between inputs and outputs.", "description": "Defines a conversion between some number of inputs and outputs that should\n be hoisted out of loops or canceled where possible.\n\n This is an operation that allows local pattern rewrites to be defined that\n shouldn't modify loop structure to allow that structure to be modified as\n a post-processing step. It is **not** expected to appear in IR long-term,\n and should, if possible, be rewritten away by the same pass that introduced\n it.\n\n The initial motivation for this operation is to enable code such as the\n lowering of an `inner_tiled` operation to platform intrinsics to mark\n marshaling/unmarshaling needed to convert between the types and shapes IREE\n expects and what the platform expects. However, it could be used for other\n cases where, within a loop, we have `arg <- f^{-1}(g(f(arg)))` where the\n $f$ and $f^{-1}$ can be moved out of the loop without sacrificing\n correctness.\n\n In general, this operation executes the contained single-block region once,\n with the arguments of the region bound to its inputs and the returned\n results bound to its outputs. It must always be correct to perform this\n inlining, though it is likely to be less performant.\n\n The `tag` and `inverse_tag` are used to identify pairs of hoistable\n conversions that can cancel with each other. The operations placed in a\n `hoistable_conversion` operation must be such that the following operations\n are correct for a pair of operations F and G such that `tag(F) ==\n inverse_tag(G)` and `inverse_tag(G) == tag(F)`:\n\n 1. If the outputs of F are the inputs of G, the results of G can be\n replaced by the arguments to F\n 2. If the arguments to F are loop iteration arguments and the results of G\n are the subsequent yielded values of those arguments, then\n - Those loop arguments can be replaced by a set of arguments whose types\n match the result types of F / input types of G\n - The initial values of those new loop arguments can be constructed by\n applying F to the previous initial values\n - The results of the loop can be transformed back into their old types\n by applying G to the new results\n - If F is not the only user of those loop-carried arguments, applying G\n to the new arguments inside the loop will preserve correctness\n\n These optimizations are performed by `eliminateHoistableConversions`\n transformation in util optimizations.\n\n These properties allow pure pre-/post-processing of operands, such as\n chains of `shape_cast` operations surrounding the accumulators of intrinsic\n calls, to be pulled out of loops, and to prevent redundant conversions from\n being added after unrolling intrinsics.\n\n Note that these hoistable conversions are **not** expected to commute with\n other hoistable conversions.", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "tag", "type": "StringProp" }, { "name": "inverseTag", "type": "StringProp" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "util.initializer", "summary": "Global initialization function.", "description": "A function that is called in definition order upon module initialization.\n Must not load any globals that are defined or initialized after it in the\n module.\n\n Module initialization follows a strict execution order to ensure\n correctness:\n * Initialization points: two types of operations define initialization:\n - `util.initializer` ops: explicit initialization functions\n - `util.global` ops with initial values: implicit initialization via\n attributes\n * Execution order: initialization proceeds in exact module definition order:\n - Operations execute sequentially from top to bottom\n - Each `util.global` with an initial value conceptually materializes its\n value and stores it before the next initialization point\n - Each `util.initializer` executes its entire body before proceeding\n * Dependency rules:\n - Initializers may only access globals defined before them in module order\n - Globals with initial values are considered \"initialized\" at their\n definition point, not when first accessed\n - Function calls within initializers observe the current initialization\n state when the call is made\n * Transformation guarantees:\n - Combining passes preserve exact initialization order\n - Globals with initial values may be converted to explicit initialization\n while maintaining their position in the initialization sequence\n - The final initialization state must be identical to sequential execution\n\n Example execution:\n ```mlir\n util.global @A = 1 : i32 // A = 1\n util.initializer { ... } // Executes with A = 1\n util.global @B = 2 : i32 // B = 2\n util.initializer {\n %a = util.global.load @A : i32 // Loads 1\n %b = util.global.load @B : i32 // Loads 2\n }\n ```", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "util.list.construct", "summary": "Constructs a list with the given initial values.", "description": "Creates a new list with the given values added in order. The list will be\n allocated with an initial capacity equal to the number of values. This is a\n pseudo-operation that expands to a list create, resize, and a series of\n sets.", "operands": [ { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Util_AnyListType" } ], "assemblyFormat": "custom($values, type($values))\n attr-dict `:` qualified(type($result))", "hasCustomAssemblyFormat": true }, { "name": "util.list.create", "summary": "Creates a new empty list.", "description": "Creates a new empty list with an optional initial capacity.", "operands": [ { "name": "initial_capacity", "type": "Optional" } ], "results": [ { "name": "result", "type": "Util_AnyListType" } ], "assemblyFormat": "($initial_capacity^)? attr-dict `:` qualified(type($result))", "hasCustomAssemblyFormat": true }, { "name": "util.list.get", "summary": "Element accessor.", "description": "Returns the value of the element at the given index. Note that the value\n may be null if the element is null or the type does not match.", "operands": [ { "name": "list", "type": "Util_AnyListType" }, { "name": "index", "type": "Index" } ], "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "$list `[` $index `]` attr-dict `:` custom(type($list), type($result))", "hasCustomAssemblyFormat": true }, { "name": "util.list.resize", "summary": "Resizes the list to a new count in elements.", "description": "Resizes the list to contain `new_size` elements. This will either truncate\n the list if the existing size is greater than `new_size` or extend the list\n with the default list value of the element type.", "operands": [ { "name": "list", "type": "Util_AnyListType" }, { "name": "new_size", "type": "Index" } ], "assemblyFormat": "operands attr-dict `:` qualified(type($list))", "hasCustomAssemblyFormat": true }, { "name": "util.list.set", "summary": "Element mutator.", "description": "Sets the element at the given index to the new value.", "operands": [ { "name": "list", "type": "Util_AnyListType" }, { "name": "index", "type": "Index" }, { "name": "value", "type": "AnyType" } ], "assemblyFormat": "$list `[` $index `]` `,` $value attr-dict `:` custom(type($list), type($value))", "hasCustomAssemblyFormat": true }, { "name": "util.list.size", "summary": "The size of the list in elements.", "description": "Returns the current size of the list in elements.", "operands": [ { "name": "list", "type": "Util_AnyListType" } ], "results": [ { "name": "result", "type": "Index" } ], "assemblyFormat": "operands attr-dict `:` qualified(type($list))", "hasCustomAssemblyFormat": true }, { "name": "util.null", "summary": "Returns a null type value.", "description": "Defines an SSA value that is lowered into dialects supporting\n null/undefined/optional/etc values.", "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.numeric.optional_narrow", "summary": "memorializes an optional numeric narrowing that is valid.", "description": "Serves as a placeholder for points in the computation where an optional\n numeric narrowing can be performed without loss of information. Such ops\n can guide optimization passes wishing to perform precision reduction.\n\n In addition to the operand and result type, this op takes an additional\n `semantic_type` attribute representing the semantic target type which can\n be:\n * FloatType\n * Signed IntegerType\n * Unsigned IntegerType\n\n Note that this `semantic_type` must be a sign-carrying integer if using an\n integer type and cannot be IndexType (i.e. it can be used to indicate a\n possible narrowing of an IndexType to a specific integer).\n\n If the operand is a TensorType, then the result must be a TensorType. The\n `semantic_type` constrains the element type.\n\n Optionally, the minimum and maximum integer values (for integer semantic\n types) are tracked if known.", "operands": [ { "name": "operand", "type": "AnyTypeOf<[Util_Element, Util_Tensor]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Util_Element, Util_Tensor]>" } ], "attributes": [ { "name": "semantic_type", "type": "TypeAttr" }, { "name": "min_value", "type": "OptionalAttr" }, { "name": "max_value", "type": "OptionalAttr" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operand `:` type($operand) `as` $semantic_type attr-dict", "hasCustomAssemblyFormat": true }, { "name": "util.optimization_barrier", "summary": "Prevents compiler optimizations across a value.", "description": "Wraps any operands in an unoptimizable identity to prevent its results from\n being folded. It will be dropped during the final step in compilation and\n has no effect at runtime.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AllTypesMatch<['operands', 'results']>" } ], "assemblyFormat": "attr-dict\n ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "util.range.extents", "summary": "Returns the min/max of a union of a set of ranges.", "description": "Computes min(offsets) and max(offsets + lengths). Though it's possible to\n express this with standard arithmetic this op enables more semantically\n meaningful folding/optimizations.", "operands": [ { "name": "offsets", "type": "Variadic" }, { "name": "lengths", "type": "Variadic" } ], "results": [ { "name": "min", "type": "Util_Range" }, { "name": "max", "type": "Util_Range" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "custom($offsets, $lengths) attr-dict `:` type($min)", "hasCustomAssemblyFormat": true }, { "name": "util.range.max", "summary": "Returns the max of all values.", "description": "Computes the max of a variadic list of operands. Though it's possible to\n express this with standard arithmetic this op enables more semantically\n meaningful folding/optimizations.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Util_Range" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.range.min", "summary": "Returns the min of all values.", "description": "Computes the min of a variadic list of operands. Though it's possible to\n express this with standard arithmetic this op enables more semantically\n meaningful folding/optimizations.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Util_Range" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.return", "summary": "Return from a util.initializer.", "description": "Returns control from an initializer function.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict\n ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "util.scf.unreachable", "summary": "Non-terminator unreachable for use in SCF regions.", "description": "Marks a point as unreachable within SCF regions. Unlike `util.unreachable`\n this is not a terminator and must be followed by appropriate region\n terminators (e.g. `scf.yield`).\n\n When not in an SCF region (e.g. `util.func`) this op canonicalizes to an\n `util.unreachable` terminator that preserves the intended behavior.\n\n Note that this op has side effects to prevent code motion: reaching this op\n at runtime is observable indirectly (by way of what ops _don't_ execute). At\n minimum presence of the op indicates all following ops in the same region\n are unreachable and depending on the parent op may indicate the entire\n parent op is unreachable. The behavior is roughly equivalent to having\n lowered SCF to CFG and used `util.unreachable`.\n\n Example:\n ```mlir\n scf.while (...) {\n ...\n scf.condition(%true) ...\n } do {\n ...\n util.scf.unreachable \"infinite loop body\"\n scf.yield // Required terminator with poison values\n }\n ```", "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "assemblyFormat": "($message^)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "util.sizeof", "summary": "Returns the size in bytes of a datatype.", "description": "Most datatypes have a static size at all layers of the compilation stack.\n However, those that only have a size for certain lowering flows can be\n challenging. This op represents such sizes in a way that can be specialized\n later.\n\n Returns the size in bytes, rounded up to the next whole byte of the\n specified type. This op will fold to a constant index value for IntegerType\n and FloatType. All others are not folded.", "results": [ { "name": "size", "type": "Index" } ], "attributes": [ { "name": "sizedType", "type": "TypeAttr" } ], "assemblyFormat": "$sizedType attr-dict-with-keyword", "hasCustomAssemblyFormat": true }, { "name": "util.status.check_ok", "summary": "Raises a global failure if a status is not 'ok'.", "description": "When the status is not 'ok' this signals a runtime failure that causes the\n entire active invocation - and possibly *all* in-flight and pending\n invocations - to fail with the given status. The status will be propagated\n back via the available runtime error handling mechanisms such as semaphores\n or synchronous invocation results.\n\n As the IREE execution model is deeply pipelined it's possible that failures\n have a latency between when they are emitted and when the application can\n observe the failure. It's also possible that other work that is in-flight\n or pending when the failure occurs will complete.", "operands": [ { "name": "status", "type": "Util_Status" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "assemblyFormat": "$status (`,` $message^)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "util.string.format", "summary": "Formats a string from a template and arguments.", "description": "Produces a `!util.buffer` containing the formatted string. Uses `{}`-style\n substitution: `{}` for sequential args, `{N}` for explicit ordinal. `{{`\n and `}}` produce literal braces. Cannot mix `{}` and `{N}` in the same\n format string.\n\n Integer args are converted to unsigned decimal. Buffer args are copied\n as-is. Folds to `util.buffer.constant` when all arguments are constant.\n Partially folds when some arguments are constant by merging constant\n segments into the format string literals.\n\n Example:\n ```mlir\n %key = util.string.format \"blk.{}.attn_q.weight\"(%idx) : (index) -> !util.buffer\n %multi = util.string.format \"blk.{}.ffn.{}.weight\"(%a, %b) : (index, index) -> !util.buffer\n ```", "operands": [ { "name": "args", "type": "Variadic>" } ], "results": [ { "name": "result", "type": "Util_BufferType" } ], "attributes": [ { "name": "format", "type": "StrAttr" } ], "assemblyFormat": "$format `(` $args `)` attr-dict `:` functional-type($args, $result)", "hasCustomAssemblyFormat": true }, { "name": "util.string.itoa", "summary": "Converts an integer to its decimal string representation.", "description": "Produces a `!util.buffer` containing the unsigned decimal string\n representation of the input integer value. Folds to `util.buffer.constant`\n when the input is constant.\n\n Example:\n ```mlir\n %str = util.string.itoa %value : index -> !util.buffer\n ```", "operands": [ { "name": "value", "type": "AnyTypeOf<[Index, AnySignlessInteger]>" } ], "results": [ { "name": "result", "type": "Util_BufferType" } ], "assemblyFormat": "$value attr-dict `:` type($value) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.switch", "summary": "Primitive switch operation.", "description": "Returns the value with the given `index` in `values` or `default_value` if\n the index is out of bounds.\n\n ```mlir\n // Switch %index to cases of %c100/%c200/%c300 if index==0, ==1, ==2.\n // If %index is out of range (<0 or >2) then default to %c5.\n %0 = util.switch %index[%c100, %c200, %c300] else %c5 : i32\n ```", "operands": [ { "name": "index", "type": "Index" }, { "name": "default_value", "type": "Util_Primitive" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Util_Primitive" } ], "traits": [ { "type": "AllTypesMatch<['default_value', 'result']>" } ], "assemblyFormat": "type($default_value) `from`\n custom(ref(type($default_value)), $values, type($values))\n `at` $index\n `else` $default_value\n attr-dict\n `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "util.unfoldable_constant", "summary": "A constant that cannot be folded by the compiler.", "description": "Similar to a std.constant, but is declared as having a side effect and has\n no folder. This is really just syntactic sugar as it is canonicalized to a\n std.constant wrapped in an util.optimization_barrier.", "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "value", "type": "AnyAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "util.unreachable", "summary": "Unreachable assertion op.", "description": "Signals to the compiler that the parent block should not be reachable.\n This may be converted into a runtime assertion, though ideally they are\n stripped during translation.\n\n ```mlir\n ^bb0:\n %true = arith.constant true\n cond_br %true, ^bb2, ^bb1\n ^bb1:\n // Indicates that this branch should never be taken.\n util.unreachable \"shouldn't be here\"\n ^bb2:\n ...\n\n ```", "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "assemblyFormat": "($message^)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vector.bitcast", "summary": "bitcast casts between vectors", "description": "The bitcast operation casts between vectors of the same rank, the minor 1-D\n vector size is casted to a vector with a different element type but same\n bitwidth. In case of 0-D vectors, the bitwidth of element types must be\n equal.\n\n Example:\n\n ```mlir\n // Example casting to a smaller element type.\n %1 = vector.bitcast %0 : vector<5x1x4x3xf32> to vector<5x1x4x6xi16>\n\n // Example casting to a bigger element type.\n %3 = vector.bitcast %2 : vector<10x12x8xi8> to vector<10x12x2xi32>\n\n // Example casting to an element type of the same size.\n %5 = vector.bitcast %4 : vector<5x1x4x3xf32> to vector<5x1x4x3xi32>\n\n // Example casting of 0-D vectors.\n %7 = vector.bitcast %6 : vector to vector\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfNonI0Elem" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonI0Elem" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($result)" }, { "name": "vector.broadcast", "summary": "broadcast operation", "description": "Broadcasts the scalar or k-D vector value in the source operand\n to a n-D result vector such that the broadcast makes sense, i.e.,\n the source operand is duplicated to match the given rank and sizes\n in the result vector. The legality rules are:\n * the source operand must have the same element type as the result type\n * a k-D vector can be broadcast to\n a n-D vector if\n * k <= n, and\n * the sizes in the trailing dimensions n-k < i <= n with j=i+k-n\n match exactly as s_j = t_i or s_j = 1:\n ```\n t_1 x .. t_n-k x t_n-k+1 x .. x t_i x .. x t_n\n s_1 x .. x s_j x .. x s_k\n \n ```\n * in addition, any scalable unit dimension, `[1]`, must match exactly.\n\n The source operand is duplicated over all the missing leading dimensions\n and stretched over the trailing dimensions where the source has a non-equal\n dimension of 1 (stretching a trailing dimension is also referred to as\n \"dim-1\" broadcasting). These rules imply that any scalar broadcast (k=0) to\n any shaped vector with the same element type is always legal.\n\n Example:\n\n ```mlir\n %0 = arith.constant 0.0 : f32\n %1 = vector.broadcast %0 : f32 to vector<16xf32>\n %2 = vector.broadcast %1 : vector<16xf32> to vector<4x16xf32>\n ```", "operands": [ { "name": "source", "type": "AnyType" } ], "results": [ { "name": "vector", "type": "AnyVectorOfAnyRank" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($vector)" }, { "name": "vector.compressstore", "summary": "writes elements selectively from a vector as defined by a mask", "description": "The compress store operation writes elements from a vector into memory as\n defined by a base with indices and a mask vector. Compression only applies\n to the innermost dimension. When the mask is set, the corresponding element\n from the vector is written next to memory. Otherwise, no action is taken\n for the element. Informally the semantics are:\n\n ```\n index = i\n if (mask[0]) base[index++] = value[0]\n if (mask[1]) base[index++] = value[1]\n etc.\n ```\n\n Note that the index increment is done conditionally.\n\n If a mask bit is set and the corresponding index is out-of-bounds for the\n given base, the behavior is undefined. If a mask bit is not set, no value\n is stored regardless of the index, and the index is allowed to be\n out-of-bounds.\n\n The compress store can be used directly where applicable, or can be used\n during progressively lowering to bring other memory operations closer to\n hardware ISA support for a compress. The semantics of the operation closely\n correspond to those of the `llvm.masked.compressstore`\n [intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-compressstore-intrinsics).\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n store operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.\n\n Note, at the moment this Op is only available for fixed-width vectors.\n\n Examples:\n\n ```mlir\n vector.compressstore %base[%i], %mask, %value\n : memref, vector<8xi1>, vector<8xf32>\n\n vector.compressstore %base[%i, %j], %mask, %value\n : memref, vector<16xi1>, vector<16xf32>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "mask", "type": "FixedVectorOfNonZeroRankOf<[I1]>" }, { "name": "valueToStore", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $indices `]` `,` $mask `,` $valueToStore attr-dict `:` type($base) `,` type($mask) `,` type($valueToStore)" }, { "name": "vector.constant_mask", "summary": "creates a constant vector mask", "description": "Creates and returns a vector mask where elements of the result vector\n are set to '0' or '1', based on whether the element indices are contained\n within a hyper-rectangular region specified by the 'mask_dim_sizes'\n array attribute argument. Each element of the 'mask_dim_sizes' array,\n specifies an exclusive upper bound [0, mask-dim-size-element-value)\n for a unique dimension in the vector result. The conjunction of the ranges\n define a hyper-rectangular region within which elements values are set to 1\n (otherwise element values are set to 0). Each value of 'mask_dim_sizes' must\n be non-negative and not greater than the size of the corresponding vector\n dimension (as opposed to vector.create_mask which allows this). Sizes that\n correspond to scalable dimensions are implicitly multiplied by vscale,\n though currently only zero (none set) or the size of the dim/vscale\n (all set) are supported.\n\n Example:\n\n ```mlir\n // create a constant vector mask of size 4x3xi1 with elements in range\n // 0 <= row <= 2 and 0 <= col <= 1 are set to 1 (others to 0).\n %1 = vector.constant_mask [3, 2] : vector<4x3xi1>\n\n print %1\n columns\n 0 1 2\n |------------\n 0 | 1 1 0\n rows 1 | 1 1 0\n 2 | 1 1 0\n 3 | 0 0 0\n ```", "results": [ { "name": "result", "type": "VectorOfAnyRankOf<[I1]>" } ], "attributes": [ { "name": "mask_dim_sizes", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$mask_dim_sizes attr-dict `:` type(results)" }, { "name": "vector.contract", "summary": "vector contraction operation", "description": "Computes the sum of products of vector elements along contracting\n dimension pairs from 2 vectors of rank M and N respectively, adds this\n intermediate result to the accumulator argument of rank K, and returns a\n vector result of rank K (where K = num_lhs_free_dims + num_rhs_free_dims +\n num_batch_dims (see dimension type descriptions below)). For K = 0 (no\n free or batch dimensions), the accumulator and output are a scalar.\n\n If operands and the result have types of different bitwidths, operands are\n promoted to have the same bitwidth as the result before performing the\n contraction. For integer types, only signless integer types are supported,\n and the promotion happens via sign extension.\n\n An iterator type attribute list must be specified, where each element of\n the list represents an iterator with one of the following types:\n\n * \"reduction\": reduction dimensions are present in the lhs and rhs\n arguments but not in the output (and accumulator\n argument). These are the dimensions along which the vector\n contraction op computes the sum of products, and\n contracting dimension pair dimension sizes must match\n between lhs/rhs.\n\n * \"parallel\": Batch dimensions are iterator type \"parallel\", and\n are non-contracting dimensions present in the lhs, rhs and\n output. The lhs/rhs co-iterate along the batch dimensions,\n which should be expressed in their indexing maps.\n\n Free dimensions are iterator type \"parallel\", and are\n non-contraction, non-batch dimensions accessed by either the\n lhs or rhs (but not both). The lhs and rhs free dimensions\n are unrelated to each other and do not co-iterate, which\n should be expressed in their indexing maps.\n\n An indexing map attribute list must be specified with an entry for lhs, rhs\n and acc arguments. An indexing map attribute specifies a mapping from each\n iterator in the iterator type list, to each dimension of an N-D vector.\n\n An optional kind attribute may be used to specify the combining function\n between the intermediate result and accumulator argument of rank K. This\n attribute can take the values `add`/`mul`/`minsi`/`minui`/`maxsi`/`maxui`\n /`and`/`or`/`xor` for integers, and `add`/`mul`/`minnumf`/`maxnumf`\n /`minimumf`/`maximumf` for floats. The default is `add`.\n\n Example:\n\n ```mlir\n // Simple DOT product (K = 0).\n #contraction_accesses = [\n affine_map<(i) -> (i)>,\n affine_map<(i) -> (i)>,\n affine_map<(i) -> ()>\n ]\n #contraction_trait = {\n indexing_maps = #contraction_accesses,\n iterator_types = [\"reduction\"]\n }\n %3 = vector.contract #contraction_trait %0, %1, %2\n : vector<10xf32>, vector<10xf32> into f32\n\n // 2D vector contraction with one contracting dimension (matmul, K = 2).\n #contraction_accesses = [\n affine_map<(i, j, k) -> (i, k)>,\n affine_map<(i, j, k) -> (k, j)>,\n affine_map<(i, j, k) -> (i, j)>\n ]\n #contraction_trait = {\n indexing_maps = #contraction_accesses,\n iterator_types = [\"parallel\", \"parallel\", \"reduction\"]\n }\n\n %3 = vector.contract #contraction_trait %0, %1, %2\n : vector<4x3xf32>, vector<3x7xf32> into vector<4x7xf32>\n\n // 4D to 3D vector contraction with two contracting dimensions and\n // one batch dimension (K = 3).\n #contraction_accesses = [\n affine_map<(b0, f0, f1, c0, c1) -> (c0, b0, c1, f0)>,\n affine_map<(b0, f0, f1, c0, c1) -> (b0, c1, c0, f1)>,\n affine_map<(b0, f0, f1, c0, c1) -> (b0, f0, f1)>\n ]\n #contraction_trait = {\n indexing_maps = #contraction_accesses,\n iterator_types = [\"parallel\", \"parallel\", \"parallel\",\n \"reduction\", \"reduction\"]\n }\n\n %4 = vector.contract #contraction_trait %0, %1, %2\n : vector<7x8x16x15xf32>, vector<8x16x7x5xf32> into vector<8x15x5xf32>\n\n // Vector contraction with mixed typed. lhs/rhs have different element\n // types than accumulator/result.\n %5 = vector.contract #contraction_trait %0, %1, %2\n : vector<10xf16>, vector<10xf16> into f32\n\n // Contract with max (K = 0).\n #contraction_accesses = [\n affine_map<(i) -> (i)>,\n affine_map<(i) -> (i)>,\n affine_map<(i) -> ()>\n ]\n #contraction_trait = {\n indexing_maps = #contraction_accesses,\n iterator_types = [\"reduction\"],\n kind = #vector.kind\n }\n %6 = vector.contract #contraction_trait %0, %1, %2\n : vector<10xf32>, vector<10xf32> into f32\n ```", "operands": [ { "name": "lhs", "type": "AnyVectorOfNonZeroRankNonI0Elem" }, { "name": "rhs", "type": "AnyVectorOfNonZeroRankNonI0Elem" }, { "name": "acc", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "indexing_maps", "type": "ArrayAttr" }, { "name": "iterator_types", "type": "TypedArrayAttrBase" }, { "name": "kind", "type": "DefaultValuedAttr" }, { "name": "fastmath", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "vector.create_mask", "summary": "creates a vector mask", "description": "Creates and returns a vector mask where elements of the result vector\n are set to '0' or '1', based on whether the element indices are contained\n within a hyper-rectangular region specified by the operands. Specifically,\n each operand specifies a range [0, operand-value) for a unique dimension in\n the vector result. The conjunction of the operand ranges define a\n hyper-rectangular region within which elements values are set to 1\n (otherwise element values are set to 0). If operand-value is negative, it is\n treated as if it were zero, and if it is greater than the corresponding\n dimension size, it is treated as if it were equal to the dimension size.\n\n Example:\n\n ```mlir\n // create a vector mask of size 4x3xi1 where elements in range\n // 0 <= row <= 2 and 0 <= col <= 1 are set to 1 (others to 0).\n %1 = vector.create_mask %c3, %c2 : vector<4x3xi1>\n\n print %1\n columns\n 0 1 2\n |------------\n 0 | 1 1 0\n rows 1 | 1 1 0\n 2 | 1 1 0\n 3 | 0 0 0\n ```", "operands": [ { "name": "mask_dim_sizes", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VectorOfAnyRankOf<[I1]>" } ], "assemblyFormat": "$mask_dim_sizes attr-dict `:` type(results)" }, { "name": "vector.deinterleave", "summary": "constructs two vectors by deinterleaving an input vector", "description": "The deinterleave operation constructs two vectors from a single input\n vector. The first result vector contains the elements from even indexes\n of the input, and the second contains elements from odd indexes. This is\n the inverse of a `vector.interleave` operation.\n\n Each output's trailing dimension is half of the size of the input\n vector's trailing dimension. This operation requires the input vector\n to have a rank > 0 and an even number of elements in its trailing\n dimension.\n\n The operation supports scalable vectors.\n\n Example:\n ```mlir\n %0, %1 = vector.deinterleave %a\n : vector<8xi8> -> vector<4xi8>\n %2, %3 = vector.deinterleave %b\n : vector<2x8xi8> -> vector<2x4xi8>\n %4, %5 = vector.deinterleave %c\n : vector<2x8x4xi8> -> vector<2x8x2xi8>\n %6, %7 = vector.deinterleave %d\n : vector<[8]xf32> -> vector<[4]xf32>\n %8, %9 = vector.deinterleave %e\n : vector<2x[6]xf64> -> vector<2x[3]xf64>\n %10, %11 = vector.deinterleave %f\n : vector<2x4x[6]xf64> -> vector<2x4x[3]xf64>\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "res1", "type": "AnyVectorOfNonZeroRank" }, { "name": "res2", "type": "AnyVectorOfNonZeroRank" } ], "traits": [ { "type": "TypesMatchWith<'source', 'res1', '[&]() -> ::mlir::VectorType {\n auto vectorType = ::llvm::cast($_self);\n ::mlir::VectorType::Builder builder(vectorType);\n auto lastDim = vectorType.getRank() - 1;\n auto newDimSize = vectorType.getDimSize(lastDim) / 2;;\n if (newDimSize <= 0)\n return vectorType; // (invalid input type)\n return builder.setDim(lastDim, newDimSize);\n }()'>" }, { "type": "AllTypesMatch<['res1', 'res2']>" } ], "assemblyFormat": "$source attr-dict `:` type($source) `->` type($res1)" }, { "name": "vector.expandload", "summary": "reads elements from memory and spreads them into a vector as defined by a mask", "description": "The expand load reads elements from memory into a vector as defined by a\n base with indices and a mask vector. Expansion only applies to the innermost\n dimension. When the mask is set, the next element is read from memory.\n Otherwise, the corresponding element is taken from a pass-through vector.\n Informally the semantics are:\n\n ```\n index = i\n result[0] := if mask[0] then base[index++] else pass_thru[0]\n result[1] := if mask[1] then base[index++] else pass_thru[1]\n etc.\n ```\n\n Note that the index increment is done conditionally.\n\n If a mask bit is set and the corresponding index is out-of-bounds for the\n given base, the behavior is undefined. If a mask bit is not set, the value\n comes from the pass-through vector regardless of the index, and the index is\n allowed to be out-of-bounds.\n\n The expand load can be used directly where applicable, or can be used\n during progressively lowering to bring other memory operations closer to\n hardware ISA support for an expand. The semantics of the operation closely\n correspond to those of the `llvm.masked.expandload`\n [intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-expandload-intrinsics).\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n load operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.\n\n Note, at the moment this Op is only available for fixed-width vectors.\n\n Examples:\n\n ```mlir\n %0 = vector.expandload %base[%i], %mask, %pass_thru\n : memref, vector<8xi1>, vector<8xf32> into vector<8xf32>\n\n %1 = vector.expandload %base[%i, %j], %mask, %pass_thru\n : memref, vector<16xi1>, vector<16xf32> into vector<16xf32>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "mask", "type": "FixedVectorOfNonZeroRankOf<[I1]>" }, { "name": "pass_thru", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $indices `]` `,` $mask `,` $pass_thru attr-dict `:` type($base) `,` type($mask) `,` type($pass_thru) `into` type($result)" }, { "name": "vector.extract", "summary": "extract operation", "description": "Extracts an (n − k)-D result sub-vector from an n-D source vector at a\n specified k-D position. When n = k, the result degenerates to a scalar\n element.\n\n Static and dynamic indices must be greater or equal to zero and less than\n the size of the corresponding dimension. The result is undefined if any\n index is out-of-bounds. The value `-1` represents a poison index, which\n specifies that the extracted element is poison.\n\n Example:\n\n ```mlir\n %1 = vector.extract %0[3]: vector<8x16xf32> from vector<4x8x16xf32>\n %2 = vector.extract %0[2, 1, 3]: f32 from vector<4x8x16xf32>\n %4 = vector.extract %0[%a, %b, %c]: f32 from vector<4x8x16xf32>\n %5 = vector.extract %0[2, %b]: vector<16xf32> from vector<4x8x16xf32>\n %6 = vector.extract %10[-1, %c]: f32 from vector<4x16xf32>\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfAnyRank" }, { "name": "dynamic_position", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "attributes": [ { "name": "static_position", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$source ``\n custom($dynamic_position, $static_position)\n attr-dict `:` type($result) `from` type($source)" }, { "name": "vector.extract_strided_slice", "summary": "extract_strided_slice operation", "description": "Takes an n-D vector, k-D `offsets` integer array attribute, a k-sized\n `sizes` integer array attribute, a k-sized `strides` integer array\n attribute and extracts the n-D subvector at the proper offset.\n\n At the moment strides must contain only 1s.\n\n Returns an n-D vector where the first k-D dimensions match the `sizes`\n attribute. The returned subvector contains the elements starting at offset\n `offsets` and ending at `offsets + sizes`.\n\n Example:\n\n ```mlir\n %1 = vector.extract_strided_slice %0\n {offsets = [0, 2], sizes = [2, 4], strides = [1, 1]}:\n vector<4x8x16xf32> to vector<2x4x16xf32>\n\n // TODO: Evolve to a range form syntax similar to:\n %1 = vector.extract_strided_slice %0[0:2:1][2:4:1]\n vector<4x8x16xf32> to vector<2x4x16xf32>\n ```\n\n TODO: Implement support for poison indices.", "operands": [ { "name": "source", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "offsets", "type": "TypedArrayAttrBase" }, { "name": "sizes", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type(results)" }, { "name": "vector.fma", "summary": "vector fused multiply-add", "description": "Multiply-add expressions operate on n-D vectors and compute a fused\n pointwise multiply-and-accumulate: `$result = $lhs * $rhs + $acc`.\n All operands and result have the same vector type. The semantics\n of the operation correspond to those of the `llvm.fma`\n [intrinsic](https://llvm.org/docs/LangRef.html#int-fma). In the\n particular case of lowering to LLVM, this is guaranteed to lower\n to the `llvm.fma.*` intrinsic.\n\n Example:\n\n ```mlir\n %3 = vector.fma %0, %1, %2: vector<8x16xf32>\n ```", "operands": [ { "name": "lhs", "type": "VectorOfAnyRankOf<[AnyFloat]>" }, { "name": "rhs", "type": "VectorOfAnyRankOf<[AnyFloat]>" }, { "name": "acc", "type": "VectorOfAnyRankOf<[AnyFloat]>" } ], "results": [ { "name": "result", "type": "VectorOfAnyRankOf<[AnyFloat]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'acc', 'result']>" } ], "assemblyFormat": "$lhs `,` $rhs `,` $acc attr-dict `:` type($lhs)" }, { "name": "vector.from_elements", "summary": "operation that defines a vector from scalar elements", "description": "This operation defines a vector from one or multiple scalar elements. The\n scalar elements are arranged in row-major within the vector. The number of\n elements must match the number of elements in the result type. All elements\n must have the same type, which must match the element type of the result\n vector type. Scalable vectors are not supported.\n\n Examples:\n\n ```mlir\n // Define a 0-D vector.\n %0 = vector.from_elements %f1 : vector\n // [%f1]\n\n // Define a 1-D vector.\n %1 = vector.from_elements %f1, %f2 : vector<2xf32>\n // [%f1, %f2]\n\n // Define a 2-D vector.\n %2 = vector.from_elements %f1, %f2, %f3, %f4, %f5, %f6 : vector<2x3xf32>\n // [[%f1, %f2, %f3], [%f4, %f5, %f6]]\n\n // Define a 3-D vector.\n %3 = vector.from_elements %f1, %f2, %f3, %f4, %f5, %f6 : vector<3x1x2xf32>\n // [[[%f1, %f2]], [[%f3, %f4]], [[%f5, %f6]]]\n ```", "operands": [ { "name": "elements", "type": "Variadic" } ], "results": [ { "name": "dest", "type": "AnyFixedVectorOfAnyRank" } ], "assemblyFormat": "$elements attr-dict `:` type($dest)" }, { "name": "vector.gather", "category": "Tensor", "summary": "Gathers elements from memory or ranked tensor into a vector as defined by an\n index vector and a mask vector.", "description": "The gather operation returns an n-D vector whose elements are either loaded\n from a k-D memref or tensor, or taken from an n-D pass-through vector, depending\n on the values of an n-D mask vector.\n\n If a mask bit is set, the corresponding result element is taken from `base`\n at an index defined by k indices and n-D `index_vec`. Otherwise, the element\n is taken from the pass-through vector. As an example, suppose that `base` is\n 3-D and the result is 2-D:\n\n ```mlir\n func.func @gather_3D_to_2D(\n %base: memref, %ofs_0: index, %ofs_1: index, %ofs_2: index,\n %indices: vector<2x3xi32>, %mask: vector<2x3xi1>,\n %fall_thru: vector<2x3xf32>) -> vector<2x3xf32> {\n %result = vector.gather %base[%ofs_0, %ofs_1, %ofs_2]\n [%indices], %mask, %fall_thru : [...]\n return %result : vector<2x3xf32>\n }\n ```\n\n The indexing semantics are then,\n\n ```\n result[i,j] := if mask[i,j] then base[i0, i1, i2 + indices[i,j]]\n else pass_thru[i,j]\n ```\n The index into `base` only varies in the innermost ((k-1)-th) dimension.\n\n If a mask bit is set and the corresponding index is out-of-bounds for the\n given base, the behavior is undefined. If a mask bit is not set, the value\n comes from the pass-through vector regardless of the index, and the index is\n allowed to be out-of-bounds.\n\n The gather operation can be used directly where applicable, or can be used\n during progressively lowering to bring other memory operations closer to\n hardware ISA support for a gather.\n\n The memref must have non-negative strides. Negative strides are not supported\n and will trigger a verification error.\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n gather operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.\n\n Examples:\n\n ```mlir\n // 1-D memref gathered to 2-D vector.\n %0 = vector.gather %base[%c0][%v], %mask, %pass_thru\n : memref, vector<2x16xi32>, vector<2x16xi1>, vector<2x16xf32> into vector<2x16xf32>\n\n // 2-D memref gathered to 1-D vector.\n %1 = vector.gather %base[%i, %j][%v], %mask, %pass_thru\n : memref<16x16xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32> into vector<16xf32>\n ```", "operands": [ { "name": "base", "type": "TensorOrMemRef<[ AnyType ]>" }, { "name": "offsets", "type": "Variadic" }, { "name": "indices", "type": "VectorOfNonZeroRankOf<[AnyInteger, Index]>" }, { "name": "mask", "type": "VectorOfNonZeroRankOf<[I1]>" }, { "name": "pass_thru", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $offsets `]` `[` $indices `]` `,` $mask `,` $pass_thru attr-dict `:` type($base) `,` type($indices) `,` type($mask) `,` type($pass_thru) `into` type($result)" }, { "name": "vector.insert", "summary": "insert operation", "description": "Inserts an (n - k)-D sub-vector (value-to-store) into an n-D destination\n vector at a specified k-D position. When n = 0, value-to-store degenerates\n to a scalar element inserted into the n-D destination vector.\n\n Static and dynamic indices must be greater or equal to zero and less than\n the size of the corresponding dimension. The result is undefined if any\n index is out-of-bounds. The value `-1` represents a poison index, which\n specifies that the resulting vector is poison.\n\n Example:\n\n ```mlir\n %2 = vector.insert %0, %1[3] : vector<8x16xf32> into vector<4x8x16xf32>\n %5 = vector.insert %3, %4[2, 1, 3] : f32 into vector<4x8x16xf32>\n %11 = vector.insert %9, %10[%a, %b, %c] : f32 into vector<4x8x16xf32>\n %12 = vector.insert %4, %10[2, %b] : vector<16xf32> into vector<4x8x16xf32>\n %13 = vector.insert %20, %1[-1, %c] : f32 into vector<4x16xf32>\n ```", "operands": [ { "name": "valueToStore", "type": "AnyType" }, { "name": "dest", "type": "AnyVectorOfAnyRank" }, { "name": "dynamic_position", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyVectorOfAnyRank" } ], "attributes": [ { "name": "static_position", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['dest', 'result']>" } ], "assemblyFormat": "$valueToStore `,` $dest custom($dynamic_position, $static_position)\n attr-dict `:` type($valueToStore) `into` type($dest)" }, { "name": "vector.insert_strided_slice", "summary": "strided_slice operation", "description": "Takes a k-D valueToStore vector, an n-D destination vector (n >= k), n-sized\n `offsets` integer array attribute, a k-sized `strides` integer array attribute\n and inserts the k-D valueToStore vector as a strided subvector at the proper offset\n into the n-D destination vector.\n\n At the moment strides must contain only 1s.\n\n Returns an n-D vector that is a copy of the n-D destination vector in which\n the last k-D dimensions contain the k-D valueToStore vector elements strided at\n the proper location as specified by the offsets.\n\n Example:\n\n ```mlir\n %2 = vector.insert_strided_slice %0, %1\n {offsets = [0, 0, 2], strides = [1, 1]}:\n vector<2x4xf32> into vector<16x4x8xf32>\n ```", "operands": [ { "name": "valueToStore", "type": "AnyVectorOfNonZeroRank" }, { "name": "dest", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "offsets", "type": "TypedArrayAttrBase" }, { "name": "strides", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AllTypesMatch<['dest', 'result']>" } ], "assemblyFormat": "$valueToStore `,` $dest attr-dict `:` type($valueToStore) `into` type($dest)" }, { "name": "vector.interleave", "summary": "constructs a vector by interleaving two input vectors", "description": "The interleave operation constructs a new vector by interleaving the\n elements from the trailing (or final) dimension of two input vectors,\n returning a new vector where the trailing dimension is twice the size.\n\n Note that for the n-D case this differs from the interleaving possible with\n `vector.shuffle`, which would only operate on the leading dimension.\n\n Another key difference is this operation supports scalable vectors, though\n currently a general LLVM lowering is limited to the case where only the\n trailing dimension is scalable.\n\n Example:\n ```mlir\n %a = arith.constant dense<[0, 1]> : vector<2xi32>\n %b = arith.constant dense<[2, 3]> : vector<2xi32>\n // The value of `%0` is `[0, 2, 1, 3]`.\n %0 = vector.interleave %a, %b : vector<2xi32> -> vector<4xi32>\n\n // Examples showing allowed input and result types.\n %1 = vector.interleave %c, %d : vector -> vector<2xf16>\n %2 = vector.interleave %e, %f : vector<6x3xf32> -> vector<6x6xf32>\n %3 = vector.interleave %g, %h : vector<[4]xi32> -> vector<[8]xi32>\n %4 = vector.interleave %i, %j : vector<2x4x[2]xf64> -> vector<2x4x[4]xf64>\n ```", "operands": [ { "name": "lhs", "type": "AnyVectorOfAnyRank" }, { "name": "rhs", "type": "AnyVectorOfAnyRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs attr-dict `:` type($lhs) `->` type($result)" }, { "name": "vector.load", "summary": "reads an n-D slice of memory into an n-D vector", "description": "The 'vector.load' operation reads an n-D slice of memory into an n-D\n vector. It takes a 'base' memref, an index for each memref dimension and a\n result vector type as arguments. It returns a value of the result vector\n type. The 'base' memref and indices determine the start memory address from\n which to read. Each index provides an offset for each memref dimension\n based on the element type of the memref. The shape of the result vector\n type determines the shape of the slice read from the start memory address.\n The elements along each dimension of the slice are strided by the memref\n strides. When loading more than 1 element, only unit strides are allowed\n along the most minor memref dimension. These constraints guarantee that\n elements read along the first dimension of the slice are contiguous in\n memory.\n\n The memref element type can be a scalar or a vector type. If the memref\n element type is a scalar, it should match the element type of the result\n vector. If the memref element type is vector, it should match the result\n vector type.\n\n Example: 0-D vector load on a scalar memref.\n ```mlir\n %result = vector.load %base[%i, %j] : memref<100x100xf32>, vector\n ```\n\n Example: 1-D vector load on a scalar memref.\n ```mlir\n %result = vector.load %base[%i, %j] : memref<100x100xf32>, vector<8xf32>\n ```\n\n Example: 1-D vector load on a vector memref.\n ```mlir\n %result = vector.load %memref[%i, %j] : memref<200x100xvector<8xf32>>, vector<8xf32>\n ```\n\n Example: 2-D vector load on a scalar memref.\n ```mlir\n %result = vector.load %memref[%i, %j] : memref<200x100xf32>, vector<4x8xf32>\n ```\n\n Example: 2-D vector load on a vector memref.\n ```mlir\n %result = vector.load %memref[%i, %j] : memref<200x100xvector<4x8xf32>>, vector<4x8xf32>\n ```\n\n The memref must have non-negative strides. Negative strides are not supported\n and will trigger a verification error.\n\n Representation-wise, the 'vector.load' operation permits out-of-bounds\n reads. Support and implementation of out-of-bounds vector loads is\n target-specific. No assumptions should be made on the value of elements\n loaded out of bounds. Not all targets may support out-of-bounds vector\n loads.\n\n Example: Potential out-of-bound vector load.\n ```mlir\n %result = vector.load %memref[%index] : memref, vector<8xf32>\n ```\n\n Example: Explicit out-of-bound vector load.\n ```mlir\n %result = vector.load %memref[%c0] : memref<7xf32>, vector<8xf32>\n ```\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n load operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyVectorOfAnyRank" } ], "attributes": [ { "name": "nontemporal", "type": "DefaultValuedOptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $indices `]` attr-dict `:` type($base) `,` type($result)" }, { "name": "vector.mask", "summary": "Predicates a maskable vector operation", "description": "The `vector.mask` is a `MaskingOpInterface` operation that predicates the\n execution of another operation. It takes an `i1` vector mask and an\n optional passthru vector as arguments.\n\n A implicitly `vector.yield`-terminated region encloses the operation to be\n masked. Values used within the region are captured from above. Only one\n *maskable* operation can be masked with a `vector.mask` operation at a time.\n An operation is *maskable* if it implements the `MaskableOpInterface`. The\n terminator yields all results from the maskable operation to the result of\n this operation. No other values are allowed to be yielded.\n\n An empty `vector.mask` operation is currently legal to enable optimizations\n across the `vector.mask` region. However, this might change in the future\n once vector transformations gain better support for `vector.mask`.\n TODO: Consider making empty `vector.mask` illegal.\n\n The vector mask argument holds a bit for each vector lane and determines\n which vector lanes should execute the maskable operation and which ones\n should not. The `vector.mask` operation returns the value produced by the\n masked execution of the nested operation, if any. The masked-off lanes in\n the result vector are taken from the corresponding lanes of the pass-thru\n argument, if provided, or left unmodified, otherwise. At this point, 0-D\n vectors are not supported by `vector.mask`. They may be supported in the\n future.\n\n The `vector.mask` operation does not prescribe how a maskable operation\n should be masked or how a masked operation should be lowered. Masking\n constraints and some semantic details are provided by each maskable\n operation through the `MaskableOpInterface`. Lowering of masked operations\n is implementation defined. For instance, scalarizing the masked operation\n or executing the operation for the masked-off lanes are valid lowerings as\n long as the execution of masked-off lanes does not change the observable\n behavior of the program.\n\n Examples:\n\n ```\n %0 = vector.mask %mask { vector.reduction , %a : vector<8xi32> into i32 } : vector<8xi1> -> i32\n ```\n\n ```\n %0 = vector.mask %mask, %passthru { arith.divsi %a, %b : vector<8xi32> } : vector<8xi1> -> vector<8xi32>\n ```\n\n ```\n vector.mask %mask { vector.transfer_write %val, %t0[%idx] : vector<16xf32>, memref } : vector<16xi1>\n ```\n\n ```\n vector.mask %mask { vector.transfer_write %val, %t0[%idx] : vector<16xf32>, tensor } : vector<16xi1> -> tensor\n ```", "operands": [ { "name": "mask", "type": "VectorOfNonZeroRankOf<[I1]>" }, { "name": "passthru", "type": "Optional" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "maskRegion", "type": "SizedRegion<1>" } ], "hasCustomAssemblyFormat": true }, { "name": "vector.maskedload", "summary": "loads elements from memory into a vector as defined by a mask vector", "description": "The masked load reads elements from memory into a vector as defined\n by a base with indices and a mask vector. When the mask is set, the\n element is read from memory. Otherwise, the corresponding element is taken\n from a pass-through vector. Informally the semantics are:\n ```\n result[0] := if mask[0] then base[i + 0] else pass_thru[0]\n result[1] := if mask[1] then base[i + 1] else pass_thru[1]\n etc.\n ```\n\n If a mask bit is set and the corresponding index is out-of-bounds for the\n given base, the behavior is undefined. If a mask bit is not set, the value\n comes from the pass-through vector regardless of the index, and the index is\n allowed to be out-of-bounds.\n\n The masked load can be used directly where applicable, or can be used\n during progressively lowering to bring other memory operations closer to\n hardware ISA support for a masked load. The semantics of the operation\n closely correspond to those of the `llvm.masked.load`\n [intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-load-intrinsics).\n\n Examples:\n\n ```mlir\n %0 = vector.maskedload %base[%i], %mask, %pass_thru\n : memref, vector<8xi1>, vector<8xf32> into vector<8xf32>\n\n %1 = vector.maskedload %base[%i, %j], %mask, %pass_thru\n : memref, vector<16xi1>, vector<16xf32> into vector<16xf32>\n ```\n\n The memref must have non-negative strides. Negative strides are not supported\n and will trigger a verification error.\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n load operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "mask", "type": "VectorOfNonZeroRankOf<[I1]>" }, { "name": "pass_thru", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $indices `]` `,` $mask `,` $pass_thru attr-dict `:` type($base) `,` type($mask) `,` type($pass_thru) `into` type($result)" }, { "name": "vector.maskedstore", "summary": "stores elements from a vector into memory as defined by a mask vector", "description": "The masked store operation writes elements from a vector into memory\n as defined by a base with indices and a mask vector. When the mask is\n set, the corresponding element from the vector is written to memory. Otherwise,\n no action is taken for the element. Informally the semantics are:\n ```\n if (mask[0]) base[i+0] = value[0]\n if (mask[1]) base[i+1] = value[1]\n etc.\n ```\n\n If a mask bit is set and the corresponding index is out-of-bounds for the\n given base, the behavior is undefined. If a mask bit is not set, no value\n is stored regardless of the index, and the index is allowed to be\n out-of-bounds.\n\n The masked store can be used directly where applicable, or can be used\n during progressively lowering to bring other memory operations closer to\n hardware ISA support for a masked store. The semantics of the operation\n closely correspond to those of the `llvm.masked.store`\n [intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-store-intrinsics).\n\n Examples:\n\n ```mlir\n vector.maskedstore %base[%i], %mask, %value\n : memref, vector<8xi1>, vector<8xf32>\n\n vector.maskedstore %base[%i, %j], %mask, %value\n : memref, vector<16xi1>, vector<16xf32>\n ```\n\n The memref must have non-negative strides. Negative strides are not supported\n and will trigger a verification error.\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n store operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "mask", "type": "VectorOfNonZeroRankOf<[I1]>" }, { "name": "valueToStore", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $indices `]` `,` $mask `,` $valueToStore attr-dict `:` type($base) `,` type($mask) `,` type($valueToStore)" }, { "name": "vector.multi_reduction", "summary": "Multi-dimensional reduction operation", "description": "Reduces an n-D vector into an (n-k)-D vector (or a scalar when k == n)\n using the given operation: `add`/`mul`/`minsi`/`minui`/`maxsi`/`maxui`\n /`and`/`or`/`xor` for integers, and `add`/`mul`/`minnumf`/`maxnumf`/`minimumf`\n /`maximumf` for floats.\n Takes an initial accumulator operand.\n\n Example:\n\n ```mlir\n %1 = vector.multi_reduction , %0, %acc0 [1, 3] :\n vector<4x8x16x32xf32> to vector<4x16xf32>\n %2 = vector.multi_reduction , %1, %acc1 [0, 1] :\n vector<4x16xf32> to f32\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfNonZeroRankNonI0Elem" }, { "name": "acc", "type": "AnyType" } ], "results": [ { "name": "dest", "type": "AnyType" } ], "attributes": [ { "name": "kind", "type": "Vector_CombiningKindAttr{add|mul|minui|minsi|minnumf|maxui|maxsi|maxnumf|and|or|xor|maximumf|minimumf}" }, { "name": "reduction_dims", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['dest', 'acc']>" } ], "assemblyFormat": "$kind `,` $source `,` $acc attr-dict $reduction_dims `:` type($source) `to` type($dest)" }, { "name": "vector.outerproduct", "summary": "vector outerproduct with optional fused add", "description": "Takes 2 1-D vectors and returns the 2-D vector containing the outer-product,\n as illustrated below:\n ```\n outer | [c, d]\n ------+------------\n [a, | [ [a*c, a*d],\n b] | [b*c, b*d] ]\n ```\n This operation also accepts a 1-D vector lhs and a scalar rhs. In this\n case a simple AXPY operation is performed, which returns a 1-D vector.\n ```\n [a, b] * c = [a*c, b*c]\n ```\n\n An optional extra vector argument with the same shape as the output\n vector may be specified in which case the operation returns the sum of\n the outer-product and the extra vector. In this multiply-accumulate\n scenario for floating-point arguments, the rounding mode is enforced\n by guaranteeing that a fused-multiply add operation is emitted. When\n lowered to the LLVMIR dialect, this form emits `llvm.intr.fma`, which\n is guaranteed to lower to actual `fma` instructions on x86.\n\n An optional kind attribute may be specified to be: `add`/`mul`/`minsi`\n /`minui`/`maxsi`/`maxui`/`and`/`or`/`xor` for integers, and `add`/`mul`\n /`minnumf`/`maxnumf`/`minimumf`/`maximumf` for floats. The default is\n `add`.\n\n Example:\n\n ```\n %2 = vector.outerproduct %0, %1: vector<4xf32>, vector<8xf32>\n return %2: vector<4x8xf32>\n\n %3 = vector.outerproduct %0, %1, %2:\n vector<4xf32>, vector<8xf32>, vector<4x8xf32>\n return %3: vector<4x8xf32>\n\n %4 = vector.outerproduct %0, %1, %2 {kind = #vector.kind}:\n vector<4xf32>, vector<8xf32>, vector<4x8xf32>\n return %3: vector<4x8xf32>\n\n %6 = vector.outerproduct %4, %5: vector<10xf32>, f32\n return %6: vector<10xf32>\n\n ```", "operands": [ { "name": "lhs", "type": "AnyVectorOfNonZeroRankNonI0Elem" }, { "name": "rhs", "type": "AnyType" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "AnyVectorOfNonZeroRankNonI0Elem" } ], "attributes": [ { "name": "kind", "type": "DefaultValuedAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "vector.print", "summary": "print operation (for testing and debugging)", "description": "Prints the source vector (or scalar) to stdout in a human-readable format\n (for testing and debugging). No return value.\n\n Example:\n\n ```mlir\n %v = arith.constant dense<0.0> : vector<4xf32>\n vector.print %v : vector<4xf32>\n ```\n\n When lowered to LLVM, the vector print is decomposed into elementary\n printing method calls that at runtime will yield:\n\n ```\n ( 0.0, 0.0, 0.0, 0.0 )\n ```\n\n This is printed to stdout via a small runtime support library, which only\n needs to provide a few printing methods (single value for all data\n types, opening/closing bracket, comma, newline).\n\n By default `vector.print` adds a newline after the vector, but this can be\n controlled by the `punctuation` attribute. For example, to print a comma\n after instead do:\n\n ```mlir\n vector.print %v : vector<4xf32> punctuation \n ```\n\n Note that it is possible to use the punctuation attribute alone. The\n following will print a single newline:\n\n ```mlir\n vector.print punctuation \n ```\n\n Additionally, to aid with debugging and testing `vector.print` can also\n print constant strings:\n\n ```mlir\n vector.print str \"Hello, World!\"\n ```", "operands": [ { "name": "source", "type": "Optional>>" } ], "attributes": [ { "name": "punctuation", "type": "DefaultValuedAttr" }, { "name": "stringLiteral", "type": "OptionalAttr" } ], "assemblyFormat": "($source^ `:` type($source))?\n oilist(\n `str` $stringLiteral\n | `punctuation` $punctuation)\n attr-dict" }, { "name": "vector.reduction", "summary": "reduction operation", "description": "Reduces an 1-D vector \"horizontally\" into a scalar using the given\n operation: `add`/`mul`/`minsi`/`minui`/`maxsi`/`maxui`/`and`/`or`/`xor` for\n integers, and `add`/`mul`/`minnumf`/`maxnumf`/`minimumf`/`maximumf` for\n floats. Reductions also allow an optional fused accumulator.\n\n Note that these operations are restricted to 1-D vectors to remain\n close to the corresponding LLVM intrinsics:\n\n http://llvm.org/docs/LangRef.html#vector-reduction-intrinsics\n\n Example:\n\n ```mlir\n %1 = vector.reduction , %0 : vector<16xf32> into f32\n\n %3 = vector.reduction , %2 : vector<4xi32> into i32\n\n %4 = vector.reduction , %0, %1 : vector<16xf32> into f32\n ```", "operands": [ { "name": "vector", "type": "AnyVectorOfNonI0Elem" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "dest", "type": "AnyType" } ], "attributes": [ { "name": "kind", "type": "Vector_CombiningKindAttr{add|mul|minui|minsi|minnumf|maxui|maxsi|maxnumf|and|or|xor|maximumf|minimumf}" }, { "name": "fastmath", "type": "DefaultValuedAttr" } ], "traits": [ { "type": "TypesMatchWith<'dest', 'acc', '::llvm::cast($_self)'>" } ], "assemblyFormat": "$kind `,` $vector (`,` $acc^)? (`fastmath` `` $fastmath^)? attr-dict `:` type($vector) `into` type($dest)" }, { "name": "vector.scalable.extract", "summary": "extract subvector from scalable vector operation", "description": "Takes rank-1 source vector and a position `pos` within the source\n vector, and extracts a subvector starting from that position.\n\n The extraction position must be a multiple of the minimum size of the result\n vector. For the operation to be well defined, the destination vector must\n fit within the source vector from the specified position. Since the source\n vector is scalable and its runtime length is unknown, the validity of the\n operation can't be verified nor guaranteed at compile time.\n\n Example:\n\n ```mlir\n %1 = vector.scalable.extract %0[8] : vector<4xf32> from vector<[8]xf32>\n %3 = vector.scalable.extract %2[0] : vector<[4]xf32> from vector<[8]xf32>\n ```\n\n Invalid example:\n ```mlir\n %1 = vector.scalable.extract %0[5] : vector<4xf32> from vector<[16]xf32>\n ```", "operands": [ { "name": "source", "type": "ScalableVectorOfRank<[1]>" } ], "results": [ { "name": "result", "type": "VectorOfRank<[1]>" } ], "attributes": [ { "name": "pos", "type": "I64Attr" } ], "assemblyFormat": "$source `[` $pos `]` attr-dict `:` type($result) `from` type($source)" }, { "name": "vector.scalable.insert", "summary": "insert subvector into scalable vector operation", "description": "This operations takes a rank-1 fixed-length or scalable subvector and\n inserts it within the destination scalable vector starting from the\n position specificed by `pos`. If the source vector is scalable, the\n insertion position will be scaled by the runtime scaling factor of the\n source subvector.\n\n The insertion position must be a multiple of the minimum size of the source\n vector. For the operation to be well defined, the source vector must fit in\n the destination vector from the specified position. Since the destination\n vector is scalable and its runtime length is unknown, the validity of the\n operation can't be verified nor guaranteed at compile time.\n\n Example:\n\n ```mlir\n %2 = vector.scalable.insert %0, %1[8] : vector<4xf32> into vector<[16]xf32>\n %5 = vector.scalable.insert %3, %4[0] : vector<8xf32> into vector<[4]xf32>\n %8 = vector.scalable.insert %6, %7[0] : vector<[4]xf32> into vector<[8]xf32>\n ```\n\n Invalid example:\n ```mlir\n %2 = vector.scalable.insert %0, %1[5] : vector<4xf32> into vector<[16]xf32>\n ```", "operands": [ { "name": "valueToStore", "type": "VectorOfRank<[1]>" }, { "name": "dest", "type": "ScalableVectorOfRank<[1]>" } ], "results": [ { "name": "result", "type": "ScalableVectorOfRank<[1]>" } ], "attributes": [ { "name": "pos", "type": "I64Attr" } ], "traits": [ { "type": "AllTypesMatch<['dest', 'result']>" } ], "assemblyFormat": "$valueToStore `,` $dest `[` $pos `]` attr-dict `:` type($valueToStore) `into` type($dest)" }, { "name": "vector.scan", "summary": "Scan operation", "description": "Performs an inclusive/exclusive scan on an n-D vector along a single\n dimension returning an n-D result vector using the given\n operation (`add`/`mul`/`minsi`/`minui`/`maxsi`/`maxui`/`and`/`or`/`xor` for\n integers, and `add`/`mul`/`minnumf`/`maxnumf`/`minimumf`/`maximumf` for\n floats), and a specified value for the initial value. The operator returns\n the result of scan as well as the result of the last reduction in the scan.\n\n Example:\n\n ```mlir\n %1:2 = vector.scan , %0, %acc {inclusive = false, reduction_dim = 1 : i64} :\n vector<4x8x16x32xf32>, vector<4x16x32xf32>\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfNonZeroRankNonI0Elem" }, { "name": "initial_value", "type": "AnyVectorOfNonI0Elem" } ], "results": [ { "name": "dest", "type": "AnyVectorOfNonZeroRankNonI0Elem" }, { "name": "accumulated_value", "type": "AnyVectorOfNonI0Elem" } ], "attributes": [ { "name": "kind", "type": "Vector_CombiningKindAttr{add|mul|minui|minsi|minnumf|maxui|maxsi|maxnumf|and|or|xor|maximumf|minimumf}" }, { "name": "reduction_dim", "type": "I64Attr" }, { "name": "inclusive", "type": "BoolAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'dest']>" }, { "type": "AllTypesMatch<['initial_value', 'accumulated_value']>" } ], "assemblyFormat": "$kind `,` $source `,` $initial_value attr-dict `:` type($source) `,` type($initial_value)" }, { "name": "vector.scatter", "category": "Tensor", "summary": "scatters elements from a vector into memory or ranked tensor as defined by an index vector\n and a mask vector", "description": "The scatter operation stores elements from a n-D vector into memory or ranked tensor as\n defined by a base with indices and an additional n-D index vector, but\n only if the corresponding bit in a n-D mask vector is set. Otherwise, no\n action is taken for that element. Informally the semantics are:\n ```\n if (mask[0]) base[index[0]] = value[0]\n if (mask[1]) base[index[1]] = value[1]\n etc.\n ```\n\n If a mask bit is set and the corresponding index is out-of-bounds for the\n given base, the behavior is undefined. If a mask bit is not set, no value\n is stored regardless of the index, and the index is allowed to be\n out-of-bounds.\n\n If the index vector contains two or more duplicate indices, the behavior is\n undefined. Underlying implementation may enforce strict sequential\n semantics.\n TODO: always enforce strict sequential semantics?\n\n The scatter operation can be used directly where applicable, or can be used\n during progressively lowering to bring other memory operations closer to\n hardware ISA support for a scatter. The semantics of the operation closely\n correspond to those of the `llvm.masked.scatter`\n [intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-scatter-intrinsics).\n\n The memref must have non-negative strides. Negative strides are not supported\n and will trigger a verification error.\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n scatter operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.\n\n Examples:\n\n ```mlir\n vector.scatter %base[%c0][%v], %mask, %value\n : memref, vector<16xi32>, vector<16xi1>, vector<16xf32>\n\n vector.scatter %base[%i, %j][%v], %mask, %value\n : memref<16x16xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32>\n ```", "operands": [ { "name": "base", "type": "TensorOrMemRef<[ AnyType ]>" }, { "name": "offsets", "type": "Variadic" }, { "name": "indices", "type": "VectorOfNonZeroRankOf<[AnyInteger, Index]>" }, { "name": "mask", "type": "VectorOfNonZeroRankOf<[I1]>" }, { "name": "valueToStore", "type": "AnyVectorOfNonZeroRank" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$base `[` $offsets `]` `[` $indices `]` `,` $mask `,` $valueToStore attr-dict `:` type($base) `,` type($indices) `,` type($mask) `,` type($valueToStore) (`->` type($result)^)?" }, { "name": "vector.shape_cast", "summary": "shape_cast casts between vector shapes", "description": "Casts to a vector with the same number of elements, element type, and\n number of scalable dimensions.\n\n It is currently assumed that this operation does not require moving data,\n and that it will be folded away before lowering vector operations.\n\n There is an exception to the folding expectation when targeting\n llvm.intr.matrix operations. We need a type conversion back and forth from a\n 2-D MLIR vector to a 1-D flattened LLVM vector.shape_cast lowering to LLVM\n is supported in that particular case, for now.\n\n Examples:\n\n ```mlir\n %1 = vector.shape_cast %0 : vector<4x3xf32> to vector<3x2x2xf32>\n\n // with 2 scalable dimensions (number of which must be preserved).\n %3 = vector.shape_cast %2 : vector<[2]x3x[4]xi8> to vector<3x[1]x[8]xi8>\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfAnyRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfAnyRank" } ], "assemblyFormat": "$source attr-dict `:` type($source) `to` type($result)" }, { "name": "vector.shuffle", "summary": "shuffle operation", "description": "The shuffle operation constructs a permutation (or duplication) of elements\n from two input vectors, returning a vector with the same element type as\n the input and a length that is the same as the shuffle mask. The two input\n vectors must have the same element type, same rank, and trailing dimension\n sizes and shuffles their values in the leading dimension (which may differ\n in size) according to the given mask. The legality rules are:\n * the two operands must have the same element type as the result\n - Either, the two operands and the result must have the same\n rank and trailing dimension sizes, viz. given two k-D operands\n v1 : and\n v2 : \n we have s_i = t_i for all 1 < i <= k\n - Or, the two operands must be 0-D vectors and the result is a 1-D vector.\n * the mask length equals the leading dimension size of the result\n * numbering the input vector indices left to right across the operands, all\n mask values must be within range, viz. given two k-D operands v1 and v2\n above, all mask values are in the range [0,s_1+t_1). The value `-1`\n represents a poison mask value, which specifies that the selected element\n is poison.\n\n Note, scalable vectors are not supported.\n\n Example:\n\n ```mlir\n %0 = vector.shuffle %a, %b[0, 3]\n : vector<2xf32>, vector<2xf32> ; yields vector<2xf32>\n %1 = vector.shuffle %c, %b[0, 1, 2]\n : vector<2x16xf32>, vector<1x16xf32> ; yields vector<3x16xf32>\n %2 = vector.shuffle %a, %b[3, 2, 1, 0]\n : vector<2xf32>, vector<2xf32> ; yields vector<4xf32>\n %3 = vector.shuffle %a, %b[0, 1]\n : vector, vector ; yields vector<2xf32>\n %4 = vector.shuffle %a, %b[0, 4, -1, -1, -1, -1]\n : vector<4xf32>, vector<4xf32> ; yields vector<6xf32>\n ```", "operands": [ { "name": "v1", "type": "AnyFixedVectorOfAnyRank" }, { "name": "v2", "type": "AnyFixedVectorOfAnyRank" } ], "results": [ { "name": "vector", "type": "AnyVectorOfNonZeroRank" } ], "attributes": [ { "name": "mask", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "operands $mask attr-dict `:` type(operands)" }, { "name": "vector.splat", "hasCustomAssemblyFormat": 1 }, { "name": "vector.step", "summary": "A linear sequence of values from 0 to N", "description": "A `step` operation produces a 1-D vector representing a linear sequence from\n 0 to N-1, where N is the number of elements in the `result` vector.\n\n The result element type must be `index` or a signless integer of at least 8\n bits. If the sequence value exceeds the allowed limit for the element type\n then the result for that lane is truncated.\n\n Supports fixed-width and scalable vectors.\n\n Examples:\n\n ```mlir\n %0 = vector.step : vector<4xindex> // [0, 1, 2, 3]\n %1 = vector.step : vector<4xi32> // [0, 1, 2, 3]\n %2 = vector.step : vector<258xi8> // [0, 1, .., 255, 0, 1]\n %3 = vector.step : vector<[4]xindex> // [0, 1, .., ]\n ```", "results": [ { "name": "result", "type": "VectorOfRankAndType<[1], [VectorStepElementType]>" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "vector.store", "summary": "writes an n-D vector to an n-D slice of memory", "description": "The 'vector.store' operation writes an n-D vector to an n-D slice of memory.\n It takes the vector value to be stored, a 'base' memref and an index for\n each memref dimension. The 'base' memref and indices determine the start\n memory address from which to write. Each index provides an offset for each\n memref dimension based on the element type of the memref. The shape of the\n vector value to store determines the shape of the slice written from the\n start memory address. The elements along each dimension of the slice are\n strided by the memref strides. When storing more than 1 element, only unit\n strides are allowed along the most minor memref dimension. These constraints\n guarantee that elements written along the first dimension of the slice are\n contiguous in memory.\n\n The memref element type can be a scalar or a vector type. If the memref\n element type is a scalar, it should match the element type of the value\n to store. If the memref element type is vector, it should match the type\n of the value to store.\n\n Example: 0-D vector store on a scalar memref.\n ```mlir\n vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector\n ```\n\n Example: 1-D vector store on a scalar memref.\n ```mlir\n vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<8xf32>\n ```\n\n Example: 1-D vector store on a vector memref.\n ```mlir\n vector.store %valueToStore, %memref[%i, %j] : memref<200x100xvector<8xf32>>, vector<8xf32>\n ```\n\n Example: 2-D vector store on a scalar memref.\n ```mlir\n vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<4x8xf32>\n ```\n\n Example: 2-D vector store on a vector memref.\n ```mlir\n vector.store %valueToStore, %memref[%i, %j] : memref<200x100xvector<4x8xf32>>, vector<4x8xf32>\n ```\n\n The memref must have non-negative strides. Negative strides are not supported\n and will trigger a verification error.\n\n Representation-wise, the 'vector.store' operation permits out-of-bounds\n writes. Support and implementation of out-of-bounds vector stores are\n target-specific. No assumptions should be made on the memory written out of\n bounds. Not all targets may support out-of-bounds vector stores.\n\n Example: Potential out-of-bounds vector store.\n ```mlir\n vector.store %valueToStore, %memref[%index] : memref, vector<8xf32>\n ```\n\n Example: Explicit out-of-bounds vector store.\n ```mlir\n vector.store %valueToStore, %memref[%c0] : memref<7xf32>, vector<8xf32>\n ```\n\n An optional `alignment` attribute allows to specify the byte alignment of the\n store operation. It must be a positive power of 2. The operation must access\n memory at an address aligned to this boundary. Violating this requirement\n triggers immediate undefined behavior.", "operands": [ { "name": "valueToStore", "type": "AnyVectorOfAnyRank" }, { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "nontemporal", "type": "DefaultValuedOptionalAttr" }, { "name": "alignment", "type": "OptionalAttr>" } ], "assemblyFormat": "$valueToStore `,` $base `[` $indices `]` attr-dict `:` type($base) `,` type($valueToStore)" }, { "name": "vector.to_elements", "summary": "operation that decomposes a vector into all its scalar elements", "description": "This operation decomposes all the scalar elements from a vector. The\n decomposed scalar elements are returned in row-major order. The number of\n scalar results must match the number of elements in the input vector type.\n All the result elements have the same result type, which must match the\n element type of the input vector. Scalable vectors are not supported.\n\n Examples:\n\n ```mlir\n // Decompose a 0-D vector.\n %0 = vector.to_elements %v0 : vector\n // %0 = %v0[0]\n\n // Decompose a 1-D vector.\n %0:2 = vector.to_elements %v1 : vector<2xf32>\n // %0#0 = %v1[0]\n // %0#1 = %v1[1]\n\n // Decompose a 2-D.\n %0:6 = vector.to_elements %v2 : vector<2x3xf32>\n // %0#0 = %v2[0, 0]\n // %0#1 = %v2[0, 1]\n // %0#2 = %v2[0, 2]\n // %0#3 = %v2[1, 0]\n // %0#4 = %v2[1, 1]\n // %0#5 = %v2[1, 2]\n\n // Decompose a 3-D vector.\n %0:6 = vector.to_elements %v3 : vector<3x1x2xf32>\n // %0#0 = %v3[0, 0, 0]\n // %0#1 = %v3[0, 0, 1]\n // %0#2 = %v3[1, 0, 0]\n // %0#3 = %v3[1, 0, 1]\n // %0#4 = %v3[2, 0, 0]\n // %0#5 = %v3[2, 0, 1]\n ```", "operands": [ { "name": "source", "type": "AnyVectorOfAnyRank" } ], "results": [ { "name": "elements", "type": "Variadic" } ], "traits": [ { "type": "InferTypeOpInterface" } ], "assemblyFormat": "$source attr-dict `:` type($source)" }, { "name": "vector.transfer_read", "summary": "Reads a supervector from memory into an SSA vector value.", "description": "The `vector.transfer_read` op performs a read from a slice within a\n [MemRef](../LangRef.md#memref-type) or a Ranked\n [Tensor](../LangRef.md#tensor-type) supplied as its first operand\n into a [vector](../LangRef.md#vector-type) of the same base elemental type.\n\n A memref/tensor operand with vector element type, must have its vector\n element type match a suffix (shape and element type) of the vector (e.g.\n memref<3x2x6x4x3xf32>, vector<1x1x4x3xf32>).\n\n The slice is further defined by a full-rank index within the MemRef/Tensor,\n supplied as the operands `[1 .. 1 + rank(memref/tensor))` that defines the\n starting point of the transfer (e.g. `%A[%i0, %i1, %i2]`).\n\n The permutation_map [attribute](../LangRef.md#attributes) is an\n [affine-map](Affine.md#affine-maps) which specifies the transposition on the\n slice to match the vector shape. The permutation map may be implicit and\n omitted from parsing and printing if it is the canonical minor identity map\n (i.e. if it does not permute or broadcast any dimension).\n\n The size of the slice is specified by the size of the vector, given as the\n return type.\n\n An SSA value `padding` of the same elemental type as the MemRef/Tensor is\n provided to specify a fallback value in the case of out-of-bounds accesses\n and/or masking.\n\n An optional SSA value `mask` may be specified to mask out elements read from\n the MemRef/Tensor. The `mask` type is an `i1` vector with a shape that\n matches how elements are read from the MemRef/Tensor, *before* any\n permutation or broadcasting. Elements whose corresponding mask element is\n `0` are masked out and replaced with `padding`.\n\n For every vector dimension, the boolean array attribute `in_bounds`\n specifies if the transfer is guaranteed to be within the source bounds. If\n set to \"false\", accesses (including the starting point) may run\n out-of-bounds along the respective vector dimension as the index increases.\n Non-vector dimensions *must* always be in-bounds. The `in_bounds` array\n length has to be equal to the vector rank. This attribute has a default\n value: `false` (i.e. \"out-of-bounds\"). When skipped in the textual IR, the\n default value is assumed. Similarly, the OP printer will omit this\n attribute when all dimensions are out-of-bounds (i.e. the default value is\n used).\n\n A `vector.transfer_read` can be lowered to a simple load if all dimensions\n are specified to be within bounds and no `mask` was specified.\n\n This operation is called 'read' by opposition to 'load' because the\n super-vector granularity is generally not representable with a single\n hardware register. A `vector.transfer_read` is thus a mid-level abstraction\n that supports super-vectorization with non-effecting padding for full-tile\n only operations.\n\n More precisely, let's dive deeper into the permutation_map for the following\n MLIR:\n\n ```mlir\n vector.transfer_read %A[%expr1, %expr2, %expr3, %expr4]\n { permutation_map : (d0,d1,d2,d3) -> (d2,0,d0) } :\n memref, vector<3x4x5xf32>\n ```\n\n This operation always reads a slice starting at `%A[%expr1, %expr2, %expr3,\n %expr4]`. The size of the slice can be inferred from the resulting vector\n shape and walking back through the permutation map: 3 along d2 and 5 along\n d0, so the slice is: `%A[%expr1 : %expr1 + 5, %expr2, %expr3:%expr3 + 3, %expr4]`\n\n That slice needs to be read into a `vector<3x4x5xf32>`. Since the\n permutation map is not full rank, there must be a broadcast along vector\n dimension `1`.\n\n A notional lowering of vector.transfer_read could generate code resembling:\n\n ```mlir\n // %expr1, %expr2, %expr3, %expr4 defined before this point\n // alloc a temporary buffer for performing the \"gather\" of the slice.\n %tmp = memref.alloc() : memref>\n for %i = 0 to 3 {\n affine.for %j = 0 to 4 {\n affine.for %k = 0 to 5 {\n // Note that this load does not involve %j.\n %a = load %A[%expr1 + %k, %expr2, %expr3 + %i, %expr4] : memref\n // Update the temporary gathered slice with the individual element\n %slice = memref.load %tmp : memref> -> vector<3x4x5xf32>\n %updated = vector.insert %a, %slice[%i, %j, %k] : f32 into vector<3x4x5xf32>\n memref.store %updated, %tmp : memref>\n }}}\n // At this point we gathered the elements from the original\n // memref into the desired vector layout, stored in the `%tmp` allocation.\n %vec = memref.load %tmp : memref> -> vector<3x4x5xf32>\n ```\n\n On a GPU one could then map `i`, `j`, `k` to blocks and threads. Notice that\n the temporary storage footprint could conceptually be only `3 * 5` values but\n `3 * 4 * 5` values are actually transferred between `%A` and `%tmp`.\n\n Alternatively, if a notional vector broadcast operation were available, we\n could avoid the loop on `%j` and the lowered code would resemble:\n\n ```mlir\n // %expr1, %expr2, %expr3, %expr4 defined before this point\n %tmp = memref.alloc() : memref>\n for %i = 0 to 3 {\n affine.for %k = 0 to 5 {\n %a = load %A[%expr1 + %k, %expr2, %expr3 + %i, %expr4] : memref\n %slice = memref.load %tmp : memref> -> vector<3x4x5xf32>\n // Here we only store to the first element in dimension one\n %updated = vector.insert %a, %slice[%i, 0, %k] : f32 into vector<3x4x5xf32>\n memref.store %updated, %tmp : memref>\n }}\n // At this point we gathered the elements from the original\n // memref into the desired vector layout, stored in the `%tmp` allocation.\n // However we haven't replicated them alongside the first dimension, we need\n // to broadcast now.\n %partialVec = load %tmp : memref> -> vector<3x4x5xf32>\n %vec = broadcast %tmpvec, 1 : vector<3x4x5xf32>\n ```\n\n where `broadcast` broadcasts from element 0 to all others along the\n specified dimension. This time, the number of loaded element is `3 * 5`\n values.\n An additional `1` broadcast is required. On a GPU this broadcast could be\n implemented using a warp-shuffle if loop `j` were mapped to `threadIdx.x`.\n\n Syntax\n ```\n operation ::= ssa-id `=` `vector.transfer_read` ssa-use-list\n `{` attribute-entry `} :` memref-type `,` vector-type\n ```\n\n Example:\n\n ```mlir\n // Read the slice `%A[%i0, %i1:%i1+256, %i2:%i2+32]` into vector<32x256xf32>\n // and pad with %f0 to handle the boundary case:\n %f0 = arith.constant 0.0f : f32\n affine.for %i0 = 0 to %0 {\n affine.for %i1 = 0 to %1 step 256 {\n affine.for %i2 = 0 to %2 step 32 {\n %v = vector.transfer_read %A[%i0, %i1, %i2], (%f0)\n {permutation_map: (d0, d1, d2) -> (d2, d1)} :\n memref, vector<32x256xf32>\n }}}\n\n // or equivalently (rewrite with vector.transpose)\n %f0 = arith.constant 0.0f : f32\n affine.for %i0 = 0 to %0 {\n affine.for %i1 = 0 to %1 step 256 {\n affine.for %i2 = 0 to %2 step 32 {\n %v0 = vector.transfer_read %A[%i0, %i1, %i2], (%f0)\n {permutation_map: (d0, d1, d2) -> (d1, d2)} :\n memref, vector<256x32xf32>\n %v = vector.transpose %v0, [1, 0] :\n vector<256x32xf32> to vector<32x256f32>\n }}}\n\n // Read the slice `%A[%i0, %i1]` (i.e. the element `%A[%i0, %i1]`) into\n // vector<128xf32>. The underlying implementation will require a 1-D vector\n // broadcast:\n affine.for %i0 = 0 to %0 {\n affine.for %i1 = 0 to %1 {\n %3 = vector.transfer_read %A[%i0, %i1]\n {permutation_map: (d0, d1) -> (0)} :\n memref, vector<128xf32>\n }\n }\n\n // Read from a memref with vector element type.\n %4 = vector.transfer_read %arg1[%c3, %c3], %vf0\n {permutation_map = (d0, d1)->(d0, d1)}\n : memref>, vector<1x1x4x3xf32>\n\n // Read from a tensor with vector element type.\n %4 = vector.transfer_read %arg1[%c3, %c3], %vf0\n {permutation_map = (d0, d1)->(d0, d1)}\n : tensor>, vector<1x1x4x3xf32>\n\n // Special encoding for 0-d transfer with 0-d tensor/memref, vector shape\n // {1} and permutation_map () -> (0).\n %0 = vector.transfer_read %arg0[], %f0 {permutation_map = affine_map<()->(0)>} :\n tensor, vector<1xf32>\n ```", "operands": [ { "name": "base", "type": "AnyShaped" }, { "name": "indices", "type": "Variadic" }, { "name": "padding", "type": "AnyType" }, { "name": "mask", "type": "Optional>" } ], "results": [ { "name": "vector", "type": "AnyVectorOfAnyRank" } ], "attributes": [ { "name": "permutation_map", "type": "AffineMapAttr" }, { "name": "in_bounds", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "vector.transfer_write", "summary": "The vector.transfer_write op writes a supervector to memory.", "description": "The `vector.transfer_write` op performs a write from a\n [vector](../LangRef.md#vector-type), supplied as its first operand, into a\n slice within a [MemRef](../LangRef.md#memref-type) or a Ranked\n [Tensor](../LangRef.md#tensor-type) of the same base elemental type,\n supplied as its second operand.\n\n A vector memref/tensor operand must have its vector element type match a\n suffix (shape and element type) of the vector (e.g. memref<3x2x6x4x3xf32>,\n vector<1x1x4x3xf32>). If the operand is a tensor, the operation returns a\n new tensor of the same type.\n\n The slice is further defined by a full-rank index within the MemRef/Tensor,\n supplied as the operands `[2 .. 2 + rank(memref/tensor))` that defines the\n starting point of the transfer (e.g. `%A[%i0, %i1, %i2, %i3]`).\n\n The permutation_map [attribute](../LangRef.md#attributes) is an\n [affine-map](Affine.md#affine-maps) which specifies the transposition on the\n slice to match the vector shape. The permutation map may be implicit and\n omitted from parsing and printing if it is the canonical minor identity map\n (i.e. if it does not permute any dimension). In contrast to `transfer_read`,\n write ops cannot have broadcast dimensions.\n\n The size of the slice is specified by the size of the vector.\n\n An optional SSA value `mask` may be specified to mask out elements written\n to the MemRef/Tensor. The `mask` type is an `i1` vector with a shape that\n matches how elements are written into the MemRef/Tensor, *after* applying\n any permutation. Elements whose corresponding mask element is `0` are\n masked out.\n\n For every vector dimension, the boolean array attribute `in_bounds`\n specifies if the transfer is guaranteed to be within the source bounds. If\n set to \"false\", accesses (including the starting point) may run\n out-of-bounds along the respective vector dimension as the index increases.\n Non-vector dimensions *must* always be in-bounds. The `in_bounds` array\n length has to be equal to the vector rank. This attribute has a default\n value: `false` (i.e. \"out-of-bounds\"). When skipped in the textual IR, the\n default value is assumed. Similarly, the OP printer will omit this\n attribute when all dimensions are out-of-bounds (i.e. the default value is\n used).\n\n A `vector.transfer_write` can be lowered to a simple store if all\n dimensions are specified to be within bounds and no `mask` was specified.\n\n This operation is called 'write' by opposition to 'store' because the\n super-vector granularity is generally not representable with a single\n hardware register. A `vector.transfer_write` is thus a\n mid-level abstraction that supports super-vectorization with non-effecting\n padding for full-tile-only code. It is the responsibility of\n `vector.transfer_write`'s implementation to ensure the memory writes are\n valid. Different lowerings may be pertinent depending on the hardware\n support.\n\n Example:\n\n ```mlir\n // write vector<16x32x64xf32> into the slice\n // `%A[%i0, %i1:%i1+32, %i2:%i2+64, %i3:%i3+16]`:\n for %i0 = 0 to %0 {\n affine.for %i1 = 0 to %1 step 32 {\n affine.for %i2 = 0 to %2 step 64 {\n affine.for %i3 = 0 to %3 step 16 {\n %val = `ssa-value` : vector<16x32x64xf32>\n vector.transfer_write %val, %A[%i0, %i1, %i2, %i3]\n {permutation_map: (d0, d1, d2, d3) -> (d3, d1, d2)} :\n vector<16x32x64xf32>, memref\n }}}}\n\n // or equivalently (rewrite with vector.transpose)\n for %i0 = 0 to %0 {\n affine.for %i1 = 0 to %1 step 32 {\n affine.for %i2 = 0 to %2 step 64 {\n affine.for %i3 = 0 to %3 step 16 {\n %val = `ssa-value` : vector<16x32x64xf32>\n %valt = vector.transpose %val, [1, 2, 0] :\n vector<16x32x64xf32> -> vector<32x64x16xf32>\n vector.transfer_write %valt, %A[%i0, %i1, %i2, %i3]\n {permutation_map: (d0, d1, d2, d3) -> (d1, d2, d3)} :\n vector<32x64x16xf32>, memref\n }}}}\n\n // write to a memref with vector element type.\n vector.transfer_write %4, %arg1[%c3, %c3]\n {permutation_map = (d0, d1)->(d0, d1)}\n : vector<1x1x4x3xf32>, memref>\n\n // return a tensor where the vector is inserted into the source tensor.\n %5 = vector.transfer_write %4, %arg1[%c3, %c3]\n {permutation_map = (d0, d1)->(d0, d1)}\n : vector<1x1x4x3xf32>, tensor>\n\n // Special encoding for 0-d transfer with 0-d tensor/memref, vector shape\n // {1} and permutation_map () -> (0).\n %1 = vector.transfer_write %0, %arg0[] {permutation_map = affine_map<()->(0)>} :\n vector<1xf32>, tensor\n ```", "operands": [ { "name": "valueToStore", "type": "AnyVectorOfAnyRank" }, { "name": "base", "type": "AnyShaped" }, { "name": "indices", "type": "Variadic" }, { "name": "mask", "type": "Optional>" } ], "results": [ { "name": "result", "type": "Optional" } ], "attributes": [ { "name": "permutation_map", "type": "AffineMapAttr" }, { "name": "in_bounds", "type": "TypedArrayAttrBase" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "vector.transpose", "category": "Transform", "summary": "vector transpose operation", "description": "Takes a n-D vector and returns the transposed n-D vector defined by\n the permutation of ranks in the n-sized integer array attribute (in case\n of 0-D vectors the array attribute must be empty).\n\n In the operation\n\n ```mlir\n %1 = vector.transpose %0, [i_1, .., i_n]\n : vector\n to vector\n ```\n\n the `permutation` array [i_1, .., i_n] must be a permutation of [0, .., n-1].\n\n Example:\n\n ```mlir\n %1 = vector.transpose %0, [1, 0] : vector<2x3xf32> to vector<3x2xf32>\n\n [ [a, b, c], [ [a, d],\n [d, e, f] ] -> [b, e],\n [c, f] ]\n ```", "operands": [ { "name": "vector", "type": "AnyVectorOfAnyRank" } ], "results": [ { "name": "result", "type": "AnyVectorOfAnyRank" } ], "attributes": [ { "name": "permutation", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$vector `,` $permutation attr-dict `:` type($vector) `to` type($result)" }, { "name": "vector.type_cast", "summary": "type_cast op converts a scalar memref to a vector memref", "description": "Performs a conversion from a memref with scalar element to a memref with a\n *single* vector element, copying the shape of the memref to the vector. This\n is the minimal viable operation that is required to makeke\n super-vectorization operational. It can be seen as a special case of the\n `view` operation but scoped in the super-vectorization context.\n\n Example:\n\n ```mlir\n %A = memref.alloc() : memref<5x4x3xf32>\n %VA = vector.type_cast %A : memref<5x4x3xf32> to memref>\n ```", "operands": [ { "name": "memref", "type": "StaticShapeMemRefOf<[AnyType]>" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "$memref attr-dict `:` type($memref) `to` type($result)" }, { "name": "vector.vscale", "summary": "Load vector scale size", "description": "The `vscale` op returns the scale of the scalable vectors, a positive\n integer value that is constant at runtime but unknown at compile-time.\n The scale of the vector indicates the multiplicity of the vectors and\n vector operations. For example, a `vector<[4]xi32>` is equivalent to\n `vscale` consecutive `vector<4xi32>`; and an operation on a\n `vector<[4]xi32>` is equivalent to performing that operation `vscale`\n times, once on each `<4xi32>` segment of the scalable vector. The `vscale`\n op can be used to calculate the step in vector-length agnostic (VLA) loops.\n Right now we only support one contiguous set of scalable dimensions, all of\n them grouped and scaled with the value returned by 'vscale'.", "results": [ { "name": "res", "type": "Index" } ], "assemblyFormat": "attr-dict" }, { "name": "vector.yield", "summary": "Terminates and yields values from vector regions.", "description": "\"vector.yield\" yields an SSA value from the Vector dialect op region and\n terminates the regions. The semantics of how the values are yielded is\n defined by the parent operation.\n If \"vector.yield\" has any operands, the operands must correspond to the\n parent operation's results.\n If the parent operation defines no value the vector.yield may be omitted\n when printing the region.", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "vhlo.abs_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.add_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.after_all_v1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.all_gather_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "all_gather_dim", "type": "VHLO_AnyAttr" }, { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "use_global_device_ids", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.all_gather_v2", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "all_gather_dim", "type": "VHLO_AnyAttr" }, { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "use_global_device_ids", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.all_reduce_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "use_global_device_ids", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "computation", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.all_reduce_v2", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "use_global_device_ids", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "computation", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.all_to_all_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "split_dimension", "type": "VHLO_AnyAttr" }, { "name": "concat_dimension", "type": "VHLO_AnyAttr" }, { "name": "split_count", "type": "VHLO_AnyAttr" }, { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.all_to_all_v2", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "split_dimension", "type": "VHLO_AnyAttr" }, { "name": "concat_dimension", "type": "VHLO_AnyAttr" }, { "name": "split_count", "type": "VHLO_AnyAttr" }, { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.and_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.async_done_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.async_start_v1", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "regions": [ { "name": "collective", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.atan2_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.batch_norm_grad_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "scale", "type": "VHLO_AnyType" }, { "name": "mean", "type": "VHLO_AnyType" }, { "name": "variance", "type": "VHLO_AnyType" }, { "name": "grad_output", "type": "VHLO_AnyType" } ], "results": [ { "name": "grad_operand", "type": "VHLO_AnyType" }, { "name": "grad_scale", "type": "VHLO_AnyType" }, { "name": "grad_offset", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "epsilon", "type": "VHLO_AnyAttr" }, { "name": "feature_index", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.batch_norm_inference_v1", "category": "Normalization", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "scale", "type": "VHLO_AnyType" }, { "name": "offset", "type": "VHLO_AnyType" }, { "name": "mean", "type": "VHLO_AnyType" }, { "name": "variance", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "epsilon", "type": "VHLO_AnyAttr" }, { "name": "feature_index", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.batch_norm_training_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "scale", "type": "VHLO_AnyType" }, { "name": "offset", "type": "VHLO_AnyType" } ], "results": [ { "name": "output", "type": "VHLO_AnyType" }, { "name": "batch_mean", "type": "VHLO_AnyType" }, { "name": "batch_var", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "epsilon", "type": "VHLO_AnyAttr" }, { "name": "feature_index", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.bitcast_convert_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.broadcast_in_dim_v1", "category": "Shape", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.broadcast_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "broadcast_sizes", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.call_v1", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.case_v1", "operands": [ { "name": "index", "type": "VHLO_AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "branches", "type": "VariadicRegion" } ] }, { "name": "vhlo.cbrt_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.cbrt_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.ceil_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.cholesky_v1", "operands": [ { "name": "a", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "lower", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.clamp_v1", "category": "Activation", "operands": [ { "name": "min", "type": "VHLO_AnyType" }, { "name": "operand", "type": "VHLO_AnyType" }, { "name": "max", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.collective_broadcast_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.collective_permute_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "source_target_pairs", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.compare_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "comparison_direction", "type": "VHLO_AnyAttr" }, { "name": "compare_type", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.complex_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.composite_v1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "VHLO_AnyAttr" }, { "name": "composite_attributes", "type": "VHLO_AnyAttr" }, { "name": "decomposition", "type": "VHLO_AnyAttr" }, { "name": "version", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.composite_v2", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "VHLO_AnyAttr" }, { "name": "composite_attributes", "type": "VHLO_AnyAttr" }, { "name": "decomposition", "type": "VHLO_AnyAttr" }, { "name": "version", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "composite_regions", "type": "VariadicRegion" } ] }, { "name": "vhlo.concatenate_v1", "category": "Tensor", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "dimension", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.constant_v1", "results": [ { "name": "output", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "value", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.convert_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.convolution_v1", "category": "Layer", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "window_strides", "type": "VHLO_AnyAttr" }, { "name": "padding", "type": "VHLO_AnyAttr" }, { "name": "lhs_dilation", "type": "VHLO_AnyAttr" }, { "name": "rhs_dilation", "type": "VHLO_AnyAttr" }, { "name": "window_reversal", "type": "VHLO_AnyAttr" }, { "name": "input_batch_dimension", "type": "VHLO_AnyAttr" }, { "name": "input_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "input_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "kernel_input_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "kernel_output_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "kernel_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "output_batch_dimension", "type": "VHLO_AnyAttr" }, { "name": "output_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "output_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "feature_group_count", "type": "VHLO_AnyAttr" }, { "name": "batch_group_count", "type": "VHLO_AnyAttr" }, { "name": "precision_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.cosine_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.cosine_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.count_leading_zeros_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.create_token_v1", "results": [ { "name": "output", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.cross-replica-sum_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "replica_groups", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.custom_call_v1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "call_target_name", "type": "VHLO_AnyAttr" }, { "name": "has_side_effect", "type": "VHLO_AnyAttr" }, { "name": "backend_config", "type": "VHLO_AnyAttr" }, { "name": "api_version", "type": "VHLO_AnyAttr" }, { "name": "called_computations", "type": "VHLO_AnyAttr" }, { "name": "operand_layouts", "type": "VHLO_AnyAttr" }, { "name": "result_layouts", "type": "VHLO_AnyAttr" }, { "name": "output_operand_aliases", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.custom_call_v2", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "call_target_name", "type": "VHLO_AnyAttr" }, { "name": "has_side_effect", "type": "VHLO_AnyAttr" }, { "name": "backend_config", "type": "VHLO_AnyAttr" }, { "name": "api_version", "type": "VHLO_AnyAttr" }, { "name": "called_computations", "type": "VHLO_AnyAttr" }, { "name": "operand_layouts", "type": "VHLO_AnyAttr" }, { "name": "result_layouts", "type": "VHLO_AnyAttr" }, { "name": "output_operand_aliases", "type": "VHLO_AnyAttr" }, { "name": "result_tilings", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.divide_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.dot_general_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "lhs_batching_dimensions", "type": "VHLO_AnyAttr" }, { "name": "rhs_batching_dimensions", "type": "VHLO_AnyAttr" }, { "name": "lhs_contracting_dimensions", "type": "VHLO_AnyAttr" }, { "name": "rhs_contracting_dimensions", "type": "VHLO_AnyAttr" }, { "name": "precision_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dot_general_v2", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "lhs_batching_dimensions", "type": "VHLO_AnyAttr" }, { "name": "rhs_batching_dimensions", "type": "VHLO_AnyAttr" }, { "name": "lhs_contracting_dimensions", "type": "VHLO_AnyAttr" }, { "name": "rhs_contracting_dimensions", "type": "VHLO_AnyAttr" }, { "name": "precision_config", "type": "VHLO_AnyAttr" }, { "name": "lhs_precision_type", "type": "VHLO_AnyAttr" }, { "name": "rhs_precision_type", "type": "VHLO_AnyAttr" }, { "name": "accumulation_type", "type": "VHLO_AnyAttr" }, { "name": "lhs_component_count", "type": "VHLO_AnyAttr" }, { "name": "rhs_component_count", "type": "VHLO_AnyAttr" }, { "name": "num_primitive_operations", "type": "VHLO_AnyAttr" }, { "name": "allow_imprecise_accumulation", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dot_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "precision_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_broadcast_in_dim_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "output_dimensions", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "broadcast_dimensions", "type": "VHLO_AnyAttr" }, { "name": "known_expanding_dimensions", "type": "VHLO_AnyAttr" }, { "name": "known_nonexpanding_dimensions", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_conv_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" }, { "name": "d_padding", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "window_strides", "type": "VHLO_AnyAttr" }, { "name": "padding", "type": "VHLO_AnyAttr" }, { "name": "lhs_dilation", "type": "VHLO_AnyAttr" }, { "name": "rhs_dilation", "type": "VHLO_AnyAttr" }, { "name": "window_reversal", "type": "VHLO_AnyAttr" }, { "name": "input_batch_dimension", "type": "VHLO_AnyAttr" }, { "name": "input_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "input_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "kernel_input_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "kernel_output_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "kernel_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "output_batch_dimension", "type": "VHLO_AnyAttr" }, { "name": "output_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "output_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "feature_group_count", "type": "VHLO_AnyAttr" }, { "name": "batch_group_count", "type": "VHLO_AnyAttr" }, { "name": "precision_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_conv_v2", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" }, { "name": "padding", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "window_strides", "type": "VHLO_AnyAttr" }, { "name": "lhs_dilation", "type": "VHLO_AnyAttr" }, { "name": "rhs_dilation", "type": "VHLO_AnyAttr" }, { "name": "window_reversal", "type": "VHLO_AnyAttr" }, { "name": "input_batch_dimension", "type": "VHLO_AnyAttr" }, { "name": "input_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "input_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "kernel_input_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "kernel_output_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "kernel_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "output_batch_dimension", "type": "VHLO_AnyAttr" }, { "name": "output_feature_dimension", "type": "VHLO_AnyAttr" }, { "name": "output_spatial_dimensions", "type": "VHLO_AnyAttr" }, { "name": "feature_group_count", "type": "VHLO_AnyAttr" }, { "name": "batch_group_count", "type": "VHLO_AnyAttr" }, { "name": "precision_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_gather_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "VHLO_AnyType" }, { "name": "slice_sizes", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "offset_dims", "type": "VHLO_AnyAttr" }, { "name": "collapsed_slice_dims", "type": "VHLO_AnyAttr" }, { "name": "start_index_map", "type": "VHLO_AnyAttr" }, { "name": "index_vector_dim", "type": "VHLO_AnyAttr" }, { "name": "indices_are_sorted", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_gather_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "VHLO_AnyType" }, { "name": "slice_sizes", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "offset_dims", "type": "VHLO_AnyAttr" }, { "name": "collapsed_slice_dims", "type": "VHLO_AnyAttr" }, { "name": "operand_batching_dims", "type": "VHLO_AnyAttr" }, { "name": "start_indices_batching_dims", "type": "VHLO_AnyAttr" }, { "name": "start_index_map", "type": "VHLO_AnyAttr" }, { "name": "index_vector_dim", "type": "VHLO_AnyAttr" }, { "name": "indices_are_sorted", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_iota_v1", "operands": [ { "name": "output_shape", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "iota_dimension", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_pad_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "padding_value", "type": "VHLO_AnyType" }, { "name": "edge_padding_low", "type": "VHLO_AnyType" }, { "name": "edge_padding_high", "type": "VHLO_AnyType" }, { "name": "interior_padding", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.dynamic_reshape_v1", "category": "Shape", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "output_shape", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.dynamic_slice_v1", "category": "Tensor", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "slice_sizes", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.dynamic_update_slice_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "update", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.einsum_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "einsum_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.exponential_minus_one_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.exponential_minus_one_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.exponential_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.exponential_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.fft_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "fft_type", "type": "VHLO_AnyAttr" }, { "name": "fft_length", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.floor_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.func_v1", "attributes": [ { "name": "sym_name", "type": "VHLO_AnyAttr" }, { "name": "function_type", "type": "VHLO_AnyAttr" }, { "name": "sym_visibility", "type": "VHLO_AnyAttr" }, { "name": "arg_attrs", "type": "VHLO_AnyAttr" }, { "name": "res_attrs", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "body", "type": "VHLO_AnyRegion" } ], "assemblyFormat": "custom($sym_name, $body, $function_type) attr-dict" }, { "name": "vhlo.gather_v1", "category": "Tensor", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "offset_dims", "type": "VHLO_AnyAttr" }, { "name": "collapsed_slice_dims", "type": "VHLO_AnyAttr" }, { "name": "start_index_map", "type": "VHLO_AnyAttr" }, { "name": "index_vector_dim", "type": "VHLO_AnyAttr" }, { "name": "slice_sizes", "type": "VHLO_AnyAttr" }, { "name": "indices_are_sorted", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.gather_v2", "category": "Tensor", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "offset_dims", "type": "VHLO_AnyAttr" }, { "name": "collapsed_slice_dims", "type": "VHLO_AnyAttr" }, { "name": "operand_batching_dims", "type": "VHLO_AnyAttr" }, { "name": "start_indices_batching_dims", "type": "VHLO_AnyAttr" }, { "name": "start_index_map", "type": "VHLO_AnyAttr" }, { "name": "index_vector_dim", "type": "VHLO_AnyAttr" }, { "name": "slice_sizes", "type": "VHLO_AnyAttr" }, { "name": "indices_are_sorted", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.get_dimension_size_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "dimension", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.get_tuple_element_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "index", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.if_v1", "operands": [ { "name": "pred", "type": "VHLO_AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "true_branch", "type": "VHLO_AnyRegion" }, { "name": "false_branch", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.imag_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.infeed_v1", "operands": [ { "name": "token", "type": "VHLO_AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "infeed_config", "type": "VHLO_AnyAttr" }, { "name": "layout", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.iota_v1", "results": [ { "name": "output", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "iota_dimension", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.is_finite_v1", "operands": [ { "name": "x", "type": "VHLO_AnyType" } ], "results": [ { "name": "y", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.log_plus_one_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.log_plus_one_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.log_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.log_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.logistic_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.logistic_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.map_v1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "dimensions", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "computation", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.maximum_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.minimum_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.multiply_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.negate_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.not_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.optimization_barrier_v1", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ] }, { "name": "vhlo.or_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.outfeed_v1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "outfeed_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.pad_v1", "category": "Transform", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "padding_value", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "edge_padding_low", "type": "VHLO_AnyAttr" }, { "name": "edge_padding_high", "type": "VHLO_AnyAttr" }, { "name": "interior_padding", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.partition_id_v1", "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.popcnt_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.power_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.real_dynamic_slice_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "start_indices", "type": "VHLO_AnyType" }, { "name": "limit_indices", "type": "VHLO_AnyType" }, { "name": "strides", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.real_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.recv_v1", "operands": [ { "name": "token", "type": "VHLO_AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "channel_type", "type": "VHLO_AnyAttr" }, { "name": "is_host_transfer", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.recv_v2", "operands": [ { "name": "token", "type": "VHLO_AnyType" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "channel_type", "type": "VHLO_AnyAttr" }, { "name": "is_host_transfer", "type": "VHLO_AnyAttr" }, { "name": "source_target_pairs", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.reduce_precision_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "output", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "exponent_bits", "type": "VHLO_AnyAttr" }, { "name": "mantissa_bits", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.reduce_scatter_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "scatter_dimension", "type": "VHLO_AnyAttr" }, { "name": "replica_groups", "type": "VHLO_AnyAttr" }, { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "use_global_device_ids", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "computation", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.reduce_v1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimensions", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "body", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.reduce_window_v1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "init_values", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "window_dimensions", "type": "VHLO_AnyAttr" }, { "name": "window_strides", "type": "VHLO_AnyAttr" }, { "name": "base_dilations", "type": "VHLO_AnyAttr" }, { "name": "window_dilations", "type": "VHLO_AnyAttr" }, { "name": "padding", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "body", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.remainder_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.replica_id_v1", "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.reshape_v1", "category": "Shape", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.return_v1", "operands": [ { "name": "results", "type": "Variadic" } ] }, { "name": "vhlo.reverse_v1", "category": "Transform", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "dimensions", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.rng_bit_generator_v1", "operands": [ { "name": "initial_state", "type": "VHLO_AnyType" } ], "results": [ { "name": "output_state", "type": "VHLO_AnyType" }, { "name": "output", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "rng_algorithm", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.rng_v1", "operands": [ { "name": "a", "type": "VHLO_AnyType" }, { "name": "b", "type": "VHLO_AnyType" }, { "name": "shape", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "rng_distribution", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.round_nearest_afz_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.round_nearest_even_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.rsqrt_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.rsqrt_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.scatter_v1", "category": "Tensor", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "scatter_indices", "type": "VHLO_AnyType" }, { "name": "updates", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "update_window_dims", "type": "VHLO_AnyAttr" }, { "name": "inserted_window_dims", "type": "VHLO_AnyAttr" }, { "name": "scatter_dims_to_operand_dims", "type": "VHLO_AnyAttr" }, { "name": "index_vector_dim", "type": "VHLO_AnyAttr" }, { "name": "indices_are_sorted", "type": "VHLO_AnyAttr" }, { "name": "unique_indices", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "update_computation", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.scatter_v2", "category": "Tensor", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "scatter_indices", "type": "VHLO_AnyType" }, { "name": "updates", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "update_window_dims", "type": "VHLO_AnyAttr" }, { "name": "inserted_window_dims", "type": "VHLO_AnyAttr" }, { "name": "input_batching_dims", "type": "VHLO_AnyAttr" }, { "name": "scatter_indices_batching_dims", "type": "VHLO_AnyAttr" }, { "name": "scatter_dims_to_operand_dims", "type": "VHLO_AnyAttr" }, { "name": "index_vector_dim", "type": "VHLO_AnyAttr" }, { "name": "indices_are_sorted", "type": "VHLO_AnyAttr" }, { "name": "unique_indices", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "update_computation", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.select_and_scatter_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "source", "type": "VHLO_AnyType" }, { "name": "init_value", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "window_dimensions", "type": "VHLO_AnyAttr" }, { "name": "window_strides", "type": "VHLO_AnyAttr" }, { "name": "padding", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "select", "type": "VHLO_AnyRegion" }, { "name": "scatter", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.select_v1", "operands": [ { "name": "pred", "type": "VHLO_AnyType" }, { "name": "on_true", "type": "VHLO_AnyType" }, { "name": "on_false", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.send_v1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "channel_type", "type": "VHLO_AnyAttr" }, { "name": "is_host_transfer", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.send_v2", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "token", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "channel_id", "type": "VHLO_AnyAttr" }, { "name": "channel_type", "type": "VHLO_AnyAttr" }, { "name": "is_host_transfer", "type": "VHLO_AnyAttr" }, { "name": "source_target_pairs", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.set_dimension_size_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "size", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "dimension", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.shift_left_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.shift_right_arithmetic_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.shift_right_logical_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.sign_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.sine_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.sine_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.slice_v1", "category": "Tensor", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "start_indices", "type": "VHLO_AnyAttr" }, { "name": "limit_indices", "type": "VHLO_AnyAttr" }, { "name": "strides", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.sort_v1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "VHLO_AnyAttr" }, { "name": "is_stable", "type": "VHLO_AnyAttr" } ], "regions": [ { "name": "comparator", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.sqrt_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.sqrt_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.subtract_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.tan_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.tan_v2", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.tanh_v1", "category": "Activation", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.tanh_v2", "category": "Activation", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "result_accuracy", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.torch_index_select_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" }, { "name": "index", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "dim", "type": "VHLO_AnyAttr" }, { "name": "batch_dims", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.transpose_v1", "category": "Transform", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "permutation", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.triangular_solve_v1", "operands": [ { "name": "a", "type": "VHLO_AnyType" }, { "name": "b", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "left_side", "type": "VHLO_AnyAttr" }, { "name": "lower", "type": "VHLO_AnyAttr" }, { "name": "unit_diagonal", "type": "VHLO_AnyAttr" }, { "name": "transpose_a", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.tuple_v1", "operands": [ { "name": "val", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.unary_einsum_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ], "attributes": [ { "name": "einsum_config", "type": "VHLO_AnyAttr" } ] }, { "name": "vhlo.uniform_dequantize_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.uniform_quantize_v1", "operands": [ { "name": "operand", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vhlo.while_v1", "operands": [ { "name": "operand", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "cond", "type": "VHLO_AnyRegion" }, { "name": "body", "type": "VHLO_AnyRegion" } ] }, { "name": "vhlo.xor_v1", "operands": [ { "name": "lhs", "type": "VHLO_AnyType" }, { "name": "rhs", "type": "VHLO_AnyType" } ], "results": [ { "name": "result", "type": "VHLO_AnyType" } ] }, { "name": "vifrt.AfterV1", "operands": [ { "name": "inputs", "type": "Variadic" } ], "results": [ { "name": "control_output", "type": "Vifrt_AnyType" } ] }, { "name": "vifrt.AssembleV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "output", "type": "Vifrt_AnyType" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.BitcastArraysV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "donated", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.CallFuncV1", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "Vifrt_AnyAttr" } ] }, { "name": "vifrt.CallLoadedExecutableV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "callee", "type": "Vifrt_AnyAttr" }, { "name": "io_aliases", "type": "Vifrt_AnyAttr" }, { "name": "donated_input_indices", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.CallV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "callee", "type": "Vifrt_AnyAttr" }, { "name": "devices", "type": "Vifrt_AnyAttr" }, { "name": "io_aliases", "type": "Vifrt_AnyAttr" }, { "name": "donated_input_indices", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.CopyArraysV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "donated", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.CopyArraysV2", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "donated", "type": "Vifrt_AnyAttr" }, { "name": "reuse", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.DisassembleV1", "operands": [ { "name": "input", "type": "Vifrt_AnyType" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ] }, { "name": "vifrt.FuncV1", "attributes": [ { "name": "sym_name", "type": "Vifrt_AnyAttr" }, { "name": "function_type", "type": "Vifrt_AnyAttr" }, { "name": "sym_visibility", "type": "Vifrt_AnyAttr" }, { "name": "arg_attrs", "type": "Vifrt_AnyAttr" }, { "name": "res_attrs", "type": "Vifrt_AnyAttr" } ], "regions": [ { "name": "body", "type": "Vifrt_AnyRegion" } ], "assemblyFormat": "custom($sym_name, $body, $function_type) attr-dict" }, { "name": "vifrt.LoadedExecutableV1", "attributes": [ { "name": "sym_name", "type": "Vifrt_AnyAttr" }, { "name": "function_type", "type": "Vifrt_AnyAttr" }, { "name": "devices", "type": "Vifrt_AnyAttr" } ] }, { "name": "vifrt.RemapArraysV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "mappings", "type": "Vifrt_AnyAttr" }, { "name": "donated", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.ReshardV1", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "control_inputs", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "control_output", "type": "Vifrt_AnyType" } ], "attributes": [ { "name": "donated", "type": "Vifrt_AnyAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ] }, { "name": "vifrt.ReturnV1", "operands": [ { "name": "results", "type": "Variadic" } ] }, { "name": "vm.abs.f32", "summary": "Floating point absolute-value operation.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.abs.f64", "summary": "Floating point absolute-value operation.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.abs.i32", "summary": "Integer absolute-value operation.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.abs.i64", "summary": "Integer absolute-value operation.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.add.f32", "summary": "Floating-point add operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.add.f64", "summary": "Floating-point add operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.add.i32", "summary": "Integer add operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.add.i64", "summary": "Integer add operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.and.i32", "summary": "Integer binary and operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.and.i64", "summary": "Integer binary and operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.assign.ref", "summary": "Assigns a ref value between registers.", "description": "Assigns a reference value from one register to another. This is a runtime\n operation that performs retain/move semantics based on the MOVE bit.\n\n This operation exists to support efficient ref-to-ref assignments where\n the source and destination may have the same or different registers. When\n the source and destination registers are the same, this operation becomes\n a no-op and is elided during bytecode encoding.", "operands": [ { "name": "source", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_AnyRef" } ], "assemblyFormat": "$source attr-dict `:` type($source) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.atan.f32", "summary": "Arcus tangent of the given value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.atan.f64", "summary": "Arcus tangent of the given value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.atan2.f32", "summary": "2-argument arcus tangent of the given values.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.atan2.f64", "summary": "2-argument arcus tangent of the given values.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.bitcast.f32.i32", "summary": "Bitcast from a 32-bit float-point value to a 32-bit integer.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.bitcast.f64.i64", "summary": "Bitcast from a 64-bit float-point value to a 64-bit integer.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.bitcast.i32.f32", "summary": "Bitcast from a 32-bit integer to a 32-bit float-point value.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.bitcast.i64.f64", "summary": "Bitcast from a 64-bit integer to a 64-bit float-point value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.br", "summary": "Unconditional branch operation.", "description": "Represents an unconditional branch operation that branches to a target block\n with the given set of arguments.\n\n ```\n ^bb0(...):\n vm.br ^bb1(%a)\n ^bb1(%blockArg1):\n ...\n ```", "operands": [ { "name": "destOperands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.br_table", "summary": "Branch table operation.", "description": "Represents a branch table instructing execution to branch to the block with\n the specified index. If the index is out of bounds then execution will\n branch to the default block.\n\n ```\n vm.br_table %index {\n default: ^bb1(%a : i64),\n 0: ^bb2,\n 1: ^bb3(%c : i64)\n }\n ```", "operands": [ { "name": "index", "type": "I32" }, { "name": "defaultOperands", "type": "Variadic" }, { "name": "caseOperands", "type": "VariadicOfVariadic" } ], "attributes": [ { "name": "case_operand_segments", "type": "DenseI32ArrayAttr" } ], "successors": [ { "name": "defaultDestination", "type": "AnySuccessor" }, { "name": "caseDestinations", "type": "VariadicSuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$index ` ` `{` `\\n`\n custom(\n $defaultDestination, $defaultOperands, type($defaultOperands),\n $caseDestinations, $caseOperands, type($caseOperands))\n `}`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.break", "summary": "Unconditional debug break operation.", "description": "Breaks into the attached debugger or asks for attaching a debugger. After\n resuming (or if a debugger is not attached) execution will continue at the\n target block.", "operands": [ { "name": "destOperands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.alloc", "summary": "Allocates a new zero-initialized buffer.", "description": "Allocates a new zero-initialized buffer with the given size in bytes.", "operands": [ { "name": "length", "type": "VM_BufferIndex" }, { "name": "alignment", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_RefOf" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.clone", "summary": "Clones a buffer.", "description": "Clones a range of the source buffer to produce a mutable buffer with the\n same contents.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "alignment", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_RefOf" } ], "assemblyFormat": "operands attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.compare", "summary": "Compares a range of a buffer to another.", "description": "Returns 1 if the two ranges are bitwise equivalent, somewhat like memcmp.", "operands": [ { "name": "lhs_buffer", "type": "VM_RefOf" }, { "name": "lhs_offset", "type": "VM_BufferIndex" }, { "name": "rhs_buffer", "type": "VM_RefOf" }, { "name": "rhs_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "operands attr-dict `:` type($lhs_buffer) `,` type($rhs_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.copy", "summary": "Copies a range of a buffer to another.", "description": "Copies a range of one buffer to another, like memcpy.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" }, { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" } ], "assemblyFormat": "operands attr-dict `:` type($source_buffer) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.fill.f32", "summary": "Fills the buffer with the given repeating 32-bit value.", "description": "Fills an element range of the buffer with the given value, like memset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[F32, I32]>" } ], "assemblyFormat": "$target_buffer `,` $target_offset `,` $length `,` $value\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.fill.f64", "summary": "Fills the buffer with the given repeating 64-bit value.", "description": "Fills an element range of the buffer with the given value, like memset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[F64, I32]>" } ], "assemblyFormat": "$target_buffer `,` $target_offset `,` $length `,` $value\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.fill.i16", "summary": "Fills the buffer with the given repeating 16-bit value.", "description": "Fills an element range of the buffer with the given value, like memset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I16, I32]>" } ], "assemblyFormat": "$target_buffer `,` $target_offset `,` $length `,` $value\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.fill.i32", "summary": "Fills the buffer with the given repeating 32-bit value.", "description": "Fills an element range of the buffer with the given value, like memset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$target_buffer `,` $target_offset `,` $length `,` $value\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.fill.i64", "summary": "Fills the buffer with the given repeating 64-bit value.", "description": "Fills an element range of the buffer with the given value, like memset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I64, I32]>" } ], "assemblyFormat": "$target_buffer `,` $target_offset `,` $length `,` $value\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.fill.i8", "summary": "Fills the buffer with the given repeating 8-bit value.", "description": "Fills an element range of the buffer with the given value, like memset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I8, I32]>" } ], "assemblyFormat": "$target_buffer `,` $target_offset `,` $length `,` $value\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.hash", "description": "Computes the SipHash-2-4 of the source buffer at the given offset for\n |length| bytes using seed `0x0001020304...0e0f`.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" }, { "name": "length", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$source_buffer `,` $source_offset `,` $length\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.length", "summary": "Returns the byte length of a buffer.", "description": "Returns the total byte length of the given buffer. This is the exact value\n as specified during buffer allocation though the underlying system buffer\n may have additional padding.", "operands": [ { "name": "buffer", "type": "VM_RefOf" } ], "results": [ { "name": "result", "type": "VM_BufferIndex" } ], "assemblyFormat": "operands attr-dict `:` type($buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.f32", "summary": "32-bit floating-point load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[F32, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.f64", "summary": "64-bit floating-point load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[F64, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.i16.s", "summary": "Signed 16-bit integer load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.i16.u", "summary": "Unsigned 16-bit integer load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.i32", "summary": "32-bit integer load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.i64", "summary": "64-bit integer load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I64, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.i8.s", "summary": "Signed 8-bit integer load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.load.i8.u", "summary": "Unsigned 8-bit integer load.", "description": "Loads a value from the buffer at the given element offset.", "operands": [ { "name": "source_buffer", "type": "VM_RefOf" }, { "name": "source_offset", "type": "VM_BufferIndex" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$source_buffer `[` $source_offset `]`\n attr-dict `:` type($source_buffer) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.store.f32", "summary": "32-bit floating-point store.", "description": "Stores a value to the buffer at the given element offset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[F32, I32]>" } ], "assemblyFormat": "$value `,` $target_buffer `[` $target_offset `]`\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.store.f64", "summary": "64-bit floating-point store.", "description": "Stores a value to the buffer at the given element offset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[F64, I32]>" } ], "assemblyFormat": "$value `,` $target_buffer `[` $target_offset `]`\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.store.i16", "summary": "Unsigned 16-bit integer store.", "description": "Stores a value to the buffer at the given element offset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$value `,` $target_buffer `[` $target_offset `]`\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.store.i32", "summary": "32-bit integer store.", "description": "Stores a value to the buffer at the given element offset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$value `,` $target_buffer `[` $target_offset `]`\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.store.i64", "summary": "64-bit integer store.", "description": "Stores a value to the buffer at the given element offset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I64, I32]>" } ], "assemblyFormat": "$value `,` $target_buffer `[` $target_offset `]`\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.buffer.store.i8", "summary": "Unsigned 8-bit integer store.", "description": "Stores a value to the buffer at the given element offset.", "operands": [ { "name": "target_buffer", "type": "VM_RefOf" }, { "name": "target_offset", "type": "VM_BufferIndex" }, { "name": "value", "type": "AnyTypeOf<[I32, I32]>" } ], "assemblyFormat": "$value `,` $target_buffer `[` $target_offset `]`\n attr-dict `:` type($value) `->` type($target_buffer)", "hasCustomAssemblyFormat": true }, { "name": "vm.call", "summary": "Call operation.", "description": "Calls an internal VM function with the given arguments.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "VM_FuncRefAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$callee `(` operands `)` attr-dict `:` functional-type(operands, results)", "hasCustomAssemblyFormat": true }, { "name": "vm.call.variadic", "summary": "Call operation with variadic arguments.", "description": "Calls an internal VM function with the given arguments. One or more of the\n arguments may be variadic, encoded as segmented sized operand lists.\n\n Variadic arguments must be specified with a total count in the segment_sizes\n attribute.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "VM_FuncRefAttr" }, { "name": "segment_sizes", "type": "SignlessIntElementsAttr<16>" }, { "name": "segment_types", "type": "TypedArrayAttrBase" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.call.variadic.yieldable", "summary": "Variadic call operation that may yield.", "description": "Calls a variadic VM import function that may yield. If the call yields,\n execution resumes at the specified successor block with the call results\n as block arguments. If the call completes synchronously, control branches\n to the successor with the results.\n\n Variadic arguments must be specified with a total count in the segment_sizes\n attribute. Only imports are supported (not internal functions).\n\n ```\n ^bb0:\n vm.call.variadic.yieldable @import(%a, %b, %c) {segment_sizes = dense<[1, 2]> : vector<2xi16>}\n : (i32, i32, i32) -> ^resume(i32)\n ^resume(%result : i32):\n vm.return %result\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "VM_FuncRefAttr" }, { "name": "segment_sizes", "type": "SignlessIntElementsAttr<16>" }, { "name": "segment_types", "type": "TypedArrayAttrBase" }, { "name": "result_types", "type": "TypedArrayAttrBase" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` `(` type($operands) `)`\n `->` $dest custom($result_types)", "hasCustomAssemblyFormat": true }, { "name": "vm.call.yieldable", "summary": "Call operation that may yield.", "description": "Calls a VM function (internal or imported) that may yield. If the call\n yields execution resumes at the specified successor block with the call\n results as block arguments. If the call completes synchronously control\n branches to the successor with the results.\n\n This op is a terminator that combines a call with an explicit resume point,\n making the yield/resume semantics visible in the IR.\n\n ```\n ^bb0:\n vm.call.yieldable @hal.fence.await(%timeout, %fence) : (i32, !vm.ref) -> ^resume(i32)\n ^resume(%result : i32):\n vm.return %result\n ```", "operands": [ { "name": "arguments", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "VM_FuncRefAttr" }, { "name": "result_types", "type": "TypedArrayAttrBase" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$callee `(` $arguments `)` attr-dict `:` `(` type($arguments) `)`\n `->` $dest custom($result_types)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.any.ref", "summary": "Casts from any ref to a specific ref type.", "description": "Performs a runtime cast of an opaque `!vm.ref` to a specific `!vm.ref`\n and raises an error if the operand does not match the expected type.\n Null refs can always be cast between types.", "operands": [ { "name": "operand", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_AnyRef" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.f32.si32", "summary": "Cast from a float-point value to a signed 32-bit integer.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.f32.si64", "summary": "Cast from a float-point value to a signed 64-bit integer.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.f32.ui32", "summary": "Cast from an float-point value to an unsigned 32-bit integer.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.f32.ui64", "summary": "Cast from an float-point value to an unsigned 64-bit integer.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.f64.si64", "summary": "Cast from a float-point value to a signed integer.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.f64.ui64", "summary": "Cast from an float-point value to an unsigned integer.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.ref.any", "summary": "Casts from a specific ref to any ref type.", "description": "Performs a compile-time widening cast of a specific `!vm.ref` to an\n opaque `!vm.ref`. At runtime this is equivalent to a ref assignment\n since all refs have the same representation. Uses the same encoding as\n vm.assign.ref.", "operands": [ { "name": "operand", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_AnyRef" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.si32.f32", "summary": "Cast from a signed integer to a float-point value.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.si64.f32", "summary": "Cast from a signed integer to a float-point value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.si64.f64", "summary": "Cast from a signed integer to a float-point value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.ui32.f32", "summary": "Cast from an unsigned integer to a float-point value.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.ui64.f32", "summary": "Cast from an unsigned integer to a float-point value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cast.ui64.f64", "summary": "Cast from an unsigned integer to a float-point value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ceil.f32", "summary": "Floating point ceiling operation.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ceil.f64", "summary": "Floating point ceiling operation.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.check.eq", "summary": "Raises a global failure if the condition is true.", "description": "When the condition is true this signals a runtime failure that causes the\n entire active invocation - and possibly *all* in-flight and pending\n invocations - to fail. The status will be propagated back via the available\n runtime error handling mechanisms such as semaphores or synchronous\n invocation results.\n\n This is implemented as a pseudo-op that transforms into a vm.cond_fail\n operation.\n\n ```\n vm.check.eq %a, %b, \"a == b\" : i32\n vm.check.nz %ref, \"!null\" : !vm.ref\n ```", "operands": [ { "name": "lhs", "type": "VM_AnyType" }, { "name": "rhs", "type": "VM_AnyType" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs (`,` $message^)? attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.check.ne", "summary": "Raises a global failure if the condition is true.", "description": "When the condition is true this signals a runtime failure that causes the\n entire active invocation - and possibly *all* in-flight and pending\n invocations - to fail. The status will be propagated back via the available\n runtime error handling mechanisms such as semaphores or synchronous\n invocation results.\n\n This is implemented as a pseudo-op that transforms into a vm.cond_fail\n operation.\n\n ```\n vm.check.eq %a, %b, \"a == b\" : i32\n vm.check.nz %ref, \"!null\" : !vm.ref\n ```", "operands": [ { "name": "lhs", "type": "VM_AnyType" }, { "name": "rhs", "type": "VM_AnyType" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs (`,` $message^)? attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.check.nearly_eq", "summary": "Raises a global failure if the condition is true.", "description": "When the condition is true this signals a runtime failure that causes the\n entire active invocation - and possibly *all* in-flight and pending\n invocations - to fail. The status will be propagated back via the available\n runtime error handling mechanisms such as semaphores or synchronous\n invocation results.\n\n This is implemented as a pseudo-op that transforms into a vm.cond_fail\n operation.\n\n ```\n vm.check.eq %a, %b, \"a == b\" : i32\n vm.check.nz %ref, \"!null\" : !vm.ref\n ```", "operands": [ { "name": "lhs", "type": "VM_AnyType" }, { "name": "rhs", "type": "VM_AnyType" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs `,` $rhs (`,` $message^)? attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.check.nz", "summary": "Raises a global failure if the condition is true.", "description": "When the condition is true this signals a runtime failure that causes the\n entire active invocation - and possibly *all* in-flight and pending\n invocations - to fail. The status will be propagated back via the available\n runtime error handling mechanisms such as semaphores or synchronous\n invocation results.\n\n This is implemented as a pseudo-op that transforms into a vm.cond_fail\n operation.\n\n ```\n vm.check.eq %a, %b, \"a == b\" : i32\n vm.check.nz %ref, \"!null\" : !vm.ref\n ```", "operands": [ { "name": "value", "type": "VM_AnyType" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "assemblyFormat": "$value (`,` $message^)? attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.f32.near", "summary": "Near floating-point equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.f32.o", "summary": "Ordered floating-point equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.f32.u", "summary": "Unordered floating-point equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.f64.near", "summary": "Near floating-point equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.f64.o", "summary": "Ordered floating-point equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.f64.u", "summary": "Unordered floating-point equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.i32", "summary": "Integer equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.i64", "summary": "Integer equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.eq.ref", "summary": "ref equality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "VM_AnyRef" }, { "name": "rhs", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.f32.o", "summary": "Ordered floating-point greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.f32.u", "summary": "Unordered floating-point greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.f64.o", "summary": "Ordered floating-point greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.f64.u", "summary": "Unordered floating-point greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.i32.s", "summary": "Signed integer greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.i32.u", "summary": "Unsigned integer greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.i64.s", "summary": "Signed integer greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gt.i64.u", "summary": "Unsigned integer greater-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.f32.o", "summary": "Ordered floating-point greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.f32.u", "summary": "Unordered floating-point greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.f64.o", "summary": "Ordered floating-point greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.f64.u", "summary": "Unordered floating-point greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.i32.s", "summary": "Signed integer greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.i32.u", "summary": "Unsigned integer greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.i64.s", "summary": "Signed integer greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.gte.i64.u", "summary": "Unsigned integer greater-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.f32.o", "summary": "Ordered floating-point less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.f32.u", "summary": "Unordered floating-point less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.f64.o", "summary": "Ordered floating-point less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.f64.u", "summary": "Unordered floating-point less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.i32.s", "summary": "Signed integer less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.i32.u", "summary": "Unsigned integer less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.i64.s", "summary": "Signed integer less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lt.i64.u", "summary": "Unsigned integer less-than comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.f32.o", "summary": "Ordered floating-point less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.f32.u", "summary": "Unordered floating-point less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.f64.o", "summary": "Ordered floating-point less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.f64.u", "summary": "Unordered floating-point less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.i32.s", "summary": "Signed integer less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.i32.u", "summary": "Unsigned integer less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.i64.s", "summary": "Signed integer less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.lte.i64.u", "summary": "Unsigned integer less-than-or-equal comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nan.f32", "summary": "Floating-point NaN comparison operation.", "description": "Returns 1 if the value is NaN.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nan.f64", "summary": "Floating-point NaN comparison operation.", "description": "Returns 1 if the value is NaN.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.f32.o", "summary": "Ordered floating-point inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.f32.u", "summary": "Unordered floating-point inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.f64.o", "summary": "Ordered floating-point inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.f64.u", "summary": "Unordered floating-point inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.i32", "summary": "Integer inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.i64", "summary": "Integer inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.ne.ref", "summary": "ref inequality comparison operation.", "description": "Compares two operands with the specified predicate.", "operands": [ { "name": "lhs", "type": "VM_AnyRef" }, { "name": "rhs", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "operands attr-dict `:` type($lhs)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.f32.o", "summary": "Ordered floating-point non-zero comparison operation.", "description": "Compares the given floating-point operand for a non-zero value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "operands attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.f32.u", "summary": "Unordered floating-point non-zero comparison operation.", "description": "Compares the given floating-point operand for a non-zero value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "operands attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.f64.o", "summary": "Ordered floating-point non-zero comparison operation.", "description": "Compares the given floating-point operand for a non-zero value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "operands attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.f64.u", "summary": "Unordered floating-point non-zero comparison operation.", "description": "Compares the given floating-point operand for a non-zero value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "operands attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.i32", "summary": "Integer non-zero comparison operation.", "description": "Compares the given integer operand for a non-zero value.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.i64", "summary": "Integer non-zero comparison operation.", "description": "Compares the given integer operand for a non-zero value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cmp.nz.ref", "summary": "ref non-zero comparison operation.", "description": "Compares the given ref operand for a non-zero/null value.", "operands": [ { "name": "operand", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_CondValue" } ], "assemblyFormat": "$operand attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.cond_br", "summary": "Conditional branch operation.", "description": "Represents a conditional branch operation that branches to one of the two\n target blocks with the given set of arguments.\n\n ```\n ^bb0(...):\n vm.cond_br %condition, ^bb1(%a), ^bb2(%b)\n ^bb1(%blockArg1):\n ...\n ^bb2(%blockArg2):\n ...\n ```", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "trueDestOperands", "type": "Variadic" }, { "name": "falseDestOperands", "type": "Variadic" } ], "successors": [ { "name": "trueDest", "type": "AnySuccessor" }, { "name": "falseDest", "type": "AnySuccessor" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$condition `,`\n $trueDest (`(` $trueDestOperands^ `:` type($trueDestOperands) `)`)? `,`\n $falseDest (`(` $falseDestOperands^ `:` type($falseDestOperands) `)`)?\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.cond_break", "summary": "Conditional debug break operation.", "description": "Breaks into the attached debugger or asks for attaching a debugger if the\n provided condition is true. After resuming (or if a debugger is not\n attached) execution will continue at the target block.", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "destOperands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$condition `,` $dest (`(` $destOperands^ `:` type($destOperands) `)`)?\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.cond_fail", "summary": "Raises a global failure if the condition is true.", "description": "When the condition is true this signals a runtime failure that causes the\n entire active invocation - and possibly *all* in-flight and pending\n invocations - to fail with the given status. The status will be propagated\n back via the available runtime error handling mechanisms such as semaphores\n or synchronous invocation results.\n\n As the IREE execution model is deeply pipelined it's possible that failures\n have a latency between when they are emitted and when the application can\n observe the failure. It's also possible that other work that is in-flight\n or pending when the failure occurs will complete.\n\n This is implemented as a pseudo-op that transforms into a vm.fail operation\n guarded by the condition.\n\n ```\n %nz = vm.cmp.nz.i32 %value : i32\n %statusCode = vm.const.i32 9\n vm.cond_fail %nz, %statusCode, \"expected non-zero\"\n ```", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "status", "type": "Util_Status" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.const.f32", "summary": "32-bit floating-point constant operation.", "description": "Defines a constant value that is treated as a scalar literal at runtime.", "results": [ { "name": "result", "type": "F32" } ], "attributes": [ { "name": "value", "type": "VM_ConstantFloatValueAttr" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.f32.zero", "summary": "32-bit floating-point constant zero operation.", "description": "Defines a constant zero primitive.", "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.f64", "summary": "64-bit floating-point constant operation.", "description": "Defines a constant value that is treated as a scalar literal at runtime.", "results": [ { "name": "result", "type": "F64" } ], "attributes": [ { "name": "value", "type": "VM_ConstantFloatValueAttr" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.f64.zero", "summary": "64-bit floating-point constant zero operation.", "description": "Defines a constant zero primitive.", "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.i32", "summary": "32-bit integer constant operation.", "description": "Defines a constant value that is treated as a scalar literal at runtime.", "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "value", "type": "VM_ConstantIntegerValueAttr" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.i32.zero", "summary": "32-bit integer constant zero operation.", "description": "Defines a constant zero primitive.", "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.i64", "summary": "64-bit integer constant operation.", "description": "Defines a constant value that is treated as a scalar literal at runtime.", "results": [ { "name": "result", "type": "I64" } ], "attributes": [ { "name": "value", "type": "VM_ConstantIntegerValueAttr" } ], "assemblyFormat": "$value attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.i64.zero", "summary": "64-bit integer constant zero operation.", "description": "Defines a constant zero primitive.", "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.const.ref.rodata", "summary": "Constant rodata access operation.", "description": "Returns a reference to a read-only buffer.", "results": [ { "name": "value", "type": "VM_RefOf" } ], "attributes": [ { "name": "rodata", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$rodata attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.const.ref.zero", "summary": "null ref constant operation.", "description": "Defines a constant null ref that can be used in comparisons and\n initialization.", "results": [ { "name": "result", "type": "VM_AnyRef" } ], "assemblyFormat": "`:` type($result) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.cos.f32", "summary": "Cosine of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.cos.f64", "summary": "Cosine of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ctlz.i32", "summary": "Counts the leading zeros in an integer value.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ctlz.i64", "summary": "Counts the leading zeros in an integer value.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.discard.refs", "summary": "Discards reference values, releasing them.", "description": "Explicitly releases reference values. This is used by the compiler to insert\n early releases at ref death points, enabling functions to be marked as\n \"refs clean\" so the runtime can skip cleanup on the success path.\n\n The encode method is implemented manually in C++ to support per-operand\n elision based on register allocation analysis. Operands that have already\n been released via a MOVE bit on a preceding use are elided from encoding.", "operands": [ { "name": "refs", "type": "Variadic" } ], "assemblyFormat": "($refs^ `:` type($refs))? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.div.f32", "summary": "Floating point division operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.div.f64", "summary": "Floating point division operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.div.i32.s", "summary": "Signed integer division operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.div.i32.u", "summary": "Unsigned integer division operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.div.i64.s", "summary": "Signed integer division operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.div.i64.u", "summary": "Unsigned integer division operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.erf.f32", "summary": "Computes the error function of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.erf.f64", "summary": "Computes the error function of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.exp.f32", "summary": "Base-e exponential of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.exp.f64", "summary": "Base-e exponential of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.exp2.f32", "summary": "Base-2 exponential of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.exp2.f64", "summary": "Base-2 exponential of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.expm1.f32", "summary": "Base-e exponential of the specified value minus 1.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.expm1.f64", "summary": "Base-e exponential of the specified value minus 1.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.export", "summary": "Exports a function from the module.", "description": "Specifies an exported function with an externally-visible alias. Multiple\n exports can reference the same internal functions.", "attributes": [ { "name": "function_ref", "type": "FlatSymbolRefAttr" }, { "name": "export_name", "type": "StrAttr" }, { "name": "ordinal", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.ext.f32.f64", "summary": "Floating-point zero extend 32 bits to 64 bits.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i16.i32.s", "summary": "Integer sign extend 16 bits to 32 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i16.i32.u", "summary": "Integer zero extend 16 bits to 32 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i16.i64.s", "summary": "Integer sign extend 16 bits to 64 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i16.i64.u", "summary": "Integer zero extend 16 bits to 64 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i32.i64.s", "summary": "Integer sign extend 32 bits to 64 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i32.i64.u", "summary": "Integer zero extend 32 bits to 64 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i8.i32.s", "summary": "Integer sign extend 8 bits to 32 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i8.i32.u", "summary": "Integer zero extend 8 bits to 32 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i8.i64.s", "summary": "Integer sign extend 8 bits to 64 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.ext.i8.i64.u", "summary": "Integer zero extend 8 bits to 64 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.fail", "summary": "Raises a global failure.", "description": "Signals a runtime failure that causes the entire active invocation - and\n possibly *all* in-flight and pending invocations - to fail with the given\n status. The status will be propagated back via the available runtime error\n handling mechanisms such as semaphores or synchronous invocation results.\n\n As the IREE execution model is deeply pipelined it's possible that failures\n have a latency between when they are emitted and when the application can\n observe the failure. It's also possible that other work that is in-flight\n or pending when the failure occurs will complete.\n\n ```\n %statusCode = vm.const.i32 9\n vm.fail %statusCode, \"oh no!\"\n ```", "operands": [ { "name": "status", "type": "Util_Status" } ], "attributes": [ { "name": "message", "type": "OptionalAttr" } ], "assemblyFormat": "$status (`,` $message^)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.floor.f32", "summary": "Floating point floor operation.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.floor.f64", "summary": "Floating point floor operation.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.fma.f32", "summary": "Floating point fused multiply-add operation (a*b+c).", "operands": [ { "name": "a", "type": "F32" }, { "name": "b", "type": "F32" }, { "name": "c", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b', 'c', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.fma.f64", "summary": "Floating point fused multiply-add operation (a*b+c).", "operands": [ { "name": "a", "type": "F64" }, { "name": "b", "type": "F64" }, { "name": "c", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b', 'c', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.fma.i32", "summary": "Integer fused-multiply add operation (a*b+c).", "operands": [ { "name": "a", "type": "I32" }, { "name": "b", "type": "I32" }, { "name": "c", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b', 'c', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.fma.i64", "summary": "Integer fused-multiply add operation (a*b+c).", "operands": [ { "name": "a", "type": "I64" }, { "name": "b", "type": "I64" }, { "name": "c", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b', 'c', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.func", "summary": "Function defined with VM control flow ops.", "description": "Represents a function containing VM ops and those of compatible dialects.\n All flow control is performed by VM ops.", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "ordinal", "type": "OptionalAttr" }, { "name": "inlining_policy", "type": "OptionalAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.global.address", "summary": "Returns an address reference to a global.", "description": "Returns an indirect address reference to the given global. During export the\n address will be converted to the natural format of the global table (for\n example, ordinals for refs and byte offsets for primitive types).", "results": [ { "name": "result", "type": "AnyTypeOf<[VM_Ptr, Util_AnyPtrType]>" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.f32", "summary": "32-bit floating-point global declaration.", "description": "Defines a global value that is treated as a scalar literal at runtime.\n Initialized to zero unless an initial value is specified.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "initial_value", "type": "OptionalAttr>" }, { "name": "inlining_policy", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name\n attr-dict\n custom($type, $initial_value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.f64", "summary": "64-bit floating-point global declaration.", "description": "Defines a global value that is treated as a scalar literal at runtime.\n Initialized to zero unless an initial value is specified.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "initial_value", "type": "OptionalAttr>" }, { "name": "inlining_policy", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name\n attr-dict\n custom($type, $initial_value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.i32", "summary": "32-bit integer global declaration.", "description": "Defines a global value that is treated as a scalar literal at runtime.\n Initialized to zero unless an initial value is specified.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "initial_value", "type": "OptionalAttr>" }, { "name": "inlining_policy", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name\n attr-dict\n custom($type, $initial_value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.i64", "summary": "64-bit integer global declaration.", "description": "Defines a global value that is treated as a scalar literal at runtime.\n Initialized to zero unless an initial value is specified.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "initial_value", "type": "OptionalAttr>" }, { "name": "inlining_policy", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name\n attr-dict\n custom($type, $initial_value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.f32", "summary": "Global 32-bit floating-point load operation.", "description": "Loads the value of a global containing an primitive value.", "results": [ { "name": "value", "type": "F32" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.f64", "summary": "Global 64-bit floating-point load operation.", "description": "Loads the value of a global containing an primitive value.", "results": [ { "name": "value", "type": "F64" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.i32", "summary": "Global 32-bit integer load operation.", "description": "Loads the value of a global containing an primitive value.", "results": [ { "name": "value", "type": "I32" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.i64", "summary": "Global 64-bit integer load operation.", "description": "Loads the value of a global containing an primitive value.", "results": [ { "name": "value", "type": "I64" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.indirect.f32", "summary": "Global 32-bit floating-point load operation.", "description": "Loads the value of a global containing a primitive value.", "operands": [ { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "results": [ { "name": "value", "type": "F32" } ], "attributes": [ { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($global) `->` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.indirect.f64", "summary": "Global 64-bit floating-point load operation.", "description": "Loads the value of a global containing a primitive value.", "operands": [ { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "results": [ { "name": "value", "type": "F64" } ], "attributes": [ { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($global) `->` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.indirect.i32", "summary": "Global 32-bit integer load operation.", "description": "Loads the value of a global containing a primitive value.", "operands": [ { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "results": [ { "name": "value", "type": "I32" } ], "attributes": [ { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($global) `->` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.indirect.i64", "summary": "Global 64-bit integer load operation.", "description": "Loads the value of a global containing a primitive value.", "operands": [ { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "results": [ { "name": "value", "type": "I64" } ], "attributes": [ { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($global) `->` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.indirect.ref", "summary": "Global ref load operation.", "description": "Loads the value of a global containing a ref of the given type.", "operands": [ { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "results": [ { "name": "value", "type": "VM_AnyRef" } ], "attributes": [ { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($global) `->` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.load.ref", "summary": "Global ref load operation.", "description": "Loads the value of a global containing a ref of the given type.", "results": [ { "name": "value", "type": "VM_AnyRef" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" }, { "name": "is_immutable", "type": "UnitAttr" } ], "assemblyFormat": "(`immutable` $is_immutable^)?\n $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.ref", "summary": "ref global declaration.", "description": "Defines a global value that is a ref of a specific type. The global will\n retain the ref object for the lifetime of the context or until the value is\n replaced with a store or reset.\n Initialized to null unless an initial value is specified.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "TypeAttr" }, { "name": "is_mutable", "type": "UnitAttr" }, { "name": "inlining_policy", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n (`mutable` $is_mutable^)?\n $sym_name\n attr-dict\n `:` $type", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.f32", "summary": "Global 32-bit floating-point store operation.", "description": "Stores a primitive value value to a global.", "operands": [ { "name": "value", "type": "F32" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.f64", "summary": "Global 64-bit floating-point store operation.", "description": "Stores a primitive value value to a global.", "operands": [ { "name": "value", "type": "F64" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.i32", "summary": "Global 32-bit integer store operation.", "description": "Stores a primitive value value to a global.", "operands": [ { "name": "value", "type": "I32" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.i64", "summary": "Global 64-bit integer store operation.", "description": "Stores a primitive value value to a global.", "operands": [ { "name": "value", "type": "I64" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.indirect.f32", "summary": "Global 32-bit floating-point store operation.", "description": "Stores a primitive value to a global.", "operands": [ { "name": "value", "type": "F32" }, { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value) `->` type($global)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.indirect.f64", "summary": "Global 64-bit floating-point store operation.", "description": "Stores a primitive value to a global.", "operands": [ { "name": "value", "type": "F64" }, { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value) `->` type($global)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.indirect.i32", "summary": "Global 32-bit integer store operation.", "description": "Stores a primitive value to a global.", "operands": [ { "name": "value", "type": "I32" }, { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value) `->` type($global)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.indirect.i64", "summary": "Global 64-bit integer store operation.", "description": "Stores a primitive value to a global.", "operands": [ { "name": "value", "type": "I64" }, { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value) `->` type($global)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.indirect.ref", "summary": "Global ref stores operation.", "description": "Stores a ref to a global, retaining it until the global is reset.", "operands": [ { "name": "value", "type": "VM_AnyRef" }, { "name": "global", "type": "AnyTypeOf<[VM_Ptr, Util_PtrOf]>" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value) `->` type($global)", "hasCustomAssemblyFormat": true }, { "name": "vm.global.store.ref", "summary": "Global ref stores operation.", "description": "Stores a ref to a global, retaining it until the global is reset.", "operands": [ { "name": "value", "type": "VM_AnyRef" } ], "attributes": [ { "name": "global", "type": "VM_GlobalRefAttr" } ], "assemblyFormat": "$value `,` $global attr-dict `:` type($value)", "hasCustomAssemblyFormat": true }, { "name": "vm.import", "summary": "Imports a function from an external module.", "description": "Specifies a function that should be imported from either the runtime or\n an external VM module.\n\n Required imports can be declared with a minimum version of the module that\n contains the import. The maximum declared minimum version of all required\n imports from the module will become the required minimum version at runtime.\n\n Optional imports not present at runtime will be invalid to call and whether\n they were resolved can be queried with `vm.import.resolved`.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" }, { "name": "is_optional", "type": "OptionalAttr" }, { "name": "minimum_version", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.import.resolved", "summary": "Returns true if an optional import was resolved at runtime.", "description": "Allows for checking whether a optional import was resolved at runtime. If\n this returns false then attempting to call the imported function will result\n in a failure at runtime.", "results": [ { "name": "result", "type": "VM_CondValue" } ], "attributes": [ { "name": "import", "type": "VM_FuncRefAttr" } ], "assemblyFormat": "$import attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.initializer", "summary": "Global initialization function.", "description": "A function that is called in definition order upon module initialization.\n Must not load any globals that are defined or initialized after it in the\n module.", "attributes": [ { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.list.alloc", "summary": "Allocates a new empty list.", "description": "Allocates a new typed list with a minimum initial_capacity.", "operands": [ { "name": "initial_capacity", "type": "VM_ListIndex" } ], "results": [ { "name": "result", "type": "VM_AnyList" } ], "assemblyFormat": "operands attr-dict `:` `(` type($initial_capacity) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.list.get.f32", "summary": "Primitive type element accessor.", "description": "Returns the value of the element at the given index.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.list.get.f64", "summary": "Primitive type element accessor.", "description": "Returns the value of the element at the given index.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" } ], "results": [ { "name": "result", "type": "F64" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.list.get.i32", "summary": "Primitive type element accessor.", "description": "Returns the value of the element at the given index.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.list.get.i64", "summary": "Primitive type element accessor.", "description": "Returns the value of the element at the given index.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.list.get.ref", "summary": "ref type element accessor.", "description": "Returns the ref value of the element at the given index. Note that the value\n may be null if the element is null or the type does not match.", "operands": [ { "name": "list", "type": "VM_AnyList" }, { "name": "index", "type": "VM_ListIndex" } ], "results": [ { "name": "result", "type": "VM_AnyRef" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.list.reserve", "summary": "Reserves capacity for list growth.", "description": "Reserves storage for at least minimum_capacity elements. If the list already\n has at least the specified capacity the operation is ignored.", "operands": [ { "name": "list", "type": "VM_AnyList" }, { "name": "minimum_capacity", "type": "VM_ListIndex" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($minimum_capacity) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.resize", "summary": "Resizes the list to a new count in elements.", "description": "Resizes the list to contain new_size elements. This will either truncate\n the list if the existing size is greater than new_size or extend the list\n with the default list value of 0 if storing primitives and null if refs.", "operands": [ { "name": "list", "type": "VM_AnyList" }, { "name": "new_size", "type": "VM_ListIndex" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($new_size) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.set.f32", "summary": "Primitive type element mutator.", "description": "Sets the element at the given index to the new value.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" }, { "name": "value", "type": "F32" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `,` type($value) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.set.f64", "summary": "Primitive type element mutator.", "description": "Sets the element at the given index to the new value.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" }, { "name": "value", "type": "F64" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `,` type($value) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.set.i32", "summary": "Primitive type element mutator.", "description": "Sets the element at the given index to the new value.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" }, { "name": "value", "type": "I32" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `,` type($value) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.set.i64", "summary": "Primitive type element mutator.", "description": "Sets the element at the given index to the new value.", "operands": [ { "name": "list", "type": "VM_ListOf" }, { "name": "index", "type": "VM_ListIndex" }, { "name": "value", "type": "I64" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `,` type($value) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.set.ref", "summary": "ref type element mutator.", "description": "Sets the element at the given index to the new ref value (possibly null).", "operands": [ { "name": "list", "type": "VM_AnyList" }, { "name": "index", "type": "VM_ListIndex" }, { "name": "value", "type": "VM_AnyRef" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `,` type($index) `,` type($value) `)`", "hasCustomAssemblyFormat": true }, { "name": "vm.list.size", "summary": "The size of the list in elements.", "description": "Returns the current size of the list in elements.", "operands": [ { "name": "list", "type": "VM_AnyList" } ], "results": [ { "name": "result", "type": "VM_ListIndex" } ], "assemblyFormat": "operands attr-dict `:` `(` type($list) `)` `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log.f32", "summary": "Base-e logarithm of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log.f64", "summary": "Base-e logarithm of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log10.f32", "summary": "Base-10 logarithm of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log10.f64", "summary": "Base-10 logarithm of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log1p.f32", "summary": "Natural logarithm of one plus the given value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log1p.f64", "summary": "Natural logarithm of one plus the given value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log2.f32", "summary": "Base-2 logarithm of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.log2.f64", "summary": "Base-2 logarithm of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.max.f32", "summary": "Floating point maximum operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.max.f64", "summary": "Floating point maximum operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.max.i32.s", "summary": "Signed integer maximum operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.max.i32.u", "summary": "Unsigned integer maximum operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.max.i64.s", "summary": "Signed integer maximum operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.max.i64.u", "summary": "Unsigned integer maximum operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.min.f32", "summary": "Floating point minimum operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.min.f64", "summary": "Floating point minimum operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.min.i32.s", "summary": "Signed integer minimum operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.min.i32.u", "summary": "Unsigned integer minimum operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.min.i64.s", "summary": "Signed integer minimum operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.min.i64.u", "summary": "Unsigned integer minimum operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.module", "summary": "Module containing VM functions and variables.", "description": "Top-level container for VM functions.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "ordinal_counts", "type": "OptionalAttr" }, { "name": "version", "type": "OptionalAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility)\n $sym_name\n attr-dict-with-keyword\n regions", "hasCustomAssemblyFormat": true }, { "name": "vm.module_terminator", "summary": "Terminator pseudo-op for the module op.", "assemblyFormat": "attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vm.mul.f32", "summary": "Floating point multiplication operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.mul.f64", "summary": "Floating point multiplication operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.mul.i32", "summary": "Integer multiplication operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.mul.i64", "summary": "Integer multiplication operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.neg.f32", "summary": "Floating point negation operation.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.neg.f64", "summary": "Floating point negation operation.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.not.i32", "summary": "Integer binary not operation.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.not.i64", "summary": "Integer binary not operation.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.optimization_barrier", "summary": "Prevents compiler optimizations across a value.", "description": "Wraps any operands in an unoptimizable identity to prevent its results from\n being folded. It will be dropped during the final step in compilation and\n has no effect at runtime.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "AllTypesMatch<['operands', 'results']>" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "vm.or.i32", "summary": "Integer binary or operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.or.i64", "summary": "Integer binary or operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.pow.f32", "summary": "Floating point raised to the power of operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.pow.f64", "summary": "Floating point raised to the power of operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.print", "summary": "Message printing operation.", "description": "Prints the given string message and zero or more values.", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "message", "type": "StrAttr" } ], "assemblyFormat": "$message `(` operands `)` attr-dict `:` type(operands)", "hasCustomAssemblyFormat": true }, { "name": "vm.rem.f32", "summary": "Floating point remainder operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rem.f64", "summary": "Floating point remainder operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rem.i32.s", "summary": "Signed integer division remainder operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rem.i32.u", "summary": "Unsigned integer division remainder operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rem.i64.s", "summary": "Signed integer division remainder operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rem.i64.u", "summary": "Unsigned integer division remainder operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.return", "summary": "Return operation.", "description": "Represents a return operation within a function.\n\n ```\n vm.func @foo(%0: i32, %1: f8) -> (i32, f8) {\n vm.return %0, %1 : i32, f8\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?", "hasCustomAssemblyFormat": true }, { "name": "vm.rodata", "summary": "Read-only data definition operation.", "description": "Defines a blob of read-only constant data that can be represented as a\n ref. This can be used to store arbitrary data within modules such as\n large constant buffers and other file contents.\n\n Note that the data is reference counted as a way to track its usage once the\n value leaves the module. For example, returning rodata from an exported\n function must keep the data (possibly backed by mmap) valid for its entire\n lifetime.\n\n By default all rodata will be aligned in the final module output at a\n 16-byte granularity. An optional alignment can be specified to override the\n default for cases where larger or smaller alignments are needed.", "attributes": [ { "name": "sym_visibility", "type": "OptionalAttr" }, { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "value", "type": "Util_AnySerializableAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "ordinal", "type": "OptionalAttr" }, { "name": "mime_type", "type": "OptionalAttr" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "assemblyFormat": "custom($sym_visibility) $sym_name attr-dict $value", "hasCustomAssemblyFormat": true }, { "name": "vm.rodata.inline", "summary": "Inlined constant rodata.", "description": "vm.rodata that can be embedded inline in functions. See vm.rodata for more\n information.", "results": [ { "name": "result", "type": "VM_RefOf" } ], "attributes": [ { "name": "name", "type": "OptionalAttr" }, { "name": "value", "type": "Util_AnySerializableAttr" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "mime_type", "type": "OptionalAttr" } ], "assemblyFormat": "($name^)? attr-dict `:` type($result) `=` $value", "hasCustomAssemblyFormat": true }, { "name": "vm.rodata.table.inline", "summary": "Inlined constant rodata table.", "description": "vm.rodata with another associated vm.rodata table specifying byte offsets\n and sizes as a subview into the flattened data. The table is a flat array\n of 32 or 64-bit integers storing (offset, size) in element order.\n\n The optional alignment attribute applies to both the table and data rodata.\n The data_alignment attribute can be used to specify an alignment for the\n elements of the table, padding to the data alignment with zeros. The element\n sizes reflect the unpadded attribute storage sizes.\n\n See vm.rodata for more information.", "results": [ { "name": "table_result", "type": "VM_RefOf" }, { "name": "data_result", "type": "VM_RefOf" } ], "attributes": [ { "name": "table_name", "type": "OptionalAttr" }, { "name": "data_name", "type": "OptionalAttr" }, { "name": "table_type", "type": "TypeAttrOf" }, { "name": "data_array", "type": "TypedArrayAttrBase" }, { "name": "alignment", "type": "OptionalAttr" }, { "name": "data_alignment", "type": "OptionalAttr" }, { "name": "mime_type", "type": "OptionalAttr" } ], "assemblyFormat": "$table_type attr-dict `:` type($table_result) `,` type($data_result) `=` $data_array", "hasCustomAssemblyFormat": true }, { "name": "vm.round.f32", "summary": "Rounds the value to the nearest integer away from zero.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.round.f32.even", "summary": "Rounds the value to the nearest even integer.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.round.f64", "summary": "Rounds the value to the nearest integer away from zero.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.round.f64.even", "summary": "Rounds the value to the nearest even integer.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rsqrt.f32", "summary": "Reciprocal of sqrt (1 / sqrt of the specified value).", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.rsqrt.f64", "summary": "Reciprocal of sqrt (1 / sqrt of the specified value).", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.select.f32", "summary": "Floating-point select operation.", "description": "Chooses one value based on a binary condition supplied as its first operand.\n If the value of the condition is true the `true_value` operand is chosen,\n otherwise the `false_value` operand is chosen. The true and false values\n must have the same types. For example, the maximum operation is obtained by\n combining \"select\" with \"cmpi\" as follows:\n\n ```\n %2 = vm.cmp.gt.i32.s %0, %1 : i32\n %3 = vm.select.i32 %2, %0, %1 : i32\n ```", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "true_value", "type": "F32" }, { "name": "false_value", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.select.f64", "summary": "Floating-point select operation.", "description": "Chooses one value based on a binary condition supplied as its first operand.\n If the value of the condition is true the `true_value` operand is chosen,\n otherwise the `false_value` operand is chosen. The true and false values\n must have the same types. For example, the maximum operation is obtained by\n combining \"select\" with \"cmpi\" as follows:\n\n ```\n %2 = vm.cmp.gt.i32.s %0, %1 : i32\n %3 = vm.select.i32 %2, %0, %1 : i32\n ```", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "true_value", "type": "F64" }, { "name": "false_value", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.select.i32", "summary": "Integer select operation.", "description": "Chooses one value based on a binary condition supplied as its first operand.\n If the value of the condition is true the `true_value` operand is chosen,\n otherwise the `false_value` operand is chosen. The true and false values\n must have the same types. For example, the maximum operation is obtained by\n combining \"select\" with \"cmpi\" as follows:\n\n ```\n %2 = vm.cmp.gt.i32.s %0, %1 : i32\n %3 = vm.select.i32 %2, %0, %1 : i32\n ```", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "true_value", "type": "I32" }, { "name": "false_value", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.select.i64", "summary": "Integer select operation.", "description": "Chooses one value based on a binary condition supplied as its first operand.\n If the value of the condition is true the `true_value` operand is chosen,\n otherwise the `false_value` operand is chosen. The true and false values\n must have the same types. For example, the maximum operation is obtained by\n combining \"select\" with \"cmpi\" as follows:\n\n ```\n %2 = vm.cmp.gt.i32.s %0, %1 : i32\n %3 = vm.select.i32 %2, %0, %1 : i32\n ```", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "true_value", "type": "I64" }, { "name": "false_value", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.select.ref", "summary": "ref select operation.", "description": "Chooses one value based on a binary condition supplied as its first operand.\n If the value of the condition is true the `true_value` operand is chosen,\n otherwise the `false_value` operand is chosen.", "operands": [ { "name": "condition", "type": "VM_CondValue" }, { "name": "true_value", "type": "VM_AnyRef" }, { "name": "false_value", "type": "VM_AnyRef" } ], "results": [ { "name": "result", "type": "VM_AnyRef" } ], "traits": [ { "type": "AllTypesMatch<['true_value', 'false_value', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.shl.i32", "summary": "Integer shift left operation.", "description": "Shifts the operand in a direction by the number of bits specified.", "operands": [ { "name": "operand", "type": "I32" }, { "name": "amount", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `,` $amount attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.shl.i64", "summary": "Integer shift left operation.", "description": "Shifts the operand in a direction by the number of bits specified.", "operands": [ { "name": "operand", "type": "I64" }, { "name": "amount", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `,` $amount attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.shr.i32.s", "summary": "Signed integer (arithmetic) shift right operation.", "description": "Shifts the operand in a direction by the number of bits specified.", "operands": [ { "name": "operand", "type": "I32" }, { "name": "amount", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `,` $amount attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.shr.i32.u", "summary": "Unsigned integer (logical) shift right operation.", "description": "Shifts the operand in a direction by the number of bits specified.", "operands": [ { "name": "operand", "type": "I32" }, { "name": "amount", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `,` $amount attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.shr.i64.s", "summary": "Signed integer (arithmetic) shift right operation.", "description": "Shifts the operand in a direction by the number of bits specified.", "operands": [ { "name": "operand", "type": "I64" }, { "name": "amount", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `,` $amount attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.shr.i64.u", "summary": "Unsigned integer (logical) shift right operation.", "description": "Shifts the operand in a direction by the number of bits specified.", "operands": [ { "name": "operand", "type": "I64" }, { "name": "amount", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand `,` $amount attr-dict `:` type($operand)", "hasCustomAssemblyFormat": true }, { "name": "vm.sin.f32", "summary": "Sine of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sin.f64", "summary": "Sine of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sqrt.f32", "summary": "Sqrt of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sqrt.f64", "summary": "Sqrt of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sub.f32", "summary": "Floating point subtraction operation.", "operands": [ { "name": "lhs", "type": "F32" }, { "name": "rhs", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sub.f64", "summary": "Floating point subtraction operation.", "operands": [ { "name": "lhs", "type": "F64" }, { "name": "rhs", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sub.i32", "summary": "Integer subtract operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.sub.i64", "summary": "Integer subtract operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.switch.f32", "summary": "Floating-point switch operation.", "description": "Returns the value with the given `index` in `values` or `default_value` if\n the index is out of bounds.\n\n ```mlir\n // Switch %index to cases of %c100/%c200/%c300 if index==0, ==1, ==2.\n // If %index is out of range (<0 or >2) then default to %c5.\n %0 = vm.switch.f32 %index[%c100, %c200, %c300] else %c5 : f32\n ```", "operands": [ { "name": "index", "type": "VM_Index" }, { "name": "default_value", "type": "F32" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['default_value', 'result']>" } ], "assemblyFormat": "$index `[` $values `]` `else` $default_value attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.switch.f64", "summary": "Floating-point switch operation.", "description": "Returns the value with the given `index` in `values` or `default_value` if\n the index is out of bounds.\n\n ```mlir\n // Switch %index to cases of %c100/%c200/%c300 if index==0, ==1, ==2.\n // If %index is out of range (<0 or >2) then default to %c5.\n %0 = vm.switch.f32 %index[%c100, %c200, %c300] else %c5 : f32\n ```", "operands": [ { "name": "index", "type": "VM_Index" }, { "name": "default_value", "type": "F64" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['default_value', 'result']>" } ], "assemblyFormat": "$index `[` $values `]` `else` $default_value attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.switch.i32", "summary": "Integer switch operation.", "description": "Returns the value with the given `index` in `values` or `default_value` if\n the index is out of bounds.\n\n ```mlir\n // Switch %index to cases of %c100/%c200/%c300 if index==0, ==1, ==2.\n // If %index is out of range (<0 or >2) then default to %c5.\n %0 = vm.switch.i32 %index[%c100, %c200, %c300] else %c5 : i32\n ```", "operands": [ { "name": "index", "type": "VM_Index" }, { "name": "default_value", "type": "I32" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['default_value', 'result']>" } ], "assemblyFormat": "$index `[` $values `]` `else` $default_value attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.switch.i64", "summary": "Integer switch operation.", "description": "Returns the value with the given `index` in `values` or `default_value` if\n the index is out of bounds.\n\n ```mlir\n // Switch %index to cases of %c100/%c200/%c300 if index==0, ==1, ==2.\n // If %index is out of range (<0 or >2) then default to %c5.\n %0 = vm.switch.i32 %index[%c100, %c200, %c300] else %c5 : i32\n ```", "operands": [ { "name": "index", "type": "VM_Index" }, { "name": "default_value", "type": "I64" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['default_value', 'result']>" } ], "assemblyFormat": "$index `[` $values `]` `else` $default_value attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.switch.ref", "summary": "ref switch operation.", "description": "Returns the value with the given `index` in `values` or `default_value` if\n the index is out of bounds.\n\n ```mlir\n // Switch %arg0 to cases of %r0/%r1/%r2 if arg0==0, ==1, ==2.\n // If %arg0 is out of range (<0 or >2) then default to %null.\n %0 = vm.switch.ref %index[%r0, %r1, %r2] else %null : vm.ref\n ```", "operands": [ { "name": "index", "type": "VM_Index" }, { "name": "default_value", "type": "VM_AnyRef" }, { "name": "values", "type": "Variadic" } ], "results": [ { "name": "result", "type": "VM_AnyRef" } ], "traits": [ { "type": "AllTypesMatch<['default_value', 'result']>" } ], "hasCustomAssemblyFormat": true }, { "name": "vm.tanh.f32", "summary": "Hyperbolic tangent of the specified value.", "operands": [ { "name": "operand", "type": "F32" } ], "results": [ { "name": "result", "type": "F32" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.tanh.f64", "summary": "Hyperbolic tangent of the specified value.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F64" } ], "traits": [ { "type": "AllTypesMatch<['operand', 'result']>" } ], "assemblyFormat": "$operand attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trace", "summary": "Trace value(s) operation.", "description": "Traces one or more values at the time the operation is executed.\n These values will be encoded into the active trace depending on the active\n trace verbosity setting.", "operands": [ { "name": "operands", "type": "Variadic" } ], "attributes": [ { "name": "event_name", "type": "StrAttr" } ], "assemblyFormat": "$event_name `(` operands `)` attr-dict `:` type(operands)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.f64.f32", "summary": "Floating-point truncate to 32 bits.", "operands": [ { "name": "operand", "type": "F64" } ], "results": [ { "name": "result", "type": "F32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.i16.i8", "summary": "Integer truncate to 8 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.i32.i16", "summary": "Integer truncate to 16 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.i32.i8", "summary": "Integer truncate to 8 bits.", "operands": [ { "name": "operand", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.i64.i16", "summary": "Integer truncate to 16 bits.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.i64.i32", "summary": "Integer truncate to 32 bits.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.trunc.i64.i8", "summary": "Integer truncate to 8 bits.", "operands": [ { "name": "operand", "type": "I64" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$operand attr-dict `:` type($operand) `->` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.xor.i32", "summary": "Integer binary exclusive-or operation.", "operands": [ { "name": "lhs", "type": "I32" }, { "name": "rhs", "type": "I32" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.xor.i64", "summary": "Integer binary exclusive-or operation.", "operands": [ { "name": "lhs", "type": "I64" }, { "name": "rhs", "type": "I64" } ], "results": [ { "name": "result", "type": "I64" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "operands attr-dict `:` type($result)", "hasCustomAssemblyFormat": true }, { "name": "vm.yield", "summary": "Unconditional fiber yield operation.", "description": "Yields the fiber for some (likely short) amount of time. This can be used to\n perform cooperative scheduling and ensure fair (enough) execution. Execution\n resumes at the specified target branch.\n\n ```\n ^bb0:\n vm.yield ^on_resume\n ^on_resume:\n ...\n ```", "operands": [ { "name": "destOperands", "type": "Variadic" } ], "successors": [ { "name": "dest", "type": "AnySuccessor" } ], "assemblyFormat": "$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vmvx.binary", "summary": "Performs a strided elementwise operation on two same-rank buffers.", "description": "Performs the operation in-place as if:\n ```\n OUT = OP(LHS, RHS)\n ```\n\n Where `OP` is a concrete operation name as defined in ukernel/elementwise.h", "operands": [ { "name": "lhs_buffer", "type": "VMVX_Buffer" }, { "name": "lhs_offset", "type": "VMVX_Index" }, { "name": "lhs_strides", "type": "Variadic" }, { "name": "rhs_buffer", "type": "VMVX_Buffer" }, { "name": "rhs_offset", "type": "VMVX_Index" }, { "name": "rhs_strides", "type": "Variadic" }, { "name": "out_buffer", "type": "VMVX_Buffer" }, { "name": "out_offset", "type": "VMVX_Index" }, { "name": "out_strides", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" } ], "attributes": [ { "name": "opcode", "type": "StrAttr" }, { "name": "element_type", "type": "VMVX_ElementTypeAttr" } ], "assemblyFormat": "`op` `` `(` $opcode `:` $element_type `)`\n `lhs` `` `(` $lhs_buffer `offset` $lhs_offset `strides` `[` $lhs_strides `]` `:` type($lhs_buffer) `)`\n `rhs` `` `(` $rhs_buffer `offset` $rhs_offset `strides` `[` $rhs_strides `]` `:` type($rhs_buffer) `)`\n `out` `` `(` $out_buffer `offset` $out_offset `strides` `[` $out_strides `]` `:` type($out_buffer) `)`\n `sizes` `` `(` $sizes `)`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vmvx.copy", "summary": "Copy from one buffer to another.", "operands": [ { "name": "in_buffer", "type": "VMVX_Buffer" }, { "name": "in_offset", "type": "VMVX_Index" }, { "name": "in_strides", "type": "Variadic" }, { "name": "out_buffer", "type": "VMVX_Buffer" }, { "name": "out_offset", "type": "VMVX_Index" }, { "name": "out_strides", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" } ], "attributes": [ { "name": "element_type", "type": "VMVX_ElementTypeAttr" } ], "assemblyFormat": "`in` `` `(` $in_buffer `offset` $in_offset `strides` `[` $in_strides `]` `:` type($in_buffer) `)`\n `out` `` `(` $out_buffer `offset` $out_offset `strides` `[` $out_strides `]` `:` type($out_buffer) `)`\n `sizes` `` `(` $sizes `)`\n `:` $element_type\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vmvx.fill2d", "summary": "Fill a tile with a scalar.", "description": "Fills a tile with dimensions [m, n] with a scalar.", "operands": [ { "name": "scalar", "type": "VMVX_ElementType" }, { "name": "out_buffer", "type": "VMVX_Buffer" }, { "name": "out_offset", "type": "VMVX_Index" }, { "name": "out_row_stride", "type": "VMVX_Index" }, { "name": "m", "type": "VMVX_Index" }, { "name": "n", "type": "VMVX_Index" } ], "assemblyFormat": "`scalar` `` `(` $scalar `:` type($scalar) `)`\n `out` `` `(` $out_buffer `offset` $out_offset `row_stride` $out_row_stride `:` type($out_buffer) `)`\n `sizes` `` `(` $m `,` $n `)`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vmvx.get_buffer_descriptor", "summary": "Late binds a base buffer/offset/strides.", "description": "Queries a base buffer, offset and strides. This op is late bound to its\n source (alloca, binding, etc), allowing additional layers of\n transformations to be added as lowering progresses (or for buffers to be\n combined).\n\n This op has canonicalization rules which will bubble it up through the\n view stack. A final reconciliation pass is used explicitly to bind it to\n concrete sources.", "operands": [ { "name": "source", "type": "AnyMemRef" } ], "results": [ { "name": "base_buffer", "type": "Util_BufferType" }, { "name": "offset", "type": "Index" }, { "name": "sizes", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "assemblyFormat": "$source `:` type($source) `->` type(results) attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vmvx.get_raw_interface_binding_buffer", "summary": "Gets the raw buffer associated with a binding.", "description": "Normally, a slice of a binding buffer is returned via\n hal.interface.binding.subspan. However, the normal VMVX lowering flow for\n this presumes that the result is a memref, and upon final conversion, it\n will offset the memref automatically to make it consistent.\n\n This op is used in situations where earlier in a lowering, we have fully\n resolved the binding to a buffer and would just like the raw backing\n buffer as passed to the interface.", "results": [ { "name": "buffer", "type": "Util_BufferType" } ], "attributes": [ { "name": "layout", "type": "HAL_PipelineLayoutAttr" }, { "name": "binding", "type": "IndexAttr" } ], "assemblyFormat": "`layout` `(` $layout `)`\n `binding` `(` $binding `)`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "vmvx.unary", "summary": "Performs a strided elementwise unary operation.", "description": "Performs the operation in-place as if:\n ```\n OUT = OP(IN)\n ```\n\n Where `OP` is a concrete operation name as defined in ukernel/elementwise.h", "operands": [ { "name": "in_buffer", "type": "VMVX_Buffer" }, { "name": "in_offset", "type": "VMVX_Index" }, { "name": "in_strides", "type": "Variadic" }, { "name": "out_buffer", "type": "VMVX_Buffer" }, { "name": "out_offset", "type": "VMVX_Index" }, { "name": "out_strides", "type": "Variadic" }, { "name": "sizes", "type": "Variadic" } ], "attributes": [ { "name": "opcode", "type": "StrAttr" }, { "name": "element_type", "type": "VMVX_ElementTypeAttr" } ], "assemblyFormat": "`op` `` `(` $opcode `:` $element_type `)`\n `in` `` `(` $in_buffer `offset` $in_offset `strides` `[` $in_strides `]` `:` type($in_buffer) `)`\n `out` `` `(` $out_buffer `offset` $out_offset `strides` `[` $out_strides `]` `:` type($out_buffer) `)`\n `sizes` `` `(` $sizes `)`\n attr-dict", "hasCustomAssemblyFormat": true }, { "name": "wasmssa.abs", "summary": "Floating point absolute value", "description": "Example:\n\n ```mlir\n %a = wasmssa.abs %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.add", "summary": "Sum two values", "description": "Example:\n\n ```mlir\n %a = wasmssa.add %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.and", "summary": "Compute the bitwise AND between two values", "description": "Example:\n\n ```mlir\n %a = wasmssa.and %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.block", "summary": "Create a nesting level with a label at its exit.", "description": "Defines a Wasm block, creating a new nested scope.\n A block contains a body region and an optional list of input values.\n Control can enter the block and later branch out to the block target.\n Example:\n\n ```mlir\n wasmssa.block {\n\n // instructions\n\n } > ^successor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "successors": [ { "name": "target", "type": "AnySuccessor" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "(`(`$inputs^`)` `:` type($inputs))? attr-dict `:` $body `>` $target" }, { "name": "wasmssa.block_return", "summary": "Return from the current block", "description": "Escape from the current nesting level and return the control flow to its successor.\n Optionally, mark the arguments that should be transfered to the successor block.\n\n This shouldn't be confused with branch operations that targets the label defined\n by the nesting level operation.\n\n For instance, a `wasmssa.block_return` in a loop will give back control to the\n successor of the loop, where a `branch` targeting the loop will flow back to the entry block of the loop.\n\n Example:\n\n ```mlir\n wasmssa.block_return\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "assemblyFormat": "($inputs^ `:` type($inputs))? attr-dict" }, { "name": "wasmssa.branch_if", "summary": "Jump to target level if condition has non-zero value", "description": "Jump to target level if the condition is has a non-zero value.\n\n Example:\n\n ```mlir\n wasmssa.branch_if %a to level 0 with args(%b : i32) else ^bb1\n ```", "operands": [ { "name": "condition", "type": "I32" }, { "name": "inputs", "type": "Variadic" } ], "attributes": [ { "name": "exitLevel", "type": "UI32Attr" } ], "successors": [ { "name": "elseSuccessor", "type": "AnySuccessor" } ], "assemblyFormat": "$condition `to` `level` $exitLevel (`with` `args` `(`$inputs^ `:` type($inputs)`)`)? `else` $elseSuccessor attr-dict" }, { "name": "wasmssa.call", "summary": "Calling a Wasm function", "description": "Emits a call to a defined function\n\n Example:\n\n ```mlir\n %a = wasmssa.call @func_0 : () -> i32\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee (`(`$operands^`)`)? attr-dict `:` functional-type($operands, $results)" }, { "name": "wasmssa.ceil", "summary": "Ceil rounding of floating point value", "description": "Example:\n\n ```mlir\n %a = wasmssa.ceil %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.clz", "summary": "Count leading zeroes of an integer", "description": "Example:\n\n ```mlir\n %a = wasmssa.clz %b : i32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.const", "summary": "Operator that represents a constant value", "description": "Defines a constant value.\n\n Example:\n\n ```mlir\n // Example of integer constant\n %a = wasmssa.const 1 : i32\n\n // Example of floating point constant\n %b = wasmssa.const 9.000000e+00 : f64\n ```", "results": [ { "name": "result", "type": "WasmSSA_NumericType" } ], "attributes": [ { "name": "value", "type": "TypedAttrInterface" } ], "traits": [ { "type": "AllTypesMatch<['value', 'result']>" } ], "assemblyFormat": "$value attr-dict" }, { "name": "wasmssa.convert_s", "summary": "Convert integer interpreted as 2's complement signed value to floating-point value.\n\n Consume an integer and produces a floating point value containing the rounded value of the original operand. Rounding is round to nearest, tie to even.", "description": "Example:\n\n ```mlir\n %a = wasmssa.convert_s %b : i32 to f64\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.convert_u", "summary": "Convert integer, interpreted as binary encoded positive value, to floating-point value.\n\n Consume an integer and produces a floating point value containing the rounded value of the original operand. Rounding is round to nearest, tie to even.", "description": "Example:\n\n ```mlir\n %a = wasmssa.convert_u %b : i32 to f64\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.copysign", "summary": "Copy sign from one floating point value to the other.", "description": "Example:\n\n ```mlir\n %a = wasmssa.copysign %b %c : f32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.ctz", "summary": "Count trailing zeroes of an integer", "description": "Example:\n\n ```mlir\n %a = wasmssa.ctz %b : i32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.demote", "summary": "Convert a f64 value to f32", "description": "Example:\n\n ```mlir\n %a = wasmssa.demote %b : f64 to f32\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[F64]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[F32]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.div", "summary": "Division between floating point values", "description": "Example:\n\n ```mlir\n %a = wasmssa.div %b %c : f32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.div_si", "summary": "Divide values interpreted as signed int", "description": "Example:\n\n ```mlir\n %a = wasmssa.div_si %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.div_ui", "summary": "Divide values interpreted as unsigned int", "description": "Example:\n\n ```mlir\n %a = wasmssa.div_ui %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.eq", "summary": "Check if two values are equal", "description": "Example:\n\n ```mlir\n %a = wasmssa.eq %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.eqz", "summary": "Check if the given value is equal to zero", "description": "Example:\n\n ```mlir\n %a = wasmssa.eqz %b : i64 -> i32\n ```", "operands": [ { "name": "input", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "I32" } ], "assemblyFormat": "$input`:` type($input) `->` type($result) attr-dict" }, { "name": "wasmssa.extend", "description": "Extend low bytes of a value to fit a given width.\n For instance, signed extension from 8 low bits of the 32-bits integer value\n 254 (0x000000FE) would produce the value -2 (0xFFFFFFFE).\n\n This corresponds to the `extendnn` instruction of Wasm, which shouldn't be\n confused with the `extend_inn` Wasm instruction, for which all input bits\n are used and widened to wider output type.\n In this operation, input and output types are the same.\n\n Example:\n\n ```mlir\n %a = wasmssa.extend 16 low bits from %[[VAL_0]]: i64\n ```", "operands": [ { "name": "input", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "WasmSSA_IntegerType" } ], "attributes": [ { "name": "bitsToTake", "type": "Builtin_IntegerAttr" } ], "traits": [ { "type": "AllTypesMatch<['input', 'result']>" } ], "assemblyFormat": "$bitsToTake `low` `bits` `from` $input `:` type($input) attr-dict" }, { "name": "wasmssa.extend_i32_s", "summary": "Sign extend i32 to i64.", "description": "Example:\n\n ```mlir\n %a = wasmssa.extend_i32_s %b to i64\n ```", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$input `to` type($result) attr-dict" }, { "name": "wasmssa.extend_i32_u", "summary": "Zero extend i32 to i64.", "description": "Example:\n\n ```mlir\n %a = wasmssa.extend_i32_s %b to i64\n ```", "operands": [ { "name": "input", "type": "I32" } ], "results": [ { "name": "result", "type": "I64" } ], "assemblyFormat": "$input `to` type($result) attr-dict" }, { "name": "wasmssa.floor", "summary": "Floor rounding of floating point value", "description": "Example:\n\n ```mlir\n %a = wasmssa.floor %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.func", "description": "Represents a Wasm function definition.\n\n In Wasm function, locals and function arguments are interchangeable.\n They are for instance both accessed using `local.get` instruction.\n\n On the other hand, a function type is defined as a pair of tuples of Wasm value types.\n To model this, the wasm.func operation has:\n\n - A function type that represents the corresponding Wasm type (tuples of value types)\n\n - Arguments of the entry block of type `!wasm`, with T the corresponding type\n in the function type.\n\n By default, `wasmssa.func` have nested visibility. Functions exported by the module\n are marked with the exported attribute. This gives them public visibility.\n\n Example:\n\n ```mlir\n // Internal function with no arguments that returns a float32\n wasmssa.func @my_f32_func() -> f32\n\n // Exported function with no arguments that returns a float32\n wasmssa.func exported @my_f32_func() -> f32\n\n // A function that takes a local ref argument\n wasmssa.func @i64_wrap(%a: !wasmssa) -> i32\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "functionType", "type": "WasmSSA_FuncTypeAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "exported", "type": "UnitAttr" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "wasmssa.ge", "summary": "Check if a float value is greater or equal to another", "description": "Example:\n\n ```mlir\n %a = wasmssa.ge %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.ge_si", "summary": "Check if a signed integer value is greater or equal to another", "description": "Example:\n\n ```mlir\n %a = wasmssa.ge_si %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.ge_ui", "summary": "Check if an unsigned integer value is greater or equal to another", "description": "Example:\n\n ```mlir\n %a = wasmssa.ge_ui %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.global", "summary": "WebAssembly global value", "description": "WebAssembly global variable.\n Body contains the initialization instructions for the variable value.\n The body must contain only instructions considered `const` in a webassembly context,\n such as `wasmssa.const` or `global.get`.\n\n By default, `wasmssa.global` have nested visibility. Global exported by the module\n are marked with the exported attribute. This gives them public visibility.\n\n Example:\n\n ```mlir\n // Define module_global_var, an internal mutable i32 global variable equal to 10.\n wasmssa.global @module_global_var i32 mutable : {\n %[[VAL_0:.*]] = wasmssa.const 10 : i32\n wasmssa.return %[[VAL_0]] : i32\n }\n\n // Define global_var, an exported constant i32 global variable equal to 42.\n wasmssa.global @global_var i32 : {\n %[[VAL_0:.*]] = wasmssa.const 42 : i32\n wasmssa.return %[[VAL_0]] : i32\n }\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "WasmSSA_ValTypeAttr" }, { "name": "isMutable", "type": "UnitAttr" }, { "name": "exported", "type": "UnitAttr" } ], "regions": [ { "name": "initializer", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "wasmssa.global_get", "summary": "Returns the value of the global passed as argument.", "description": "Retrieves the value of the global passed as argument and stores it in a\n variable\n\n Example:\n\n ```mlir\n // Gets the value of `@global_0` and stores its value in %a\n %a = wasmssa.global_get @global_0 : i32\n ```", "results": [ { "name": "global_val", "type": "WasmSSA_ValType" } ], "attributes": [ { "name": "global", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$global attr-dict `:` type($global_val)" }, { "name": "wasmssa.gt", "summary": "Check if a float value is greater than another", "description": "Example:\n\n ```mlir\n %a = wasmssa.gt %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.gt_si", "summary": "Check if a signed integer value is greater than another", "description": "Example:\n\n ```mlir\n %a = wasmssa.gt_si %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.gt_ui", "summary": "Check if an unsigned integer value is greater than another", "description": "Example:\n\n ```mlir\n %a = wasmssa.gt_ui %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.if", "summary": "Execute the if region if condition value is non-zero, the else region otherwise.", "description": "Execute the if region if the condition is non-zero. Otherwise the else region is executed.\n The else region can be empty but must return the same datatype as the if region.\n If clauses can be nested.\n\n Example:\n\n ```mlir\n // Runs the if clause is %a is non-zero\n wasmssa.if %a {\n // Execute if %a is non-zero\n } else {\n // else clause\n }\n ```", "operands": [ { "name": "condition", "type": "I32" }, { "name": "inputs", "type": "Variadic" } ], "successors": [ { "name": "target", "type": "AnySuccessor" } ], "regions": [ { "name": "if", "type": "AnyRegion" }, { "name": "else", "type": "AnyRegion" } ], "assemblyFormat": "$condition (`(`$inputs^`)` `:` type($inputs))? attr-dict `:` $if custom($else) `>` $target" }, { "name": "wasmssa.import_func", "summary": "Importing a function variable", "description": "Imports a function from another module\n\n Example:\n\n ```mlir\n // Imports foo(i32) -> () from the module my_module\n wasmssa.import_func \"foo\" from \"my_module\" as @func_0 {sym_visibility = \"nested\", type = (i32) -> ()}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "moduleName", "type": "StrAttr" }, { "name": "importName", "type": "StrAttr" }, { "name": "type", "type": "WasmSSA_FuncTypeAttr" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "res_attrs", "type": "OptionalAttr>" } ], "assemblyFormat": "$importName `from` $moduleName `as` $sym_name attr-dict" }, { "name": "wasmssa.import_global", "summary": "Importing a global variable", "description": "Imports a global from another module\n\n Example:\n\n ```mlir\n // Imports the \"glob\" i32 global from the module my_module as \"global_0\"\n wasmssa.import_global \"glob\" from \"my_module\" as @global_0 nested : i32\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "moduleName", "type": "StrAttr" }, { "name": "importName", "type": "StrAttr" }, { "name": "type", "type": "WasmSSA_ValTypeAttr" }, { "name": "isMutable", "type": "UnitAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "wasmssa.import_mem", "summary": "Importing a memory", "description": "Import a memory from another module.\n\n Example:\n\n ```mlir\n // Import the memory `mem` from `my_module` as @mem_0\n wasmssa.import_mem \"mem\" from \"my_module\" as @mem_0 {limits = !wasmssa}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "moduleName", "type": "StrAttr" }, { "name": "importName", "type": "StrAttr" }, { "name": "limits", "type": "WasmSSA_LimitTypeAttr" } ], "assemblyFormat": "$importName `from` $moduleName `as` $sym_name attr-dict" }, { "name": "wasmssa.import_table", "summary": "Importing a table", "description": "Import a table from another module.\n\n Example:\n\n ```mlir\n // Import the table `table` from `my_module` as @table_0\n wasmssa.import_table \"table\" from \"my_module\" as @table_0 {type = !wasmssa}\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "moduleName", "type": "StrAttr" }, { "name": "importName", "type": "StrAttr" }, { "name": "type", "type": "WasmSSA_TableTypeAttr" } ], "assemblyFormat": "$importName `from` $moduleName `as` $sym_name attr-dict" }, { "name": "wasmssa.le", "summary": "Check if a float value is less or equal to another", "description": "Example:\n\n ```mlir\n %a = wasmssa.le %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.le_si", "summary": "Check if a signed integer value is less or equal to another", "description": "Example:\n\n ```mlir\n %a = wasmssa.le_si %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.le_ui", "summary": "Check if an unsigned integer value is less or equal to another", "description": "Example:\n\n ```mlir\n %a = wasmssa.le_ui %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.local", "summary": "Declaration of local variable", "description": "Declares a local variable\n\n Example:\n\n ```mlir\n // Declares `%a`, a float32 local\n %a = wasmssa.local of type f32\n ```", "results": [ { "name": "result", "type": "WasmSSA_LocalRef" } ], "attributes": [ { "name": "type", "type": "WasmSSA_ValTypeAttr" } ], "assemblyFormat": "`of` `type` $type attr-dict" }, { "name": "wasmssa.local_get", "summary": "Set local to value and return the operand.", "description": "Gets the value of a local variable and returns a reference to it.\n\n Example:\n\n ```mlir\n // Retrieves a reference to `%a`, a float32 local\n %b = wasmssa.local_get %a : ref to f32\n ```", "operands": [ { "name": "localVar", "type": "WasmSSA_LocalRef" } ], "results": [ { "name": "result", "type": "WasmSSA_ValType" } ], "assemblyFormat": "$localVar `:` type($localVar) attr-dict" }, { "name": "wasmssa.local_set", "summary": "Set local to given value", "description": "Sets the value of a local variable.\n\n Example:\n\n ```mlir\n // Sets `%d`, to the value of `%c`\n wasmssa.local_set %d : ref to i32 to %c : i32\n ```", "operands": [ { "name": "localVar", "type": "WasmSSA_LocalRef" }, { "name": "value", "type": "WasmSSA_ValType" } ], "assemblyFormat": "$localVar `:` type($localVar) `to` $value `:` type($value) attr-dict" }, { "name": "wasmssa.local_tee", "summary": "Set local to value and return the operand.", "description": "Sets the value of a local variable and returns it.\n\n Example:\n\n ```mlir\n // Sets `%b`, to the value of `%c` and returns it in %a\n %a = wasmssa.local_tee %b : ref to i32 to %c : i32\n ```", "operands": [ { "name": "localVar", "type": "WasmSSA_LocalRef" }, { "name": "value", "type": "WasmSSA_ValType" } ], "results": [ { "name": "result", "type": "WasmSSA_ValType" } ], "assemblyFormat": "$localVar `:` type($localVar) `to` $value `:` type($value) attr-dict" }, { "name": "wasmssa.loop", "summary": "Create a nesting level that define its entry as jump target.", "description": "Represents a Wasm loop construct. This defines a nesting level with\n a label at the entry of the region.\n\n Example:\n\n ```mlir\n wasmssa.loop {\n\n } > ^successor\n ```", "operands": [ { "name": "inputs", "type": "Variadic" } ], "successors": [ { "name": "target", "type": "AnySuccessor" } ], "regions": [ { "name": "body", "type": "AnyRegion" } ], "assemblyFormat": "(`(`$inputs^`)` `:` type($inputs))? attr-dict `:` $body `>` $target" }, { "name": "wasmssa.lt", "summary": "Check if a float value is less than another", "description": "Example:\n\n ```mlir\n %a = wasmssa.lt %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.lt_si", "summary": "Check if a signed integer value is less than another", "description": "Example:\n\n ```mlir\n %a = wasmssa.lt_si %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.lt_ui", "summary": "Check if an unsigned integer value is less than another", "description": "Example:\n\n ```mlir\n %a = wasmssa.lt_ui %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.max", "summary": "Compute the minimum of two floating point values.", "description": "Example:\n\n ```mlir\n %a = wasmssa.max %b %c : f32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.memory", "summary": "WebAssembly memory definition", "description": "Define a memory to be used by the program.\n Multiple memories can be defined in the same module.\n\n By default, `wasmssa.memory` have nested visibility. Memory exported by\n the module are marked with the exported attribute. This gives them public\n visibility.\n\n Example:\n\n ```mlir\n // Define the `mem_0` (internal) memory with defined size bounds of [0:65536]\n wasmssa.memory @mem_0 !wasmssa\n\n // Define the `mem_1` exported memory with minimal size of 512\n wasmssa.memory exported @mem_1 !wasmssa\n ```", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "limits", "type": "WasmSSA_LimitTypeAttr" }, { "name": "exported", "type": "UnitAttr" } ], "assemblyFormat": "(`exported` $exported^)? $sym_name $limits attr-dict" }, { "name": "wasmssa.min", "summary": "Compute the minimum of two floating point values.", "description": "Example:\n\n ```mlir\n %a = wasmssa.min %b %c : f32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.mul", "summary": "Multiply two values", "description": "Example:\n\n ```mlir\n %a = wasmssa.mul %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.ne", "summary": "Check if two values are different", "description": "Example:\n\n ```mlir\n %a = wasmssa.ne %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "I32" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) `->` type($result) attr-dict" }, { "name": "wasmssa.nearest", "summary": "Round floating point value to the nearest integer, ties to even", "description": "Example:\n\n ```mlir\n %a = wasmssa.nearest %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.neg", "summary": "Floating point negation", "description": "Example:\n\n ```mlir\n %a = wasmssa.neg %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.or", "summary": "Compute the bitwise OR of two values", "description": "Example:\n\n ```mlir\n %a = wasmssa.or %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.popcnt", "summary": "Population count of an integer.", "description": "Example:\n\n ```mlir\n %a = wasmssa.popcnt %b : i32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.promote", "summary": "Get f64 representation of a f32 value.", "description": "Example:\n\n ```mlir\n %a = wasmssa.promote %b : f32 to f64\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[Builtin_Float32]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[Builtin_Float64]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.reinterpret", "summary": "Reinterpret the value represented by a bit vector by\n bit-casting it to another type of same representation width.", "description": "Example:\n\n ```mlir\n %a = wasmssa.reinterpret %b : f32 as i32\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "assemblyFormat": "$input `:` type($input) `as` type($result) attr-dict" }, { "name": "wasmssa.rem_si", "summary": "Calculate the remainder of dividing two integer values as signed integer", "description": "Example:\n\n ```mlir\n %a = wasmssa.rem_si %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.rem_ui", "summary": "Calculate the remainder of dividing two integer values as an unsigned integer", "description": "Example:\n\n ```mlir\n %a = wasmssa.rem_ui %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.return", "summary": "Return from the current function frame", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "wasmssa.rotl", "summary": "Rotate left.\n\n Consume an integer and an integer rotate. The first\n integer shall be rotated left by N bits, where N is the value of the\n second integer.", "description": "Example:\n\n ```mlir\n %a = wasmssa.rotl %b by %c bits : i64\n ```", "operands": [ { "name": "val", "type": "WasmSSA_IntegerType" }, { "name": "bits", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "WasmSSA_IntegerType" } ], "traits": [ { "type": "AllTypesMatch<['val', 'bits', 'result']>" } ], "assemblyFormat": "$val `by` $bits `bits` `:` type($val) attr-dict" }, { "name": "wasmssa.rotr", "summary": "Rotate right.\n\n Consume an integer, and an integer rotate. The first\n integer shall be rotated right by N bits, where N is the value of the\n second integer.", "description": "Example:\n\n ```mlir\n %a = wasmssa.rotr %b by %c bits : i64\n ```", "operands": [ { "name": "val", "type": "WasmSSA_IntegerType" }, { "name": "bits", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "WasmSSA_IntegerType" } ], "traits": [ { "type": "AllTypesMatch<['val', 'bits', 'result']>" } ], "assemblyFormat": "$val `by` $bits `bits` `:` type($val) attr-dict" }, { "name": "wasmssa.shl", "summary": "Consume an integer and an integer shift amount. The first\n integer shall be shifted left by N bits, where N is the value of the second\n integer.", "description": "Example:\n\n ```mlir\n %a = wasmssa.shl %b by %c bits : i64\n ```", "operands": [ { "name": "val", "type": "WasmSSA_IntegerType" }, { "name": "bits", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "WasmSSA_IntegerType" } ], "traits": [ { "type": "AllTypesMatch<['val', 'bits', 'result']>" } ], "assemblyFormat": "$val `by` $bits `bits` `:` type($val) attr-dict" }, { "name": "wasmssa.shr_s", "summary": "Arithmetic right shift.\n\n Consume an integer and an integer shift amount. The first\n integer shall be shifted right by N bits, where N is the value of the\n second integer.\n\n Vacated bits on the left shall be filled with the sign bit.", "description": "Example:\n\n ```mlir\n %a = wasmssa.shr_s %b by %c bits : i64\n ```", "operands": [ { "name": "val", "type": "WasmSSA_IntegerType" }, { "name": "bits", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "WasmSSA_IntegerType" } ], "traits": [ { "type": "AllTypesMatch<['val', 'bits', 'result']>" } ], "assemblyFormat": "$val `by` $bits `bits` `:` type($val) attr-dict" }, { "name": "wasmssa.shr_u", "summary": "Logical right shift.\n\n Consume an integer, and an integer shift amount. The first\n integer shall be shifted right by N bits, where N is the value of the\n second integer.\n\n Vacated bits on the left shall be filled with zeroes.", "description": "Example:\n\n ```mlir\n %a = wasmssa.shr_u %b by %c bits : i64\n ```", "operands": [ { "name": "val", "type": "WasmSSA_IntegerType" }, { "name": "bits", "type": "WasmSSA_IntegerType" } ], "results": [ { "name": "result", "type": "WasmSSA_IntegerType" } ], "traits": [ { "type": "AllTypesMatch<['val', 'bits', 'result']>" } ], "assemblyFormat": "$val `by` $bits `bits` `:` type($val) attr-dict" }, { "name": "wasmssa.sqrt", "summary": "Floating point square root", "description": "Example:\n\n ```mlir\n %a = wasmssa.sqrt %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.sub", "summary": "Subtract two values", "description": "Example:\n\n ```mlir\n %a = wasmssa.sub %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "wasmssa.table", "summary": "WebAssembly table value", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "type", "type": "WasmSSA_TableTypeAttr" }, { "name": "exported", "type": "UnitAttr" } ], "assemblyFormat": "(`exported` $exported^)? $sym_name $type attr-dict" }, { "name": "wasmssa.trunc", "summary": "Trunc of floating point value", "description": "Example:\n\n ```mlir\n %a = wasmssa.trunc %b : f32\n ```", "operands": [ { "name": "src", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'result']>" } ], "assemblyFormat": "$src`:` type($src) attr-dict" }, { "name": "wasmssa.trunc_si", "summary": "Truncate floating point value to signed integer.\n\n Consume a floating point value and produces a signed integer holding the value truncated toward zero.\n Traps if the value is NaN, is infinity, or is outside the range of the target integer type.", "description": "Example:\n\n ```mlir\n %a = wasmssa.trunc_si %b : f32 to i32\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.trunc_ui", "summary": "Truncate floating point value to unsigned integer.\n\n Consume a floating point value and produces an unsigned integer holding the value truncated toward zero.\n Traps if the value is NaN, is infinity, is negative, or is outside the range of the target integer type.", "description": "Example:\n\n ```mlir\n %a = wasmssa.trunc_ui %b : f32 to i32\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[WasmSSA_FPType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_IntegerType]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.wrap", "summary": "Cast an i64 to i32 by using a wrapping mechanism: y = x mod 2^32", "description": "Example:\n\n ```mlir\n %a = wasmssa.wrap %b : i64 to i32\n ```", "operands": [ { "name": "input", "type": "AnyTypeOf<[I64]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[I32]>" } ], "assemblyFormat": "$input `:` type($input) `to` type($result) attr-dict" }, { "name": "wasmssa.xor", "summary": "Compute the bitwise XOR of two values", "description": "Example:\n\n ```mlir\n %a = wasmssa.xor %b %c : i32\n ```", "operands": [ { "name": "lhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" }, { "name": "rhs", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "results": [ { "name": "result", "type": "AnyTypeOf<[WasmSSA_NumericType]>" } ], "traits": [ { "type": "AllTypesMatch<['lhs', 'rhs', 'result']>" } ], "assemblyFormat": "$lhs $rhs `:` type($lhs) attr-dict" }, { "name": "x86.amx.tile_load", "summary": "tile load operation", "description": "Loads a tile from memory defined by a `base` and `indices`, with the\n shape defined by the 2-dim vector type of the result.\n The tile's rows are populated by reading contiguous elements starting\n at the `base`. For each tile row, the `base` is incremented by `stride`\n number of elements.\n\n The tile is loaded using the following indexing scheme:\n\n ```\n for row in enumerate(tile_rows):\n mem_row = base[i0, i1, ..., iN + row * stride]\n for col in enumerate(tile_cols):\n tile[row, col] = mem_row[col]\n ```\n\n If the `stride` is not provided, then the `base` buffer must be at least\n 2-dimensional, and the `stride` is automatically inferred and corresponds\n to the stride of the buffer's second innermost dimension.\n\n The operation is eventually lowered into the \"tileloadd\" instruction\n with the corresponding tile configuration.\n\n With the write memory effect, each `x86.amx.tile_load` operation serves as\n a compilation hint to use a separate tile register.\n\n Example:\n\n ```mlir\n // Tile load from a 2-D memref with implicit stride.\n %0 = x86.amx.tile_load %arg0[%c0, %c0] : memref into !x86.amx.tile<16x64xi8>\n\n // Tile load from a 1-D memref with explicit stride.\n %0 = x86.amx.tile_load %arg0[%c0], %stride : memref into !x86.amx.tile<16x64xi8>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "stride", "type": "Optional" } ], "results": [ { "name": "res", "type": "AnyAMXTile" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$base `[` $indices `]` (`,` $stride^ )? attr-dict`:` type($base) `into` qualified(type($res))" }, { "name": "x86.amx.tile_mulf", "summary": "tile multiplication operation (floating-point)", "description": "Multiplies a \"m x k\" tile with a \"k x n\" tile and accumulates the results\n into a \"m x n\" destination tile. Supports \"f32 <- bf16 x bf16\" (with\n pairs of \"bf16\") and \"f32 <- f8E5M2/f8E4M3FN x f8E5M2/f8E4M3FN\".\n \n The operation is eventually lowered into the \"tdpbf16ps/tdpbf8ps/tdpbhf8ps/\n tdphbf8ps/tdphf8ps\" instruction with the corresponding tile configuration.\n\n Example:\n\n ```mlir\n %0 = x86.amx.tile_mulf %a, %b, %c\n : !x86.amx.tile<16x32xbf16>, !x86.amx.tile<16x32xbf16>, !x86.amx.tile<16x16xf32>\n ```", "operands": [ { "name": "lhs", "type": "AMXTileF16OrBF16OrF8" }, { "name": "rhs", "type": "AMXTileF16OrBF16OrF8" }, { "name": "acc", "type": "AMXTileF32" } ], "results": [ { "name": "res", "type": "AMXTileF32" } ], "traits": [ { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$lhs `,` $rhs `,` $acc attr-dict `:` qualified(type($lhs)) `,` qualified(type($rhs)) `,` qualified(type($acc))" }, { "name": "x86.amx.tile_muli", "summary": "tile multiplication operation (integer)", "description": "Multiplies a \"m x k\" tile with a \"k x n\" tile and accumulates the results\n into a \"m x n\" destination tile. Supports all \"si32 <- s/ui8 x s/ui8\"\n combinations (4 bytes packed into dwords in the columns of both the\n source operand tiles; the zero or sign extension is specified with\n the attributes and default to sign extended).\n \n The operation is eventually lowered into one of the \"tdpbssd\",\n \"tdpbsud\", \"tdpbusd\", or \"tdpbuud\" instructions with the corresponding\n tile configuration.\n\n Example:\n\n ```mlir\n %0 = x86.amx.tile_muli %a zext, %b zext, %c\n : !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x16xi32>\n ```", "operands": [ { "name": "lhs", "type": "AMXTileI8" }, { "name": "rhs", "type": "AMXTileI8" }, { "name": "acc", "type": "AMXTileI32" } ], "results": [ { "name": "res", "type": "AMXTileI32" } ], "attributes": [ { "name": "isZextLhs", "type": "UnitAttr" }, { "name": "isZextRhs", "type": "UnitAttr" } ], "traits": [ { "type": "AllTypesMatch<['acc', 'res']>" } ], "assemblyFormat": "$lhs (`zext` $isZextLhs^)? `,` $rhs (`zext` $isZextRhs^)? `,` $acc attr-dict `:` qualified(type($lhs)) `,` qualified(type($rhs)) `,` qualified(type($acc))" }, { "name": "x86.amx.tile_store", "summary": "tile store operation", "description": "Stores a tile to memory defined by a `base` and `indices`, with the\n shape defined by the 2-dim vector type of the value.\n The tile's rows are written contiguously to the buffer starting at\n the `base`. For each tile row, the `base` is incremented by `stride`\n number of elements.\n\n The tile is stored using the following indexing scheme:\n\n ```\n for row in enumerate(tile_rows):\n mem_row = base[i0, i1, ..., iN + row * stride]\n for col in enumerate(tile_cols):\n mem_row[col] = tile[row, col]\n ```\n\n If the `stride` is not provided, then the `base` buffer must be at least\n 2-dimensional, and the `stride` is automatically inferred and corresponds\n to the stride of the buffer's second innermost dimension.\n\n The operation is eventually lowered into the \"tilestored\" instruction\n with the corresponding tile configuration.\n\n Example:\n\n ```mlir\n // Tile store to a 2-D memref with implicit stride.\n x86.amx.tile_store %arg1[%c0, %c0], %0 : memref, !x86.amx.tile<16x64xi8>\n\n // Tile store to a 1-D memref with explicit stride.\n x86.amx.tile_store %arg1[%c0], %0, %stride : memref, !x86.amx.tile<16x64xi8>\n ```", "operands": [ { "name": "base", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" }, { "name": "val", "type": "AnyAMXTile" }, { "name": "stride", "type": "Optional" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$base `[` $indices `]` `,` $val (`,` $stride^ )?attr-dict `:` type($base) `,` qualified(type($val))" }, { "name": "x86.amx.tile_zero", "summary": "tile zero operation", "description": "Zeroes the destination tile, with the shape defined by the 2-dim\n vector type of the result.\n \n The operation is eventually lowered into the \"tilezero\" instruction\n with the corresponding tile configuration.\n \n With the write memory effect, each `x86.amx.tile_zero` operation serves as\n a compilation hint to use a separate tile register.\n\n Example:\n\n ```mlir\n %0 = x86.amx.tile_zero : !x86.amx.tile<16x16xbf16>\n ```", "results": [ { "name": "res", "type": "AnyAMXTile" } ], "assemblyFormat": "attr-dict `:` qualified(type($res))" }, { "name": "x86.avx.bcst_to_f32.packed", "summary": "AVX: Broadcasts BF16/F16 into packed F32 Data.", "description": "#### From the Intel Intrinsics Guide:\n\n Convert scalar BF16 or F16 (16-bit) floating-point element stored at memory locations\n starting at location `__A` to a single-precision (32-bit) floating-point,\n broadcast it to packed single-precision (32-bit) floating-point elements,\n and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx.bcst_to_f32.packed %a : memref<1xbf16> -> vector<8xf32>\n %dst = x86.avx.bcst_to_f32.packed %a : memref<1xf16> -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "MemRefOf<[BF16, F16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [F32]>" } ], "assemblyFormat": "$a attr-dict`:` type($a)`->` type($dst)" }, { "name": "x86.avx.cvt.packed.even.indexed_to_f32", "summary": "AVX: Convert packed BF16/F16 even-indexed elements into packed F32 Data.", "description": "#### From the Intel Intrinsics Guide:\n\n Convert packed BF16 or F16 (16-bit) floating-point even-indexed elements stored at\n memory locations starting at location `__A` to packed single-precision\n (32-bit) floating-point elements, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx.cvt.packed.even.indexed_to_f32 %a : memref<16xbf16> -> vector<8xf32>\n %dst = x86.avx.cvt.packed.even.indexed_to_f32 %a : memref<16xf16> -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "MemRefOf<[BF16, F16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [F32]>" } ], "assemblyFormat": "$a attr-dict`:` type($a)`->` type($dst)" }, { "name": "x86.avx.cvt.packed.odd.indexed_to_f32", "summary": "AVX: Convert packed BF16/F16 odd-indexed elements into packed F32 Data.", "description": "#### From the Intel Intrinsics Guide:\n\n Convert packed BF16 or F16 (16-bit) floating-point odd-indexed elements stored at\n memory locations starting at location `__A` to packed single-precision\n (32-bit) floating-point elements, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx.cvt.packed.odd.indexed_to_f32 %a : memref<16xbf16> -> vector<8xf32>\n %dst = x86.avx.cvt.packed.odd.indexed_to_f32 %a : memref<16xf16> -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "MemRefOf<[BF16, F16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [F32]>" } ], "assemblyFormat": "$a attr-dict`:` type($a)`->` type($dst)" }, { "name": "x86.avx.dot.i8", "summary": "Dot Int8 op", "description": "The `dot` op is an AVX2-Int8 specific op that can lower to the proper\n LLVMAVX2-INT8 operation `llvm.vpdpbssd` depending on the width of MLIR\n vectors it is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Multiply groups of 4 adjacent pairs of signed 8-bit integers in `a` with \n corresponding signed 8-bit integers in `b`, producing 4 intermediate signed 16-bit \n results. Sum these 4 results with the corresponding 32-bit integer in `w`, and \n store the packed 32-bit results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx.dot.i8 %w, %a, %b : vector<32xi8> -> vector<8xi32>\n ```", "operands": [ { "name": "w", "type": "VectorOfLengthAndType<[4, 8], [I32]>" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 32], [I8]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 32], [I8]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "AllTypesMatch<['w', 'dst']>" }, { "type": "TypesMatchWith<'w', 'a', '[object Object],[object Object]'>" } ], "assemblyFormat": "$w `,` $a `,` $b attr-dict `:` type($a) `->` type($w)" }, { "name": "x86.avx.intr.dot", "summary": "Dot", "description": "Computes the 4-way dot products of the lower and higher parts of the source\n vectors and broadcasts the two results to the lower and higher elements of\n the destination vector, respectively. Adding one element of the lower part\n to one element of the higher part in the destination vector yields the full\n dot product of the two source vectors.\n\n Example:\n\n ```mlir\n %0 = x86.avx.intr.dot %a, %b : vector<8xf32>\n %1 = vector.extract %0[%i0] : f32 from vector<8xf32>\n %2 = vector.extract %0[%i4] : f32 from vector<8xf32>\n %d = arith.addf %1, %2 : f32\n ```", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8], [F32]>" }, { "name": "b", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "results": [ { "name": "res", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($res)" }, { "name": "x86.avx.rsqrt", "summary": "Rsqrt", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "results": [ { "name": "b", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$a attr-dict `:` type($a)" }, { "name": "x86.avx10.dot.i8", "summary": "AVX10 Dot Int8 op", "description": "The `dot` op is an AVX10-Int8 specific op that can lower to the proper\n LLVMAVX10-INT8 operation `llvm.vpdpbssd.512`.\n\n Multiply groups of 4 adjacent pairs of signed 8-bit integers in `a` with\n corresponding signed 8-bit integers in `b`, producing 4 intermediate signed 16-bit\n results. Sum these 4 results with the corresponding 32-bit integer in `w`, and\n store the packed 32-bit results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx10.dot.i8 %w, %a, %b : vector<64xi8> -> vector<16xi32>\n ```", "operands": [ { "name": "w", "type": "VectorOfLengthAndType<[16], [I32]>" }, { "name": "a", "type": "VectorOfLengthAndType<[64], [I8]>" }, { "name": "b", "type": "VectorOfLengthAndType<[64], [I8]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "AllTypesMatch<['w', 'dst']>" }, { "type": "TypesMatchWith<'w', 'a', '[object Object],[object Object]'>" } ], "assemblyFormat": "$w `,` $a `,` $b attr-dict `:` type($a) `->` type($w)" }, { "name": "x86.avx512.cvt.packed.f32_to_bf16", "summary": "Convert packed F32 to packed BF16 Data.", "description": "The `convert_f32_to_bf16` op is an AVX512-BF16 specific op that can lower\n to the proper LLVMAVX512BF16 operation `llvm.cvtneps2bf16` depending on\n the width of MLIR vectors it is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Convert packed single-precision (32-bit) floating-point elements in `a` to\n packed BF16 (16-bit) floating-point elements, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx512.cvt.packed.f32_to_bf16 %a : vector<8xf32> -> vector<8xbf16>\n ```", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8, 16], [F32]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[8, 16], [BF16]>" } ], "assemblyFormat": "$a attr-dict `:` type($a) `->` type($dst)" }, { "name": "x86.avx512.dot", "summary": "Dot BF16 op", "description": "The `dot` op is an AVX512-BF16 specific op that can lower to the proper\n LLVMAVX512BF16 operation `llvm.dpbf16ps` depending on the width of MLIR\n vectors it is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Compute dot-product of BF16 (16-bit) floating-point pairs in `a` and `b`,\n accumulating the intermediate single-precision (32-bit) floating-point\n elements with elements in `src`, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86.avx512.dot %src, %a, %b : vector<32xbf16> -> vector<16xf32>\n ```", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[4, 8, 16], [F32]>" }, { "name": "a", "type": "VectorOfLengthAndType<[8, 16, 32], [BF16]>" }, { "name": "b", "type": "VectorOfLengthAndType<[8, 16, 32], [BF16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8, 16], [F32]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "AllTypesMatch<['src', 'dst']>" }, { "type": "TypesMatchWith<'src', 'a', '[object Object],[object Object]'>" } ], "assemblyFormat": "$src `,` $a `,` $b attr-dict `:` type($a) `->` type($src)" }, { "name": "x86.avx512.mask.compress", "summary": "Masked compress op", "description": "The mask.compress op is an AVX512 specific op that can lower to the\n `llvm.mask.compress` instruction. Instead of `src`, a constant vector\n vector attribute `constant_src` may be specified. If neither `src` nor\n `constant_src` is specified, the remaining elements in the result vector are\n set to zero.\n\n #### From the Intel Intrinsics Guide:\n\n Contiguously store the active integer/floating-point elements in `a` (those\n with their respective bit set in writemask `k`) to `dst`, and pass through the\n remaining elements from `src`.", "operands": [ { "name": "k", "type": "VectorOfLengthAndType<[16, 8], [I1]>" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [F32, I32, F64, I64]>" }, { "name": "src", "type": "Optional>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16, 8], [F32, I32, F64, I64]>" } ], "attributes": [ { "name": "constant_src", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['a', 'dst']>" }, { "type": "TypesMatchWith<'dst', 'k', '[object Object],[object Object]'>" } ], "assemblyFormat": "$k `,` $a (`,` $src^)? attr-dict `:` type($dst) (`,` type($src)^)?" }, { "name": "x86.avx512.mask.rndscale", "summary": "Masked roundscale op", "description": "The mask.rndscale op is an AVX512 specific op that can lower to the proper\n LLVMAVX512 operation: `llvm.mask.rndscale.ps.512` or\n `llvm.mask.rndscale.pd.512` instruction depending on the type of vectors it\n is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Round packed floating-point elements in `a` to the number of fraction bits\n specified by `imm`, and store the results in `dst` using writemask `k`\n (elements are copied from src when the corresponding mask bit is not set).", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "k", "type": "I32" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "imm", "type": "AnyTypeOf<[I16, I8]>" }, { "name": "rounding", "type": "I32" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'a', 'dst']>" }, { "type": "TypesMatchWith<'dst', 'imm', '[object Object],[object Object]'>" } ], "assemblyFormat": "$src `,` $k `,` $a `,` $imm `,` $rounding attr-dict `:` type($dst)" }, { "name": "x86.avx512.mask.scalef", "summary": "ScaleF op", "description": "The `mask.scalef` op is an AVX512 specific op that can lower to the proper\n LLVMAVX512 operation: `llvm.mask.scalef.ps.512` or\n `llvm.mask.scalef.pd.512` depending on the type of MLIR vectors it is\n applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Scale the packed floating-point elements in `a` using values from `b`, and\n store the results in `dst` using writemask `k` (elements are copied from src\n when the corresponding mask bit is not set).", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "k", "type": "AnyTypeOf<[I16, I8]>" }, { "name": "rounding", "type": "I32" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'a', 'b', 'dst']>" }, { "type": "TypesMatchWith<'dst', 'k', '[object Object],[object Object]'>" } ], "assemblyFormat": "$src `,` $a `,` $b `,` $k `,` $rounding attr-dict `:` type($dst)" }, { "name": "x86.avx512.vp2intersect", "summary": "Vp2Intersect op", "description": "The `vp2intersect` op is an AVX512 specific op that can lower to the proper\n LLVMAVX512 operation: `llvm.vp2intersect.d.512` or\n `llvm.vp2intersect.q.512` depending on the type of MLIR vectors it is\n applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Compute intersection of packed integer vectors `a` and `b`, and store\n indication of match in the corresponding bit of two mask registers\n specified by `k1` and `k2`. A match in corresponding elements of `a` and\n `b` is indicated by a set bit in the corresponding bit of the mask\n registers.", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [I32, I64]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 8], [I32, I64]>" } ], "results": [ { "name": "k1", "type": "VectorOfLengthAndType<[16, 8], [I1]>" }, { "name": "k2", "type": "VectorOfLengthAndType<[16, 8], [I1]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "TypesMatchWith<'a', 'k1', '[object Object],[object Object]'>" }, { "type": "TypesMatchWith<'a', 'k2', '[object Object],[object Object]'>" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($a)" }, { "name": "x86vector.avx.bcst_to_f32.packed", "summary": "AVX: Broadcasts BF16/F16 into packed F32 Data.", "description": "#### From the Intel Intrinsics Guide:\n\n Convert scalar BF16 or F16 (16-bit) floating-point element stored at memory locations\n starting at location `__A` to a single-precision (32-bit) floating-point,\n broadcast it to packed single-precision (32-bit) floating-point elements,\n and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx.bcst_to_f32.packed %a : memref<1xbf16> -> vector<8xf32>\n %dst = x86vector.avx.bcst_to_f32.packed %a : memref<1xf16> -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "MemRefOf<[BF16, F16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [F32]>" } ], "assemblyFormat": "$a attr-dict`:` type($a)`->` type($dst)" }, { "name": "x86vector.avx.cvt.packed.even.indexed_to_f32", "summary": "AVX: Convert packed BF16/F16 even-indexed elements into packed F32 Data.", "description": "#### From the Intel Intrinsics Guide:\n\n Convert packed BF16 or F16 (16-bit) floating-point even-indexed elements stored at\n memory locations starting at location `__A` to packed single-precision\n (32-bit) floating-point elements, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx.cvt.packed.even.indexed_to_f32 %a : memref<16xbf16> -> vector<8xf32>\n %dst = x86vector.avx.cvt.packed.even.indexed_to_f32 %a : memref<16xf16> -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "MemRefOf<[BF16, F16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [F32]>" } ], "assemblyFormat": "$a attr-dict`:` type($a)`->` type($dst)" }, { "name": "x86vector.avx.cvt.packed.odd.indexed_to_f32", "summary": "AVX: Convert packed BF16/F16 odd-indexed elements into packed F32 Data.", "description": "#### From the Intel Intrinsics Guide:\n\n Convert packed BF16 or F16 (16-bit) floating-point odd-indexed elements stored at\n memory locations starting at location `__A` to packed single-precision\n (32-bit) floating-point elements, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx.cvt.packed.odd.indexed_to_f32 %a : memref<16xbf16> -> vector<8xf32>\n %dst = x86vector.avx.cvt.packed.odd.indexed_to_f32 %a : memref<16xf16> -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "MemRefOf<[BF16, F16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [F32]>" } ], "assemblyFormat": "$a attr-dict`:` type($a)`->` type($dst)" }, { "name": "x86vector.avx.dot.i8", "summary": "Dot Int8 op", "description": "The `dot` op is an AVX2-Int8 specific op that can lower to the proper\n LLVMAVX2-INT8 operation `llvm.vpdpbssd` depending on the width of MLIR\n vectors it is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Multiply groups of 4 adjacent pairs of signed 8-bit integers in `a` with \n corresponding signed 8-bit integers in `b`, producing 4 intermediate signed 16-bit \n results. Sum these 4 results with the corresponding 32-bit integer in `w`, and \n store the packed 32-bit results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx.dot.i8 %w, %a, %b : vector<32xi8> -> vector<8xi32>\n ```", "operands": [ { "name": "w", "type": "VectorOfLengthAndType<[4, 8], [I32]>" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 32], [I8]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 32], [I8]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "AllTypesMatch<['w', 'dst']>" }, { "type": "TypesMatchWith<'w', 'a', '[object Object],[object Object]'>" } ], "assemblyFormat": "$w `,` $a `,` $b attr-dict `:` type($a) `->` type($w)" }, { "name": "x86vector.avx.intr.dot", "summary": "Dot", "description": "Computes the 4-way dot products of the lower and higher parts of the source\n vectors and broadcasts the two results to the lower and higher elements of\n the destination vector, respectively. Adding one element of the lower part\n to one element of the higher part in the destination vector yields the full\n dot product of the two source vectors.\n\n Example:\n\n ```mlir\n %0 = x86vector.avx.intr.dot %a, %b : vector<8xf32>\n %1 = vector.extract %0[%i0] : f32 from vector<8xf32>\n %2 = vector.extract %0[%i4] : f32 from vector<8xf32>\n %d = arith.addf %1, %2 : f32\n ```", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8], [F32]>" }, { "name": "b", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "results": [ { "name": "res", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($res)" }, { "name": "x86vector.avx.rsqrt", "summary": "Rsqrt", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "results": [ { "name": "b", "type": "VectorOfLengthAndType<[8], [F32]>" } ], "traits": [ { "type": "SameOperandsAndResultType" } ], "assemblyFormat": "$a attr-dict `:` type($a)" }, { "name": "x86vector.avx10.dot.i8", "summary": "AVX10 Dot Int8 op", "description": "The `dot` op is an AVX10-Int8 specific op that can lower to the proper\n LLVMAVX10-INT8 operation `llvm.vpdpbssd.512`.\n\n Multiply groups of 4 adjacent pairs of signed 8-bit integers in `a` with\n corresponding signed 8-bit integers in `b`, producing 4 intermediate signed 16-bit\n results. Sum these 4 results with the corresponding 32-bit integer in `w`, and\n store the packed 32-bit results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx10.dot.i8 %w, %a, %b : vector<64xi8> -> vector<16xi32>\n ```", "operands": [ { "name": "w", "type": "VectorOfLengthAndType<[16], [I32]>" }, { "name": "a", "type": "VectorOfLengthAndType<[64], [I8]>" }, { "name": "b", "type": "VectorOfLengthAndType<[64], [I8]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16], [I32]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "AllTypesMatch<['w', 'dst']>" }, { "type": "TypesMatchWith<'w', 'a', '[object Object],[object Object]'>" } ], "assemblyFormat": "$w `,` $a `,` $b attr-dict `:` type($a) `->` type($w)" }, { "name": "x86vector.avx512.cvt.packed.f32_to_bf16", "summary": "Convert packed F32 to packed BF16 Data.", "description": "The `convert_f32_to_bf16` op is an AVX512-BF16 specific op that can lower\n to the proper LLVMAVX512BF16 operation `llvm.cvtneps2bf16` depending on\n the width of MLIR vectors it is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Convert packed single-precision (32-bit) floating-point elements in `a` to\n packed BF16 (16-bit) floating-point elements, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx512.cvt.packed.f32_to_bf16 %a : vector<8xf32> -> vector<8xbf16>\n ```", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[8, 16], [F32]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[8, 16], [BF16]>" } ], "assemblyFormat": "$a attr-dict `:` type($a) `->` type($dst)" }, { "name": "x86vector.avx512.dot", "summary": "Dot BF16 op", "description": "The `dot` op is an AVX512-BF16 specific op that can lower to the proper\n LLVMAVX512BF16 operation `llvm.dpbf16ps` depending on the width of MLIR\n vectors it is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Compute dot-product of BF16 (16-bit) floating-point pairs in `a` and `b`,\n accumulating the intermediate single-precision (32-bit) floating-point\n elements with elements in `src`, and store the results in `dst`.\n\n Example:\n ```mlir\n %dst = x86vector.avx512.dot %src, %a, %b : vector<32xbf16> -> vector<16xf32>\n ```", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[4, 8, 16], [F32]>" }, { "name": "a", "type": "VectorOfLengthAndType<[8, 16, 32], [BF16]>" }, { "name": "b", "type": "VectorOfLengthAndType<[8, 16, 32], [BF16]>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[4, 8, 16], [F32]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "AllTypesMatch<['src', 'dst']>" }, { "type": "TypesMatchWith<'src', 'a', '[object Object],[object Object]'>" } ], "assemblyFormat": "$src `,` $a `,` $b attr-dict `:` type($a) `->` type($src)" }, { "name": "x86vector.avx512.mask.compress", "summary": "Masked compress op", "description": "The mask.compress op is an AVX512 specific op that can lower to the\n `llvm.mask.compress` instruction. Instead of `src`, a constant vector\n vector attribute `constant_src` may be specified. If neither `src` nor\n `constant_src` is specified, the remaining elements in the result vector are\n set to zero.\n\n #### From the Intel Intrinsics Guide:\n\n Contiguously store the active integer/floating-point elements in `a` (those\n with their respective bit set in writemask `k`) to `dst`, and pass through the\n remaining elements from `src`.", "operands": [ { "name": "k", "type": "VectorOfLengthAndType<[16, 8], [I1]>" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [F32, I32, F64, I64]>" }, { "name": "src", "type": "Optional>" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16, 8], [F32, I32, F64, I64]>" } ], "attributes": [ { "name": "constant_src", "type": "OptionalAttr" } ], "traits": [ { "type": "AllTypesMatch<['a', 'dst']>" }, { "type": "TypesMatchWith<'dst', 'k', '[object Object],[object Object]'>" } ], "assemblyFormat": "$k `,` $a (`,` $src^)? attr-dict `:` type($dst) (`,` type($src)^)?" }, { "name": "x86vector.avx512.mask.rndscale", "summary": "Masked roundscale op", "description": "The mask.rndscale op is an AVX512 specific op that can lower to the proper\n LLVMAVX512 operation: `llvm.mask.rndscale.ps.512` or\n `llvm.mask.rndscale.pd.512` instruction depending on the type of vectors it\n is applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Round packed floating-point elements in `a` to the number of fraction bits\n specified by `imm`, and store the results in `dst` using writemask `k`\n (elements are copied from src when the corresponding mask bit is not set).", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "k", "type": "I32" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "imm", "type": "AnyTypeOf<[I16, I8]>" }, { "name": "rounding", "type": "I32" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'a', 'dst']>" }, { "type": "TypesMatchWith<'dst', 'imm', '[object Object],[object Object]'>" } ], "assemblyFormat": "$src `,` $k `,` $a `,` $imm `,` $rounding attr-dict `:` type($dst)" }, { "name": "x86vector.avx512.mask.scalef", "summary": "ScaleF op", "description": "The `mask.scalef` op is an AVX512 specific op that can lower to the proper\n LLVMAVX512 operation: `llvm.mask.scalef.ps.512` or\n `llvm.mask.scalef.pd.512` depending on the type of MLIR vectors it is\n applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Scale the packed floating-point elements in `a` using values from `b`, and\n store the results in `dst` using writemask `k` (elements are copied from src\n when the corresponding mask bit is not set).", "operands": [ { "name": "src", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" }, { "name": "k", "type": "AnyTypeOf<[I16, I8]>" }, { "name": "rounding", "type": "I32" } ], "results": [ { "name": "dst", "type": "VectorOfLengthAndType<[16, 8], [F32, F64]>" } ], "traits": [ { "type": "AllTypesMatch<['src', 'a', 'b', 'dst']>" }, { "type": "TypesMatchWith<'dst', 'k', '[object Object],[object Object]'>" } ], "assemblyFormat": "$src `,` $a `,` $b `,` $k `,` $rounding attr-dict `:` type($dst)" }, { "name": "x86vector.avx512.vp2intersect", "summary": "Vp2Intersect op", "description": "The `vp2intersect` op is an AVX512 specific op that can lower to the proper\n LLVMAVX512 operation: `llvm.vp2intersect.d.512` or\n `llvm.vp2intersect.q.512` depending on the type of MLIR vectors it is\n applied to.\n\n #### From the Intel Intrinsics Guide:\n\n Compute intersection of packed integer vectors `a` and `b`, and store\n indication of match in the corresponding bit of two mask registers\n specified by `k1` and `k2`. A match in corresponding elements of `a` and\n `b` is indicated by a set bit in the corresponding bit of the mask\n registers.", "operands": [ { "name": "a", "type": "VectorOfLengthAndType<[16, 8], [I32, I64]>" }, { "name": "b", "type": "VectorOfLengthAndType<[16, 8], [I32, I64]>" } ], "results": [ { "name": "k1", "type": "VectorOfLengthAndType<[16, 8], [I1]>" }, { "name": "k2", "type": "VectorOfLengthAndType<[16, 8], [I1]>" } ], "traits": [ { "type": "AllTypesMatch<['a', 'b']>" }, { "type": "TypesMatchWith<'a', 'k1', '[object Object],[object Object]'>" }, { "type": "TypesMatchWith<'a', 'k2', '[object Object],[object Object]'>" } ], "assemblyFormat": "$a `,` $b attr-dict `:` type($a)" }, { "name": "xegpu.alloc_nbarrier", "summary": "It allocates a set of named barriers.", "description": "AllocNbarrier is to create a set of named barriers as\n specified by `nbarrier_num`. Named barriers are workgroup level resources,\n and are shared by all threads in the workgroup. For example, there are\n up to 32 barriers (range 0-31) for each XeCore on PVC. A typical use case\n is that a workgroup is partitioned into N subgroups of threads (N <= 32),\n and each subgroup coordinating their work with a separate barrier with id\n range from 0 to N respectively.", "attributes": [ { "name": "nbarrier_num", "type": "I64Attr" } ], "assemblyFormat": "$nbarrier_num attr-dict" }, { "name": "xegpu.atomic_rmw", "summary": "Atomic read-modify-write operation on the TensorDesc.", "description": "The `xegpu.atomic_rmw` operation provides a way to perform a read-modify-write\n operation on the region described by the `TensorDesc` free from data races. The\n `kind` enumeration specifies the modification to be performed, The `mask` operand\n has the same shape with `TensorDesc`, and is used to enable or disable specific\n data points of the `TensorDesc`. The `value` operand represents the new value to\n be applied during the modification.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n - `kind`: An attribute that specifies the atomic operation to be performed\n (e.g., add, min, max, exchange, etc.).\n\n - `tensorDesc`: A `TensorDesc` describing the memory region on which the atomic\n read-modify-write is performed.\n\n - `mask`: A predicate mask with the same shape as `tensorDesc`. Only elements\n with a true (non-zero) mask value participate in the atomic operation;\n masked-out elements are not modified.\n\n - `value`: The input values used by the atomic operation. It must have the same\n shape and element type as `tensorDesc` and `result`.\n\n - `layout`: [optional] An attribute that identifies the operation as an anchor,\n enabling users to assign a layout that governs distribution at the subgroup\n and/or lane level. Only valid at workgroup and subgroup levels.", "operands": [ { "name": "tensorDesc", "type": "XeGPU_TensorDesc" }, { "name": "mask", "type": "XeGPU_MaskType" }, { "name": "value", "type": "XeGPU_ValueType" } ], "results": [ { "name": "result", "type": "XeGPU_ValueType" } ], "attributes": [ { "name": "kind", "type": "AtomicRMWKindAttr{addf|addi|andi|assign|maximumf|maxnumf|maxs|maxu|minimumf|minnumf|mins|minu|mulf|muli|ori|xori}" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$kind $tensorDesc `,` $mask `,` $value attr-dict `:`\n qualified(type($tensorDesc)) `,` type($mask) `,` type($value) `->` type($result)" }, { "name": "xegpu.convert_layout", "summary": "Convert the layout of the input operand", "description": "`convert_layout` redistribute data across subgroups and/or lanes from the `input_layout` to\n the `target_layout`. Both `input_layout` and `target_layout` must correspond to the same programming\n scope, such as workgroup level (wg) or subgroup level (sg) code. This operation is not valid once\n the IR is lowered to WI level because that is the end result of all distributions.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n - `source`: The input vector whose data is to be redistributed. The source and\n result types must match.\n - `input_layout`: The layout attribute describing the current distribution of `source`\n across subgroups and/or lanes.\n - `target_layout`: The layout attribute describing the desired distribution of the result\n across subgroups and/or lanes.\n\n Example (Subgroup level):\n ```mlir\n %coop_a = xegpu.convert_layout %a <{\n input_layout = #xegpu.layout,\n target_layout = #xegpu.layout}>\n : vector<128x128xf16>\n ```", "operands": [ { "name": "source", "type": "XeGPU_VectorOrScalarType" } ], "results": [ { "name": "result", "type": "XeGPU_VectorOrScalarType" } ], "attributes": [ { "name": "input_layout", "type": "DistributeLayoutAttr" }, { "name": "target_layout", "type": "DistributeLayoutAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" } ], "assemblyFormat": "$source prop-dict attr-dict `:` type($source)" }, { "name": "xegpu.create_mem_desc", "summary": "Create a memory descriptor.", "description": "Creates a memory descriptor from a shared local memory (SLM) buffer, and xegpu\n specific memory layout. The resulting memory descriptor has to have the same size\n as the underlying shared local memory.\n\n Arguments:\n - `source` : 1D or 2D statically shaped memref, representing the raw SLM buffer. The provided memref must be contiguous.\n\n Results:\n - `mem_desc` : the memory descriptor (1D or higher).\n\n Example (1D):\n ```mlir\n %mdesc = xegpu.create_mem_desc %mref\n : memref<128xi8, 3> -> !xegpu.mem_desc<64xf16>\n ```\n\n Example (2D with layout):\n ```mlir\n %mdesc = xegpu.create_mem_desc %mref\n : memref<4096xi8, 3>\n -> !xegpu.mem_desc<32x64xf16, #xegpu.mem_layout>\n ```", "operands": [ { "name": "source", "type": "AnyTypeOf<[StaticShared1DMemRefOf<[XeGPU_ScalarType]>, StaticShared2DMemRefOf<[XeGPU_ScalarType]>]>" } ], "results": [ { "name": "mem_desc", "type": "XeGPU_MemDesc" } ], "assemblyFormat": "$source prop-dict attr-dict `` `:` type($source) `->` qualified(type($mem_desc))" }, { "name": "xegpu.create_nd_tdesc", "summary": "Create nd-tensor descriptor operation", "description": "The \"create_nd_tdesc\" operation creates a TensorDescType which represents\n a sub-view of a 1D/2D memory region inside the one or two innermost dimensions\n of the source. (It can be extended to support n-D memory region if needed in\n future). Elements in the subview continuous in each dimension. It encodes the\n following important information for supporting Intel hardware features:\n\n Arguments:\n - `source`: an object representing (starting address/pointer of) a memory region.\n It can be either a memref object, or simply a pointer represented by uint64_t type.\n For the case of dynamic memrefs or pointer, the shape and layout information of the\n memory region should be explicitly passed via `shape` and `strides` parameters.\n\n - `shape`: the shape information of the memory region pointed by the \"source\". It is\n typically encoded via the MemRefType of the source, e.g., memref<4096x4096xf16>.\n But if \"source\" is simply a pointer represented as uint64_t type, or a memref\n type without shape information e.g., memref, the shape information has\n to be explicitly passed via the \"shape\" and \"const_shape\" arguments.\n\n - `strides`: the strides of the memory region pointed by the \"source\". Similar to shape,\n it is typically encoded via the MemRefType of the source too. But if \"source\" is\n simply a pointer represented as uint64_t type, or a memref type without shape\n information e.g., memref, the strides information has to be explicitly\n passed via the \"strides\" and \"const_strides\" argument.\n\n Results:\n - `res`: nd tensor descriptor\n\n Example 1 (suppose the tensor shape inferred by the compiler is 8x16):\n ```mlir\n %0 = memref.alloc() : memref<1024x1024xf32>\n %1 = xegpu.create_nd_tdesc %0 : memref<1024x1024xf32> -> TensorDesc<8x16xf32>\n ```\n\n Example 2 (suppose the tensor shape inferred by the compiler is 8x16):\n ```mlir\n %0 = memref.alloc(%h, %w) : memref\n %c1 = arith.constant 1 : index\n %1 = xegpu.create_nd_tdesc %0, shape:[%h, %w], strides:[%w, %c1]: memref -> TensorDesc<8x16xf32>\n ```\n\n Example 3 (suppose the tensor shape inferred by the compiler is 8x16):\n ```mlir\n %0 = ... : ui64\n %c1 = arith.constant 1 : index\n %1 = xegpu.create_nd_tdesc %0, shape:[%h, %w], strides:[%w, %c1]: ui64 -> TensorDesc<8x16xf32>\n ```", "operands": [ { "name": "source", "type": "XeGPU_BaseAddrType" }, { "name": "shape", "type": "Variadic" }, { "name": "strides", "type": "Variadic" } ], "results": [ { "name": "TensorDesc", "type": "XeGPU_TensorDesc" } ], "attributes": [ { "name": "const_shape", "type": "OptionalAttr" }, { "name": "const_strides", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$source ``\n (`,` `shape` `:` custom($shape, $const_shape)^\n `,` `strides``:` custom($strides, $const_strides))?\n attr-dict `:` type($source) `->` qualified(type($TensorDesc))" }, { "name": "xegpu.create_tdesc", "summary": "create scattered tensor descriptors (TensorDesc).", "description": "\"create_tdesc\" is similar to \"create_nd_tdesc\" in terms that it creates\n a Tensor Descriptor (TensorDescType) for a memory region. While \"create_nd_tdesc\"\n is for creating continuous subviews, \"create_tdesc\" is for creating non-continuous\n (scattered) subviews, allowing each lane in a subgroup specifying their own offset.\n It accepts the following parameters:\n\n Arguments:\n\n - `source`: a 1D memref or pointer (i64, i32, ui64, ui32) represents the flattened\n memory object.\n\n - `offsets`: a vector containing offsets of each access point. Its size\n is fixed to the hardware supportted subgroup size, e.g., 16 on PVC,\n implying each element in the vector corresponds to a SIMT lane in the subgroup.\n\n Results:\n - `res`: scattered tensor descriptor\n\n The first dimension of the result TensorDesc corresponds to lanes, so it should\n match the dimension of offsets. It may also has a second dimension corresponding to\n the chunk_size if the chunk size is larger than 1.\n\n Example 1: It assumes subgroup size is 4, and accesses a[0], a[16], a[32], a[64]\n ```mlir\n %a = memref.alloc() : memref<1024xf32>\n %0 = arith.constant dense<[0, 16, 32, 64]> : vector<4xindex>\n %1 = xegpu.create_tdesc %a, %0: memref<1024xf32>, vector<4xindex> -> TensorDesc<4xf32>\n ```\n\n Example 2: It assumes subgroup size is 4, and each workitem access 8 elements.\n It will access totally 32 data elements: a[0:7], a[16:23], a[32:39], a[64:71]\n ```mlir\n %0 = memref.alloc() : memref<1024xf32>\n %off = arith.constant dense<[0, 16, 32, 64]> : vector<4xindex>\n %1 = xegpu.create_tdesc %0, %off : memref<1024xf32>, vector<4xindex>\n -> TensorDesc<4x8xf32, #xegpu.scattered_tdesc_attr>\n ```\n\n Example 3: It is similar to Example 2, but there is some overlaps among workitems.\n It accesses: a[0:7], a[4:11], a[8:15], a[12:19]\n ```mlir\n %0 = memref.alloc() : memref<1024xf32>\n %off = arith.constant dense<[0, 4, 8, 12]> : vector<4xindex>\n %1 = xegpu.create_tdesc %0, %off : memref<1024xf32>, vector<4xindex>\n -> TensorDesc<4x8xf32, #xegpu.scattered_tdesc_attr>\n ```", "operands": [ { "name": "source", "type": "XeGPU_GatherScatterBaseAddrType" }, { "name": "offsets", "type": "XeGPU_OffsetType" } ], "results": [ { "name": "TensorDesc", "type": "XeGPU_TensorDesc" } ], "assemblyFormat": "$source `,` $offsets attr-dict `:` type($source) `,` type($offsets) `->` qualified(type($TensorDesc))" }, { "name": "xegpu.dpas", "summary": "It performs mma computation", "description": "DPAS performs matrix multiplication on matrix A of `mxk`\n size, B of `kxn` size, and accumulate on matrix C of `mxn` to the same size\n matrix.\n\n The operands can be 2D, 3D, or 4D vectors. When the vectors have more than 2\n dimensions, the leading dimensions are treated as **batch dimensions** that\n must match across all operands (lhs, rhs, acc, and result). The batch\n dimensions represent independent matrix multiplications that are executed in\n parallel. For example:\n - 2D: `A: vector<8x16xf16>`, `B: vector<16x16xf16>` -> `C: vector<8x16xf32>`\n - 3D: `A: vector<4x8x16xf16>`, `B: vector<4x16x16xf16>` -> `C: vector<4x8x16xf32>`\n (4 independent 8x16 matrix multiplications)\n - 4D: `A: vector<2x4x8x16xf16>`, `B: vector<2x4x16x16xf16>` -> `C: vector<2x4x8x16xf32>`\n (2x4=8 independent 8x16 matrix multiplications)\n\n The last 2 dimensions are always the core matrix multiplication dimensions\n (M, K for lhs; K, N for rhs; M, N for result).\n\n In lane level code, each lane from a subgroup holds a data fragment for A, B, C and the result,\n which are represented as 1D vectors. Please refer to [OpenCL Intel extentions]\n (https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroup_matrix_multiply_accumulate.html)\n for more details about the fragment distribution.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `lhs`: A vector value representing the left-hand-side matrix tile (A) participating in the\n matrix multiply. Can be 1D, 2D, 3D, or 4D where leading dimensions are batch dimensions.\n\n - `rhs`: A vector value representing the right-hand-side matrix tile (B). Can be 1D, 2D, 3D, or 4D\n where leading dimensions are batch dimensions.\n\n - `acc`: [optional] A vector value representing the accumulator matrix tile (C). When present, the\n result is computed as `lhs * rhs + acc`; otherwise, the accumulator is implicitly assumed to be zero.\n Must have the same batch dimensions as lhs and rhs.\n\n - `layout_a`, `layout_b`, `layout_cd`: [optional] Attributes that identify this\n operation as anchor for operands A, B, and the accumulator/result, enabling users to assign layouts\n that govern distribution at the subgroup and/or lane level. Only valid at workgroup and subgroup\n level.\n\n Example 1 (Workgroup level, 2D):\n\n ```mlir\n %d = xegpu.dpas %a, %b, %c <{\n layout_a = #xegpu.layout,\n layout_b = #xegpu.layout,\n layout_cd = #xegpu.layout}\n : vector<64x128xf16>, vector<128x128xf16>, vector<64x128xf32> -> vector<64x128xf32>\n ```\n\n Example 2 (Lane level, 1D):\n\n ```mlir\n %d = xegpu.dpas %a, %b, %c\n : vector<8xf16>, vector<16xf16>, vector<8xf32> -> vector<8xf32>\n ```\n\n Example 3 (Workgroup level, 3D with batch):\n\n ```mlir\n // 4 independent 8x16 matrix multiplications\n %d = xegpu.dpas %a, %b, %c\n : vector<4x8x16xf16>, vector<4x16x16xf16>, vector<4x8x16xf32> -> vector<4x8x16xf32>\n ```", "operands": [ { "name": "lhs", "type": "XeGPU_DpasOprType" }, { "name": "rhs", "type": "XeGPU_DpasOprType" }, { "name": "acc", "type": "Optional" } ], "results": [ { "name": "result", "type": "XeGPU_DpasResType" } ], "attributes": [ { "name": "layout_a", "type": "OptionalAttr" }, { "name": "layout_b", "type": "OptionalAttr" }, { "name": "layout_cd", "type": "OptionalAttr" } ], "assemblyFormat": "$lhs `,` $rhs (`,` $acc^)? attr-dict `:` type($lhs)`,` type($rhs) (`,` type($acc)^)? `->` type($result)" }, { "name": "xegpu.dpas_mx", "summary": "It performs scaled mma computation", "description": "DPAS MX performs matrix multiplication on matrix A and Matrix B\n of low precision data type. A is of size`mxk`\n size, B is of size `kxn`, and accumulate on matrix C of size `mxn` to the same size\n matrix.\n\n The operands can be 2D, 3D, or 4D vectors. When the vectors have more than 2\n dimensions, the leading dimensions are treated as **batch dimensions** that\n must match across all operands (a, b, acc, result, scale_a, scale_b). The batch\n dimensions represent independent matrix multiplications that are executed in\n parallel. For example:\n - 2D: `A: vector<8x32xf8E5M2>`, `B: vector<32x16xf8E5M2>` -> `C: vector<8x16xbf16>`\n - 3D: `A: vector<4x8x32xf8E5M2>`, `B: vector<4x32x16xf8E5M2>` -> `C: vector<4x8x16xbf16>`\n (4 independent 8x16 scaled matrix multiplications)\n - 4D: `A: vector<2x4x8x32xf8E5M2>`, `B: vector<2x4x32x16xf8E5M2>` -> `C: vector<2x4x8x16xbf16>`\n (2x4=8 independent 8x16 scaled matrix multiplications)\n\n The last 2 dimensions are always the core matrix multiplication dimensions\n (M, K for a; K, N for b; M, N for result). The scale vectors also follow the\n same batch dimension structure.\n\n In lane level code, each lane from a subgroup holds a data fragment for A, B, Acc and the result,\n which are represented as 1D vectors.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `a`: A vector value representing the left-hand-side matrix tile (A) participating in the\n matrix multiply. Can be 1D, 2D, 3D, or 4D where leading dimensions are batch dimensions.\n\n - `b`: A vector value representing the right-hand-side matrix tile (B). Can be 1D, 2D, 3D, or 4D\n where leading dimensions are batch dimensions.\n\n - `acc`: A vector value representing the accumulator matrix tile (C). The\n result is computed as `a * b + acc`. Must have the same batch dimensions as a and b.\n\n - `scale_a`: A floating point vector/scalar value used to scale `a` for\n matrix multiplication. When a vector, must have matching batch dimensions.\n\n - `scale_b`: A floating point vector/scalar value used to scale `b` for\n matrix multiplication. When a vector, must have matching batch dimensions.\n\n - `layout_a`, `layout_b`, `layout_cd`: [optional] Attributes that identify this\n operation as anchor for operands A, B, and the accumulator/result, enabling users to assign layouts\n that govern distribution at the subgroup and/or lane level. Only valid at workgroup and subgroup\n level.", "operands": [ { "name": "a", "type": "XeGPU_DpasOprType" }, { "name": "b", "type": "XeGPU_DpasOprType" }, { "name": "acc", "type": "Optional" }, { "name": "scale_a", "type": "Optional ]>>" }, { "name": "scale_b", "type": "Optional ]>>" } ], "results": [ { "name": "result", "type": "XeGPU_DpasResType" } ], "attributes": [ { "name": "layout_a", "type": "OptionalAttr" }, { "name": "layout_b", "type": "OptionalAttr" }, { "name": "layout_cd", "type": "OptionalAttr" }, { "name": "layout_a_scale", "type": "OptionalAttr" }, { "name": "layout_b_scale", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$a `,` $b (`,` $acc^)?\n (`scale_a` `=` $scale_a^)?\n (`scale_b` `=` $scale_b^)?\n attr-dict `:` functional-type(operands, results)" }, { "name": "xegpu.fence", "summary": "It synchronizes memory accesses.", "description": "It synchronizes the memory access between\n write and following read or write.\n 1. `Memory_kind` describes the memory kind. \"global\" means the global memory,\n \"slm\" means the share local memory.\n 2. `Fence_scope` describes the scope of fence. \"Workgroup\" means that the scope would be\n within each workgroup. \"GPU\" means the scope would be across workgroups within the GPU.", "attributes": [ { "name": "memory_kind", "type": "XeGPU_MemorySpaceAttr{global|slm}" }, { "name": "fence_scope", "type": "XeGPU_FenceScopeAttr{workgroup|gpu}" } ], "assemblyFormat": "`memory_kind` `=` $memory_kind `,` `fence_scope` `=` $fence_scope attr-dict" }, { "name": "xegpu.init_nbarrier", "summary": "It assigns a named barrier to the current thread.", "description": "InitNbarrierOp assigns the named barrier with the specified\n barrier ID (0~31) to the current thread. Multiple threads may bind to the\n same named barrier, and the `participant_thread_num` specifies the total\n number of threads associated with the nbarrier. It returns an object of\n NbarrierType representing the barrier", "operands": [ { "name": "nbarrier_id", "type": "I8" }, { "name": "participant_thread_num", "type": "I8" } ], "results": [ { "name": "result", "type": "XeGPU_Nbarrier" } ], "assemblyFormat": "$nbarrier_id `,` $participant_thread_num attr-dict `:`\n type($nbarrier_id) `,` type($participant_thread_num) `->` qualified(type($result))" }, { "name": "xegpu.load", "summary": "load a set of scattered data points from memory.", "description": "It (aka. load) load data per each lane. The output\n describes the data being loaded at the subgroup level, so its size is\n consistent with the number of lanes in a subgroup. When the chunk size\n is larger than 2, the output vector is a 2D vector, with dim-0 correspoding\n to lanes, and dim-1 corresponding to the chunk size loaded by each lane.\n The mask operand masks out memory access so that it is safe to pass out-of-boundary\n addresses/offsets as long as they are masked. Each mask element applies to one lane.\n\n In lane level, the result is a 1D vector that represents the data to be loaded by\n each lane. If size is not 1, size should be equal to the chunk size.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `source`: represents the memory region to be loaded from, which can be either a\n 1D memref or pointer (ui64, ui32, i64 or i32).\n\n - `offsets`: represents offsets from source.\n offsets is a vector of `index` type and vector length is either the subgroup size\n or 1 at lane level. scalar offset is also valid for lane level.\n\n - `mask`: is a vector of `i1` type, which is used to mask out the memory access.\n mask is a vector of size equal to the subgroup size, or 1 at lane level.\n scalar mask is also valid for lane level.\n\n - `chunk_size`: [optional] represents contiguous number of elements to load from per work item.\n\n - `l1_hint`, `l2_hint`, `l3_hint`: [optional] cache hints for each level of cache.\n\n - `layout`: [optional] Describes the expected layout of the `tensor_desc` operand or the result\n of load. Only valid at workgroup and subgroup levels.\n\n Results:\n - `res`: represents loaded data\n\n Example 1 (Subgroup level):\n A variant accepts memref as base pointer or the source operand\n could be a raw pointer (ui64, ui32, i64, i32).\n ```mlir\n %a = memref.alloc() : memref<1024xf32>\n %offsets = vector.step : vector<16xindex>\n %mask = vector.constant_mask [16]: vector<16xi1>\n %val = xegpu.load %a[%offsets], %mask {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n layout = #xegpu.layout}\n : memref<1024xf32>, vector<16xi1>, vector<16xindex> -> vector<16xf32>\n ```\n\n Example 2 (lane level):\n lane level only accepts the offsets variant. chunk_size can be inferred from result\n type. In this example, chunk_size is 8.\n ```mlir\n %2 = xegpu.load %1[%2], %0 <{l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint}>\n : memref<128xf32>, vector<1xindex>, vector<1xi1> -> vector<8xf32>\n ```", "operands": [ { "name": "source", "type": "XeGPU_GatherScatterBaseAddrType" }, { "name": "offsets", "type": "AnyTypeOf<[XeGPU_OffsetType, Index]>" }, { "name": "mask", "type": "AnyTypeOf<[XeGPU_MaskType, I1]>" } ], "results": [ { "name": "value", "type": "XeGPU_ValueOrScalarType" } ], "attributes": [ { "name": "chunk_size", "type": "OptionalAttr" }, { "name": "l1_hint", "type": "OptionalAttr" }, { "name": "l2_hint", "type": "OptionalAttr" }, { "name": "l3_hint", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" }, { "name": "contiguity", "type": "OptionalAttr" } ], "assemblyFormat": "$source `[` $offsets `]` `,`\n $mask prop-dict\n attr-dict `:` type(operands) `->` type($value)" }, { "name": "xegpu.load_matrix", "description": "This operation loads a block of data from shared local memory (SLM) as specified\n by the provided `mem_desc`. Memory descriptors of any rank (1D or higher) are supported.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n - `mem_desc`: the memory descriptor identifying the SLM region.\n - `offsets`: the coordinates within the memory descriptor to read from.\n - `subgroup_block_io`: [optional] An attribute indicating that the operation can be lowered\n to a subgroup block load. When this attribute is present, the offsets are subgroup-uniform\n across all lanes. Only used on subgroup and lane level.\n - `layout`: [optional] Describes the expected layout of the `mem_desc` operand as well as\n the result of load (they are identical).\n Only valid at workgroup and subgroup levels.\n\n Results:\n - `res`: the elements loaded from SLM.\n\n Example (1D):\n ```mlir\n %1 = xegpu.load_matrix %0[%c0] : !xegpu.mem_desc<64xf16>, index -> vector<16xf16>\n ```\n\n Example (Workgroup level, 2D):\n ```mlir\n %c0 = arith.constant 0 : index\n %1 = xegpu.load_matrix %0[%c0, %c0] <{\n layout = #xegpu.layout }>\n : !xegpu.mem_desc<128x128xf16, #xegpu.mem_layout>\n , index, index -> vector<128x128xf16>\n ```", "operands": [ { "name": "mem_desc", "type": "XeGPU_MemDesc" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "res", "type": "XeGPU_ValueOrScalarType" } ], "attributes": [ { "name": "const_offsets", "type": "DenseI64ArrayAttr" }, { "name": "subgroup_block_io", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$mem_desc `` custom($offsets, $const_offsets)\n prop-dict attr-dict `` `:` type(operands) `->` type(results)" }, { "name": "xegpu.load_nd", "summary": "loads a n-D block from memory (represented by TensorDesc)to registers (represented by vector)", "description": "LoadNdOp essentially mimics the hardware block read instruction to read\n a block of data from memory to register. It takes a set of optional cache\n hints for each level of cache, L1, L2 and L3. If hardware does not have a\n correspoding cache, Corresponding cache hint attribute will be masked.\n\n The tensor descriptor can be 1D, 2D, 3D, or higher dimensional. When the\n tensor descriptor has more than 2 dimensions, the leading dimensions are\n treated as **batch dimensions** that are unrolled to unit dimensions during\n lowering. At the subgroup level, the load_nd operation executes at 2D\n granularity to match the 2D block IO hardware support. The result vector\n has the same shape as the tensor descriptor. The number of offset indices\n must match the rank of the tensor descriptor.\n\n On Intel GPUs, hardware-supported packing rearranges data elements during\n the load of the B operand when the element bit-width is less than 32 bits\n (for example, fp16). The transpose feature reorders data during the load\n when the element type is fp32 or fp64. These two features are mutually\n exclusive and shall not be enabled simultaneously. Both features support only\n 2D blocked tensor_desc.\n\n At lane level, result vector represents the data to be loaded by each lane.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `TensorDesc`: A tensor descriptor specifying the base nd-region of memory\n and the tensor tile to be loaded. Can be 1D, 2D, 3D, or higher dimensional\n where leading dimensions are batch dimensions.\n\n - `offsets`: Index values representing per-dimension offsets from the base position\n encoded in `TensorDesc`. They are encoded via `offsets` and `const_offsets`.\n The number of offsets must match the tensor descriptor rank.\n\n - `packed`: [optional] A unit attribute indicating that packing is applied\n during the load when supported by the hardware. Only valid at lane level.\n\n - `transpose`: [optional] An attribute describing a hardware-supported transpose\n to be applied during the load. Only valid at Lane level.\n\n - `l1_hint`, `l2_hint`, `l3_hint`: [optional] Cache-hint attributes indicating the\n desired behavior at the L1, L2, and L3 cache levels.\n\n - `layout`: [optional] Describes the expected layout of the `tensor_desc` operand as well as the result of the load (they are identical). Only valid at workgroup and subgroup levels.\n\n Example 1 (Workgroup level, 2D):\n ```mlir\n xegpu.load_nd %1 {transpose = [1, 0],\n l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n layout = #xegpu.layout}\n : !xegpu.tensor_desc<32x256xf32> -> vector<32x256xf32>\n ```\n\n Example 2 (lane level, 2D):\n ```mlir\n xegpu.load_nd %1 {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint}>\n : !xegpu.tensor_desc<8x16xf32> -> vector<8xf32>\n ```\n\n Example 3 (3D with batch dimension):\n ```mlir\n // Load 4 independent 8x16 blocks\n %result = xegpu.load_nd %tdesc[0, 0, 0] <{l1_hint = #xegpu.cache_hint}>\n : !xegpu.tensor_desc<4x8x16xf16> -> vector<4x8x16xf16>\n ```", "operands": [ { "name": "TensorDesc", "type": "XeGPU_TensorDesc" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "value", "type": "XeGPU_ValueType" } ], "attributes": [ { "name": "const_offsets", "type": "DenseI64ArrayAttr" }, { "name": "packed", "type": "OptionalAttr" }, { "name": "transpose", "type": "OptionalAttr" }, { "name": "l1_hint", "type": "OptionalAttr" }, { "name": "l2_hint", "type": "OptionalAttr" }, { "name": "l3_hint", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$TensorDesc ``\n custom($offsets, $const_offsets)\n prop-dict attr-dict `:` qualified(type($TensorDesc)) `->` type($value)" }, { "name": "xegpu.nbarrier_arrive", "summary": "It signals the arrival at the named barrier.", "description": "NbarrierArriveOp signals the hardware (or other threads)\n that the current thread has produced its data for the consumer threads. When\n the hardware signalled by `participant_thread_num` threads for the named barrier,\n it will notify the threads waiting for the named barrier to continue their work.", "operands": [ { "name": "nbarrier", "type": "XeGPU_Nbarrier" } ], "assemblyFormat": "$nbarrier attr-dict `:` qualified(type($nbarrier))" }, { "name": "xegpu.nbarrier_wait", "summary": "It waits for a named barrier.", "description": "NbarrierWaitOp signals the hardware which named barrier\n the current thread is waiting for, such that it can get notified when the\n named barrier is completed.", "operands": [ { "name": "nbarrier", "type": "XeGPU_Nbarrier" } ], "assemblyFormat": "$nbarrier attr-dict `:` qualified(type($nbarrier))" }, { "name": "xegpu.prefetch", "summary": "prefetches a set of scattered data points to cache", "description": "It issues instructions to prefetch a set of scattered data points\n from memory to each level of the cache based on their cache policy.\n As compared to prefetch_nd, which works on non-scattered TensorDesc,\n it works on scattered TensorDesc instead.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `source`: represents the memory region to be loaded from, which can be either a\n 1D memref or pointer (ui64, ui32, i64 or i32).\n\n - `offsets`: represents offsets from source.\n offsets is a vector of `index` type and vector length is either the subgroup size\n or 1 at lane level. scalar offset is also valid for lane level.\n\n - `l1_hint`, `l2_hint`, `l3_hint`: [optional] cache hints for each level of cache.\n\n - `offset_align_byte`: [optional] required if `source` is a pointer. If `source` is not a pointer,\n it is not allowed. Represents the alignment in bytes of each offset in offsets.\n\n - `layout`: [optional] Describes the expected layout of the `tensor_desc` or `offsets`\n operand. Only valid at workgroup and subgroup levels.\n\n Example 1 (Workgroup level):\n ```mlir\n %a = memref.alloc() : memref<256xf16>\n %offsets = arith.constant dense<[0, 1, ..., 255]> : vector<256xindex>\n xegpu.prefetch %a[%offsets] {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n layout = #xegpu.layout\n }\n : memref<256xf16>, vector<256xindex>\n ```\n\n Example 2 (lane level):\n A variant accepts memref or integer (raw pointer) as base and offsets directly.\n The source operand could be a raw pointer (ui64, ui32, i64, i32).\n ```mlir\n %a = memref.alloc() : memref<1024xf32>\n %0 = arith.constant dense<[0, 16, 32, 64]> : vector<4xindex>\n xegpu.prefetch %a[%0] {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint}\n : memref<1024xf32>, vector<4xindex>\n ```\n\n Example 3 (lane level):\n lane level only accepts the offsets variant.\n ```mlir\n xegpu.prefetch %0[%1] {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint}\n : memref<256xf32>, vector<1xindex>\n ```\n\n Example 4 (lane level):\n lane level only accepts the offsets variant.\n ```mlir\n xegpu.prefetch %0[%1] {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n offset_align_byte = 2}\n : i64, vector<1xindex>\n ```", "operands": [ { "name": "source", "type": "XeGPU_GatherScatterBaseAddrType" }, { "name": "offsets", "type": "AnyTypeOf<[XeGPU_OffsetType, Index]>" } ], "attributes": [ { "name": "l1_hint", "type": "OptionalAttr" }, { "name": "l2_hint", "type": "OptionalAttr" }, { "name": "l3_hint", "type": "OptionalAttr" }, { "name": "offset_align_byte", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$source `[` $offsets `]`\n prop-dict\n attr-dict `:` type(operands)" }, { "name": "xegpu.prefetch_nd", "summary": "prefetches a n-D block to cache", "description": "It issues an instruction to prefetch a block of data from continuous\n memory regions to each level of the cache based on their cache policy.\n\n The tensor descriptor can be n-dimensional. When the\n tensor descriptor has more than 2 dimensions, the leading dimensions are\n treated as **batch dimensions** that are unrolled to unit dimensions during\n lowering. At the subgroup level, the prefetch_nd operation executes at 2D\n granularity to match the 2D block IO hardware support. The number of offset\n indices must match the rank of the tensor descriptor.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n - `TensorDesc`: A tensor descriptor specifying the base nd-region of\n memory and tensor tile to be prefetched. Can be 1D, 2D, 3D, or higher\n dimensional where leading dimensions are batch dimensions.\n\n - `offsets`: index values representing per-dimension offsets from the\n base position encoded in `TensorDesc`. It is encoded via \"offsets\"\n and \"const_offsets\". The number of offsets must match the tensor descriptor rank.\n\n - `l1_hint`, `l2_hint`, `l3_hint`: [optional] An cache-hint attribute\n indicating the desired behavior at the L1, L2, and L3 cache levels.\n\n - `layout`: [optional] Describes the expected layout of the `tensor_desc` operand.\n Only valid at the workgroup and subgroup levels.\n\n Example 1 (Workgroup level, 2D):\n ```mlir\n %c0 = arith.constant 0 : index\n %c1 = arith.constant 1 : index\n xegpu.prefetch_nd %tdesc[%c0, %c1] {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n layout = #xegpu.layout }\n : !xegpu.tensor_desc<32x256xf16>\n ```\n\n Example 2 (3D with batch dimension):\n ```mlir\n // Prefetch 4 independent 8x16 blocks\n xegpu.prefetch_nd %tdesc[0, 0, 0] <{l1_hint = #xegpu.cache_hint}>\n : !xegpu.tensor_desc<4x8x16xf16>\n ```", "operands": [ { "name": "TensorDesc", "type": "XeGPU_TensorDesc" }, { "name": "offsets", "type": "Variadic" } ], "attributes": [ { "name": "const_offsets", "type": "DenseI64ArrayAttr" }, { "name": "l1_hint", "type": "OptionalAttr" }, { "name": "l2_hint", "type": "OptionalAttr" }, { "name": "l3_hint", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$TensorDesc ``\n custom($offsets, $const_offsets)\n prop-dict attr-dict `:` qualified(type($TensorDesc))" }, { "name": "xegpu.store", "summary": "store data to scattered memory locations.", "description": "It (aka. store) stores data to scattered memory locations. The value is\n typically a 1D vector. But when the chunk size of the TensorDesc is larger than 1, it will be\n a 2D vector instead. For the later case, dim-1 of the value correspods to the simd lanes\n and the dim-0 of the value corresponds to the chunk size stored per lane. So `store_scatter`\n has transpose effect, which is similar to `load_gather`. Therefore, a transpose attribute is\n introduced on purpose, making sure users are aware of this implicit transformation.\n\n In lane level, the result is a 1D vector that represents the data to be stored by\n each lane. If size is not 1, size should be equal to the chunk size.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `value`: represents the data to be stored.\n\n - `dest`: represents the memory region to be stored to, which can be either a\n 1D memref or pointer (ui64, ui32, i64 or i32).\n\n - `offsets`: represents offsets from dest.\n offsets is a vector of `index` type and vector length is either the subgroup size\n or 1 at lane level. scalar offset is also valid for lane level.\n\n - `mask`: is a vector of `i1` type, which is used to mask out the memory access.\n mask is a vector of size equal to the subgroup size, or 1 at lane level.\n scalar mask is also valid for lane level.\n\n - `chunk_size`: [optional] represents contiguous number of elements to store to per work item.\n\n - `l1_hint`, `l2_hint`, `l3_hint`: [optional] cache hints for each level of cache.\n\n - `layout`: [optional] Describes the expected layout of the `tensor_desc` operand or the value\n to be stored. Only valid at workgroup and subgroup levels.\n\n\n Example 1 (Subgroup level):\n A variant accepts memref as base pointer and an offset.\n The dest operand could be a raw pointer (uint64_t).\n ```mlir\n %a = memref.alloc() : memref<1024xf32>\n %val = arith.constant dense<0.0> : vector<16xf32>\n %offsets = vector.step : vector<16xindex>\n %mask = vector.constant_mask [16]: vector<16xi1>\n xegpu.store %val, %a[%offsets], %mask {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n layout = #xegpu.layout}\n : vector<16xf32>, memref<1024xf32>, vector<16xi1>, vector<16xindex>\n ```\n\n Example 2 (Lane level):\n Lane level IR only accepts the offsets variant. chunk_size can be inferred from value\n type. In this example, chunk_size is 8.\n ```mlir\n xegpu.store %0, %1[%2], %3 <{l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint}>\n : vector<8xf32>, memref<256xf32>, vector<1xindex>, vector<1xi1>\n ```", "operands": [ { "name": "value", "type": "XeGPU_ValueOrScalarType" }, { "name": "dest", "type": "XeGPU_GatherScatterBaseAddrType" }, { "name": "offsets", "type": "AnyTypeOf<[XeGPU_OffsetType, Index]>" }, { "name": "mask", "type": "AnyTypeOf<[XeGPU_MaskType, I1]>" } ], "attributes": [ { "name": "chunk_size", "type": "OptionalAttr" }, { "name": "l1_hint", "type": "OptionalAttr" }, { "name": "l2_hint", "type": "OptionalAttr" }, { "name": "l3_hint", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" }, { "name": "contiguity", "type": "OptionalAttr" } ], "assemblyFormat": "$value `,`\n $dest `[` $offsets `]` `,`\n $mask\n prop-dict\n attr-dict `:` type(operands)" }, { "name": "xegpu.store_matrix", "description": "This operation stores a `data` fragment into the shared local memory region\n specified by a `mem_desc`. Memory descriptors of any rank (1D or higher) are supported.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n - `mem_desc`: the memory descriptor specifying the SLM region.\n - `offsets`: the coordinates within the memory descriptor where the data will be written.\n - `data`: the values to be stored.\n - `subgroup_block_io`: [optional] An attribute indicating that the operation can be lowered\n to a subgroup block store. When this attribute is present, the offsets are subgroup-uniform\n across all lanes. Only used on subgroup and lane level.\n - `layout`: [optional] Describes the expected layout of the `mem_desc` operand as well as\n the value to be stored (they are identical). Only valid at workgroup and subgroup levels.\n\n Example (1D):\n ```mlir\n xegpu.store_matrix %1, %0[%c0] : vector<16xf16>, !xegpu.mem_desc<64xf16>, index\n ```\n\n Example (Workgroup level, 2D):\n ```mlir\n %c0 = arith.constant 0 : index\n xegpu.store_matrix %1, %0[%c0, %c0] <{\n layout = #xegpu.layout }>\n : vector<128x128xf16>, !xegpu.mem_desc<128x128xf16>>, index, index\n ```", "operands": [ { "name": "data", "type": "XeGPU_ValueOrScalarType" }, { "name": "mem_desc", "type": "XeGPU_MemDesc" }, { "name": "offsets", "type": "Variadic" } ], "attributes": [ { "name": "const_offsets", "type": "DenseI64ArrayAttr" }, { "name": "subgroup_block_io", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$data `,` $mem_desc `` custom($offsets, $const_offsets)\n prop-dict attr-dict `` `:` type(operands)" }, { "name": "xegpu.store_nd", "summary": "stores a n-D block register region back to memory", "description": "StoreNdOp essentially mimics the hardware block write instruction io\n write a block of data from register into the memory region as described\n by the TensorDesc. It takes a set of optional cache hints for each level\n of cache, L1, L2 and L3. If hardware does not have a correspoding cache,\n Corresponding cache hint attribute will be masked.\n\n The tensor descriptor can be 1D, 2D, 3D, or higher dimensional. When the\n tensor descriptor has more than 2 dimensions, the leading dimensions are\n treated as **batch dimensions** that are unrolled to unit dimensions during\n lowering. At the subgroup level, the store_nd operation executes at 2D\n granularity to match the 2D block IO hardware support. The value vector\n must have the same shape as the tensor descriptor. The number of offset\n indices must match the rank of the tensor descriptor.\n\n At lane level, the input vector represents the data to be stored by each lane.\n\n This operation serves as an anchor through which users assign a layout attribute\n to govern computation distribution.\n\n Arguments:\n\n - `value`: A vector value representing the tensor tile to be stored. Can be\n 1D, 2D, 3D, or higher dimensional where leading dimensions are batch dimensions.\n\n - `TensorDesc`: A tensor descriptor specifying the base nd-region of memory and\n the tensor tile to be stored. Can be 1D, 2D, 3D, or higher dimensional\n where leading dimensions are batch dimensions.\n\n - `offsets`: Index values representing per-dimension offsets from the base position\n encoded in `TensorDesc`. They are encoded via `offsets` and `const_offsets`.\n The number of offsets must match the tensor descriptor rank.\n\n - `l1_hint`, `l2_hint`, `l3_hint`: [optional] Cache-hint attributes indicating the\n desired behavior at the L1, L2, and L3 cache levels.\n\n - `layout`: [optional] Describes the expected layout of the `tensor_desc` operand as well as\n the value to be stored (they are identical). Only valid at workgroup and subgroup levels.\n\n Example 1 (Workgroup level, 2D):\n ```mlir\n xegpu.store_nd %3, %2 {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint,\n layout = #xegpu.layout}\n : vector<32x256xf16>, !xegpu.tensor_desc<32x256xf16>\n ```\n\n Example 2 (lane level, 2D):\n ```mlir\n xegpu.store_nd %3, %2 {l1_hint = #xegpu.cache_hint,\n l2_hint = #xegpu.cache_hint,\n l3_hint = #xegpu.cache_hint}\n : vector<8xf16>, !xegpu.tensor_desc<8x16xf16>\n ```\n\n Example 3 (3D with batch dimension):\n ```mlir\n // Store 4 independent 8x16 blocks\n xegpu.store_nd %value, %tdesc[0, 0, 0] <{l1_hint = #xegpu.cache_hint}>\n : vector<4x8x16xf16>, !xegpu.tensor_desc<4x8x16xf16>\n ```", "operands": [ { "name": "value", "type": "XeGPU_ValueType" }, { "name": "TensorDesc", "type": "XeGPU_TensorDesc" }, { "name": "offsets", "type": "Variadic" } ], "attributes": [ { "name": "const_offsets", "type": "DenseI64ArrayAttr" }, { "name": "l1_hint", "type": "OptionalAttr" }, { "name": "l2_hint", "type": "OptionalAttr" }, { "name": "l3_hint", "type": "OptionalAttr" }, { "name": "layout", "type": "OptionalAttr" } ], "assemblyFormat": "$value `,`\n $TensorDesc ``\n custom($offsets, $const_offsets)\n prop-dict attr-dict `:` type($value) `,` qualified(type($TensorDesc))" }, { "name": "xegpu.truncf", "summary": "It performs floating point truncation from higher precision to lower precision.", "description": "The `xegpu.truncf` operation truncates floating point values from a higher\n precision type to a lower precision type.\n Converts `f16` and `bf16` to microscaling float types.\n Rounding mode defaults to round to nearest even.\n\n Example:\n ```mlir\n %res = xegpu.truncf %src : vector<16xf16> -> vector<16xf8E5M2>\n ```", "operands": [ { "name": "source", "type": "FixedVectorOfNonZeroRankOf<[XeGPU_FloatType]>" } ], "results": [ { "name": "result", "type": "FixedVectorOfNonZeroRankOf<[XeGPU_FloatType]>" } ], "assemblyFormat": "$source attr-dict `:` type(operands) `->` type(results)" }, { "name": "xegpu.update_nd_offset", "summary": "It updates the offsets for the TensorDesc.", "description": "The op updates the offset of the given TensorDesc.\n The offsets are relative offset to the current position in the number\n of elements. It will result in a same type TensorDesc as the input.\n\n Example:\n ```\n %2 = xegpu.update_nd_offset %1, [0, 16]: !xegpu.tensor_desc<8x16xf32>\n ```", "operands": [ { "name": "TensorDesc", "type": "XeGPU_TensorDesc" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "result", "type": "XeGPU_TensorDesc" } ], "attributes": [ { "name": "const_offsets", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['TensorDesc', 'result']>" } ], "assemblyFormat": "$TensorDesc `,`\n custom($offsets, $const_offsets)\n attr-dict `:` qualified(type($result))" }, { "name": "xegpu.update_offset", "summary": "It updates the offsets for the given tensor descriptor", "description": "It behaves similar to `update_nd_offset` in terms that\n it updates offset of a TensorDesc, and the offsets are relative offset to\n the current position in the number of elements. However, `update_nd_offset`\n is to update the start point of a 2D block, so its offset constains two\n elements representing the shift in each dimension. `update_offset` is to\n update the offset per lane, so its offsets contains values representing\n shifts for each lane.\n\n Example:\n ```mlir\n %off = arith.constant dense<[32, 32, 32, 32]> : vector<4xindex>\n %2 = xegpu.update_offset %1, %off :\n !xegpu.tensor_desc<4x2xf32, #xegpu.scattered_tdesc_attr>, vector<4xindex>\n ```", "operands": [ { "name": "TensorDesc", "type": "XeGPU_TensorDesc" }, { "name": "offsets", "type": "XeGPU_OffsetType" } ], "results": [ { "name": "result", "type": "XeGPU_TensorDesc" } ], "traits": [ { "type": "AllTypesMatch<['TensorDesc', 'result']>" } ], "assemblyFormat": "$TensorDesc `,` $offsets attr-dict `:` qualified(type($TensorDesc)) `,` type($offsets)" }, { "name": "xevm.blockload", "summary": "subgroup block load", "description": "Reads one or more components of Result data for each invocation\n in the subgroup from the specified `ptr` as a block operation.\n The data is read strided, so the first value read is:\n ```\n ptr[ SubgroupLocalInvocationId ]\n ```\n and the second value read is:\n ```\n ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ]\n ```\n Result type may be a scalar or vector type of scalar element type.\n\n The parameters are:\n * `ptr` - the base address to load from. Must be uniform across subgroup.\n * `cache_control` - an enumerator that sets the cache behaviour\n\n Example:\n ```mlir\n %loaded_a = xevm.blockload %src,\n <{cache_control=#xevm.load_cache_control}>\n : (!llvm.ptr<1>) -> vector<4xi16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" } ], "results": [ { "name": "res", "type": "AnyTypeOf<[XeVM_1DBlockElemType, FixedVectorOfRankAndType<[1], [XeVM_1DBlockElemType]>]>" } ], "attributes": [ { "name": "cache_control", "type": "OptionalAttr" } ], "assemblyFormat": "operands prop-dict attr-dict `:` functional-type(operands, results)" }, { "name": "xevm.blockload2d", "summary": "2D block load", "description": "The `xevm.blockload2d` operation loads a two dimensional matrix tile\n from a base matrix residing in global memory. The parameters are:\n * `ptr` - the base address of the base matrix containing the tile to load\n * `base_width` - the width of the base matrix in number of bytes.\n * `base_height` - the number of rows in the base matrix\n * `base_pitch` - the physical stride between the first columns of the current\n row and the subsequent row in number of bytes.\n * `x`, `y`, `tile_width`, `tile_height` - the starting offsets and shape of\n the tile to load in number of elements.\n * `elem_size_in_bits` - the size in bits of the matrix element type\n - 32 for f32, tf32\n - 16 for f16, int16, bf16\n - 8 for int8\n * `v_blocks` - number of consecutive tiles in innermost dimension direction to load\n * `transpose` - transpose the tile in registers (useful for 32 bit element type)\n * `pack_register` - pack element types narrower than register bit width.\n [M, N] => [M/factor, N, factor] where factor is register_size_in_bits / elem_size_in_bits\n * `cache_control` - an enumerator that sets the cache behaviour\n\n Notes:\n - the `transpose` and `pack_register` parameters are mutual exclusive\n - transposing the tile loaded is used for A matrix in backward path or used for the B matrix operand\n (D = C + A * B), where A has row-major layout and B should have column-major layout in memory.\n - if the tile loaded contains out of bound elements of the matrix, they are filled with 0.\n\n Example:\n ```mlir\n %base_width_a = arith.constant 32 : i32\n %base_height_a = arith.constant 8 : i32\n %base_pitch_a = arith.constant 32 : i32\n %x = arith.constant 0 : i32\n %y = arith.constant 0 : i32\n %loaded_a = xevm.blockload2d %src, %base_width_a, %base_height_a, %base_pitch_a, %x, %y\n <{elem_size_in_bits=16 : i32, tile_width=16 : i32, tile_height=8 : i32,\n v_blocks=1 : i32, transpose=false : i32, pack_register=false,\n cache_control=#xevm.load_cache_control}>\n : (!llvm.ptr<1>, i32, i32, i32, i32, i32) -> vector<8xi16>\n ```", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "base_width", "type": "I32" }, { "name": "base_height", "type": "I32" }, { "name": "base_pitch", "type": "I32" }, { "name": "x", "type": "I32" }, { "name": "y", "type": "I32" } ], "results": [ { "name": "res", "type": "FixedVectorOfRankAndType<[1], [XeVM_ElemType]>" } ], "attributes": [ { "name": "elem_size_in_bits", "type": "I32Attr" }, { "name": "tile_width", "type": "I32Attr" }, { "name": "tile_height", "type": "I32Attr" }, { "name": "v_blocks", "type": "I32Attr" }, { "name": "transpose", "type": "I1Attr" }, { "name": "pack_register", "type": "I1Attr" }, { "name": "cache_control", "type": "OptionalAttr" } ], "assemblyFormat": "operands prop-dict attr-dict `:` functional-type(operands, results)" }, { "name": "xevm.blockprefetch2d", "summary": "2D block prefetch", "description": "The `xevm.blockprefetch2d` operation prefetches a two dimensional tile\n from a larger base matrix residing in global memory. The parameters are:\n * `ptr` - the base address of the base matrix containing the tile to prefetch\n * `base_width` - the width of the base matrix in number of bytes.\n * `base_height` - the number of rows in the base matrix\n * `base_pitch` - the physical stride between the first columns of the current\n row and the subsequent row in number of bytes.\n * `x`, `y`, `tile_width`, `tile_height` - the starting offsets and shape of tile\n to prefetch in number of elements.\n * `elem_size_in_bits` - the size in bits of the matrix element\n - 32 for f32, bf32\n - 16 for f16, int16, bf16\n - 8 for int8, int4, int2\n * `v_blocks` - number of tiles in innermost dimension direction to prefetch\n * `cache_control` - an enumerator that sets the cache behaviour\n\n Example:\n ```mlir\n xevm.blockprefetch2d %ptr, %base_width, %base_height, %base_pitch, %x, %y\n <{elem_size_in_bits=8 : i32, tile_width=32 : i32, tile_height=8 : i32,\n v_blocks=1 : i32, cache_control=#xevm.load_cache_control}>\n : (!llvm.ptr<1>, i32, i32, i32, i32, i32)\n ```", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "base_width", "type": "I32" }, { "name": "base_height", "type": "I32" }, { "name": "base_pitch", "type": "I32" }, { "name": "x", "type": "I32" }, { "name": "y", "type": "I32" } ], "attributes": [ { "name": "elem_size_in_bits", "type": "I32Attr" }, { "name": "tile_width", "type": "I32Attr" }, { "name": "tile_height", "type": "I32Attr" }, { "name": "v_blocks", "type": "I32Attr" }, { "name": "cache_control", "type": "OptionalAttr" } ], "assemblyFormat": "operands prop-dict attr-dict `:` `(` type(operands) `)`" }, { "name": "xevm.blockstore", "summary": "subgroup block store", "description": "Writes one or more components of `val` for each invocation\n in the subgroup to the specified `ptr` as a block operation.\n The data is written strided, so the first value is written to:\n ```\n ptr[ SubgroupLocalInvocationId ]\n ```\n and the second value is written to:\n ```\n ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ]\n ```\n `val` type may be a scalar or vector type of scalar element type.\n\n The parameters are:\n * `ptr` - the base address to store to. Must be uniform across subgroup.\n * `val` - the value to store\n * `cache_control` - an enumerator that sets the cache behaviour\n\n Example:\n ```mlir\n xevm.blockstore %ptr, %val\n <{cache_control=#xevm.store_cache_control}>\n : (!llvm.ptr<1>, vector<4xi16>)\n ```", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "val", "type": "AnyTypeOf<[XeVM_1DBlockElemType, FixedVectorOfRankAndType<[1], [XeVM_1DBlockElemType]>]>" } ], "attributes": [ { "name": "cache_control", "type": "OptionalAttr" } ], "assemblyFormat": "operands prop-dict attr-dict `:` `(` type(operands) `)`" }, { "name": "xevm.blockstore2d", "summary": "2D block store", "description": "The `xevm.blockstore2d` operation stores a two dimensional tile into a\n larger matrix residing in global memory. The parameters are:\n * `ptr` - the base address of the target matrix where to store the tile\n * `base_width` - the width of the base matrix in number of bytes.\n * `base_height` - the number of rows in the base matrix\n * `base_pitch` - the physical stride between the first columns of the current\n row and the subsequent row in number of bytes.\n * `x`, `y`, `tile_width`, `tile_height` - the starting offsets and shape of the tile to store\n in number of elements.\n * `elem_size_in_bits` - the size in bits of the matrix element\n - 32 for f32, tf32\n - 16 for f16, int16, bf16\n - 8 for int8\n * `cache_control` - an enumerator that sets the cache behaviour\n * `stored_val` - the tile to store\n\n Example:\n ```mlir\n %base_width_c = arith.constant 64 : i32\n %base_height_c = arith.constant 8 : i32\n %base_pitch_c = arith.constant 64 : i32\n %x = arith.constant 0 : i32\n %y = arith.constant 0 : i32\n xevm.blockstore2d %dst, %base_width_c, %base_height_c, %base_pitch_c, %x, %y, %src\n <{elem_size_in_bits=32 : i32, tile_width=16 : i32, tile_height=8 : i32,\n cache_control=#xevm.load_cache_control}>\n : (!llvm.ptr<1>, i32, i32, i32, i32, i32, vector<8xi32>)\n ```", "operands": [ { "name": "ptr", "type": "LLVM_AnyPointer" }, { "name": "base_width", "type": "I32" }, { "name": "base_height", "type": "I32" }, { "name": "base_pitch", "type": "I32" }, { "name": "x", "type": "I32" }, { "name": "y", "type": "I32" }, { "name": "stored_val", "type": "FixedVectorOfRankAndType<[1], [XeVM_ElemType]>" } ], "attributes": [ { "name": "elem_size_in_bits", "type": "I32Attr" }, { "name": "tile_width", "type": "I32Attr" }, { "name": "tile_height", "type": "I32Attr" }, { "name": "cache_control", "type": "OptionalAttr" } ], "assemblyFormat": "operands prop-dict attr-dict `:` `(` type(operands) `)`" }, { "name": "xevm.extf", "summary": "Floating point extension from f8/bf8/f4 to f16/bf16", "description": "The `xevm.extf` operation extends a floating point value from\n f8/bf8/f4 format to f16/bf16 format. It is the inverse of `xevm.truncf`.", "operands": [ { "name": "src", "type": "AnyTypeOf<[FixedVectorOfRankAndType<[1], [I8, I<4>]>, I8, I<4>]>" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[FixedVectorOfRankAndType<[1], [F16, BF16]>, F16, BF16]>" } ], "attributes": [ { "name": "src_etype", "type": "XeVM_ExtfSrcElemTypeAttr" }, { "name": "dst_etype", "type": "XeVM_ExtfDstElemTypeAttr" } ], "assemblyFormat": "$src ` ` `{` $src_etype `,` $dst_etype `}` attr-dict `:` functional-type(operands, results)" }, { "name": "xevm.group_count.x", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.group_count.y", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.group_count.z", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.group_id.x", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.group_id.y", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.group_id.z", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.lane_id", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.local_id.x", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.local_id.y", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.local_id.z", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.local_size.x", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.local_size.y", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.local_size.z", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.memfence", "summary": "Work-item's memory fence.", "description": "This operation ensures that all prior memory accesses of this\n work-item to `addrspace` are visible to all other work-items in `scope`.\n Parameters description:\n * `scope` - specify the memory scope at which all other work-items should observe\n memory operations prior to the fence.\n * `addrspace` - specify the address space of work-item's memory accesses\n to be affected by the fence.", "attributes": [ { "name": "scope", "type": "XeVM_MemScopeAttr{lane|subgroup|workgroup|cluster|device|system}" }, { "name": "addrspace", "type": "DefaultValuedAttr" } ], "assemblyFormat": "prop-dict attr-dict" }, { "name": "xevm.mma", "summary": "Subgroup matrix multiply-add", "description": "The `xevm.mma` is a cooperative operation where all threads/lanes in\n a subgroup participates and carries out matrix multiplication plus accumulation:\n\n D = C + A x B\n\n where the A, B, C input matrices and the result D have shapes:\n - D : MxN\n - C : MxN\n - A : MxK\n - B : KxN\n\n Parameters:\n * `a` - vector of matrix A elements.\n * `b` - vector of matrix B elements.\n * `c` - (optional) vector of matrix C elements.\n * `shape` - the shape of the matrices, specified as `M`, `N`, and `K` values.\n * `types` - the data types of the matrices, specified as `D`, `A`, `B`, and optionally `C`.\n\n Example:\n ```mlir\n %d = xevm.mma %a, %b, %c { shape=, types= }\n : (vector<8xi16>, vector<8xi32>, vector<8xf32>) -> vector<8xf32>\n ```", "operands": [ { "name": "a", "type": "FixedVectorOfRankAndType<[1], [XeVM_MatrixElemType]>" }, { "name": "b", "type": "FixedVectorOfRankAndType<[1], [XeVM_MatrixElemType]>" }, { "name": "c", "type": "Optional>" } ], "results": [ { "name": "d", "type": "FixedVectorOfRankAndType<[1], [XeVM_MatrixElemType]>" } ], "attributes": [ { "name": "shape", "type": "XeVM_MMAShapeAttr" }, { "name": "types", "type": "XeVM_MMATypesAttr" } ], "assemblyFormat": "$a `,` $b (`,` $c^)? ` `\n `{`\n `shape` `=` $shape `,`\n `types` `=` $types\n `}` attr-dict `:` functional-type(operands, results)" }, { "name": "xevm.mma_mx", "summary": "Subgroup matrix multiply-add with MxN shape and MX scaling", "description": "The `xevm.mma_mx` is similar to `xevm.mma` has scale operands for A and B matrices.\n It is a cooperative operation where all threads/lanes in a subgroup participates\n and carries out matrix multiplication plus accumulation:\n\n D = C + A x B\n\n where the A, B, C input matrices and the result D have shapes:\n - D : MxN\n - C : MxN\n - A : MxK\n - B : KxN\n\n Parameters:\n * `a` - vector of matrix A elements.\n * `b` - vector of matrix B elements.\n * `scale_a` - vector or scalar of scaling factors for matrix A.\n * `scale_b` - vector or scalar of scaling factors for matrix B.\n * `c` - (optional) vector of matrix C elements.\n * `shape` - the shape of the matrices, specified as `M`, `N`, and `K` values.\n * `types` - the data types of the matrices, specified as `D`, `A`, `B`, and optionally `C`.", "operands": [ { "name": "a", "type": "FixedVectorOfRankAndType<[1], [XeVM_MatrixElemType]>" }, { "name": "b", "type": "FixedVectorOfRankAndType<[1], [XeVM_MatrixElemType]>" }, { "name": "scale_a", "type": "AnyTypeOf<[FixedVectorOfRankAndType<[1], [I8]>, I8]>" }, { "name": "scale_b", "type": "AnyTypeOf<[FixedVectorOfRankAndType<[1], [I8]>, I8]>" }, { "name": "c", "type": "Optional>" } ], "results": [ { "name": "d", "type": "FixedVectorOfRankAndType<[1], [XeVM_MatrixElemType]>" } ], "attributes": [ { "name": "shape", "type": "XeVM_MMAShapeAttr" }, { "name": "types", "type": "XeVM_MMATypesAttr" } ], "assemblyFormat": "$a `,` $b `,` $scale_a `,` $scale_b (`,` $c^)? ` `\n `{`\n `shape` `=` $shape `,`\n `types` `=` $types\n `}` attr-dict `:` functional-type(operands, results)" }, { "name": "xevm.prefetch", "summary": "Prefetch data into a cache subsystem.", "description": "Work-item issues a prefetch from global memory to cache:\n * `ptr` - LLVM pointer with address space. Address space must be 1 (global)\n or 4 (generic)\n * `cache_control` - specify caching options", "operands": [ { "name": "ptr", "type": "AnyTypeOf<[ LLVM_PointerInAddressSpace < 1 >, LLVM_PointerInAddressSpace < 4 > ]>" } ], "attributes": [ { "name": "cache_control", "type": "OptionalAttr" } ], "assemblyFormat": "operands prop-dict attr-dict `:` `(` type(operands) `)`" }, { "name": "xevm.subgroup_id", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.subgroup_size", "results": [ { "name": "res", "type": "AnyTypeOf<[I32, I64]>" } ], "attributes": [ { "name": "range", "type": "OptionalAttr" } ], "assemblyFormat": "(`range` $range^)? attr-dict `:` type($res)" }, { "name": "xevm.truncf", "summary": "Floating point truncation from f16/bf16 to f8/bf8/f4", "description": "The `xevm.truncf` operation truncates a floating point value from\n f16/bf16 to f8/bf8/f4 format.", "operands": [ { "name": "src", "type": "AnyTypeOf<[FixedVectorOfRankAndType<[1], [F16, BF16]>, F16, BF16]>" } ], "results": [ { "name": "dst", "type": "AnyTypeOf<[FixedVectorOfRankAndType<[1], [I8, I<4>]>, I8, I<4>]>" } ], "attributes": [ { "name": "src_etype", "type": "XeVM_TruncfSrcElemTypeAttr" }, { "name": "dst_etype", "type": "XeVM_TruncfDstElemTypeAttr" } ], "assemblyFormat": "$src ` ` `{` $src_etype `,` $dst_etype `}` attr-dict `:` functional-type(operands, results)" }, { "name": "xla_cpu.extract_workgroup_id", "summary": "Extracts the workgroup id from the call frame", "description": "Given a call frame, returns the workgroup id in the dimension provided.\n\n ```mlir\n %0 = xla_cpu.extract_workgroup_id %call_frame, x\n %1 = xla_cpu.extract_workgroup_id %call_frame, y\n %2 = xla_cpu.extract_workgroup_id %call_frame, z\n ```", "operands": [ { "name": "call_frame", "type": "XLACPU_CallFrame" } ], "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "WorkGroupDimensionAttr{x|y|z}" } ], "assemblyFormat": "$call_frame `,` $dimension attr-dict" }, { "name": "xla_cpu.load", "summary": "Loads a tensor from an XLA:CPU call frame", "description": "Loads a tensor from an XLA:CPU call frame at the given index.\n\n ```mlir\n %0 = xla_cpu.load %call_frame, 0 : tensor<32x32xf32>\n ```", "operands": [ { "name": "call_frame", "type": "XLACPU_CallFrame" } ], "results": [ { "name": "result", "type": "TensorOrMemRef" } ], "attributes": [ { "name": "index", "type": "I32Attr" } ], "assemblyFormat": "$call_frame `,` $index attr-dict `:` type($result)" }, { "name": "xla_cpu.success", "summary": "Creates an !xla_cpu.error in the 'success' state.", "results": [ { "name": "result", "type": "XLACPU_Error" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "xla_framework.buffer_to_mem", "summary": "Creation of memref from XLA buffer pointer", "description": "This convert's between XLA's representation of a buffer and standard MLIR's\n representation of memrefs.\n\n This will be lowered to LLVM logic that will take a pointer and create a\n memref descriptor based on the static information for the memref.", "operands": [ { "name": "buffer", "type": "XLAFramework_BufferType" } ], "results": [ { "name": "result", "type": "AnyRankedOrUnrankedMemRef" } ], "assemblyFormat": "$buffer attr-dict `:` type($result)" }, { "name": "xla_framework.mem_to_buffer", "summary": "Creation of XLA buffer pointer from memref", "description": "This convert's between XLA's and standard MLIR's representations of memrefs.\n\n This will be lowered to LLVM logic that will pass through a memref's\n pointer.", "operands": [ { "name": "memref", "type": "AnyRankedOrUnrankedMemRef" } ], "results": [ { "name": "buffer", "type": "XLAFramework_BufferType" } ], "assemblyFormat": "$memref attr-dict `:` type($memref)" }, { "name": "xla_gpu.allocate_shared", "summary": "Allocates a shared memory tile.", "description": "Allocates a shared memory tensor. The tensor is shared among all threads in\n a block.\n\n ```mlir\n %shared = xla_gpu.allocate_shared : tensor<32x32xf32>\n ```", "results": [ { "name": "result", "type": "AnyStaticShapeTensor" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "xla_gpu.insert", "summary": "Inserts an indexed vector into a tensor", "operands": [ { "name": "source", "type": "XLAGPU_IndexedVectorType" }, { "name": "indices", "type": "Variadic" }, { "name": "dest", "type": "AnyRankedTensor" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "map", "type": "XLA_IndexingMapAttr" } ], "traits": [ { "type": "TypesMatchWith<'result', 'dest', '$_self'>" } ], "assemblyFormat": "$source `(` $indices `)` `into` $dest `at` $map attr-dict `:` type($source) `->` type($result)" }, { "name": "xla_gpu.pdl_launch_dependents", "summary": "Triggers programmatic dependent launch." }, { "name": "xla_gpu.pdl_wait", "summary": "Waits for upstream dependencies." }, { "name": "xla_gpu.reduce", "summary": "Performs a reduction", "description": "The `xla_gpu.reduce` op performs a variadic reduction of the provided\n operands using the list of dimensions and a symbol for a combiner function.\n\n ```mlir\n func.func @add(%a_acc: f32, %b_acc: i32, %a: f32, %b: i32)\n -> (f32, i32) {\n %0 = arith.addf %a_acc, %a : f32\n %1 = arith.addi %b_acc, %b : i32\n func.return %0, %1 : f32, i32\n }\n %sum:2 = xla_gpu.reduce (%in0, %in1) inits(%init0, %init1) dimensions=[0, 2]\n combiner=@add : tensor<16x8x4xf32>, tensor<16x8x4xi32>\n to tensor<8xf32>, tensor<8xi32>\n ```", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "dimensions", "type": "ConfinedAttr]>" }, { "name": "combiner", "type": "FlatSymbolRefAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "xla_gpu.shuffle_reduce", "summary": "Performs a full warp shuffle and reduces the values", "description": "This op performs a full warp shuffle and reduces the results using the given\n function. The function is invoked with the operands from the low lanes,\n followed by the operands from the high lanes. For example:\n\n ```\n %result:2 = xla_gpu.shuffle_reduce (%in0, %in1) to 16 combiner=@argmax\n ```\n\n Will perform shuffles with distance 16, 8, 4, 2 and 1, and will invoke\n @argmax five times. The first invocations will be\n\n ```\n @argmax(%in0[i], %in1[i], %in0[16+i], %in1[16+i])\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "combiner", "type": "FlatSymbolRefAttr" }, { "name": "max_distance", "type": "I64Attr" } ], "traits": [ { "type": "TypesMatchWith<'operands', 'results', '$_self'>" } ], "hasCustomAssemblyFormat": true }, { "name": "xla_gpu.sync_threads", "summary": "Synchronizes threads.", "description": "Synchronizes threads, taking any number of distributed tensors and returning\n the synchronized state.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "traits": [ { "type": "TypesMatchWith<'operands', 'results', '$_self'>" } ], "assemblyFormat": "operands attr-dict `:` type($operands)" }, { "name": "xla.apply_indexing", "summary": "Applies indexing map to a list of SSA values", "description": "The `apply_indexing` operation applies an indexing_map to a list\n of SSA values, yielding a single SSA value. The number of dimension and\n symbol arguments must be equal to the respective number of dimensional and\n symbolic inputs in the indexing_map. The index mapping can be\n multi-dimensional, and so the `apply_indexing` operation always returns one\n value. The operands and results must all have ‘index’ type.\n\n Example:\n\n ```mlir\n #map = #xla.indexing_map<(d0, d1)[s0] -> (d0 floordiv 8 + d1 floordiv 128, s0)>\n %results:2 = xla_ops.apply_indexing #map (%0 in [0, 10], %1 in [0, 11])[%2 in [11, 32]]\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "indexing_map_attr", "type": "XLA_IndexingMapAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "xla.atomic_rmw", "summary": "Atomically updates an element of a tensor.", "description": "Reads an element from a tensor, computes the updated value for it, and\n writes back the result.", "operands": [ { "name": "input", "type": "AnyRankedTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "regions": [ { "name": "computation", "type": "SizedRegion<1>" } ], "traits": [ { "type": "TypesMatchWith<'input', 'result', '$_self'>" } ], "assemblyFormat": "$input `[` $indices `]` `:` type($input) $computation attr-dict" }, { "name": "xla.get_dynamic_dim_size", "summary": "Returns the dynamic size of a dimension. The dynamic sizes are stored in the same buffer, after the main values as an array of s32. The `dim` argument can be larger than `tensor`'s rank, because XLA has passes like flatten_tensors that only change the view of the memory.", "operands": [ { "name": "tensor", "type": "AnyStaticShapeTensor" } ], "results": [ { "name": "result", "type": "I32" } ], "attributes": [ { "name": "dim", "type": "I64Attr" } ], "assemblyFormat": "$tensor $dim attr-dict `:` type($tensor)" }, { "name": "xla.loop", "summary": "Loop nest that iterates over all feasible values of RangeVars.", "description": "```mlir\n #map = #xla.indexing_map<(d0)[s0, s1] -> (d0 + s0, s1),\n domain:\n d0 in [0, 3],\n s0 in [0, 1024],\n s1 in [0, 32]\n >\n // Initial sum set to 0.\n %sum_0 = arith.constant 0.0 : f32\n %dim = arith.constant 1 : index\n // iter_args binds initial values to the loop's region arguments.\n %sum = xla.loop (%dim)[%i, %j] -> (%r0, %r1)\n in #map iter_args(%sum_iter = %sum_0) -> (f32) {\n %t = tensor.extract %buffer[%i, %j] : tensor<1024x32xf32>\n %sum_next = arith.addf %sum_iter, %t : f32\n // Yield current iteration sum to next iteration %sum_iter or to %sum\n // if final iteration.\n xla.yield %sum_next : f32\n }\n ```", "operands": [ { "name": "dims", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "indexing_map_attr", "type": "XLA_IndexingMapAttr" } ], "regions": [ { "name": "region", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "hasCustomAssemblyFormat": true }, { "name": "xla.predicated_extract", "summary": "Extracts a value from a tensor if a condition holds", "operands": [ { "name": "condition", "type": "I1" }, { "name": "fallback", "type": "AnyType" }, { "name": "src", "type": "AnyStaticShapeTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyType" } ], "traits": [ { "type": "TypesMatchWith<'src', 'fallback', '::llvm::cast($_self).getElementType()'>" }, { "type": "TypesMatchWith<'src', 'result', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$src `[` $indices `]` `if` $condition `else` $fallback attr-dict `:` type($src)" }, { "name": "xla.predicated_insert", "summary": "Inserts a value into a tensor if a condition holds", "operands": [ { "name": "condition", "type": "I1" }, { "name": "value", "type": "AnyType" }, { "name": "dest", "type": "AnyStaticShapeTensor" }, { "name": "indices", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyStaticShapeTensor" } ], "traits": [ { "type": "TypesMatchWith<'dest', 'result', '$_self'>" }, { "type": "TypesMatchWith<'dest', 'value', '::llvm::cast($_self).getElementType()'>" } ], "assemblyFormat": "$value `into` $dest `[` $indices `]` `if` $condition attr-dict `:` type($dest)" }, { "name": "xla.pure_call", "summary": "Function call without side effects.", "operands": [ { "name": "operands", "type": "Variadic" } ], "results": [ { "name": "result", "type": "Variadic" } ], "attributes": [ { "name": "callee", "type": "FlatSymbolRefAttr" } ], "assemblyFormat": "$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)" }, { "name": "xla.workgroup_id", "results": [ { "name": "result", "type": "Index" } ], "attributes": [ { "name": "dimension", "type": "WorkGroupDimensionAttr{x|y|z}" } ], "assemblyFormat": "$dimension attr-dict" }, { "name": "xla.yield", "summary": "Terminator for atomic_rmw ops.", "operands": [ { "name": "result", "type": "Variadic" } ], "assemblyFormat": "$result attr-dict `:` type($result)" }, { "name": "xsmm.binary.dispatch", "summary": "Generate a binary kernel for a specific tile size.", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "kind", "type": "XSMM_BinaryKind{NONE|ADD|MUL|SUB|DIV|MULADD|MATMUL|MUL_AND_REDUCE_TO_SCALAR_OP_ADD|PACK}" }, { "name": "compute_type", "type": "TypeAttr" }, { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "ldi1", "type": "I64Attr" }, { "name": "ldi2", "type": "I64Attr" }, { "name": "ldo", "type": "I64Attr" }, { "name": "func_type", "type": "FuncTypeAttr" }, { "name": "bcastType1", "type": "I32Attr" }, { "name": "bcastType2", "type": "I32Attr" } ], "assemblyFormat": "$kind `(` `bcast1` $bcastType1 `bcast2` $bcastType2 `ldo`\n $ldo `ldi2` $ldi2 `ldi1` $ldi1 `tile` $tile `compute` $compute_type `func` $func_type `)` attr-dict `:` type($ptr)", "hasCustomAssemblyFormat": true }, { "name": "xsmm.binary.invoke", "summary": "Invoke a previously generated binary kernel.", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "output", "type": "AnyMemRef" }, { "name": "input1", "type": "AnyMemRef" }, { "name": "input2", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.beta.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" }, { "name": "strideA", "type": "I64Attr" }, { "name": "strideB", "type": "I64Attr" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.bias.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" }, { "name": "strideA", "type": "I64Attr" }, { "name": "strideB", "type": "I64Attr" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.bias.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" }, { "name": "strideA", "type": "I64Attr" }, { "name": "strideB", "type": "I64Attr" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.bias.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.bias.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" }, { "name": "aOffsets", "type": "TypedArrayAttrBase" }, { "name": "bOffsets", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" }, { "name": "aOffsets", "type": "TypedArrayAttrBase" }, { "name": "bOffsets", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.relu.beta1.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.relu.beta1.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" }, { "name": "aOffsets", "type": "TypedArrayAttrBase" }, { "name": "bOffsets", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.relu.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.offs.relu.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" }, { "name": "aOffsets", "type": "TypedArrayAttrBase" }, { "name": "bOffsets", "type": "TypedArrayAttrBase" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.relu.beta.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.relu.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" }, { "name": "strideA", "type": "I64Attr" }, { "name": "strideB", "type": "I64Attr" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.brgemm.relu.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "attributes": [ { "name": "numBatches", "type": "I64Attr" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.bias.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM and relu shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.bias.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.relu.beta.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM and relu shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.relu.beta.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.relu.dispatch.f32", "summary": "query LIBXSMM's code registry based on GEMM and relu shape", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "tileld", "type": "TypedArrayAttrBase" } ], "assemblyFormat": "$tile `,` $tileld attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.gemm.relu.invoke.f32", "summary": "invoke a previously queried LIBXSMM kernel", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "c", "type": "F32MemRef" }, { "name": "a", "type": "F32MemRef" }, { "name": "b", "type": "F32MemRef" }, { "name": "d", "type": "F32MemRef" }, { "name": "indices", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "xsmm.unary.dispatch", "summary": "Generate a unary kernel for a specific tile size.", "results": [ { "name": "ptr", "type": "I64" } ], "attributes": [ { "name": "kind", "type": "XSMM_UnaryKind{NONE|IDENTITY|XOR|X2|SQRT|RELU|RELU_INV|TANH|TANH_INV|SIGMOID|SIGMOID_INV|GELU|GELU_INV|NEGATE|INC|RECIPROCAL|RECIPROCAL_SQRT|EXP|REDUCE_X_OP_ADD|REDUCE_X2_OP_ADD|REDUCE_X_X2_OP_ADD|REDUCE_X_OP_MAX|REDUCE_X_OP_MUL|REDUCE_X_OP_ADD_NCNC_FORMAT|REDUCE_TO_SCALAR_OP_ADD|DROPOUT|DROPOUT_INV|REPLICATE_COL_VAR|TRANSFORM_NORM_TO_VNNI|TRANSFORM_NORM_TO_NORMT|TRANSFORM_VNNI_TO_VNNIT|TRANSFORM_NORM_TO_VNNIT|TRANSFORM_NORM_TO_VNNI_PAD|UNPACK_TO_BLOCKS|LEAKY_RELU|LEAKY_RELU_INV|ELU|ELU_INV|STOCHASTIC_ROUND}" }, { "name": "compute_type", "type": "TypeAttr" }, { "name": "tile", "type": "TypedArrayAttrBase" }, { "name": "ldi", "type": "I64Attr" }, { "name": "ldo", "type": "I64Attr" }, { "name": "func_type", "type": "FuncTypeAttr" }, { "name": "bcastType", "type": "I32Attr" } ], "assemblyFormat": "$kind `(` $compute_type `,` $tile `,` $ldi `,` $ldo `,` $bcastType `)`\n `:` $func_type attr-dict", "hasCustomAssemblyFormat": true }, { "name": "xsmm.unary.invoke", "summary": "Invoke a previously generated unary kernel.", "operands": [ { "name": "ptr", "type": "I64" }, { "name": "output", "type": "AnyMemRef" }, { "name": "input", "type": "AnyMemRef" }, { "name": "indices", "type": "Variadic" } ], "hasCustomAssemblyFormat": true }, { "name": "xten_nn.atan2", "summary": "Calculate the atan2 of input/other of a given pair of tensor element-wise.", "description": "Calculate the arctangent of input/other of a given pair of tensor element-wise.", "operands": [ { "name": "input", "type": "XTenNN_AnyFloatTensor" }, { "name": "other", "type": "XTenNN_AnyFloatTensor" } ], "results": [ { "name": "output", "type": "XTenNN_AnyFloatTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.ConvTranspose", "summary": "Perform ConvTranspose operation", "description": "This operation is equivalent to `onnx.ConvTranspose` and computes the ConvTranspose.", "operands": [ { "name": "input", "type": "4DTensorOf<[AnyFloat]>" }, { "name": "weights", "type": "4DTensorOf<[AnyFloat]>" }, { "name": "bias", "type": "1DTensorOf<[AnyFloat]>" } ], "results": [ { "name": "output", "type": "4DTensorOf<[AnyFloat]>" } ], "attributes": [ { "name": "pad", "type": "ArrayAttr<2>" }, { "name": "output_padding", "type": "I64DenseArrayAttr<2>" }, { "name": "stride", "type": "I64DenseArrayAttr<2>" }, { "name": "dilation", "type": "I64DenseArrayAttr<2>" }, { "name": "group", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.depth_to_space", "summary": "Performs resizing to an image.", "description": "Permutes data from depth into blocks of spatial data.\n Outputs a copy of the input tensor where values from the depth dim are moved to the H and W dimension.\n Blocksize: The size of the blocks being moved.\n Mode:\n - 1: DCR: Elements are rearranged in order Depth - Column - Row\n - 2: CRD: Elements rearranged in order Column - Row - Depth", "operands": [ { "name": "X", "type": "4DTensorOf<[XTenNN_AnyIntegerOrFloat]>" } ], "results": [ { "name": "Y", "type": "4DTensorOf<[XTenNN_AnyIntegerOrFloat]>" } ], "attributes": [ { "name": "blocksize", "type": "I64Attr" }, { "name": "mode", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.dequantize", "summary": "Dequantizes a signless/unsigned integer tensor of given bitwidth to a float tensor.", "description": "Dequantizes a signless/unsigned integer tensor of given bitwidth to a float tensor.\n Since tosa is using signless/unsigned types currently, we also consider signless integer types for\n signed ones when the type is not unsigned until tosa support signed integers.\n\n Applies the following linear dequantization to the input tensor x:\n y = (x - zero_point) * scale\n\n Iff log2(scale) is representable as si32 and zero_point == 0, shift is set to log2(scale).\n In this case the dequantization is equal to:\n y = x * ( 2^shift )", "operands": [ { "name": "input", "type": "XTenNN_AnySignlessOrUnsignedIntegerTensor" } ], "results": [ { "name": "output", "type": "XTenNN_AnyFloatTensor" } ], "attributes": [ { "name": "shift", "type": "OptionalAttr" }, { "name": "scale", "type": "F32Attr" }, { "name": "zero_point", "type": "XTenNN_AnyIntegerAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "xten_nn.elu", "summary": "Calculate the elu operation of the given input tensor element-wise", "description": "Calculate the elu operation (Exponential Linear Unit) of the given input tensor element-wise.\n ELU(x) = x, if x > 0\n alpha * (exp(x)-1), if x <= 0", "operands": [ { "name": "input", "type": "XTenNN_AnyFloatTensor" } ], "results": [ { "name": "output", "type": "XTenNN_AnyFloatTensor" } ], "attributes": [ { "name": "alpha", "type": "F32Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.grid_sample", "summary": "Performs gridsampling given an input and a flow-field grid.", "description": "This operation is equivalent to `onnx.GridSample`, and computes the output value through\n the interpolation of the flow-field grid and the input.", "operands": [ { "name": "X", "type": "AnyTensor" }, { "name": "grid", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "align_corners", "type": "I64Attr" }, { "name": "mode", "type": "I64Attr" }, { "name": "padding_mode", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.group_conv2d", "summary": "Grouped convolution with multiple channel outputs per layer", "description": "Calculates separates convolutions with multiple channel outputs per layer.\n\n This operations expects the same TORCH/ONNX's Conv2d datalayout specification for input and\n weight [NxCxHxW].\n\n Pad attribute is expected to be two arrays of i64 values, eg: [[0,1], [2,2]]. First and second\n arrays denote the initial and end padding for H and W dimensions respectively.", "operands": [ { "name": "input", "type": "4DTensorOf<[AnyFloat]>" }, { "name": "weights", "type": "4DTensorOf<[AnyFloat]>" }, { "name": "bias", "type": "1DTensorOf<[AnyFloat]>" } ], "results": [ { "name": "output", "type": "4DTensorOf<[AnyFloat]>" } ], "attributes": [ { "name": "pad", "type": "ArrayAttr<2>" }, { "name": "stride", "type": "I64DenseArrayAttr<2>" }, { "name": "dilation", "type": "I64DenseArrayAttr<2>" }, { "name": "group", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.group_dequantize", "summary": "Group dequantizes an integer tensor of given width to a float32 tensor.", "description": "Dequantizes an integer tensor of given width to a float32 tensor.\n\n Scales and zeros must have a shape that is broadcastable to the quants shape.\n Output and scales most have the same dtype, as must zeros and quants.\n The range of values in zeros and quants is given by the min and max attributes,\n and the bits attribute gives the number of integer bits required for that range.\n\n Applies the following linear dequantization to the input tensor x:\n output[a][b][c] = (quants[a][b][c] - zeros[a][b][c]) * scales[a][b][c]", "operands": [ { "name": "quants", "type": "XTenNN_AnySignlessOrUnsignedIntegerTensor" }, { "name": "scales", "type": "XTenNN_AnyFloatTensor" }, { "name": "zeros", "type": "XTenNN_AnySignlessOrUnsignedIntegerTensor" } ], "results": [ { "name": "output", "type": "XTenNN_AnyFloatTensor" } ], "attributes": [ { "name": "min", "type": "SI32Attr" }, { "name": "max", "type": "SI32Attr" }, { "name": "bits", "type": "SI32Attr" } ], "assemblyFormat": "`(`$quants `:` type($quants) `,` $scales `:` type($scales)`,` $zeros `:` type($zeros)`)` attr-dict `->` type($output)" }, { "name": "xten_nn.group_quantize", "summary": "Group quantizes a float32 tensor to an integer tensor of given width.", "description": "Quantizes a given float32 tensor into a integer tensor of given width.\n\n Scales and zeros must have a shape that is broadcastable to the input shape.\n Input and scales most have the same dtype, as must zeros and quants.\n The range of values in zeros and quants is given by the min and max attributes,\n and the bits attribute gives the number of integer bits required for that range.\n\n Applies the following linear quantization:\n quants[a][b][c] = round( (input[a][b][c] / scales[a][b][c]) + zeros[a][b][c] )\n\n Round will saturate to the range of the output type and the rounding mode is set to half\n to nearest even.", "operands": [ { "name": "input", "type": "XTenNN_AnyFloatTensor" }, { "name": "scales", "type": "XTenNN_AnyFloatTensor" }, { "name": "zeros", "type": "XTenNN_AnySignlessOrUnsignedIntegerTensor" } ], "results": [ { "name": "quants", "type": "XTenNN_AnySignlessOrUnsignedIntegerTensor" } ], "attributes": [ { "name": "min", "type": "SI32Attr" }, { "name": "max", "type": "SI32Attr" }, { "name": "bits", "type": "SI32Attr" } ], "assemblyFormat": "`(`$input `:` type($input) `,` $scales `:` type($scales) `,` $zeros `:` type($zeros)`)` attr-dict `->` type($quants)" }, { "name": "xten_nn.kernel", "summary": "An opaque kernel", "description": "The `xten_nn.kernel` operation defines an opaque computation with a name.\n Example:\n ```\n %c = xten_nn.kernel \"myKernel\" (%arg0 : tensor<2xi64>) {attr = 4 : i32} -> tensor<2xi64>\n %d:2 = xten_nn.kernel \"frob\" (%arg0 : tensor<2xi64>, %arg1 : tensor<4xi64>) -> tensor<2xi64>, tensor<1xi64>\n %e = xten_nn.kernel \"matmul\" (%arg0 : tensor<2xi64>) instantiation_args {N = 42 : i32} {attr = 4 : i32} -> tensor<2xi64>\n ```", "operands": [ { "name": "arguments", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "attributes": [ { "name": "name", "type": "StrAttr" }, { "name": "instantiation_args", "type": "OptionalAttr" }, { "name": "instantiation_arg_names", "type": "OptionalAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "xten_nn.load_external_const", "summary": "Loads a constant from an external source as a const operator.", "description": "Represents a constant value that can be provided by a `method`, but the values are not otherwise available.\n The `method` is compiler-known and implemented, and not defined by this operation.\n The default conceptual `method` is \"h5\", indicating that the value is stored in an h5 `file` at index `key`.\n\n Unfortunately, this operation cannot carry the ConstantLike trait as a Fold operation\n is required to be implemented for constants. For this particular operation we cannot return\n a sensible value as other dialect constants do since the value is stored within a file.\n\n This implementation follows closely to what `ml_program.global_load_const` implements. As it too\n does not implement the ConstantLike trait.", "results": [ { "name": "output", "type": "AnyTensor" } ], "attributes": [ { "name": "key", "type": "StrAttr" }, { "name": "file", "type": "StrAttr" }, { "name": "method", "type": "OptionalAttr" } ], "assemblyFormat": "attr-dict `->` type($output)" }, { "name": "xten_nn.mish", "summary": "Calculate the mish operation of the given input tensor element-wise", "description": "Calculate the mish operation (Self Regularized Non-Monotonic Neural Activation Function) of the given input tensor element-wise.", "operands": [ { "name": "input", "type": "XTenNN_AnyFloatTensor" } ], "results": [ { "name": "output", "type": "XTenNN_AnyFloatTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.output", "summary": "Defines the output value of a subgraph or node", "description": "The `xten_nn.output` operation serves as the terminator for XTenNN operations\n that declare a region that produces result values.\n\n Example:\n ```mlir\n %sum = xten_nn.subgraph (%c0 = %arg0 : tensor<2xi64>) {\n // Implementation...\n xten_nn.output %result : tensor<120xi64>\n }\n ```", "operands": [ { "name": "operands", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($operands^ `:` type($operands))?" }, { "name": "xten_nn.quantize", "summary": "Quantizes a float tensor to a signless or unsigned integer tensor of given width.", "description": "Quantizes a given float tensor into a signless or unsigned integer tensor of given width.\n Since tosa is using signless/unsigned types currently, we also consider signless integer types for\n signed ones when the type is not unsigned until tosa support signed integers.\n\n Applies the following linear quantization to the input tensor x:\n y = round((x / scale) + zero_point)\n\n Iff log2(scale) is representable as si32 and zero_point == 0, shift is set to log2(scale).\n In this case the quantization is equal to:\n y = round( x / 2^shift )\n\n Round will saturate to the range of the output type and the rounding mode is set to half\n to nearest even.", "operands": [ { "name": "input", "type": "XTenNN_AnyFloatTensor" } ], "results": [ { "name": "output", "type": "XTenNN_AnySignlessOrUnsignedIntegerTensor" } ], "attributes": [ { "name": "shift", "type": "OptionalAttr" }, { "name": "scale", "type": "F32Attr" }, { "name": "zero_point", "type": "XTenNN_AnyIntegerAttr" } ], "hasCustomAssemblyFormat": true }, { "name": "xten_nn.reduce_mean", "summary": "Reduce Mean operation", "description": "This operation is equivalent to `onnx.ReduceMean` and computes the mean of\n the input tensor's elements along the provided axes.", "operands": [ { "name": "input", "type": "AnyRankedTensor" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axes", "type": "DenseI64ArrayAttr" }, { "name": "keepdims", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.reflect_pad", "summary": "Performs reflective padding over a tensor input.", "description": "Apply a padding with `reflect` mode meaning that the ifm is reflected where the padding is applied:\n data = [\n [1, 2],\n [3, 4],\n [5, 6],\n ]\n pads = [0, 2, 0, 0]\n output = [\n [1, 2, 1, 2],\n [3, 4, 3, 4],\n [5, 6, 5, 6],\n ]", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "pads", "type": "TensorOf<[I64]>" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.resize", "summary": "Performs resizing to an image.", "description": "Performs resizing to input image. Some constrains and information:\n - It does not perform 'antialias' for linear mode (ONNX's antialias==0)\n - It performs the resize in all dimensions (ONNX's axes==None)\n - No sampling is perfomed outside the tensor (ONNX's exclude_outside==0)\n - The input is always stretched to meet the new required dimensions (ONNX's keep_aspect_ratio_policy==stretch)\n - Scales\n - 1D vector with one value per dimension (4 for 2D resize, 5 for 3D resize)\n - Cordinate Transformation Mode:\n - 0: half_pixel\n - 1: pytorch_half_pixel\n - 2: asymmetric\n - 3: align_corners\n - Mode:\n - 0: Nearest\n - 1: Linear\n - Nearest mode:\n - 0: floor\n - 1: round_prefer_ceil\n - 2: round_prefer_floor", "operands": [ { "name": "X", "type": "TensorRankOf<[XTenNN_AnyIntegerOrFloat], [4, 5]>" } ], "results": [ { "name": "Y", "type": "TensorRankOf<[XTenNN_AnyIntegerOrFloat], [4, 5]>" } ], "attributes": [ { "name": "scales", "type": "DenseF32ArrayAttr" }, { "name": "coordinate_transformation_mode", "type": "I64Attr" }, { "name": "mode", "type": "I64Attr" }, { "name": "nearest_mode", "type": "I64Attr" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.round", "summary": "Calculate the round operation of the given input tensor element-wise.", "description": "Calculate the round operation of the given input tensor element-wise.\n In case of halves, the rule is to round them to the nearest even integer as does the 'round' operation in torch and onnx.", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.sign", "summary": "Calculate the sign of the given input tensor element-wise", "description": "Calculate the sign of the given input tensor element-wise. If input > 0, output 1. if input < 0, output -1. if input == 0, output 0.\n If the input is a NaN, the output will be a copy of the input element.", "operands": [ { "name": "input", "type": "AnyTensor" } ], "results": [ { "name": "output", "type": "AnyTensor" } ], "assemblyFormat": "operands attr-dict `:` functional-type(operands, results)" }, { "name": "xten_nn.subgraph", "summary": "Separates a subgraph inside a graph", "description": "The `xten_nn.subgraph` operation declares its body to be an isolated sub-\n graph, separated from the surrounding graph.\n\n This allows code motion between the parent and anonymous\n subgraphs.\n\n The meaning of the subgraph is described using both attributes and its\n body. If the body is present, the contents of the body can replace the\n subgraph operation without any change to what would be computed.\n The body is not required: in that case the attributes must be enough\n to identify the operation of the subgraph. (This resembles an func.func\n without a body: there may be a body in a different module or the\n compiler may know how to implement it when it is an intrinsic.)\n\n Example:\n ```mlir\n func.func @subgraph(%arg0: tensor<2xi64>) -> tensor<2xi64> {\n %sum = xten_nn.subgraph (%c0 = %arg0 : tensor<2xi64>) {\n // Implementation...\n xten_nn.output %out : tensor<120xi64>\n } -> tensor<120xi64>\n return %sum : tensor<120xi64>\n }\n ```", "operands": [ { "name": "captures", "type": "Variadic" } ], "results": [ { "name": "results", "type": "Variadic" } ], "regions": [ { "name": "content", "type": "MaxSizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "xten_nn.topk", "summary": "Calculate the topk", "description": "Follows the specification of ONNX TopK at opset 11", "operands": [ { "name": "input", "type": "AnyTensor" }, { "name": "k", "type": "I64" } ], "results": [ { "name": "output", "type": "AnyRankedTensor" }, { "name": "indices", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "axis", "type": "I64Attr" }, { "name": "largest", "type": "I1Attr" }, { "name": "sorted", "type": "I1Attr" } ], "assemblyFormat": "`(`$input `:` type($input) `,` $k `:` type($k)`)` attr-dict `->` type($output) `,` type($indices)" }, { "name": "xten_nn.unspecified", "summary": "Materializes an unspecified value", "description": "The `xten_nn.unspecified` op materializes a constant-like unspecified value.\n\n For integer result types, the value may be any integer value.\n For floating-point result types, the value may be any finite, non-NaN,\n non-infinite value.\n\n ```mlir\n %0 = xten_nn.unspecified : tensor\n ```", "results": [ { "name": "result", "type": "AnyType" } ], "assemblyFormat": "attr-dict `:` type($result)" }, { "name": "xtile.dot_scaled", "summary": "dot_scaled", "description": "$result = matrix_multiply(scale($lhs, $lhs_scale), scale($rhs, $rhs_scale)).\n Where scale(x, s) is a function that applies the scale per block following microscaling spec.", "operands": [ { "name": "lhs", "type": "RankedTensorOf<[AnyFloat, I8]>" }, { "name": "rhs", "type": "RankedTensorOf<[AnyFloat, I8]>" }, { "name": "lhs_scale", "type": "Optional>" }, { "name": "rhs_scale", "type": "Optional>" } ], "results": [ { "name": "result", "type": "RankedTensorOf<[AnyFloat]>" } ], "attributes": [ { "name": "fastMath", "type": "BoolAttr" }, { "name": "lhs_k_pack", "type": "DefaultValuedAttr" }, { "name": "rhs_k_pack", "type": "DefaultValuedAttr" }, { "name": "lhs_elem_type", "type": "TypeAttr" }, { "name": "rhs_elem_type", "type": "TypeAttr" }, { "name": "dot_dimension_numbers", "type": "OptionalAttr" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "$lhs (`scale` $lhs_scale^)? `,` $rhs (`scale` $rhs_scale^)? attr-dict\n `:` type($lhs) (`,` type($lhs_scale)^)? `*` type($rhs) (`,` type($rhs_scale)^)? `->` type($result)" }, { "name": "xtile.entry_func", "summary": "My custom entry function operation", "description": "This operation defines a custom entry function that is the starting\n point for execution. It has a single-block region, takes a\n variadic list of memrefs and exactly one tile id index arguments,\n it has no return values.", "attributes": [ { "name": "sym_name", "type": "SymbolNameAttr" }, { "name": "function_type", "type": "TypeAttrOf" }, { "name": "arg_attrs", "type": "OptionalAttr>" }, { "name": "tile_info", "type": "OptionalAttr" }, { "name": "res_attrs", "type": "OptionalAttr>" }, { "name": "num_opaque_args", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "IsolatedFromAbove" } ], "hasCustomAssemblyFormat": true }, { "name": "xtile.extract", "summary": "Extract a tile from a memref.", "operands": [ { "name": "source", "type": "AnyMemRef" }, { "name": "offsets", "type": "Variadic" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "full_tile_shape", "type": "DenseI64ArrayAttr" }, { "name": "strides", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$source `[` $offsets `]` $full_tile_shape $strides\n `:` type($source) `->` type($result) attr-dict" }, { "name": "xtile.insert", "summary": "Insert a tile into a memref.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "destination", "type": "AnyMemRef" }, { "name": "offsets", "type": "Variadic" } ], "attributes": [ { "name": "full_tile_shape", "type": "DenseI64ArrayAttr" }, { "name": "strides", "type": "DenseI64ArrayAttr" } ], "assemblyFormat": "$source `into` $destination `[` $offsets `]` $full_tile_shape $strides\n `:` type($source) `->` type($destination) attr-dict" }, { "name": "xtile.mask", "summary": "Mask the values of a tensor.", "description": "Masks out the values of the input tensor that are outside the range of the\n given mask upper bound. Masked values are set to the provided value.", "operands": [ { "name": "source", "type": "AnyRankedTensor" }, { "name": "value", "type": "AnyType" } ], "results": [ { "name": "result", "type": "AnyRankedTensor" } ], "attributes": [ { "name": "bounds", "type": "DenseI64ArrayAttr" } ], "traits": [ { "type": "AllTypesMatch<['source', 'result']>" }, { "type": "TypesMatchWith<'result', 'value', '[object Object]'>" } ], "assemblyFormat": "$source `bounds` $bounds `,` $value `:` type($result) attr-dict" }, { "name": "xtile.return", "summary": "Terminates the entry function", "description": "This operation terminates the entry function block. It has no operands\n and produces no results.", "assemblyFormat": "attr-dict" }, { "name": "xtile.scan", "summary": "scan operation", "description": "Mirrors HLO's kScan operation.", "operands": [ { "name": "inputs", "type": "Variadic" }, { "name": "inits", "type": "Variadic" } ], "results": [ { "name": "outputs", "type": "Variadic" }, { "name": "carries", "type": "Variadic" } ], "attributes": [ { "name": "dimension", "type": "I64Attr" }, { "name": "scan_dim_size", "type": "I64Attr" }, { "name": "is_reverse", "type": "DefaultValuedAttr" } ], "regions": [ { "name": "body", "type": "SizedRegion<1>" } ], "traits": [ { "type": "AttrSizedOperandSegments" } ], "assemblyFormat": "`(` $inputs `)` `inits` `(` $inits `)`\n `dimension` `=` $dimension\n attr-dict\n `:` `(` type($inputs) `)` `,` `(` type($inits) `)` `->` `(` type($outputs) `)` `,` `(` type($carries) `)`\n $body" }, { "name": "xtile.select_buffer", "summary": "Selects a specific buffer from an array of buffers.", "description": "Takes a source buffer (which is an array of pointers to disjoint buffers)\n and an index (replica_id), and returns a new buffer handle representing\n the selected disjoint buffer.\n\n This is useful when the input to a kernel is a collection of disjoint\n buffers and we want to select one of them based on the replica_id.", "operands": [ { "name": "source", "type": "AnyMemRef" }, { "name": "replica_id", "type": "Index" } ], "results": [ { "name": "result", "type": "AnyMemRef" } ], "assemblyFormat": "$source `[` $replica_id `]` `:` type($source) `->` type($result) attr-dict" }, { "name": "xtile.yield", "summary": "Yield values from an xtile region", "description": "This operation yields values from an xtile region, such as the body of\n an xtile.scan operation. It can yield values of any type, including\n scalars and tensors.", "operands": [ { "name": "results", "type": "Variadic" } ], "assemblyFormat": "attr-dict ($results^ `:` type($results))?" } ]