@@ -12,28 +12,27 @@ export CUDA_VISIBLE_DEVICES="${GPU_ID}"
1212GRAPH_NET_ROOT=$( python3 -c " import graph_net; import os; print(os.path.dirname(os.path.dirname(graph_net.__file__)))" )
1313RESUME=" true"
1414
15- DECOMPOSE_WORKSPACE=/tmp/subgraph_dataset_workspace/test100
16- LEVEL_DECOMPOSE_WORKSPACE=$DECOMPOSE_WORKSPACE /decomposed_${OP_RANGE} ops
17- OP_NAMES_OUTPUT_DIR=${DECOMPOSE_WORKSPACE} /sample_op_names
18- RANGE_DECOMPOSE_OUTPUT_DIR=$LEVEL_DECOMPOSE_WORKSPACE /range_decompose
19- GRAPH_VAR_RENAME_OUTPUT_DIR=$LEVEL_DECOMPOSE_WORKSPACE /graph_var_renamed
20- DEDUPLICATED_OUTPUT_DIR=$LEVEL_DECOMPOSE_WORKSPACE /deduplicated
21- DEVICE_REWRITED_OUTPUT_DIR=$LEVEL_DECOMPOSE_WORKSPACE /device_rewrited
22- CUMSUM_NUM_KERNELS_DIR=$LEVEL_DECOMPOSE_WORKSPACE /cumsum_num_kernels
23- FUSIBLE_SUBGRAPH_RANGES_DIR=$LEVEL_DECOMPOSE_WORKSPACE /fusible_subgraph_ranges
24- FUSIBLE_SUBGRAPH_SAMPLES_DIR=$LEVEL_DECOMPOSE_WORKSPACE /fusible_subgraph_samples
25- RENAMED_FUSIBLE_SUBGRAPH_DIR=$LEVEL_DECOMPOSE_WORKSPACE /renamed_fusible_subgraphs
26- DEDUPLICATED_FUSIBLE_SUBGRAPH_DIR=$LEVEL_DECOMPOSE_WORKSPACE /deduplicated_fusible_subgraphs
27- UNITTESTS_OUTPUT_DIR=$LEVEL_DECOMPOSE_WORKSPACE /unittests
15+ DECOMPOSE_WORKSPACE=/tmp/subgraph_dataset_workspace
16+ OP_NAMES_OUTPUT_DIR=$DECOMPOSE_WORKSPACE /sample_op_names
17+ RANGE_DECOMPOSE_OUTPUT_DIR=$DECOMPOSE_WORKSPACE /range_decompose
18+ GRAPH_VAR_RENAME_OUTPUT_DIR=$DECOMPOSE_WORKSPACE /graph_var_renamed
19+ DEDUPLICATED_OUTPUT_DIR=$DECOMPOSE_WORKSPACE /deduplicated
20+ DEVICE_REWRITED_OUTPUT_DIR=$DECOMPOSE_WORKSPACE /device_rewrited
21+ CUMSUM_NUM_KERNELS_DIR=$DECOMPOSE_WORKSPACE /cumsum_num_kernels
22+ FUSIBLE_SUBGRAPH_RANGES_DIR=$DECOMPOSE_WORKSPACE /fusible_subgraph_ranges
23+ FUSIBLE_SUBGRAPH_SAMPLES_DIR=$DECOMPOSE_WORKSPACE /fusible_subgraph_samples
24+ RENAMED_FUSIBLE_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE /renamed_fusible_subgraphs
25+ DEDUPLICATED_FUSIBLE_SUBGRAPH_DIR=$DECOMPOSE_WORKSPACE /deduplicated_fusible_subgraphs
26+ UNITTESTS_OUTPUT_DIR=$DECOMPOSE_WORKSPACE /unittests
2827
29- mkdir -p " $LEVEL_DECOMPOSE_WORKSPACE "
28+ mkdir -p " $DECOMPOSE_WORKSPACE "
3029
3130model_list=" $GRAPH_NET_ROOT /graph_net/config/small100_torch_samples_list.txt"
32- range_decomposed_subgraph_list=${LEVEL_DECOMPOSE_WORKSPACE } /range_decomposed_subgraph_sample_list.txt
33- deduplicated_subgraph_list=${LEVEL_DECOMPOSE_WORKSPACE } /deduplicated_subgraph_sample_list.txt
34- device_rewrited_subgraph_list=${LEVEL_DECOMPOSE_WORKSPACE } /device_rewrited_subgraph_sample_list.txt
35- fusible_subgraph_list=${LEVEL_DECOMPOSE_WORKSPACE } /fusible_subgraph_sample_list.txt
36- deduplicated_fusible_subgraphs_list=${LEVEL_DECOMPOSE_WORKSPACE } /deduplicated_fusible_subgraph_sample_list.txt
31+ range_decomposed_subgraph_list=${DECOMPOSE_WORKSPACE } /range_decomposed_subgraph_sample_list.txt
32+ deduplicated_subgraph_list=${DECOMPOSE_WORKSPACE } /deduplicated_subgraph_sample_list.txt
33+ device_rewrited_subgraph_list=${DECOMPOSE_WORKSPACE } /device_rewrited_subgraph_sample_list.txt
34+ fusible_subgraph_list=${DECOMPOSE_WORKSPACE } /fusible_subgraph_sample_list.txt
35+ deduplicated_fusible_subgraphs_list=${DECOMPOSE_WORKSPACE } /deduplicated_fusible_subgraph_sample_list.txt
3736
3837function generate_subgraph_list() {
3938 local target_dir=" $1 "
@@ -80,8 +79,8 @@ function generate_split_point() {
8079 --fold-times 16 \
8180 --min-seq-ops ${MIN_SEQ_OPS} \
8281 --max-seq-ops ${MAX_SEQ_OPS} \
83- --subgraph-ranges-json " $LEVEL_DECOMPOSE_WORKSPACE /subgraph_ranges_${OP_RANGE} ops.json" \
84- --output-json " $LEVEL_DECOMPOSE_WORKSPACE /split_results_${OP_RANGE} ops.json"
82+ --subgraph-ranges-json " $DECOMPOSE_WORKSPACE /subgraph_ranges_${OP_RANGE} ops.json" \
83+ --output-json " $DECOMPOSE_WORKSPACE /split_results_${OP_RANGE} ops.json"
8584}
8685
8786function range_decompose() {
@@ -97,8 +96,8 @@ function range_decompose() {
9796 "resume": true,
9897 "model_path_prefix": "$GRAPH_NET_ROOT ",
9998 "output_dir": "${RANGE_DECOMPOSE_OUTPUT_DIR} ",
100- "split_results_path": "$LEVEL_DECOMPOSE_WORKSPACE /split_results_${OP_RANGE} ops.json",
101- "subgraph_ranges_path": "$LEVEL_DECOMPOSE_WORKSPACE /subgraph_ranges_${OP_RANGE} ops.json",
99+ "split_results_path": "$DECOMPOSE_WORKSPACE /split_results_${OP_RANGE} ops.json",
100+ "subgraph_ranges_path": "$DECOMPOSE_WORKSPACE /subgraph_ranges_${OP_RANGE} ops.json",
102101 "group_head_and_tail": true,
103102 "chain_style": false
104103 }
@@ -276,26 +275,26 @@ main() {
276275 timestamp=` date +%Y%m%d_%H%M`
277276 suffix=" ${OP_RANGE} ops_${timestamp} "
278277
279- generate_op_names 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_op_names_${suffix} .txt
280- generate_split_point 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_split_point_${suffix} .txt
281- range_decompose 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_range_decompose_${suffix} .txt
278+ generate_op_names 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_op_names_${suffix} .txt
279+ generate_split_point 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_split_point_${suffix} .txt
280+ range_decompose 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_range_decompose_${suffix} .txt
282281
283282 generate_subgraph_list ${RANGE_DECOMPOSE_OUTPUT_DIR} ${range_decomposed_subgraph_list}
284- rename_decomposed_subgraph 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_rename_decomposed_subgraph_${suffix} .txt
285- remove_duplicate_renamed_graphs 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_remove_duplicate_renamed_graphs_${suffix} .txt
283+ rename_decomposed_subgraph 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_rename_decomposed_subgraph_${suffix} .txt
284+ remove_duplicate_renamed_graphs 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_remove_duplicate_renamed_graphs_${suffix} .txt
286285
287286 generate_subgraph_list ${DEDUPLICATED_OUTPUT_DIR} ${deduplicated_subgraph_list}
288- rewrite_device 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_rewrite_device_${suffix} .txt
287+ rewrite_device 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_rewrite_device_${suffix} .txt
289288
290289 generate_subgraph_list ${DEVICE_REWRITED_OUTPUT_DIR} ${device_rewrited_subgraph_list}
291- gen_fusible_subgraphs 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_fusible_subgraphs_${suffix} .txt
290+ gen_fusible_subgraphs 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_fusible_subgraphs_${suffix} .txt
292291
293292 generate_subgraph_list ${FUSIBLE_SUBGRAPH_SAMPLES_DIR} ${fusible_subgraph_list}
294- rename_fusible_subgraph 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_rename_fusible_subgraph_${suffix} .txt
295- remove_duplicate_fusible_graphs 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_remove_duplicate_fusible_graphs_${suffix} .txt
293+ rename_fusible_subgraph 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_rename_fusible_subgraph_${suffix} .txt
294+ remove_duplicate_fusible_graphs 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_remove_duplicate_fusible_graphs_${suffix} .txt
296295
297296 generate_subgraph_list ${DEDUPLICATED_FUSIBLE_SUBGRAPH_DIR} ${deduplicated_fusible_subgraphs_list}
298- generate_unittests 2>&1 | tee ${LEVEL_DECOMPOSE_WORKSPACE } /log_unittests_${suffix} .txt
297+ generate_unittests 2>&1 | tee ${DECOMPOSE_WORKSPACE } /log_unittests_${suffix} .txt
299298}
300299
301300main
0 commit comments