Skip to content

Commit 496515a

Browse files
committed
update
1 parent b6ad6af commit 496515a

File tree

6 files changed

+403
-282
lines changed

6 files changed

+403
-282
lines changed

.github/ci_expected_accuracy/check_expected.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_test_result(data, suite, dtype, mode, model):
3131
data: JSON data containing test results
3232
suite: Test suite name
3333
dtype: Data type
34-
mode: Inference or training mode
34+
mode: Inference or training mode
3535
model: Model name
3636
3737
Returns:
@@ -91,7 +91,7 @@ def update_reference_dataframe(refer_data, model_name, dtype, accuracy):
9191
refer_data.loc[mask, dtype] = accuracy
9292
else:
9393
new_row = {'name': model_name, dtype: accuracy}
94-
refer_data = pd.concat([refer_data, pd.DataFrame([new_row])],
94+
refer_data = pd.concat([refer_data, pd.DataFrame([new_row])],
9595
ignore_index=True)
9696
return refer_data
9797

@@ -155,13 +155,13 @@ def main():
155155
description="Accuracy Check",
156156
formatter_class=argparse.ArgumentDefaultsHelpFormatter
157157
)
158-
parser.add_argument("--driver", type=str, default="rolling",
158+
parser.add_argument("--driver", type=str, default="rolling",
159159
help="rolling or lts")
160-
parser.add_argument("--category", type=str, default="inductor",
160+
parser.add_argument("--category", type=str, default="inductor",
161161
help="inductor")
162-
parser.add_argument("--suite", type=str, required=True,
162+
parser.add_argument("--suite", type=str, required=True,
163163
help="huggingface, timm_models or torchbench")
164-
parser.add_argument("--mode", type=str, required=True,
164+
parser.add_argument("--mode", type=str, required=True,
165165
help="inference or training")
166166
parser.add_argument("--dtype", type=str, required=True,
167167
help="float32, bfloat16, float16, amp_bf16 or amp_fp16")
@@ -214,7 +214,7 @@ def main():
214214
known_accuracy = get_test_result(test_known_data, suite, dtype, mode, model_name)
215215

216216
# Debug print (optional)
217-
print(f"{model_name}: test={test_accuracy}, ref={refer_accuracy}, known={known_accuracy}")
217+
# print(f"{model_name}: test={test_accuracy}, ref={refer_accuracy}, known={known_accuracy}")
218218

219219
# Categorize model and determine if reference needs update
220220
category, should_update = categorize_model(

.github/scripts/calculate_best_perf.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def create_new_row(category, model, value_type, value, args_dict):
118118
}
119119

120120

121-
def update_best_performance(best_data, category, model, value_type,
121+
def update_best_performance(best_data, category, model, value_type,
122122
new_value, args_dict):
123123
"""
124124
Update best performance data with new value if better.
@@ -149,7 +149,7 @@ def update_best_performance(best_data, category, model, value_type,
149149
# Add new row
150150
new_row = create_new_row(category, model, value_type, new_value, args_dict)
151151
best_data = pd.concat([
152-
best_data,
152+
best_data,
153153
pd.DataFrame([new_row])
154154
], ignore_index=True)
155155

@@ -162,25 +162,25 @@ def main():
162162
description="Get Best Performance",
163163
formatter_class=argparse.ArgumentDefaultsHelpFormatter
164164
)
165-
parser.add_argument("--best", required=True,
165+
parser.add_argument("--best", required=True,
166166
help="Saved best performance file")
167-
parser.add_argument("--new", required=True,
167+
parser.add_argument("--new", required=True,
168168
help="New performance results directory")
169-
parser.add_argument("--device", type=str,
169+
parser.add_argument("--device", type=str,
170170
help="Device name, such as PVC1100")
171-
parser.add_argument("--os", type=str,
171+
parser.add_argument("--os", type=str,
172172
help="OS version, such as Ubuntu 22.04")
173-
parser.add_argument("--driver", type=str,
173+
parser.add_argument("--driver", type=str,
174174
help="Driver version, such as 25.05.32567")
175-
parser.add_argument("--oneapi", type=str,
175+
parser.add_argument("--oneapi", type=str,
176176
help="OneAPI version, such as 2025.1")
177-
parser.add_argument("--gcc", type=str,
177+
parser.add_argument("--gcc", type=str,
178178
help="GCC version, such as 11")
179-
parser.add_argument("--python", type=str,
179+
parser.add_argument("--python", type=str,
180180
help="Python version, such as 3.10")
181-
parser.add_argument("--pytorch", type=str,
181+
parser.add_argument("--pytorch", type=str,
182182
help="PyTorch version")
183-
parser.add_argument("--torch-xpu-ops", type=str,
183+
parser.add_argument("--torch-xpu-ops", type=str,
184184
help="Torch XPU Ops version")
185185

186186
args = parser.parse_args()
@@ -223,7 +223,7 @@ def main():
223223

224224
for new_file in new_files:
225225
category = multiple_replace(new_file)
226-
print(f"Processing category: {category}")
226+
# print(f"Processing category: {category}")
227227

228228
try:
229229
new_data = pd.read_csv(new_file)
@@ -235,7 +235,7 @@ def main():
235235
# Process eager performance
236236
eager_perf = row["abs_latency"] * row["speedup"]
237237
best_data = update_best_performance(
238-
best_data, category, model_name, "eager",
238+
best_data, category, model_name, "eager",
239239
eager_perf, system_config
240240
)
241241

.github/scripts/e2e_summary.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set -euo pipefail
55
# Script: test_results_processor.sh
66
# Description: Process accuracy and performance test results for XPU operations
77

8-
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
readonly script_path="$(dirname "${BASH_SOURCE[0]}")"
9+
readonly SCRIPT_DIR="$(cd "$script_path" && pwd)"
910
readonly SCRIPT_NAME="$(basename "$0")"
1011

1112
# Constants
@@ -121,22 +122,22 @@ parse_test_results() {
121122
total = passed = pass_rate = failed = xfail = timeout = 0
122123
new_passed = new_enabled = not_run = 0
123124
}
124-
/Total/ { total = $3 }
125-
/Passed/ { passed = $3 }
126-
/Pass rate/ { pass_rate = $3 }
127-
/Real failed/ { failed = format_count($4, "🔴") }
128-
/Expected failed/ { xfail = format_count($4, "🔵") }
129-
/timeout/ { timeout = format_count($4, "🟡") }
130-
/Failed to passed/ { new_passed = format_count($5, "🟢") }
131-
/Not run/ { not_run = $4 }
132-
/New models/ { new_enabled = format_count($3, "🔵") }
125+
/Total models:/ { total = $3 }
126+
/Passed models:/ { passed = $3 }
127+
/Pass rate:/ { pass_rate = $3 }
128+
/Real failed models:/ { failed = format_count($4, "🔴") }
129+
/Expected failed models:/ { xfail = format_count($4, "🔵") }
130+
/Warning timeout models:/ { timeout = format_count($4, "🟡") }
131+
/Failed to passed models:/ { new_passed = format_count($5, "🟢") }
132+
/Not run.in models:/ { not_run = $4 }
133+
/New models:/ { new_enabled = format_count($3, "🔵") }
133134
134135
function format_count(count, icon) {
135136
return count > 0 ? icon count : count
136137
}
137138
138139
END {
139-
printf "%s | %s | %s | %s | %s | %s | %s | %s | %s",
140+
printf "%s | %s | %s | %s | %s | %s | %s | %s | %s",
140141
total, passed, pass_rate, failed, xfail, timeout, new_passed, new_enabled, not_run
141142
}'
142143
}
@@ -241,10 +242,10 @@ get_model_result() {
241242
determine_color() {
242243
local tmp_file="$1" model="$2"
243244
grep -w "$model" "$tmp_file" | awk '
244-
/Real failed/ { print "🔴"; exit }
245-
/Expected failed|New models/ { print "🔵"; exit }
246-
/Warning timeout/ { print "🟡"; exit }
247-
/Failed to passed/ { print "🟢"; exit }
245+
/Real failed models:/ { print "🔴"; exit }
246+
/Expected failed models:|New models:/ { print "🔵"; exit }
247+
/Warning timeout models:/ { print "🟡"; exit }
248+
/Failed to passed models:/ { print "🟢"; exit }
248249
{ print "black" }
249250
' | head -1
250251
}
@@ -329,7 +330,7 @@ generate_header() {
329330
330331
#### Note:
331332
🔴: Failed cases needing investigation
332-
🟢: New passed cases needing reference update
333+
🟢: New passed cases needing reference update
333334
🔵: Expected failed or new enabled cases
334335
🟡: Warning cases
335336
Empty: Cases not run

.github/scripts/get_issue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def main():
9999
# Time the operation
100100
issues_data = get_github_issues(
101101
repo_owner=args.repo_owner,
102-
repo_name=args.repo_name,
102+
repo_name=args.repo_name,
103103
labels=args.labels,
104104
state=args.state
105105
)

.github/scripts/lintrunner.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
set -ex
33

44
# Creat a venv for lint check
5-
python3 -m venv lint
5+
curl -LsSf https://astral.sh/uv/install.sh | sh
6+
source $HOME/.local/bin/env
7+
uv venv lint --python 3.12 --clear
68
source lint/bin/activate
7-
python3 -m pip install -U pip setuptools wheel
9+
uv pip install -U pip setuptools wheel
810

911
# Use uv to speed up lintrunner init
10-
python3 -m pip install uv==0.1.45
11-
python3 -m pip install ruamel.yaml
12+
uv pip install ruamel.yaml
1213

1314
CACHE_DIRECTORY="/tmp/.lintbin"
1415
# Try to recover the cached binaries
@@ -20,7 +21,7 @@ fi
2021

2122
# if lintrunner is not installed, install it
2223
if ! command -v lintrunner &> /dev/null; then
23-
python3 -m pip install lintrunner==0.12.7
24+
uv pip install lintrunner
2425
fi
2526

2627
# Ignoring errors in one specific run
@@ -37,8 +38,8 @@ if [[ "${CLANG}" == "1" ]]; then
3738
echo "Please run the checker under pytorch source code folder"
3839
fi
3940
fi
40-
#python3 -m tools.generate_torch_version --is_debug=false
41-
#python3 -m tools.pyi.gen_pyi \
41+
#uv tools.generate_torch_version --is_debug=false
42+
#uv tools.pyi.gen_pyi \
4243
# --native-functions-path aten/src/ATen/native/native_functions.yaml \
4344
# --tags-path aten/src/ATen/native/tags.yaml \
4445
# --deprecated-functions-path "tools/autograd/deprecated.yaml"

0 commit comments

Comments
 (0)