Skip to content
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

Usage with torch.compile in Pytorch 2? #60

Open
dreavjr opened this issue Sep 28, 2023 · 2 comments
Open

Usage with torch.compile in Pytorch 2? #60

dreavjr opened this issue Sep 28, 2023 · 2 comments

Comments

@dreavjr
Copy link

dreavjr commented Sep 28, 2023

Is mup compatible with torch.compile() in Pytorch 2? If yes, what is the correct usage (e.g. should we apply mup before compile or after)?

@edwardjhu
Copy link
Collaborator

I don't see why it might not be compatible right away, but I haven't tested it.

What happens to the coordinate check if you rerun one of our examples after torch.compile()?

@tivek
Copy link

tivek commented Feb 17, 2024

Recently, torch.compile() started using FakeTensors for both input and weight during compilation. That means that temporary FakeTensor weights are created from original Tensor weights. infshape attributes are not copied to these FakeTensor weights.

Consequently, during compilation, MuReadout.forward() and MuReadout.width_mult() trip this assert and the compilation fails.

This unwanted sideeffect will also influence the ability to eg. export mup models to ONNX.

Any advice how to circumvent missing infshapes on FakeTensors going forward?

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

No branches or pull requests

3 participants