-
Notifications
You must be signed in to change notification settings - Fork 47
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
lavfi/dnn: Unification of Async and Sync Modes #423
Conversation
cf5ad0e
to
0d9f960
Compare
caa6689
to
c3f61cf
Compare
c3f61cf
to
5f12a38
Compare
eee1825
to
160b77a
Compare
81704ce
to
092a580
Compare
the four patches relative to last level task can be merged together, I see it would be large (thanks for considering small patches), it is more nature to be together. |
looks good to me, please send to ffmpeg community. thanks. @Semmer2 could you also have a test after the patches are sent, thanks. |
Sure, I'll send it in a few minutes after rebasing to the latest master. Thank you for reviewing. |
145434e
to
8a214fc
Compare
lgtm |
8a214fc
to
f40ce8e
Compare
Hi, |
f40ce8e
to
e17772d
Compare
I have corrected the patch and tested it with the following commands. ClassificationI tried with these values of async (0,0), (0,1), (1,0), (1,1) where (x,y) = (async value in detect, async value in classify)
DetectionTried with
DerainTried with
SR filterTried with
DNN ProcessingTried with
In the native backend, async is not supported, so @guoyejun @Semmer2 Sir, can you have a look at the above commands and check if I missed any filter? Thank you. |
Hi Shubhanshu, |
Thanks. I'll send the updated patches to the mailing list. |
we may need to merge the last patch into the patch which causes the issue |
I think the patch Shall I merge these? (these = |
yes, we'd keep every single patch not breaking things. |
19d2108
to
c604077
Compare
This commit rearranges the code in Native Backend to use the TaskItem for inference. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
This commit unifies the async and sync mode from the DNN filters' perspective. As of this commit, the Native backend only supports synchronous execution mode. Now the user can switch between async and sync mode by using the 'async' option in the backend_configs. The values can be 1 for async and 0 for sync mode of execution. This commit affects the following filters: 1. vf_dnn_classify 2. vf_dnn_detect 3. vf_dnn_processing 4. vf_sr 5. vf_derain This commit also updates the filters vf_dnn_detect and vf_dnn_classify to send only the input frame and send NULL as output frame instead of input frame to the DNN backends. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
This commit removes the unused sync mode specific code from the DNN filters since the sync and async mode are now unified from the filters' perspective. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
Remove async flag from filter's perspective after the unification of async and sync modes in the DNN backend. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
This patch renames the InferenceItem to LastLevelTaskItem in the three backends to avoid confusion among the meanings of these structs. The following are the renames done in this patch: 1. extract_inference_from_task -> extract_lltask_from_task 2. InferenceItem -> LastLevelTaskItem 3. inference_queue -> lltask_queue 4. inference -> lltask 5. inference_count -> lltask_count Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
c604077
to
8bac25e
Compare
i see you just force-pushed the patches, is it a rebase or something new? |
Actually, I saw some CI tests failing, so thought to rebase against the latest master. Nothing new added. |
Patch Set Description
This patchset is a part of optional deliverables in the GSoC project Async Support for TensorFlow Backend in FFmpeg.
Objective: Unification of async and sync modes in the DNN backends from the filters' perspective.
Parts under this deliverable:
- Unifies the async and sync modes in the DNN backend from the filters' perspective.
- Adds
TaskItem
based inference in Native backend.- Renames
InferenceItem
toLastLevelTaskItem
.Methodology
In this patchset, we plan to deliver a common inference function for async and sync modes to the filters (as compared to the two functions
ff_dnn_execute_model_async
andff_dnn_execute_model
). This will simplify the code on the filter side and the filters don't have to care about the mode of execution. With this patchset, the image frames are sent first by the frames and then collected using theff_dnn_get_result
function which sends back the input and output frames in a sequential manner.The execution mode can now be set by using the
async
flag in thebackend_configs
as follows:backend_configs=async=1
backend_configs=async=0
Another part of this patchset contains the renaming of the
InferenceItem
in the three backends toLastLevelTaskItem
and the relevant changes to avoid further confusion in the meaning of these structs.Patches
2c2a825 Task-based Inference in Native Backend
5db5789 Unify Execution Modes in DNN Filters
c0b4154 Remove synchronous functions from DNN filters
42ce1db Remove Async Flag from DNN Filter Side
5f0a0ed Rename InferenceItem to LastLevelTaskItem
85fed1e Include dnn_processing in docs of sr and derain filter