-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: --assert_all_regions_parallelizable flag that has the same func… #722
Conversation
cd4c265
to
349efe6
Compare
OS:ubuntu-20.04 |
OS = |
LGTM :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, if you can do the small changes that I suggest we can merge :)
compiler/cli.py
Outdated
) | ||
self.add_argument( | ||
"--assert_all_regions_parallelizable", | ||
help="assert that the compiler succeeded with all regions being parallelizable and no general error occuring (used to make tests more robust)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a comment that this is strictly stricter than --assert_compiler_success
compiler/pash_compilation_server.py
Outdated
if compile_success: | ||
response = server_util.success_response( | ||
f"{process_id} {compiled_script_file} {var_file} {input_ir_file}" | ||
) | ||
elif not all_region_parallelizable: | ||
# send specified message to say not all regions are parallelizable instead of general exception caught | ||
response = server_util.error_response(f"{process_id} not all regions are parallelizable; failed to compile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response can be more specific, and slightly reworded. At this point we know precisely which region is not parallelizable, and we can respond with that (instead of a more generic "not all regions"). Also, the all_region_parallelizable
flag could be renamed to current_region_parallelizable
or parallelizability_success
since it refers to a specific region and not all regions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be okay to response with "current region" along with the process_id
? I'm not entirely sure how to refer to a region
Thank you for the reviews!
OS = |
OS:ubuntu-20.04 |
…tion as old assert_compiler_success flag; new assert_compiler_success flag now will not exit with error when regions are unparallelizable and exit with error when general exceptions are caught Signed-off-by: YUUU23 <[email protected]>
Signed-off-by: YUUU23 <[email protected]>
9e67a36
to
536bd8e
Compare
OS = |
OS:ubuntu-20.04 |
Thank you for this fix!! |
To introduce the
--assert_all_regions_parallelizable
flag (should exit with error when bothUnparallelizableError
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 whenUnparallelizableError
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 recognizecompiler/custom_error.py
: introduceNotAllRegionParallelizableError
to be raised whenUnparallelizableError
are caught in thecompile.ir
function inpash/compiler/pash_compiler.py
;NotAllRegionParallelizableError
will be caught incompiler/pash_compilation_server.py
when thecompile.ir
function is called; if this error is caught, the new variableall_region_parallelizable
incompiler/pash_compilation_server.py
will be marked falseerror_response
with a different error message is saved in the compiler serverassert_compiler_success
flag is on andcompile_success
is false butall_region_parallelizable
is true (some general exceptions caught) ; orassert_all_regions_parallelizable
flag on andcompile_success
is false because of both general exceptions or unparallelizable regioncompiler/orchestrator_runtime/pash_prepare_call_compiler.sh
: marks variablepash_all_region_parallelizable
iferror_response
contains message regarding regions not being parallelizable. We should exit on error when,assert_all_regions_parallelizable
flag on andruntime_return_code != 0
: general exceptionassert_all_regions_parallelizable
flag on andpash_all_region_parallelizable != 0
: some region is not parallelizableassert_compiler_success_flag
flag on andruntime_return_code != 0
andpash_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.