some thoughts:
tldr: the schedule search blows up on branchy graphs (resnet blocks, pyramid pooling, u2net), i added a search budget as a workaround. the ops my nets need (add, avg-pool, stride) don’t really fit “fast unets through fusion”, so question is if denox should be more general “image nets in renderers” or stay unet focused. for now i only opened the bug fixes + bilinear, which make sense either way. models for click/box/brush select + automatic masks are ready and usable if the ops go in, plain unets could be an alternative (not tested). theoretically the new ops could be fused like pool/upsample/concat too, via some prologue / epilogue system for the conv (+ a search that doesn’t blow up on branchy graphs)
so the search quickly blows up in all_minimum_cost_subgraphs (the structural pruning in prune_topological). my nets have resnet style residual blocks + a pyramid pooling block, so lots of split → join, and every branch multiplies the states. oidn and the test models stay at most at ~6.7M states, mine didn’t finish within 15 GB, u2netp needed >26 GB.
i just added a search budget for this which of course works, probably not optimal for graphs over the budget (only the pruning goes greedy, the final selection still picks the best of what’s left), but I didn’t measure how much
and now i trained my own network but it uses resnet style encoders which also blow up (same reason)
i added all this while getting u2net to work without thinking too much, so i quickly wanna stop here and think about if this is even right direction for denox, i added some ops now, (elementwise-add, avg-pool, strided-conv) which my architecture needs (resnet encoder + pyramid pooling, probably closer to SOTA theoretically, not possible with the data anyway) but this does not really fit the idea of the super performant unet execution. if you think about denox as just getting models into vulkan and into renderers, then adding the ops and everything i did makes sense. but if it’s about unets can be done fast with smart fuse then ig not. not sure how karl sees it.
theoretically to just get this working, i can probably use plain unets with the existing features and call it a day. but didn’t test how much worse it is. not really educated guess → not too much worse. resnet style encoders that exist probably win mostly because of image net pretraining (even though residuals prob help)
i opened PRs now for everything that makes sense either way IMO (the bug fixes).
also now opened the bilinear resize PR, that is also applicable to bare unets / standard alternative. which he probably would want to merge, but the rest would need this thought first
of course, we can also fuse the new stuff the same way. currently it’s hard written so the shaders would grow quite a lot for the fused ops, but we could do a epilogue + prologue system. this is what CUTLASS (epilogue visitor trees) and TVM do for CUDA afaik
but yeah i have very cool segmentation models ready if we would add these 3 ops (+ bilinear and the search budget), click, box and brush select (left click adds, right click removes, more clicks refine) and automatic masks for people, sky, vegetation, water, mountain, ground, building, clothing and subject. all trained from scratch on open images v7 (+ the cc licensed part of coco-stuff for the automatic masks), circa 5-7 ms for a click (up to ~13 ms with many clicks) and ~7 ms for the automatic masks on a laptop 3060 which is only at a 60w charger and i think quite a lot slower because of it. for the automatic masks the net is ~1.4 ms, ~7 ms is with guided filter btw, this is on input 384×384 and output 192×192 (click select is 512 in, 256 out), so we could increase this of course, have compute budget i think. the results are usable, but strong edits have halo of course