Skip to content

Commit 7e48732

Browse files
authored
Merge branch 'develop' into add_albert_model
2 parents e715153 + b91adfc commit 7e48732

File tree

2,241 files changed

+970807
-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,241 files changed

+970807
-143602
lines changed

graph_net/test/nlp_model_getter.py

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

244-
return model, enc
244+
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+
752fd67d12054cfd32677bec5eae6b293b7af30f784daf6da7b29049d300361c
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
be19706eab62425b7014788a90447aa1413bb2990334a60dad10a424ce300a9a
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
845a39a2df9046b5673fad1785a3a216037950eb451d58aa167b8b989334fd55
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e29ad28c026c0c6760a73db8bfa502afcc3f239b12ca8c2dd3ba3b258544b744
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
03434c5692eadd4f05bb5feaf8ea4eb6778381fda71507383df7c9a01e702062
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": "electra-base",
4+
"num_devices_required": 1,
5+
"num_nodes_required": 1
6+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class Program_weight_tensor_data_0:
2+
name = "data_0"
3+
shape = [1, 21]
4+
dtype = "int64"
5+
data = [
6+
101,
7+
7592,
8+
1010,
9+
2026,
10+
2171,
11+
2003,
12+
3960,
13+
1012,
14+
1045,
15+
2572,
16+
4083,
17+
2055,
18+
2312,
19+
2653,
20+
4275,
21+
1998,
22+
2037,
23+
4294,
24+
2015,
25+
1012,
26+
102,
27+
]
28+
29+
30+
class Program_weight_tensor_data_1:
31+
name = "data_1"
32+
shape = [1, 21]
33+
dtype = "int64"
34+
data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

0 commit comments

Comments
 (0)