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

rv32im circuit updates #1690

Merged
merged 11 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ jobs:
- check
- check-benchmarks
- check-external
- check-semver
- check-template
- crates-validator
- doc
Expand Down Expand Up @@ -473,5 +472,5 @@ jobs:
key: Linux-default
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION
- run: cargo test -p risc0-groth16 -F docker --release
- run: cargo test -p risc0-zkvm -F prove -F docker -- tests::stark2snark
- run: cargo test -p risc0-zkvm -F prove -F docker -- tests::docker::stark2snark
- run: sccache --show-stats
49 changes: 0 additions & 49 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion risc0/build/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ mod test {
build("../../risc0/zkvm/methods/guest/Cargo.toml");
compare_image_id(
"risc0_zkvm_methods_guest/multi_test",
"7efd4bd6d611bc603477298a6390c3e3eb6f1aaf2a5894ec4e778729b16ae2c4",
"f81791400a474a78347c7d0af931db7cbd2f89c10eddb90e20288d11fc649de6",
);
}
}
12 changes: 5 additions & 7 deletions risc0/build_kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ impl KernelBuild {

fn compile_cuda(&mut self, output: &str) {
println!("cargo:rerun-if-env-changed=RISC0_CUDA_OPT");
println!("cargo:rerun-if-env-changed=NVCC_PREPEND_FLAGS");
println!("cargo:rerun-if-env-changed=NVCC_APPEND_FLAGS");
println!("cargo:rerun-if-env-changed=RISC0_NVCC_FLAGS");
Copy link
Member Author

Choose a reason for hiding this comment

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

@mothran @rlukata Note: this was changed so that by default, -arch=native is used. In order to build for a specific architecture, use RISC0_NVCC_FLAGS instead of NVCC_PREPEND_FLAGS or NVCC_APPEND_FLAGS.


// Note: we default to -O1 because O3 can upwards of 5 hours (or more)
// to compile on the current CUDA toolchain. Using O1 only shows a ~10%
Expand All @@ -146,12 +145,11 @@ impl KernelBuild {
let ptx_opt_level = env::var("RISC0_CUDA_OPT").unwrap_or("1".to_string());

let mut flags = vec![];
if let Some(prepend_flags) = env::var("NVCC_PREPEND_FLAGS").ok() {
flags.push(prepend_flags);
}
flags.push(format!("--ptxas-options=-O{ptx_opt_level}"));
if let Some(append_flags) = env::var("NVCC_APPEND_FLAGS").ok() {
flags.push(append_flags);
if let Ok(nvcc_flags) = env::var("RISC0_NVCC_FLAGS") {
flags.push(nvcc_flags);
} else {
flags.push("-arch=native".into());
}

self.cached_compile(
Expand Down
2 changes: 1 addition & 1 deletion risc0/circuit/recursion/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn download_zkr() {

const FILENAME: &str = "recursion_zkr.zip";
const SRC_PATH: &str = "src/recursion_zkr.zip";
const SHA256_HASH: &str = "3ee890ae3b7c2cf167813fe653ca9b5b8a117bb0a61c1a904f8e6acf62c76251";
const SHA256_HASH: &str = "48d53160fb8d7756667aadc6437120f1d252eb37ca56528877da5c9918cbe4f5";

fn check_sha2(path: &Path) -> bool {
let data = fs::read(path).unwrap();
Expand Down
26 changes: 13 additions & 13 deletions risc0/circuit/recursion/src/control_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/// Merkle root of the RECURSION_CONTROL_IDS
pub const ALLOWED_IDS_ROOT: &str =
"88c1f749250aba181168c33839d7a351671e7a5b7f3e746dde91ef6c6e9ef344";
"54058968ca621b3dfdf22c5d7dc65533ffbc1552e36d8b4437424d037328645e";

pub const RECURSION_CONTROL_IDS: [(&str, &str); 15] = [
(
Expand All @@ -23,51 +23,51 @@ pub const RECURSION_CONTROL_IDS: [(&str, &str); 15] = [
),
(
"join.zkr",
"d6d4e4502b24a53e2097c86b820695196b50214171d1af085cf0d329eda2354c",
"bea76f74072983519b9ca337aae9e653b5468d721b1f9664c7bc2c50fa1fc236",
),
(
"lift_14.zkr",
"e54c9017d3cd7b10f8590a097cc4ee3d309c380bcc9b310ead94587341b4d550",
"1ca9f73882f7b11685e6c6702d41f038ed7cd341b71d97115adaf81e8404873c",
),
(
"lift_15.zkr",
"9119b275ec70de27192e4d324bdb3c4d8a1b9e7137b9170ca0baed0d8bf77d0c",
"55a319417092cc0ee5685455de8551421ef36b3de7cff0391478bf0335c4045e",
),
(
"lift_16.zkr",
"c5be2418325c0314e4bfe822d4c5bc5763abde06b59b7a4c35013e271470280a",
"0e9269332ef0c02843ee796bade0cc1bfa03071a74ec15623f0c766158771166",
),
(
"lift_17.zkr",
"aa78453ab464ed650ac5b70debc4453a2a703e6f83c10755f518bc081926481d",
"b20f380484297d66efbfd930108ea541d734dd1e6189dc1f0f647d10487ca43a",
),
(
"lift_18.zkr",
"d5cdf820ae55b209a2bc1b2b58803c0b85408934fc575c38da42931673e38144",
"202feb2b77a5c4675f02e50843635766dd9a9963d67af608525eab708ed1b023",
),
(
"lift_19.zkr",
"8fd2f733163e846b17a6503ad7070718f49b425c5d6b6a77751e9a221a407d4b",
"c884c54fd8e34558654fcb058e369955d3d75b516469ef5066208b3e4974b609",
),
(
"lift_20.zkr",
"5ae5fb57f4d8ca65e83af3650ce36f00c309267032699b6e9865b21e847f2070",
"f9b12b4707d9a9274665064ca487604e700c561e753b284c151ccc42b5bc5b11",
),
(
"lift_21.zkr",
"9407fc33d5126735f24ec662f156e50e377b45534ab789739145021f752c152a",
"02591155c3ef402f8ca4b45c21491973fe305769e9f12f21c86d15307731643b",
),
(
"lift_22.zkr",
"90027841077ad96250be266855d8506d0164b775bea8c35594ab5a40f9530955",
"f9cb321681130d5d77bf4e013d7ea0220571b75f39499b5a256a64275aa10e6d",
),
(
"lift_23.zkr",
"47d3095f79618d57f3ee9c1bb2046c680a18ab05d062af2e33e6a53d1202063a",
"3b5368352b643730fe48d459ca66fc272de8e46e1dc0d349b98f886cefdd9219",
),
(
"lift_24.zkr",
"1112c0660d6a8c3dc7b2961cfe996815a19fbf2583f2d0639d530826aa67764f",
"758ac221b3f3843dfe5fee23bf3097567f97103c5211e5075f8e151950a0b038",
),
(
"resolve.zkr",
Expand Down
4 changes: 2 additions & 2 deletions risc0/circuit/recursion/src/recursion_zkr.zip
Git LFS file not shown
Loading
Loading