Skip to content

Commit b81e63f

Browse files
committed
Merge branch 'main' into gpu_integration
2 parents b37b649 + ba282a0 commit b81e63f

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/benchmark-gpu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ concurrency:
3333
cancel-in-progress: true
3434

3535
env:
36-
# Vast offer search: RTX 5090, >=16 cores, >=64GB RAM, >=64GB disk, verified +
36+
# Vast offer search: RTX 5090, >=16 cores, >=96GB RAM, >=64GB disk, verified +
3737
# rentable, Blackwell-capable driver, <= cap.
3838
GPU_NAME: RTX_5090
3939
PRICE_CAP: "1"
@@ -169,7 +169,7 @@ jobs:
169169
MIN_DRIVER: "580"
170170
run: |
171171
# cpu_ram filter is in GB.
172-
QUERY="gpu_name=${GPU_NAME} num_gpus=1 cpu_cores_effective>=16 cpu_ram>=64 disk_space>=64 verified=true rentable=true cuda_max_good>=12.8 dph_total<=${PRICE_CAP}"
172+
QUERY="gpu_name=${GPU_NAME} num_gpus=1 cpu_cores_effective>=16 cpu_ram>=96 disk_space>=64 verified=true rentable=true cuda_max_good>=12.8 dph_total<=${PRICE_CAP}"
173173
echo "Query: $QUERY (+ client-side driver_version major >= $MIN_DRIVER)"
174174
# Keep only offers whose driver major >= MIN_DRIVER, then most expensive first
175175
# (within the price cap) — premium hosts have faster disks/network (quicker image
@@ -190,7 +190,7 @@ jobs:
190190
sleep "$OFFER_INTERVAL"
191191
done
192192
if [ -z "$OFFER_ID" ]; then
193-
echo "::error::No RTX 5090 offer matched after $OFFER_ATTEMPTS attempts (>=16 cores, >=64GB RAM, >=64GB disk, driver>=${MIN_DRIVER}, <= \$${PRICE_CAP}/hr)"
193+
echo "::error::No RTX 5090 offer matched after $OFFER_ATTEMPTS attempts (>=16 cores, >=96GB RAM, >=64GB disk, driver>=${MIN_DRIVER}, <= \$${PRICE_CAP}/hr)"
194194
exit 1
195195
fi
196196
echo "id=$OFFER_ID" >> "$GITHUB_OUTPUT"

crypto/math-cuda/tests/merkle_root_parity.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ fn gpu_merkle_root(columns: &[Vec<u64>], blowup: usize, weights: &[u64]) -> [u8;
5555
}
5656
}
5757

58-
// Per-row leaves (rows_per_leaf = 1): this parity test compares the generic
59-
// keccak-leaves + Merkle primitives against a per-row CPU reference.
60-
let gpu_leaves = math_cuda::merkle::keccak_leaves_base(&flat, n_lde, num_cols, n_lde, 1)
58+
// Row-pair leaves (rows_per_leaf = 2, matching `ROWS_PER_LEAF`): the CPU
59+
// reference is `commit_rows_bit_reversed`, which hashes bit-reversed row
60+
// pairs into each leaf, so the generic GPU keccak-leaves + Merkle path must
61+
// use the same row-pair layout to produce a matching root.
62+
let gpu_leaves = math_cuda::merkle::keccak_leaves_base(&flat, n_lde, num_cols, n_lde, 2)
6163
.expect("GPU keccak leaves");
6264
let nodes =
6365
math_cuda::merkle::build_merkle_tree_on_device(&gpu_leaves).expect("GPU Merkle tree");
@@ -191,8 +193,10 @@ fn gpu_ext3_merkle_root(columns: &[Vec<Fp3>], blowup: usize, weights: &[u64]) ->
191193
}
192194
}
193195

196+
// Row-pair leaves (rows_per_leaf = 2, matching `ROWS_PER_LEAF`) to match the
197+
// row-pair `commit_rows_bit_reversed` CPU reference below.
194198
let gpu_leaves =
195-
math_cuda::merkle::keccak_leaves_ext3(&flat_for_keccak, lde_size, num_cols, lde_size, 1)
199+
math_cuda::merkle::keccak_leaves_ext3(&flat_for_keccak, lde_size, num_cols, lde_size, 2)
196200
.expect("GPU ext3 keccak leaves");
197201
let nodes =
198202
math_cuda::merkle::build_merkle_tree_on_device(&gpu_leaves).expect("GPU Merkle tree");

0 commit comments

Comments
 (0)