Skip to content

Commit 8ce68eb

Browse files
authored
[Bug Fix] Fix subgraph generation. (#686)
* Fix rename and other minor bugs. * Fix.
1 parent 9c3a864 commit 8ce68eb

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

graph_net/tools/generate_subgraph_dataset.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ DIM_GENERALIZED_FUSIBLE_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/11_dimension_generaliz
3232
RENAMED_DIM_GENERALIZED_FUSIBLE_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/12_renamed_dimension_generalized_fusible_subgraphs
3333
DEDUP_DIM_GENERALIZED_FUSIBLE_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/13_deduplicated_dimension_generalized_fusible_subgraphs
3434
DTYPE_GENERALIZED_FUSIBLE_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/14_dtype_generalized_fusible_subgraphs
35-
BACKWARD_GRAPH_OUTPUT_DIR=$DECOMPOSE_WORKSPACE/15_backward_graph_extracted
35+
BACKWARD_GRAPH_OUTPUT_DIR=$DECOMPOSE_WORKSPACE/15_backward_fusible_subgraphs
3636
# FUSIBLE_SUBGRAPH_UNITTEST_DIR=$DECOMPOSE_WORKSPACE/16_fusible_subgraphs_unittests
3737

3838
# typical_subgraphs
3939
DIM_GENERALIZED_TYPICAL_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/2-08_dimension_generalized_typical_subgraphs
4040
RENAMED_DIM_GENERALIZED_TYPICAL_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/2-09_renamed_dimension_generalized_typical_subgraphs
4141
DEDUP_DIM_GENERALIZED_TYPICAL_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/2-10_deduplicated_dimension_generalized_typical_subgraphs
4242
DTYPE_GENERALIZED_TYPICAL_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE/2-11_dtype_generalized_typical_subgraphs
43-
BACKWARD_GRAPH_TYPICAL_OUTPUT_DIR=$DECOMPOSE_WORKSPACE/2-13_backward_graph_extracted
44-
# TYPICAL_SUBGRAPH_UNITTEST_DIR=$DECOMPOSE_WORKSPACE/2-14_typical_kernelbench_unittests
43+
BACKWARD_GRAPH_TYPICAL_OUTPUT_DIR=$DECOMPOSE_WORKSPACE/2-12_backward_typical_subgraphs
44+
# TYPICAL_SUBGRAPH_UNITTEST_DIR=$DECOMPOSE_WORKSPACE/2-13_typical_kernelbench_unittests
4545

4646
mkdir -p $DECOMPOSE_WORKSPACE
4747
mkdir -p $OUTPUT_DIR
4848

49-
model_list="$GRAPH_NET_ROOT/graph_net/config/torch_samples_list.txt"
49+
model_list="$GRAPH_NET_ROOT/graph_net/config/torch100_samples_list.txt"
5050

5151
device_rewrited_sample_list=${DECOMPOSE_WORKSPACE}/device_rewrited_sample_list.txt
5252
range_decomposed_subgraph_list=${DECOMPOSE_WORKSPACE}/range_decomposed_subgraph_sample_list.txt
@@ -366,7 +366,7 @@ function rename_dimension_generalized_fusible_subgraph() {
366366
"resume": ${RESUME},
367367
"model_path_prefix": "${DIM_GENERALIZED_FUSIBLE_SUBGRAPH_DIR}",
368368
"data_input_predicator_filepath": "$GRAPH_NET_ROOT/graph_net/torch/constraint_util.py",
369-
"data_input_predicator_class_name": "RenamedDataInputPredicator",
369+
"data_input_predicator_class_name": "NaiveDataInputPredicator",
370370
"model_runnable_predicator_filepath": "$GRAPH_NET_ROOT/graph_net/torch/constraint_util.py",
371371
"model_runnable_predicator_class_name": "ModelRunnablePredicator",
372372
"output_dir": "${RENAMED_DIM_GENERALIZED_FUSIBLE_SUBGRAPH_DIR}"
@@ -500,7 +500,7 @@ function rename_dimension_generalized_typical_subgraphs() {
500500
"resume": ${RESUME},
501501
"model_path_prefix": "${DIM_GENERALIZED_TYPICAL_SUBGRAPH_DIR}",
502502
"data_input_predicator_filepath": "$GRAPH_NET_ROOT/graph_net/torch/constraint_util.py",
503-
"data_input_predicator_class_name": "RenamedDataInputPredicator",
503+
"data_input_predicator_class_name": "NaiveDataInputPredicator",
504504
"model_runnable_predicator_filepath": "$GRAPH_NET_ROOT/graph_net/torch/constraint_util.py",
505505
"model_runnable_predicator_class_name": "ModelRunnablePredicator",
506506
"output_dir": "${RENAMED_DIM_GENERALIZED_TYPICAL_SUBGRAPH_DIR}"
@@ -629,7 +629,7 @@ function generate_fusible_subgraphs() {
629629
generate_generalized_subgraph_list ${DTYPE_GENERALIZED_FUSIBLE_SUBGRAPH_DIR} ${dtype_generalized_subgraphs_list}
630630

631631
# extract backward graphs (train_forward, train_backward, eval_forward)
632-
backward_graph_extractor 2>&1 | tee ${DECOMPOSE_WORKSPACE}/log_backward_graph_extractor_${suffix}.txt
632+
backward_graph_extractor 2>&1 | tee ${DECOMPOSE_WORKSPACE}/log_backward_graph_extractor_fusible_${suffix}.txt
633633

634634
# generate kernelbench format unittest
635635
# generate_unittests 2>&1 | tee ${DECOMPOSE_WORKSPACE}/log_unittests_${suffix}.txt
@@ -686,15 +686,15 @@ function main() {
686686

687687
sample_type="fusible_graph"
688688
generate_fusible_subgraphs
689-
cp -rf $DTYPE_GENERALIZED_FUSIBLE_SUBGRAPH_DIR $OUTPUT_DIR/$sample_type
690-
cp -rf $dtype_generalized_subgraphs_list $OUTPUT_DIR/$sample_type/sample_list.txt
689+
#cp -rf $DTYPE_GENERALIZED_FUSIBLE_SUBGRAPH_DIR $OUTPUT_DIR/$sample_type
690+
#cp -rf $dtype_generalized_subgraphs_list $OUTPUT_DIR/$sample_type/sample_list.txt
691691

692692
sample_type="typical_graph"
693693
generate_typical_subgraphs
694-
cp -rf $DTYPE_GENERALIZED_TYPICAL_SUBGRAPH_DIR $OUTPUT_DIR/$sample_type
695-
cp -rf $dtype_generalized_typical_subgraph_list $OUTPUT_DIR/$sample_type/sample_list.txt
694+
#cp -rf $DTYPE_GENERALIZED_TYPICAL_SUBGRAPH_DIR $OUTPUT_DIR/$sample_type
695+
#cp -rf $dtype_generalized_typical_subgraph_list $OUTPUT_DIR/$sample_type/sample_list.txt
696696

697-
generate_database
697+
#generate_database
698698
}
699699

700700
function summary() {
@@ -811,23 +811,23 @@ function summary() {
811811
done
812812
echo ""
813813

814-
num_backward_graph_typical_subgraphs=`find ${BACKWARD_GRAPH_TYPICAL_OUTPUT_DIR} -name "model.py" | wc -l`
815-
echo "- [Typical - 4] backward graph extraction: successed=${num_backward_graph_typical_subgraphs}"
816-
for mode in eval_forward train_forward train_backward
817-
do
818-
num_backward_graph_typical_mode=`find ${BACKWARD_GRAPH_TYPICAL_OUTPUT_DIR}/${mode} -name "model.py" | wc -l`
819-
echo " ${mode}, successed=${num_backward_graph_typical_mode}"
820-
done
821-
echo ""
822-
823814
num_dtype_generalized_typical_subgraphs=`find ${DTYPE_GENERALIZED_TYPICAL_SUBGRAPH_DIR} -name "model.py" | wc -l`
824-
echo "- [Typical - 5] dtype generalization: successed=${num_dtype_generalized_typical_subgraphs}"
815+
echo "- [Typical - 4] dtype generalization: successed=${num_dtype_generalized_typical_subgraphs}"
825816
for dtype in float32 float16 bfloat16
826817
do
827818
num_dtype_generalized_typical_subgraphs_index=`find ${DTYPE_GENERALIZED_TYPICAL_SUBGRAPH_DIR}/${dtype} -name "model.py" | wc -l`
828819
echo " ${dtype}, successed=${num_dtype_generalized_typical_subgraphs_index}"
829820
done
830821
echo ""
822+
823+
num_backward_graph_typical_subgraphs=`find ${BACKWARD_GRAPH_TYPICAL_OUTPUT_DIR} -name "model.py" | wc -l`
824+
echo "- [Typical - 5] backward graph extraction: successed=${num_backward_graph_typical_subgraphs}"
825+
for mode in eval_forward train_forward train_backward
826+
do
827+
num_backward_graph_typical_mode=`find ${BACKWARD_GRAPH_TYPICAL_OUTPUT_DIR}/${mode} -name "model.py" | wc -l`
828+
echo " ${mode}, successed=${num_backward_graph_typical_mode}"
829+
done
830+
echo ""
831831
}
832832

833833
main

0 commit comments

Comments
 (0)