Interface verificarlo mca - #21
Draft
MinliLiao wants to merge 15 commits into
Draft
Conversation
…_LIB_PATH is defined
…onment variable (same as verificarlo)
…Exponent, toSignificand), where mcaType=0 selects verificarlo MCA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds the option to use verificarlo's MCA backends with a new API
__raptor_mca_op_func(fty * function, int MCA_backend, int from_type, int to_type, int to_exponent, int to_mantissa)which adds MCA on top of raptor op-mode. The first and the last 4 parameters of this API is the same as__raptor_truncate_op_func, where the second parameter indicates which MCA backend is used. Set the second parameter to0for verificarlo's MCA backends.When MCA on the inbound operand values are needed, the function from
__raptor_mca_op_funcwill have MCA added after the inbound operand values are truncated but before performing the operations.With MCA on the outbound operand values are needed, the function from
__raptor_mca_op_funcwill have MCA added after performing the operations but before the outbound operand values are converted back to original precision.To get the similar behavior as verificarlo, the precision need to be increased (increase to double precision for single precision, and 128-bit floating-point for double precision).
To enable the use of verificarlo MCA backend, the path to the verificarlo MCA backend dynamic library
libinterflop_mca.soorlibinterflop_mca_int.sofile need to be passed to the cmake command to compile RAPTOR with-D__RAPTOR_VERIFICARLOMCA_LIB_PATHoption. Both libraries can be passed at the same time, with their paths separated with a semi-colon, where which backend is used will be selectable at runtime.The
libinterflop_mca_int.sobackend need to have the_mcaint_inexact_binary64and_mcaint_inexact_binary128function signatures modified to allow external linkage in verificarlo'ssrc/backends/interflop-backend-mcaint/interflop_mca_int.cto be used by RAPTOR:The options to link against the corresponding verificarlo MCA backend is not included in the RAPTOR wrapper
raptor-clangetc. and would need to be added manually when compiling applications with RAPTOR. If both libraries were included in-D__RAPTOR_VERIFICARLOMCA_LIB_PATH, both libraries also need to be linked.Same as verificarlo, the options for MCA can be set with the
VFC_BACKENDSenvironment variable at runtime.If the
VFC_BACKENDSenvironment variable is not defined or is empty, the default setting is equal toVFC_BACKENDS="default_lib --precision-binary32=24 --precision-binary64=53 --mode=pb --error-mode=rel --max-abs-error-exponent=112 --seed=0 --sparsity=1.0", wheredefault_librefers tolibinterflop_mca_int.soif it is available,libinterflop_mca.sootherwise.