Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos (CommConetxt, yeild_op, etc.) #61560

Merged
merged 5 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/auto_parallel/pipeline_scheduler_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_pp_pass(self):
assert losses_1f1b_overlap[0].shape[0] == 4
# losses_fleet_1f1b is the last loss of accumulate_steps
# losses_fthenb is all the losses of accumulate_steps
# losses_1f1b is alla the losses of accumulate_steps
# losses_1f1b is all the losses of accumulate_steps
self.check_results(losses_fleet_1f1b[0], losses_fthenb[0][-1])
self.check_results(losses_fleet_1f1b[0], losses_1f1b[0][-1])
self.check_results(losses_fleet_1f1b[0], losses_eager1f1b[0][-1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from paddle import nn


class TestSimpleNetWithEmtpyGradForSemiAutoParallel(
class TestSimpleNetWithEmptyGradForSemiAutoParallel(
TestSimpleNetForSemiAutoParallel
):
def __init__(self):
Expand Down Expand Up @@ -72,4 +72,4 @@ def run_test_case(self):


if __name__ == '__main__':
TestSimpleNetWithEmtpyGradForSemiAutoParallel().run_test_case()
TestSimpleNetWithEmptyGradForSemiAutoParallel().run_test_case()
4 changes: 2 additions & 2 deletions test/auto_parallel/test_comm_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_comm_cost(self):
cluster = Cluster()
cluster.build_from_file(cluster_json_path)

# Build CommConetxt
# Build CommContext
CommContext._has_instance = None
CommContext._instance = None
comm_context = CommContext(cluster)
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_cross_machine_comm_cost(self):
cluster = Cluster()
cluster.build_from_file(cluster_json_path)

# Build CommConetxt
# Build CommContext
CommContext._has_instance = None
CommContext._instance = None
comm_context = CommContext(cluster)
Expand Down
2 changes: 1 addition & 1 deletion test/autograd/test_prim2orig.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def init_data(self):

self.prim2orig_args = (X, Y)
self.all_ops = ['add_p', 'elementwise_add']
# { prim_op_output_var: orign_op_out_index }
# { prim_op_output_var: origin_op_out_index }
self.out_map = {self.output['Z']: 0}

def test_op(self):
Expand Down
20 changes: 10 additions & 10 deletions test/cpp/inference/infer_ut/test_LeViT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ TEST(gpu_tester_LeViT, analysis_gpu_bz1) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
config_no_ir.SwitchIrOptim(false);
// prepare inference config
config.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand All @@ -70,7 +70,7 @@ TEST(tensorrt_tester_LeViT, trt_fp32_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -81,7 +81,7 @@ TEST(tensorrt_tester_LeViT, trt_fp32_bz2) {
config.EnableUseGpu(100, 0);
config.EnableTensorRtEngine(
1 << 20, 2, 50, paddle_infer::PrecisionType::kFloat32, false, false);
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand All @@ -96,7 +96,7 @@ TEST(tensorrt_tester_LeViT, trt_fp32_bz2) {

TEST(tensorrt_tester_LeViT, serial_diff_batch_trt_fp32) {
int max_batch_size = 5;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -121,7 +121,7 @@ TEST(tensorrt_tester_LeViT, serial_diff_batch_trt_fp32) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// get groudtruth by disbale ir
// get ground truth by disable ir
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
// get infer results
Expand All @@ -141,7 +141,7 @@ TEST(tensorrt_tester_LeViT, multi_thread4_trt_fp32_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -152,7 +152,7 @@ TEST(tensorrt_tester_LeViT, multi_thread4_trt_fp32_bz2) {
config.EnableUseGpu(100, 0);
config.EnableTensorRtEngine(
1 << 20, 2, 50, paddle_infer::PrecisionType::kFloat32, false, false);
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand Down Expand Up @@ -194,7 +194,7 @@ TEST(tensorrt_tester_LeViT, multi_stream_thread4_trt_fp32_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -205,7 +205,7 @@ TEST(tensorrt_tester_LeViT, multi_stream_thread4_trt_fp32_bz2) {
config.EnableUseGpu(100, 0);
config.EnableTensorRtEngine(
1 << 20, 2, 50, paddle_infer::PrecisionType::kFloat32, false, false);
// get groudtruth by disbale ir
// get ground truth by disable ir

paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
Expand Down
12 changes: 6 additions & 6 deletions test/cpp/inference/infer_ut/test_det_mv3_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ TEST(gpu_tester_det_mv3_db, analysis_gpu_bz4) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
config_no_ir.SwitchIrOptim(false);
// prepare inference config
config.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand All @@ -95,7 +95,7 @@ TEST(tensorrt_tester_det_mv3_db, multi_thread2_trt_fp32_dynamic_shape_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -107,7 +107,7 @@ TEST(tensorrt_tester_det_mv3_db, multi_thread2_trt_fp32_dynamic_shape_bz2) {
config.EnableTensorRtEngine(
1 << 20, 4, 3, paddle_infer::PrecisionType::kFloat32, false, false);
PrepareDynamicShape(&config, 4);
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand Down Expand Up @@ -141,7 +141,7 @@ TEST(mkldnn_tester_det_mv3_db, multi_thread2_mkl_fp32_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -153,7 +153,7 @@ TEST(mkldnn_tester_det_mv3_db, multi_thread2_mkl_fp32_bz2) {
config.EnableMKLDNN();
config.SetMkldnnCacheCapacity(10);
config.SetCpuMathLibraryNumThreads(10);
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand Down
8 changes: 4 additions & 4 deletions test/cpp/inference/infer_ut/test_ernie_text_cls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ TEST(gpu_tester_ernie_text_cls, analysis_gpu_bz2_buffer) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -71,7 +71,7 @@ TEST(gpu_tester_ernie_text_cls, analysis_gpu_bz2_buffer) {
std::string params_str = paddle::test::read_file(params_file);
config.SetModelBuffer(
prog_str.c_str(), prog_str.size(), params_str.c_str(), params_str.size());
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand All @@ -91,7 +91,7 @@ TEST(mkldnn_tester_ernie_text_cls, multi_thread4_mkl_fp32_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand All @@ -104,7 +104,7 @@ TEST(mkldnn_tester_ernie_text_cls, multi_thread4_mkl_fp32_bz2) {
config.EnableMKLDNN();
config.SetMkldnnCacheCapacity(10);
config.SetCpuMathLibraryNumThreads(10);
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &my_input_data_map, &truth_output_data, 1);
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/inference/infer_ut/test_mobilnetv1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST(tensorrt_tester_mobilenetv1, tuned_dynamic_trt_fp32_bz2) {
if (tuned_shape) {
// NOTE: shape_range_info will be saved after destructor of predictor
// function
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config tune_config;
tune_config.SetModel(FLAGS_modeldir + "/inference.pdmodel",
FLAGS_modeldir + "/inference.pdiparams");
Expand Down
8 changes: 4 additions & 4 deletions test/cpp/inference/infer_ut/test_ppyolo_mbv3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TEST(tensorrt_tester_ppyolo_mbv3, multi_thread4_trt_fp32_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/model.pdmodel",
FLAGS_modeldir + "/model.pdiparams");
Expand All @@ -75,7 +75,7 @@ TEST(tensorrt_tester_ppyolo_mbv3, multi_thread4_trt_fp32_bz2) {
config.EnableTensorRtEngine(
1 << 25, 2, 3, paddle_infer::PrecisionType::kFloat32, false, false);
LOG(INFO) << config.Summary();
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &input_data_map, &truth_output_data, 1);
Expand Down Expand Up @@ -111,7 +111,7 @@ TEST(DISABLED_mkldnn_tester_ppyolo_mbv3, multi_thread4_mkl_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/model.pdmodel",
FLAGS_modeldir + "/model.pdiparams");
Expand All @@ -125,7 +125,7 @@ TEST(DISABLED_mkldnn_tester_ppyolo_mbv3, multi_thread4_mkl_bz2) {
config.SetMkldnnCacheCapacity(10);
config.SetCpuMathLibraryNumThreads(10);
LOG(INFO) << config.Summary();
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &input_data_map, &truth_output_data, 1);
Expand Down
12 changes: 6 additions & 6 deletions test/cpp/inference/infer_ut/test_ppyolov2_r50vd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TEST(tensorrt_tester_ppyolov2_r50vd, multi_thread2_trt_fp32_bz1) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/model.pdmodel",
FLAGS_modeldir + "/model.pdiparams");
Expand All @@ -75,7 +75,7 @@ TEST(tensorrt_tester_ppyolov2_r50vd, multi_thread2_trt_fp32_bz1) {
config.EnableTensorRtEngine(
1 << 28, 2, 10, paddle_infer::PrecisionType::kFloat32, false, false);
LOG(INFO) << config.Summary();
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &input_data_map, &truth_output_data, 1);
Expand All @@ -96,7 +96,7 @@ TEST(tensorrt_tester_ppyolov2_r50vd, multi_thread2_trt_fp32_bz1) {
LOG(INFO) << "join tid : " << i;
threads[i].join();
// CompareRecord(&truth_output_data, &infer_output_data, 1e-2);
// TODO(OliverLPH): disable comparison since precsion is low
// TODO(OliverLPH): disable comparison since precision is low
}

std::cout << "finish multi-thread test" << std::endl;
Expand All @@ -109,7 +109,7 @@ TEST(mkldnn_tester_ppyolov2_r50vd, multi_thread2_mkl_bz2) {
// init output data
std::map<std::string, paddle::test::Record> infer_output_data,
truth_output_data;
// prepare groudtruth config
// prepare ground truth config
paddle_infer::Config config, config_no_ir;
config_no_ir.SetModel(FLAGS_modeldir + "/model.pdmodel",
FLAGS_modeldir + "/model.pdiparams");
Expand All @@ -123,7 +123,7 @@ TEST(mkldnn_tester_ppyolov2_r50vd, multi_thread2_mkl_bz2) {
config.SetMkldnnCacheCapacity(10);
config.SetCpuMathLibraryNumThreads(10);
LOG(INFO) << config.Summary();
// get groudtruth by disbale ir
// get ground truth by disable ir
paddle_infer::services::PredictorPool pred_pool_no_ir(config_no_ir, 1);
SingleThreadPrediction(
pred_pool_no_ir.Retrieve(0), &input_data_map, &truth_output_data, 1);
Expand All @@ -144,7 +144,7 @@ TEST(mkldnn_tester_ppyolov2_r50vd, multi_thread2_mkl_bz2) {
LOG(INFO) << "join tid : " << i;
threads[i].join();
// CompareRecord(&truth_output_data, &infer_output_data, 1e-4);
// TODO(OliverLPH): disable comparison since precsion is low
// TODO(OliverLPH): disable comparison since precision is low
}

std::cout << "finish multi-thread test" << std::endl;
Expand Down
Loading