From 8007c55ac35722f9feff777a8d3bde72072424ab Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 13 Dec 2022 18:03:47 -0800 Subject: [PATCH] Introduce spec.md (#766) Earlier today, in conclusion of the Q3/Q4 speccing marathon, we have finished speccing HLO semantics for the StableHLO ops. This was a huge effort that involved writing 93 specs, including digging deep into involved semantics of ops like batch_norm_grad, convolution, dot_general and more. Congratulations to everyone who contributed to this important milestone! The idea of this project was to create a baseline from which the StableHLO opset will evolve in the future. Our immediate next steps will be writing a dynamism RFC (#8) and speccing quantization (#588) on top of this baseline. Also, this speccing marathon has uncovered a lot of future work - both in cleaning up the opset and improving the implementation to fully conform to the spec. This is something that we're aiming to address in the next year. --- .../{spec_draft => spec}/all_to_all.svg | 0 .../{spec_draft => spec}/convolution.svg | 0 docs/images/{spec_draft => spec}/gather.svg | 0 .../{spec_draft => spec}/reduce_scatter.svg | 0 .../{spec_draft => spec}/reduce_window.svg | 0 docs/images/{spec_draft => spec}/scatter.svg | 0 .../select_and_scatter.svg | 0 docs/reference.md | 2 +- docs/{spec_draft.md => spec.md} | 16 +- docs/status.md | 2 +- docs/type_inference.md | 2 +- rfcs/20220912-compatibility.md | 4 +- stablehlo/dialect/StablehloOps.td | 186 +++++++++--------- 13 files changed, 106 insertions(+), 106 deletions(-) rename docs/images/{spec_draft => spec}/all_to_all.svg (100%) rename docs/images/{spec_draft => spec}/convolution.svg (100%) rename docs/images/{spec_draft => spec}/gather.svg (100%) rename docs/images/{spec_draft => spec}/reduce_scatter.svg (100%) rename docs/images/{spec_draft => spec}/reduce_window.svg (100%) rename docs/images/{spec_draft => spec}/scatter.svg (100%) rename docs/images/{spec_draft => spec}/select_and_scatter.svg (100%) rename docs/{spec_draft.md => spec.md} (99%) diff --git a/docs/images/spec_draft/all_to_all.svg b/docs/images/spec/all_to_all.svg similarity index 100% rename from docs/images/spec_draft/all_to_all.svg rename to docs/images/spec/all_to_all.svg diff --git a/docs/images/spec_draft/convolution.svg b/docs/images/spec/convolution.svg similarity index 100% rename from docs/images/spec_draft/convolution.svg rename to docs/images/spec/convolution.svg diff --git a/docs/images/spec_draft/gather.svg b/docs/images/spec/gather.svg similarity index 100% rename from docs/images/spec_draft/gather.svg rename to docs/images/spec/gather.svg diff --git a/docs/images/spec_draft/reduce_scatter.svg b/docs/images/spec/reduce_scatter.svg similarity index 100% rename from docs/images/spec_draft/reduce_scatter.svg rename to docs/images/spec/reduce_scatter.svg diff --git a/docs/images/spec_draft/reduce_window.svg b/docs/images/spec/reduce_window.svg similarity index 100% rename from docs/images/spec_draft/reduce_window.svg rename to docs/images/spec/reduce_window.svg diff --git a/docs/images/spec_draft/scatter.svg b/docs/images/spec/scatter.svg similarity index 100% rename from docs/images/spec_draft/scatter.svg rename to docs/images/spec/scatter.svg diff --git a/docs/images/spec_draft/select_and_scatter.svg b/docs/images/spec/select_and_scatter.svg similarity index 100% rename from docs/images/spec_draft/select_and_scatter.svg rename to docs/images/spec/select_and_scatter.svg diff --git a/docs/reference.md b/docs/reference.md index c00677b911a..1a5f98d68c9 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -3,7 +3,7 @@ ## Data Model -[StableHLO programs](spec_draft.md#programs) are computations over tensors +[StableHLO programs](spec.md#programs) are computations over tensors (n-dimensional arrays), which, in the current model, are implemented using class `Tensor`. The underlying storage class for a `Tensor` object, `detail::Buffer`, stores the `mlir::ShapedType` of the tensor along with a diff --git a/docs/spec_draft.md b/docs/spec.md similarity index 99% rename from docs/spec_draft.md rename to docs/spec.md index 329487a3c61..fca0a021766 100644 --- a/docs/spec_draft.md +++ b/docs/spec.md @@ -1,4 +1,4 @@ -# StableHLO Specification Draft +# StableHLO Specification ## Types @@ -753,7 +753,7 @@ Afterwards, within each `process_group`: ### Semantics -![](images/spec_draft/all_to_all.svg) +![](images/spec/all_to_all.svg) Within each process group in the StableHLO grid, splits the values of the `operand` tensor along `split_dimension` into parts, scatters the split parts @@ -1895,7 +1895,7 @@ Computes dot products between windows of `lhs` and slices of `rhs` and produces `result`. The following diagram shows how elements in `result` are computed from `lhs` and `rhs` using a concrete example. -![](images/spec_draft/convolution.svg) +![](images/spec/convolution.svg) More formally, we start with reframing the inputs to the operation in terms of `lhs` in order to be able to express windows of `lhs`: @@ -2709,7 +2709,7 @@ The following diagram shows how elements in `result` map on elements in `operand` using a concrete example. The diagram picks a few example `result` indices and explains in detail which `operand` indices they correspond to. -![](images/spec_draft/gather.svg) +![](images/spec/gather.svg) More formally, `result[result_index] = operand[operand_index]` where: @@ -4000,7 +4000,7 @@ More formally: ### Semantics -![](images/spec_draft/reduce_scatter.svg) +![](images/spec/reduce_scatter.svg) Within each process group in the StableHLO grid, performs reduction, using `computations`, over the values of the `operand` tensor from each process, @@ -4104,7 +4104,7 @@ and produces `results`. The following diagram shows how elements in `results[k]` are computed from `inputs[k]` using a concrete example. -![](images/spec_draft/reduce_window.svg) +![](images/spec/reduce_window.svg) More formally, `results[:][result_index] = reduce(windows, init_values, axes(inputs[:]), body)` where: @@ -4574,7 +4574,7 @@ The following diagram shows how elements in `updates[k]` map on elements in `updates[k]` indices and explains in detail which `results[k]` indices they correspond to. -![](images/spec_draft/scatter.svg) +![](images/spec/scatter.svg) More formally, for all `update_index` from the index space of `updates[0]`: @@ -4766,7 +4766,7 @@ a `result` tensor. The following diagram shows how elements in `result` are computed from `operand` and `source` using a concrete example. -![](images/spec_draft/select_and_scatter.svg) +![](images/spec/select_and_scatter.svg) More formally: diff --git a/docs/status.md b/docs/status.md index 5a31c70f403..da52dd64fba 100644 --- a/docs/status.md +++ b/docs/status.md @@ -24,7 +24,7 @@ one of the following tracking labels. implements some verification. - Customized labels for Verifier and Type Inference - **yes**: there is an implementation, and it's in sync with - [StableHLO semantics](https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md). + [StableHLO semantics](https://github.com/openxla/stablehlo/blob/main/docs/spec.md). - **yes\***: there is an implementation, and it's in sync with [XLA semantics](https://www.tensorflow.org/xla/operation_semantics). Since XLA semantics is oftentimes underdocumented, we are using diff --git a/docs/type_inference.md b/docs/type_inference.md index 0892fc67a3f..571fb16439c 100644 --- a/docs/type_inference.md +++ b/docs/type_inference.md @@ -10,7 +10,7 @@ These proposals apply to both revisiting existing implementations, and achieving ## (P1) Use the StableHLO spec as the source of truth. -The [spec](https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md) is the source of truth for all verifiers and shape functions of the StableHLO ops. The existing verifiers and shape functions of every op need revisited to be fully aligned with the specification. Note that the specification document keeps evolving, in cases that the spec for an op is not available, the XLA implementation should be used as the source of truth instead: including [xla/service/shape\_inference.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/service/shape_inference.cc) and [xla/service/hlo\_verifier.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/service/hlo_verifier.cc). XLA implementation doesn't cover unbounded dynamism, so for unbounded dynamism we'll apply common sense until the dynamism RFC is available. +The [spec](https://github.com/openxla/stablehlo/blob/main/docs/spec.md) is the source of truth for all verifiers and shape functions of the StableHLO ops. The existing verifiers and shape functions of every op need revisited to be fully aligned with the specification. Note that the specification document keeps evolving, in cases that the spec for an op is not available, the XLA implementation should be used as the source of truth instead: including [xla/service/shape\_inference.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/service/shape_inference.cc) and [xla/service/hlo\_verifier.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/service/hlo_verifier.cc). XLA implementation doesn't cover unbounded dynamism, so for unbounded dynamism we'll apply common sense until the dynamism RFC is available. ## (P2) Make the most of ODS diff --git a/rfcs/20220912-compatibility.md b/rfcs/20220912-compatibility.md index 3278949b36d..fc0f22876e6 100644 --- a/rfcs/20220912-compatibility.md +++ b/rfcs/20220912-compatibility.md @@ -47,14 +47,14 @@ StableHLO (opset, libStablehlo and serialization format) will version in complia **(G4) Version 0.x.x:** There will be some stability guarantees while in major version 0. There is not stability guaranteed within the major version, but we will provide 1 month of forward and backward compatibility between minor versions. This approach is chosen to allow dialect evolution and cleanup in the early days, as well as refine compatibility procedures while meeting the requirements of early adopters. Stability within major version will begin with version `1.x.x` and will happen in 2023. -_*StableHLO semantics is defined by the StableHLO specification and can be tested using the StableHLO interpreter. Refer to the [StableHLO Specification](https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md) for reference semantics._ +_*StableHLO semantics is defined by the StableHLO specification and can be tested using the StableHLO interpreter. Refer to the [StableHLO Specification](https://github.com/openxla/stablehlo/blob/main/docs/spec.md) for reference semantics._ **Proposal 3:** Provide forward / backward compatibility within a major release, with major releases happening at least 5 years apart. Additionally provide backward compatibility for serialized artifacts across 1 major release. ## What's not covered? **Bugs:** We may make backward incompatible changes if the current implementation is clearly broken, that is, if it contradicts the Operation's spec. -**Unspecced features:** We may make backward incompatible changes to features which haven't been specced (see [StableHLO Specification](https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md)). +**Unspecced features:** We may make backward incompatible changes to features which haven't been specced (see [StableHLO Specification](https://github.com/openxla/stablehlo/blob/main/docs/spec.md)). **Numerical accuracy:** StableHLO has multiple ops that have implementation-defined accuracy across consumers and even within the same consumer across versions. As a result, StableHLO doesn't aim to make any guarantees about numerical accuracy, although this may change in a future RFC. diff --git a/stablehlo/dialect/StablehloOps.td b/stablehlo/dialect/StablehloOps.td index ec44b5a45d6..fc31e4da4db 100644 --- a/stablehlo/dialect/StablehloOps.td +++ b/stablehlo/dialect/StablehloOps.td @@ -74,7 +74,7 @@ def StableHLO_ConstantOp : StableHLO_Op<"constant", Produces an `output` tensor from a constant `value`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloconstant + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloconstant Example: ```mlir @@ -107,7 +107,7 @@ def StableHLO_IotaOp : StableHLO_Op<"iota", [Pure]> { along the `iota_dimension` dimension. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloiota + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloiota Example: ```mlir @@ -207,7 +207,7 @@ def StableHLO_AbsOp: StableHLO_UnaryElementwiseOp<"abs", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloabs + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloabs Example: ```mlir @@ -225,7 +225,7 @@ def StableHLO_CbrtOp: StableHLO_UnaryElementwiseOp<"cbrt", IEEE-754 specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocbrt + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocbrt Example: ```mlir @@ -241,7 +241,7 @@ def StableHLO_CeilOp: StableHLO_UnaryElementwiseOp<"ceil", Performs element-wise ceil of `operand` tensor and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloceil + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloceil Example: ```mlir @@ -258,7 +258,7 @@ def StableHLO_ConvertOp : StableHLO_UnaryElementwiseOp<"convert", `operand` tensor and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloconvert + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloconvert Example: ```mlir @@ -277,7 +277,7 @@ def StableHLO_ClzOp: StableHLO_UnaryElementwiseOp<"count_leading_zeros", `operand` tensor and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocount_leading_zeros + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocount_leading_zeros Example: ```mlir @@ -295,7 +295,7 @@ def StableHLO_CosineOp: StableHLO_UnaryElementwiseOp<"cosine", specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocosine + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocosine Example: ```mlir @@ -312,7 +312,7 @@ def StableHLO_ExpOp: StableHLO_UnaryElementwiseOp<"exponential", a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloexponential + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloexponential Example: ```mlir @@ -329,7 +329,7 @@ def StableHLO_Expm1Op: StableHLO_UnaryElementwiseOp<"exponential_minus_one", and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloexponential_minus_one + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloexponential_minus_one Example: ```mlir @@ -346,7 +346,7 @@ def StableHLO_FloorOp: StableHLO_UnaryElementwiseOp<"floor", tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlofloor + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlofloor Example: ```mlir @@ -364,7 +364,7 @@ def StableHLO_ImagOp: StableHLO_UnaryElementwiseOp<"imag", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloimag + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloimag Example: ```mlir @@ -381,7 +381,7 @@ def StableHLO_IsFiniteOp: StableHLO_UnaryElementwiseOp<"is_finite", [Pure, neither +Inf, -Inf, nor NaN) and produces a `y` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlois_finite + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlois_finite Example: ```mlir @@ -404,7 +404,7 @@ def StableHLO_LogOp: StableHLO_UnaryElementwiseOp<"log", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlolog + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlolog Example: ```mlir @@ -421,7 +421,7 @@ def StableHLO_Log1pOp: StableHLO_UnaryElementwiseOp<"log_plus_one", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlolog_plus_one + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlolog_plus_one Example: ```mlir @@ -438,7 +438,7 @@ def StableHLO_LogisticOp: StableHLO_UnaryElementwiseOp<"logistic", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlologistic + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlologistic Example: ```mlir @@ -455,7 +455,7 @@ def StableHLO_NotOp: StableHLO_UnaryElementwiseOp<"not", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlonot + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlonot Example: ```mlir @@ -472,7 +472,7 @@ def StableHLO_NegOp: StableHLO_UnaryElementwiseOp<"negate", tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlonegate + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlonegate Example: ```mlir @@ -489,7 +489,7 @@ def StableHLO_PopulationCountOp: StableHLO_UnaryElementwiseOp<"popcnt", tensor and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlopopcnt + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlopopcnt Example: ```mlir @@ -507,7 +507,7 @@ def StableHLO_RealOp: StableHLO_UnaryElementwiseOp<"real", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreal + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreal Example: ```mlir @@ -524,7 +524,7 @@ def StableHLO_RoundOp: StableHLO_UnaryElementwiseOp<"round_nearest_afz", away from zero, on the `operand` tensor and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloround_nearest_afz + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloround_nearest_afz Example: ```mlir @@ -542,7 +542,7 @@ def StableHLO_RoundNearestEvenOp: StableHLO_UnaryElementwiseOp<"round_nearest_ev tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloround_nearest_even + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloround_nearest_even Example: @@ -561,7 +561,7 @@ def StableHLO_RsqrtOp: StableHLO_UnaryElementwiseOp<"rsqrt", IEEE-754 specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlorsqrt + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlorsqrt Example: ```mlir @@ -579,7 +579,7 @@ def StableHLO_SignOp: StableHLO_UnaryElementwiseOp<"sign", tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlosign + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlosign Example: ```mlir @@ -597,7 +597,7 @@ def StableHLO_SineOp: StableHLO_UnaryElementwiseOp<"sine", specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlosine + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlosine Example: ```mlir @@ -615,7 +615,7 @@ def StableHLO_SqrtOp: StableHLO_UnaryElementwiseOp<"sqrt", specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlosqrt + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlosqrt Example: ```mlir @@ -634,7 +634,7 @@ def StableHLO_TanhOp: StableHLO_UnaryElementwiseOp<"tanh", specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlotanh + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlotanh Example: ```mlir @@ -685,7 +685,7 @@ def StableHLO_AddOp : StableHLO_BinaryElementwiseOp<"add", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloadd + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloadd Example: ```mlir @@ -703,7 +703,7 @@ def StableHLO_Atan2Op : StableHLO_BinaryElementwiseOp<"atan2", specification. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloatan2 + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloatan2 Example: ```mlir @@ -720,7 +720,7 @@ def StableHLO_ComplexOp: StableHLO_BinaryElementwiseOp<"complex", [Pure, imaginary values, `lhs` and `rhs`, and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocomplex + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocomplex Example: ```mlir @@ -744,7 +744,7 @@ def StableHLO_DivOp : StableHLO_BinaryElementwiseOp<"divide", and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlodivide + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlodivide Example: ```mlir @@ -761,7 +761,7 @@ def StableHLO_MaxOp : StableHLO_BinaryElementwiseOp<"maximum", a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlomaximum + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlomaximum Example: ```mlir @@ -778,7 +778,7 @@ def StableHLO_MinOp : StableHLO_BinaryElementwiseOp<"minimum", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlominimum + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlominimum Example: ```mlir @@ -795,7 +795,7 @@ def StableHLO_MulOp : StableHLO_BinaryElementwiseOp<"multiply", `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlomultiply + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlomultiply Example: ```mlir @@ -812,7 +812,7 @@ def StableHLO_PowOp : StableHLO_BinaryElementwiseOp<"power", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlopower + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlopower Example: ```mlir @@ -829,7 +829,7 @@ def StableHLO_RemOp : StableHLO_BinaryElementwiseOp<"remainder", and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloremainder + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloremainder Example: ```mlir @@ -846,7 +846,7 @@ def StableHLO_ShiftLeftOp : StableHLO_BinaryElementwiseOp<"shift_left", number of bits and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloshift_left + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloshift_left Example: ```mlir @@ -863,7 +863,7 @@ def StableHLO_ShiftRightArithmeticOp : StableHLO_BinaryElementwiseOp<"shift_righ by `rhs` number of bits and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloshift_right_arithmetic + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloshift_right_arithmetic Example: ```mlir @@ -880,7 +880,7 @@ def StableHLO_ShiftRightLogicalOp : StableHLO_BinaryElementwiseOp<"shift_right_l `rhs` number of bits and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloshift_right_logical + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloshift_right_logical Example: ```mlir @@ -897,7 +897,7 @@ def StableHLO_SubtractOp : StableHLO_BinaryElementwiseOp<"subtract", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlosubtract + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlosubtract Example: ```mlir @@ -927,7 +927,7 @@ def StableHLO_AndOp: StableHLO_BinaryBiwiseOrLogicalElementwiseOp<"and"> { and produces a `result` tensor See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloand + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloand Example: ```mlir @@ -943,7 +943,7 @@ def StableHLO_OrOp: StableHLO_BinaryBiwiseOrLogicalElementwiseOp<"or"> { and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloor + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloor Example: ```mlir @@ -959,7 +959,7 @@ def StableHLO_XorOp : StableHLO_BinaryBiwiseOrLogicalElementwiseOp<"xor"> { types and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloxor + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloxor Example: ```mlir @@ -982,7 +982,7 @@ def StableHLO_InfeedOp : StableHLO_Op<"infeed", []> { Reads data from the infeed and produces `results`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloinfeed + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloinfeed Example: ```mlir @@ -1012,7 +1012,7 @@ def StableHLO_OutfeedOp : StableHLO_Op<"outfeed", Writes `inputs` to the outfeed and produces a `result` token. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlooutfeed + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlooutfeed Example: ```mlir @@ -1039,7 +1039,7 @@ def StableHLO_SendOp : StableHLO_Op<"send", Sends `inputs` to a channel `channel_id` and produces a `result` token. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlosend + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlosend Example: ```mlir @@ -1070,7 +1070,7 @@ def StableHLO_RecvOp : StableHLO_Op<"recv", []> { Receives data from a channel with `channel_id` and produces `results`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlorecv + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlorecv Example: ```mlir @@ -1104,7 +1104,7 @@ def StableHLO_ReplicaIdOp : StableHLO_Op<"replica_id", [Pure, Produces `replica_id` of the current process. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreplica_id + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreplica_id Example: ```mlir @@ -1123,7 +1123,7 @@ def StableHLO_PartitionIdOp : StableHLO_Op<"partition_id", [Pure, Produces `partition_id` of the current process. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlopartition_id + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlopartition_id Example: ```mlir @@ -1149,7 +1149,7 @@ def StableHLO_AfterAllOp : StableHLO_Op<"after_all", [Pure, operations that depend on `result`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloafter_all + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloafter_all Example: @@ -1181,7 +1181,7 @@ def StableHLO_IfOp: StableHLO_Op<"if", [ `false_branch` depending on the value of `pred`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloif + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloif Example: %result = "stablehlo.if"(%pred) ({ @@ -1215,7 +1215,7 @@ def StableHLO_CaseOp: StableHLO_Op<"case", [ depending on the value of `index`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocase + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocase Example: ```mlir @@ -1249,7 +1249,7 @@ def StableHLO_WhileOp: StableHLO_Op<"while", [ `cond` function outputs `true`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlowhile + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlowhile Example: %results:2 = "stablehlo.while"(%input0, %input1) ({ @@ -1301,7 +1301,7 @@ def StableHLO_AllGatherOp : StableHLO_Op<"all_gather", [SameOperandsAndResultEle `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloall_gather + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloall_gather Example: ```mlir @@ -1335,7 +1335,7 @@ def StableHLO_AllReduceOp : StableHLO_Op<"all_reduce", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloall_reduce + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloall_reduce Example: ```mlir @@ -1380,7 +1380,7 @@ def StableHLO_ReduceScatterOp : StableHLO_Op<"reduce_scatter", scatters the split parts between the processes to produce the `result`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreduce_scatter + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreduce_scatter Example: ```mlir @@ -1420,7 +1420,7 @@ def StableHLO_AllToAllOp : StableHLO_Op<"all_to_all", and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloall_to_all + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloall_to_all Example: ```mlir @@ -1455,7 +1455,7 @@ def StableHLO_ReduceOp: StableHLO_ShapedInterfaceOp<"reduce", [ `dimensions` and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreduce + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreduce Example: ```mlir @@ -1496,7 +1496,7 @@ def StableHLO_GetTupleElementOp: StableHLO_Op<"get_tuple_element", [Pure, `result`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloget_tuple_element + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloget_tuple_element Example: ```mlir @@ -1524,7 +1524,7 @@ def StableHLO_TupleOp : StableHLO_Op<"tuple", [Pure, Produces a `result` tuple from values `val`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlotuple + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlotuple Example: ```mlir @@ -1550,7 +1550,7 @@ def StableHLO_CompareOp: StableHLO_Op<"compare", [Pure, SameOperandsElementType, `comparison_direction` and `compare_type`, and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocompare + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocompare Example: ```mlir @@ -1593,7 +1593,7 @@ def StableHLO_SliceOp: StableHLO_Op< indices and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloslice + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloslice Example: ```mlir @@ -1624,7 +1624,7 @@ def StableHLO_DynamicSliceOp: StableHLO_Op<"dynamic_slice", indices and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlodynamic_slice + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlodynamic_slice Example: ```mlir @@ -1658,7 +1658,7 @@ def StableHLO_DynamicUpdateSliceOp: StableHLO_Op<"dynamic_update_slice", `update`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloslice + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloslice Example: ```mlir @@ -1695,7 +1695,7 @@ def StableHLO_BatchNormGradOp : StableHLO_Op<"batch_norm_grad", [Pure, `grad_offset` tensors. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlobatch_norm_grad + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlobatch_norm_grad Example: ```mlir @@ -1734,7 +1734,7 @@ def StableHLO_BatchNormInferenceOp : StableHLO_Op<"batch_norm_inference", `feature_index` dimension and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlobatch_norm_inference + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlobatch_norm_inference Example: ```mlir @@ -1770,7 +1770,7 @@ def StableHLO_BatchNormTrainingOp : StableHLO_Op<"batch_norm_training", dimension and produces `output`, `batch_mean` and `batch_var` tensors. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlobatch_norm_training + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlobatch_norm_training Example: ```mlir @@ -1804,7 +1804,7 @@ def StableHLO_BitcastConvertOp : StableHLO_ShapedInterfaceOp<"bitcast_convert", the type of the `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlobitcast_convert + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlobitcast_convert Example: ```mlir @@ -1862,7 +1862,7 @@ def StableHLO_BroadcastInDimOp : StableHLO_Op<"broadcast_in_dim", data in the `operand` tensor and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlobroadcast_in_dim + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlobroadcast_in_dim Example: @@ -1939,7 +1939,7 @@ def StableHLO_CholeskyOp : StableHLO_Op<"cholesky", Computes the Cholesky decomposition of a batch of matrices. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocholesky + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocholesky Example: ```mlir @@ -1967,7 +1967,7 @@ def StableHLO_ClampOp : StableHLO_ShapedInterfaceOp<"clamp", [Pure, value and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloclamp + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloclamp Example: ```mlir @@ -2000,7 +2000,7 @@ def StableHLO_ConcatenateOp : StableHLO_ShapedInterfaceOp<"concatenate", tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloconcatenate + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloconcatenate Example: ```mlir @@ -2029,7 +2029,7 @@ def StableHLO_CollectivePermuteOp: StableHLO_Op<"collective_permute", a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocollective_permute + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocollective_permute Example: ```mlir @@ -2064,7 +2064,7 @@ def StableHLO_ConvolutionOp : StableHLO_Op<"convolution", [Pure, InferTensorType produces `result`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloconvolution + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloconvolution Example: ```mlir @@ -2141,7 +2141,7 @@ def StableHLO_CustomCallOp: StableHLO_Op<"custom_call", takes `inputs` and `called_computations` and produces `results`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlocustom_call + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlocustom_call Example: ```mlir @@ -2229,7 +2229,7 @@ def StableHLO_DotGeneralOp: StableHLO_ShapedInterfaceOp<"dot_general", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlodot_general + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlodot_general Example: ```mlir @@ -2308,7 +2308,7 @@ def StableHLO_FftOp: StableHLO_Op<"fft", [InferTensorType, Pure]> { inputs/outputs. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlofft + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlofft Example: ```mlir @@ -2336,7 +2336,7 @@ def StableHLO_GatherOp: StableHLO_Op<"gather", [InferTensorTypeWithReify, Pure]> `start_indices` and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlogather + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlogather Example: ```mlir @@ -2403,7 +2403,7 @@ def StableHLO_MapOp: StableHLO_ShapedInterfaceOp<"map", produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlomap + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlomap Example: ```mlir @@ -2431,7 +2431,7 @@ def StableHLO_ReshapeOp: StableHLO_Op<"reshape", Performs reshape of `operand` tensor to a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreshape + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreshape Example: ```mlir @@ -2483,7 +2483,7 @@ def StableHLO_ScatterOp: StableHLO_Op<"scatter", `updates` using `update_computation`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloscatter + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloscatter Example: @@ -2528,7 +2528,7 @@ def StableHLO_SelectOp: StableHLO_Op<"select", [Pure, HLO_BroadcastingElementwis `on_false` tensor based on the value of the corresponding element of `pred`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloselect + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloselect Example: ```mlir @@ -2558,7 +2558,7 @@ def StableHLO_SelectAndScatterOp: StableHLO_Op<"select_and_scatter", a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloselect_and_scatter + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloselect_and_scatter Example: ```mlir @@ -2635,7 +2635,7 @@ def StableHLO_SortOp : StableHLO_Op<"sort", number of tensors as `results`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreverse + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreverse Example: %result0, %result1 = "stablehlo.sort"(%input0, %input1) ({ @@ -2674,7 +2674,7 @@ def StableHLO_ReverseOp: StableHLO_Op<"reverse", `dimensions` and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreverse + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreverse Example: ```mlir @@ -2703,7 +2703,7 @@ def StableHLO_PadOp: StableHLO_ShapedInterfaceOp<"pad", elements of the tensor with the given `padding_value`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlopad + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlopad Example: ```mlir @@ -2757,7 +2757,7 @@ def StableHLO_TransposeOp: StableHLO_ShapedInterfaceOp<"transpose", a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlotranspose + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlotranspose Example: ```mlir @@ -2784,7 +2784,7 @@ def StableHLO_TriangularSolveOp: StableHLO_Op<"triangular_solve", coefficient matrices. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlotriangular_solve + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlotriangular_solve Example: ```mlir @@ -2819,7 +2819,7 @@ def StableHLO_ReduceWindowOp: StableHLO_Op<"reduce_window", [ and produces `results`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreduce_window + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreduce_window Example: ```mlir @@ -2936,7 +2936,7 @@ def StableHLO_OptimizationBarrierOp : StableHLO_Op<"optimization_barrier", an identity, i.e. `result` = `operand`. See - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlooptimization_barrier + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlooptimization_barrier Example: ```mlir @@ -2971,7 +2971,7 @@ def StableHLO_RngOp : StableHLO_Op<"rng", [InferTensorTypeWithReify, AllElementT a `result` tensor of a given shape `shape`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlorng + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlorng Example: ```mlir @@ -3003,7 +3003,7 @@ def StableHLO_RngBitGeneratorOp : StableHLO_Op<"rng_bit_generator", [Pure]> { pseudorandom number generator algorithm `rng_algorithm`. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehlorng_bit_generator + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehlorng_bit_generator Example: ```mlir @@ -3074,7 +3074,7 @@ def StableHLO_ReducePrecisionOp : floating-point type and produces a `result` tensor. See: - https://github.com/openxla/stablehlo/blob/main/docs/spec_draft.md#stablehloreduce_precision + https://github.com/openxla/stablehlo/blob/main/docs/spec.md#stablehloreduce_precision Example: ```mlir