1. An apparatus to optimize sparse matrix execution, comprising: a context former to identify a matrix function call to a matrix function library, the matrix function call associated with a sparse matrix; a pattern matcher to identify an operational pattern associated with the matrix function call; a code generator to: generate a matrix data structure identifying when persistent data of the sparse matrix changes, the matrix data structure stored external to the matrix function library; and generate a function data structure associated with the matrix function call, the function data structure stored external to the matrix function library; and generate a runtime association between the matrix data structure, the function data structure, and the matrix function call to prevent re-computation of the operational pattern during subsequent use of the matrix function call; and a version checker to determine when the persistent data of the sparse matrix changes based on a comparison of first version information of the matrix data structure and second version information of the function data structure, at least one of the context former, the pattern matcher, the code generator, or the version checker including hardware.