Skip to content

Commit 164e64b

Browse files
authored
Merge pull request #730 from opentensor/sam-benchmarking
github action to automatically run benchmarking weights on standardized hardware
2 parents 5eb5e93 + d3f13d5 commit 164e64b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/workflows/benchmark-weights.yml

Whitespace-only changes.

scripts/benchmark_all.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
set -ex
3+
4+
# List of pallets you want to benchmark
5+
pallets=("pallet_subtensor" "pallet_collective" "pallet_commitments" "pallet_registry" "pallet_admin_utils")
6+
7+
# Chain spec and output directory
8+
chain_spec="finney" # or your specific chain spec
9+
10+
for pallet in "${pallets[@]}"
11+
do
12+
echo "Benchmarking $pallet..."
13+
cargo run --profile=production --features=runtime-benchmarks,try-runtime --bin node-subtensor -- benchmark pallet \
14+
--chain $chain_spec \
15+
--wasm-execution=compiled \
16+
--pallet $pallet \
17+
--extrinsic '*' \
18+
--steps 50 \
19+
--repeat 5 \
20+
--output "pallets/$pallet/src/weights.rs" \
21+
--template ./.maintain/frame-weight-template.hbs # Adjust this path to your template file
22+
done
23+
24+
echo "All pallets have been benchmarked and weights updated."

0 commit comments

Comments
 (0)