Skip to content

Commit 674074b

Browse files
committed
feedback
1 parent 5df328d commit 674074b

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

llvm/docs/MLGO.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ This document is an outline of the tooling and APIs facilitating MLGO.
1818
Note that tools for orchestrating ML training are not part of LLVM, as they are
1919
dependency-heavy - both on the ML infrastructure choice, as well as choices of
2020
distrubuted 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

5656
In 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
5858
decisions on. In that regard, the interface from the compiler side to the ML
5959
side is the same: pass features, and get a decision. It's essentially a function
6060
call, where the parameters and result are bound by name and are described by
@@ -83,12 +83,13 @@ Implementers
8383
At construction, the implementer is expected to receive a list of ``TensorSpec``
8484
for 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

9394
Internally, the expectation is that the implementer uses the name (and maybe
9495
shape) 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
158159
requiring no out of tree build-time dependencies.
159160

160161
- ``InteractiveModelRunner``. This is intended for training scenarios where the

0 commit comments

Comments
 (0)