onediff icon indicating copy to clipboard operation
onediff copied to clipboard

pad方法支持circular模式

Open vincentmmc opened this issue 1 year ago • 16 comments

你好,请问什么时候pad方法可以支持circular模式? image

vincentmmc avatar Jun 13 '24 11:06 vincentmmc

@lijunliangTG

vincentmmc avatar Jun 19 '24 00:06 vincentmmc

您好,请问是在什么场景下用到这个模式呢?为什么需要这个模式?

lijunliangTG avatar Jun 19 '24 01:06 lijunliangTG

您好,请问是在什么场景下用到这个模式呢?为什么需要这个模式?

你好,我是要实现一个无缝铺贴功能用到的这个模式,代码参考:https://github.com/tjm35/asymmetric-tiling-sd-webui/blob/main/scripts/asymmetric_tiling.py 第88、89行。 感谢回复~@lijunliangTG

vincentmmc avatar Jun 19 '24 06:06 vincentmmc

@lijunliangTG

vincentmmc avatar Jun 22 '24 15:06 vincentmmc

请问您用的是什么模型,我这里复现一下

lijunliangTG avatar Jun 24 '24 01:06 lijunliangTG

WARNING [2024-06-24 02:04:27] /data/home/lijunliang/project/onediff/src/onediff/utils/log_utils.py:33 - Logging handlers already exist for ONEDIFF
Pydantic version 1.10.11 is too low, please upgrade to 2.5.2 or higher.
ERROR [2024-06-24 02:04:28] /data/home/lijunliang/project/onediff/src/onediff/infer_compiler/backends/oneflow/transform/builtin_transform.py:221 - convert <class 'function'> failed: Transform failed of <class 'function'>: 'function' object has no attribute '<locals>'

ERROR [2024-06-24 02:04:28] /data/home/lijunliang/project/onediff/src/onediff/infer_compiler/backends/oneflow/deployable_module.py:38 - Exception in forward: e=NotImplementedError("Transform failed of <class 'ldm.modules.diffusionmodules.openaimodel.UNetModel'>: Transform failed of <class 'torch.nn.modules.container.ModuleList'>: Transform failed of <class 'ldm.modules.diffusionmodules.openaimodel.TimestepEmbedSequential'>: Transform failed of <class 'torch.nn.modules.conv.Conv2d'>: Unsupported type: <class 'function'>")
WARNING [2024-06-24 02:04:28] /data/home/lijunliang/project/onediff/src/onediff/infer_compiler/backends/oneflow/deployable_module.py:39 - Recompile oneflow module ...
ERROR [2024-06-24 02:04:29] /data/home/lijunliang/project/onediff/src/onediff/infer_compiler/backends/oneflow/transform/builtin_transform.py:221 - convert <class 'function'> failed: Transform failed of <class 'function'>: 'function' object has no attribute '<locals>'

当我复现时遇到了上面的情况 模型为sd1.5 ,请问您遇到的是否为这个情况

lijunliangTG avatar Jun 24 '24 02:06 lijunliangTG

@lijunliangTG 我遇到的情况是我想用oneflow.nn.functional.pad的circular mode但是oneflow提示还不支持,我想问这个模式有没有计划支持?

以下是我的调试代码 `import torch import oneflow

torch_ts = torch.randn((1,1,2,3)) torch_ts_circular = torch.nn.functional.pad(torch_ts,(1,1,0,0),mode='circular') print(torch_ts) print(torch_ts_circular)

oneflow_ts = oneflow.randn((1,1,2,3)) oneflow_ts_circular = oneflow.nn.functional.pad(oneflow_ts,(1,1,0,0),mode='circular') print(oneflow_ts) print(oneflow_ts_circular)`

以下是输出结果 `tensor([[[[ 1.2974, -0.3249, -0.2213], [-0.1191, -0.4286, 2.3114]]]])

tensor([[[[-0.2213, 1.2974, -0.3249, -0.2213, 1.2974], [ 2.3114, -0.1191, -0.4286, 2.3114, -0.1191]]]])

Traceback (most recent call last): File "pad_func_test.py", line 10, in oneflow_ts_circular = oneflow.nn.functional.pad(oneflow_ts,(1,1,0,0),mode='circular') File "/data1/python_envs/diffusers/lib/python3.8/site-packages/oneflow/nn/functional/pad.py", line 102, in pad raise NotImplementedError( NotImplementedError: 2D circular padding are not supported for now`

vincentmmc avatar Jun 24 '24 06:06 vincentmmc

我正在尝试实现

lijunliangTG avatar Jun 24 '24 06:06 lijunliangTG

我正在尝试实现

thanks~~

vincentmmc avatar Jun 25 '24 03:06 vincentmmc

你好,请问有进展吗?@lijunliangTG

vincentmmc avatar Jul 02 '24 01:07 vincentmmc

目前前向传播的代码基本实现,请您再稍等几天。

lijunliangTG avatar Jul 03 '24 15:07 lijunliangTG

目前前向传播的代码基本实现,请您再稍等几天。

你好 请问这个问题解决了吗 @lijunliangTG

nono909090 avatar Jul 12 '24 01:07 nono909090

你好 请问有进展吗 @strint

nono909090 avatar Jul 19 '24 02:07 nono909090

您好,算法功能已经实现,但是目前测试脚本的实现有点问题,正在解决中

lijunliangTG avatar Jul 19 '24 03:07 lijunliangTG

你好,请问有进展了吗?@lijunliangTG

vincentmmc avatar Aug 07 '24 01:08 vincentmmc

@vincentmmc

这块暂时没有更新了。

如果涉及 onediff 仓库没有适配的模型,请使用 nexfort 后端,算子兼容性会更好:https://github.com/siliconflow/onediff/tree/main/src/onediff/infer_compiler

strint avatar Aug 07 '24 02:08 strint