-
Notifications
You must be signed in to change notification settings - Fork 23
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] support custom segmentation strategy #1245
Conversation
@@ -27,6 +29,40 @@ use crate::{ | |||
/// Check segment every 100 instructions. | |||
const SEGMENT_CHECK_INTERVAL: usize = 100; | |||
|
|||
const DEFAULT_MAX_SEGMENT_LEN: usize = (1 << 22) - 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from #1217
crates/vm/src/arch/segment.rs
Outdated
const DEFAULT_MAX_CELLS_PER_CHIP_IN_SEGMENT: usize = DEFAULT_MAX_SEGMENT_LEN * 120; | ||
|
||
pub trait SegmentationStrategy { | ||
fn should_segment(&self, trace_heights: &[usize], trace_cells: &[usize]) -> bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's more general to take the chip_complex as the input, but that has some generic types and I wasn't able to get it work with Arc<dyn>
.
Do we think there are other information needed to determine if one should segment?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -59,6 +59,16 @@ impl<VC> ContinuationProver<VC> { | |||
self | |||
} | |||
|
|||
pub fn set_max_segment_len(&mut self, max_segment_len: usize) -> &mut Self { | |||
self.stark_prover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should refactor somehow
This comment has been minimized.
This comment has been minimized.
@@ -67,8 +67,7 @@ impl NativeConfig { | |||
..Default::default() | |||
}, | |||
num_public_values, | |||
) | |||
.with_max_segment_len((1 << 24) - 100), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm i am not sure where should put this.
It might be more ideal for this segment strategy to be vm_config so all the "config values" are in one place... but couldn't not make it serde
Commit: 7bf930d |
for #1254 |
based on discussion from #1217
fix INT-3005