Comments (3)
Thanks for the repro! The error is because dynamo creates an extra parameter in the state dict, self_encoder_weight
, which aliases self.encoder.weight
, and this causes some issues downstream.
It should work if you set the strict=False
flag in the call to torch.export
:
exported_program = torch.export.export(M2(), (torch.randn(3, 3),), strict=False)
print(exported_program)
"""
ExportedProgram:
class GraphModule(torch.nn.Module):
def forward(self, p_m1_encoder_weight: "f32[3, 3]", x: "f32[3, 3]"):
# File: /data/users/angelayi/pytorch2/torch/nn/modules/linear.py:116 in forward, code: return F.linear(input, self.weight, self.bias)
linear: "f32[3, 3]" = torch.ops.aten.linear.default(x, p_m1_encoder_weight); x = None
# File: /data/users/angelayi/pytorch2/moo.py:1199 in forward, code: Y = encoded_feats + self.encoder.weight
add: "f32[3, 3]" = torch.ops.aten.add.Tensor(linear, p_m1_encoder_weight); linear = p_m1_encoder_weight = None
return (add,)
Graph signature: ExportGraphSignature(input_specs=[InputSpec(kind=<InputKind.PARAMETER: 2>, arg=TensorArgument(name='p_m1_encoder_weight'), target='m1.encoder.weight', persistent=None), InputSpec(kind=<InputKind.USER_INPUT: 1>, arg=TensorArgument(name='x'), target=None, persistent=None)], output_specs=[OutputSpec(kind=<OutputKind.USER_OUTPUT: 1>, arg=TensorArgument(name='add'), target=None)])
Range constraints: {}
"""
from pytorch.
Thank you, it works. Will it be fixed or should we expect to use "strict=False" to export weighttying model in the long run.
from pytorch.
We will fix it, but you can expect to use strict=False in the long run.
from pytorch.
Related Issues (20)
- Assertion failed: (0 <= mpsAxis && mpsAxis < 4 && "Runtime canonicalization must simplify reduction axes to minor 4 dimensions."), function getKernelAxes, file GPUReductionOps.mm, line 31.
- Dynamo: warning when we incorrectly inline autograd.Function.backward due to subclass gradients
- run dynamo CI shard with aot_eager_decomp_partition backend to see fallout
- torch.view_copy(x, dtype) diverges from eager when the destiny dtype has less bytes than the origin HOT 2
- Setting the 0D tensor of only one element to `fill_value` of `full()` works against error message HOT 2
- Setting the 0D tensor of only one element to `fill_value` of `full()`/`full_like()` works against error message HOT 2
- [Break XPU] The newly added Inductor test case `test_convolution5` fp16 failed on XPU and blocked the CI.
- DISABLED test_trigger_on_error (__main__.ExcTests) HOT 1
- FP8 Emulation HOT 3
- Got this error when just running my flask script HOT 3
- [dynamo] Crash when unspecialized nn.Module with custom getattr throws exception
- LayoutLMForMaskedLM generates NaN in Max-autotune mode with cuda-graph enabled HOT 7
- [TS2EP] Failing on longformer HOT 3
- Improve the Inductor generated kernel for the pattern of `output1 = pointwise(intput); output2 = transpose(output1)` HOT 8
- UserWarning triggered by scheduler.step(0) inside the step function in SequentialLR class
- [Functionalization] The inplace decompose op is meaningless
- Model training time increase more than 10x in some case HOT 2
- [inductor][cpu]lcnet_050 AMP multiple/single thread static/dynamic shape default/CPP wrapper performance regression in 2024-06-30 nightly release HOT 5
- There is an error in the description of torch.Tensor.scatter_() in the document HOT 4
- Support python attribute mutations of tensor subclass graph inputs from within __torch_dispatch__ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.