compile_fx¶
torch_tvarant.compiler.compile_fx(gm, example_inputs=None) → GraphModule
Optimize a captured FX graph for Tvarant.
Runs GEMM-epilogue fusion then pointwise fusion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gm
|
GraphModule
|
FX graph module to optimize in place / recompile. |
required |
example_inputs
|
Any
|
Unused; accepted for Dynamo backend compatibility. |
None
|
Returns:
| Type | Description |
|---|---|
GraphModule
|
torch.fx.GraphModule: Fused graph ready to run on |
Source code in torch_tvarant/compiler.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |