Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
914 B
Python
20 lines
914 B
Python
import sys,collections,statistics
|
|
sys.path.insert(0,"/data/leleka-e2e/decode/tools")
|
|
import lct as L
|
|
t=L.Trace(sys.argv[1])
|
|
byc=collections.defaultdict(list)
|
|
for k in t.kernels: byc[k.corr].append(k)
|
|
big=[c for c,v in byc.items() if len(v)>=900]; big.sort(key=lambda c:min(k.start for k in byc[c])); big=big[2:-2]
|
|
lat=[];sh=[]
|
|
for c in big:
|
|
ks=sorted(byc[c],key=lambda k:k.start)
|
|
db=[k for k in ks if "doorbell_publish" in t.names.get(k.name,"")]
|
|
gu=[k for k in ks if "gu_swiglu" in t.names.get(k.name,"")]
|
|
if len(db)!=48: continue
|
|
for i,d in enumerate(db):
|
|
nxt=db[i+1].start if i+1<48 else 1<<62
|
|
g=[k for k in gu if d.start<k.start<nxt]
|
|
if g: lat.append((g[0].start-d.start)/1e3)
|
|
lat.sort(); n=len(lat)
|
|
print("doorbell start -> first VRAM expert gate/up start (us): n=%d mean %.1f p10 %.1f p50 %.1f p90 %.1f"%(n,statistics.mean(lat),lat[n//10],lat[n//2],lat[9*n//10]))
|