🐛 Bug
Current nvFuser executor in Thunder checks every argument at runtime if it's DTensor or not. This check should be performed at trace construction time because the dispatch to DTensor-based execution or not should be done solely based on the types recorded in the trace.
Place where DTensor check is performed:
|
if dist.is_available() and any(isinstance(t, torch.distributed.tensor.DTensor) for t in args): |
This would involve updating the construction of FusionDefinitionWrapper to include a new attribute "use_dtensor_execute" (or some better name) to control the dispatch.
cc @tfogal