Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About updating to tensorflow-icg based on TF version >= 2.0 #6

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from

Conversation

nbwuzhe
Copy link

@nbwuzhe nbwuzhe commented Mar 25, 2020

No description provided.

Yuefeng Zhou and others added 30 commits August 21, 2019 19:16
… will use new converters.

PiperOrigin-RevId: 264736807
This CL makes use of the standard LLVM LLJIT and removes the need for a custom JIT implementation within MLIR.

To achieve this, one needs to clone (i.e. serde) the produced llvm::Module into a new LLVMContext. This is currently necessary because the llvm::LLVMContext is owned by the LLVMDialect, somewhat deep in the call hierarchy.

In the future we should remove the reliance of serding the llvm::Module by allowing the injection of an LLVMContext from the top-level. Unfortunately this will require deeper API changes and impact multiple places. It is therefore left for future work.

PiperOrigin-RevId: 264737459
This CL adds the necessary plumbing to have a SavedModel importer:
creating a subclass from ImporterBase, adding entry point functions,
and registering it to MLIR translate framework.

Right now the importer just converts all functions in the SavedModel.
Adding support for SignatureDef and other SavedModel components
is to be implemented in subsequent CLs.

Added a minimal test to make sure the plumbing works.

PiperOrigin-RevId: 264738045
…ialect.cpp - NFC

PiperOrigin-RevId: 264740014
Fixes #97

PiperOrigin-RevId: 264743395
PiperOrigin-RevId: 264744295
…at are present in MatMul Op. In preparation for tf.einsum switch, these are all needed for existing tests to pass.

PiperOrigin-RevId: 264744322
…r TF to TFLite translation.

PiperOrigin-RevId: 264746751
Operation interfaces generally require a bit of boilerplate code to connect all of the pieces together. This cl introduces mechanisms in the ODS to allow for generating operation interfaces via the 'OpInterface' class.

Providing a definition of the `OpInterface` class will auto-generate the c++
classes for the interface. An `OpInterface` includes a name, for the c++ class,
along with a list of interface methods. There are two types of methods that can be used with an interface, `InterfaceMethod` and `StaticInterfaceMethod`. They are both comprised of the same core components, with the distinction that `StaticInterfaceMethod` models a static method on the derived operation.

An `InterfaceMethod` is comprised of the following components:
    * ReturnType
      - A string corresponding to the c++ return type of the method.
    * MethodName
      - A string corresponding to the desired name of the method.
    * Arguments
      - A dag of strings that correspond to a c++ type and variable name
        respectively.
    * MethodBody (Optional)
      - An optional explicit implementation of the interface method.

def MyInterface : OpInterface<"MyInterface"> {
  let methods = [
    // A simple non-static method with no inputs.
    InterfaceMethod<"unsigned", "foo">,

    // A new non-static method accepting an input argument.
    InterfaceMethod<"Value *", "bar", (ins "unsigned":$i)>,

    // Query a static property of the derived operation.
    StaticInterfaceMethod<"unsigned", "fooStatic">,

    // Provide the definition of a static interface method.
    // Note: `ConcreteOp` corresponds to the derived operation typename.
    StaticInterfaceMethod<"Operation *", "create",
      (ins "OpBuilder &":$builder, "Location":$loc), [{
        return builder.create<ConcreteOp>(loc);
    }]>,

    // Provide a definition of the non-static method.
    // Note: `op` corresponds to the derived operation variable.
    InterfaceMethod<"unsigned", "getNumInputsAndOutputs", (ins), [{
      return op.getNumInputs() + op.getNumOutputs();
    }]>,
  ];

PiperOrigin-RevId: 264754898
PiperOrigin-RevId: 264758470
… max for

quantized int32.

PiperOrigin-RevId: 264765625
The arguments to ComputePaddingHeightWidth were mixed up: dilation rate
is 2d (height, width), padding is only passed in once.

PiperOrigin-RevId: 264787666
PiperOrigin-RevId: 264789677
MLIR builders are meant to be trivially copyable values.

PiperOrigin-RevId: 264807495
This delegates handling of custom calls to the extracted ThunkEmitter and
adds basic data structures to the HLODialectEmitter to track thunks.

PiperOrigin-RevId: 264808440
PiperOrigin-RevId: 264826413
…e it.

This avoids a potentially quadratic execution time in building the gradient graph, because we were previously creating the set multiple times for each op in the graph.

PiperOrigin-RevId: 264826531
…ased once a Toeplitz solver is checked in.

PiperOrigin-RevId: 264829158
jianlijianli and others added 30 commits August 25, 2019 22:48
Revert producer-consumer multi-output fusion constraints.

Relaxation introduced cycles to the HLO graph.

PiperOrigin-RevId: 265398581
PiperOrigin-RevId: 265398643
… tflite fused ops.

PiperOrigin-RevId: 265400666
PiperOrigin-RevId: 265411696
This is a part of a larger migration effort for tensorflow::tstring.
See: tensorflow/community#91
PiperOrigin-RevId: 265449545
Added Cord copy-ctor/assignment for tstring.

This is a part of a larger migration effort for tensorflow::tstring.
See: tensorflow/community#91
PiperOrigin-RevId: 265451696
PiperOrigin-RevId: 265455751
…ing.

This is a part of a larger migration effort for tensorflow::tstring.
See: tensorflow/community#91
PiperOrigin-RevId: 265474945
This is a part of a larger migration effort for tensorflow::tstring.
See: tensorflow/community#91
PiperOrigin-RevId: 265475150
This fixes a bug when folding ops with inner ops and inner ops are still being visited.

PiperOrigin-RevId: 265475780
PiperOrigin-RevId: 265479073
PiperOrigin-RevId: 265483372
The `Graph.create_op()` method has a deprecated argument wrapper and performs redundant type checking. Both add unnecessary overhead for calls from framework-internal sources, so this change switches `tf.constant()` and `OpDefLibrary._apply_op_helper()` to use the internal version.

As a consequence, classes that override `Graph.create_op()` must now override `Graph._create_op_internal()`, and this change updates all known classes to do so.

PiperOrigin-RevId: 265484157
Each `tf.Tensor` caches a SWIG-wrapped `TF_Output` object to map that tensor to the C API's graph. We currently lazily cache this object in `tf.Tensor` on its first consumption, but it turns out that we already build the object for all tensors as a by-product of calculating tensor types. This change saves the original object in each `tf.Tensor` when it is constructed, which decreases the overhead of graph construction.

PiperOrigin-RevId: 265484399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.