@@ -117,18 +117,6 @@ def preprocess(
117117 if node .op == "placeholder" and node .name in user_input_names :
118118 user_input_placeholders .append (node .meta ["val" ])
119119
120- # Create pseudo user inputs using torch.randn and metadata from input placeholders
121- faked_user_inputs = []
122- for placeholder in user_input_placeholders :
123- if isinstance (placeholder , torch .Tensor ):
124- # Generate fake input with same shape and dtype, on CUDA
125- fake_input = torch .randn (
126- placeholder .shape , dtype = placeholder .dtype , device = "cuda"
127- )
128- faked_user_inputs .append (fake_input )
129-
130- faked_user_inputs = tuple (faked_user_inputs )
131-
132120 options : dict [str , typing .Any ] = {
133121 # Embed CUDA kernel binaries directly into the compiled shared object
134122 "aot_inductor.embed_kernel_binary" : True ,
@@ -145,7 +133,7 @@ def preprocess(
145133 }
146134
147135 with collect_unsupported_fallback_kernels ():
148- so_path = torch ._inductor .aot_compile (edge_program_module , faked_user_inputs , options = options ) # type: ignore[arg-type]
136+ so_path = torch ._inductor .aot_compile (edge_program_module , tuple ( user_input_placeholders ) , options = options ) # type: ignore[arg-type]
149137 if len (missing_fallback_kernels ) > 0 :
150138 formatted_kernels = "\n - " .join (sorted (missing_fallback_kernels ))
151139 raise RuntimeError (
0 commit comments