ParallelAccelerator.jl icon indicating copy to clipboard operation
ParallelAccelerator.jl copied to clipboard

Fuzz-test ParallelAccelerator against Julia tests

Open lkuper opened this issue 9 years ago • 8 comments

To figure out how robust ParallelAccelerator is, one useful thing to do would be to "fuzz" ParallelAccelerator against the Julia test suite. The idea would be to wrap each test call in an @acc block and see whether ParallelAccelerator can handle the code. We'd expect not to be able to handle a lot of these.

lkuper avatar Mar 30 '16 17:03 lkuper

Would it be useful to have an alternative backend that lowers parallel IR into sequential for loop? This way we won't be limited by CGen, and can focus on testing the functionality of the compiler itself.

ninegua avatar Mar 30 '16 17:03 ninegua

@ninegua Would the threading backend serve that purpose when the number of threads is set to 1?

lkuper avatar Mar 30 '16 18:03 lkuper

There is already testing code in there that converts parfors into explicitly called function. All we'd need to do is to elevate that code to its own "mode" controlled by some option.

DrTodd13 avatar Mar 30 '16 18:03 DrTodd13

@tkelman As someone who knows a lot about the Julia testing infrastructure, do you know if there's an easy way to hook into the Julia test suite and instrument it with @acc wrappers around the tests being run?

lkuper avatar Apr 07 '16 16:04 lkuper

Does it need to be on function definitions, or can it be at call sites?

tkelman avatar Apr 07 '16 19:04 tkelman

@tkelman Hmm, good question. The recommended way of using it is on function definitions. You can use it at call sites, but we were actually talking about deprecating allowing that. How hard would it be to put it on definitions?

lkuper avatar Apr 07 '16 20:04 lkuper

You'd need to put the annotation on all the standard library functions that get called in the tests, I think. Making ParallelAccelerator work during bootstrap could be tricky.

tkelman avatar Apr 07 '16 21:04 tkelman

In that case you might be able to make a smaller modification to the @test macro and get somewhere.

tkelman avatar Apr 07 '16 22:04 tkelman