Comments (5)
from pytorch.
This is sort of like need proper subclass support in Dynamo :P
cc @mlazos
from pytorch.
I have a very simple repo
The first print(parameters) in the code changes the output from Parameter containing, to tensor with grad_fn
def test_ParameterList(self):
@torch.compile(backend="eager")
def func():
def make_param():
return Parameter(torch.randn(2, 2))
parameters = []
# without the following print line we generate:
# [Parameter containing:
# tensor([[ 0.0461, 0.4024],
# [-1.0115, 0.2167]], requires_grad=True)]
#
# with it we geenrate
# [tensor([[ 0.0461, 0.4024],
# [-1.0115, 0.2167]], grad_fn=<TracableCreateParameterBackward>)]
print(parameters)
parameters.append(make_param())
print(parameters)
```
from pytorch.
@laithsakka I wasn't able to repro using using the test_ParameterList
example on nightly (it still prints Parameter containing: ...
). Is it expected?
@anijain2305 I have seen this error before when working on Traceable FSDP+TP. Some thoughts:
- The suggestion from error message (
cloning the output
) is not correct because we do want to preserve the nn.Parameter placeholder tensor identity (i.e. we must return the original nn.Parameter placeholder). - I wonder if you have high-level insight on why the nn.Parameter (or its base tensor) was mutated. I suspect it's from nn.Linear's
reset_parameters
method, but I haven't verified it myself yet.
from pytorch.
@yf225 sorry I updated the test I missed one print before parameters.append(make_param())
for the second print with the print we get
[tensor([[ 0.0461, 0.4024], [-1.0115, 0.2167]], grad_fn=)]
without it we get :
[Parameter containing:
tensor([[ 0.0461, 0.4024],
[-1.0115, 0.2167]], requires_grad=True)]
from pytorch.
Related Issues (20)
- torch.jit.script causes Segmentation fault 139 HOT 3
- AOTAutogradCache implementation
- Cannot convert -oo to int HOT 4
- 'FakeRootModule' object has no attribute 'self___aot_engines_0_short_term_memories_list_0_0_0' HOT 4
- Use of standard library math functions vs global namespace
- can not create custom gradient when fp8 type is used HOT 2
- JIT script can cause unneeded `requires_grad` inside `no_grad` blocks
- torchinductor error in torchao tests HOT 5
- unexpected `inference_mode` interaction with `torch.autograd.functional.jacobian` HOT 3
- python test/inductor/test_torchinductor.py -k GPUTests.test_slice_scatter_reinplace_cuda failure HOT 1
- Fast path detach()/alias() in FakeTensor HOT 1
- control output type in matmul HOT 1
- The Conv1D layer has a large difference in parameter update results when trained on CPU and GPU HOT 2
- The weight update results of torch.nn.BatchNorm1d on different hardware are inconsistent HOT 2
- Assertion error when running timm_models "levit_128"
- [apple M2]libc++abi: terminating due to uncaught exception of type c10::Error: Could not find schema for aten::randn HOT 1
- put profiling results from different ranks into one webpage HOT 1
- torch.cumprod will silently cast the output data type to int64 HOT 3
- Proposal to add a CUDA backend for tensor conversion from BSR/BSC tensors to CSR/CSC tensors
- Torch rocm 6.0 breaks gfx900 amd gpus (fixed in 6.1) 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.