Commit Graph

106 Commits

Author SHA1 Message Date
Benoit Chevallier-Mames
150d33ba48 feat: make get_printable_graph give correct info for np.dot
closes #204
2021-09-06 11:57:45 +02:00
Arthur Meyre
97ce55447f refactor: modify the imports to have everything in numpy
- allows users to do import hdk.numpy as hnp and use hnp for everything
- update notebooks and docs
2021-09-03 09:58:00 +02:00
youben11
2e459a344c refactor(dtype_helpers): homogenize functions 2021-09-03 08:57:07 +01:00
youben11
31c1787af2 feat(mlir): conversion of dot node into MLIR 2021-09-03 08:57:07 +01:00
youben11
f686ca535a feat(mlir): convert TensorValue inputs to MLIR
factorized the input type conversion of scalar values
2021-09-03 08:57:07 +01:00
Arthur Meyre
9ffe9b667a refacto: fix missed renaming after bad merge 2021-09-02 14:27:19 +02:00
Arthur Meyre
bf2585ba0a refacto: rename hnumpy to numpy as requested for the package imports 2021-09-02 12:20:01 +02:00
Benoit Chevallier-Mames
e9c5ce27bb feat: factorize the ufunc management and add lot of ufunc's
refs #126
2021-09-02 10:46:31 +02:00
Arthur Meyre
b582e68cd0 dev: add OPGraphs to compilation artifacts during float fusing 2021-09-01 15:25:33 +02:00
Umut
1e8debfb57 refactor: rename ClearValue/EncryptedValue to ClearScalar/EncryptedScalar 2021-09-01 15:33:19 +03:00
Arthur Meyre
95f683f37c refacto: do not convert to int in get_table from ArbitraryFunc
- this assumption only holds for compiler v0 and there are checks in the
MLIR converter to verify that the ArbitraryFunction yields integers
2021-09-01 13:42:35 +02:00
Benoit Chevallier-Mames
2badcecd0d feat: append \n instead of prepending it in get_printable_graph
closes #222
2021-09-01 10:23:14 +02:00
Umut
1fa049d914 feat: dump compilation artifacts automatically on compilation failures 2021-08-31 18:40:40 +03:00
Benoit Chevallier-Mames
0d84f8c5f5 feat: adding exp functions in the managed operators
refs #126
closes #260
2021-08-31 17:24:30 +02:00
Benoit Chevallier-Mames
e90df9c0b7 feat: adding arcsin, arccos, arctan in the managed operators
refs #126
closes #257
2021-08-31 16:39:17 +02:00
Benoit Chevallier-Mames
4c77f08854 feat: adding tan in the managed operators
refs #126
closes #255
2021-08-31 16:39:17 +02:00
Benoit Chevallier-Mames
802f7943b1 feat: adding cos in the managed operators
refs #126
closes #235
2021-08-31 12:25:24 +02:00
youben11
784158741e feat(mlir): TLU conversion 2021-08-31 09:04:24 +01:00
Arthur Meyre
dbda93639b dev(ir): add get_table function to ArbitraryFunction node 2021-08-31 09:04:24 +01:00
Benoit Chevallier-Mames
809ce28b38 feat: an option to show MLIR
closes #224
2021-08-27 18:48:59 +02:00
Arthur Meyre
1b489b281c refactor: move is_equivalent to conftest.py for tests 2021-08-26 14:15:30 +02:00
Arthur Meyre
31259e556c refactor: remove the content= when adding nodes to a graph
- required by tests but can be done by the testing function itself
2021-08-26 11:25:55 +02:00
Arthur Meyre
ff260b2cd2 feat(nptracer): add dot tracing abilities
- remove no cover from Dot.label
- small refactor of BaseTracer to make _sanitize a class method
- small refactor of get_ufunc_numpy_output_dtype to manage funcs and ufuncs
- add function routing to NPTracer
- add dot tracing to NPTracer
- small refactor to get tracing functions for numpy funcs and ufuncs
2021-08-25 11:00:36 +02:00
Arthur Meyre
6d663ef63d dev(ir): add Dot IntermediateNode 2021-08-25 10:51:03 +02:00
Arthur Meyre
4655bea987 fix: register IR nodes to check when nodes are missing debug draw colors 2021-08-25 10:51:03 +02:00
Umut
b41029d9c0 refactor(drawing): start using graphviz for visualization 2021-08-25 10:01:20 +03:00
Arthur Meyre
66d0c8dd62 feat(tracing): update hnumpy to manage tensor types
- binary ops and constants support
2021-08-24 16:00:42 +02:00
Arthur Meyre
96b04b45e1 refacto: rename check functions for values
- indicate the checks are for ScalarValues as we now have TensorValues
coming
2021-08-24 16:00:42 +02:00
Arthur Meyre
fc3ae6461c refacto: change the way mixing values is handled
- use an intermediate function that checks which mix function to use
- update function used in hnumpy tracing
2021-08-24 16:00:42 +02:00
Arthur Meyre
cc1221eac5 dev(bounds): add custom min and max func callbacks to manage foreign types
- allows us to pass a specialized function to estimate min and max for e.g.
numpy and/or torch tensors
2021-08-24 16:00:42 +02:00
Umut
1d5be5a1e7 refactor: re-organize data types and values 2021-08-24 16:13:36 +03:00
Umut
2b5f7f3118 refactor: rename ConstantInput to Constant to reduce confusion 2021-08-24 10:48:57 +03:00
Arthur Meyre
4e658c15cb feat: add TensorValue 2021-08-24 09:31:17 +02:00
Arthur Meyre
985cf973d8 refactor: values.py
- change import for BaseDataType
- create helper functions rather than partials to have docstrings in IDE
hints
2021-08-24 09:31:17 +02:00
Arthur Meyre
0e1534637b fix: BaseValue now deepcopies the data_type it receives
- avoids weird situations with refs to a type that gets modified
2021-08-24 09:31:17 +02:00
Arthur Meyre
e41f77349f refactor: make BaseDataType __eq__ abstract
- update test files with dummy dtypes
2021-08-24 09:31:17 +02:00
Arthur Meyre
7a0f11b1b0 refactor: change IR and BaseTracer to support any input mixing function
- prepares support for tensor types
- introduce _n_in and n_in() and requires_mix_values_func() for
IntermediateNode to know if they require a function to mix input values and
determine output value
- update BaseTracer to pass the class _mix_values_func to IntermediateNodes
that need it
- update NPTracer to stay consistent with current behavior regarding values
mixing
2021-08-23 14:10:41 +02:00
Arthur Meyre
78480e5da7 refactor: make IR agnostic of clear/encypted values 2021-08-23 14:10:41 +02:00
Arthur Meyre
9a0c108d4b refactor: refactor ConstantInput to be flexible
- refactor to take a function to generate the propore BaseValue to store in
its output
- refactor BaseTracer to force inheriting tracers to indicate how to build
a ConstantInput tracer
- remove "as import" for intermediate in hnumpy/tracing.py
- update compile to manage python dtypes
2021-08-23 14:10:41 +02:00
Arthur Meyre
c528d72e62 refactor: remove Scalars type hint
- add a helper function to determine BaseDataType of a constant python
scalar, int or float in dtype_helpers.py
- make BaseTracer type agnostic
- make ConstantInput type agnostic
2021-08-23 14:10:41 +02:00
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
Umut
94fef5e202 feat(debugging): provide a way to export the drawn graph as a png file 2021-08-18 17:33:19 +03:00
Umut
a367d68c6e feat(compilation-configuration): make compilation customizable 2021-08-18 15:10:58 +03:00
youben11
788e94bfa3 feat: end to end compilation and execution 2021-08-18 08:08:19 +01:00