Procedure

  1. Navigate to the project creation page, as shown in Figure 1.
    • If this is your first login to MindStudio, click New Project on the MindStudio welcome window to go to the project creation page.
    • If this is not your first login to MindStudio, choose File > New > Project... form the menu bar to go to the project creation page.
      Figure 1 Create Ascend Training Project

      During first-time sample project creation, ensure that the development environment is connected to the Internet. You can download the sample project template and decompress it to MindStudio_installation_directory/plugins/ascend-foundation/samples/advisor/ to ensure that new sample projects can be properly created. If you do not need to create sample projects, you can decompress the downloaded sample project template to any directory and choose File > Open... in MindStudio to open it.

  2. Create an ecosystem repository sample project.
    1. In the navigation pane on the left, select Ascend Advisor. Configure the CANN version on the right, as shown in Figure 1.
    2. Click Next to set the project parameters, as described in Table 1.
      Table 1 Project parameters

      Parameter

      Description

      Project name

      Project name (user-defined).

      The name contains a maximum of 64 characters, starting with a letter and ending with a letter or digit. Only letters, digits, hyphens (-), and underscores (_) are allowed.

      Project location

      Default path for saving a project (user-defined). (For users who use MindStudio for the first time, the default value is $HOME/MindstudioProjects)

      More Settings

      Module name: module name, same as the Project name.

      Content root: path in the root directory.

      Module file location: module file path.

      Click the check box on the right of Project format. A drop-down list is displayed.
      • .idea (directory-based) (default option): During project creation, an .idea project directory is created to save the project information.
      • .ipr (file-based): project configuration file used to save the project configuration information.
    3. Click Finish. See Figure 2.
      Figure 2 Ecosystem repository sample project
    4. If there is already an active project in the window, a confirmation message is displayed.
      • Click This Window to open the created project in the current window.
      • Click New Window to open the created project in a new window.
  3. View the directory structure and main files of the training project.

    Table 2 File description

    File

    Description

    ecosystem.json

    Ecosystem repository configuration file. You can use this configuration file to start and run the ecosystem repository. For details, see 3.a.

    requirements.txt

    File for recording the Python dependencies of a repository. Ecosystem repository developers fill in the dependencies involved in an ecosystem repository in this file. Other users can run the pip3 install –r requirements.txt command to install the dependencies when using the repository.

    model.py

    Source code file of the ecosystem repository. Ecosystem developers write service code in this file and fill in the result in the specified format. The source code file name must be the same as the ecosystem repository name. For the detailed development guide, visit the SDK download path.

    1. Modify the ecosystem.json file.
      For details about the parameters, see Table 3.
      {
          "model_list": [
              {
                  "model_name": "model",
                  "session_list": [
                      {
                          "python_model_path": "./model/src/"
                      }
                  ]
              }
          ]
      }
      Table 3 Parameters in ecosystem.json

      Parameter

      Description

      Mandatory or Not

      model_name

      Ecosystem repository name (that is, source code file name).

      Yes

      python_model_path

      Directory where the source code file is located. The relative path can be identified, so you can configure this path to the directory where the ecosystem.json file is located.

      Yes

    2. Before using the ecosystem repository in other environments, run the pip3 install –r requirements.txt command to install the dependency library.
    3. Develop the ecosystem repository code in the model.py file.
  4. Perform analysis using Advisor.

    MindStudio IDE does not support the Advisor-based performance analysis function of the ecosystem repository.