-
Notifications
You must be signed in to change notification settings - Fork 59
feat(new-execution): metered execution #1652
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f62e4f8
feat: add e2 execute functions
shuklaayush 40e3bcf
feat: add harcoded number of interactions
shuklaayush 8ec07bf
feat: add execute_e2 in vm, segment
shuklaayush 07eeac7
fix: use interactions from vkey
shuklaayush 6aa0f38
fix: add logs
shuklaayush d96f798
fix: add heights for periphery chips
shuklaayush 58a7277
feat: add memory metering
shuklaayush 117f892
feat: add exact memory height calculations
shuklaayush 6962c40
fix: move divergence calculation to separate fn
shuklaayush 7194ad7
fix: merge conflict fixes
shuklaayush d5d12e8
feat: add bigint u256 benchmark
shuklaayush c4a0e2e
fix: uncomment benchmarks
shuklaayush f7ba2e4
fix: accurate access adapter height measurement before finalize
shuklaayush da809d6
fix: calculate finalize access adapter rows at the end
shuklaayush ee2a906
Merge remote-tracking branch 'origin/feat/new-execution' into feat/ne…
shuklaayush 8b354e4
fix: undo memory operations during segmentation checks
shuklaayush af5b4e3
fix: clean up code
shuklaayush e381c4d
fix: cleanup
shuklaayush d6c4187
refactor: move execution modes to subdirectory
shuklaayush 2569734
fix: use approximate value of access adapter heights
shuklaayush 7508e82
fix: remove dbg statements
shuklaayush a012aca
chore: rename execute_e2 to execute_metered
shuklaayush bf8df90
feat: add logs on suspension
shuklaayush 77311f9
fix: iterate once
shuklaayush 898ebc7
perf: remove unnecessary vec
shuklaayush 36241ac
fix: remove vec
shuklaayush 50494bb
fix: prev data read shouldn't be traced
shuklaayush 2ac2e3f
fix: make read untraced
shuklaayush File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[workspace] | ||
[package] | ||
name = "openvm-factorial-iterative-u256-program" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] } | ||
openvm-bigint-guest = { path = "../../../extensions/bigint/guest" } | ||
|
||
[features] | ||
default = [] | ||
|
||
[profile.profiling] | ||
inherits = "release" | ||
debug = 2 | ||
strip = false |
Binary file added
BIN
+63.2 KB
benchmarks/guest/factorial_iterative_u256/elf/openvm-factorial-iterative-u256-program.elf
Binary file not shown.
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[app_vm_config.rv32i] | ||
[app_vm_config.rv32m] | ||
[app_vm_config.io] | ||
[app_vm_config.bigint] |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use core::hint::black_box; | ||
use openvm as _; | ||
use openvm_bigint_guest::U256; | ||
|
||
// This will overflow but that is fine | ||
const N: u32 = 65_000; | ||
|
||
pub fn main() { | ||
let mut acc = U256::from_u32(1); | ||
let mut i = U256::from_u32(N); | ||
while i > black_box(U256::ZERO) { | ||
acc *= i.clone(); | ||
i -= U256::from_u32(1); | ||
} | ||
black_box(acc); | ||
} |
Binary file modified
BIN
-72 Bytes
(100%)
benchmarks/guest/fibonacci_iterative/elf/openvm-fibonacci-iterative-program.elf
Binary file not shown.
This file contains hidden or 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,15 +1,15 @@ | ||
use core::hint::black_box; | ||
use openvm as _; | ||
use openvm::io::reveal_u32; | ||
|
||
const N: u64 = 500_000; | ||
const N: u32 = 900_000; | ||
|
||
pub fn main() { | ||
let mut a: u64 = 0; | ||
let mut b: u64 = 1; | ||
let mut a: u32 = 0; | ||
let mut b: u32 = 1; | ||
for _ in 0..black_box(N) { | ||
let c: u64 = a.wrapping_add(b); | ||
let c: u32 = a.wrapping_add(b); | ||
a = b; | ||
b = c; | ||
} | ||
black_box(a); | ||
reveal_u32(a, 0); | ||
} |
Binary file modified
BIN
-88 Bytes
(100%)
benchmarks/guest/fibonacci_recursive/elf/openvm-fibonacci-recursive-program.elf
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.