PyTorch Workflow - 3.5 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2023-09-28
Version
3.5 English

To generate the quantized inference model and reference result, follow these steps:

  1. Generate the quantized inference model by running the following command to quantize the model.
    python resnet18_quant.py --quant_mode calib --subset_len 200
  2. Set deploy_check to True in export_xmodel API.
    quantizer.export_xmodel(deploy_check=True)
  3. Generate the reference result by running the following command to generate reference data.
    python resnet18_quant.py --quant_mode test  --deploy
  4. Generate the DPU xmodel by running the following command to generate the DPU XMODEL file.
    vai_c_xir -x /PATH/TO/quantized.xmodel -a /PATH/TO/
    arch.json -o /OUTPUTPATH -n netname}
  5. Generate the DPU inference result.

    This step is the same as the step in the TensorFlow workflow.

  6. Crosscheck the reference result and the DPU inference result.

    This step is the same as the step in the TensorFlow workflow.