Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

https://www.svp-team.com/forum/viewtopi … 483#p81483
and copy the onnx moel in the correct folder
you need put the *.onnx files here C:\Program Files (x86)\SVP 4\rife\models\rife

452 (edited by grobalt 09-01-2023 11:16:58)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

here's a full script you can use for testing
run with
> vspipe test.py .

variables:
- frame size on line 16, "length" is the number of source frames
- CPU threads on line 6
- GPU streams on line 27
- SVP's add. functions on/off - comment line 69

I thought the problem was in a CPU threads number, which was 4 before, and it's not enough to feed the GPU. Now it's 8, but you're saying there's no difference. Which is strange.
DON'T FORGET TO RESTART SVP after .js/.py file replacing, it may not reload these files automatically in some cases

---
BTW use_cuda_graph=True gives only like 2% difference in my case

Better late than never smile
Output 2000 frames in 15.43 seconds (129.62 fps)

changing clip = core.std.BlankClip(width=1920,height=1080,length=1000,format=vs.YUV420P8)
to
clip = core.std.BlankClip(width=3840,height=2160,length=1000,format=vs.YUV420P8)

Output 2000 frames in 62.34 seconds (32.08 fps)

P.S. i ordered new hardware to test .. Ryzen 7700x, DDR5 7200 Memory etc.

453 (edited by grobalt 09-01-2023 11:36:03)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

aloola wrote:

[vapoursynth]
https://media.discordapp.net/attachments/290709370600423424/1061384563072454847/image.png?width=512&height=545

RIFE TRT ~83FPS, easy to watch x3 24 1080p in realtime. Compare with vsrife ~60fps

this screenshot shows software h264 transcoding, if i use the settings of the screenshot my 6core CPU is at 100%, GPU with 2 threads at about 35% utilization and 19fps (4k) or 41 fps (starts above 50 but after some time 41 is stabelized) (1080p)
however, your CPU is a 2CCD Model with higher memory write bandwidth ... let's see what happens when my new hardware arrives, it seems the 4090 is quite limited on the ryzen 5xxx platform

454

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

grobalt wrote:

this screenshot shows software h264 transcoding, if i use the settings of the screenshot my 6core CPU is at 100%, GPU with 2 threads at about 35% utilization and 19fps (4k) or 41 fps (starts above 50 but after some time 41 is stabelized) (1080p)

Use the 'ultrafast' preset and let us know if performance has improved:
https://trac.ffmpeg.org/wiki/Encode/H.264

We are now testing RIFE and looking for bottlenecks smile

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

with software transcoding ?

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

UHD
> We are now testing

you are not big_smile

457 (edited by UHD 09-01-2023 13:33:53)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

UHD
> We are now testing

you are not big_smile

I'm testing virtually without a proper graphics card, and this is even more difficult lol

458

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

grobalt wrote:

with software transcoding ?

288 new fps (1080p) for 4090+13900k (TensorRT8.5+vs_threads=4+fp16) (rife46) (num_streams=10) (benchmark was done with vspipe file.py -p . instead of piping into ffmpeg and rendering to avoid cpu bottleneck)

