Skip to content

Commit 9182682

Browse files
committed
fix error test
Signed-off-by: Yang Wang <[email protected]>
1 parent d7a6652 commit 9182682

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

.ci/scripts/benchmark_tooling/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ python3 .ci/scripts/benchmark_tooling/get_benchmark_analysis_data.py \
3131
- `--endTime`: End time in ISO format (e.g., "2025-06-17T18:00:00") (required)
3232
- `--env`: Choose environment ("local" or "prod", default: "prod")
3333
- `--no-silent`: Show processing logs (default: only show results & minimum logging)
34-
- `print-all-table-info`: show all cleaned table infos, this helps user to pick the correct format of filters
3534

3635
##### Output Options:
3736
- `--outputType`: Choose output format (default: "print")
@@ -49,15 +48,24 @@ python3 .ci/scripts/benchmark_tooling/get_benchmark_analysis_data.py \
4948
- `--models`: Filter by specific model names (e.g "mv3" "meta-llama-llama-3.2-1b-instruct-qlora-int4-eo8")
5049

5150
#### Example Usage
52-
call multiple private device pools and models
51+
call multiple private device pools and models:
52+
this fetches all the private table data that has model `llama-3.2-1B` and `mv3`
5353
```bash
5454
python3 get_benchmark_analysis_data.py \
5555
--startTime "2025-06-01T00:00:00" \
5656
--endTime "2025-06-11T00:00:00" \
57-
--private-device-pools 'apple_iphone_15_private' 'samsung_s22_private'
58-
--models 'mv3' 'allenai/OLMo-1B-hf'
57+
--private-device-pools 'apple_iphone_15_private' 'samsung_s22_private' \
58+
--models 'meta-llama/Llama-3.2-1B-Instruct-SpinQuant_INT4_EO8' 'mv3'
5959
```
6060

61+
this fetches all the private iphone table data that has model `llama-3.2-1B` and `mv3`, and associated public iphone data
62+
```bash
63+
python3 get_benchmark_analysis_data.py \
64+
--startTime "2025-06-01T00:00:00" \
65+
--endTime "2025-06-11T00:00:00" \
66+
--private-device-pools 'apple_iphone_15_private' \
67+
--models 'meta-llama/Llama-3.2-1B-Instruct-SpinQuant_INT4_EO8' 'mv3'
68+
```
6169
#### Working with Output Files CSV and Excel
6270

6371
You can use methods in `common.py` to convert the file data back to DataFrame format, those methods read the first row in csv/excel file, and return result with format list of {"groupInfo":DICT, "df":df.Dataframe{}} format.

.ci/scripts/benchmark_tooling/common.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ def read_all_csv_with_metadata(folder_path: str) -> List[Dict[str, Any]]:
3838
results.append({"groupInfo": meta, "df": df})
3939
print(f"successfully fetched {len(results)} sheets from {folder_path}")
4040
return results
41+
42+
43+
import logging
44+
logging.basicConfig(level=logging.INFO)
45+
46+
# For Excel files (assuming the Excel file is in the current directory)
47+
file_path = "./private.xlsx"
48+
res = read_excel_with_json_header(file_path)
49+
logging.info(res)

.ci/scripts/benchmark_tooling/get_benchmark_analysis_data.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,8 @@ def _process(
539539
)
540540
self.data = deepcopy(data)
541541

542+
543+
#
542544
private_list = sorted(
543545
(
544546
item
@@ -547,8 +549,9 @@ def _process(
547549
),
548550
key=lambda x: x["table_name"],
549551
)
550-
print(f"Found {len(private_list)} private tables before filtering")
552+
551553
if filters:
554+
logging.info(f"Found {len(private_list)} private tables before filtering")
552555
private_list = self.filter_private_results(private_list, filters)
553556
else:
554557
logging.info("filters is None, using all private results")
@@ -625,7 +628,6 @@ def normalize_string(self, s: str) -> str:
625628
def filter_private_results(
626629
self, all_privates: List[Dict[str, Any]], filters: BenchmarkFilters
627630
):
628-
629631
# fetch all private devices within the time range for samsung and ios
630632
private_devices = self.get_all_private_devices()
631633

@@ -638,6 +640,7 @@ def filter_private_results(
638640
return all_privates
639641

640642
device_ios_match = set()
643+
# hardcoded since we only have 2 device pools, each for iphone and samsung
641644
if "apple_iphone_15_private" in device_pool:
642645
device_ios_match.update(
643646
private_devices[0]
@@ -714,7 +717,6 @@ def argparsers():
714717
nargs="+",
715718
help="Filter results by one or more backend full name(e.g. --backend qlora mv3) (OR logic within backends scope, AND logic with other filter type)",
716719
)
717-
718720
parser.add_argument(
719721
"--private-device-pools",
720722
nargs="+", # allow one or more values

0 commit comments

Comments
 (0)