Minifier has trouble correctly setting up requires_grad'ness of inputs for forward only
Labels: triaged, oncall: pt2, module: minifier

### 🐛 Describe the bug

Try running the minifier launcher at https://gist.github.com/2a361f0f7613fe6e609c14cb18717454 with https://github.com/pytorch/pytorch/pull/93853 https://github.com/pytorch/pytorch/pull/93403 https://github.com/pytorch/pytorch/pull/93856

A lot of minification attempts fail with

```
Traceback (most recent call last):                                                                                       
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/debug_utils.py", line 672, in same_two_models                         
    res = run_fwd_maybe_bwd(opt_gm, example_inputs, only_fwd)                                                            
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/debug_utils.py", line 632, in run_fwd_maybe_bwd                       
    out = gm(args)                                                                                                       
  File "/data/users/ezyang/b/pytorch/torch/_functorch/aot_autograd.py", line 996, in g                                   
    return f(*args)                                                                                                      
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/eval_frame.py", line 211, in _fn                                      
    return fn(*args, **kwargs)                                                                                           
  File "/data/users/ezyang/b/pytorch/torch/_functorch/aot_autograd.py", line 2497, in forward                            
    return compiled_fn(full_args)                                                                                        
  File "/data/users/ezyang/b/pytorch/torch/_functorch/aot_autograd.py", line 996, in g                                   
    return f(*args)                                                                                                      
  File "/data/users/ezyang/b/pytorch/torch/_functorch/aot_autograd.py", line 2061, in debug_compiled_function            
    assert not a.requires_grad, format_guard_bug_msg(                                                                    
AssertionError: At compilation time, graph 12 was compiled under the assumption that input 3 would not require grad, but at runtime this was not the case.  This indicates a guard bug in AOTAutograd or Dynamo, please file a bug to PyTorch. 
```

```
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 310, in transform           
    tracer.run()                                                                                                         
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 1715, in run      
    super().run()                                           
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 564, in run         
    and self.step()                                         
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 527, in step
    getattr(self, inst.opname)(inst)                        
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 1781, in RETURN_VALUE
    self.output.compile_subgraph(self)              
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/output_graph.py", line 563, in compile_subgraph
    self.compile_and_call_fx_graph(tx, pass2.graph_output_vars(), root)                                                  
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/output_graph.py", line 610, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm)                                                                            
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/utils.py", line 162, in time_wrapper   
    r = func(*args, **kwargs)                               
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/output_graph.py", line 697, in call_user_compiler                     
    raise BackendCompilerFailed(self.compiler_fn, e) from e                                                              
torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.   
```

The minifier should be more clever about how it sets up inputs.

### Versions

master

cc @soumith @msaroufim @wconstab @ngimel @bdhirsh