Skip to content

Commit dbc136c

Browse files
committed
Add debug print statements to generate_proofs for matrix dimensions and encoding. Limit proof generation to one iteration for testing purposes.
1 parent a6a7216 commit dbc136c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/zklora/zk_proof_generator.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,16 @@ async def generate_proofs(
254254
m = W.shape[0]
255255
n = W.shape[1]
256256

257+
print("m =", m, "n =", n)
258+
257259
print("A.shape =", A.shape, " B.shape =", B.shape)
258260
print("W.shape =", W.shape)
259261

260262
W = W.tolist()
261263
W_encoded = [fixed_point_encode(row, fractional_bits=24) for row in W]
262264

265+
print("W_encoded.shape =", len(W_encoded), len(W_encoded[0]))
266+
263267
# Read input data
264268
with open(json_path, "r") as f:
265269
input_data = json.load(f)
@@ -269,16 +273,20 @@ async def generate_proofs(
269273
x_2d = x.reshape(-1, m) # shape: (batch*seq_len, W.shape[0])
270274
print("batch x tokens × hidden:", x_2d.shape)
271275

276+
count_proofs = 0
272277
for i in range(len(x_2d)):
273278
v = x_2d[i].tolist()
274279
v_encoded = fixed_point_encode(v, fractional_bits=24)
280+
print("v_encoded.shape =", len(v_encoded))
275281
start_time = time.time()
276282
pl.vector_matrix_multiplication_prove(m, n, v_encoded, W_encoded)
277283
end_time = time.time()
278284
if verbose:
279285
print(f"Proof gen took {end_time - start_time:.2f} sec")
280286
total_prove_time += end_time - start_time
281-
287+
count_proofs += 1
288+
if count_proofs >= 1:
289+
break
282290

283291
else:
284292
raise ValueError(f"Invalid ZK backend: {zk_backend}")

0 commit comments

Comments
 (0)