Skip to content

Commit a53e782

Browse files
committed
Add detail of sample statistics for different model category and call it in ci.
1 parent d1b2a69 commit a53e782

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/Validate-GPU.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
- name: Run check
7979
env:
8080
work_dir: ${{ github.workspace }}
81+
if: steps.check-bypass.outputs.can-skip != 'true'
8182
run: |
8283
docker exec -t ${{ env.container_name }} /bin/bash -c '
8384
source ${{ github.workspace }}/../../../proxy

tools/ci/check_validate.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ function LOG {
88

99
LOG "[INFO] Start validate samples changed by pull request ..."
1010

11-
export GRAPH_NET_EXTRACT_WORKSPACE=$(cd $(dirname $0)/../.. && pwd)
11+
export GRAPH_NET_ROOT=$(cd $(dirname $0)/../.. && pwd)
12+
export GRAPH_NET_EXTRACT_WORKSPACE="${GRAPH_NET_ROOT}/samples"
1213
export PYTHONPATH=${GRAPH_NET_EXTRACT_WORKSPACE}:$PYTHONPATH
1314

1415
[ -z "$CUDA_VISIBLE_DEVICES" ] && CUDA_VISIBLE_DEVICES="0"
@@ -73,6 +74,7 @@ function main() {
7374
check_validation_info=$(check_validation)
7475
check_validation_code=$?
7576
summary_problems $check_validation_code "$check_validation_info"
77+
python ${GRAPH_NET_ROOT}/tools/count_sample.py
7678
LOG "[INFO] check_validation run success and no error!"
7779
}
7880

tools/count_sample.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,20 @@
55
filename = os.path.abspath(__file__)
66
root_dir = os.path.dirname(os.path.dirname(filename))
77
samples_dir = os.path.join(root_dir, "samples")
8+
model_categories = os.listdir(samples_dir)
89

910
graph_net_count = 0
10-
for root, dirs, files in os.walk(samples_dir):
11-
for file in files:
12-
if file == "graph_net.json":
13-
graph_net_count += 1
11+
graph_net_dict = {}
12+
for category in model_categories:
13+
category_dir = os.path.join(samples_dir, category)
14+
if os.path.isdir(category_dir):
15+
graph_net_dict[category] = 0
16+
for root, dirs, files in os.walk(category_dir):
17+
if "graph_net.json" in files:
18+
graph_net_count += 1
19+
graph_net_dict[category] += 1
20+
1421
print(f"Number of graph_net.json files: {graph_net_count}")
22+
for name, number in graph_net_dict.items():
23+
print(f"- {name:24}: {number}")
24+
print()

0 commit comments

Comments
 (0)