train命令
命令功能
使用之前已存在的调优结果在use交互界面中继续调优,或直接指定模板文件目录在use交互界面调优。
命令格式
1 | train [-h] [-r <round>] [--algorithm <algo>] [-i <ratio>] |
参数说明
参数 |
参数选项 |
说明 |
|---|---|---|
-h/--help |
- |
可选参数,获取帮助信息。 |
-r/--round |
- |
可选参数,指定训练的轮次,默认为50轮。 |
--algorithm |
- |
可选参数,指定训练时的算法,默认为HPO。 |
-i/--initial-random-ratio |
- |
可选参数,指定初始随机比率,该值越大,训练时的随机轮次越多。未训练时默认值为0.5,当存在训练轮次后默认值为0,取值范围0-1。 |
使用示例
可在use界面中继续两轮的自动调优,最后的报告将和之前自动调优数据一同汇总排序显示。
1 | train -r 2 |
返回信息如下:
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 | Bound [2025-07-22 02:17:35 UTC] [KAT] [message] - -------------------------------------------------------------------------------- [2025-07-22 02:17:35 UTC] [KAT] [message] - Postgre| seq_page_cost | -- |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| -- | 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 | -- | 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_| -- | 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| -- | 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: /home/template/train/train-20250722-095736 [2025-07-22 02:17:35 UTC] [KAT] [message] - ================================================================================ |
示例中性能指标为tpmC,基线性能为86.610,使用自动调优5轮后,继续自动调优2轮后,最优性能数据为115.750,较基线性能提升35.21%;并在回显结尾处提供调优结果文件保存目录,可在后续调优结果处理步骤使用。
在PostgreSQL的数据库性能测试中,tpmC是一个源自TPC-C基准测试的关键性能指标。
父主题: 调优结果处理