File size: 1,244 Bytes
4fcf06b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import datetime, glob, json, os

out = '/workspace/v41-quant/q2-iq2-20260910'
plan = json.load(open(out + '/plan.json'))
shards = plan['shards']
total_q = sum(sum(t['out_bytes'] for t in s['tensors'] if t['role'] == 'quantised') for s in shards)
files = sorted(glob.glob(out + '/*.complete'), key=os.path.getmtime)
done = [os.path.basename(f).replace('.complete', '') for f in files]
q = sum(sum(t['out_bytes'] for t in s['tensors'] if t['role'] == 'quantised') for s in shards if s['output_shard'] in done)
m = [os.path.getmtime(f) for f in files]
recent = [m[j + 1] - m[j] for j in range(max(0, len(m) - 6), len(m) - 1)]
cad = sum(recent) / len(recent) if recent else 0.0
now = datetime.datetime.now(datetime.timezone.utc)
eta_s = cad * (len(shards) - len(done))
abs_t = (now + datetime.timedelta(seconds=eta_s)).strftime('%H:%M')
size = sum(os.path.getsize(out + '/' + s['output_shard']) for s in shards if os.path.exists(out + '/' + s['output_shard']))
total_bytes = sum(s['data_bytes'] for s in shards)
print(f"{now.strftime('%H:%M:%S')}Z shards {len(done)}/{len(shards)}  {q / total_q * 100:.1f}% of quantised bytes  "
      f"{size / 1e9:.1f}/{total_bytes / 1e9:.1f} GB  cadence {cad:.0f}s/shard  ETA {eta_s / 60:.0f} min -> ~{abs_t}Z")