k4yt3x / video2x

A machine learning-based lossless video super resolution framework. Est. Hack the Valley II, 2018.
https://video2x.org
GNU Affero General Public License v3.0
10.72k stars 1k forks source link

Hardware Acceleration on Downscaling #405

Closed Super99Master closed 1 month ago

Super99Master commented 4 years ago

Description

Add Hardware Acceleration to the Downscaling process since it's barely using the CPU.

Sources

HADownscaling

Running 2 Downscaler for a max of 32% CPU utilization.

GitGerby commented 3 years ago

I haven't looked at the code yet; would it be possible to launch N downscaling processes where N is the number of logical processors on the system?

Super99Master commented 3 years ago

I haven't looked at the code yet; would it be possible to launch N downscaling processes where N is the number of logical processors on the system?

Yes https://github.com/Super99Master/video2x/commit/a1b2aa380d67fe423d63c113d6bc471b03c8c3ff

Results of Multythreading: Number of threads | Whole time compleation (3 run avg) | Runs 1 | 118,19566 | 117.69998 119.31545 117.57157 4 | 52,39386 | 54.2574 52.24034 50.68386 12 | 40,72011 | 40.01302 41.70235 40.44497

I think 4 threads is good enough without pinning the processor at 100%. With 4 threads it was around 80% utilization

Super99Master commented 3 years ago

https://github.com/Super99Master/video2x/commits/master

This is more or less how multithreading the downscaling process should work,

Rmdhn1 commented 3 years ago

Can i leave the downscaling, put that commit into mine, and then continue where i left off don't wanna spend 5 hours downscaling when you spent 4 upscaling

Super99Master commented 3 years ago

Can i leave the downscaling, put that commit into mine, and then continue where i left off don't wanna spend 5 hours downscaling when you spent 4 upscaling

Sorry, but i don't understand what you mean. Multy threaded downscaling was added in the dev tree

Rmdhn1 commented 3 years ago

also, huh, i downloaded it from git and the downscaling isn't multi threaded, i checked it on the python code and it isn't there

edit: OH GOD DAMNIT, DEV TREE? I DOWNLOADED THE MASTER

Super99Master commented 3 years ago

also, huh, i downloaded it from git and the downscaling isn't multi threaded, i checked it on the python code and it isn't there

edit: OH GOD DAMNIT, DEV TREE? I DOWNLOADED THE MASTER

https://github.com/k4yt3x/video2x/pull/449

k4yt3x commented 3 years ago

FYI: The 5.0 beta will be streamlined, so it will also be multi-threaded...or multi-processed rather.