pash icon indicating copy to clipboard operation
pash copied to clipboard

feat: --assert_all_regions_parallelizable flag that has the same func…

Open YUUU23 opened this issue 1 year ago • 3 comments

To introduce the --assert_all_regions_parallelizable flag (should exit with error when both UnparallelizableError and general exception are caught) and changing the original --assert_compiler_success flag to exiting with error only when general exceptions are caught (does not exit with error when UnparallelizableError are caught), the following were added:

  • compiler/orchestrator_runtime/pash_init_setup.sh, compiler/cli.py : set-up and add information regarding --assert_all_regions_parallelizable flag for pash to recognize

  • compiler/custom_error.py: introduce NotAllRegionParallelizableError to be raised when UnparallelizableError are caught in the compile.ir function in pash/compiler/pash_compiler.py ;

    • the NotAllRegionParallelizableError will be caught in compiler/pash_compilation_server.py when the compile.ir function is called; if this error is caught, the new variable all_region_parallelizable in compiler/pash_compilation_server.py will be marked false
    • to differentiate all regions not parallelizable from general error, a error_response with a different error message is saved in the compiler server
    • don't increase the running procs if assert_compiler_success flag is on and compile_success is false but all_region_parallelizable is true (some general exceptions caught) ; or assert_all_regions_parallelizable flag on and compile_success is false because of both general exceptions or unparallelizable region
  • compiler/orchestrator_runtime/pash_prepare_call_compiler.sh: marks variable pash_all_region_parallelizable if error_response contains message regarding regions not being parallelizable. We should exit on error when,

    • assert_all_regions_parallelizable flag on and runtime_return_code != 0 : general exception
    • assert_all_regions_parallelizable flag on and pash_all_region_parallelizable != 0 : some region is not parallelizable
    • assert_compiler_success_flag flag on and runtime_return_code != 0 and pash_all_region_parallelizable == 0 : general exception (and not error because some regions were not parallelizable)
  • evaluation/tests/test_evaluation_scripts.sh : when executing tests, change --assert_compiler_success to --assert_all_regions_parallelizable, since what assert_compiler_success originally does is now carried out by --assert_all_regions_parallelizable

Tested the above for expected behavior by running some intro scripts in the directory, and it does seem like we are exiting with error for --assert_compiler_success only when general exceptions are caught and not the unparallelizable ones. We are also exiting on error for both reasons when --assert_all_regions_parallelizable flag is on. When both flags are used at the same time, we follow the behavior of --assert_all_regions_parallelizable. PaSh testing scripts locally also seems to pass all tests.

YUUU23 avatar Jun 16 '24 20:06 YUUU23

OS:ubuntu-20.04 Sun Jun 16 21:02:20 UTC 2024 intro: 2/2 tests passed. interface: 41/41 tests passed. compiler: 54/54 tests passed.

github-actions[bot] avatar Jun 16 '24 21:06 github-actions[bot]

OS = CPU = Ram = Hash = 349efe6d Kernel=

github-actions[bot] avatar Jun 16 '24 21:06 github-actions[bot]

LGTM :-)

yizhengx avatar Jun 18 '24 12:06 yizhengx

OS = CPU = Ram = Hash = 9e67a362 Kernel=

github-actions[bot] avatar Jul 12 '24 20:07 github-actions[bot]

OS:ubuntu-20.04 Fri Jul 12 20:03:49 UTC 2024 intro: 2/2 tests passed. interface: 41/41 tests passed. compiler: 54/54 tests passed.

github-actions[bot] avatar Jul 12 '24 20:07 github-actions[bot]

OS = CPU = Ram = Hash = 536bd8e5 Kernel=

github-actions[bot] avatar Jul 12 '24 20:07 github-actions[bot]

OS:ubuntu-20.04 Fri Jul 12 20:06:57 UTC 2024 intro: 2/2 tests passed. interface: 41/41 tests passed. compiler: 54/54 tests passed.

github-actions[bot] avatar Jul 12 '24 20:07 github-actions[bot]

Thank you for this fix!!

angelhof avatar Jul 26 '24 20:07 angelhof