Recovery Time (MindSpore)

This section describes the optimization items that can be used to shorten the resumable training time on MindSpore, including Fault Detection Time, Training Rollback and Checkpoint Loading Time, and Cache Building Time.

Fault Detection Time

A parameter plane network fault in a cluster may not affect a training job. Therefore, the cluster scheduling components do not forcibly interrupt the job. When the parameter plane network fault affects a training job, the network timeout mechanism of collective communication is triggered. After a default waiting period of 30 minutes, the cluster scheduling components can detect the fault and trigger resumable training. To solve this problem, MindSpore provides a watchdog fault detection function to determine if training jobs are affected and to reduce fault detection time. For details, see Table 1.

Table 1 Description of watchdog fault detection

Function

Watchdog fault detection

Function Highlights

When training is started, a monitoring thread is started at the same time to continuously obtain communication exceptions and task execution exceptions. After a fault is detected, an exception is quickly thrown, the training process is terminated, and rescheduling is triggered.

Instructions

Only MindSpore 2.4 and later versions are supported.

Key Operation

The watchdog fault detection is enabled by default in MindSpore. You do not need to manually configure it. To disable watchdog, add the following fields in bold to the model configuration file.

...
context:
  ascend_config:
    hccl_watchdog: False    
...

Training Rollback and Checkpoint Loading Time

Cache Building Time

During resumable training, a computational graph needs to be built. However, this process takes a long time in foundation model scenarios. To solve this problem, MindSpore can store a building cache file during the first building. During fault recovery, the graph building cache in storage can be directly read to reduce the graph building time. For details, see Table 4.

Table 4 Graph building cache

Function

Graph building cache

Function Highlights

During graph compilation, the cache file stored on the storage device is loaded to help reduce compilation time.

Instructions

Only supported by MindSpore 2.3.0 and later versions.

Key Operation

Add the following environment variables to the shell startup script (for example, train_start.sh) for training:
export MS_COMPILER_CACHE_ENABLE=1
export MS_COMPILER_CACHE_ENABLE=1 # Enable graph compilation cache.
export MS_COMPILER_CACHE_PATH=xxx # Set the graph compilation cache path.