Open elegios opened 1 year ago
For accelerate, there are specific test files (test/examples/accelerate/*.mc
) that use acceleration, for which we try compiling and executing both with acceleration enabled and in debug mode (where we verify that the well-formedness checks pass). Relevant information for these tests:
which nvcc
) and Futhark (which futhark
)mi compile --accelerate
and mi compile --debug-accelerate
Note that these tests are currently not included in make test-all
. They have hardware requirements (a CUDA-compatible GPU), so I don’t think they should be included there for now.
Would this new Makefile setup be a wrapper for tup or a reworking of what we have now? I think the tup system looks nice and it would tie in nicely with the "quick" tests. Some additional comments:
make test/accelerate
(quick tests + accelerate), make test/js
(quick tests + javascript), or make test/accelerate/sundials
(quick tests + accelerate and sundials). For example, I if I changed the underlying CUDA installation and want to rerun the accelerate tests only I could do it as make test/accelerate -B
.Boot
library is a dependency and must be installed, but I do not think that it makes sense to install the boot
binary by default since that is not something you would use outside of the miking bootstrapping process.Note that these tests are currently not included in
make test-all
. They have hardware requirements (a CUDA-compatible GPU), so I don’t think they should be included there for now.
This is an interesting and somewhat inconvenient point. I guess the ideal case is that if you run test-all
without the correct hardware it should give a warning but not run those tests, and if you have the correct hardware it should run the tests whether you have the dependencies or not?
Also, @larshum, I'm guessing the files compiled with --accelerate
and --debug-accelerate
should also be run (with no arguments?), not just compiled?
Would this new Makefile setup be a wrapper for tup or a reworking of what we have now?
I don't think we should move to tup as the main/only build approach just yet, partly because of the FUSE difficulties on Mac, and partly because there's an issue that needs to be fixed before our setup works properly (I'm using a locally patched version until then).
- Using Makefile patterns, you could parse additional target aspects to specify non-standard aspects that you also want to test. Such as
make test/accelerate
(quick tests + accelerate),make test/js
(quick tests + javascript), ormake test/accelerate/sundials
(quick tests + accelerate and sundials). For example, I if I changed the underlying CUDA installation and want to rerun the accelerate tests only I could do it asmake test/accelerate -B
.
I did not know you could do quite that level of fanciness in make targets. It would certainly be convenient with a quick way of specifying different subsets. It's worth noting though that we're not really using make
for it's intended purpose in most of this design (essentially no dependency tracking, just a collection of tasks to run), so it's not a given that we want to keep using make
.
- When you say "mi and boot library", do you refer to the executables? The
Boot
library is a dependency and must be installed, but I do not think that it makes sense to install theboot
binary by default since that is not something you would use outside of the miking bootstrapping process.
I meant the mi
executable and the boot
library, but not the boot
executable. I've updated the original issue to clarify.
Also, @larshum, I'm guessing the files compiled with --accelerate and --debug-accelerate should also be run (with no arguments?), not just compiled?
Yes, that's the idea — both compiling and executing.
It is still not possible to build sundialsml
with the opam
switch we use with Miking and I'm not able to build it from source on Fedora 37.
If you want to check if it is installed I suppose you can do a ocamlfind query sundialsml
. For the ipopt interface you can check for the required opam package with ocamlfind query ipoptml
.
As you probably already know, the tests for these two are currently defined in test-sundials.mk
and test-ipopt.mk
.
test/examples/tuning
are run with mi tune
subcommand, as defined in test-tune.mk
.stdlib/cp/solve.mc
that require minizinc
(which minizinc
) to be installed. Right now, these tests do not run if minizinc
is not available.It is still not possible to build
sundialsml
with theopam
switch we use with Miking and I'm not able to build it from source on Fedora 37.If you want to check if it is installed I suppose you can do a
ocamlfind query sundialsml
. For the ipopt interface you can check for the required opam package withocamlfind query ipoptml
.
@br4sco Since these would be using externals I assume we expect them to fail when interpreted? The current compile tests seem to disable both optimizations and prune-utests
, is that important here?
- The files in
test/examples/tuning
are run withmi tune
subcommand, as defined intest-tune.mk
.
@lingmar I'm guessing that these tests should work in interpreted mode, but that they might be too slow for it? Maybe only some of them?
Also, should they be compiled and run as normal as well, or just via tune
?
@lingmar I'm guessing that these tests should work in interpreted mode, but that they might be too slow for it? Maybe only some of them? Also, should they be compiled and run as normal as well, or just via
tune
?
They don't have to be compiled and run as normal, via tune
is enough. Tuning is not supported in interpreted mode so that is not needed either.
@br4sco Since these would be using externals I assume we expect them to fail when interpreted? The current compile tests seem to disable both optimizations and
prune-utests
, is that important here?
Sorry for the late reply. It is not important. You cannot currently do a test-all-prune-utest
on the non-multicore switch unless you apply this patch.
diff --git a/test-files.mk b/test-files.mk
index 82b4601d..71c4f13a 100644
--- a/test-files.mk
+++ b/test-files.mk
@@ -60,6 +60,7 @@ compile_files_exclude += test/mlang/also_includes_lib.mc
compile_files_exclude += test/mlang/mlang.mc
compile_files_exclude += test/mlang/nestedpatterns.mc
compile_files_exclude += test/mlang/catchall.mc
+compile_files_exclude += stdlib/multicore/thread.mc
# Programs that we currently cannot interpret/test. These are programs written
I don't remember exactly why, but some dependency isn't pruned.
The JVM backend stdlib/jvm/compile.mc
:
Dependencies:
java
and javac
. I have been using version 17, but I think the lowest you can go is 11. Java 8 which is the most common one does not work!
To see if they exist use which java
and which javac
.
You can check the version with java --version
and javac --version
. This works for HopSpot, other JVMs might have other flags for checking the version.
One more thing, I need some jar files to compile the java program used in the backend. Right now I fetch them from mvn repositories with curl
in the backend. I do not know if it is better if they were fetched by some other script or something which prepares testing/running of the backend.
Our build and test system is getting a bit unwieldy, and it currently requires a large number of files at the top-level of the repo. We'd like to address both of these points, and this issue is intended to track that effort.
Tasks
mc
files should have the following tests by default:mi compile --test
.mi eval --test
(and no arguments to the program itself).mc
-files that are tested as normal but only if the dependencies are available.mc
-files that should not be tested as normal, even if dependencies are available.mc
-files that require other flags or arguments, or things that are run in entirely different ways.Targets/interface
test-quick
, a small set of tests that use no optional dependencies, as a sanity check.test
, run all tests for which dependencies are installed, i.e., it is "smart". This should print what was chosen and what wasn't.test-all
, liketest
, but unconditionally run all tests, i.e., it fails if there's a dependency missing.build/mi
, the default target via full bootstrapping. Should maybe overwrite an already built compiler, so it doesn't need to be combined withmake clean
all the time?mi
.boot
, for the interpreter and the library.install
, install (already built)mi
executable andboot
library.install-boot
, install the (already built)boot
library.watch
, to watch for changes viaentr
and runtup
clean
, remove all files in the repository that are ignored (i.e., via.gitignore
), which should include all build artifacts.Questions/problems:
test
could (optionally) be told exactly which sets of tests to run, andtest-quick
andtest-all
are just special cases?mi
for the tests (installed, full bootstrapped, or bootstrapped via installed).watch
that does not usetup
? It would presently not handle dependencies, i.e., everything would be re-run all the time, which is probably not all that useful?watch
but only re-run a subset of the tests.Collected test information
test/examples/accelerate/**/*.mc
)which nvcc
) and Futhark (which futhark
). Also hardware requirements, so should perhaps not even be included unconditionally intest-all
.mi compile --accelerate
andmi compile --debug-accelerate
, followed by running as usual.stdlib/sundials/**/*.mc
)ocamlfind query sundialsml
test/examples/tuning/**/*.mc
)mi tune --test --disable-optimizations --compile --disable-exit-early --enable-cleanup
, followed by running as usual.stdlib/cp/solve.mc
)which minizinc
stdlib/jvm/compile.mc
)which java
andwhich javac
), should perhaps check version (>= 11?).