I'm new to Polygraphy, and my command looks like this:
polygraphy run
${onnx_path}
--onnxrt --trt
--providers cpu
--pool-limit workspace:24G
--atol 1e-3 --rtol 1e-3
--tf32
--verbose
--trt-min-shapes input:[1,3,1333,1333] --trt-opt-shapes input:[1,3,1333,1333] --trt-max-shapes input:[1,3,1333,1333]
--input-shapes 'input:[1,3,1333,1333]'
--onnx-outputs mark all
--trt-outputs mark all
--load-timing-cache ${timing_cache_path}
--load-inputs ${cus_inputs}
--save-engine ${trt_path}
> result-run.txt
Since my model is a ViT (Vision Transformer) and the input size [3,1333,1333] is quite large, my RTX 4090 with 24GB VRAM runs into an OOM (Out of Memory) error.
To address this, I'm considering not marking all layers at once but instead marking them in batches—for example:
5 layers at a time:
--trt-outputs "layer0 layer1 layer2 layer3 layer4"
or 100 layers at a time, but doing this manually in the command line is very inconvenient.
Question: Does the mark option accept a file as input? For example:
--trt-outputs layer_names.txt
I'm new to Polygraphy, and my command looks like this:
polygraphy run
${onnx_path}
--onnxrt --trt
--providers cpu
--pool-limit workspace:24G
--atol 1e-3 --rtol 1e-3
--tf32
--verbose
--trt-min-shapes input:[1,3,1333,1333] --trt-opt-shapes input:[1,3,1333,1333] --trt-max-shapes input:[1,3,1333,1333]
--input-shapes 'input:[1,3,1333,1333]'
--onnx-outputs mark all
--trt-outputs mark all
--load-timing-cache ${timing_cache_path}
--load-inputs ${cus_inputs}
--save-engine ${trt_path}
> result-run.txt
Since my model is a ViT (Vision Transformer) and the input size [3,1333,1333] is quite large, my RTX 4090 with 24GB VRAM runs into an OOM (Out of Memory) error.
To address this, I'm considering not marking all layers at once but instead marking them in batches—for example:
5 layers at a time:
--trt-outputs "layer0 layer1 layer2 layer3 layer4"
or 100 layers at a time, but doing this manually in the command line is very inconvenient.
Question: Does the mark option accept a file as input? For example:
--trt-outputs layer_names.txt