Skip to content

Commit bd3d398

Browse files
JewelRoamlixinqi
andauthored
Fix fusible subgraph generation and add into graph_net/tools/generate_subgraph_dataset.sh (#480)
* Add debug case for CumSumNumKernelsGenerator * FIx dir name * fix name mismatch in torch/fx_graph_parse_util.py * Add gen_fusible_subgraphs to graph_net/tools/generate_subgraph_dataset.sh * warmup in count_kernels --------- Co-authored-by: Xinqi Li <[email protected]>
1 parent ddc9ecb commit bd3d398

File tree

16 files changed

+1422
-44
lines changed

16 files changed

+1422
-44
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
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/workspace_cumsum_num_kernels/test_model_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/graph_net/test/workspace_cumsum_num_kernels",
21+
"output_dir": "$CUMSUM_NUM_KERNELS_WORKSPACE",
22+
"resume": $resume
23+
}
24+
}
25+
EOF
26+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"framework": "torch",
3+
"num_devices_required": 1,
4+
"num_nodes_required": 1,
5+
"dynamic": false,
6+
"model_name": "hf-tiny-model-private_tiny-random-Swinv2ForImageClassification_0"
7+
}

graph_net/test/workspace_cumsum_num_kernels/samples/transformers-auto-model/hf-tiny-model-private_tiny-random-Swinv2ForImageClassification/_decomposed/hf-tiny-model-private_tiny-random-Swinv2ForImageClassification_0/input_meta.py

Whitespace-only changes.

graph_net/test/workspace_cumsum_num_kernels/samples/transformers-auto-model/hf-tiny-model-private_tiny-random-Swinv2ForImageClassification/_decomposed/hf-tiny-model-private_tiny-random-Swinv2ForImageClassification_0/input_tensor_constraints.py

Whitespace-only changes.

graph_net/test/workspace_cumsum_num_kernels/samples/transformers-auto-model/hf-tiny-model-private_tiny-random-Swinv2ForImageClassification/_decomposed/hf-tiny-model-private_tiny-random-Swinv2ForImageClassification_0/model.py

Lines changed: 265 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)