Precision Mode
Contents
Precision Mode#
This tutorial is available as an IPython notebook at malaya-speech/example/precision-mode.
Let say you want to run the model in FP16, or FP64.
[1]:
import malaya_speech
import logging
logging.basicConfig(level = logging.INFO)
Use specific precision for specific model#
To do that, pass precision_mode
parameter to any load model function in Malaya-Speech,
malaya_speech.gender.deep_model(model = 'vggvox-v2', precision_mode = 'FP16')
Supported precision mode is {'BFLOAT16', 'FP16', 'FP32', 'FP64'}
, default is FP32
, check code at https://github.com/huseinzol05/malaya-boilerplate/blob/main/malaya_boilerplate/frozen_graph.py
[8]:
gender = malaya_speech.gender.deep_model(model = 'vggvox-v2')
# gender_fp16 = malaya_speech.gender.deep_model(model = 'vggvox-v2', precision_mode = 'FP16')
INFO:root:running gender/vggvox-v2 using device /device:CPU:0
Not all operations supported FP16.