Stella Laurenzo
00c791f925
Make common utilities for converting TypeNode <-> IR types.
...
* Generalizes the conversions from ObjectValueType <-> tensor and ndarray.
* Creates a utility to construct the default type map hook.
2020-07-04 20:33:13 -07:00
Stella Laurenzo
97c92aa264
Remove the existing attached values/ops from CPA types.
...
This was ad-hoc and needs to be replaced by a more principled track back to the IR.
2020-07-04 17:47:19 -07:00
Stella Laurenzo
f66f4d7ef8
Update for renamed pass.
2020-07-04 17:43:04 -07:00
Stella Laurenzo
adb8094108
Fix some compiler option and warning levels.
2020-07-04 17:38:01 -07:00
Stella Laurenzo
48a0b0ec7f
NFC: Move CPATypeInference to Typing directory.
2020-07-04 16:56:09 -07:00
Stella Laurenzo
051d088161
NFC: Move CPA typing analysis down a directory.
2020-07-04 16:40:02 -07:00
Stella Laurenzo
6a50efd046
Extend the CPA type inference to work on numpy types/ops.
...
* Adds an op interface for adding CPA constraints.
* Adds a type conversion hook for handling built-in types (that we can't have adopt our interface).
* Converts tensor<> to object(!Tensor, [e:<type>]) just like NdArray.
* Implement a few numpy ops far enough to do dtype inference for simple sequences.
2020-07-03 18:16:34 -07:00
Stella Laurenzo
34861b18f4
Add NdArray type inference conversion.
2020-07-03 16:38:10 -07:00
Stella Laurenzo
4a2f7c0b5f
Add constraint propagation and tracking of node members.
2020-07-03 13:29:52 -07:00
Stella Laurenzo
1a13c38033
More progress on CPA.
...
* Added transitivity propagation rules.
* Fixed up some copy-n-paste inversions from the old algorithm.
2020-07-02 18:56:05 -07:00
Stella Laurenzo
74b8bed7e3
Unique CPA type and constraints to enable comparison by pointer during propagation.
2020-07-02 17:07:02 -07:00
Stella Laurenzo
a257da46e2
Introduce a type interface for mapping to CPA types.
...
* Currently just simplifies the logic for UnknownType -> TypeVar.
2020-07-02 13:56:27 -07:00
Stella Laurenzo
b0604684ba
NFC: Move CPA support down into it's own directory.
2020-07-02 11:31:23 -07:00
Stella Laurenzo
e1839a0d6b
Bump llvm and iree versions.
...
* Gets us passed the upstream changes that enable type interfaces.
* Adds the ARM backend due to an implicit IREE dependency sneaking in for that (https://github.com/google/iree/issues/2401 )
* Adds explicit TypeStorage to type base classes per upstream change.
2020-07-02 11:24:05 -07:00
Stella Laurenzo
270608c781
Fix misspelled -gdwarf-2.
2020-07-02 10:46:46 -07:00
Stella Laurenzo
918aa487e9
Adjust configure script to probe more robustly.
2020-07-02 10:45:49 -07:00
Stella Laurenzo
aeb422b030
Some fixes to get npcomp building and passing on windows.
...
There is more that can be done here, but this gets it minimally working.
2020-07-01 21:28:04 -07:00
Stella Laurenzo
92190176fb
Add skeleton of pass to do modified PCA type inference.
2020-06-30 20:57:09 -07:00
Stella Laurenzo
f1b08a0ef0
Add some support classes for implementing a CPA type inference algorithm.
2020-06-30 18:28:39 -07:00
Stella Laurenzo
0962a31ca8
Bump llvm and IREE version to revisions circa 2020/7/29.
...
* Also fixes a dependency issue that was causing a build race.
2020-06-30 11:22:30 -07:00
Stella Laurenzo
2d4b0843c1
Fix evaluation message reporting and add checks to tests.
2020-06-29 17:48:17 -07:00
Stella Laurenzo
d5e3902b6d
Fix broken link
2020-06-29 16:49:23 -07:00
Stella Laurenzo
e5ac477862
Add docs on ufuncs.
2020-06-29 16:44:33 -07:00
Stella Laurenzo
272f13fc31
Update docs with notes on the numpy extension.
2020-06-29 16:37:29 -07:00
Stella Laurenzo
046751254f
Refactor old tracing tests and remove deprecated ops.
...
* Old doctests to run under lit.
* Old custom filecheck tests -> pytest directory (under lit).
* Rename some old ufunc ops in the tracer.
2020-06-29 16:19:03 -07:00
Stella Laurenzo
7ca292ade5
Add partial evaluator for explicit numpy ufuncs.
...
* This enables emission of "numpy.add(a, b)" and several dozen others.
* Will deprecate original ufunc infra in a follow-on.
2020-06-29 15:27:39 -07:00
Stella Laurenzo
1024c508f8
Move numpy compiler support to new directory.
2020-06-29 13:02:34 -07:00
Stella Laurenzo
a4f3ce1ed3
Add value coding for ndarray.
...
* This lets us import arrays from the outer environment, which is the first step to actually handling numpy ops.
2020-06-28 18:42:08 -07:00
Stella Laurenzo
f6721c173d
Add create_array_from_tensor and copy_to_tensor ops.
2020-06-28 17:58:26 -07:00
Stella Laurenzo
b2708e4687
Add test case for !numpy.ndarray.
2020-06-28 17:41:21 -07:00
Stella Laurenzo
efe8915901
Add NdArrayType.
2020-06-28 17:37:20 -07:00
Stella Laurenzo
bccfd5f6fc
Refactor environment.py into components.
...
* Creates a new top level Configuration class
* Adds a module for creating test configs, getting some hard coding out of core classes
2020-06-28 16:52:25 -07:00
Stella Laurenzo
d6b428fb60
Merge pull request #4 from google/stella_dev
...
Add "template function" ops and importer code.
2020-06-26 18:38:46 -07:00
Stella Laurenzo
7bd5733d38
Add "template function" ops and importer code.
...
* This starts to lay down the infra for reasoning about calls
* Adds the importer code to generate IR for function calls of compiler recognized static functions.
2020-06-26 18:36:36 -07:00
Stella Laurenzo
26fd2a576e
Update docs for 'macro' -> 'partial evaluation'.
2020-06-26 13:53:40 -07:00
Stella Laurenzo
e45287d83e
Rename 'macro' nomenclature to 'partial eval'.
2020-06-26 13:50:51 -07:00
Stella Laurenzo
dd6a4e638b
Add macro facility and use it to enable module and namedtuple attribute resolution.
2020-06-25 23:11:32 -07:00
Stella Laurenzo
25a580b8d3
Add section on name resolution and update broken links.
2020-06-22 23:25:30 -07:00
Stella Laurenzo
5e54bcfc8c
Change test to explicit module level constant.
2020-06-22 18:46:40 -07:00
Stella Laurenzo
e5958d820f
Add constant resolution from globals and builtins.
2020-06-22 18:42:32 -07:00
Stella Laurenzo
f791909a25
Factor name resolution and constant creation to a new environment facility.
2020-06-22 18:15:56 -07:00
Stella Laurenzo
2242f48228
Fix broken link
2020-06-20 12:01:49 -07:00
Stella Laurenzo
12d8459d73
Rework README, add docs, and move some scripts to better locations accordingly.
2020-06-20 11:56:13 -07:00
Stella Laurenzo
b3ecd57b29
Add a sample test that exercises short circuit control flow.
2020-06-19 17:25:18 -07:00
Stella Laurenzo
b811db4b76
Wrap the IREE compiler flow in a one stop API.
2020-06-19 17:17:22 -07:00
Stella Laurenzo
dc87e09b5a
Enable simple_invoke with upstream fix for scalar arguments.
2020-06-19 16:32:15 -07:00
Stella Laurenzo
fc5f10c5c5
Bump revision and fix issues.
...
* llvm revision = 4836188ad9b3334b0c1e055d45ccaa54ed797e4b
* iree revision = 091482e8fdf599d6cb5c701d5b3ccb27fc66c014
2020-06-19 10:38:51 -07:00
Stella Laurenzo
529873d13c
Wire up IREE compilation and runtime in a new backend test.
...
* Adds python bindings for invoking flow, HAL, and VM lowering pipelines.
* Adds pythong bindings for translating to VM module flatbuffer.
* Adds a new backend_test/iree directory and configure lit to find the IREE python rt bindings.
* Open code a simple_invoke.py that exercises the whole pipeline (need real APIs for a lot of this).
* Fails when invoking the function because I never implemented argument marshaling for scalars :(
* Plenty of stuff to do tomorrow.
2020-06-19 00:30:34 -07:00
Stella Laurenzo
373878f31f
Add _npcomp.backend.iree module.
...
* Populates with builders for the various path pipelines and translator.
2020-06-18 23:28:30 -07:00
Stella Laurenzo
213041449f
Move most python sources to the include and lib tree.
2020-06-18 18:02:39 -07:00