Configuring and Provisioning a Cross-Resource-Pool Training Job
Scenarios
All operations in this section are performed on the local cloud. Cross-resource-pool training requires cross-resource-pool training jobs to be delivered based on the resource pool federation. The end-to-end operation process is similar to that of single-resource-pool training jobs. You can select one or more resource pools in the resource pool federation to configure training tasks. Only one training task can be configured for a resource pool.
Prerequisites
- Before creating a cross-resource-pool training job, ensure that the resource pool federation is in the running state and at least one physical resource pool has been managed.
- The environment preparation for the CCE cluster corresponding to the resource pool managed by the resource pool federation has been completed.
Procedure
- Log in to the ModelArts management console using a tenant account. In the navigation pane, choose Model Training > Training Jobs.
- In the upper right corner, click Create Training Job and select Cross-resource-pool training. Figure 1 Cross-resource-pool training
- On the page for creating a cross-resource-pool training job, enter basic information and select a resource pool federation. You can enter the basic information based on the following table. Figure 2 Entering information
Figure 3 Selecting instance specifications
Table 1 Basic information Parameter
Description
Name
Enter a job name.
Description (Optional)
Enter the job description.
Resource Pool Federation
Select a created resource pool federation.
Specifications
The specifications contain information such as the server type and model. The ModelArts plugin must be installed on the node where a job is to be created. Therefore, the actually allocated resources are less than the applied resources. Specific resource values are dynamically adjusted based on actual node statuses.
Compute Nodes
Mandatory. Select the number of compute nodes as needed. The default value is 1.
Custom image
If the software in the preset base images cannot meet your needs, you can use a custom image for training. This image must be uploaded to SWR in advance.NOTE:- Local cloud: Select a value from the drop-down list.
- Collaboration cloud: Enter a value.
Code Directory
Optional. If the user ID is not specified, the default value 1000 will be used.NOTE:- Local cloud: Select a value from the drop-down list.
- Collaboration cloud: Enter a value.
The code will be downloaded to the /home/ma-user/modelarts/user-job-dir directory.
Boot Command
Mandatory. Enter the boot command of the image. For details, see "PyTorch Training Plugin Support" below.
User ID
Optional. Enter the user ID for running the container. The default value 1000 is recommended.
If the user ID is set to 0, the user in the training container is root.
Log Storage Location
You are advised to select an empty OBS file directory to store the log files. In addition, you must have the read and write permissions on the OBS file directory.NOTE:- Local cloud: Select a value from the drop-down list.
- Collaboration cloud: Enter a value.
PyTorch Training Plugin Support
Based on the service characteristics of PyTorch training and the resource scheduling model of federation jobs, the training platform summarizes information about all federation job instances and injects corresponding environment variables for PyTorch DDP training so that the training process can directly use these parameters.
Example: Assume that the boot command is bash start_train.sh, the torchrun process is started in start_train.sh, and the training script is train.py. The torchrun boot command is as follows:
torchrun --nproc_per_node $NPROC_PER_NODE \ --nnodes $NNODES \ --node_rank $NODE_RANK \ --master_addr $MASTER_ADDR \ --master_port $MASTER_PORT train.py ...
Table 2 ENV injected by the PyTorch plugin Key
Description
MASTER_ADDR
Communication address of the PyTorch master node
NNODES
Number of nodes (pods) that participate in training
NPROC_PER_NODE
Number of processes to be started on each training node (corresponding to the number of GPUs on the node)
MASTER_PORT
Listening port of the PyTorch master node. The default value is 29500.
NODE_RANK
Global sequence of the current node (pod).
- Configure environment variables.
- The parameters required by PSM route optimization need to be configured using the environment variable. Figure 4 Environment variable
- Environment variable name: MA_PSM_STRATEGY
- Environment variable value: PSM parameters
- Specify the MoXing version. In a cross-cloud training job, you need to use the environment variable MA_MOXING_FWVER to specify the MoXing version for downloading the training code.
- Environment variable name: MA_MOXING_FWVER
- Environment variable value: 2.4.0rc11
- Specify the platform image version. In a cross-cloud training job, you need to use the environment variable MA_CUSTOM_TOOL_IMAGE_VERSION to specify the image version of the platform tool container for downloading training code (providing a container environment for MoXing) and uploading training logs.
- Environment variable name: MA_CUSTOM_TOOL_IMAGE_VERSION
- Environment variable value: 1.0.0-7.2.0-b065.3
- The parameters required by PSM route optimization need to be configured using the environment variable.
- Add a training task and submit the job. Figure 5 Adding a training task and submitting the job
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot