You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0015e1
Browse filesBrowse the repository at this point in the historyBrowse files
Summary:
Custom ops for optical-flow frame interpolation networks:
- `et_vk.warp(input, flow)` samples `input` bilinearly at `out_px + flow`, with border padding. A flow warp written in PyTorch builds a normalized grid and calls `grid_sampler_2d`; this op skips the grid, which removes its dispatches and is more accurate in fp16, because the grid's normalized coordinates lose precision at large resolutions.
- `et_vk.warp_blend(img0, img1, flow, mask)` fuses the final step of such a network into one shader: a bilinear upsample of `flow` and `mask` to the image size (when they are smaller), two warps (flow channels 0-1 and 2-3), a sigmoid on the mask, the blend and the clamp.
Both have a reference implementation and a `Meta` kernel, so H and W can be dynamic at export. The partitioner only delegates shapes the shaders handle: flow `[N, 2, H, W]` for `warp`, flow `[N, 4, h, w]` and mask `[N, 1, h, w]` for `warp_blend`, with no broadcasting. The ops have no CPU kernel, so a rejected node fails at load. The two shaders share a bilinear border-sampling helper. Graphs that do not emit these ops are unchanged.
`etvk_ops_bench` gets CPU references for both ops and `operators/warp/cases/correctness.json`: fp32 and fp16, N=2, C in {3, 4, 5, 8}, a 1-pixel-wide input, flows up to +-100 px, and same-size, 2x, non-integer and downsampled flow for `warp_blend`. The `warp` cases are added to the operator lists of `test-vulkan-operators-linux` in `pull.yml` and of the GPU job in `vulkan.yml`.
Reviewed By: SS-JIA
Differential Revision: D129150747
Pull Request resolved: #24692
0 commit comments