-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathgraphsample_insert.sh
More file actions
executable file
·77 lines (62 loc) · 2.57 KB
/
graphsample_insert.sh
File metadata and controls
executable file
·77 lines (62 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -x
GRAPH_NET_ROOT=$(python3 -c "import graph_net; import os; print(os.path.dirname(os.path.dirname(graph_net.__file__)))")
DB_PATH="${1:-${GRAPH_NET_ROOT}/sqlite/GraphNet.db}"
DATASET_ROOT="${GRAPH_NET_ROOT}/20260317"
TORCH_MODEL_LIST="${DATASET_ROOT}/full_graph.txt"
TYPICAL_GRAPH_SAMPLES_LIST="${DATASET_ROOT}/typical_graph.txt"
FUSIBLE_GRAPH_SAMPLES_LIST="${DATASET_ROOT}/fusible_graph.txt"
SOLE_OP_GRAPH_SAMPLES_LIST="${DATASET_ROOT}/sole_op_graph.txt"
ORDER_VALUE=0
if [ ! -f "$DB_PATH" ]; then
echo "Fail ! No Database ! : $DB_PATH"
exit 1
fi
while IFS= read -r model_rel_path; do
echo "insert : $model_rel_path"
python3 "${GRAPH_NET_ROOT}/sqlite/graphsample_insert.py" \
--model_path_prefix "$DATASET_ROOT/full_graph" \
--relative_model_path "$model_rel_path" \
--repo_uid "hf_torch_samples" \
--sample_type "full_graph" \
--order_value "$ORDER_VALUE" \
--db_path "$DB_PATH"
((ORDER_VALUE++))
done < "$TORCH_MODEL_LIST"
while IFS= read -r model_rel_path; do
echo "insert : $model_rel_path"
python3 "${GRAPH_NET_ROOT}/sqlite/graphsample_insert.py" \
--model_path_prefix "${DATASET_ROOT}/typical_graph" \
--relative_model_path "$model_rel_path" \
--op_names_path_prefix "${DATASET_ROOT}/03_sample_op_names" \
--repo_uid "hf_torch_samples" \
--sample_type "typical_graph" \
--order_value "$ORDER_VALUE" \
--db_path "$DB_PATH"
((ORDER_VALUE++))
done < "$TYPICAL_GRAPH_SAMPLES_LIST"
while IFS= read -r model_rel_path; do
echo "insert : $model_rel_path"
python3 "${GRAPH_NET_ROOT}/sqlite/graphsample_insert.py" \
--model_path_prefix "${DATASET_ROOT}/fusible_graph" \
--relative_model_path "$model_rel_path" \
--op_names_path_prefix "${DATASET_ROOT}/03_sample_op_names" \
--repo_uid "hf_torch_samples" \
--sample_type "fusible_graph" \
--order_value "$ORDER_VALUE" \
--db_path "$DB_PATH"
((ORDER_VALUE++))
done < "$FUSIBLE_GRAPH_SAMPLES_LIST"
while IFS= read -r model_rel_path; do
echo "insert : $model_rel_path"
python3 "${GRAPH_NET_ROOT}/sqlite/graphsample_insert.py" \
--model_path_prefix "${DATASET_ROOT}/sole_op_graph" \
--relative_model_path "$model_rel_path" \
--op_names_path_prefix "${DATASET_ROOT}/03_sample_op_names" \
--repo_uid "hf_torch_samples" \
--sample_type "sole_op_graph" \
--order_value "$ORDER_VALUE" \
--db_path "$DB_PATH"
((ORDER_VALUE++))
done < "$SOLE_OP_GRAPH_SAMPLES_LIST"
echo "all done"