Skip to content

Commit 4c0fdd2

Browse files
committed
setup link
Signed-off-by: Yang Wang <[email protected]>
1 parent 600bb1a commit 4c0fdd2

File tree

5 files changed

+32
-22
lines changed

5 files changed

+32
-22
lines changed

.ci/scripts/benchmark_tooling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ python3 .ci/scripts/benchmark_tooling/get_benchmark_analysis_data.py \
5252
--endTime "2025-06-17T18:00:00" \
5353
--outputType "excel"
5454

55-
python3 analyze_benchmark_stability.py \
55+
python3 .ci/scripts/benchmark_tooling/analyze_benchmark_stability.py \
5656
--primary-file private.xlsx \
5757
--reference-file public.xlsx
5858
```

.ci/scripts/benchmark_tooling/analyze_benchmark_stability.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import argparse
22
import os
3-
import re
43

54
import matplotlib.pyplot as plt
65
import numpy as np
@@ -16,35 +15,37 @@ def print_section_header(title):
1615
print("=" * 100 + "\n")
1716

1817

19-
def normalize_tab_name(name):
18+
def normalize_name(name):
2019
"""Normalize tab name for better matching"""
2120
# Convert to lowercase and remove spaces
22-
return name.lower().replace(" ", "")
21+
return name.lower().replace(" ", "").replace("(private)", "")
2322

2423

2524
def parse_model_device_config(config):
2625
"""Extract model and device from config"""
2726
model = config.get("model", "")
27+
backend = config.get("backend", "")
28+
full_model = f"{model}({backend})" if backend else model
2829
base_device = config.get("device", "")
2930
os_version = config.get("arch", "")
3031
full_device = f"{base_device}({os_version})" if os_version else base_device
3132
if not base_device:
32-
return model, "unkown", "unknown", ""
33-
return model, full_device, base_device, os_version
33+
return full_model, "unkown", "unknown", ""
34+
return full_model, full_device, base_device, os_version
3435

3536

3637
def is_matching_dataset(primary_sheet, reference_sheet):
3738
"""
3839
Check if two datasets match for comparison based on model and device
3940
Allows different OS versions for the same device
4041
"""
41-
primary_model = primary_sheet.get("model", "")
42-
primary_device = primary_sheet.get("base_device", "")
43-
primary_os = primary_sheet.get("os_version", "")
42+
primary_model = normalize_name(primary_sheet.get("model", ""))
43+
primary_device = normalize_name(primary_sheet.get("base_device", ""))
44+
# primary_os = normalize_name(primary_sheet.get("os_version", ""))
4445

45-
reference_model = reference_sheet.get("model", "")
46-
reference_device = reference_sheet.get("base_device", "")
47-
reference_os = reference_sheet.get("os_version", "")
46+
reference_model = normalize_name(reference_sheet.get("model", ""))
47+
reference_device = normalize_name(reference_sheet.get("base_device", ""))
48+
# reference_os = normalize_name(reference_sheet.get("os_version", ""))
4849

4950
if not primary_model:
5051
print("Warning: Primary sheet {} has no model info, for {primary_model} ")
@@ -82,9 +83,9 @@ def analyze_latency_stability( # noqa: C901
8283

8384
for document in documents:
8485
sheetName = document.get("sheetName", None)
85-
print(f"Loading dataset: {sheetName}")
8686
df = document.get("df", None)
8787
config = document.get("groupInfo", None)
88+
print(f"Loading dataset: {sheetName} with config: {config} ")
8889

8990
if df is None or df.empty:
9091
print(f"Skipping sheet {sheetName} because it has no df data")
@@ -139,14 +140,13 @@ def analyze_latency_stability( # noqa: C901
139140
reference_datasets = {}
140141
if reference_file:
141142
print_section_header("LOADING REFERENCE DATASETS (Public)")
142-
documents = read_excel_with_json_header(primary_file)
143+
documents = read_excel_with_json_header(reference_file)
143144

144145
for document in documents:
145146
sheetName = document.get("sheetName", None)
146-
print(f"Loading dataset: {sheetName}")
147147
df = document.get("df", None)
148148
config = document.get("groupInfo", None)
149-
149+
print(f"Loading dataset: {sheetName} with config:{config}")
150150
if df is None or df.empty:
151151
print(f"Skipping sheet {sheetName} because it has no df data")
152152
continue
@@ -263,7 +263,9 @@ def analyze_latency_stability( # noqa: C901
263263
break
264264

265265
if not found_match:
266-
print(f"Warning: No matching reference dataset for {primary_sheet}")
266+
print(
267+
f"Warning: No matching reference dataset for {primary_sheet} with config: {primary_info['model']}{primary_info['full_device']} "
268+
)
267269

268270
if not matches_found:
269271
print("No matching datasets found between primary and reference files.")

.ci/scripts/benchmark_tooling/get_benchmark_analysis_data.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ def output_data(
302302
logging.info(
303303
f"Generating output with type {output_type}: {[self.matching_groups.keys()]}"
304304
)
305+
305306
o_type = self._to_output_type(output_type)
306307
if o_type == OutputType.PRINT:
307308
logging.info("\n ========= Generate print output ========= \n")
@@ -576,7 +577,10 @@ def _process_private_public_data(self, filters: Optional[BenchmarkFilters]):
576577
public_list = self._filter_public_result(private_list, all_public)
577578

578579
logging.info(
579-
f"Found {len(private_list)} private tables, Found assoicated {len(public_list)} public tables"
580+
f"Found {len(private_list)} private tables, {[item['table_name'] for item in private_list]}"
581+
)
582+
logging.info(
583+
f"Found assoicated {len(public_list)} public tables, {json.dumps([item['table_name'] for item in public_list],indent=2)}"
580584
)
581585

582586
self.matching_groups["private"] = MatchingGroupResult(

backends/xnnpack/third-party/generate-cpuinfo-wrappers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
],
6767
"(defined(__arm__) || defined(__aarch64__)) && defined(TARGET_OS_MAC) && TARGET_OS_MAC": [
6868
"arm/mach/init.c",
69-
],}
69+
],
70+
}
7071

7172

7273
if __name__ == "__main__":
@@ -77,7 +78,10 @@
7778
print(filepath)
7879
os.makedirs(os.path.dirname(filepath))
7980
with open(filepath, "w") as wrapper:
80-
print("/* Auto-generated by generate-wrappers.py script. Do not modify */", file=wrapper)
81+
print(
82+
"/* Auto-generated by generate-wrappers.py script. Do not modify */",
83+
file=wrapper,
84+
)
8185
print(file=wrapper)
8286
print("#ifdef __APPLE__", file=wrapper)
8387
print("\t#include <TargetConditionals.h>", file=wrapper)

extension/llm/custom_ops/spinquant/third-party/FFHT/example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
t2 = timeit.default_timer()
1616

1717
if sys.version_info[0] == 2:
18-
print (t2 - t1 + 0.0) / (reps + 0.0)
18+
print(t2 - t1 + 0.0) / (reps + 0.0)
1919
if sys.version_info[0] == 3:
20-
print('{}'.format((t2 - t1 + 0.0) / (reps + 0.0)))
20+
print("{}".format((t2 - t1 + 0.0) / (reps + 0.0)))

0 commit comments

Comments
 (0)