已合并
【fix】: 修复Rand构图问题 #1964
liyuewei创建于 9月4日
【fix】: 修复Rand构图问题 #1964
已合并
共 4 个文件变更+17-11
| @@ -1028,7 +1028,8 @@ af::Status DefaultMTE3Api([[maybe_unused]] const std::vector<TensorShapeInfo> &i | |||
| 1028 | af::Status DefaultVECApi([[maybe_unused]] const std::vector<TensorShapeInfo> &input_shapes, | 1028 | af::Status DefaultVECApi([[maybe_unused]] const std::vector<TensorShapeInfo> &input_shapes, |
| 1029 | [[maybe_unused]] const std::vector<TensorShapeInfo> &output_shapes, | 1029 | [[maybe_unused]] const std::vector<TensorShapeInfo> &output_shapes, |
| 1030 | [[maybe_unused]] const NodeInfo &node, PerfOutputInfo &perf_res) { | 1030 | [[maybe_unused]] const NodeInfo &node, PerfOutputInfo &perf_res) { |
| 1031 | - GE_ASSERT_TRUE(!input_shapes.empty() && !output_shapes.empty()); | 1031 | + // rand/randn have no input shape, so check output shape only |
| 1032 | + GE_ASSERT_TRUE(!output_shapes.empty()); | ||
| 1032 | perf_res.pipe_res[PipeType::AIV_VEC] = af::sym::kSymbolOne; | 1033 | perf_res.pipe_res[PipeType::AIV_VEC] = af::sym::kSymbolOne; |
| 1033 | return af::SUCCESS; | 1034 | return af::SUCCESS; |
| 1034 | } | 1035 | } |
| @@ -133,8 +133,8 @@ static const std::map<std::string, af::ComputeType> kOpTypeToComputeType = { | |||
| 133 | {Scalar::Type, af::ComputeType::kComputeInvalid}, | 133 | {Scalar::Type, af::ComputeType::kComputeInvalid}, |
| 134 | {Output::Type, af::ComputeType::kComputeInvalid}, | 134 | {Output::Type, af::ComputeType::kComputeInvalid}, |
| 135 | {IndexExpr::Type, af::ComputeType::kComputeInvalid}, | 135 | {IndexExpr::Type, af::ComputeType::kComputeInvalid}, |
| 136 | - {"Rand", af::ComputeType::kComputeInvalid}, | 136 | + {Rand::Type, af::ComputeType::kComputeElewise}, |
| 137 | - {"Randn", af::ComputeType::kComputeInvalid}, | 137 | + {Randn::Type, af::ComputeType::kComputeElewise}, |
| 138 | 138 | ||
| 139 | {Load::Type, af::ComputeType::kComputeLoad}, | 139 | {Load::Type, af::ComputeType::kComputeLoad}, |
| 140 | {Store::Type, af::ComputeType::kComputeStore}, | 140 | {Store::Type, af::ComputeType::kComputeStore}, |
| @@ -56,10 +56,6 @@ TEST_P(E2E_FusedBackendElewise_Code, CalculateCorrect) { | |||
| 56 | // Launch | 56 | // Launch |
| 57 | uint32_t ws_size = 0; | 57 | uint32_t ws_size = 0; |
| 58 | AutofuseTiling(test_shape[0], test_shape[1], &tiling_data, &ws_size, &block_dim, 48, 192 * 1024); | 58 | AutofuseTiling(test_shape[0], test_shape[1], &tiling_data, &ws_size, &block_dim, 48, 192 * 1024); |
| 59 | - printf("g0_tiling_key: %d\n", tiling_data.graph0_tiling_key); | ||
| 60 | - printf("g1_tiling_key: %d\n", tiling_data.graph1_tiling_key); | ||
| 61 | - printf("g2_tiling_key: %d\n", tiling_data.graph2_tiling_key); | ||
| 62 | - printf("ws_size: %d, ws3_size: %d, ws5_size: %d\n", ws_size, tiling_data.workspace3, tiling_data.workspace5); | ||
| 63 | float *workspace = (float *)AscendC::GmAlloc(ws_size + 32); | 59 | float *workspace = (float *)AscendC::GmAlloc(ws_size + 32); |
| 64 | 60 | ||
| 65 | AscendC::SetKernelMode(KernelMode::AIV_MODE); | 61 | AscendC::SetKernelMode(KernelMode::AIV_MODE); |