[all-commits] [llvm/llvm-project] e4794f: [mlgo][nfc] Decouple TensorSpec from tensorflow.
Mircea Trofin via All-commits
all-commits at lists.llvm.org
Thu Apr 21 15:37:19 PDT 2022
Author: Mircea Trofin <mtrofin at google.com>
Date: 2022-04-21 (Thu, 21 Apr 2022)
[mlgo][nfc] Decouple TensorSpec from tensorflow.
The motivation is twofold:
1) Allow plugging in a different training-time evaluator, e.g.
2) Allow using TensorSpec for AOT, too, to support evolution: we start
by extracting a superset of the features currently supported by a
model. For the tensors the model does not support, we just return a
valid, but useless, buffer. This makes using a 'smaller' model (less
supported tensors) transparent to the compiler. The key is to
dimension the buffer appropriately, and we already have TensorSpec
modeling that info.
The only coupling was due to the reliance of a TF internal API for
getting the element size, but for the types we are interested in,
`sizeof` is sufficient.
A subsequent change will yank out TensorSpec in its own module.
Differential Revision: https://reviews.llvm.org/D124045
More information about the All-commits