@@ -4,20 +4,24 @@ GRAPH_NET_ROOT=$(python3 -c "import graph_net; import os; print(
44os.path.dirname(graph_net.__file__))" )
55
66# input model path
7- MODEL_PATH_IN_SAMPLES=/timm/resnet18
8- extractor_config_json_str=$( cat << EOF
7+ MODEL_NAME=resnet18
8+ MODEL_PATH_IN_SAMPLES=/timm/$MODEL_NAME
9+ decorator_config_json_str=$( cat << EOF
910{
10- "custom_extractor_path": "$GRAPH_NET_ROOT /torch/naive_graph_decomposer.py",
11- "custom_extractor_config": {
12- "output_dir": "/tmp/chain_naive_decompose_workspace",
13- "split_positions": [8, 16, 32],
14- "group_head_and_tail": true,
15- "chain_style": true
11+ "decorator_path": "$GRAPH_NET_ROOT /torch/extractor.py",
12+ "decorator_config": {
13+ "name": "$MODEL_NAME ",
14+ "custom_extractor_path": "$GRAPH_NET_ROOT /torch/naive_graph_decomposer.py",
15+ "custom_extractor_config": {
16+ "output_dir": "/tmp/chain_naive_decompose_workspace",
17+ "split_positions": [8, 16, 32],
18+ "group_head_and_tail": true,
19+ "chain_style": true
20+ }
1621 }
1722}
1823EOF
1924)
20- EXTRACTOR_CONFIG =$( echo $extractor_config_json_str | base64 -w 0)
25+ DECORATOR_CONFIG =$( echo $decorator_config_json_str | base64 -w 0)
2126
22- mkdir -p /tmp/naive_decompose_workspace
23- python3 -m graph_net.torch.single_device_runner --model-path $GRAPH_NET_ROOT /../samples/$MODEL_PATH_IN_SAMPLES --enable-extract True --extract-name resnet18 --dump-graph-hash-key --extractor-config=$EXTRACTOR_CONFIG
27+ python3 -m graph_net.torch.run_model --model-path $GRAPH_NET_ROOT /../samples/$MODEL_PATH_IN_SAMPLES --decorator-config=$DECORATOR_CONFIG
0 commit comments