Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0433c4d
Update benchmark_all.sh
JohnReedV Apr 22, 2025
06bae13
Create run-benchmarks.yml
JohnReedV Apr 22, 2025
acc47b8
revert benchmark_all change
JohnReedV Apr 22, 2025
0d72063
Create benchmark_action.sh
JohnReedV Apr 23, 2025
ba16a0e
Update run-benchmarks.yml
JohnReedV Apr 23, 2025
8c81059
benchmarks
JohnReedV Apr 23, 2025
d02d955
rename action to run-benchmarks
JohnReedV Apr 23, 2025
23e3ce3
benchmark_action
JohnReedV Apr 23, 2025
64d5af2
update set_weights weight
JohnReedV Apr 23, 2025
d39a8d3
remove zero weights
JohnReedV Apr 23, 2025
7215000
remove zero weights
JohnReedV Apr 23, 2025
61115be
update weights based on CI results
JohnReedV Apr 23, 2025
d768103
Update weights
JohnReedV Apr 23, 2025
e909c18
bump CI
JohnReedV Apr 23, 2025
5b0c215
fix action
JohnReedV Apr 23, 2025
fae4d14
Update run-benchmarks.yml
JohnReedV Apr 23, 2025
2051da8
update weight
JohnReedV Apr 23, 2025
5ca2728
update benchmark action logs
JohnReedV Apr 23, 2025
46b8efd
update weight
JohnReedV Apr 23, 2025
d6a4bc2
update reads/writes
JohnReedV Apr 23, 2025
d6d4585
check reads/writes in benchmark_action
JohnReedV Apr 23, 2025
e41ce59
update logs
JohnReedV Apr 23, 2025
9d00e29
better script checking and logs
JohnReedV Apr 23, 2025
9c0c309
update some reads/writes
JohnReedV Apr 23, 2025
01f5b5b
update more reads/writes
JohnReedV Apr 23, 2025
4a4c377
script now checks reads_writes() too
JohnReedV Apr 23, 2025
3e8dde3
add missing reads
JohnReedV Apr 23, 2025
f03ec00
update reads/writes
JohnReedV Apr 23, 2025
e5db751
add a write
JohnReedV Apr 23, 2025
2862d48
fix dispatch tests
JohnReedV Apr 23, 2025
3d18613
fix dispatch test
JohnReedV Apr 23, 2025
b50e21a
Merge branch 'devnet-ready' into benchmark-action
JohnReedV Apr 24, 2025
f5fc675
fix new benchmarks
JohnReedV Apr 24, 2025
f352b04
update weights
JohnReedV Apr 24, 2025
b5f3bab
fix another weight
JohnReedV Apr 24, 2025
74ebb55
skip-validate-benchmarks
JohnReedV Apr 24, 2025
9cac728
bump CI
JohnReedV Apr 24, 2025
649ecc9
test CI
JohnReedV Apr 24, 2025
22d7b3b
Update dispatches.rs
JohnReedV Apr 24, 2025
db946dd
test CI
JohnReedV Apr 24, 2025
6c0f7b1
revert
JohnReedV Apr 24, 2025
cd7e7f0
bump CI
JohnReedV Apr 24, 2025
eca9583
add retry logic
JohnReedV Apr 24, 2025
f0cd9c6
read all numbers correctly
JohnReedV Apr 24, 2025
cfc6cb8
fix number parsing bug
JohnReedV Apr 24, 2025
c1b24e5
update some reads
JohnReedV Apr 24, 2025
1fc7513
Merge branch 'devnet-ready' into benchmark-action
JohnReedV Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/run-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/benchmarks.yml
name: Validate-Benchmarks

on:
pull_request:
workflow_dispatch:

concurrency:
group: run-benchmarks-${{ github.ref }}
cancel-in-progress: true

jobs:
validate-benchmarks:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-validate-benchmarks') }}
runs-on: SubtensorCI
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
key: bench-${{ hashFiles('**/Cargo.lock') }}

- name: Build node with benchmarks
run: |
cargo build --profile production -p node-subtensor --features runtime-benchmarks

- name: Run & validate benchmarks
run: |
chmod +x scripts/benchmark_action.sh
./scripts/benchmark_action.sh
5 changes: 4 additions & 1 deletion pallets/subtensor/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ benchmarks! {
let seed : u32 = 1;

Subtensor::<T>::init_new_network(netuid, tempo);

SubtokenEnabled::<T>::insert(netuid, true);
Subtensor::<T>::set_burn(netuid, 1);
Subtensor::<T>::set_network_registration_allowed( netuid, true );

Expand Down Expand Up @@ -175,6 +175,7 @@ benchmarks! {

Subtensor::<T>::init_new_network(netuid, tempo);
Subtensor::<T>::set_network_registration_allowed( netuid, true );
SubtokenEnabled::<T>::insert(netuid, true);

Subtensor::<T>::set_max_allowed_uids( netuid, 4096 );
assert_eq!(Subtensor::<T>::get_max_allowed_uids(netuid), 4096);
Expand Down Expand Up @@ -216,6 +217,7 @@ benchmarks! {

Subtensor::<T>::init_new_network(netuid, tempo);
Subtensor::<T>::set_network_registration_allowed( netuid, true );
SubtokenEnabled::<T>::insert(netuid, true);

Subtensor::<T>::set_max_allowed_uids( netuid, 4096 );
assert_eq!(Subtensor::<T>::get_max_allowed_uids(netuid), 4096);
Expand Down Expand Up @@ -247,6 +249,7 @@ benchmarks! {
let seed : u32 = 1;

Subtensor::<T>::init_new_network(netuid, tempo);
SubtokenEnabled::<T>::insert(netuid, true);
Subtensor::<T>::set_burn(netuid, 1);
Subtensor::<T>::set_network_registration_allowed( netuid, true );
Subtensor::<T>::set_max_allowed_uids( netuid, 4096 );
Expand Down
Loading