Skip to content

Commit

Permalink
Stabillization of the Runtime (#839)
Browse files Browse the repository at this point in the history
Runtime and moose v1.0.2 release.
  • Loading branch information
Lex Vorona authored Feb 9, 2022
1 parent 165b4ec commit 96e94a9
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 13 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

## v0.1.2

### Release notes

This is the first "stable" release with a complete set of public APIs.
Future releases are expected to contain instructions for migration from the previous "stable" version.

### Changed

- Symbolic compilation support
- Sufficient primitives to execute AES decryption
- Sufficient primitives to execute custom models, including linear regression and XGBoost decision trees.

### Fixed

- NA
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ ci-ready:
$(MAKE) test-ci

release: ci-ready
cargo release --workspace --skip-publish
cargo release --workspace --no-publish --execute

.PHONY: build pydep pylib install fmt lint test test-long test-ci clean ci-ready release
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ a more extensive test suite we recommend using `make test-long` command.

Follow these steps to release a new version:

0. Make sure `cargo release` is installed (`cargo install cargo-release`)

1. create a new branch from `main`, eg `git checkout -b new-release`

2. run `make release`
Expand Down
2 changes: 1 addition & 1 deletion elk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elk"
version = "0.1.0"
version = "0.1.2"
license = "MIT"
edition = "2018"
authors = []
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "macros"
version = "0.1.0"
version = "0.1.2"
license = "MIT"
edition = "2018"

Expand Down
5 changes: 2 additions & 3 deletions moose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "moose"
version = "0.1.2-alpha.0"
version = "0.1.2"
license = "MIT"
authors = [""]
description = ""
Expand Down Expand Up @@ -38,7 +38,7 @@ paste = "~1.0"
petgraph = "~0.5"
rand = "~0.8"
rand_chacha = "~0.3"
rayon = "1.5"
rayon = "~1.5"
rmp-serde = {version="0.15.5", features=["serde128"] }
serde = { version="~1.0", features=["derive"] }
serde_bytes="~0.11"
Expand All @@ -56,7 +56,6 @@ aes-gcm = "~0.9"
criterion = { version="~0.3", features=["async_tokio"] }
env_logger = "~0.8"
proptest = "~1.0"
rayon = "~1.5"
rstest = "~0.12"

[[bench]]
Expand Down
8 changes: 8 additions & 0 deletions moose/src/compilation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ fn parse_pass(name: &str) -> anyhow::Result<Pass> {
}
}

pub const DEFAULT_PASSES: [Pass; 5] = [
Pass::Typing,
Pass::Symbolic,
Pass::Prune,
Pass::Networking,
Pass::Toposort,
];

pub fn into_pass(passes: &[String]) -> anyhow::Result<Vec<Pass>> {
passes.iter().map(|s| parse_pass(s.as_str())).collect()
}
Expand Down
6 changes: 5 additions & 1 deletion pymoose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pymoose"
version = "0.1.2-alpha.0"
version = "0.1.2"
license = "MIT/Apache-2.0"
authors = [""]
description = ""
Expand All @@ -27,6 +27,10 @@ rmp-serde = "~0.15"
serde = { version="~1.0", features=["derive"] }
serde_bytes="~0.11"

[dev-dependencies]
flate2 = "~1.0"
rstest = "~0.12"

[dependencies.pyo3]
version = "~0.14"

Expand Down
8 changes: 8 additions & 0 deletions pymoose/compatibility/aes-lingreg-logical-0.1.2.moose
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
x = Input{arg_name = "x"}: () -> AesTensor () @Host(player0)
key = Input{arg_name = "key"}: () -> AesKey () @Replicated(player0, player1, player2)
decrypt_0 = Decrypt: (AesKey, AesTensor) -> Tensor<Fixed128(24, 40)> (key, x) @Replicated(player0, player1, player2)
constant_0 = Constant{value = HostFloat64Tensor([[0.12131529]])}: () -> Tensor<Float64> () @Host(player2)
cast_0 = Cast: (Tensor<Float64>) -> Tensor<Fixed128(24, 40)> (constant_0) @Host(player2)
dot_0 = Dot: (Tensor<Fixed128(24, 40)>, Tensor<Fixed128(24, 40)>) -> Tensor<Fixed128(24, 40)> (decrypt_0, cast_0) @Replicated(player0, player1, player2)
cast_1 = Cast: (Tensor<Fixed128(24, 40)>) -> Tensor<Float64> (dot_0) @Host(player1)
output_0 = Output: (Tensor<Float64>) -> Tensor<Float64> (cast_1) @Host(player1)
Binary file not shown.
2 changes: 1 addition & 1 deletion pymoose/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="pymoose",
version="0.1.2-alpha.0", # NOTE: auto-updated during release
version="0.1.2", # NOTE: auto-updated during release
packages=setuptools.find_packages(),
python_requires=">=3.6",
install_requires=[],
Expand Down
29 changes: 29 additions & 0 deletions pymoose/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,32 @@ fn pymoose_bindings(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_wrapped(wrap_pymodule!(moose_runtime))?;
Ok(())
}

#[cfg(test)]
mod compatibility_tests {
use moose::compilation::{compile_passes, DEFAULT_PASSES};
use moose::textual::parallel_parse_computation;
use rstest::rstest;

#[rstest]
#[case("compatibility/aes-lingreg-logical-0.1.2.moose")]
fn test_old_versions_parsing(#[case] path: String) -> Result<(), anyhow::Error> {
let source = std::fs::read_to_string(path)?;
let computation =
parallel_parse_computation(&source, crate::bindings::DEFAULT_PARSE_CHUNKS)?;
let _ = compile_passes(&computation, &DEFAULT_PASSES)?;
Ok(())
}

#[rstest]
#[case("compatibility/aes-lingreg-physical-0.1.2.moose.gz")]
fn test_old_versions_parsing_gzip(#[case] path: String) -> Result<(), anyhow::Error> {
use flate2::read::GzDecoder;
use std::io::Read;
let mut decoder = GzDecoder::new(std::fs::File::open(path)?);
let mut source = String::new();
decoder.read_to_string(&mut source)?;
let _ = parallel_parse_computation(&source, crate::bindings::DEFAULT_PARSE_CHUNKS)?;
Ok(())
}
}
10 changes: 5 additions & 5 deletions release.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
disable-publish = true
disable-tag = true
disable-push = true
publish = false
tag = false
push = false
pre-release-commit-message = "release {{version}} of {{crate_name}}"
post-release-commit-message = "starting {{next_version}} of {{crate_name}}"
pre-release-replacements = [
{file="pymoose/setup.py", search="version=\"[a-z0-9\\.-]+\"", replace="version=\"{{version}}\"", exactly=1},
{file="../pymoose/setup.py", search="version=\"[a-z0-9\\.-]+\"", replace="version=\"{{version}}\"", exactly=1},
]
post-release-replacements = [
{file="pymoose/setup.py", search="version=\"[0-9\\.]+\"", replace="version=\"{{next_version}}\"", exactly=1},
{file="../pymoose/setup.py", search="version=\"[0-9\\.]+\"", replace="version=\"{{next_version}}\"", exactly=1},
]

0 comments on commit 96e94a9

Please sign in to comment.