Commit Graph

117 Commits

Author SHA1 Message Date
Arthur Meyre
5e258ca443 refactor: change type hints in IntermediateNode evaluate 2021-08-23 14:10:41 +02:00
Arthur Meyre
5048992707 refactor: properly manage unhandled operands in BaseTracer and NPTracer
- use the pythonic way of signaling unhandled operands
- change typing hint in NPTracer
2021-08-23 14:10:41 +02:00
Arthur Meyre
a4181afe4d refactor: refactor np_dtype_helpers.py
- rename convert_numpy_dtype_to_common_dtype to
convert_numpy_dtype_to_base_data_type
- change names of constants to be clearer
2021-08-23 14:10:41 +02:00
Arthur Meyre
4f103e604a refactor: update OPGraph to be able to update bounds with foreign types
- get BaseDataType for values being checked in update_values_with_bounds
- rename SUPPORTED_TYPES to BASE_DATA_TYPES
2021-08-23 14:10:41 +02:00
Arthur Meyre
60daf31981 refactor: refactor make_integer_to_hold_ints
- rename make_integer_to_hold_ints to make_integer_to_hold
- accept any values as input as we don't know which type this function will
be called with
- rename get_bits_to_represent_int to
get_bits_to_represent_value_as_integer
2021-08-23 14:10:41 +02:00
Arthur Meyre
0ff3ae4795 refactor: refactor BaseValue and mix_values_determine_holding_dtype
- add _is_encrypted to BaseValue
- remove EncryptedValue and ClearValue classes
- add a ScalarValue class
- add two helpers EncryptedValue and ClearValue which create a ScalarValue
either encrypted or not when passed a data_type
- rename to mix_scalar_values_determine_holding_dtype
- change typing
2021-08-23 14:10:41 +02:00
Arthur Meyre
371ecae801 tests: do not test BaseValue __repr__ anymore 2021-08-23 14:10:41 +02:00
Arthur Meyre
f91092ac38 tools: update pytest make target to have a report on coverage
- allows to have coverage information without using make coverage
- make coverage remains recommended to check a commit's content
2021-08-20 09:53:02 +02:00
Arthur Meyre
6959fdf7e7 chore(tools): only make setup_env in dev docker if venv does not exist 2021-08-20 09:46:33 +02:00
Umut
94fef5e202 feat(debugging): provide a way to export the drawn graph as a png file 2021-08-18 17:33:19 +03:00
Arthur Meyre
0c5d5b0fd0 docs: change ordering of attributes and methods to be grouped
- alphabetical makes the docs hard to read
2021-08-18 14:30:37 +02:00
Umut
a367d68c6e feat(compilation-configuration): make compilation customizable 2021-08-18 15:10:58 +03:00
Umut
1b33cd7307 feat(Makefile): enable jupyter notebook support in docker environment 2021-08-18 14:49:09 +03:00
Arthur Meyre
5d26ad499a fix(build): properly serialize calls to mypy
- add an helper script to serialize make commands
- serialize mypy commands as they may overwrite each others cache
- format coverage command to avoid being ridiculously long
2021-08-18 12:23:53 +02:00
Arthur Meyre
5038502327 chore(test): make printable graph tests less verbose but keep debug info 2021-08-18 11:03:14 +02:00
Umut
c79e232d0f fix(Dockerfile): add LD_PRELOAD export to .bashrc of the docker environment 2021-08-18 11:31:06 +03:00
Umut
2dda00aeef chore(Makefile): add -s flag to pytest to improve the output of compiler tests 2021-08-18 11:31:06 +03:00
Arthur Meyre
ed66981ccd chore(reqs): move dev requirements to dev category 2021-08-18 09:36:03 +02:00
Arthur Meyre
6d14b4b318 fix(build): manage refs for push events 2021-08-18 09:08:49 +02:00
youben11
788e94bfa3 feat: end to end compilation and execution 2021-08-18 08:08:19 +01:00
Arthur Meyre
4e40982f5a feat(float-fusing): fuse float parts of an OPGraph during compilation
- this allows to be compatible with the current compiler and squash float
domains into a single int to int ArbitraryFunction
2021-08-17 18:27:31 +02:00
Arthur Meyre
d48c4dba32 dev(NPTracer): add support for sin
- re-organize numpy tracing tests

refs #126
2021-08-17 18:27:31 +02:00
Arthur Meyre
825d6422d0 dev(NPTracer): add op_name for traced functions, deepcopy kwargs
- ir.ArbitraryFunction does not deepcopy op_args and op_kwargs by default
anymore to let the control to the developer instantiating it
2021-08-17 18:27:31 +02:00
Arthur Meyre
0eebbfcd26 dev(opgraph): add facilities to OPGraph
- allow to construct graph from an existing networkx MultiDiGraph
- add a function to remove nodes unreachable from the outputs of the graph
- return the evaluated output when calling the OPGraph
2021-08-17 18:27:31 +02:00
Arthur Meyre
4976855c1d fix(debug): manage all get_color cases and unsorted arg names 2021-08-17 18:27:31 +02:00
Arthur Meyre
63eac35a43 build: launch pcc targets in parallel to speed up checks
- change call in github actions as proper flags are in the Makefile
- change mypy_ci target to avoid cache issues with multiple mypy instances
2021-08-17 18:27:31 +02:00
Umut
553f77f19b chore(ci): implement publishing docs to hdk.zama.ai on push to main 2021-08-17 18:52:27 +03:00
Umut
8df212ff49 bench: create the benchmarking infrastructure 2021-08-17 13:17:28 +03:00
Arthur Meyre
8dfed58829 chore(tools): add flake8 linter, flake8-bugbear plugin and fix issues
- remove detected `from hdk imports` (use relative imports instead) we ARE
the package
- change the way Float32 and Float64 are defined
2021-08-17 09:22:39 +02:00
youben11
3922bfe9b4 feat(mlir): support constant inputs in mlir conversion 2021-08-16 14:58:56 +01:00
youben11
8fbe5dab4d fix(mlir): unsigned are considered signless in compiler
+ changed the name of compiled func to main, as it's the default name to
  be executed later
