Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Added an Extensive Set of Tests #21

Open
wants to merge 512 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
512 commits
Select commit Hold shift + click to select a range
345d1bb
Added copy (`copy` and `device_put`) translators, however, there is n…
philip-paul-mueller May 24, 2024
979f4ec
Made some small modifications.
philip-paul-mueller May 27, 2024
2d2c160
Reloacated some code.
philip-paul-mueller May 27, 2024
8adae42
Added a transformation for `slice`.
philip-paul-mueller May 27, 2024
011a2d6
Subclasses of mapped base now have to include the assignment to retur…
philip-paul-mueller May 27, 2024
a3ac868
Implemented a test for teh `select_n` primitive.
philip-paul-mueller May 27, 2024
5f186f6
First, chunk of work.
philip-paul-mueller May 27, 2024
df82038
Small corrections.
philip-paul-mueller May 28, 2024
60b7acb
Size corrections.
philip-paul-mueller May 28, 2024
2190faf
Moved the description of the constructor arguments from `__init__` to…
philip-paul-mueller May 28, 2024
5d6962a
Moved the `jax` package.
philip-paul-mueller May 28, 2024
6c980a9
Fixed the type annotation.
philip-paul-mueller May 28, 2024
6dd65f3
Added a todo.
philip-paul-mueller May 28, 2024
a0996eb
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller May 28, 2024
f7fe13d
Found something interesting in DaCe, but it does not fully match the …
philip-paul-mueller May 28, 2024
7b7b7ef
WIP: Dynamic slicing, it seems to work, but it is not nice.
philip-paul-mueller May 28, 2024
28c77ca
Tidied up the dynamic slicing, however, it is not yet fully compatible.
philip-paul-mueller May 29, 2024
054bb22
Dynamic slice now also supports the shifting of windows.
philip-paul-mueller May 29, 2024
c7e8b9f
Some cleaning.
philip-paul-mueller May 29, 2024
a28a9c8
Removed the warning about the useless casting in the tests.
philip-paul-mueller May 29, 2024
5bb4b5e
Started to reorganize the tests.
philip-paul-mueller May 29, 2024
959849a
WIP: Started to better organize the tests.
philip-paul-mueller May 29, 2024
047bb46
Applied a first version to the new code.
philip-paul-mueller May 29, 2024
64135b9
Second round.
philip-paul-mueller May 29, 2024
5756d1e
Third rounds for updated configuration.
philip-paul-mueller May 30, 2024
8b66af8
Fourth batch of adapting new configuration.
philip-paul-mueller May 30, 2024
a5826e9
Fixed a bug in the cache.
philip-paul-mueller May 30, 2024
6f4c45b
Fixed a bug in the cache.
philip-paul-mueller May 30, 2024
4735092
Reorganized some stuff.
philip-paul-mueller May 30, 2024
758adc8
Improved coverage.
philip-paul-mueller May 30, 2024
7fa03c3
chore: add missing dependencies in the mypy hook for pre-commit
egparedes May 30, 2024
ba854e0
remove typing-extensions
egparedes May 30, 2024
6b634bd
Merge remote-tracking branch 'github/main' into initial_implementatio…
philip-paul-mueller May 30, 2024
cd7fc01
Merge remote-tracking branch 'enrique/fix_mypy_deps' into initial_imp…
philip-paul-mueller May 30, 2024
2cdd3fd
First batch of fixes.
philip-paul-mueller May 30, 2024
e4bd289
Merge remote-tracking branch 'github/main' into initial_implementation
philip-paul-mueller May 30, 2024
37c933c
Integrated some of Enrique's changes.
philip-paul-mueller May 30, 2024
699b93e
Rereverted Some of Enrique's suggestions.
philip-paul-mueller May 30, 2024
53aae7b
Made the renaming from driver to builder, that is in my view pointless.
philip-paul-mueller May 30, 2024
eabda1f
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller May 30, 2024
f0ea5b4
Made some small changes.
philip-paul-mueller May 30, 2024
fae3ce3
Last screening.
philip-paul-mueller May 31, 2024
71eae32
Merge remote-tracking branch 'github/main' into initial_implementation
philip-paul-mueller May 31, 2024
43ba073
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller May 31, 2024
a23f0ab
Started to restructure the tests.
philip-paul-mueller May 31, 2024
555e815
Screened some primitive translators.
philip-paul-mueller May 31, 2024
fc91156
Added more stuff to the ALU translator and discovered something about…
philip-paul-mueller May 31, 2024
1be3237
Because of a bug in the `logical_not` implementation of teh ALU it do…
philip-paul-mueller May 31, 2024
9ab2e9a
Fixed a bug in the `select_n` translator.
Jun 1, 2024
e4a099d
Updated the `mkarray()` function of the tests, it is now able to gene…
Jun 1, 2024
8bdea82
Compacted the tests for select.
Jun 1, 2024
f5eb441
Updated the coverage configuration, however, not yet tested.
Jun 1, 2024
4179d40
Fixed the `TranslatorContext` and `TransltedJaxprSDFG`.
philip-paul-mueller Jun 2, 2024
acfcf39
Now the translation conext and the translated sdfg no longer share an…
philip-paul-mueller Jun 2, 2024
beeb9fd
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 2, 2024
cf99b02
Updated the coverage again.
philip-paul-mueller Jun 2, 2024
7424687
Made a note about what tests are still needed.
philip-paul-mueller Jun 2, 2024
b996041
Fixed the issue with the logical operations.
philip-paul-mueller Jun 2, 2024
bb9d81d
Updated the ALU tests.
philip-paul-mueller Jun 2, 2024
95b34cf
Updated the iota test.
philip-paul-mueller Jun 2, 2024
72c055a
Fixed an issue in the pyproject configuration regarding the `TYPE_CHE…
Jun 2, 2024
66fa038
Fixed a bug in the builder.
philip-paul-mueller Jun 3, 2024
fa599c3
Added some more tests to the empty case.
philip-paul-mueller Jun 3, 2024
e164d75
Added some more tests to the builder.
philip-paul-mueller Jun 3, 2024
7fe6f3b
Fixed a bug in the builder.
philip-paul-mueller Jun 3, 2024
b518ec7
Reenabled the input output functionality in the runner function again.
philip-paul-mueller Jun 3, 2024
94bdf57
Updated some tests, especially the x64 test.
philip-paul-mueller Jun 3, 2024
380dca9
Reenabled the input output functionality in the runner function again.
philip-paul-mueller Jun 3, 2024
35dc1f1
Enrique's comments.
philip-paul-mueller Jun 4, 2024
93e7935
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 4, 2024
ff66995
Modified some tests.
philip-paul-mueller Jun 4, 2024
74435a2
Reorganized some tests.
philip-paul-mueller Jun 4, 2024
acb9501
Updated the calling code.
philip-paul-mueller Jun 4, 2024
5373ca9
It is now also possible to generate random complex.
philip-paul-mueller Jun 4, 2024
e9597f2
Updated the alu tests.
philip-paul-mueller Jun 4, 2024
4499cfb
Enrique's suggestions/comments.
philip-paul-mueller Jun 5, 2024
50b4692
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 5, 2024
5c1e8c6
Updated the tests.
philip-paul-mueller Jun 5, 2024
01cc777
Allied some reformating.
philip-paul-mueller Jun 6, 2024
9ab7360
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 6, 2024
c8b9763
Reapplied some stuff.
philip-paul-mueller Jun 6, 2024
f5b7ccc
Adapted formating in the tests, however, they are so ugly.
philip-paul-mueller Jun 6, 2024
1c3d3a6
Updated the ALT tests.
philip-paul-mueller Jun 6, 2024
7990569
Updated the ALT tests.
philip-paul-mueller Jun 6, 2024
972c9c0
Updated the tests a little bit.
philip-paul-mueller Jun 7, 2024
95f04be
Updated how `is_tracing_ongoing()` works.
philip-paul-mueller Jun 7, 2024
bbc51d0
The translator is now also able to handle cases with no input arguments.
philip-paul-mueller Jun 7, 2024
f1846eb
Updated the tests.
philip-paul-mueller Jun 7, 2024
bf68021
Updated the element type conversion translator.
philip-paul-mueller Jun 7, 2024
a376aad
Updated the slicing primitive and tests.
philip-paul-mueller Jun 7, 2024
8a79f83
It is now also possible that Jax arrays can be used.
philip-paul-mueller Jun 7, 2024
a4697be
Removed some direct import.
philip-paul-mueller Jun 7, 2024
b64b666
Implemented a way to modify the set of compilation/optimization optio…
philip-paul-mueller Jun 7, 2024
ed23d49
Added a fixture that allows to select which options are used.
philip-paul-mueller Jun 7, 2024
3518bdc
Dynamic slicing can not run with disabled optimization.
philip-paul-mueller Jun 7, 2024
7d6cc9c
For the time being disabled the optimized tests in the primitive tran…
philip-paul-mueller Jun 7, 2024
630fcce
First stepe, in fixing the array/scalar stuff.
philip-paul-mueller Jun 7, 2024
e46637d
The Jaxpr is not also included in the translation context, do I need …
philip-paul-mueller Jun 7, 2024
c7f6cc9
Fixed some missed up formating.
philip-paul-mueller Jun 7, 2024
73f0116
I have now disabled the magic comma in ruff.
philip-paul-mueller Jun 7, 2024
ca7f32a
I have now disabled the magic comma in ruff.
philip-paul-mueller Jun 7, 2024
3c6194a
I have now disabled the magic comma in ruff.
philip-paul-mueller Jun 7, 2024
174bea8
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 7, 2024
4f87173
Merge branch 'initial_implementation_cont' into initial_implementatio…
philip-paul-mueller Jun 7, 2024
c5ebe96
Renamed a file.
Jun 9, 2024
45fce56
Fixed an issue in the tests regarding the direct construction of the …
philip-paul-mueller Jun 10, 2024
a2ee92d
Added a layer to handle all outputs and inputs.
philip-paul-mueller Jun 10, 2024
b7fcc80
Updated the tests.
philip-paul-mueller Jun 10, 2024
ceb46be
Merge branch 'initial_implementation_cont_fixing_scalar' into initial…
philip-paul-mueller Jun 10, 2024
b47284d
Some small changes.
philip-paul-mueller Jun 10, 2024
40f8574
Added a configuration file in the `docs/` folder such that the traili…
philip-paul-mueller Jun 10, 2024
50860bb
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 10, 2024
4f52bad
WIP: requirements manager
egparedes May 29, 2024
9af8a4e
Small changes to the documentation of the translators.
philip-paul-mueller Jun 10, 2024
647c5f7
Implemented pytrees.
philip-paul-mueller Jun 11, 2024
c8c612c
Update tooling configs.
egparedes Jun 11, 2024
4788405
Update hooks versions
egparedes Jun 12, 2024
414c55f
Fix code style in markdown file
egparedes Jun 12, 2024
8cec411
Made some cleaning to the pytree implementation.
philip-paul-mueller Jun 12, 2024
9b40b27
Fine tune rule ignores
egparedes Jun 12, 2024
894b10c
More fixes and additions to ruff config
egparedes Jun 12, 2024
1928b95
Add coverage config from Philip
egparedes Jun 12, 2024
9909f6d
More fine tuning of ruff and pre-commit
egparedes Jun 12, 2024
5f24405
Removed a convenience function.
philip-paul-mueller Jun 12, 2024
cc7f649
Fix wrong place to add ruff configuration
egparedes Jun 12, 2024
03d6d08
Updates from new config
egparedes Jun 12, 2024
0da47fa
Fixes
egparedes Jun 12, 2024
b7a166f
Back to defaults
egparedes Jun 12, 2024
367e7b6
Fix format
egparedes Jun 12, 2024
1e825c3
Applied some of enriques new configuration.
philip-paul-mueller Jun 12, 2024
7607fd9
Merge remote-tracking branch 'enrique/more_configs' into initial_impl…
philip-paul-mueller Jun 12, 2024
b759c3b
Merge branch 'main' into req_sync
egparedes Jun 12, 2024
d123166
Final cleanups and fixes
egparedes Jun 12, 2024
39dd108
Clean up sync script
egparedes Jun 12, 2024
889ec88
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 13, 2024
c1074c4
Fixed an issue with the optimization options.
philip-paul-mueller Jun 13, 2024
9ac17bd
Implemented a `CompiledJaxprSDFG` object.
philip-paul-mueller Jun 13, 2024
6a8e2b5
Made some cleaning.
philip-paul-mueller Jun 13, 2024
c05ee3c
Added a test for the pytree support in JaCe.
philip-paul-mueller Jun 13, 2024
ce4c643
Enabled the optimization mode in the tests again.
philip-paul-mueller Jun 13, 2024
1743374
Disabled the elementconversion stuff, since it takes too long.
philip-paul-mueller Jun 13, 2024
efc27e0
Disabled the optimized unit tests, since there is a simplification bu…
philip-paul-mueller Jun 13, 2024
0221d7b
Updated the tests a little bit.
philip-paul-mueller Jun 13, 2024
fd9fb8e
This should solve some cache issue.
philip-paul-mueller Jun 13, 2024
e43dd53
Renamed the `mkarray()` function to `make_array()`.
philip-paul-mueller Jun 13, 2024
744c2b2
Should cover most of the pep whatever naming.
philip-paul-mueller Jun 13, 2024
a11f111
Merge remote-tracking branch 'github/main' into initial_implementation
philip-paul-mueller Jun 14, 2024
9cd0e01
This should fix the problems in the CI.
philip-paul-mueller Jun 14, 2024
3377f41
Now allowed direct return values even in non empty Jaxpr.
philip-paul-mueller Jun 14, 2024
8065ed2
Merge remote-tracking branch 'fork/req_sync_fix' into initial_impleme…
philip-paul-mueller Jun 14, 2024
272dd00
Bump version.
philip-paul-mueller Jun 14, 2024
3e5408b
Bump version.
philip-paul-mueller Jun 14, 2024
3f1d2ad
Updated the ignore file to also include some JaCe stuff.
philip-paul-mueller Jun 14, 2024
e6730d1
Moved tracing to its own top level module.
philip-paul-mueller Jun 14, 2024
82cf898
Updated the ROADMAP.
philip-paul-mueller Jun 14, 2024
da57db9
Improve developer documentation and add devenv session setup to nox
egparedes Jun 14, 2024
6eef078
Add information message
egparedes Jun 14, 2024
1700885
Merge remote-tracking branch 'enrique/req_sync' into initial_implemen…
philip-paul-mueller Jun 14, 2024
90a25a6
Merge remote-tracking branch 'github/main' into initial_implementation
philip-paul-mueller Jun 17, 2024
61638df
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 17, 2024
6369908
pytest now ignores deprication warnings from numpy, this is needed be…
philip-paul-mueller Jun 17, 2024
afe5cdf
Merge branch 'initial_implementation' into initial_implementation_cont
philip-paul-mueller Jun 17, 2024
0aa1726
Changed the names inside the test to make them conforming to an (in t…
philip-paul-mueller Jun 17, 2024
3424a59
Updated the tracing function.
philip-paul-mueller Jun 17, 2024
d8603d5
Now the arguments of the wrapped functions are type chakable.
philip-paul-mueller Jun 18, 2024
54374d3
Added partial support for return value typing in the stages.
philip-paul-mueller Jun 18, 2024
261d902
Imporved typing in the tracing signature.
philip-paul-mueller Jun 18, 2024
027ae35
The options for Jit are now represented as a `TypedDict`.
philip-paul-mueller Jun 18, 2024
7cdb5f5
Integrated part of teh development branch into the new PR branch.
philip-paul-mueller Jun 18, 2024
21e64a8
Merge branch 'extended_infrastructure' into dev_branch
philip-paul-mueller Jun 18, 2024
9fe9e2d
Updated the translators a little bit.
philip-paul-mueller Jun 19, 2024
2ecb7ee
Added teh concatenation translator.
philip-paul-mueller Jun 19, 2024
0b52d4b
First batch of the first review.
philip-paul-mueller Jun 21, 2024
4eb806f
second batch of first review round.
philip-paul-mueller Jun 21, 2024
744738b
DaCe does not consider dashes as valid names.
philip-paul-mueller Jun 21, 2024
71b6422
Changed `finalize_compilation_options()` to `make_final_compilation_o…
philip-paul-mueller Jun 23, 2024
e3a96ad
Merge branch 'extended_infrastructure' into dev_branch
philip-paul-mueller Jun 23, 2024
bcd941f
It seems that `dace.is_array()` does not considers zero dimensional a…
philip-paul-mueller Jun 23, 2024
4be66b1
Fixed a bug in `is_tracing_ongoing()`.
philip-paul-mueller Jun 23, 2024
617c5c1
Updated the `get_jax_literal_value()` function.
philip-paul-mueller Jun 23, 2024
031b33f
Updated the tests after merging the new PR into the development branch.
philip-paul-mueller Jun 23, 2024
c582669
Fixed a bug in `is_tracing_ongoing()`.
philip-paul-mueller Jun 23, 2024
565c69d
Updated the `get_jax_literal_value()` function.
philip-paul-mueller Jun 23, 2024
0dd9404
Imported some files to silence mypy.
philip-paul-mueller Jun 23, 2024
6b69a45
Fixed a naming error.
philip-paul-mueller Jun 24, 2024
f7ee981
Fixed a naming issue.
philip-paul-mueller Jun 24, 2024
8698397
Specified that a transient is exactly written once.
philip-paul-mueller Jun 24, 2024
f3a65d6
Fixed the noxfile, it now uses the correct Sphinx version.
philip-paul-mueller Jun 24, 2024
969f2f8
The README is now included in the documentation.
philip-paul-mueller Jun 24, 2024
29d09e7
It should be `Note:` instead of `Notes:`.
philip-paul-mueller Jun 24, 2024
d029d13
It should be `Note:` insteed of `Notes:`.
philip-paul-mueller Jun 24, 2024
bb938c7
Merge branch 'extended_infrastructure' into dev_branch
philip-paul-mueller Jun 24, 2024
4f343b3
Started with a document that outlines differences between JaCe and JA…
philip-paul-mueller Jun 24, 2024
72d6771
Added the clamp primitive, that we will need later.
philip-paul-mueller Jun 24, 2024
1766bc3
Modified the test function.
philip-paul-mueller Jun 24, 2024
d3dac22
Added a test for proper broadcasting of ternary operators.
philip-paul-mueller Jun 24, 2024
25f52a9
Added a function that is able to incorporate a context into an other …
philip-paul-mueller Jun 24, 2024
ed8f653
Fixed the concatenate translator.
philip-paul-mueller Jun 24, 2024
f4104b8
Added a translator for the `pjit` primitive.
philip-paul-mueller Jun 24, 2024
95853a3
Added a constructor to `JaCeVar` to construct it from an JAX Atom.
philip-paul-mueller Jun 24, 2024
67e546c
Added the functionality to the `pjit` translator to handle literal in…
philip-paul-mueller Jun 24, 2024
0ec665b
The Jaxpr that is translated is now aviable in the lowered object.
philip-paul-mueller Jun 24, 2024
5bc6220
Added tests for the `pjit` primitives.
philip-paul-mueller Jun 24, 2024
5385a5c
Cleared a bit the tests.
philip-paul-mueller Jun 24, 2024
1296b9d
The function to promote literals to constant is now a free function, …
philip-paul-mueller Jun 24, 2024
7615be3
Why was that thing there?
philip-paul-mueller Jun 24, 2024
70710c1
First implementation of the conditional primitive.
philip-paul-mueller Jun 25, 2024
44a8a80
Addressed Enruiques Suggestions.
philip-paul-mueller Jun 25, 2024
c8a6aa8
Squashed commit of the following:
philip-paul-mueller Jun 25, 2024
819eebb
Made a fix to the tests.
philip-paul-mueller Jun 25, 2024
110b6f4
WIP: Started with a primitive.
philip-paul-mueller Jun 25, 2024
380399a
Updated the list of differences.
philip-paul-mueller Jun 25, 2024
320c528
Added tests for the condition.
philip-paul-mueller Jun 25, 2024
e2ebc4e
Implemented propagation of Memlets in the generated graphs.
philip-paul-mueller Jun 26, 2024
071923c
Added a test for scalar branches.
philip-paul-mueller Jun 27, 2024
0869287
Added Enriques suggestions.
philip-paul-mueller Jul 1, 2024
e7fa770
Adapted the tests.
philip-paul-mueller Jul 1, 2024
aa92f01
Applied Enrique's suggestions.
philip-paul-mueller Jul 1, 2024
36e6b6b
Squashed commit of the following:
philip-paul-mueller Jul 1, 2024
a25ecb7
Added Enrique's suggestions.
philip-paul-mueller Jul 2, 2024
3048019
Updated the tests.
philip-paul-mueller Jul 2, 2024
8932815
Merge remote-tracking branch 'github/main' into dev_branch
philip-paul-mueller Jul 31, 2024
f9ee01a
Made some small modifications.
philip-paul-mueller Sep 13, 2024
fa65ee7
Ported the gather translator.
philip-paul-mueller Sep 13, 2024
b9f9427
Made it possible the the `make_array()` function is able scale automa…
philip-paul-mueller Sep 13, 2024
5a3c87f
Added tests for the gather primitive.
philip-paul-mueller Sep 13, 2024
d6265bc
Added all translators from teh development branch.
philip-paul-mueller Sep 13, 2024
25616ae
Modified the condition primitive.
philip-paul-mueller Sep 13, 2024
24d97fb
Nobody needs that thest in this form.
philip-paul-mueller Sep 13, 2024
9f22bd2
Merge branch 'new_translators' into dev_branch
philip-paul-mueller Sep 13, 2024
411bd7b
Since the bug mention in DaCe issue |1595 was resolved we can enable it.
philip-paul-mueller Sep 13, 2024
c8b7d86
First batch of Enrique's suggestions, but still not done.
philip-paul-mueller Sep 24, 2024
cb600d3
Refactored the gather translator.
philip-paul-mueller Sep 24, 2024
c29fc0d
Some more corrections.
philip-paul-mueller Sep 24, 2024
b0ac641
Merge branch 'new_translators' into dev_branch
philip-paul-mueller Sep 24, 2024
3ee8dad
Made it run again.
philip-paul-mueller Sep 24, 2024
e787ee9
Fixed an error in the tests.
philip-paul-mueller Sep 24, 2024
846a345
Fixed some errors.
philip-paul-mueller Sep 24, 2024
a546932
Merge branch 'new_translators' into new_test_suite
philip-paul-mueller Sep 24, 2024
090c3a2
Updated the `make_array()` function.
philip-paul-mueller Sep 25, 2024
e667854
Disabled the simplify pass again in the tests.
philip-paul-mueller Sep 25, 2024
6fe78b0
Fixed an error in the tests.
philip-paul-mueller Sep 25, 2024
d88752a
The test was not really testing anything, okay if it was working.
philip-paul-mueller Sep 25, 2024
2c7b3c8
Applied Enriques primarly fixes.
philip-paul-mueller Sep 26, 2024
5687f40
Merge branch 'new_translators' into new_test_suite
philip-paul-mueller Sep 26, 2024
cc10a48
Splited a test into multiple one, for better pinpointing.
philip-paul-mueller Sep 26, 2024
18bdee9
Apply suggestions from code review
philip-paul-mueller Sep 26, 2024
3588a77
Merge branch 'new_translators' into new_test_suite
philip-paul-mueller Sep 26, 2024
2169470
The import error that panda is not found is now ignored.
philip-paul-mueller Sep 27, 2024
e17b4eb
Merge branch 'main' into new_test_suite
philip-paul-mueller Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A kind of roadmap that gives a rough idea about how the project will be continue
- [x] Annotation `@jace.jit`.
- [x] Composable with Jax, i.e. take the Jax derivative of a JaCe annotated function.
- [x] Implementing the `stages` model that is supported by Jax.
- [ ] Handling Jax arrays as native input (only on single host).
- [x] Handling Jax arrays as native input (only on single host).
- [x] Cache the compilation and lowering results for later reuse.
In Jax these parts (together with the dispatch) are actually written in C++, thus in the beginning we will use a self made cache.
- [ ] Implementing some basic `PrimitiveTranslators`, that allows us to run some early tests, such as:
Expand All @@ -23,6 +23,7 @@ A kind of roadmap that gives a rough idea about how the project will be continue
But passing these benchmarks could give us some better hint of how to proceed in this matter.
- [ ] Passing the [pyhpc-benchmark](https://github.com/dionhaefner/pyhpc-benchmarks)
- [ ] Passing Felix' fluid project; possibility.
- [ ] Flash-Attention, there is a DaCe implementation.
- [ ] Support of static arguments.
- [ ] Stop relying on `jax.make_jaxpr()`.
Look at the `jax._src.pjit.make_jit()` function for how to hijack the staging process.
Expand Down
2 changes: 0 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
```{toctree}
:maxdepth: 2
:hidden:

```

```{include} ../README.md
:start-after: <!-- SPHINX-START -->
```

## Indices and tables
Expand Down
21 changes: 21 additions & 0 deletions docs/main_differences.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Main Differences Between DaCe and JaCe and JAX and JaCe

Essentially JaCe is a frontend that allows DaCe to process JAX code, thus it has to be compatible with both, at least in some sense.
We will now list the main differences between them, furthermore, you should also consult the ROADMAP.

### JAX vs. JaCe:

- JaCe always traces with enabled `x64` mode.
This is a restriction that might be lifted in the future.
- JAX returns scalars as zero-dimensional arrays, JaCe returns them as array with shape `(1, )`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

@philip-paul-mueller philip-paul-mueller Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main issue is that DaCe does not have a real concept of zero dimensional arrays, as far as I know.
Consider the following two functions

@dace.program
def bar(a: dace.float64):
    return a + 1

@dace.program
def baz(a: dace.float64[1]):
    return a + 1

if you pass a zero dimensional array to bar() then it will be casted to an scalar, if you pass it to baz() an error will happen.
Furthermore, the binary interface of the SDFG can not return scalars, return values have to be arrays there is no way around that without patching the code generator and making a lot of changes to handle special cases.
So I decided to follow PEP20 and decided that this case is not special enough to change the rule.
If you want this feature then please open an issue.

- In JAX parts of the computation runs on CPU parts on GPU, in JaCe everything runs (currently) either on CPU or GPU.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean here? Which parts run on CPU/GPU in JAX?

Copy link
Contributor Author

@philip-paul-mueller philip-paul-mueller Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JAX compiler, i.e. XLA can decide to do this.
The question is, if it really does it.

- Currently JaCe is only able to run on CPU (will be lifted soon).
- Currently JaCe is not able to run distributed (will be lifted later).
- Currently not all primitives are supported.
- JaCe does not return `jax.Array` instances, but NumPy/CuPy arrays.
- The execution is not asynchronous.
Comment on lines +15 to +16
Copy link
Collaborator

@egparedes egparedes Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two points could be also fixed in the future, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### DaCe vs. JaCe:

- JaCe accepts complex objects using JAX' pytrees.
- JaCe will support scalar inputs on GPU.
5 changes: 4 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ def docs(session: nox.Session) -> None:
@nox.session(reuse_venv=True)
def api_docs(session: nox.Session) -> None:
"""Build (regenerate) API docs."""
session.install(f"sphinx=={REQUIREMENTS['sphinx']}")
sphinx_req = REQUIREMENTS["sphinx"]
if sphinx_req.isdigit():
sphinx_req = "==" + sphinx_req
session.install(f"sphinx{sphinx_req}")
session.chdir("docs")
session.run(
"sphinx-apidoc",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
filterwarnings = [
"error",
"ignore:numpy\\..*:DeprecationWarning", # DaCe is not NumPy v2.0 ready so ignore the usage of deprecated features.
"ignore:pandas not found, skipping conversion test\\.:ImportWarning", # Pandas is not installed on the CI.
]
log_cli_level = "INFO"
minversion = "6.0"
Expand Down Expand Up @@ -233,7 +234,6 @@ max-complexity = 12
]
"tests/**" = [
"D", # pydocstyle
"N", # TODO(egparedes): remove ignore as soon as all tests are properly named
"PLR2004", # [magic-value-comparison]
"T10", # flake8-debugger
"T20", # flake8-print
Expand Down
8 changes: 8 additions & 0 deletions tests/common_fixture.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# JaCe - JAX Just-In-Time compilation using DaCe (Data Centric Parallel Programming)
#
# Copyright (c) 2024, ETH Zurich
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""Contains all common fixture we need."""
102 changes: 102 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# JaCe - JAX Just-In-Time compilation using DaCe (Data Centric Parallel Programming)
#
# Copyright (c) 2024, ETH Zurich
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""General configuration for the tests.

Todo:
- Implement some fixture that allows to force validation.
"""

from __future__ import annotations

from collections.abc import Generator

import jax
import numpy as np
import pytest

from jace import optimization, stages
from jace.util import translation_cache as tcache


Copy link
Collaborator

@egparedes egparedes Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all fixtures in this module:

Additionally, I would define another fixture requesting all other fixtures expected in the standard case and use this group fixtures in the pytestmark at module level. Example:

# This file
@pytest.fixture
def standard_jace_test_settings(enable_x64_mode_in_jax, disable_jit, ...) -> ...:
     ....

# Other test files
pytestmark = pytest.mark.usefixtures("standard_jace_test_settings")

Finally, I'd create a simpler type alias for the return type of generator fixtures as suggested here :

T = TypeVar("T")
YieldFixture = Generator[T, None, None]

@pytest.fixture
def foo() -> YieldFixture[str]:
    yield "foo"

@pytest.fixture(autouse=True)
def _enable_x64_mode_in_jax() -> Generator[None, None, None]:
"""Fixture of enable the `x64` mode in JAX.

Currently, JaCe requires that `x64` mode is enabled and will do all JAX
things with it enabled. However, if we use JAX with the intend to compare
it against JaCe we must also enable it for JAX.
"""
with jax.experimental.enable_x64():
yield


@pytest.fixture(autouse=True)
def _disable_jit() -> Generator[None, None, None]:
"""Fixture for disable the dynamic jiting in JAX, used by default.

Using this fixture has two effects.
- JAX will not cache the results, i.e. every call to a jitted function will
result in a tracing operation.
- JAX will not use implicit jit operations, i.e. nested Jaxpr expressions
using `pjit` are avoided.

This essentially disable the `jax.jit` decorator, however, the `jace.jit`
decorator is still working.

Note:
The second point, i.e. preventing JAX from running certain things in `pjit`,
is the main reason why this fixture is used by default, without it
literal substitution is useless and essentially untestable.
In certain situation it can be disabled.
"""
with jax.disable_jit(disable=True):
yield


@pytest.fixture()
def _enable_jit() -> Generator[None, None, None]:
"""Fixture to enable jit compilation.

Essentially it undoes the effects of the `_disable_jit()` fixture.
It is important that this fixture is not automatically activated.
"""
with jax.disable_jit(disable=False):
yield


@pytest.fixture(autouse=True)
def _clear_translation_cache() -> Generator[None, None, None]:
"""Decorator that clears the translation cache.

Ensures that a function finds an empty cache and clears up afterwards.
"""
tcache.clear_translation_cache()
yield
tcache.clear_translation_cache()


@pytest.fixture(autouse=True)
def _reset_random_seed() -> None:
"""Fixture for resetting the random seed.

This ensures that for every test the random seed of NumPy is reset.
This seed is used by the `util.mkarray()` helper.
"""
np.random.seed(42) # noqa: NPY002 [numpy-legacy-random]


@pytest.fixture(autouse=True)
def _set_compile_options() -> Generator[None, None, None]:
"""Disable all optimizations of jitted code.

Without explicitly supplied arguments `JaCeLowered.compile()` will not
perform any optimizations.
Please not that certain tests might override this fixture.
"""
with stages.set_compiler_options(optimization.NO_OPTIMIZATIONS):
yield
11 changes: 11 additions & 0 deletions tests/integration_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# JaCe - JAX Just-In-Time compilation using DaCe (Data Centric Parallel Programming)
#
# Copyright (c) 2024, ETH Zurich
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""JaCe's integration tests.

Currently they are mostly related to the primitive translators.
"""
8 changes: 8 additions & 0 deletions tests/integration_tests/primitive_translators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# JaCe - JAX Just-In-Time compilation using DaCe (Data Centric Parallel Programming)
#
# Copyright (c) 2024, ETH Zurich
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""Tests related to the actual primitive subtranslators."""
40 changes: 40 additions & 0 deletions tests/integration_tests/primitive_translators/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# JaCe - JAX Just-In-Time compilation using DaCe (Data Centric Parallel Programming)
#
# Copyright (c) 2024, ETH Zurich
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""General configuration for the tests of the primitive translators."""

from __future__ import annotations

from collections.abc import Generator

import pytest

from jace import optimization, stages


@pytest.fixture(
autouse=True,
params=[
optimization.NO_OPTIMIZATIONS,
pytest.param(
optimization.DEFAULT_OPTIMIZATIONS,
marks=pytest.mark.skip(
"Simplify bug 'https://github.com/spcl/dace/issues/1595'; resolved > 16.1"
),
),
],
)
def _set_compile_options(request) -> Generator[None, None, None]:
"""Set the options used for testing the primitive translators.

This fixture override the global defined fixture.

Todo:
Implement a system that only runs the optimization case in CI.
"""
with stages.set_compiler_options(request.param):
yield
Loading
Loading