Commit Graph

1554 Commits (a1d3afdba9f3baaa502654c2ab52fb86f358e6ec)
 

Author SHA1 Message Date
Sean Silva fec2ee0072 Avoid introducing DimOp's in LowerBroadcastToToLoops.
This makes sure we stay resonably canonically using the shape machinery.
(In fact, DimOp should probably be in the shape dialect since it hides a
`shape.shape_of` call)
2020-05-11 13:12:16 -07:00
Sean Silva 1ef8b91a95 Add -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE
This allows VSCode (and presumably other IDE's) to pick up a
`tools/cmake_configure.sh`'ed build directory and have intellisense.
2020-05-11 12:58:42 -07:00
Stella Laurenzo 950ba12426 Bump llvm-project to 3af85fa8f06220b43f03f26de216a67be4568fe7. 2020-05-08 20:42:40 -07:00
Sean Silva e29aef855b Initial TCF/TCP E2E seed.
Very much WIP.

This is enough to get tcf.add down to approximately the "linalg.generic
on buffers" level of abstraction. (but there are nuances)
2020-05-08 20:20:41 -07:00
Sean Silva f394e12d86 Add tools/test_all.sh
We should look into having a `ninja check-npcomp` that runs everything
with lit so that we get decent test multithreading.
We can look to how LLVM does its gtest tests ("unittests") for
inspiration.
2020-05-08 18:13:19 -07:00
Stella Laurenzo f2985e0901 Add implicit constant capture.
We want more sophisticated capture later, but this allows basics to function.
2020-05-08 17:55:02 -07:00
Stella Laurenzo 8ae71a9551 Add MLIRContext.dense_elements_attr to create an attribute from a python buffer/array. 2020-05-08 17:36:07 -07:00
Stella Laurenzo a91b0bfbe1 Add numpy.get_slice op and wire it up to the tracer. 2020-05-08 16:04:58 -07:00
Stella Laurenzo db0b0ef1b2 Switch sample tracer to emit builtin_ufunc globals instead of the impl versions. 2020-05-08 14:35:13 -07:00
Stella Laurenzo 497f1de5a2 Add env var to enable experimental numpy array function handling. 2020-05-08 14:21:43 -07:00
Stella Laurenzo 0092b912ab Update all python imports to be absolute and use a .env file to set the path correctly.
This makes things just work for debugging in VSCode.
2020-05-06 23:25:04 -07:00
Stella Laurenzo 3611958b11 Move python native library to python_native/_npcomp...so.
This allows binary and source packages to exist at different physical paths.
2020-05-06 22:44:12 -07:00
Stella Laurenzo 680e11ae62 Rename basicpy_None_type to basicpy_NoneType to match native spelling.
* Also adds Basicpy.py to tests.
2020-05-06 19:07:50 -07:00
Stella Laurenzo 644d9fb0d3 Remove spammy warnings and filecheck info in run_tests.
* This suppresses a warning that arises from using "-m" to launch a module contained in a package that arranges modules via __init__.py. It seems irrelevant to the use case of running doctests.
2020-05-06 18:48:12 -07:00
Stella Laurenzo 6b7c913e0b Add DialectHelper for Basicpy dialect.
* Involved native code for the types and slot_object_get ops.
2020-05-06 18:26:03 -07:00
Stella Laurenzo 4ebf972503 Merge ir.Ops and ir.Types into ir.DialectHelper.
This will aid in managing hierarchies of custom dialect helpers.
2020-05-06 18:26:03 -07:00
Sean Silva aa9ffc3a11 Delete npcomp.edsc_test from python/run_tests.py 2020-05-06 18:24:44 -07:00
Stella Laurenzo 714bc01c02 Bump llvm version to 0c4aab27b3da05dd1b0c0c39472525325fda5e23.
* Fixes some api-change breakages.
* Deletes edsc module now that the IR bindings are working (and since it broke with this update).
2020-05-05 21:00:49 -07:00
Stella Laurenzo bc5ef81d68 Add basicpy.SlotObject type and ops to create/index into it.
* This is intended to provide low-level modeling for built-in objects.
* It is now possible to trace slice tuples (which are tuples of NoneType|EllipsisType|SlotObjectType<slice, ...>).
2020-05-05 18:16:01 -07:00
Stella Laurenzo bfd5fedba7 Add central registration for type ranges. 2020-05-05 14:16:39 -07:00
Stella Laurenzo f8cedd8656 Add known good llvm-project commit hash to readme. 2020-05-05 14:00:06 -07:00
Stella Laurenzo 9a0f498774 Add new gist to the design notes. 2020-05-05 13:49:05 -07:00
Stella Laurenzo 502ef8f195 Create skeleton for 'Basicpy' dialect.
* It is time to start adding more python mechanisms.
* Running into this for materializing slice() objects.
2020-05-04 17:48:02 -07:00
Stella Laurenzo ebb5bcf6af Handle np.transpose() and ndarray.T shortcut.
* Just the form without explicit permutation for now.
2020-05-04 16:20:36 -07:00
Stella Laurenzo a5f755d406 Implement __array_func__ hook and use it to trace np.dot.
* Creates an abstraction/registry around emitters (intended to generalize to AST compilation as well).
* Reworks ufuncs to use the same mechanism as array funcs.
* Adds the numpy.dot op.
2020-05-04 15:47:01 -07:00
Stella Laurenzo 1f54838d2e Add hook for __array_function__ and (failing) np.dot sample. 2020-05-03 13:39:30 -07:00
Stella Laurenzo a38a1e2850 Cleanup python namespace a bit for standalone use. 2020-05-02 21:54:13 -07:00
Stella Laurenzo 1f136f9dba Update readme 2020-05-02 19:54:49 -07:00
Stella Laurenzo c89a35f97f Rework the poc tracer to be structured how intended. 2020-05-02 19:52:21 -07:00
Stella Laurenzo 0805013716 Rename ufunc_call op builder for consistency. 2020-05-01 19:06:10 -07:00
Stella Laurenzo 78a8e6ec9e Add enough python bindings to build functions and ufunc calls. 2020-05-01 18:44:06 -07:00
Stella Laurenzo ba0c96b51a Add python side Numpy dialect wrapper. 2020-05-01 10:38:52 -07:00
Stella Laurenzo 23a9ffaabe Add wrappers for block and operation iteration.
I don't technically need this now but adding while the train of thought is fresh.
2020-05-01 10:16:19 -07:00
Stella Laurenzo c8740fd866 Start splitting Py* types into a header so that further C++ interop can be built. 2020-04-30 19:23:18 -07:00
Stella Laurenzo ec0f6b4b22 Add MLIRContext and ModuleOp python bindings with asm parse/print and diagnostics. 2020-04-30 17:14:03 -07:00
Stella Laurenzo 67d38db1e2 Start defining new IR bindings and cleanup python init. 2020-04-30 16:00:00 -07:00
Stella Laurenzo d3632af675 Add !numpy.any_dtype dialect type. 2020-04-29 18:20:42 -07:00
Stella Laurenzo b4425fe1d2 Add numpy.ufunc_call op. 2020-04-29 17:49:56 -07:00
Stella Laurenzo c4a192d5c9 Rename from npcomp::NUMPY to NPCOMP::numpy to follow IREE convention. 2020-04-29 17:10:10 -07:00
Stella Laurenzo f174c0557b Cleanup build instructions/scripts 2020-04-29 17:05:45 -07:00
Stella Laurenzo 03cf785bae Remove linker detection 2020-04-29 16:33:48 -07:00
Stella Laurenzo 6cc38f1e08 Update readme 2020-04-29 16:11:18 -07:00
Stella Laurenzo 4ad485e582 Add design note links to README. 2020-04-29 10:55:35 -07:00
Stella Laurenzo e845db8a20 Add builtin_ufunc and generic_ufunc ops. 2020-04-28 23:51:54 -07:00
Stella Laurenzo 25e22aa4a5 Add contributing.md 2020-04-26 20:17:16 -07:00
Stella Laurenzo 193e7ba0d5 Update readme 2020-04-26 20:14:20 -07:00
Stella Laurenzo d2b684a1c3 Add license 2020-04-26 20:10:24 -07:00
Stella Laurenzo f514bd533d Add a helper run_lit.sh for interactive debugging. 2020-04-26 18:41:44 -07:00
Stella Laurenzo 953ef89a30 Add npcomp-opt and lit runner. 2020-04-26 17:55:15 -07:00
Stella Laurenzo d3b6e1767a Add stub numpy dialect. 2020-04-26 17:20:58 -07:00