Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(runtime, ci): finish migration to bare-metal benchmark runner and update weights #3994

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 13 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,30 @@ jobs:
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake wabt protobuf-compiler wget bzip2
curl -o wasm-opt-linux-x64.tar.gz -L `curl -s https://api.github.com/repos/WebAssembly/binaryen/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-linux")) | .browser_download_url' |grep -v sha256`
tar xzf wasm-opt-linux-x64.tar.gz && sudo mv binaryen-version_*/bin/* /usr/local/bin/
cargo install cargo-script
wasm-opt --version

- name: Run all benchmarks
run: |
./scripts/benchmarking/run_all_benchmarks.sh -c vara-dev -m
INSTANCE_TYPE="${{ inputs.instance_type }}"
INSTANCE_TYPE=${INSTANCE_TYPE} ./scripts/benchmarking/run_all_benchmarks.sh -c vara-dev -m
cp ./scripts/benchmarking/weights-output/* runtime/vara/src/weights

# apply weight adjustments for baremetal runner to `runtime/vara/src/weights/pallet_gear.rs`
if [ "$INSTANCE_TYPE" = "c6i.metal" ]; then
echo "Applying baremetal weight patch"
./scripts/benchmarking/apply_baremetal_weight_patch.rs -i runtime/vara/src/weights/pallet_gear.rs -o runtime/vara/src/weights/pallet_gear_patched.rs
mv runtime/vara/src/weights/pallet_gear_patched.rs runtime/vara/src/weights/pallet_gear.rs
fi

# apply some patches for `pallets/gear/src/weights.rs`
cp runtime/vara/src/weights/pallet_gear.rs pallets/gear/src/weights.rs
sed -i -E 's/\w+::WeightInfo for SubstrateWeight/WeightInfo for SubstrateWeight/' pallets/gear/src/weights.rs

# apply some patches for `pallets/gear-builtin/src/weights.rs`
cp runtime/vara/src/weights/pallet_gear_builtin.rs pallets/gear-builtin/src/weights.rs
sed -i -E 's/\w+::WeightInfo for SubstrateWeight/WeightInfo for SubstrateWeight/' pallets/gear-builtin/src/weights.rs

# generate code for lightweight scheduler that is used in gtest and other crates
./scripts/weight-dump.sh

Expand Down
2 changes: 1 addition & 1 deletion gtest/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ pub mod gbuild {
let manifest_path = etc::find_up("Cargo.toml")
.map_err(|_| Error::GbuildArtifactNotFound("Could not find manifest".into()))?;
let manifest = Manifest::from_path(&manifest_path)
.map_err(|_| Error::GbuildArtifactNotFound("Could not parse mainfest".into()))?;
.map_err(|_| Error::GbuildArtifactNotFound("Could not parse manifest".into()))?;
let target = etc::find_up("target").unwrap_or(
manifest_path
.parent()
Expand Down
118 changes: 59 additions & 59 deletions pallets/gear-builtin/src/weights.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading