onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

[Draft] QDQ stripping transformation in OpenVINO EP

Open sspintel opened this issue 1 year ago • 3 comments
trafficstars

sspintel avatar May 09 '24 15:05 sspintel

Thanks for the comments @skottmckay. I will address them. Meanwhile, a question. Is there an easy way to check if a given model is QDQ and only apply this transformation if that's the case (other than iterating through the whole graph and checking if a QDQ operator exists), as we don't want to build the graph from scratch for non-QDQ models.

sspintel avatar May 10 '24 07:05 sspintel

Thanks for the comments @skottmckay. I will address them. Meanwhile, a question. Is there an easy way to check if a given model is QDQ and only apply this transformation if that's the case (other than iterating through the whole graph and checking if a QDQ operator exists), as we don't want to build the graph from scratch for non-QDQ models.

I'm not aware of any direct way.

If it isn't a QDQ model the number of nodes returned by GetAllNodeUnits should be equal to the number of nodes in the GraphViewer so you could potentially infer using that.

But calling GetAllNodeUnits is going to be more expensive than iterating and checking if any node's op_type is DQ/Q as a first step so it depends what you want to optimize for.

skottmckay avatar May 10 '24 08:05 skottmckay

Thanks for the comments @skottmckay. I will address them. Meanwhile, a question. Is there an easy way to check if a given model is QDQ and only apply this transformation if that's the case (other than iterating through the whole graph and checking if a QDQ operator exists), as we don't want to build the graph from scratch for non-QDQ models.

I'm not aware of any direct way.

If it isn't a QDQ model the number of nodes returned by GetAllNodeUnits should be equal to the number of nodes in the GraphViewer so you could potentially infer using that.

But calling GetAllNodeUnits is going to be more expensive than iterating and checking if any node's op_type is DQ/Q as a first step so it depends what you want to optimize for.

I'm iterating and checking if any node's op_type is DQ/Q instead and doing qdq stripping only it it's true

sspintel avatar May 13 '24 04:05 sspintel

@jywu-msft

sfatimar avatar May 24 '24 03:05 sfatimar

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar May 24 '24 03:05 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar May 24 '24 03:05 azure-pipelines[bot]

/azp run Linux QNN CI Pipeline,MacOS CI Pipeline,orttraining-amd-gpu-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed,onnxruntime-binary-size-checks-ci-pipeline,Big Models,Android CI Pipeline, Linux Android Emulator QNN CI Pipeline

jywu-msft avatar May 24 '24 05:05 jywu-msft

Azure Pipelines successfully started running 10 pipeline(s).

azure-pipelines[bot] avatar May 24 '24 05:05 azure-pipelines[bot]

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar May 24 '24 14:05 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar May 24 '24 14:05 azure-pipelines[bot]

/azp run Linux QNN CI Pipeline,MacOS CI Pipeline,orttraining-amd-gpu-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed,onnxruntime-binary-size-checks-ci-pipeline,Big Models,Android CI Pipeline, Linux Android Emulator QNN CI Pipeline

jywu-msft avatar May 24 '24 14:05 jywu-msft

Azure Pipelines successfully started running 10 pipeline(s).

azure-pipelines[bot] avatar May 24 '24 14:05 azure-pipelines[bot]

/azp run Windows ARM64 QNN CI Pipeline,Windows x64 QNN CI Pipeline,Windows CPU CI Pipeline,Windows GPU CI Pipeline,Windows GPU TensorRT CI Pipeline,ONNX Runtime Web CI Pipeline,Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline

jywu-msft avatar May 24 '24 18:05 jywu-msft

Azure Pipelines successfully started running 10 pipeline(s).

azure-pipelines[bot] avatar May 24 '24 18:05 azure-pipelines[bot]