-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
392 additions
and
106 deletions.
There are no files selected for viewing
This file contains 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 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 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,59 @@ | ||
max_width = 100 | ||
hard_tabs = false | ||
tab_spaces = 2 | ||
newline_style = "Auto" | ||
use_small_heuristics = "Default" | ||
indent_style = "Block" | ||
wrap_comments = false | ||
comment_width = 80 | ||
normalize_comments = false | ||
format_strings = false | ||
format_macro_matchers = false | ||
format_macro_bodies = true | ||
empty_item_single_line = true | ||
struct_lit_single_line = true | ||
fn_single_line = false | ||
where_single_line = false | ||
imports_indent = "Block" | ||
imports_layout = "Mixed" | ||
merge_imports = true | ||
reorder_imports = true | ||
reorder_modules = true | ||
reorder_impl_items = false | ||
type_punctuation_density = "Wide" | ||
space_before_colon = false | ||
space_after_colon = true | ||
spaces_around_ranges = false | ||
binop_separator = "Front" | ||
remove_nested_parens = true | ||
combine_control_expr = true | ||
struct_field_align_threshold = 0 | ||
match_arm_blocks = true | ||
force_multiline_blocks = false | ||
fn_args_density = "Tall" | ||
brace_style = "SameLineWhere" | ||
control_brace_style = "AlwaysSameLine" | ||
trailing_semicolon = true | ||
trailing_comma = "Vertical" | ||
match_block_trailing_comma = true | ||
blank_lines_upper_bound = 1 | ||
blank_lines_lower_bound = 0 | ||
edition = "Edition2015" | ||
merge_derives = true | ||
use_try_shorthand = true | ||
use_field_init_shorthand = false | ||
force_explicit_abi = true | ||
condense_wildcard_suffixes = true | ||
color = "Auto" | ||
required_version = "0.99.4" | ||
unstable_features = false | ||
disable_all_formatting = false | ||
skip_children = false | ||
hide_parse_errors = false | ||
error_on_line_overflow = false | ||
error_on_unformatted = false | ||
report_todo = "Never" | ||
report_fixme = "Never" | ||
ignore = [] | ||
emit_mode = "Files" | ||
make_backup = false |
This file contains 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 @@ | ||
[package] | ||
name = "model-enclave" | ||
version = "0.1.0" | ||
authors = ["Nick Hynes <nhynes@berkeley.edu>"] | ||
|
||
[lib] | ||
crate-type = ["staticlib"] | ||
|
||
[dependencies] | ||
lazy_static = "1.1.0" | ||
# tvm = { path = "../../../rust", default-features = false, features = ["sgx"] } | ||
tvm = { path = "/home/nhynes/myelin/deps/tvm-rs", default-features = false, features = ["sgx"] } | ||
|
||
[profile.release] | ||
lto = true | ||
opt-level = 3 |
This file contains 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,35 @@ | ||
MODEL ?= resnet | ||
NUM_THREADS ?= 4 | ||
BATCH_SIZE ?= 64 | ||
TRAINING ?= true | ||
DEBUG ?= false | ||
|
||
build_dir := ../build | ||
|
||
ifeq ($(DEBUG), false) | ||
debug := release | ||
xargo_args := --release | ||
else | ||
debug := debug | ||
endif | ||
|
||
target/x86_64-unknown-linux-sgx/$(debug)/libmodel-enclave.a: $(build_dir)/libmodel.a **/* | ||
RUST_TARGET_PATH=$(shell pwd) \ | ||
RUST_TARGET_DIR=$(shell pwd)/target \ | ||
RUSTFLAGS="-Z force-unstable-if-unmarked" \ | ||
TVM_NUM_THREADS=$(NUM_THREADS) \ | ||
BUILD_DIR=../build \ | ||
xargo build --target x86_64-unknown-linux-sgx $(xargo_args) -q | ||
|
||
$(build_dir)/libmodel.a: $(build_dir)/model.o | ||
llvm-ar cr $@ $^ | ||
|
||
$(build_dir)/model.o: $(build_dir)/model.bc | ||
clang -c $< -o $@ -fPIC -O3 | ||
objcopy --globalize-symbol __tvm_module_startup $@ | ||
|
||
$(build_dir)/model.bc: src/build_model.py | ||
python3 $< -o $(build_dir) | ||
|
||
clean: | ||
xargo clean |
This file contains 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 @@ | ||
[dependencies] | ||
alloc = {} | ||
panic_unwind = {} | ||
panic_abort = {} | ||
|
||
[dependencies.std] | ||
features = ["backtrace", "stdio", "untrusted_time"] | ||
path = "/home/nhynes/myelin/deps/rust-sgx-sdk/xargo/sgx_tstd" | ||
# git = "https://github.com/oasislabs/rust-sgx-sdk" | ||
# rev = "7334c30d85cb1752577998705110b7b27c69b570" | ||
stage = 2 | ||
|
||
[dependencies.xargo_sgx_rand] | ||
# git = "https://github.com/oasislabs/rust-sgx-sdk" | ||
path = "/home/nhynes/myelin/deps/rust-sgx-sdk/xargo/sgx_rand" | ||
# rev = "7334c30d85cb1752577998705110b7b27c69b570" | ||
stage = 3 |
This file contains 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,9 @@ | ||
enclave.so | ||
{ | ||
global: | ||
g_global_data_sim; | ||
g_global_data; | ||
enclave_entry; | ||
local: | ||
*; | ||
}; |
This file contains 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,39 @@ | ||
-----BEGIN RSA P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||
fg95si9oO7EBT+Oqvhccd2J+F1IVXncccYnF4u5ZGWt5lLewN/pVr7MjjykeaHqN | ||
t+rfnQam2psA6fL4zS2zTmZPzR2tnY8Y1GBTi0Ko1OKd1HMCgcAb5cB/7/AQlhP9 | ||
yQa04PLH9ygQkKKptZp7dy5WcWRx0K/hAHRoi2aw1wZqfm7VBNu2SLcs90kCCCxp | ||
6C5sfJi6b8NpNbIPC+sc9wsFr7pGo9SFzQ78UlcWYK2Gu2FxlMjonhka5hvo4zvg | ||
WxlpXKEkaFt3gLd92m/dMqBrHfafH7VwOJY2zT3WIpjwuk0ZzmRg5p0pG/svVQEH | ||
NZmwRwlopysbR69B/n1nefJ84UO50fLh5s5Zr3gBRwbWNZyzhXk= | ||
-----END RSA PRIVATE KEY----- |
8 changes: 4 additions & 4 deletions
8
apps/sgx/enclave_config.xml → apps/sgx/enclave/enclave_config.xml.in
This file contains 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.