11#! /bin/bash
22
3+ # GRAPH_NET_ROOT=$(python3 -c "import graph_net; import os; print(os.path.dirname(os.path.dirname(graph_net.__file__)))")
4+
5+ # model_path_list=$GRAPH_NET_ROOT/graph_net/test/dev_model_list/cumsum_num_kernels_sample_list.txt
6+ # WORKSPACE_ROOT=/tmp/fusible_subgraphs
7+ # CUMSUM_NUM_KERNELS_WORKSPACE=$WORKSPACE_ROOT/workspace_cumsum_num_kernels
8+ # FUSIBLE_SUBGRAPH_RANGES_WORKSPACE=$WORKSPACE_ROOT/workspace_fusible_subgraph_ranges
9+ # FUSIBLE_SUBGRAPH_SAMPLES_WORKSPACE=$WORKSPACE_ROOT/workspace_fusible_subgraph_samples
10+ # resume=false
11+
12+ # python3 -m graph_net.model_path_handler \
13+ # --model-path-list "$model_path_list" \
14+ # --handler-config $(base64 -w 0 <<EOF
15+ # {
16+ # "handler_path": "$GRAPH_NET_ROOT/graph_net/torch/sample_passes/cumsum_num_kernels_generator.py",
17+ # "handler_class_name": "CumSumNumKernelsGenerator",
18+ # "handler_config": {
19+ # "output_json_file_name": "cumsum_num_kernels.json",
20+ # "model_path_prefix": "$GRAPH_NET_ROOT",
21+ # "output_dir": "$CUMSUM_NUM_KERNELS_WORKSPACE",
22+ # "resume": $resume
23+ # }
24+ # }
25+ # EOF
26+ # )
27+
28+ # python3 -m graph_net.model_path_handler \
29+ # --model-path-list "$model_path_list" \
30+ # --handler-config $(base64 -w 0 <<EOF
31+ # {
32+ # "handler_path": "$GRAPH_NET_ROOT/graph_net/sample_pass/fusible_subgraph_ranges_generator.py",
33+ # "handler_class_name": "FusibleSubgraphRangesGenerator",
34+ # "handler_config": {
35+ # "model_path_prefix": "$CUMSUM_NUM_KERNELS_WORKSPACE",
36+ # "input_json_file_name": "cumsum_num_kernels.json",
37+ # "output_json_file_name": "fusible_subgraph_ranges.json",
38+ # "output_dir": "$FUSIBLE_SUBGRAPH_RANGES_WORKSPACE",
39+ # "resume": $resume
40+ # }
41+ # }
42+ # EOF
43+ # )
44+
45+ # python3 -m graph_net.model_path_handler \
46+ # --model-path-list "$model_path_list" \
47+ # --handler-config $(base64 -w 0 <<EOF
48+ # {
49+ # "handler_path": "$GRAPH_NET_ROOT/graph_net/torch/sample_passes/subgraph_generator.py",
50+ # "handler_class_name": "SubgraphGenerator",
51+ # "handler_config": {
52+ # "model_path_prefix": "$GRAPH_NET_ROOT",
53+ # "output_dir": "$FUSIBLE_SUBGRAPH_SAMPLES_WORKSPACE",
54+ # "subgraph_ranges_json_root": "$FUSIBLE_SUBGRAPH_RANGES_WORKSPACE",
55+ # "resume": $resume
56+ # }
57+ # }
58+ # EOF
59+ # )
60+
361GRAPH_NET_ROOT=$( python3 -c " import graph_net; import os; print(os.path.dirname(os.path.dirname(graph_net.__file__)))" )
462
563model_path_list=$GRAPH_NET_ROOT /graph_net/test/dev_model_list/cumsum_num_kernels_sample_list.txt
@@ -9,51 +67,45 @@ FUSIBLE_SUBGRAPH_RANGES_WORKSPACE=$WORKSPACE_ROOT/workspace_fusible_subgraph_ran
967FUSIBLE_SUBGRAPH_SAMPLES_WORKSPACE=$WORKSPACE_ROOT /workspace_fusible_subgraph_samples
1068resume=false
1169
12- python3 -m graph_net.model_path_handler \
70+ python3 -m graph_net.apply_sample_pass \
1371 --model-path-list " $model_path_list " \
14- --handler-config $( base64 -w 0 << EOF
72+ --sample-pass-file-path " $GRAPH_NET_ROOT /graph_net/torch/sample_passes/cumsum_num_kernels_generator.py" \
73+ --sample-pass-class-name " CumSumNumKernelsGenerator" \
74+ --sample-pass-config " $( cat << EOF
1575{
16- "handler_path": "$GRAPH_NET_ROOT /graph_net/torch/sample_passes/cumsum_num_kernels_generator.py",
17- "handler_class_name": "CumSumNumKernelsGenerator",
18- "handler_config": {
19- "output_json_file_name": "cumsum_num_kernels.json",
20- "model_path_prefix": "$GRAPH_NET_ROOT ",
21- "output_dir": "$CUMSUM_NUM_KERNELS_WORKSPACE ",
22- "resume": $resume
23- }
76+ "output_json_file_name": "cumsum_num_kernels.json",
77+ "model_path_prefix": "$GRAPH_NET_ROOT ",
78+ "output_dir": "$CUMSUM_NUM_KERNELS_WORKSPACE ",
79+ "resume": $resume
2480}
2581EOF
26- )
82+ ) "
2783
28- python3 -m graph_net.model_path_handler \
84+ python3 -m graph_net.apply_sample_pass \
2985 --model-path-list " $model_path_list " \
30- --handler-config $( base64 -w 0 << EOF
86+ --sample-pass-file-path " $GRAPH_NET_ROOT /graph_net/sample_pass/fusible_subgraph_ranges_generator.py" \
87+ --sample-pass-class-name " FusibleSubgraphRangesGenerator" \
88+ --sample-pass-config " $( cat << EOF
3189{
32- "handler_path": "$GRAPH_NET_ROOT /graph_net/sample_pass/fusible_subgraph_ranges_generator.py",
33- "handler_class_name": "FusibleSubgraphRangesGenerator",
34- "handler_config": {
35- "model_path_prefix": "$CUMSUM_NUM_KERNELS_WORKSPACE ",
36- "input_json_file_name": "cumsum_num_kernels.json",
37- "output_json_file_name": "fusible_subgraph_ranges.json",
38- "output_dir": "$FUSIBLE_SUBGRAPH_RANGES_WORKSPACE ",
39- "resume": $resume
40- }
90+ "model_path_prefix": "$CUMSUM_NUM_KERNELS_WORKSPACE ",
91+ "input_json_file_name": "cumsum_num_kernels.json",
92+ "output_json_file_name": "fusible_subgraph_ranges.json",
93+ "output_dir": "$FUSIBLE_SUBGRAPH_RANGES_WORKSPACE ",
94+ "resume": $resume
4195}
4296EOF
43- )
97+ ) "
4498
45- python3 -m graph_net.model_path_handler \
99+ python3 -m graph_net.apply_sample_pass \
46100 --model-path-list " $model_path_list " \
47- --handler-config $( base64 -w 0 << EOF
101+ --sample-pass-file-path " $GRAPH_NET_ROOT /graph_net/sample_pass/subgraph_generator.py" \
102+ --sample-pass-class-name " SubgraphGenerator" \
103+ --sample-pass-config " $( cat << EOF
48104{
49- "handler_path": "$GRAPH_NET_ROOT /graph_net/torch/sample_passes/subgraph_generator.py",
50- "handler_class_name": "SubgraphGenerator",
51- "handler_config": {
52- "model_path_prefix": "$GRAPH_NET_ROOT ",
53- "output_dir": "$FUSIBLE_SUBGRAPH_SAMPLES_WORKSPACE ",
54- "subgraph_ranges_json_root": "$FUSIBLE_SUBGRAPH_RANGES_WORKSPACE ",
55- "resume": $resume
56- }
105+ "model_path_prefix": "$GRAPH_NET_ROOT ",
106+ "output_dir": "$FUSIBLE_SUBGRAPH_SAMPLES_WORKSPACE ",
107+ "subgraph_ranges_json_root": "$FUSIBLE_SUBGRAPH_RANGES_WORKSPACE ",
108+ "resume": $resume
57109}
58110EOF
59- )
111+ ) "
0 commit comments