Tencent / Tencent/ncnn

promote pnnx dynamo exported program support

Open
#6,366 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
23.8k
Forks
4.5k
Avg merge
2d 20h
Merged PRs (30d)
37

Description

https://docs.pytorch.org/docs/stable/export.html

import torch
import torchvision.models as models

net = models.resnet18()
net.eval()

torch.manual_seed(0)
x = torch.rand(1, 3, 224, 224)

a = net(x)

# export pt2
program = torch.export.export(net, (x,))
torch.export.save(program, 'test_resnet18.pt2')
  • ./pnnx test_resnet18.pt2 (parsing and populate pnnx graph)
  • generate export_exported_program() in xxx_pnnx.py
  • add operator tests for exported program

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked PyTorch export documentation and the provided ResNet18 example, then run ./pnnx test_resnet18.pt2 to inspect current parsing behavior. The work is complete when the exported program parses into a populated pnnx graph, export_exported_program() is generated in the relevant xxx_pnnx.py, and operator tests cover the exported program.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, pytorch
Domain
machine-learning, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.