add utils and finish multi-thread training