Rate This Document
Findability
Accuracy
Completeness
Readability

Function Description

Command Function

Generates a configuration template of the parameter space and application scenario for the Kunpeng AutoTuner. After a template is generated, you can run the devkit kat train -t task.json -p param.json command to start automatic tuning.

Syntax

1
devkit kat template [-h] [-l {0,1,2,3}] [-g] [-o <dir>]

Parameter Description

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information.

-l/--log-level

0/1/2/3

Log level, which defaults to 2.
  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

-g/--generate

-

Enters the interactive user interface and generates a simple template file for the application. The template contains only mandatory parameters.

-c/--convert

-

Converts a simple template file to a general template file with all parameters.

-o/--output

-

Path to the generated template file.

Example

  • Generating a simple template
    1
    devkit kat template -g -o /opt/template
    

    The -g parameter displays the interactive user interface. Set the basic parameters required by a template file. The -o /opt/template parameter indicates the path to the generated template file.

  1. Select an application.

    Press the or key to select an application, and press Enter to confirm the selection.

    Figure 1 Selecting an application
  2. Select an application version.

    Press Enter to go to the version list and select the required version. Press Esc to return to the parent directory. Press Space to select or deselect the option.

    Figure 2 Selecting a version
  3. Select a parameter type.

    Press Space to switch between [Y] and [N] to select or deselect the parameter type. The OS option indicates system parameter tuning and the uarch option indicates microarchitecture parameter tuning.

    Figure 3 Selecting parameter types
  4. Select application parameters.
    Press Enter to go to the application parameter configuration screen and select the parameters that you want to enable.
    Figure 4 Selecting Spark parameters
  5. Save the configuration to generate a simple template file.

    After the configuration is complete, press S to save the simple template file to the specified directory. If you do not specify a directory, a template file named kat-template-YMD-HMS is generated in the command execution directory.

    Figure 5 Generating a simple template file
  6. Exit from the interactive user interface.

    Press Q to choose to exit, and then press Y to confirm exiting. The directory for saving the template file is displayed on the terminal.

    Command output:

    1
    [2024-12-30 09:46:49 UTC] [KAT] [message] - The path of the saved file is as follows:: ['/home/kat_show/DevKit-CLI-xx.xx.xx-Linux-Kunpeng/template_Spark_20241230_094556']
    
  7. View the generated simple template file.
    1
    ls /home/kat_show/DevKit-CLI-xx.0.xx-Linux-Kunpeng/template_Spark_20241230_094556
    

    Command output:

    1
    param_Spark_uarch.json  task_Spark_uarch.json
    
  8. View the application parameter file.
    1
    vim /home/kat_show/DevKit-CLI-xx.0.xx-Linux-Kunpeng/template_Spark_20241230_094556/param_Spark_OS_uarch.json
    

    The param_xxx_xxxx.json file contains application parameters selected on the interactive user interface.

    Figure 6 Application parameter file
  9. View and complete the task parameter file.
    1
    vim /opt/template/template_spark_20241218_075615/task_Spark_OS_uarch.json
    

    Set mandatory parameters in the template file based on your requirements, such as the environment information, application server, performance test tool server, and pressure test metrics. For details about the parameters, see Parameters of a Simple Template File.

    Figure 7 Task template file
  10. Save the task parameter file and exit.

    After completing the basic configuration, press Esc, input :wq, and press Enter to save the file and exit.

  • Converting a simple template to a general template

    If a simple parameter template does not meet your requirements, convert it to a general parameter template.

    1
    devkit kat template -c /home/kat_show_user/task_Rocksdb_OS.json
    

    Command output:

    1
    [2024-12-19 13:53:27 UTC] [KAT] [ info  ] - /home/kat_show_user/task_Rocksdb_OS.json has been converted to /home/kat_show_user/task_Rocksdb_OS_custom.json
    
    Figure 8 General template file