-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #565 from opentensor/production-profile
Document production profile
- Loading branch information
Showing
9 changed files
with
148 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
cargo build --release --features runtime-benchmarks | ||
./target/release/node-subtensor benchmark pallet \ | ||
--chain=local \ | ||
--execution=wasm \ | ||
--wasm-execution=compiled \ | ||
--pallet=pallet_admin_utils \ | ||
--extrinsic="*" \ | ||
--steps 50 \ | ||
--repeat 20 \ | ||
--output=pallets/admin-utils/src/weights.rs \ | ||
--template=./.maintain/frame-weight-template.hbs | ||
cargo build --profile production --features runtime-benchmarks | ||
./target/production/node-subtensor benchmark pallet \ | ||
--chain=local \ | ||
--pallet=pallet_admin_utils \ | ||
--extrinsic="*" \ | ||
--steps 50 \ | ||
--repeat 20 \ | ||
--output=pallets/admin-utils/src/weights.rs \ | ||
--template=./.maintain/frame-weight-template.hbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
cargo build --release --features runtime-benchmarks | ||
./target/release/node-subtensor benchmark pallet \ | ||
--chain=local \ | ||
--execution=wasm \ | ||
--wasm-execution=compiled \ | ||
--pallet=pallet_commitments \ | ||
--extrinsic="*" \ | ||
--output=pallets/commitments/src/weights.rs \ | ||
--template=./.maintain/frame-weight-template.hbs | ||
cargo build --profile production --features runtime-benchmarks | ||
./target/production/node-subtensor benchmark pallet \ | ||
--chain=local \ | ||
--pallet=pallet_commitments \ | ||
--extrinsic="*" \ | ||
--output=pallets/commitments/src/weights.rs \ | ||
--template=./.maintain/frame-weight-template.hbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
cargo build --release --features runtime-benchmarks | ||
./target/release/node-subtensor benchmark pallet \ | ||
--chain=local \ | ||
--execution=wasm \ | ||
--wasm-execution=compiled \ | ||
--pallet=pallet_registry \ | ||
--extrinsic="*" \ | ||
--output=pallets/registry/src/weights.rs \ | ||
--template=./.maintain/frame-weight-template.hbs | ||
./target/production/node-subtensor benchmark pallet \ | ||
--chain=local \ | ||
--pallet=pallet_registry \ | ||
--extrinsic="*" \ | ||
--output=pallets/registry/src/weights.rs \ | ||
--template=./.maintain/frame-weight-template.hbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
DEFAULT_BIN_PATH='./target/release/node-subtensor' | ||
DEFAULT_BIN_PATH='./target/production/node-subtensor' | ||
BIN_PATH=$DEFAULT_BIN_PATH | ||
TMP_SPEC='temp.json' | ||
OUTPUT_FILE='benchmarking.txt' | ||
|
||
|
||
# Getting arguments from user | ||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-p|--bin-path) | ||
BIN_PATH="$2" | ||
shift | ||
shift | ||
;; | ||
-*|--*) | ||
echo "Unknown option $1" | ||
exit 1 | ||
;; | ||
*) | ||
POSITIONAL_ARGS+=("$1") | ||
shift | ||
;; | ||
-p | --bin-path) | ||
BIN_PATH="$2" | ||
shift | ||
shift | ||
;; | ||
-* | --*) | ||
echo "Unknown option $1" | ||
exit 1 | ||
;; | ||
*) | ||
POSITIONAL_ARGS+=("$1") | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
# Ensure binary exists before node-subtensor executions | ||
if [ ! -f $BIN_PATH ]; then | ||
if [[ "$DEFAULT_BIN_PATH" == "$BIN_PATH" ]]; then | ||
cargo build --release --features runtime-benchmarks | ||
else | ||
echo "Binary '$BIN_PATH' does not exist. You can use -p or --bin-path to specify a different location." | ||
exit 1 | ||
fi | ||
if [[ "$DEFAULT_BIN_PATH" == "$BIN_PATH" ]]; then | ||
cargo build --profile production --features runtime-benchmarks | ||
else | ||
echo "Binary '$BIN_PATH' does not exist. You can use -p or --bin-path to specify a different location." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Build Temporary Spec | ||
$BIN_PATH build-spec --disable-default-bootnode --raw --chain local > $TMP_SPEC | ||
$BIN_PATH build-spec --disable-default-bootnode --raw --chain local >$TMP_SPEC | ||
|
||
# Run benchmark | ||
$BIN_PATH benchmark pallet \ | ||
--chain=$TMP_SPEC \ | ||
--execution=native --wasm-execution=compiled \ | ||
--pallet pallet-subtensor --extrinsic 'benchmark_dissolve_network' \ | ||
--output $OUTPUT_FILE | ||
--chain=$TMP_SPEC \ | ||
--pallet pallet-subtensor --extrinsic 'benchmark_dissolve_network' \ | ||
--output $OUTPUT_FILE | ||
|
||
rm $TMP_SPEC | ||
rm $TMP_SPEC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
cargo build --release --features runtime-benchmarks | ||
cargo build --profile production --features runtime-benchmarks | ||
|
Oops, something went wrong.