Skip to content

Commit cfd47b6

Browse files
authored
Add detail of sample statistics for different model category and call it in ci. (#162)
1 parent 2ddb2a5 commit cfd47b6

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-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: 4 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"
@@ -17,6 +18,7 @@ function prepare_env() {
1718
git config --global --add safe.directory "*"
1819
num_changed_samples=$(git diff --name-only develop | grep -E "samples/(.*\.py|.*\.json)" | wc -l)
1920
if [ ${num_changed_samples} -eq 0 ]; then
21+
python ${GRAPH_NET_ROOT}/tools/count_sample.py
2022
LOG "[INFO] This pull request doesn't change any samples, skip the CI."
2123
exit 0
2224
fi
@@ -73,6 +75,7 @@ function main() {
7375
check_validation_info=$(check_validation)
7476
check_validation_code=$?
7577
summary_problems $check_validation_code "$check_validation_info"
78+
python ${GRAPH_NET_ROOT}/tools/count_sample.py
7679
LOG "[INFO] check_validation run success and no error!"
7780
}
7881

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)