Skip to content

Refactor torchao and tests to use model architectures from torchao.testing.model_architectures #2078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jainapurva opened this issue Apr 18, 2025 · 1 comment
Labels
good first issue Good for newcomers

Comments

@jainapurva
Copy link
Contributor

PR: #2036, adds standard model architectures to torchao.testing.model_architectures.py. Replace the existing model definitions from torchao and tests to reuse the model definitions from model_architectures.py. If new definitions are found, add them to model_architectures.py

Eg:
Replace

class ToyLinearModel(torch.nn.Module):
def __init__(self, m=64, n=32, k=64, bias=False):
super().__init__()
self.linear1 = torch.nn.Linear(m, n, bias=bias).to(torch.float)
self.linear2 = torch.nn.Linear(n, k, bias=bias).to(torch.float)
def example_inputs(self, batch_size=1, dtype=torch.float, device="cpu"):
return (
torch.randn(
batch_size, self.linear1.in_features, dtype=dtype, device=device
),
)
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
to use torchao.testing.model_architectures.ToyLinearModel

@jainapurva jainapurva added the good first issue Good for newcomers label Apr 18, 2025
@XueSongTap
Copy link

Can I work on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants