Learning Wizard

This section describes the intended audience, porting process of a TensorFlow 2.6.5-based model, and precautions for using this document.

Intended Audience

This document is intended for AI algorithm engineers. It describes how to port a training script developed by TensorFlow 2.6.5 Python APIs to the NPU to execute training, and debug and optimize the accuracy and performance.

To better understand this document, you are supposed to:
  • Be familiar with the basic CANN architecture and features.
  • Be familiar with TensorFlow APIs.
  • Possess knowledge of machine learning and deep learning, especially network training basics.
  • Be proficient in Python programming.

Supported Products

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Precautions

  • Before model porting, prepare a model developed in TensorFlow 2.6.5 and the dataset, and ensure that the model runs normally on the GPU or CPU and meet the accuracy and performance requirements. In addition, record the accuracy and performance results for later comparison with those on the AI processor.
  • The code snippets in this document are only examples. Manual tweaking is needed.

Model Development Process

The model development aims to port the original TensorFlow-based model to the AI processor and start training. The process is as follows.

Figure 1 Model development process

Porting Modes

You have the following two options for porting your training script developed based on the TensorFlow Python API to the AI processor:

  • Automated porting

    Algorithm engineers can use the porting tool to analyze the support for the TensorFlow Python API on the Ascend AI Processor, and automatically port native TensorFlow training scripts to those supported by the Ascend AI Processor. For APIs unportable by the tool, modify your training scripts according to the tool report.

  • Manual porting

    Algorithm engineers can modify TensorFlow training scripts to adapt them to the Ascend AI Processor. This method is more complex. The more friendly automated porting mode is recommended.