Skip to content

torch.fx to MDF #431

@davidt0x

Description

@davidt0x

The current pipeline for PyTorch to MDF conversion utilizes TorchScript compilation of PyTorch models. The TorchScript graph is created with a call to torch.jit.script. The TorchScript graph is then traversed and converted to an MDF model in a node by node manner (for the most part). The code for this is all contained in modeci_mdf.interfaces.pytorch.importer. The future direction of PyTorch 2.0 PyTorch 2.0 seems to be moving away from TorchScript in favor or torch.fx graphs and torch.compile. It would probably be best to rewrite the TorchScript compilation dependency to utilize these new features. This might have the added advantage that FX graph IR seems to capture some higher level details (hierarchy of nn.Module) of the model which might be carried over to MDF. A good first step would be to implement a simple proof of concept conversion from a simple PyTorch example model to an MDF model. A good first example would be this simple model.

A proof of concept or rough implementation of this feature for this simple model would be a great thing to try for an Outreachy candidate. A a more complete implementation could be pursued by a successful candidate over the summer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions