-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IR] Implement save/load functions in IR and handle external data properly #1801
Conversation
Is it only the path change that makes it more efficient? |
I added PR description |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1801 +/- ##
==========================================
- Coverage 75.07% 75.03% -0.04%
==========================================
Files 245 248 +3
Lines 26555 26633 +78
Branches 4873 4887 +14
==========================================
+ Hits 19936 19984 +48
- Misses 5685 5707 +22
- Partials 934 942 +8 ☔ View full report in Codecov by Sentry. |
Test Results 24 files ± 0 24 suites ±0 3h 32m 17s ⏱️ + 7m 30s For more details on these failures, see this check. Results for commit 7887b9e. ± Comparison against base commit 87aee66. This pull request removes 2220 tests.
|
Implement efficient save/load and handle loading external data properly in the IR.
Before this change, when a ModelProto containing external data is converted to IR, the external tensor objects will load the data from a path relative to the working directory, not the ONNX file. This is because we do not store the onnx file path and thus have no way to look for the external data file.
With the change, a
base_dir
property is added to ExternalTensor that we can set, in a separate pass when the directory is available, so the object has full information to find the data file on disk. The base_dir is not serialized to the proto to maintain a relative path in the "location" field in TensorProto.#1701, #1792
Example: