@@ -45,27 +45,49 @@ impl Default for CudaConfig {
4545/// NVIDIA TensorRT execution provider configuration.
4646#[ derive( Debug , Clone , Serialize , Deserialize ) ]
4747pub struct TensorRtConfig {
48+ pub detailed_build_log : bool ,
4849 pub fp16 : bool ,
50+ pub int8 : bool ,
51+ /// Description: specify INT8 calibration table file for non-QDQ models in INT8 mode.
52+ /// Note: calibration table should not be provided for QDQ model
53+ /// because TensorRT doesn’t allow calibration table to be loded if there is any Q/DQ node in the model.
54+ /// By default the name is empty.
55+ pub int8_calibration_table_name : String ,
56+ /// Description: select what calibration table is used for non-QDQ models in INT8 mode.
57+ /// If True, native TensorRT generated calibration table is used;
58+ /// If False, ONNXRUNTIME tool generated calibration table is used.
59+ /// Note: Please copy up-to-date calibration table file to trt_engine_cache_path before inference.
60+ /// Calibration table is specific to models and calibration data sets.
61+ /// Whenever new calibration table is generated, old file in the path should be cleaned up or be replaced.
62+ pub int8_use_native_calibration_table : bool ,
4963 pub engine_cache : bool ,
5064 pub timing_cache : bool ,
5165 pub dump_ep_context_model : bool ,
5266 pub dump_subgraphs : bool ,
5367 pub builder_optimization_level : u8 ,
5468 pub max_workspace_size : usize ,
5569 pub min_subgraph_size : usize ,
70+ pub dla_core : u32 ,
71+ pub dla : bool ,
5672}
5773
5874impl Default for TensorRtConfig {
5975 fn default ( ) -> Self {
6076 Self {
77+ detailed_build_log : true ,
6178 fp16 : true ,
79+ int8 : false ,
80+ int8_calibration_table_name : "" . to_string ( ) ,
81+ int8_use_native_calibration_table : true ,
6282 engine_cache : true ,
6383 timing_cache : false ,
6484 dump_ep_context_model : false , // TODO
6585 dump_subgraphs : false ,
6686 builder_optimization_level : 3 , // 3, 0-5
6787 max_workspace_size : 1073741824 , // 1G
6888 min_subgraph_size : 1 ,
89+ dla_core : 0 ,
90+ dla : false ,
6991 }
7092 }
7193}
0 commit comments