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

Co-authored-by: Yineng Zhang <me@zhyncs.com>
This commit is contained in:
fzyzcjy
2025-10-11 15:59:03 +08:00
committed by GitHub
co-authored by Yineng Zhang
parent 129d299278
commit 21337b22b9
13 changed files with 1065 additions and 178 deletions
+4 -2
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():