-
Notifications
You must be signed in to change notification settings - Fork 106
Onnx kill switch #779
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Onnx kill switch #779
Conversation
… multiple devices). Tests pass (new feature hasn't tested yet)
…w device is introduced and use rwlock to synchronise.
…'t overflows than the tensor type in TENSORSET.
Codecov Report
@@ Coverage Diff @@
## master #779 +/- ##
==========================================
+ Coverage 79.22% 79.99% +0.77%
==========================================
Files 50 52 +2
Lines 7662 7767 +105
==========================================
+ Hits 6070 6213 +143
+ Misses 1592 1554 -38
Continue to review full report at Codecov.
|
if (strcasecmp((key), "TF") == 0) { | ||
ret = RAI_LoadBackend(ctx, RAI_BACKEND_TENSORFLOW, (val)); | ||
} else if (strcasecmp((key), "TFLITE") == 0) { | ||
ret = RAI_LoadBackend(ctx, RAI_BACKEND_TFLITE, (val)); | ||
} else if (strcasecmp((key), "TORCH") == 0) { | ||
ret = RAI_LoadBackend(ctx, RAI_BACKEND_TORCH, (val)); | ||
} else if (strcasecmp((key), "ONNX") == 0) { | ||
ret = RAI_LoadBackend(ctx, RAI_BACKEND_ONNXRUNTIME, (val)); |
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 this loading section 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.
This is called from ai.config LOADBACKEND <backend> <backend_path>
command.
…aces that are affected)
…into ONNX_kill_switch
…om backend len (supported only for onnx now) in INFO MODULES command.
- Add a state flag to every entry in the onnx run sessions array and update it atomically, to avoid situations where main threads and bg thread both access the runOptions field. - Refactor the info_modules section, and change AI.INFO command so it must receive a module/script key. The other info will be accessible as part of the info modules command.
…eated from start, number of threads in this case should be larger.
… instance). test info command with AI fields
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.
Very good job!
This PR introduces the "ONNX kill switch" - a mechanism for terminating onnx sessions whose runtime exceeds a certain threshold. It is done by registering a callback to Redis cron event loop (runs by default every 100 ms) upon loading onnx backend. This callback will use the "kill" API that ONNX has for every session that its runtime exceeds the timeout. Note that: