Commit Graph

188 Commits

Author SHA1 Message Date
William Seo
1fa5d91580 working taint analysis 2022-11-01 21:12:57 +00:00
William Seo
d909bf0fc7 Implemented vismap generation 2022-10-09 04:57:05 +00:00
William Seo
18b4112f05 Added test case generation for testing batched vs naive 2022-09-30 01:02:18 +00:00
William Seo
94b65fdd91 Cleaned up directory, changed test names 2022-04-27 06:29:08 +00:00
William Seo
6c590db47e Fixed linting issue 2022-04-26 01:00:00 +00:00
William Seo
cdc2ea8967 Merge branch 'fhe' of wys.github.com:circify/circ into fhe 2022-04-26 00:23:22 +00:00
William Seo
afd8bf200f Added support for addition, multiplication, and simple vectorized operations 2022-04-26 00:22:34 +00:00
Edward Chen
277c2c0394 Merge branch 'master' into fhe 2022-04-19 11:06:33 -04:00
Alex Ozdemir
157370f307 Eliminate tuples with persistent vectors (#75)
Change: The tuple elimination pass now represents its *tuple trees*
using nested persistent vectors of non-tuple terms, rather than standard
terms.

Rationale: When large oblivious arrays are transformed to tuples, said
tuples are large, and updates to them use the tuple update operator.
However, when we eliminate those tuples, we essentially replace the
update operator with an explicit tuple (tree). For a large number of
updates, this entails quadratic memory usage.

Of course, it doesn't *need* to: each update only modifies one spot in
the tuple.

Thus, in this patch, we change the representation of tuples in tuple
tree from a standard term---whose children are in a vector---such that
the children are now in a persistent vector from the `im` crate. This
allows for an "update" operation on the vector that takes log time and
log new space.

Effect: This reduces the compiler's memory usage on
`examples/C/mpc/benchmarks/2pc_biomatch_40x.c` from ~28GB to ~1GB. It
also makes the compiler substantially faster on that benchmark.
2022-04-11 13:13:58 -07:00
Alex Ozdemir
0b42f26089 Improve non-recursive type-checking (#74)
In *non-recursive* type-checking, perhaps better called *type computing*
we perform a minimal traversal in order to compute the type of a term,
without recursively type-checking it. Informally, we assume it is well
typed, and do the minimal amount of work needed to compute its type.

Two improvements:
1. No longer implemented with recursion.
2. Caches all intermediate results.

Implementation:
* `check_dependencies(Term) -> Vec<Term>`: maps a terms to the immediate
  children of it whose types are needed to compute its type.
* `check_raw_step(Term, TypeTable) -> Sort`: assumes those children have
  their types in the table, and computes this term's type.
* `check_raw`: glues the two above functions together into a suitable
  traversal. Similar to `rec_check_raw`, but the traversal isn't total.

Significance:

Previously, we had a non-recursive implementation for array stores that
*didn't cache intermediate results* which could cause quadratic
type-checking time (if the type-check callee was doing a top-down
traversal). Edward sent me a benchmark that was experiencing this,
resulting in 74.1% of total compilation time being spent type-checking.
Now it's down to 0.4% of total compilation time.
2022-04-11 11:41:02 -07:00
Riad S. Wahby
50b97f6acb zsharp fixes ; speed improvements (#73)
This PR does two things:

- Fixes some scoping issues in Z# having to do with the context in which function and struct definitions are interpreted.
- Improves speed and reduces TermTable memory consumption by 2x (by keying on Arc<TermData> rather than TermData)
- Improves speed for Z# array handling with a BTreeMap -> HashMap swap
- Adds intrinsic widening casts in Z#. These were previously handled by bit-splitting, which is wasteful.
 
On array-heavy Z# programs, this PR improves speed by about 5x and memory consumption by roughly the same.

---

* zsharp::term::ir_array should use HashMap (faster, less memory)

* perf improvements

constant folding: get rid of redundant clones
bitvector: impl arith for refs
TermTable: don't store redundant term as key

* EMBED widening casts

* generic inf: need to push fn defn context onto filestack

* canonicalize path in err msg

* need struct defn on filestack, too

* no need to warn about U32 indexing in zsharp

* fix warning
2022-04-08 21:16:35 -04:00
Edward Chen
2052869261 Removing old ABY dependency (#63)
* removing EzPC dependency
* removing old ABY dependencies
2022-04-07 14:03:27 -04:00
Edward Chen
63e3bea1b8 Adding benchmark scripts and logging for ABY backend (#72) 2022-04-06 04:04:52 -04:00
Edward Chen
ffa2ac3dc9 Updated ABY tests to ignore logging code (#71) 2022-04-05 02:08:40 -04:00
William Seo
fdb91e7b4e fixed test inputs 2022-03-31 21:44:37 +00:00
William Seo
d55e5a53c8 fixed bug in driver 2022-03-31 21:31:54 +00:00
William Seo
5b1ac714f9 changed ci.yml again again 2022-03-31 21:18:30 +00:00
William Seo
308bcbc86d changed ci.yml again 2022-03-31 21:16:48 +00:00
William Seo
f127d5d48e changed ci.yml 2022-03-31 21:15:40 +00:00
William Seo
d30b3d4bf7 Changed build script and ci.yml 2022-03-31 21:08:11 +00:00
William Seo
cb53d1a7e6 Deleted extraneous content. Fixed a bug 2022-03-31 06:05:34 +00:00
William Seo
2159c20ff3 Added building/testing for FHE backend 2022-03-31 05:13:24 +00:00
Alex Ozdemir
c784bf7054 Typo in CSE project 2022-03-27 20:24:20 -07:00
Alex Ozdemir
bdd3c59a3c Two write-ups (#68) 2022-03-27 18:45:03 -07:00
Riad S. Wahby
8c8e704914 field flexibility ; add limit for linearity reduction (#66)
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
2022-03-25 15:03:09 -07:00
William Seo
3c3f2037d8 Fixed linting issue 2022-03-25 02:02:42 +00:00
William Seo
eb796061dc Removed extraneous code 2022-03-25 01:55:14 +00:00
William Seo
a66a508c98 Fixed Merge Conflicts 2022-03-25 01:28:06 +00:00
William Seo
248d746ca6 Updated backend to support SEAL interpreter 2022-03-25 00:59:56 +00:00
Edward Chen
13f9a092b5 Updated ABY VM to include IN bytecode instruction (#65)
- updated ABY interpreter to include IN gates
- Added tqdm requirement
2022-03-24 15:53:44 -04:00
William Seo
8bceb9a2f2 Merge pull request #55 from circify/IR_Map
Added Map to IR (evaluation and typechecking)
2022-03-17 15:09:40 -04:00
Alex Ozdemir
0d61d45a65 add flamegraph action (#59) 2022-03-10 09:16:40 -08:00
Ubuntu
9462866a34 Fixed linting issues 2022-03-10 07:17:05 +00:00
Ubuntu
0fe65aa6a0 Fixed formatting issue 2022-03-10 05:42:51 +00:00
Ubuntu
90340d89d7 Made edits based on the comments 2022-03-10 05:18:35 +00:00
Edward Chen
9b9a689321 removing EzPC dependency (#58) 2022-03-08 11:04:52 -05:00
Ubuntu
6d8b69c69f Merge branch 'master' into IR_Map 2022-03-06 21:21:36 +00:00
Alex Ozdemir
eaf451e651 Kill dead file (#56) 2022-03-05 02:05:23 -08:00
Edward Chen
8fed29bd32 ABY VM and Interpreter (#47)
Updated ABY testing framework with an ABY bytecode and interpreter
2022-02-28 19:47:50 -05:00
Ubuntu
e3bafe07e9 Ran the linter and formatter 2022-02-28 04:36:48 +00:00
Edward Chen
f66b14a702 Updating build system - 2 (#54)
Fixed linting error
2022-02-26 17:33:22 -05:00
Edward Chen
8b4ff8ff93 Updating build system (#51) 2022-02-26 02:21:53 -05:00
Edward Chen
ae2dde166c update EZPC file (#52) 2022-02-26 01:28:35 -05:00
Edward Chen
b9526234ac Updating build system (#44)
`python3 driver.py -h`
2022-02-25 17:13:10 -05:00
Ubuntu
b7b2491d78 Added Map to IR (evaluation and typechecking) 2022-02-25 21:04:37 +00:00
William Seo
0404c6e395 Implemented typechecking for Map IR 2022-02-25 01:51:01 +00:00
William Seo
1cb736f6df Merged with main 2022-02-21 20:26:28 +00:00
William Seo
3c59444ad7 Map Operation changed indices to bitvectors 2022-02-21 20:13:07 +00:00
William Seo
ea4b7ed5f2 Added Map operation to IR 2022-02-16 20:13:26 +00:00
Edward Chen
76539bf05d Function and Import support for C Frontend (#45)
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
Co-authored-by: Ubuntu <ubuntu@neptune2.maas>
2022-02-16 12:15:51 -05:00