Skip to content
Snippets Groups Projects
Commit 7356cec4 authored by xiyehu2's avatar xiyehu2
Browse files

More stuff to lookat

parent e5da8e40
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,8 @@ import cupy as cp
def test(f_idx, t_idx):
paths, off = get_rearrange_paths(f_idx, t_idx)
create_moving_array_reduced(_sig, _table_cp, paths, off)
create_moving_array_reduced(_table_cp, _sig, f_idx, t_idx)
return cp.asnumpy(_sig)
def count(paths, path_table, off):
......@@ -24,8 +24,8 @@ def count(paths, path_table, off):
return counter
data = np.load("data/table-half_31.npz", allow_pickle=True)
table = data['path_table'].item()
data = np.load("table/table-half_31_120722.npz", allow_pickle=True)
table = data['table'].item()
twzr = data['wfm'].item()
static_sig = data['static_sig']
target = data['target']
......@@ -38,14 +38,18 @@ for key in table:
_table_cp[key] = cp.array(table[key])
n_repeat = 500
_sig = cp.array(static_sig)
times = np.zeros((nt+1,2))
filling_ratio = np.zeros((nt+1,2))
n_move = np.zeros((nt+1,n_repeat))
total_t = np.zeros((nt+1, 2))
gpu_t = np.zeros((nt+1, 2))
cpu_t = np.zeros((nt+1, 2))
filling_ratio = np.zeros((nt+1, 2))
n_move = np.zeros((nt+1, 2))
for i in range(nt+1):
_sig = cp.array(static_sig)
f_prob = i/nt
calc_t = np.zeros(n_repeat)
t_t = np.zeros(n_repeat)
g_t = np.zeros(n_repeat)
c_t = np.zeros(n_repeat)
ratio = np.zeros(n_repeat)
nm = np.zeros(n_repeat)
print(i, f_prob)
......@@ -63,24 +67,31 @@ for i in range(nt+1):
)
# stuff to save
ratio[j] = f_idx.size / nt
calc_t[j] = b.gpu_times + b.cpu_times
g_t[j] = b.gpu_times
c_t[j] = b.cpu_times
t_t[j] = b.gpu_times + b.cpu_times
paths, off = get_rearrange_paths(f_idx, t_idx)
nm[j] = count(paths, _table_cp, off)
# n_move[i,0] = np.mean(nm)
# n_move[i,1] = np.var(nm)
n_move[i] = nm
times[i,0] = np.mean(calc_t)
times[i,1] = np.var(calc_t)
n_move[i,0] = np.mean(nm)
n_move[i,1] = np.var(nm)
gpu_t[i,0] = np.mean(g_t)
gpu_t[i,1] = np.var(g_t)
cpu_t[i,0] = np.mean(c_t)
cpu_t[i,1] = np.var(c_t)
total_t[i,0] = np.mean(t_t)
total_t[i,1] = np.var(t_t)
filling_ratio[i,0] = np.mean(ratio)
filling_ratio[i,1] = np.var(ratio)
np.savez(
f"data/reduced-benchmark_{nt}-half.npz",
f"data/120722_benchmark_{nt}-half_wfm-only.npz",
wfm=twzr,
target=target,
filling_ratio=filling_ratio,
times=times,
times=[gpu_t, cpu_t, total_t],
n_move=n_move
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment