Approximate inference of marginals using the IBIA framework