@@ -71,27 +71,27 @@ def main(config):
7171 )
7272 blockwise_opt .run_block_loop ()
7373
74- if 'eval' in config and 'transformed' in config .eval .eval_pos :
75- blockwise_opt .deploy ('origin_float' )
76- for ppl_eval in eval_list :
77- ppl = ppl_eval .eval (model )
78- logger .info (f'{ ppl_eval .dataset } ppl : { ppl } ' )
79-
80- if 'cvt' in config and config .get ('cvt' , True ):
81- blockwise_opt .run_block_cvt ()
82-
83- if 'save' in config and config .save .get ('save_trans' , False ):
84- blockwise_opt .save_model (save_trans_path )
85-
86- if 'save' in config and config .save .get ('save_trtllm' , False ):
87- blockwise_opt .save_model (save_trtllm_trans_path )
88- from llmc .utils .export_trtllm import cvt_trtllm_engine
89-
90- cvt_trtllm_engine (
91- save_trtllm_trans_path ,
92- save_trtllm_engine_path ,
93- config .save .get ('trtllm_cfg' ),
94- )
74+ if 'eval' in config and 'transformed' in config .eval .eval_pos :
75+ blockwise_opt .deploy ('origin_float' )
76+ for ppl_eval in eval_list :
77+ ppl = ppl_eval .eval (model )
78+ logger .info (f'{ ppl_eval .dataset } ppl : { ppl } ' )
79+
80+ if 'cvt' in config and config .get ('cvt' , True ):
81+ blockwise_opt .run_block_cvt ()
82+
83+ if 'save' in config and config .save .get ('save_trans' , False ):
84+ blockwise_opt .save_model (save_trans_path )
85+
86+ if 'save' in config and config .save .get ('save_trtllm' , False ):
87+ blockwise_opt .save_model (save_trtllm_trans_path )
88+ from llmc .utils .export_trtllm import cvt_trtllm_engine
89+
90+ cvt_trtllm_engine (
91+ save_trtllm_trans_path ,
92+ save_trtllm_engine_path ,
93+ config .save .get ('trtllm_cfg' ),
94+ )
9595
9696 if 'eval' in config and 'fake_quant' in config .eval .eval_pos :
9797 blockwise_opt .deploy ('fake_quant' )
0 commit comments