-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[export] Support complex constant in serde #161517
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161517
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3f43612 with merge base 5c306c3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
Summary:
For a model like
```
class M(torch.nn.Module):
def forward(self, x):
s = torch.sin(x)
z = 1j * s
return z
```
Its graph will be
```
graph():
%x : [num_users=1] = placeholder[target=x]
%sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {})
%mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {})
return (mul,)
```
`1j` will appear as a constant complex argument in the `aten.mul`
Test Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Differential Revision: D80672323
17afbb4 to
1cebf4b
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
1cebf4b to
61de0d1
Compare
Summary:
For a model like
```
class M(torch.nn.Module):
def forward(self, x):
s = torch.sin(x)
z = 1j * s
return z
```
Its graph will be
```
graph():
%x : [num_users=1] = placeholder[target=x]
%sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {})
%mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {})
return (mul,)
```
`1j` will appear as a constant complex argument in the `aten.mul`
Test Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Differential Revision: D80672323
Summary:
For a model like
```
class M(torch.nn.Module):
def forward(self, x):
s = torch.sin(x)
z = 1j * s
return z
```
Its graph will be
```
graph():
%x : [num_users=1] = placeholder[target=x]
%sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {})
%mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {})
return (mul,)
```
`1j` will appear as a constant complex argument in the `aten.mul`
Test Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Differential Revision: D80672323
61de0d1 to
5ecef3a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
Summary: Pull Request resolved: pytorch#161517 For a model like ``` class M(torch.nn.Module): def forward(self, x): s = torch.sin(x) z = 1j * s return z ``` Its graph will be ``` graph(): %x : [num_users=1] = placeholder[target=x] %sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {}) %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {}) return (mul,) ``` `1j` will appear as a constant complex argument in the `aten.mul` Test Plan: buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant Rollback Plan: Differential Revision: D80672323
5ecef3a to
9b8b281
Compare
9b8b281 to
e0724af
Compare
Summary:
For a model like
```
class M(torch.nn.Module):
def forward(self, x):
s = torch.sin(x)
z = 1j * s
return z
```
Its graph will be
```
graph():
%x : [num_users=1] = placeholder[target=x]
%sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {})
%mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {})
return (mul,)
```
`1j` will appear as a constant complex argument in the `aten.mul`
Test Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Reviewed By: angelayi
Differential Revision: D80672323
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
Summary: Pull Request resolved: pytorch#161517 For a model like ``` class M(torch.nn.Module): def forward(self, x): s = torch.sin(x) z = 1j * s return z ``` Its graph will be ``` graph(): %x : [num_users=1] = placeholder[target=x] %sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {}) %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {}) return (mul,) ``` `1j` will appear as a constant complex argument in the `aten.mul` Test Plan: buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant Rollback Plan: Reviewed By: angelayi Differential Revision: D80672323
e0724af to
fe69e46
Compare
fe69e46 to
d46885b
Compare
Summary:
For a model like
```
class M(torch.nn.Module):
def forward(self, x):
s = torch.sin(x)
z = 1j * s
return z
```
Its graph will be
```
graph():
%x : [num_users=1] = placeholder[target=x]
%sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {})
%mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {})
return (mul,)
```
`1j` will appear as a constant complex argument in the `aten.mul`
Test Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Reviewed By: angelayi
Differential Revision: D80672323
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
d46885b to
7e05b0d
Compare
Summary: Pull Request resolved: #161517 For a model like ``` class M(torch.nn.Module): def forward(self, x): s = torch.sin(x) z = 1j * s return z ``` Its graph will be ``` graph(): %x : [num_users=1] = placeholder[target=x] %sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {}) %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {}) return (mul,) ``` `1j` will appear as a constant complex argument in the `aten.mul` Test Plan: buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant Rollback Plan: Reviewed By: angelayi Differential Revision: D80672323
Summary:
For a model like
```
class M(torch.nn.Module):
def forward(self, x):
s = torch.sin(x)
z = 1j * s
return z
```
Its graph will be
```
graph():
%x : [num_users=1] = placeholder[target=x]
%sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {})
%mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {})
return (mul,)
```
`1j` will appear as a constant complex argument in the `aten.mul`
Test Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Reviewed By: angelayi
Differential Revision: D80672323
7e05b0d to
4e59b46
Compare
Summary: Pull Request resolved: pytorch#161517 For a model like ``` class M(torch.nn.Module): def forward(self, x): s = torch.sin(x) z = 1j * s return z ``` Its graph will be ``` graph(): %x : [num_users=1] = placeholder[target=x] %sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {}) %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {}) return (mul,) ``` `1j` will appear as a constant complex argument in the `aten.mul` Test Plan: buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant Rollback Plan: Reviewed By: angelayi Differential Revision: D80672323
|
This pull request was exported from Phabricator. Differential Revision: D80672323 |
4e59b46 to
3f43612
Compare
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: Fixes pytorch#160749 For a model like ``` class M(torch.nn.Module): def forward(self, x): s = torch.sin(x) z = 1j * s return z ``` Its graph will be ``` graph(): %x : [num_users=1] = placeholder[target=x] %sin : [num_users=1] = call_function[target=torch.ops.aten.sin.default](args = (%x,), kwargs = {}) %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sin, 1j), kwargs = {}) return (mul,) ``` `1j` will appear as a constant complex argument in the `aten.mul` Test Plan: buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant Rollback Plan: Differential Revision: D80672323 Pull Request resolved: pytorch#161517 Approved by: https://github.com/angelayi
Summary:
Fixes #160749
For a model like
Its graph will be
1jwill appear as a constant complex argument in theaten.mulTest Plan:
buck2 run mode/dev-nosan caffe2/test:test_export -- -r test_complex_constant
Rollback Plan:
Differential Revision: D80672323