onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

Memory Optimization for Compilation in OVEP

Open sfatimar opened this issue 1 year ago • 6 comments

Calling Split API Calls Read+Model in lieu of unified Compile Model call for export compile flow to ensure memory optimization. Freeing up model proto and serialized string and read model ov ir later to free up memory for the ahead pipeline Optimization during EpCtxt flow All the Graph related operations require all the Node Attributes to be set while dealing with model instances internally with them, in the existing implementation these attributes make a copy when constructing a Graph dynamically during runtime. Propose to use these attributes in place without creating a copy to avoid memory allocation / copy while calling these Graph related functions. Changes to ensure the bug fixes related to openvino version and epctxt file path. Moving Compiler version to C++20 for getting r-value mem optimizations benefit

Motivation and Context

This change is required because memory optimization during Compilation flow is too high.

sfatimar avatar Aug 27 '24 04:08 sfatimar

@jywu-msft

sfatimar avatar Aug 27 '24 04:08 sfatimar

@jywu-msft Please review

sfatimar avatar Aug 27 '24 04:08 sfatimar

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar Aug 28 '24 04:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 28 '24 04:08 azure-pipelines[bot]

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar Aug 28 '24 15:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 28 '24 15:08 azure-pipelines[bot]

Fixed Unit test failures

sfatimar avatar Aug 29 '24 14:08 sfatimar

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar Aug 29 '24 14:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 14:08 azure-pipelines[bot]

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, Linux QNN CI Pipeline

adrianlizarraga avatar Aug 29 '24 15:08 adrianlizarraga

Azure Pipelines successfully started running 8 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 15:08 azure-pipelines[bot]

/azp run Windows CPU CI Pipeline, Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows ARM64 QNN CI Pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed, Windows x64 QNN CI Pipeline, Linux MIGraphX CI Pipeline, Big Models

adrianlizarraga avatar Aug 29 '24 16:08 adrianlizarraga

/azp run ONNX Runtime React Native CI Pipeline, orttraining-amd-gpu-ci-pipeline, Linux Android Emulator QNN CI Pipeline

adrianlizarraga avatar Aug 29 '24 16:08 adrianlizarraga

Azure Pipelines successfully started running 9 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 16:08 azure-pipelines[bot]

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 16:08 azure-pipelines[bot]

/azp run Windows GPU CUDA CI Pipeline, Windows GPU DML CI Pipeline, Windows GPU Doc Gen CI Pipeline

adrianlizarraga avatar Aug 29 '24 16:08 adrianlizarraga

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 16:08 azure-pipelines[bot]

@jywu-msft Can you help with retriggering the linux pipelines for the failure logs on onnxruntime_test_python.py unit tests.

preetha-intel avatar Aug 30 '24 19:08 preetha-intel

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar Aug 30 '24 19:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 30 '24 19:08 azure-pipelines[bot]

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar Aug 31 '24 06:08 jywu-msft

Pull request contains merge conflicts.

azure-pipelines[bot] avatar Aug 31 '24 06:08 azure-pipelines[bot]

@jywu-msft The merge conflicts are fixed. OVEP Internal ci pipeline is successful. Can you kick start the workflows at your availability

preetha-intel avatar Sep 02 '24 15:09 preetha-intel

/azp run Windows CPU CI Pipeline, Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows ARM64 QNN CI Pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed, Windows x64 QNN CI Pipeline, Linux MIGraphX CI Pipeline, Big Models

jywu-msft avatar Sep 02 '24 17:09 jywu-msft

/azp run Windows GPU CUDA CI Pipeline, Windows GPU DML CI Pipeline, Windows GPU Doc Gen CI Pipeline

jywu-msft avatar Sep 02 '24 17:09 jywu-msft

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Sep 02 '24 17:09 azure-pipelines[bot]

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, Linux QNN CI Pipeline

jywu-msft avatar Sep 02 '24 17:09 jywu-msft

Azure Pipelines successfully started running 9 pipeline(s).

azure-pipelines[bot] avatar Sep 02 '24 17:09 azure-pipelines[bot]

/azp run Linux OpenVINO CI Pipeline

jywu-msft avatar Sep 02 '24 17:09 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 02 '24 17:09 azure-pipelines[bot]