Skip to content

Commit a438ef0

Browse files
committed
revert paddle test compiler
1 parent 7c7995c commit a438ef0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

graph_net/paddle/test_compiler.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,12 @@ def test_single_model(args):
112112
print("-- Run with compiled mode")
113113
build_strategy = paddle.static.BuildStrategy()
114114
# build_strategy.build_cinn_pass = True
115-
compilation_start_time = time.time()
116115
compiled_model = paddle.jit.to_static(
117116
model_dy,
118117
input_spec=input_spec,
119118
build_strategy=build_strategy,
120119
full_graph=True,
121120
)
122-
compilation_end_time = time.time()
123-
compilation_duration = compilation_end_time - compilation_start_time
124121
compiled_model.eval()
125122
for _ in range(args.warmup if args.warmup > 0 else 0):
126123
compiled_model(**input_dict)
@@ -170,7 +167,7 @@ def print_cmp(key, func, **kwargs):
170167
print_cmp("cmp.diff_count_atol2_rtol1", get_cmp_diff_count, atol=1e-2, rtol=1e-1)
171168

172169
print(
173-
f"{args.log_prompt} duration model_path:{args.model_path} eager:{eager_duration_box.value} compiled:{compiled_duration_box.value} compilation_time:{compilation_duration}",
170+
f"{args.log_prompt} duration model_path:{args.model_path} eager:{eager_duration_box.value} compiled:{compiled_duration_box.value}",
174171
file=sys.stderr,
175172
)
176173

graph_net/torch/test_compiler.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import time
1515
import json
1616
import numpy as np
17+
import platform
1718

1819
"""
1920
Acknowledgement: We introduce evaluation method in https://github.com/ScalingIntelligence/KernelBench to enhance function.
@@ -117,7 +118,9 @@ def naive_timer(duration_box, synchronizer_func):
117118
def time_execution_naive(
118119
model_call, synchronizer_func, num_warmup: int = 3, num_trials: int = 10
119120
):
120-
print(f"[Profiling] Using device: CPU, warm up {num_warmup}, trials {num_trials}")
121+
print(
122+
f"[Profiling] Using device: {args.device} {platform.processor()}, warm up {num_warmup}, trials {num_trials}"
123+
)
121124
for _ in range(num_warmup):
122125
model_call()
123126

@@ -153,8 +156,13 @@ def test_single_model(args):
153156
result_data = {
154157
"configuration": {
155158
"model": os.path.basename(os.path.normpath(args.model_path)),
156-
"compiler": args.compiler,
157159
"device": args.device,
160+
"cpu": platform.processor(),
161+
"cuda_gpu": torch.cuda.get_device_name(0)
162+
if args.device == "cuda"
163+
else None,
164+
"compiler": args.compiler,
165+
"torch_version": torch.__version__,
158166
"warmup": args.warmup,
159167
"trials": args.trials,
160168
},

0 commit comments

Comments
 (0)