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: autoscale shard / batch size #1435

Merged
merged 14 commits into from
Sep 4, 2024
Merged

feat: autoscale shard / batch size #1435

merged 14 commits into from
Sep 4, 2024

Conversation

yuwen01
Copy link
Contributor

@yuwen01 yuwen01 commented Aug 29, 2024

No description provided.

Copy link

github-actions bot commented Aug 29, 2024

SP1 Performance Test Results

Branch: yuwen/ci-lowmem
Commit: 46bf5a12
Author: yuwen01

program cycles execute (mHz) core (kHZ) compress (KHz) time success
fibonacci 11291 0.02 5.83 0.15 1m17s
ssz-withdrawals 2757356 2.69 55.72 22.11 2m55s
tendermint 12593597 4.35 147.13 94.43 3m42s

@yuwen01 yuwen01 requested a review from jtguibas August 29, 2024 18:59
@yuwen01 yuwen01 marked this pull request as ready for review August 29, 2024 19:00
@@ -262,3 +262,38 @@ jobs:
--branch-name "${{ github.head_ref || github.ref_name }}" \
--commit-hash "${{ github.sha }}" \
--author "${{ github.event.pull_request.user.login || github.actor }}"

# Runs on a c7a.2xlarge machine, which only has 16GiB memory.
memory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this low-memory


# Runs on a c7a.2xlarge machine, which only has 16GiB memory.
memory:
name: Memory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low Memory

@@ -262,3 +262,38 @@ jobs:
--branch-name "${{ github.head_ref || github.ref_name }}" \
--commit-hash "${{ github.sha }}" \
--author "${{ github.event.pull_request.user.login || github.actor }}"

# Runs on a c7a.2xlarge machine, which only has 16GiB memory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont' need this comment

@yuwen01 yuwen01 changed the title feat: added low memory ci test feat: autoscale shard / batch size Sep 3, 2024
crates/stark/src/opts.rs Outdated Show resolved Hide resolved
@@ -42,19 +45,47 @@ pub struct SP1CoreOpts {
pub records_and_traces_channel_capacity: usize,
}

// Calculate the default shard size using an empirically determined formula.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

triple slash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u also explain this formula lol

let default_shard_size = shard_size(total_available_mem);
let default_shard_batch_size = shard_batch_size(total_available_mem);

println!("total memory: {total_available_mem} GB");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add random prints to code, use tracing::debug or something

@@ -57,7 +57,7 @@ fn main() {
// It is strongly recommended you use the network prover given the size of these programs.
if args.prove {
println!("Starting proof generation.");
let proof = client.prove(&pk, stdin).compressed().run().expect("Proving should work.");
let proof = client.prove(&pk, stdin).core().run().expect("Proving should work.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u don't need it

@@ -46,7 +46,7 @@ fn main() {

let execute = client.execute(TENDERMINT_ELF, stdin.clone()).run().expect("proving failed");

let proof = client.prove(&pk, stdin).compressed().run().expect("proving failed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid of this change

@yuwen01 yuwen01 merged commit fbdaa88 into dev Sep 4, 2024
10 checks passed
@yuwen01 yuwen01 deleted the yuwen/ci-lowmem branch September 4, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants