Skip to content

Commit 28bb219

Browse files
committed
[mlgo][nfc] Remove / fix vestigial references to Tensorflow
Some references in comments are unnecessarily specific, for historical reasons.
1 parent b15b846 commit 28bb219

File tree

9 files changed

+25
-19
lines changed

9 files changed

+25
-19
lines changed

llvm/include/llvm/Analysis/InlineAdvisor.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ struct ReplayInlinerSettings;
3636
///
3737
/// - Development mode, for training new models.
3838
/// In this mode, we trade off runtime performance for flexibility. This mode
39-
/// requires the full C Tensorflow API library, and evaluates models
40-
/// dynamically. This mode also permits generating training logs, for offline
41-
/// training.
39+
/// requires the TFLite library, and evaluates models dynamically. This mode
40+
/// also permits generating training logs, for offline training.
4241
///
4342
/// - Dynamically load an advisor via a plugin (PluginInlineAdvisorAnalysis)
4443
enum class InliningAdvisorMode : int { Default, Release, Development };

llvm/include/llvm/Analysis/InlineModelFeatureMaps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ constexpr bool isHeuristicInlineCostFeature(InlineCostFeatureIndex Feature) {
9292

9393
// List of features. Each feature is defined through a triple:
9494
// - the name of an enum member, which will be the feature index
95-
// - a textual name, used for Tensorflow model binding (so it needs to match the
96-
// names used by the Tensorflow model)
95+
// - a textual name, used for ML model binding (so it needs to match the
96+
// names used by the ML model).
9797
// - a documentation description. Currently, that is not used anywhere
9898
// programmatically, and serves as workaround to inability of inserting comments
9999
// in macros.

llvm/include/llvm/Analysis/MLModelRunner.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ namespace llvm {
1717
class LLVMContext;
1818

1919
/// MLModelRunner interface: abstraction of a mechanism for evaluating a
20-
/// tensorflow "saved model".
20+
/// ML model. More abstractly, evaluating a function that has as tensors as
21+
/// arguments, described via TensorSpecs, and returns a tensor. Currently, the
22+
/// latter is assumed to be a scalar, in absence of more elaborate scenarios.
2123
/// NOTE: feature indices are expected to be consistent all accross
2224
/// MLModelRunners (pertaining to the same model), and also Loggers (see
2325
/// TFUtils.h)

llvm/include/llvm/Analysis/ModelUnderTrainingRunner.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323

2424
namespace llvm {
2525

26-
/// ModelUnderTrainingRunner - training mode implementation. It uses TF C APIs
26+
/// ModelUnderTrainingRunner - training mode implementation. It uses TFLite
2727
/// to dynamically load and evaluate a TF SavedModel
28-
/// (https://www.tensorflow.org/guide/saved_model). Runtime performance is
28+
/// (https://www.tensorflow.org/guide/saved_model) converted to TFLite. see
29+
/// lib/Analysis/models/saved-model-to-tflite.py. Runtime performance is
2930
/// sacrificed for ease of use while training.
3031
class ModelUnderTrainingRunner final : public MLModelRunner {
3132
public:

llvm/include/llvm/Analysis/TensorSpec.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@ namespace llvm {
2626
/// Machine Learning on Heterogeneous Distributed Systems", section 4.2, para 2:
2727
/// https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45166.pdf)
2828
///
29-
/// Known tensor types. The left part is the C type, the right is a name we
30-
/// can use to identify the type (to implement TensorSpec equality checks), and
31-
/// to use, if needed, when mapping to an underlying evaluator's type system.
32-
/// The main requirement is that the C type we use has the same size and
33-
/// encoding (e.g. endian-ness) as the one used by the evaluator.
29+
/// Note that the design is motivated by Tensorflow, but it is not intended to
30+
/// be Tensorflow-specific.
31+
///
32+
/// Known tensor types. The left part is the C type, the
33+
/// right is a name we can use to identify the type (to implement TensorSpec
34+
/// equality checks), and to use, if needed, when mapping to an underlying
35+
/// evaluator's type system. The main requirement is that the C type we use has
36+
/// the same size and encoding (e.g. endian-ness) as the one used by the
37+
/// evaluator.
3438
#define SUPPORTED_TENSOR_TYPES(M) \
3539
M(float, Float) \
3640
M(double, Double) \

llvm/include/llvm/Analysis/Utils/TFUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- TFUtils.h - utilities for tensorflow C API ---------------*- C++ -*-===//
1+
//===- TFUtils.h - utilities for TFLite -------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -93,7 +93,7 @@ class TFModelEvaluator final {
9393
return static_cast<T *>(getUntypedInput(Index));
9494
}
9595

96-
/// Returns true if the tensorflow model was loaded successfully, false
96+
/// Returns true if the model was loaded successfully, false
9797
/// otherwise.
9898
bool isValid() const { return !!Impl; }
9999

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
/* Define if zstd compression is available */
9999
#cmakedefine01 LLVM_ENABLE_ZSTD
100100

101-
/* Define if LLVM is using tflite instead of libtensorflow */
101+
/* Define if LLVM is using tflite */
102102
#cmakedefine LLVM_HAVE_TFLITE
103103

104104
/* Define to 1 if you have the <sysexits.h> header file. */

llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file implements a model runner using Tensorflow C APIs, allowing the
9+
// This file implements a model runner using TFLite, allowing the
1010
// loading of a model from a command line option.
1111
//
1212
//===----------------------------------------------------------------------===//

llvm/lib/Analysis/TFLiteUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===- TFUtils.cpp - tensorflow evaluation utilities ----------------------===//
1+
//===- TFUtils.cpp - TFLite-based evaluation utilities --------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file implements utilities for interfacing with tensorflow C APIs.
9+
// This file implements utilities for interfacing with TFLite.
1010
//
1111
//===----------------------------------------------------------------------===//
1212
#include "llvm/Config/config.h"

0 commit comments

Comments
 (0)