From b95556af0e9ee5d2858546d6d5cd9ca3ad1431ec Mon Sep 17 00:00:00 2001 From: zhoujiamin01 Date: Wed, 30 Aug 2023 23:45:29 -0700 Subject: [PATCH] Add stable diffusion fp32 case --- inference/configs/stable_diffusion_v1_4/configurations.yaml | 6 ++---- .../vendor_config/kunlunxin_configurations.yaml | 3 +++ inference/inference_engine/kunlunxin/xtcl.py | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 inference/configs/stable_diffusion_v1_4/vendor_config/kunlunxin_configurations.yaml diff --git a/inference/configs/stable_diffusion_v1_4/configurations.yaml b/inference/configs/stable_diffusion_v1_4/configurations.yaml index 77014a03b..d085bae98 100644 --- a/inference/configs/stable_diffusion_v1_4/configurations.yaml +++ b/inference/configs/stable_diffusion_v1_4/configurations.yaml @@ -3,14 +3,12 @@ batch_size: 2 # Attention! For transformer decoder like bert, 1 token cause 2*param flops, so we need 2*length*params like 2*512*0.33B here # format: a_1*a*2*...*a_nea_0,like 2*512*0.33e9(bert) or 4.12e9(resnet50) flops: 6.78e11 -fp16: false -compiler: tensorrt num_workers: 8 log_freq: 5 repeat: 1 # skip validation(will also skip create_model, export onnx). Assert exist_onnx_path != null -no_validation: false # set a real onnx_path to use exist, or set it to anything but null to avoid export onnx manually(like torch-tensorrt) -exist_onnx_path: null +exist_onnx_path: ../../onnxs/stable_diffusion_v1_4_bs2_pytorch_fp16False.onnx # set a exist path of engine file like resnet50.trt/resnet50.plan/resnet50.engine exist_compiler_path: null + diff --git a/inference/configs/stable_diffusion_v1_4/vendor_config/kunlunxin_configurations.yaml b/inference/configs/stable_diffusion_v1_4/vendor_config/kunlunxin_configurations.yaml new file mode 100644 index 000000000..ed982f5f1 --- /dev/null +++ b/inference/configs/stable_diffusion_v1_4/vendor_config/kunlunxin_configurations.yaml @@ -0,0 +1,3 @@ +fp16: false +compiler: xtcl +no_validation: true diff --git a/inference/inference_engine/kunlunxin/xtcl.py b/inference/inference_engine/kunlunxin/xtcl.py index 396cc3ae9..dc1964b2f 100755 --- a/inference/inference_engine/kunlunxin/xtcl.py +++ b/inference/inference_engine/kunlunxin/xtcl.py @@ -23,7 +23,6 @@ def build_engine(self, config, onnx_path): for input in onnx_model.graph.input: input_shape = input.type.tensor_type.shape.dim input_shape = [a.dim_value for a in input_shape] - input_shape[0] = config.batch_size input_name = input.name #'inputs:0' self.input_names.append(input_name) shape_dict[input_name] = input_shape