About TF Adapter

TF Adapter is a TensorFlow plugin that accelerates the execution of TensorFlow graphs on the Ascend AI Processor. It is used to convert TensorFlow graphs into graphs that can be executed on the Ascend AI Processor.

Figure 1 shows the position of TF Adapter in the Ascend AI software stack.

Figure 1 Ascend AI software stack architecture

Figure 2 shows the TF Adapter architecture.

Figure 2 TF Adapter architecture

In the preceding figure, the left section illustrates the TensorFlow 1.15 architecture, while the right section depicts the TF Adapter architecture. Each layer of the TensorFlow framework is matched by a corresponding implementation within TF Adapter.

  • Python APIs
    TF Adapter provides Python APIs that adapt to the TensorFlow framework and supports the following functions:
    • Provides session policies, including configuration items such as function debugging, precision optimization, and performance tuning.
    • Provides advanced NPUEstimator APIs for model training on NPUs.
    • Provides APIs for resource initialization and distributed training.
  • Graph optimizer

    The graph optimizer processes subgraphs delivered by TensorFlow, identifies operators suitable for offloading, and transfers the corresponding subgraphs to the device for execution.

  • GEOP

    GEOP is a TensorFlow operator extended by TF Adapter. It is used to offload the identified subgraph to the device for execution.

  • GE Model

    GE Model is the executable GE graph adapted by TF Adapter.