164 new fps (1080p) for 4090+5950x (ncnn+2 threads+4 vs threads+ffmpeg (ultrafast) (rife4.6)

Source: https://github.com/styler00dollar/VSGAN-tensorrt-docker


It is best to check and test all options.

459

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

In my opinion, the more options are tested and the more test details are given the better. As for example in this already quite old post:

blackmickey1007 wrote:

### Environment ###
Windows 10
DDR4-2933 48GiB
Nvidia RTX2070 8GiB
Nvidia Driver 511.79
CUDA Toolkit 11.3
cuDNN v8.2.1 (June 7th, 2021), for CUDA 11.x

### Software ###
Python 3.10.4
VapourSynth R58-RC2
PyTorch 1.11.0 (CUDA 11.3)
vs_rife v2.0.0
VapourSynth-RIFE-ncnn-Vulkan r3 (model: 4.0)

### Tools & Seting ###
GPU-Z 2.45.0
VapourSynth Editor r19-mod-5-AC2
VapourSynth threads: core.num_threads = 4
Decoder: lsmas.LWLibavSource(format="yuv420p8", prefer_hw=3)
Video: demo.mp4 [720p]

### Result ###
1. RIFE filter for VapourSynth (PyTorch CUDA) - vs_rife v2.0.0
    Interpolation: x2
    RIFE model: 4.0
    scale: 1.0
    FP16: False
   
    FPS: 54.115
    CUDA: ~50%
    PerfCap: VRel, VOp, Pwr

2. RIFE filter for VapourSynth (PyTorch CUDA) - vs_rife v2.0.0
    Interpolation: x2
    RIFE model: 4.0
    scale: 0.5
    FP16: False
   
    FPS: 69.997
    CUDA: ~40%
    PerfCap: VRel, VOp

3. RIFE filter for VapourSynth (PyTorch CUDA) - vs_rife v2.0.0
    Interpolation: x2
    RIFE model: 4.0
    scale: 0.5
    FP16: True
   
    FPS: 70.936
    CUDA: ~32%
    PerfCap: VRel, VOp

4. RIFE filter for VapourSynth (ncnn Vulkan) - VapourSynth-RIFE-ncnn-Vulkan r3
    Interpolation: x2
    RIFE model: 4.0
    GPU thread: 1
    tta: False
    uhd: False
    sc: True
   
    FPS: 27.356
    CUDA: ~1%
    Compute_1: 30%
    PerfCap: Idle
   
5. RIFE filter for VapourSynth (ncnn Vulkan) - VapourSynth-RIFE-ncnn-Vulkan r3
    Interpolation: x2
    RIFE model: 4.0
    GPU thread: 2
    tta: False
    uhd: False
    sc: True
   
    FPS: 92.956
    CUDA: ~15%
    Compute_1: ~94%
    PerfCap: VRel, VOp, Pwr
   
6. RIFE filter for VapourSynth (ncnn Vulkan) - VapourSynth-RIFE-ncnn-Vulkan r3
    Interpolation: x2
    RIFE model: 4.0
    GPU thread: 2
    tta: False
    uhd: True
    sc: True
   
    FPS: 92.366
    CUDA: ~15%
    Compute_1: ~94%
    PerfCap: VRel, VOp, Pwr
   
7. RIFE filter for VapourSynth (ncnn Vulkan) - VapourSynth-RIFE-ncnn-Vulkan r3
    Interpolation: x2
    RIFE model: 4.0
    GPU thread: 2
    tta: False
    uhd: False
    sc: False
   
    FPS: 87.083
    CUDA: ~15%
    Compute_1: ~94%
    PerfCap: VRel, VOp, Pwr
   
8. RIFE filter for VapourSynth (ncnn Vulkan) - VapourSynth-RIFE-ncnn-Vulkan r3
    Interpolation: x2
    RIFE model: 4.0
    GPU thread: 3
    tta: False
    uhd: False
    sc: True
   
    FPS: 90.645
    CUDA: ~15%
    Compute_1: ~94%
    PerfCap: Idle

https://www.svp-team.com/forum/viewtopi … 219#p80219

460 (edited by Xenocyde 09-01-2023 16:18:14)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

grobalt wrote:

https://www.svp-team.com/forum/viewtopi … 483#p81483
and copy the onnx moel in the correct folder
you need put the *.onnx files here C:\Program Files (x86)\SVP 4\rife\models\rife

I followed the steps, think I did everything I was supposed to, but somehow this implementation does not seem as smooth as the mvp-lazy one. I get almost no contour artifacts for sure, but I can still see some sort of "ghost" trails and smoothness seems a bit off too. Maybe something is wrong on my side? As you can see the TensorRT is part of the Automatic profile, not sure if that's right.

Post's attachments

Untitled.png, 50.35 kb, 616 x 862
Untitled.png 50.35 kb, 144 downloads since 2023-01-09 

461 (edited by Xenocyde 09-01-2023 18:50:24)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Realized that I need to be in the RIFE video profile. So I switched to RIFE, I activate it with the new ON/OFF switch, a window pops up with some processes, after 3 minutes it's done and... it's not working properly. I'm getting 0.75 out of 1 and sound is lagging.

Post's attachments

Untitled.png, 52.84 kb, 607 x 867
Untitled.png 52.84 kb, 143 downloads since 2023-01-09 

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

don't do "fixed 60 fps" with RIFE

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

don't do "fixed 60 fps" with RIFE

Switched to "To Screen" , Movie X2/3/4, still getting 0.75 and sound is lagging.

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

GOOD NEWS EVERYONE!

updated instructions

should improve FPS on 4080-and-better (probably 4070/3080 too, dunno), when performance is bound by the system's RAM bandwidth, not GPU power
i.e. for 4K playback

grobalt
> P.S. i ordered new hardware to test .. Ryzen 7700x, DDR5 7200 Memory etc.

cancel your order big_smile

465 (edited by Xenocyde 09-01-2023 19:08:37)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

updated instructions

should improve FPS on 4080-and-better (probably 4070 too, dunno), when performance is bound by the system's RAM bandwidth, not GPU power
i.e. for 4K playback

I have 32 GB DDR4-3200 RAM and trying to do real-time for 1080p. Grobalt said 1080p real-time should be ok on RTX 3070 laptop GPU. I can run things smoothly on mvp-lazy.

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

> Grobalt said 1080p real-time should be ok on RTX 3070 laptop GPU

not sure what you're doing, but it's OK even on a 2060 laptop now big_smile

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

> Grobalt said 1080p real-time should be ok on RTX 3070 laptop GPU

not sure what you're doing, but it's OK even on a 2060 laptop now big_smile

Well, what should I do? Reinstall SVP + MPV + Rife support and redo the installation for the new TRT stuff?

468 (edited by Xenocyde 09-01-2023 20:02:34)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

So I reinstalled everything and now the SVP index shows N/A and I did not get any window pop up to wait 3 minutes before it calculates stuff. Not sure what I'm doing wrong.

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Xenocyde wrote:
Chainik wrote:

> Grobalt said 1080p real-time should be ok on RTX 3070 laptop GPU

not sure what you're doing, but it's OK even on a 2060 laptop now big_smile

Well, what should I do? Reinstall SVP + MPV + Rife support and redo the installation for the new TRT stuff?

maybe you follow VSRIFE guide, and not vsmltrt guide

uninstall SVP and follow the guide
https://www.svp-team.com/forum/viewtopi … 483#p81483

470 (edited by UHD 09-01-2023 20:06:55)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

GOOD NEWS EVERYONE!

updated instructions

should improve FPS on 4080-and-better (probably 4070/3080 too, dunno), when performance is bound by the system's RAM bandwidth, not GPU power
i.e. for 4K playback


Chainik wrote:

not sure what you're doing, but it's OK even on a 2060 laptop now big_smile

What exactly did you do? I'm very curious to know what solved the memory problems. 1080p real time with RIFE using 2060 laptop is impressive!

471 (edited by Xenocyde 09-01-2023 20:13:14)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

aloola wrote:
Xenocyde wrote:
Chainik wrote:

> Grobalt said 1080p real-time should be ok on RTX 3070 laptop GPU

not sure what you're doing, but it's OK even on a 2060 laptop now big_smile

Well, what should I do? Reinstall SVP + MPV + Rife support and redo the installation for the new TRT stuff?

maybe you follow VSRIFE guide, and not vsmltrt guide

uninstall SVP and follow the guide
https://www.svp-team.com/forum/viewtopi … 483#p81483

I reinstalled SVP, I did the TRT update, and now real-time interpolation does not even start. Well actually I do not know how to do this part: Make a copy of the RIFE video profile, one with TensorRT ON and another with OFF.

472 (edited by pille 09-01-2023 20:15:24)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Hmm, even after reinstal.

Post's attachments

htrthhtth.jpg, 409.15 kb, 661 x 329
htrthhtth.jpg 409.15 kb, 130 downloads since 2023-01-09 

473 (edited by aloola 09-01-2023 21:01:34)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

EDIT: I downloaded the new pack and reinstalled it. it works again smile

basic, redownload all the files.

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

I deleted SVP and startet from scratch, just to check if the inscructions are complete and everything is working.
There is a step missing.
After replacing generate.js and base.py, start SVP4, add the new option TensorRT etc.

Then the missing step:
Copy the Rife AI profile and select the AI Model "rife"
Enable the new Option TensorRT On

475 (edited by DragonicPrime 09-01-2023 21:05:07)

Re: New RIFE filter - 3x faster AI interpolation possible in SVP!!!

Chainik wrote:

GOOD NEWS EVERYONE!

updated instructions

should improve FPS on 4080-and-better (probably 4070/3080 too, dunno), when performance is bound by the system's RAM bandwidth, not GPU power
i.e. for 4K playback

grobalt
> P.S. i ordered new hardware to test .. Ryzen 7700x, DDR5 7200 Memory etc.

cancel your order big_smile

Just tried the updated instructions. Getting around 50fps at 4k with an RTX 4090 now. Between 170-190fps(it kept going up and down for some reason) at 1080p. These improvements are huge. Thanks for updating the instructions.
Edit: Just tested a bit more. 4k at 2x in real time now works for non HDR videos. With HDR at 4k, I only get around 35-40fps, so it is not possible yet.