[1/2] Optimizations and refactors about quant kernel (#9534)

This commit is contained in:
fzyzcjy
2025-09-05 18:45:08 +08:00
committed by GitHub
parent afd9f2f560
commit 339f8eef09
11 changed files with 996 additions and 329 deletions

View File

@@ -1,4 +1,5 @@
import os
import re
import sys
from contextlib import nullcontext
@@ -108,7 +109,8 @@ def bench_kineto(
if not with_multiple_kernels:
for name in kernel_names:
assert (
sum([name in line for line in prof_lines]) == 1
sum([int(re.search(name, line) is not None) for line in prof_lines])
== 1
), f"Errors of the kernel {name} in the profiling table (table: {prof_lines})"
# Save chrome traces
@@ -122,7 +124,7 @@ def bench_kineto(
total_time = 0
total_num = 0
for line in prof_lines:
if name in line:
if re.search(name, line) is not None:
time_str = line.split()[-2]
num_str = line.split()[-1]
for unit, scale in units.items():