Skip to content

Commit 310804f

Browse files
authored
Merge branch 'develop' into add_albert_model
2 parents adadf10 + 30b4e20 commit 310804f

File tree

2,190 files changed

+927639
-143602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,190 files changed

+927639
-143602
lines changed

graph_net/test/nlp_model_getter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,4 @@ def get_albert_model_and_inputs(model_name, text, dtype):
243243
input_ids = enc["input_ids"]
244244
enc["attention_mask"] = (input_ids != tokenizer.pad_token_id).astype("int64")
245245

246-
return model, enc
246+
return model, enc

graph_net/test_compiler_util.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
3+
4+
def tolerance_generator(t):
5+
# for float16
6+
yield 10 ** (t * 3 / 5), 10**t
7+
# for bfloat16
8+
yield 10 ** (t * 1.796 / 5), 10**t
9+
# yield float32
10+
yield 10 ** (t * 5.886 / 5), 10**t
11+
# yield float64
12+
yield 10 ** (t * 7 / 5), 10 ** (t * 7 / 5)
13+
14+
15+
def calculate_tolerance_pair(begin, end):
16+
tolerance_pair_list = []
17+
for t in range(begin, end + 1):
18+
for rtol, atol in tolerance_generator(t):
19+
effective_atol = float(f"{atol:.3g}")
20+
effective_rtol = float(f"{rtol:.3g}")
21+
tolerance_pair_list.append(
22+
{
23+
"atol": effective_atol,
24+
"rtol": effective_rtol,
25+
}
26+
)
27+
return tolerance_pair_list
28+
29+
30+
def generate_allclose_configs(cmp_all_close_func):
31+
tolerance_pair_list = calculate_tolerance_pair(-10, 5)
32+
33+
cmp_configs = []
34+
for pair in tolerance_pair_list:
35+
atol, rtol = pair["atol"], pair["rtol"]
36+
cmp_configs.append(
37+
(f"[all_close_atol_{atol:.2E}_rtol_{rtol:.2E}]", cmp_all_close_func, pair)
38+
)
39+
return cmp_configs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ef1cff7d6a09085f5a39414177fefe578d79f40af14d0cf5f79e9d5fbd2cd740
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"framework": "paddle",
3+
"model_name": "Cascade-FasterRCNN-ResNet50-FPN",
4+
"num_devices_required": 1,
5+
"num_nodes_required": 1
6+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
class Program_weight_tensor_data_0:
2+
name = "data_0"
3+
shape = []
4+
dtype = "int64"
5+
data = [3]
6+
7+
8+
class Program_weight_tensor_data_1:
9+
name = "data_1"
10+
shape = [512]
11+
dtype = "int64"
12+
min_val = 0
13+
max_val = 511
14+
data = None
15+
16+
17+
class Program_weight_tensor_data_2:
18+
name = "data_2"
19+
shape = [512, 4]
20+
dtype = "float32"
21+
max_val = float("1023.9")
22+
mean = float("564.285")
23+
std = float("272.403")
24+
data = None
25+
26+
27+
class Program_weight_tensor_data_3:
28+
name = "data_3"
29+
shape = [512]
30+
dtype = "int64"
31+
min_val = 0
32+
max_val = 2
33+
data = None
34+
35+
36+
class Program_weight_tensor_data_4:
37+
name = "data_4"
38+
shape = [3, 4]
39+
dtype = "float32"
40+
data = [
41+
399.36,
42+
483.84,
43+
458.24,
44+
542.72,
45+
680.96,
46+
599.04,
47+
747.52,
48+
668.16,
49+
642.56,
50+
606.72,
51+
688.64,
52+
727.04,
53+
]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import paddle
2+
3+
4+
class GraphModule(paddle.nn.Layer):
5+
def __init__(self):
6+
super().__init__()
7+
8+
def forward(self, data_0, data_1, data_2, data_3, data_4):
9+
# pd_op.full: (xi64) <- ()
10+
full_0 = paddle._C_ops.full(
11+
[], float("0"), paddle.int64, paddle.framework._current_expected_place()
12+
)
13+
14+
# pd_op.greater_than: (xb) <- (xi64, xi64)
15+
greater_than_0 = paddle._C_ops.greater_than(data_0, full_0)
16+
del data_0
17+
18+
# pd_op.cast: (xi64) <- (xb)
19+
cast_0 = paddle._C_ops.cast(greater_than_0, paddle.int64)
20+
del greater_than_0
21+
22+
# pd_op.not_equal: (xb) <- (xi64, xi64)
23+
not_equal_0 = paddle._C_ops.not_equal(cast_0, full_0)
24+
del cast_0
25+
26+
# pd_op.cast: (xi64) <- (xb)
27+
cast_1 = paddle._C_ops.cast(not_equal_0, paddle.int64)
28+
del not_equal_0
29+
30+
# pd_op.equal: (xb) <- (xi64, xi64)
31+
equal_0 = paddle._C_ops.equal(cast_1, full_0)
32+
del cast_1, full_0
33+
34+
# pd_op.full: (1xi32) <- ()
35+
full_1 = paddle._C_ops.full(
36+
[1], float("0"), paddle.int32, paddle.core.CPUPlace()
37+
)
38+
39+
# pd_op.gather: (-1x4xf32) <- (-1x4xf32, -1xi64, 1xi32)
40+
gather_0 = paddle._C_ops.gather(data_4, data_3, full_1)
41+
del data_3, data_4, full_1
42+
43+
# pd_op.shape64: (1xi64) <- (512xi64)
44+
shape64_0 = paddle._C_ops.shape64(data_1)
45+
del data_1
46+
47+
return gather_0, shape64_0
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d84efc51ae2a7d78f2c99b1540a638f4add520ed84de5d62907935b05a8cf292
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"framework": "paddle",
3+
"model_name": "Cascade-FasterRCNN-ResNet50-FPN",
4+
"num_devices_required": 1,
5+
"num_nodes_required": 1
6+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
class Program_weight_tensor_data_0:
2+
name = "data_0"
3+
shape = [512, 4]
4+
dtype = "float32"
5+
max_val = float("1018.05")
6+
mean = float("439.025")
7+
std = float("231.686")
8+
data = None
9+
10+
11+
class Program_weight_tensor_data_1:
12+
name = "data_1"
13+
shape = [512, 4]
14+
dtype = "float32"
15+
max_val = float("938.986")
16+
mean = float("467.502")
17+
std = float("224.196")
18+
data = None
19+
20+
21+
class Program_weight_tensor_data_2:
22+
name = "data_2"
23+
shape = [512, 4]
24+
dtype = "float32"
25+
max_val = float("936.918")
26+
mean = float("499.308")
27+
std = float("203.062")
28+
data = None
29+
30+
31+
class Program_weight_tensor_data_3:
32+
name = "data_3"
33+
shape = [512, 4]
34+
dtype = "float32"
35+
max_val = float("981.0")
36+
mean = float("506.296")
37+
std = float("288.897")
38+
data = None

0 commit comments

Comments
 (0)