UserDefinedObjectVariable should not be break renson

kisisjrlly: <p>some break reasons like <code>2. call_function UserDefinedClassVariable() [] {'sample': TensorVariable()}   File "/opt/conda/lib/python3.8/site-packages/diffusers/models/attention.py", line 244, in forward     return Transformer2DModelOutput(sample=output)</code><br>
Variable “sample” should be ignored and not need to be break reson</p>

marksaroufim: <p>Do you have a full repro you can share? Are you using your own integration or an integration by the diffuser team? If by the diffuser team do you mind opening an issue there so we can figure out whats going on</p>

dan_hu: <p>Traceback (most recent call last):<br>
File “/data/cv/aoyang/0517/model/clife-ai-cv-ai-beautify/1/test_fast.py”, line 20, in <br>
image = pipe(prompt, num_inference_steps=30).images[0]<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/utils/_contextlib.py”, line 115, in decorate_context<br>
return func(*args, **kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py”, line 1272, in <strong>call</strong><br>
image = self.vae.decode(latents / self.vae.config.scaling_factor, return_dict=False)[0]<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py”, line 209, in _fn<br>
return fn(*args, **kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py”, line 337, in catch_errors<br>
return callback(frame, cache_size, hooks)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py”, line 104, in _fn<br>
return fn(*args, **kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py”, line 262, in _convert_frame_assert<br>
return _compile(<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/utils.py”, line 163, in time_wrapper<br>
r = func(*args, **kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py”, line 324, in _compile<br>
out_code = transform_code_object(code, transform)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py”, line 445, in transform_code_object<br>
transformations(instructions, code_options)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py”, line 311, in transform<br>
tracer.run()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 1726, in run<br>
super().run()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 576, in run<br>
and self.step()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 540, in step<br>
getattr(self, inst.opname)(inst)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 342, in wrapper<br>
return inner_fn(self, inst)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 1002, in CALL_FUNCTION_EX<br>
self.call_function(fn, argsvars.items, kwargsvars.items)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 474, in call_function<br>
self.push(fn.call_function(self, args, kwargs))<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py”, line 259, in call_function<br>
return super().call_function(tx, args, kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py”, line 92, in call_function<br>
return tx.inline_user_function_return(<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 510, in inline_user_function_return<br>
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)<br>
File "/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/<em>dynamo/symbolic_convert.py", line 1806, in inline_call<br>
return cls.inline_call</em>(parent, func, args, kwargs)<br>
File "/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/<em>dynamo/symbolic_convert.py", line 1862, in inline_call</em><br>
tracer.run()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 576, in run<br>
and self.step()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 540, in step<br>
getattr(self, inst.opname)(inst)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 342, in wrapper<br>
return inner_fn(self, inst)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 965, in CALL_FUNCTION<br>
self.call_function(fn, args, {})<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 474, in call_function<br>
self.push(fn.call_function(self, args, kwargs))<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py”, line 291, in call_function<br>
return super().call_function(tx, args, kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py”, line 259, in call_function<br>
return super().call_function(tx, args, kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py”, line 92, in call_function<br>
return tx.inline_user_function_return(<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 510, in inline_user_function_return<br>
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)<br>
File "/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/<em>dynamo/symbolic_convert.py", line 1806, in inline_call<br>
return cls.inline_call</em>(parent, func, args, kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/<em>dynamo/symbolic_convert.py", line 1862, in inline_call</em><br>
tracer.run()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 576, in run<br>
and self.step()<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 540, in step<br>
getattr(self, inst.opname)(inst)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 342, in wrapper<br>
return inner_fn(self, inst)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 1014, in CALL_FUNCTION_KW<br>
self.call_function(fn, args, kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py”, line 474, in call_function<br>
self.push(fn.call_function(self, args, kwargs))<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/user_defined.py”, line 127, in call_function<br>
return super().call_function(tx, args, kwargs)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/variables/base.py”, line 230, in call_function<br>
unimplemented(f"call_function {self} {args} {kwargs}”)<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/torch/_dynamo/exc.py”, line 71, in unimplemented<br>
raise Unsupported(msg)<br>
torch._dynamo.exc.Unsupported: call_function UserDefinedClassVariable() <span class="chcklst-box fa fa-square-o fa-fw"></span> {‘sample’: TensorVariable()}</p>
<p>from user code:<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/diffusers/models/autoencoders/autoencoder_kl.py”, line 304, in decode<br>
decoded = self._decode(z).sample<br>
File “/root/miniconda/envs/StableVITON/lib/python3.10/site-packages/diffusers/models/autoencoders/autoencoder_kl.py”, line 280, in _decode<br>
return DecoderOutput(sample=dec)</p>
<p>Set torch._dynamo.config.verbose=True for more information</p>
<p>there is my code<br>
from diffusers import StableDiffusionXLPipeline,AutoPipelineForText2Image<br>
import time<br>
import torch</p>
<h1><a name="load-the-pipeline-in-full-precision-and-place-its-model-components-on-cuda-1" class="anchor" href="#load-the-pipeline-in-full-precision-and-place-its-model-components-on-cuda-1"></a>Load the pipeline in full-precision and place its model components on CUDA.</h1>
<p>pipe = AutoPipelineForText2Image.from_pretrained(“/data/cv/aoyang/0517/model/clife-ai-cv-ai-beautify/1/sdxl-turbo”,torch_dtype=torch.float16, variant=“fp16”)<br>
pipe = pipe.to(“cuda”)</p>
<p>pipe.unet.to(memory_format=torch.channels_last)<br>
pipe.vae.to(memory_format=torch.channels_last)</p>
<h1><a name="compile-the-unet-and-vae-2" class="anchor" href="#compile-the-unet-and-vae-2"></a>Compile the UNet and VAE.</h1>
<p>pipe.unet = torch.compile(pipe.unet, mode=“max-autotune”, fullgraph=True)<br>
pipe.vae.decode = torch.compile(pipe.vae.decode, mode=“max-autotune”, fullgraph=True)</p>
<p>prompt = “Astronaut in a jungle, cold color palette, muted colors, detailed, 8k”</p>
<p>image = pipe(prompt, num_inference_steps=30).images[0]</p>
<p>torch   2.0.0+cu117</p>