@@ -18,8 +18,8 @@ This document is an outline of the tooling and APIs facilitating MLGO.
1818Note that tools for orchestrating ML training are not part of LLVM, as they are
1919dependency-heavy - both on the ML infrastructure choice, as well as choices of
2020distrubuted computing. For the training scenario, LLVM only contains facilities
21- enabling it, such as corpus extraction, training data extraction, evaluation of
22- models during training.
21+ enabling it, such as corpus extraction, training data extraction, and evaluation
22+ of models during training.
2323
2424
2525.. contents ::
@@ -54,7 +54,7 @@ Inputs and outputs are named, have a scalar type (e.g. int32_t) and a shape
5454(e.g. 3x4). These are the elements that we use to bind to a ML model.
5555
5656In both training and inference, we want to expose to ML (training algorithms or
57- trained model, respectivelly ) the features we want to make optimization
57+ trained model, respectively ) the features we want to make optimization
5858decisions on. In that regard, the interface from the compiler side to the ML
5959side is the same: pass features, and get a decision. It's essentially a function
6060call, where the parameters and result are bound by name and are described by
@@ -83,12 +83,13 @@ Implementers
8383At construction, the implementer is expected to receive a list of ``TensorSpec ``
8484for input features and the ``TensorSpec `` of the output (e.g.
8585``std::vector<TensorSpec> ``). The list type is not contractual, but it must be
86- a 0-based indexing array-like container. In the order of appearance in the input
87- list, for a ``TensorSpec `` with a name "N", shape D1xD2x...Dn, and scalar type
88- "T", the implementer must set up a contiguous buffer sized
89- ``sizeof(T) * D1 * D2 * ... * Dn ``. This buffer's lifetime must be the same as
90- the lifetime of the implementer object; finally, for each given ``TensorSpec ``,
91- the implementer must call ``MLModelRunner::setUpBufferForTensor ``.
86+ a 0-based indexing array-like container. Given a ``TensorSpec `` at index "I" in
87+ the input list, that has a name "N", shape "D1 x D2x ... Dn", and scalar type
88+ "T", the implementer must:
89+ - set up a contiguous buffer sized ``sizeof(T) * D1 * D2 * ... * Dn ``. This
90+ buffer's lifetime must be the same as the lifetime of the implementer object;
91+ - call ``MLModelRunner::setUpBufferForTensor `` passing I, the ``TensorSpec ``,
92+ and the buffer above.
9293
9394Internally, the expectation is that the implementer uses the name (and maybe
9495shape) of a ``TensorSpec `` for binding (e.g. lookup in an underlying ML model).
@@ -154,7 +155,7 @@ We currently feature 3 implementations:
154155 the neural network, together with its weights (essentially, loops performing
155156 matrix multiplications)
156157
157- NOTE: we are activelly working on replacing this with an EmitC implementation
158+ NOTE: we are actively working on replacing this with an EmitC implementation
158159requiring no out of tree build-time dependencies.
159160
160161- ``InteractiveModelRunner ``. This is intended for training scenarios where the
0 commit comments