Collecting Profile Data
Function
Delivers the Profiling options to the host by using ADC and starts Profiling.
Syntax
adc --host <host_ip>:<port> --profile "<params>"
Options
Option |
Description |
Required or Not |
---|---|---|
--host |
|
Yes |
--profile |
Profiling options, specified in params. |
Yes |
Prerequisites
The application code has been built, and the generated executable file and the test data (such as the dataset and .om file) that the executable file depends have been uploaded to the corresponding directories on the host. For details about how to build and run an application, see "AscendCL Sample User Guide > Image Classification with Caffe ResNet-50 (Synchronous Inference)" in Application Software Development Guide.
In the sample, after code build, the executable file is stored in the acl_resnet50/out directory, the dataset that the executable file depends is stored in the acl_resnet50/data directory, and the .om file is stored in the acl_resnet50/model directory. Upload the src, out, data, and model directories to any subdirectory under the ~/HIAI_PROJECTS/workspace_mind_studio directory of the host. For example, ~/HIAI_PROJECTS/workspace_mind_studio/acl_resnet50. If a directory does not exist, create one. In addition, run the chmod +x executable_file_name command to grant the execute permission on the executable file.
In the command, ~ indicates the path specified by WORK_PATH and cannot be changed. The default value is the home directory of the user who runs the ada process. For details about WORK_PATH, see What Is the ide_daemon.cfg File?.
Example
- Log in to the server where the adc command is to be executed as the root user, go to the /etc directory, add the path of the libascendcl.so library to the ld.so.conf file. For example, /home/HwHiAiUser/Ascend/ascend-toolkit/latest/acllib/lib64.
In the preceding command, /home/HwHiAiUser/Ascend/ascend-toolkit/latest indicates the default installation path of the standard-form ACLlib. Replace it with the actual one.
include /etc/ld.so.conf.d/*.conf /home/HwHiAiUser/Ascend/ascend-toolkit/latest/acllib/lib64
- Run the ldconfig command to update the dynamic link libraries (DLLs).
- Prepare the environment by referring to Environment Preparation.
- Log in to the server installed with Toolkit as the running user.
- Run the adc command.The following is only an example. You need to change the parameters to actual values.
- Replace xx.xx.xx.xx after --host with the actual IP address of the host.
- Set job_id to any number for identifying a task.
- Replace app with the app name in the directory specified by app_dir, for example, main.
- Replace /xxx/xxx after app_dir with the application path on the host, for example, ~/HIAI_PROJECTS/workspace_mind_studio/acl_resnet50/out. ~ indicates the home directory of the ada process running user.
- Replace the path after result_dir with an existing path. Ensure that the user to run the adc command has the read and write permissions. After running the command, you can view the profiling result in the directory specified by result_dir.
adc --host xx.xx.xx.xx:22118 --profile "{\"job_id\": \"1\",\"app\": \"main\",\"app_dir\": \"~/HIAI_PROJECTS/workspace_mind_studio/acl_resnet50/out\",\"result_dir\": \"/home/HwHiAiUser/test\",\"profiling_options\": \"task_trace\",\"devices\": \"0\"}"