Updated on 2024-08-14 GMT+08:00

Submitting a Training Job (New Version)

You can use PyCharm Toolkit of the latest version to quickly submit the locally developed training code to ModelArts for training.

Prerequisites

  • A training code project exists in the local PyCharm.
  • You have created a bucket and folders in OBS for storing datasets and trained models. Data used by the training job has been uploaded to OBS.
  • The credential has been configured. For details, see Using Access Keys for Login.
  • PyCharm Toolkit of the latest version is available for submitting a training job of the new version only.

Configuring Training Job Parameters

  1. In PyCharm, open the training code project and training boot file, and choose ModelArts > Training Job > New... on the menu bar.
    Figure 1 Edit training job configuration
  2. In the displayed dialog box, configure the training job parameters. For details, see Table 1.
    Table 1 Training job parameters

    Parameter

    Description

    Job Name

    Name of a training job

    The system automatically generates a name. You can rename it based on the following naming rules:

    • The name contains 1 to 64 characters.
    • Letters, digits, hyphens (-), and underscores (_) are allowed.

    Job Description

    Brief description of a training job

    Algorithm Source

    Source of the training algorithm. The options are Frequently-used and Custom.

    Frequently-used refers to the frequently-used AI engines supported by ModelArts Training Management.

    If the AI engine you use is not in the supported list, you are advised to create a training job using a custom image.

    AI Engine

    Select the AI engine and the version used in code. The supported AI engines are the same as the frequently-used frameworks supported by training jobs on the ModelArts management console.

    Boot File Path

    Training boot file. The selected boot file must be a file in the current PyCharm training project. This parameter is displayed if Algorithm Source is set to Frequently-used.

    Code Directory

    Training code directory. The system automatically sets this parameter to the directory where the training boot file is located. You can change the parameter value to a directory that is in the current project and contains the boot file.

    If the algorithm source is a custom image and the training code has been built in the image, this parameter can be left blank.

    Image Path(optional)

    URL of the SWR image

    Boot Command

    Command for starting a training job, for example, bash /home/work/run_train.sh python {Python boot file and parameters}. This parameter is displayed if Algorithm Source is set to Custom.

    If the command does not contain the --data_url or --train_url parameter, the tool automatically adds the two parameters to the end of the command when submitting the training job. The two parameters correspond to the OBS path for storing training data and the OBS path for storing training output, respectively.

    Data OBS Path

    OBS path for storing training data, for example, /test-modelarts2/mnist/dataset-mnist/, in which test-modelarts2 indicates a bucket name.

    Training OBS Path

    OBS path. A directory is automatically created in the path for storing a trained model and training logs.

    Running Parameters

    Running parameters. If you want to add some running parameters to your code, add them here. Separate multiple running parameters with semicolons (;), for example, key1=value1;key2=value2. This parameter can be left blank.

    Specifications

    Type of resources used for training. Currently, public resource pools and dedicated resource pools are supported.

    Dedicated resource pool specifications are identified by Dedicated Resource Pool. Dedicated resource pool specifications are displayed only for users who have purchased dedicated resource pools.

    Compute Nodes

    Number of compute nodes. If this parameter is set to 1, the system runs in standalone mode. If this parameter is set to a value greater than 1, the distributed computing mode is used at the background.

    Available/Total Nodes

    When Specifications is set to a dedicated resource pool, the number of available nodes and the total number of nodes are displayed. The value of Compute Nodes cannot exceed the number of available nodes.

    Figure 2 Configuring training job parameter (public resource pool)
    Figure 3 Configuring training job parameter (dedicated resource pool)
    Figure 4 Configuring training job parameter (custom image)
  3. After setting the parameters, click Apply and Run. Then, local code is automatically uploaded to the cloud and training is started. The training job running status is displayed in the Training Log area in real time. If information similar to Current training job status: Successful is displayed in the training log, the training job has been successfully executed.
    • After you click Apply and Run, the system automatically executes the training job. To stop the training job, choose ModelArts > Training Job > Stop on the menu bar.
    • If you click Apply, the job is not started directly, and the training job settings are saved instead. To start the job, click Apply and Run.
    Figure 5 Training log example