Rate This Document
Findability
Accuracy
Completeness
Readability

train

Command Function

Uses the existing tuning result to continue tuning on the use interactive screen, or directly uses the template file directory for tuning on use interactive screen.

Syntax

1
train [-h] [-r <round>] [--algorithm <algo>] [-i <ratio>]

Parameter Description

Table 1 train subcommand parameters

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-r/--round

-

Number of training rounds, which defaults to 50. This parameter is optional.

--algorithm

-

Training algorithm, which defaults to HPO. This parameter is optional.

-i/--initial-random-ratio

-

Initial random ratio. A larger value indicates more random training rounds. This parameter is optional. The default value is 0.5 before training starts and changes to 0 once training starts. Valid values range from 0 to 1.

Example

Continue two rounds of automatic tuning on the use interactive screen. The final report and the previous automatic tuning data are summarized and sorted.

1
train -r 2

Command output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[2025-07-22 02:17:18 UTC] [KAT] [message] - ================================================================================
[2025-07-22 02:17:18 UTC] [KAT] [message] -           kunpeng automatic tuning - task set up
[2025-07-22 02:17:18 UTC] [KAT] [message] -           start time: 2025-07-22 02:17:18
[2025-07-22 02:17:18 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:19 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step   <params prepare>   start -----------
[2025-07-22 02:17:19 UTC] [KAT] [message] - ======================== Initial Configuration Preview =========================
[2025-07-22 02:17:19 UTC] [KAT] [message] - Total round             : 2
[2025-07-22 02:17:19 UTC] [KAT] [message] - Tuning direction        : high
[2025-07-22 02:17:19 UTC] [KAT] [message] - Algorithm               : HPO
[2025-07-22 02:17:19 UTC] [KAT] [message] - Random initial ratio    : 0.0
[2025-07-22 02:17:19 UTC] [KAT] [message] - Performance description : tpmC, transactions per minute
[2025-07-22 02:17:19 UTC] [KAT] [message] - Parameter groups        : PostgreSQL
[2025-07-22 02:17:19 UTC] [KAT] [message] - ================================================================================
[2025-07-22 02:17:19 UTC] [KAT] [message] -           kunpeng automatic tuning - round 6
[2025-07-22 02:17:19 UTC] [KAT] [message] -           start time: 2025-07-22 02:17:19
[2025-07-22 02:17:19 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:19 UTC] [KAT] [message] - Due to the presence of historical data and the random iterations being set to 0, the inference tuning phase begins.
[2025-07-22 02:17:30 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step    <round set up>    start -----------
[2025-07-22 02:17:30 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step   <assign params>    start -----------
[2025-07-22 02:17:32 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step      <run test>      start -----------
[2025-07-22 02:17:32 UTC] [KAT] [message] - --------- Run test successfully. 
[2025-07-22 02:17:32 UTC] [KAT] [message] - --------- Performance     :     104.570
[2025-07-22 02:17:32 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step  <round tear down>   start -----------
[2025-07-22 02:17:33 UTC] [KAT] [message] - ================================================================================
[2025-07-22 02:17:33 UTC] [KAT] [message] -           kunpeng automatic tuning - round 7
[2025-07-22 02:17:33 UTC] [KAT] [message] -           start time: 2025-07-22 02:17:33
[2025-07-22 02:17:33 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:33 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step    <round set up>    start -----------
[2025-07-22 02:17:33 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step   <assign params>    start -----------
[2025-07-22 02:17:34 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step      <run test>      start -----------
[2025-07-22 02:17:34 UTC] [KAT] [message] - --------- Run test successfully. 
[2025-07-22 02:17:34 UTC] [KAT] [message] - --------- Performance     :      86.470
[2025-07-22 02:17:34 UTC] [KAT] [message] - --------- kunpeng automatic tuning - Step  <round tear down>   start -----------
[2025-07-22 02:17:35 UTC] [KAT] [message] - ================================== Round Info =================================
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] -         Case        |    Round     | Performance  | Difference   |Improvement (%)
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] -       Baseline      |      0       |    85.61     |      --      |      --      
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] -         Best        |      1       |    115.75    |    30.14     |       35.21  
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] -        Worst        |      7       |    86.47     |     0.86     |        1.00  
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Note:
[2025-07-22 02:17:35 UTC] [KAT] [message] -     This table compares performance across the baseline, best, and worst rounds. 
[2025-07-22 02:17:35 UTC] [KAT] [message] - The gap between the best and worst rounds indicates the impact of the parameter 
[2025-07-22 02:17:35 UTC] [KAT] [message] - space on overall performance.
[2025-07-22 02:17:35 UTC] [KAT] [message] - ================================== Param Diff =================================
[2025-07-22 02:17:35 UTC] [KAT] [message] -  Group |   Parameter   |Baseline |  Best   |  Worst  | Importance |    Range    
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Postgre| seq_page_cost |6.0154236|4.2559897|8.9317063|   11.35%   | [0.0, 10.0] 
[2025-07-22 02:17:35 UTC] [KAT] [message] -   SQL  |               |         |71336317 |06083022 |            |             
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Postgre|maintenance_wor|   18    |   21    |   14    |   8.55%    |   [1, 64]   
[2025-07-22 02:17:35 UTC] [KAT] [message] -   SQL  |     k_mem     |         |         |         |            |             
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Postgre|  wal_buffers  | 194523  | 127736  | 238537  |   4.63%    |[-1, 262144] 
[2025-07-22 02:17:35 UTC] [KAT] [message] -   SQL  |               |         |         |         |            |             
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Postgre|max_pred_locks_|   115   |   123   |   102   |   3.85%    |  [10, 128]  
[2025-07-22 02:17:35 UTC] [KAT] [message] -   SQL  |per_transaction|         |         |         |            |             
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Postgre|vacuum_cost_lim|   465   |   288   |  2964   |   3.79%    |[200, 10000] 
[2025-07-22 02:17:35 UTC] [KAT] [message] -   SQL  |      it       |         |         |         |            |             
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Note:
[2025-07-22 02:17:35 UTC] [KAT] [message] -     This table shows the parameter differences between the baseline round and the 
[2025-07-22 02:17:35 UTC] [KAT] [message] - best and worst rounds throughout the training. The table is sorted by parameter 
[2025-07-22 02:17:35 UTC] [KAT] [message] - importance, displaying the top 5 parameters or parameters whose importance sum 
[2025-07-22 02:17:35 UTC] [KAT] [message] - exceeds 60%. Items marked with "--" indicate parameter values cannot be obtained. 
[2025-07-22 02:17:35 UTC] [KAT] [message] - ============================== Auto Tuning Report ==============================
[2025-07-22 02:17:35 UTC] [KAT] [message] - Total round             : 7
[2025-07-22 02:17:35 UTC] [KAT] [message] - Total run               : 8
[2025-07-22 02:17:35 UTC] [KAT] [message] - Fail times              : 0
[2025-07-22 02:17:35 UTC] [KAT] [message] - Tuning direction        : high
[2025-07-22 02:17:35 UTC] [KAT] [message] - Algorithm               : HPO
[2025-07-22 02:17:35 UTC] [KAT] [message] - Performance description : tpmC, transactions per minute
[2025-07-22 02:17:35 UTC] [KAT] [message] - Parameter groups        : PostgreSQL
[2025-07-22 02:17:35 UTC] [KAT] [message] - Baseline performance    : 85.610
[2025-07-22 02:17:35 UTC] [KAT] [message] - Top 10 performance :
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - |  Rank  |     Round     |  Performance   |  Improvement  (%) |
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   1    |   round  1    |    115.750    |       35.21       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   2    |   round  6    |    104.570     |       22.15       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   3    |   round  2    |    103.820     |       21.27       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   4    |   round  3    |     91.310     |        6.66       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   5    |   round  4    |     87.040     |        1.67       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   6    |   round  5    |     86.970     |        1.59       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - |   7    |   round  7    |     86.470     |        1.00       |
[2025-07-22 02:17:35 UTC] [KAT] [message] - --------------------------------------------------------------------------------
[2025-07-22 02:17:35 UTC] [KAT] [message] - Note:
[2025-07-22 02:17:35 UTC] [KAT] [message] - The performance value is the return value of the run test step,
[2025-07-22 02:17:35 UTC] [KAT] [message] - Performance improvement (%) =
[2025-07-22 02:17:35 UTC] [KAT] [message] -     (round performance - baseline performance) / baseline performance * 100
[2025-07-22 02:17:35 UTC] [KAT] [message] - Case package locate: /opt/template/train/train-20250722-095736
[2025-07-22 02:17:35 UTC] [KAT] [message] - ================================================================================

In the example, the performance metric is tpmC and the baseline performance is 85.610. After five rounds of automatic tuning and then two following rounds, the optimal performance reaches 115.750, presenting an increase of 35.21% over the baseline performance. The directory for saving the tuning result file is provided at the end of the command output, and can be used in subsequent tuning result processing.

In PostgreSQL database performance tests, tpmC is a key performance metric derived from the TPC-C benchmark.