Model Export to TensorRT-LLM

To enable the export stage with a ViT model, configure the configuration files:

  1. In the defaults section of conf/config.yaml, update the export field to point to the desired ViT configuration file. For example, if you want to use the vit/export_vit configuration, change the export field to vit/export_vit.

    Copy
    Copied!
                

    defaults: - export: vit/export_vit ...

  2. In the stages field of conf/config.yaml, make sure the export stage is included. For example,

    Copy
    Copied!
                

    stages: - export ...

  3. Configure infer.max_batch_size of the conf/export/vit/export_vit.yaml file to set the max_batch_size to use for the ONNX and NVIDIA TensorRT model.

  4. Set the resolution of the model with max_dim in the infer field. This will be used to generate the ONNX and NVIDIA TensorRT formats.

Remarks:

  1. To load a pretrained checkpoint for inference, set the restore_from_path field in the model section to the path of the pretrained checkpoint in .nemo format in conf/export/vit/export_vit.yaml. By default, this field links to the .nemo format checkpoint located in the ImageNet 1K fine-tuning checkpoints folder.

Previous Framework Inference
Next Model Deployment
© Copyright 2023-2024, NVIDIA. Last updated on Apr 25, 2024.