beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.15k stars 109 forks source link

Fix recompilation when batch processing is not triggered #447

Closed jjfumero closed 3 weeks ago

jjfumero commented 3 weeks ago

Description

This patch provides a fix to avoid continuous recompilation of execution plans that do not use batch processing. TornadoVM was set to recompile every time, but we only need to recompile under certain conditions only when using batch processing, or when changing the device.

Side note: We need the benchmarking suite for the AERO project.

Problem description

The issue was that the benchmark suite, and therefore, user code, can trigger recompilation over and over again due to a condition for batch processing.

Backend/s tested

Mark the backends affected by this PR.

OS tested

Mark the OS where this PR is tested.

Did you check on FPGAs?

If it is applicable, check your changes on FPGAs.

How to test the new patch?

$ tornado --enableProfiler console -m tornado.benchmarks/uk.ac.manchester.tornado.benchmarks.BenchmarkRunner blackscholes

$ tornado-test -V uk.ac.manchester.tornado.unittests.batches.TestBatches

Test: class uk.ac.manchester.tornado.unittests.batches.TestBatches
    Running test: testSameInputSizeAndTypeRestriction ................  [PASS] 
    Running test: test100MBSmall             ................  [PASS] 
    Running test: test100MBSmallLazy         ................  [PASS] 
    Running test: test100MB                  ................  [PASS] 
    Running test: test100MBLazy              ................  [PASS] 
    Running test: test300MB                  ................  [PASS] 
    Running test: test300MBLazy              ................  [PASS] 
    Running test: test512MB                  ................  [PASS] 
    Running test: test512MBLazy              ................  [PASS] 
    Running test: test50MB                   ................  [PASS] 
    Running test: test50MBInteger            ................  [PASS] 
    Running test: test50MBShort              ................  [PASS] 
    Running test: test50MBDouble             ................  [PASS] 
    Running test: test50MBLong               ................  [PASS] 
    Running test: testSameInputSizeAndTypeRestrictionJavaArrays ................  [PASS] 
    Running test: testSameInputTypeRestriction ................  [PASS] 
    Running test: testSameInputTypeRestrictionJavaArrays ................  [PASS] 
    Running test: testSameInputSize          ................  [PASS] 
    Running test: testSameInputSizeJavaArrays ................  [PASS] 
    Running test: testSameInputSizeJavaToTornado ................  [PASS] 
    Running test: testSameInputSizeTornadoToJava ................  [PASS] 
    Running test: testSameInputSizeAndTypeJavaToTornado ................  [PASS] 
    Running test: testSameInputSizeAndTypeTornadoToJava ................  [PASS] 
    Running test: testBatchNotEven           ................  [PASS] 
    Running test: testBatchNotEven2          ................  [PASS] 
    Running test: testBatchNotEven2Lazy      ................  [PASS] 
    Running test: testBatchThreadIndex       ................  [PASS] 
Test ran: 27, Failed: 0, Unsupported: 0
jjfumero commented 3 weeks ago

Validation has been fixed too.