* recover overwritten code in #8520 * support fp16 * update spec * apply review comments * support dynamic type check