[2023-03-22 12:32:20,041] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:23,163] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:23,366] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:27,174] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:27,333] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:27,465] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:27,598] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:27,730] torch._inductor.utils: [WARNING] DeviceCopy in input program
[2023-03-22 12:32:27,863] torch._inductor.utils: [WARNING] DeviceCopy in input program
I failed to find a good description of what this warning means. Any idea?
The warning seems to be raised from here and based on the definition of developer_warning I assume it should not be enabled in stable releases. Are you using the latest 2.0.0 release or a nightly build?
Iām using a nightly build 2.1.0.dev20230314+cu118. Iāll try with the latest stable release asap.
I only have this warning with one of my models and I couldnāt find which part of the code triggers it. If you have some insight into what could cause this I might be able to provide a minimal executable code snippet.
The trigger is likely to be a Device copy which is copying a tensor from one device to another - I would try removing to x_cuda1 = x.to("cuda:1") calls like this in your code and see if it solves the problem
Thatās right and indeed a simple tensor copy triggers the warning:
def fun(x):
x = x.to("cuda:0")
fun_compiled = torch.compile(fun)
x = torch.randn(1)
out = fun_compiled(x)
# [2023-03-23 10:08:02,025] torch._inductor.utils: [WARNING] DeviceCopy in input program
Did we miss to disable these warning for the stable release?
What does āinput programā mean in this context?
For stable diffusion of course there is a transfer of the image off of the GPU after the VAE/decode_first_stage step. Also, I suspect the initial noise is transferred to the GPU at the beginning. Itād be nice to know where in the complex set of operations that Stable Diffusion is, where this is coming from.
I have torch 2.0.1+cu118 and trying the default āinductorā.