Elastic Agent has reached the end of life. This section describes how to replace Elastic Agent with TaskD.
-rw-r--r-- 1 root root 6134726 Nov 10 10:32 Ascend-mindxdl-taskd_{version}_linux-aarch64.zip
-r-------- 1 root root 6205642 Nov 5 23:38 taskd-{version}-py3-none-linux_aarch64.whl
docker run -it -v /host/packagepath:/container/packagepath training_image:latest /bin/bash
pip uninstall mindx-elastic -y
If the following information is displayed, the uninstallation is successful:
Successfully uninstalled mindx_elastic-{version}
sed -i '/mindx_elastic.api/d' $(pip3 show torch | grep Location | awk -F ' ' '{print $2}')/torch/distributed/run.py
(Optional) Check whether the Elastic Agent embedding code has been deleted from the corresponding file.
vi $(pip3 show torch | grep Location | awk -F ' ' '{print $2}')/torch/distributed/run.py
pip install taskd-{version}-py3-none-linux_aarch64.whl
The installation is successful if the following information is displayed:
Successfully installed taskd-{version}
sed -i '/import os/i import taskd.python.adaptor.patch' $(pip3 show torch | grep Location | awk -F ' ' '{print $2}')/torch/distributed/run.py
docker ps
Command output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bb118ca00041 f76142d63d3a "/bin/bash -c 'sleep…" 2 hours ago Up 2 hours k8s_ascend_default-last-test-deepseek2-60b
Commit the container as the new training container image. Note that the tag of the new image is different from that of the old image. Example:
docker commit bb118ca00041 newimage:latest
from taskd.api import init_taskd_manager, start_taskd_manager
import os
job_id=os.getenv("MINDX_TASK_ID")
node_nums=XX # Total number of nodes (set by yourself)
proc_per_node=XX # Number of training processes on each node (set by yourself)
init_taskd_manager({"job_id":job_id, "node_nums": node_nums, "proc_per_node": proc_per_node})
start_taskd_manager()
For details about the parameters in the manager.py file, see def init_taskd_manager(config:dict) -> bool:.
export TASKD_PROCESS_ENABLE="on"
# The PyTorch framework is used as an example.
if [[ "${RANK}" == 0 ]]; then
export MASTER_ADDR=${POD_IP}
python manager.py & # Determined by the current path.
fi
torchrun ...
...
spec:
...
containers:
...
ports:
- containerPort: 9601
name: taskd-port
...