- 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
- 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
* 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>
* 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>
- this allows to make sure each node has a proper implementation
- move op_args and op_kwargs in ArbitraryFunction only
- update BaseTracer accordingly
- update ConstantInput to manage floats
- update OPGraph update_values_with_bounds to manage floats
- update test code to manage cases where output could be a float
- add test cases with float inputs
- this allows to have tighter data types by sticking to the smallest types
able to represent the ranges passed as argument
- update test_dataset_eval to check the output Value's data_type is updated
- this input index will be useful for MLIR/lower level conversions
- it represents the input index of an Input node when considering the
traced function signature
- update code preparing function parameters to keep signature order
- allows to have a generic way of propagating types instead of deepcopying
input values and types in IR nodes
- supports only Integers for now
- opset checks will not be performed in those functions to keep knowledge
required on the opset to the MLIR conversion step or extra check steps
- use the mix_values_determine_holding_dtype in intermediate nodes where
appropriate
- update tests that were failing with new mypy check
- mypy_test runs mypy on all .py source files in tests
- mypy_ci runs mypy and mypy_test, mypy is for source i.e. hdk/ only
- add BaseTracer which will hold most of the boilerplate code
- add hnumpy with a bare NPTracer and tracing function
- update IR to be compatible with tracing helpers
- update test helper to properly check that graphs are equivalent
- add test tracing a simple addition
- rename common/data_types/helpers.py to .../dtypes_helpers.py to avoid
having too many files with the same name
- ignore missing type stubs in the default mypy command
- add a comfort Makefile target to get errors about missing mypy stubs
- value classes have a data_type member to know what they hold
- add __repr__ to a few classes to ease readability for debug/print
- add helper functions to perform value checks that will be used for
tracing to ease readability
- add unit tests to get 100% coverage