-
Notifications
You must be signed in to change notification settings - Fork 106
Upgrade to onnx 1.9 #847
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
Upgrade to onnx 1.9 #847
Conversation
Codecov Report
@@ Coverage Diff @@
## master #847 +/- ##
==========================================
+ Coverage 79.97% 81.00% +1.03%
==========================================
Files 53 55 +2
Lines 8009 8144 +135
==========================================
+ Hits 6405 6597 +192
+ Misses 1604 1547 -57
Continue to review full report at Codecov.
|
Adding support for defining CUDA VERSIONS from outside the docker files, but still using defaults.
|
||
def test_forbidden_external_initializers(env): | ||
if not TEST_ONNX: | ||
env.debugPrint("skipping {} since TEST_ONNX=0".format(sys._getframe().f_code.co_name), force=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env.debugPrint("skipping {} since TEST_ONNX=0".format(sys._getframe().f_code.co_name), force=True) | |
env.debugPrint(f"skipping {sys._getframe().f_code.co_name} since TEST_ONNX=0", force=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in another PR
|
||
# move the external initializer to the redis' current dir (tests/flow/logs) | ||
external_initializer_model = load_file_content("model_with_external_initializers.onnx") | ||
shutil.copy(ROOT+"/tests/flow/test_data/Pads.bin", ROOT+"/tests/flow/logs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ONNX is set to look for the external initializers by default in the current working directory. When we run our tests, this location is ROOT+"/tests/flow/logs"
, so I copy the initializer from our test_data
directory into there.
'AI.MODELSTORE', 'ext_initializers_model{1}', 'ONNX', DEVICE, | ||
'BLOB', external_initializer_model) | ||
|
||
os.remove(ROOT+"/tests/flow/logs/Pads.bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ONNX is set to look for the external initializers by default in the current working directory. When we run our tests, this location is ROOT+"/tests/flow/logs"
, so I after we copy the initializer into there, we remove it at the end of the test
Upgrade python in xenial to 3.7 from 3.6 - just needed for onnx build system. Added help text / make help
@@ -0,0 +1,47 @@ | |||
# RedisAI Development Backends | |||
|
|||
This document describes how a backend for RedisAI can be built, from this repository. It highlights the supported compilation devices on a per-backend basis, and highlights the tools and commands required. Unless indicated otherwise, a backend is compiled in a docker, which is responsible for the configuration and installation of all tools required for a given backend on a per-platform basis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why "a backend"?
we build only ONNXRuntime
maybe explain the need for building a backend. First, start with explaining that we use DISABLE_EXTERNAL_INITIALIZERS=ON
and that made go and building the backend from the source. Also, explain that we do not build the other backend libraries but downloading their binaries from the library websites.
When we need to add more "backend builds" we can add additional "how-to"s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I understand. I that OK if I will make the rephrasing in the next PR (#806 - the one that updates Torch and TF)?
ignore_unversioned_libs | ||
Memcheck:Overlap | ||
... | ||
obj:*/libonnxruntime.so* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the leak/error that made you introduce this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==13852== at 0x483DA20: __memcpy_chk (vg_replace_strmem.c:1593)
==13852== by 0x7EA062B: cpuinfo_linux_parse_cpulist (in /root/project/bin/linux-x64-release/install-cpu/backends/redisai_onnxruntime/lib/libonnxruntime.so.1.9.0)
==13852== by 0x7E9C8D6: cpuinfo_linux_get_max_possible_processor (in /root/project/bin/linux-x64-release/install-cpu/backends/redisai_onnxruntime/lib/libonnxruntime.so.1.9.0)
==13852== by 0x7E9AF61: cpuinfo_x86_linux_init (in /root/project/bin/linux-x64-release/install-cpu/backends/redisai_onnxruntime/lib/libonnxruntime.so.1.9.0)
==13852== by 0x4D6C996: __pthread_once_slow (pthread_once.c:116)
==13852== by 0x7E9AE26: cpuinfo_initialize (in /root/project/bin/linux-x64-release/install-cpu/backends/redisai_onnxruntime/lib/libonnxruntime.so.1.9.0)
==13852== by 0x7CFA76A: onnxruntime::CPUIDInfo::CPUIDInfo() (in /root/project/bin/linux-x64-release/install-cpu/backends/redisai_onnxruntime/lib/libonnxruntime.so.1.9.0)
==13852== by 0x400F379: call_init.part.0 (dl-init.c:72)
==13852== by 0x400F475: call_init (dl-init.c:118)
==13852== by 0x400F475: _dl_init (dl-init.c:119)
==13852== by 0x40132D2: dl_open_worker (dl-open.c:517)
==13852== by 0x4EB2B2E: _dl_catch_exception (dl-error-skeleton.c:196)
==13852== by 0x4012BB9: _dl_open (dl-open.c:599)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming from ONNX, we have it on every test that uses ONNX. It basically says (as I understand) that they use memcpy
instead of memmove
to copy memory from one place to another in the same memory area
This is an infrastructure PR for upgrading onnxruntime to version 1.9.0
This will include @chayim work in #785 (which will be closed as from now).
We temporarily remove the use of Redis allocator as a custom allocator for onnx backend, as this feature relied on our fork onnxruntime repo. The support in Redis custom allocator will be re-introduced in #827, that is dependent on having onnx 1.9.0.
We build onnx 1.9 with the new DISABLE_EXTERNAL_INITIALIZERS flag, and test that we actually cannot load a model that uses external initializers.