From f48438c46dfe039649159f28bbeaf69f3d7db1e5 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Wed, 12 Mar 2025 13:49:05 -0700 Subject: [PATCH 1/3] Add rankRange to opSupportLimits() Add rankRange to opSupportLimits() by renaming MLSupportLimits to MLDataTypeLimits (still used for inputs, constants, and output operands), and deriving MLTensorLimits (used for tensor operands) which adds the new member as a MLRankRange dictionary. This also adds a note about an operand's allowed data types and ranks, indicating the implementations may extend or impose limits. Finally, maxTensorByteLength is exposed at the top level of the dictionary. --- index.bs | 372 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 203 insertions(+), 169 deletions(-) diff --git a/index.bs b/index.bs index 3ba65603..d4a08fec 100644 --- a/index.bs +++ b/index.bs @@ -1169,15 +1169,18 @@ The {{MLOpSupportLimits}} has the following top level members, aside from these,
: preferredInputLayout :: Preferred input layout for layout dependent operators like {{MLGraphBuilder/conv2d()}}. + : maxTensorByteLength + :: The maximum supported length of tensors, in bytes. : input :: Support limits for input {{MLOperand}}s for an {{MLGraph}}. : constant @@ -1185,48 +1188,73 @@ dictionary MLOpSupportLimits { : output :: Support limits for output {{MLOperand}}s for an {{MLGraph}}.
-#### {{MLSupportLimits}} dictionary #### {#api-mlcontext-supportlimits-dictionary} +#### {{MLDataTypeLimits}} dictionary #### {#api-mlcontext-datatypelimits-dictionary} -
+
: dataTypes :: Supported data types.
+#### {{MLRankRange}} dictionary #### {#api-mlcontext-rankrange-dictionary} + +
+ : min + :: Minimum supported rank. + : max + :: Maximum supported rank. +
+ +#### {{MLTensorLimits}} dictionary #### {#api-mlcontext-tensorlimits-dictionary} + +
+ : rankRange + :: Minimum and maximum supported ranks. +
+ #### {{MLBinarySupportLimits}} dictionary #### {#api-mlcontext-binarysupportlimits-dictionary}
: a - :: {{MLSupportLimits}} for a operand. + :: {{MLTensorLimits}} for a operand. : b - :: {{MLSupportLimits}} for b operand. + :: {{MLTensorLimits}} for b operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
#### {{MLSingleInputSupportLimits}} dictionary #### {#api-mlcontext-singleinputsupportlimits-dictionary}
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
### {{MLContext/destroy()}} ### {#api-mlcontext-destroy} @@ -1466,8 +1494,14 @@ Since the {{MLOperand/[[builder]]}} object is bound by the {{MLGraphBuilder/cons If an operation supports only a subset of {{MLOperandDataType}}s, the allowed data types for each of the operation's input operands, including both positional arguments and options, are given as either an explicit list of {{MLOperandDataType}}s, or a constraint that the operand's [=MLOperand/dataType=] must be the same as the [=MLOperand/dataType=] of another input operand, or any to allow any {{MLOperandDataType}}. +Implementations may support additional data types for operands. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLDataTypeLimits/dataTypes}} value of the corresponding member for the operation. + +Issue: Can conforming implementations support *fewer* data types for an operation than what is listed for their [=allowed data types=]? In other words, is the list of allowed types only a recommendation? + If an operation requires input operands with a particular [=MLOperand/rank=], the allowed ranks for each of the operation's input operands, including both positional arguments and options, are given as an explicit rank (e.g. 1), or N to allow any dimensionality, or the same as another operand. More specific constraints are common, such as when an input operand's shape must be [=/unidirectionally broadcastable=] to or [=/bidirectionally broadcastable=] with another input operand; in these cases, the [=/allowed ranks=] are listed as a range, with specific validation given as steps in the operation. +Implementations may (and usually do) impose an upper bound on the [=MLOperand/rank=] of operands. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLTensorLimits/rankRange}}.{{MLRankRange/max}} value of the corresponding member for the operation. + {{MLOperatorOptions}} has the following members:
: label @@ -1950,12 +1984,12 @@ partial interface MLGraphBuilder { }; dictionary MLBatchNormalizationSupportLimits { - MLSupportLimits input; - MLSupportLimits mean; - MLSupportLimits variance; - MLSupportLimits scale; - MLSupportLimits bias; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits mean; + MLTensorLimits variance; + MLTensorLimits scale; + MLTensorLimits bias; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -2036,17 +2070,17 @@ partial dictionary MLOpSupportLimits { {{MLBatchNormalizationSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : mean - :: {{MLSupportLimits}} for mean operand. + :: {{MLTensorLimits}} for mean operand. : variance - :: {{MLSupportLimits}} for variance operand. + :: {{MLTensorLimits}} for variance operand. : scale - :: {{MLSupportLimits}} for scale operand. + :: {{MLTensorLimits}} for scale operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLTensorLimits}} for output operand.
{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/batchNormalization()}}: @@ -2355,8 +2389,8 @@ partial interface MLGraphBuilder { }; dictionary MLConcatSupportLimits { - MLSupportLimits inputs; - MLSupportLimits output; + MLTensorLimits inputs; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -2400,9 +2434,9 @@ partial dictionary MLOpSupportLimits { {{MLConcatSupportLimits}} has the following members:
: inputs - :: {{MLSupportLimits}} for all input operands. + :: {{MLTensorLimits}} for all input operands. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/concat()}}: @@ -2471,10 +2505,10 @@ partial interface MLGraphBuilder { }; dictionary MLConv2dSupportLimits { - MLSupportLimits input; - MLSupportLimits filter; - MLSupportLimits bias; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits filter; + MLTensorLimits bias; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -2575,13 +2609,13 @@ partial dictionary MLOpSupportLimits { {{MLConv2dSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : filter - :: {{MLSupportLimits}} for filter operand. + :: {{MLTensorLimits}} for filter operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/conv2d()}}: @@ -3199,8 +3233,8 @@ partial interface MLGraphBuilder { }; dictionary MLLogicalNotSupportLimits { - MLSupportLimits a; - MLSupportLimits output; + MLTensorLimits a; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -3256,9 +3290,9 @@ partial dictionary MLOpSupportLimits { {{MLLogicalNotSupportLimits}} has the following members:
: a - :: {{MLSupportLimits}} for a operand. + :: {{MLTensorLimits}} for a operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following members for element-wise logical operations: @@ -3678,15 +3712,15 @@ partial interface MLGraphBuilder { optional MLOperatorOptions options = {}); }; -dictionary MLQuantizationSupportLimits { - MLSupportLimits input; - MLSupportLimits scale; - MLSupportLimits zeroPoint; - MLSupportLimits output; +dictionary MLQuantizeDequantizeLinearSupportLimits { + MLTensorLimits input; + MLTensorLimits scale; + MLTensorLimits zeroPoint; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { - MLQuantizationSupportLimits dequantizeLinear; + MLQuantizeDequantizeLinearSupportLimits dequantizeLinear; }; @@ -3731,16 +3765,16 @@ partial dictionary MLOpSupportLimits { -{{MLQuantizationSupportLimits}} has the following members: -
+{{MLQuantizeDequantizeLinearSupportLimits}} has the following members: +
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : scale - :: {{MLSupportLimits}} for scale operand. + :: {{MLTensorLimits}} for scale operand. : zeroPoint - :: {{MLSupportLimits}} for zeroPoint operand. + :: {{MLTensorLimits}} for zeroPoint operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/dequantizeLinear()}}: @@ -3849,7 +3883,7 @@ partial interface MLGraphBuilder { }; partial dictionary MLOpSupportLimits { - MLQuantizationSupportLimits quantizeLinear; + MLQuantizeDequantizeLinearSupportLimits quantizeLinear; }; @@ -4124,9 +4158,9 @@ partial interface MLGraphBuilder { }; dictionary MLGatherSupportLimits { - MLSupportLimits input; - MLSupportLimits indices; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits indices; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -4183,11 +4217,11 @@ partial dictionary MLOpSupportLimits { {{MLGatherSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : indices - :: {{MLSupportLimits}} for indices operand. + :: {{MLTensorLimits}} for indices operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/gather()}}: @@ -4757,10 +4791,10 @@ partial interface MLGraphBuilder { }; dictionary MLGemmSupportLimits { - MLSupportLimits a; - MLSupportLimits b; - MLSupportLimits c; - MLSupportLimits output; + MLTensorLimits a; + MLTensorLimits b; + MLTensorLimits c; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -4834,13 +4868,13 @@ partial dictionary MLOpSupportLimits { {{MLGemmSupportLimits}} has the following members:
: a - :: {{MLSupportLimits}} for a operand. + :: {{MLTensorLimits}} for a operand. : b - :: {{MLSupportLimits}} for b operand. + :: {{MLTensorLimits}} for b operand. : c - :: {{MLSupportLimits}} for c operand. + :: {{MLTensorLimits}} for c operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gemm()}}: @@ -4945,13 +4979,13 @@ partial interface MLGraphBuilder { }; dictionary MLGruSupportLimits { - MLSupportLimits input; - MLSupportLimits weight; - MLSupportLimits recurrentWeight; - MLSupportLimits bias; - MLSupportLimits recurrentBias; - MLSupportLimits initialHiddenState; - MLSupportLimits outputs; + MLTensorLimits input; + MLTensorLimits weight; + MLTensorLimits recurrentWeight; + MLTensorLimits bias; + MLTensorLimits recurrentBias; + MLTensorLimits initialHiddenState; + MLDataTypeLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -5061,19 +5095,19 @@ partial dictionary MLOpSupportLimits { {{MLGruSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : weight - :: {{MLSupportLimits}} for weight operand. + :: {{MLTensorLimits}} for weight operand. : recurrentWeight - :: {{MLSupportLimits}} for recurrentWeight operand. + :: {{MLTensorLimits}} for recurrentWeight operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : recurrentBias - :: {{MLSupportLimits}} for recurrentBias operand. + :: {{MLTensorLimits}} for recurrentBias operand. : initialHiddenState - :: {{MLSupportLimits}} for initialHiddenState operand. + :: {{MLTensorLimits}} for initialHiddenState operand. : outputs - :: {{MLSupportLimits}} for all the output operands. + :: {{MLDataTypeLimits}} for all the output operands.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gru()}}: @@ -5286,13 +5320,13 @@ partial interface MLGraphBuilder { }; dictionary MLGruCellSupportLimits { - MLSupportLimits input; - MLSupportLimits weight; - MLSupportLimits recurrentWeight; - MLSupportLimits hiddenState; - MLSupportLimits bias; - MLSupportLimits recurrentBias; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits weight; + MLTensorLimits recurrentWeight; + MLTensorLimits hiddenState; + MLTensorLimits bias; + MLTensorLimits recurrentBias; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -5379,19 +5413,19 @@ partial dictionary MLOpSupportLimits { {{MLGruCellSupportLimits}} has the following members;
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : weight - :: {{MLSupportLimits}} for weight operand. + :: {{MLTensorLimits}} for weight operand. : recurrentWeight - :: {{MLSupportLimits}} for recurrentWeight operand. + :: {{MLTensorLimits}} for recurrentWeight operand. : hiddenState - :: {{MLSupportLimits}} for hiddenState operand. + :: {{MLTensorLimits}} for hiddenState operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : recurrentBias - :: {{MLSupportLimits}} for recurrentBias operand. + :: {{MLTensorLimits}} for recurrentBias operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gruCell()}}: @@ -5748,10 +5782,10 @@ partial interface MLGraphBuilder { }; dictionary MLNormalizationSupportLimits { - MLSupportLimits input; - MLSupportLimits scale; - MLSupportLimits bias; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits scale; + MLTensorLimits bias; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -5821,13 +5855,13 @@ partial dictionary MLOpSupportLimits { {{MLNormalizationSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : scale - :: {{MLSupportLimits}} for scale operand. + :: {{MLTensorLimits}} for scale operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/instanceNormalization()}}: @@ -6264,15 +6298,15 @@ partial interface MLGraphBuilder { }; dictionary MLLstmSupportLimits { - MLSupportLimits input; - MLSupportLimits weight; - MLSupportLimits recurrentWeight; - MLSupportLimits bias; - MLSupportLimits recurrentBias; - MLSupportLimits peepholeWeight; - MLSupportLimits initialHiddenState; - MLSupportLimits initialCellState; - MLSupportLimits outputs; + MLTensorLimits input; + MLTensorLimits weight; + MLTensorLimits recurrentWeight; + MLTensorLimits bias; + MLTensorLimits recurrentBias; + MLTensorLimits peepholeWeight; + MLTensorLimits initialHiddenState; + MLTensorLimits initialCellState; + MLDataTypeLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -6401,23 +6435,23 @@ partial dictionary MLOpSupportLimits { {{MLLstmSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : weight - :: {{MLSupportLimits}} for weight operand. + :: {{MLTensorLimits}} for weight operand. : recurrentWeight - :: {{MLSupportLimits}} for recurrentWeight operand. + :: {{MLTensorLimits}} for recurrentWeight operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : recurrentBias - :: {{MLSupportLimits}} for recurrentBias operand. + :: {{MLTensorLimits}} for recurrentBias operand. : peepholeWeight - :: {{MLSupportLimits}} for peepholeWeight operand. + :: {{MLTensorLimits}} for peepholeWeight operand. : initialHiddenState - :: {{MLSupportLimits}} for initialHiddenState operand. + :: {{MLTensorLimits}} for initialHiddenState operand. : initialCellState - :: {{MLSupportLimits}} for initialCellState operand. + :: {{MLTensorLimits}} for initialCellState operand. : outputs - :: {{MLSupportLimits}} for all the output operands. + :: {{MLDataTypeLimits}} for all the output operands.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/lstm()}}: @@ -6673,15 +6707,15 @@ partial interface MLGraphBuilder { }; dictionary MLLstmCellSupportLimits { - MLSupportLimits input; - MLSupportLimits weight; - MLSupportLimits recurrentWeight; - MLSupportLimits hiddenState; - MLSupportLimits cellState; - MLSupportLimits bias; - MLSupportLimits recurrentBias; - MLSupportLimits peepholeWeight; - MLSupportLimits outputs; + MLTensorLimits input; + MLTensorLimits weight; + MLTensorLimits recurrentWeight; + MLTensorLimits hiddenState; + MLTensorLimits cellState; + MLTensorLimits bias; + MLTensorLimits recurrentBias; + MLTensorLimits peepholeWeight; + MLDataTypeLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -6789,23 +6823,23 @@ partial dictionary MLOpSupportLimits { {{MLLstmCellSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : weight - :: {{MLSupportLimits}} for weight operand. + :: {{MLTensorLimits}} for weight operand. : recurrentWeight - :: {{MLSupportLimits}} for recurrentWeight operand. + :: {{MLTensorLimits}} for recurrentWeight operand. : hiddenState - :: {{MLSupportLimits}} for hiddenState operand. + :: {{MLTensorLimits}} for hiddenState operand. : cellState - :: {{MLSupportLimits}} for cellState operand. + :: {{MLTensorLimits}} for cellState operand. : bias - :: {{MLSupportLimits}} for bias operand. + :: {{MLTensorLimits}} for bias operand. : recurrentBias - :: {{MLSupportLimits}} for recurrentBias operand. + :: {{MLTensorLimits}} for recurrentBias operand. : peepholeWeight - :: {{MLSupportLimits}} for peepholeWeight operand. + :: {{MLTensorLimits}} for peepholeWeight operand. : outputs - :: {{MLSupportLimits}} for all the output operands. + :: {{MLDataTypeLimits}} for all the output operands.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/lstmCell()}}: @@ -7479,9 +7513,9 @@ partial interface MLGraphBuilder { }; dictionary MLPreluSupportLimits { - MLSupportLimits input; - MLSupportLimits slope; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits slope; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -7527,11 +7561,11 @@ partial dictionary MLOpSupportLimits { {{MLPreluSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : slope - :: {{MLSupportLimits}} for slope operand. + :: {{MLTensorLimits}} for slope operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/prelu()}}: @@ -8259,10 +8293,10 @@ partial interface MLGraphBuilder { }; dictionary MLScatterSupportLimits { - MLSupportLimits input; - MLSupportLimits indices; - MLSupportLimits updates; - MLSupportLimits output; + MLTensorLimits input; + MLTensorLimits indices; + MLTensorLimits updates; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -8321,13 +8355,13 @@ partial dictionary MLOpSupportLimits { {{MLScatterSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : indices - :: {{MLSupportLimits}} for indices operand. + :: {{MLTensorLimits}} for indices operand. : updates - :: {{MLSupportLimits}} for updates operand. + :: {{MLTensorLimits}} for updates operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/scatterElements()}}: @@ -9146,8 +9180,8 @@ partial interface MLGraphBuilder { }; dictionary MLSplitSupportLimits { - MLSupportLimits input; - MLSupportLimits outputs; + MLTensorLimits input; + MLDataTypeLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -9195,9 +9229,9 @@ partial dictionary MLOpSupportLimits { {{MLSplitSupportLimits}} has the following members:
: input - :: {{MLSupportLimits}} for input operand. + :: {{MLTensorLimits}} for input operand. : outputs - :: {{MLSupportLimits}} for all the output operands. + :: {{MLDataTypeLimits}} for all the output operands.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/split()}}: @@ -9660,10 +9694,10 @@ partial interface MLGraphBuilder { }; dictionary MLWhereSupportLimits { - MLSupportLimits condition; - MLSupportLimits trueValue; - MLSupportLimits falseValue; - MLSupportLimits output; + MLTensorLimits condition; + MLTensorLimits trueValue; + MLTensorLimits falseValue; + MLDataTypeLimits output; }; partial dictionary MLOpSupportLimits { @@ -9715,13 +9749,13 @@ partial dictionary MLOpSupportLimits { {{MLWhereSupportLimits}} has the following members:
: condition - :: {{MLSupportLimits}} for condition operand. + :: {{MLTensorLimits}} for condition operand. : trueValue - :: {{MLSupportLimits}} for trueValue operand. + :: {{MLTensorLimits}} for trueValue operand. : falseValue - :: {{MLSupportLimits}} for falseValue operand. + :: {{MLTensorLimits}} for falseValue operand. : output - :: {{MLSupportLimits}} for output operand. + :: {{MLDataTypeLimits}} for output operand.
{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/where()}}: From 73281465235ee99ebee4063a978ebeb7a077fa44 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 17 Mar 2025 14:22:10 -0700 Subject: [PATCH 2/3] Review feedback --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 959d2e0a..344950fb 100644 --- a/index.bs +++ b/index.bs @@ -1499,13 +1499,13 @@ Since the {{MLOperand/[[builder]]}} object is bound by the {{MLGraphBuilder/cons If an operation supports only a subset of {{MLOperandDataType}}s, the allowed data types for each of the operation's input operands, including both positional arguments and options, are given as either an explicit list of {{MLOperandDataType}}s, or a constraint that the operand's [=MLOperand/dataType=] must be the same as the [=MLOperand/dataType=] of another input operand, or any to allow any {{MLOperandDataType}}. -Implementations may support additional data types for operands. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLDataTypeLimits/dataTypes}} value of the corresponding member for the operation. +Implementations may support fewer data types for operands than specified. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLDataTypeLimits/dataTypes}} value of the corresponding member for the operation. -Issue: Can conforming implementations support *fewer* data types for an operation than what is listed for their [=allowed data types=]? In other words, is the list of allowed types only a recommendation? +Issue: Should we specify the subset of data types that must be supported for each operator? If an operation requires input operands with a particular [=MLOperand/rank=], the allowed ranks for each of the operation's input operands, including both positional arguments and options, are given as an explicit rank (e.g. 1), or N to allow any dimensionality, or the same as another operand. More specific constraints are common, such as when an input operand's shape must be [=/unidirectionally broadcastable=] to or [=/bidirectionally broadcastable=] with another input operand; in these cases, the [=/allowed ranks=] are listed as a range, with specific validation given as steps in the operation. -Implementations may (and usually do) impose an upper bound on the [=MLOperand/rank=] of operands. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLTensorLimits/rankRange}}.{{MLRankRange/max}} value of the corresponding member for the operation. +Implementations may impose a more restricted lower bound and/or upper bound on the [=MLOperand/rank=] of operands than specified. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLTensorLimits/rankRange}}.{{MLRankRange/min}} and {{MLTensorLimits/rankRange}}.{{MLRankRange/max}} values of the corresponding member for the operation. {{MLOperatorOptions}} has the following members:
From e023048522b82fbc12f9782bc7d58c4369e099af Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Thu, 3 Apr 2025 16:37:02 -0700 Subject: [PATCH 3/3] Make MLTensorLimits not derive from MLDataTypeLimits --- index.bs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index aa90dd01..b4ff9461 100644 --- a/index.bs +++ b/index.bs @@ -1205,8 +1205,10 @@ dictionary MLOpSupportLimits {
#### {{MLDataTypeLimits}} dictionary #### {#api-mlcontext-datatypelimits-dictionary}
@@ -1230,11 +1232,14 @@ dictionary MLRankRange { #### {{MLTensorLimits}} dictionary #### {#api-mlcontext-tensorlimits-dictionary}
+ : dataTypes + :: Supported data types. : rankRange :: Minimum and maximum supported ranks.