File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,24 @@ def func(x):
155155 assert any (target .startswith ("thunder_" ) for target in targets ) # Verify that the submodules have name `thunder_*`
156156
157157
158+ @instantiate (dtypes = NOTHING )
159+ def test_inductor_fallback (executor , device , dtype ):
160+ x = torch .randn (3 , 3 , device = device , dtype = dtype )
161+
162+ def func (x ):
163+ return x .sinc ().cos ().sinc ().sinc ()
164+
165+ def trivial_compile (model , * args , ** kwargs ):
166+ return model
167+
168+ cfunc = thunderfx (func )
169+ with patch ("torch._inductor.compile_fx.compile_fx" , side_effect = trivial_compile ) as mock_call :
170+ cfunc (x )
171+
172+ # Once for sinc() and once for sinc().sinc()
173+ assert mock_call .call_count == 2
174+
175+
158176@instantiate (
159177 dtypes = NOTHING ,
160178 executors = [DynamoThunderExecutor ],
You can’t perform that action at this time.
0 commit comments