2021-08-16 14:58:56 +01:00
Umut
479176e368 doc(examples): create quantized linear and logistic regression examples 2021-08-16 15:57:18 +03:00
Arthur Meyre
048bb61e8e fix(tools): add git to the docker image to be able to make coverage
- move comment in Makefile and make it silent
2021-08-13 18:11:43 +02:00
Benoit Chevallier
3245d3e673 Feat/user friendly arbitrary function name 144 (#149)
* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

* feat: let the dev give a useful name for ArbitraryFunction

might be useful to debug or understand what happens
closes #144

Co-authored-by: Benoit Chevallier-Mames <benoitchevalliermames@zama.ai>
2021-08-13 18:10:35 +02:00
Umut
5961d1630e refactor(compilation-artifacts): enable showing data types during export 2021-08-13 15:15:54 +03:00
Ayoub Benaissa
f6c9618b5a feat(mlir): MLIR Conversion (#103)
* feat(mlir): conversion from HDKIR to MLIR

* feat(mlir): support ir.Sub and ir.Mul

- better type conversion from HDK to MLIR
- Context management inside the converter class
- better handling of input type in conversion functions

* refactor(mlir): use input and output from OPGraph

Co-authored-by: Arthur Meyre <arthur.meyre@zama.ai>

* feat(mlir): eint-int subtractions

* feat(mlir): adhere to spec for supported ops

* feat(OPGraph): getters for ordered inputs/outputs

+ formatting

* tests(mlir): test converion via compiler roundtrip

* fix(mlir): flip operands on int_eint sym ops

* feat(mlir): check that the outputs are unsigned

* feat(mlir): set bit_width of all nodes to the max

This is currently required as the compiler is already assuming this.
Could be removed from HDK when the compiler can do it on its own

* feat: value_is_integer + CRs

disable some linting errors

* tests: update compile tests + coverage

* refactor: reorganize mlir package + better doc

* doc: conformance with pydocstyle

Co-authored-by: Arthur Meyre <arthur.meyre@zama.ai>
2021-08-13 12:50:31 +01:00
Umut
2c3c080923 test(direct-tlu): create debugging and compilation tests for direct table lookup 2021-08-12 17:41:06 +03:00
Benoit Chevallier
4afc373a6b Update GETTING-STARTED.md
Adding the group name
2021-08-12 15:51:35 +02:00
Benoit Chevallier-Mames
4f6103d1d1 fix: fixing issue in the graph generation
closes #130
2021-08-12 15:17:35 +02:00
Umut
8fd0ae5c85 feat(docker): create a docker environment to test and develop MLIR stuff 2021-08-12 10:51:26 +03:00
Benoit Chevallier-Mames
8f3e461e3b fix: docstring following google conventions
refs #122
2021-08-11 18:11:56 +02:00
Benoit Chevallier-Mames
765df12a2d doc: add autogenerated doc in sphinx
refs #118
2021-08-11 15:23:11 +02:00
Arthur Meyre
7bdcfabbfe feat(hnp-tracing): add support for ufunc routing to NPTracer
- start tracing numpy.rint and manage dtypes
- update BaseTracer to accept iterables as inputs, because NPTracer does
not get list givent the way numpy sends arguments to the functions
2021-08-11 14:20:42 +02:00
Arthur Meyre
19e68589d1 dev(numpy-dtypes): add some additional numpy dtype helper functions
- add function to convert a type from the project to a numpy dtype
- add function to manage numpy ufunc output dtypes
- add a check for integers to have positive bit_width
- add a check for floats to only accept 32 and 64 bits
2021-08-11 14:20:42 +02:00
Arthur Meyre
e296e9667e chore(tools): use /bin/bash as shell for the Makefile
- tested some commands with an environment which had /bin/sh as default
shell, some did not work, this fixes it
2021-08-11 10:40:00 +02:00
Umut
fe9ab2d21d feat(compilation): create compilation artifacts and provide a way to export them in a textual format 2021-08-11 10:26:54 +03:00
Umut
56556a85e9 feat(representation): create lookup table wrapper to be used during tracing direct table lookups 2021-08-10 12:42:38 +03:00
Umut
c63ad8ac92 fix(debugging): assign a color to ArbitraryFunction nodes 2021-08-10 12:42:38 +03:00
Arthur Meyre
c51c4bd17a feat(tracing-astype): add astype method on NPTracer 2021-08-10 10:13:00 +02:00
Arthur Meyre
9ef2154d51 dev(numpy-dtype): add a function to translate numpy types to frontend types 2021-08-10 09:07:30 +02:00