已合并
fix env #401
Innoecho创建于 7月7日
fix env #401
已合并
共 1 个文件变更+5-3
| @@ -658,7 +658,9 @@ int HcclTest::parse_cmd_line(int argc, char *argv[]) | |||
| 658 | bool is910_95 = IsSupport910_95(); | 658 | bool is910_95 = IsSupport910_95(); |
| 659 | std::string shortopts = is910_95 ? "o:d:b:e:i:f:r:n:w:c:p:a:t:m:h" : "o:d:b:e:i:f:r:n:w:c:p:z:s:t:m:h"; | 659 | std::string shortopts = is910_95 ? "o:d:b:e:i:f:r:n:w:c:p:a:t:m:h" : "o:d:b:e:i:f:r:n:w:c:p:z:s:t:m:h"; |
| 660 | std::vector<struct option> longopts = build_longopts(is910_95); | 660 | std::vector<struct option> longopts = build_longopts(is910_95); |
| 661 | - if (is910_95) { | 661 | + |
| 662 | + const char *opModeEnv = getenv("HCCL_OP_EXPANSION_MODE"); | ||
| 663 | + if (is910_95 && opModeEnv == nullptr) { // 需要确保环境变量未配置 | ||
| 662 | accelerator_config = 6; // 910_95场景,修改默认加速器模式为CCU_SCHED | 664 | accelerator_config = 6; // 910_95场景,修改默认加速器模式为CCU_SCHED |
| 663 | } | 665 | } |
| 664 | while (-1 != (opt = getopt_long(argc, argv, shortopts.c_str(), longopts.data(), &longindex))) { | 666 | while (-1 != (opt = getopt_long(argc, argv, shortopts.c_str(), longopts.data(), &longindex))) { |
| @@ -1259,7 +1261,7 @@ int HcclTest::deregister_symmetric_memory(HcclCommSymWindow &sym_win) | |||
| 1259 | // -t参数对于ccu alltoallvc 算子数据量大于等于 128MB的场景 -t不生效 | 1261 | // -t参数对于ccu alltoallvc 算子数据量大于等于 128MB的场景 -t不生效 |
| 1260 | aclError HcclTest::start_profile_device_time_if_needed(size_t data_size) | 1262 | aclError HcclTest::start_profile_device_time_if_needed(size_t data_size) |
| 1261 | { | 1263 | { |
| 1262 | - bool isCcuSched = (accelerator_config == 0 || accelerator_config == 6) && IsSupport910_95(); | 1264 | + bool isCcuSched = accelerator_config == 6 && IsSupport910_95(); |
| 1263 | if (only_device_exec_time && !(isCcuSched && data->data_size >= data_size)) { | 1265 | if (only_device_exec_time && !(isCcuSched && data->data_size >= data_size)) { |
| 1264 | ACLCHECK(aclrtStreamWaitEvent(stream, sync_event)); | 1266 | ACLCHECK(aclrtStreamWaitEvent(stream, sync_event)); |
| 1265 | ACLCHECK(aclrtResetEvent(sync_event, stream)); | 1267 | ACLCHECK(aclrtResetEvent(sync_event, stream)); |
| @@ -1269,7 +1271,7 @@ aclError HcclTest::start_profile_device_time_if_needed(size_t data_size) | |||
| 1269 | 1271 | ||
| 1270 | aclError HcclTest::end_profile_device_time_if_needed(size_t data_size) | 1272 | aclError HcclTest::end_profile_device_time_if_needed(size_t data_size) |
| 1271 | { | 1273 | { |
| 1272 | - bool isCcuSched = (accelerator_config == 0 || accelerator_config == 6) && IsSupport910_95(); | 1274 | + bool isCcuSched = accelerator_config == 6 && IsSupport910_95(); |
| 1273 | if (only_device_exec_time && !(isCcuSched && data->data_size >= data_size)) { | 1275 | if (only_device_exec_time && !(isCcuSched && data->data_size >= data_size)) { |
| 1274 | int sleepTime = 50 + warmup_iters * 2 + iters * 2; | 1276 | int sleepTime = 50 + warmup_iters * 2 + iters * 2; |
| 1275 | std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime)); | 1277 | std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime)); |
上面readme里默认模式是AICPUTS,但是在没有配置HCCL_OP_EXPANSION_MODE的情况下,判断是910_95的情况下走664行跟readme没有保持一致,注释建议删除