Skip to content

Conversation

@ppwwyyxx
Copy link
Collaborator

Summary: use the wrapped function (instead of the wrapper) to obtain argument names

Test Plan:

buck test mode/dev-nosan //caffe2/test:jit -- 'test_unused_decorator \(test_jit\.TestScript\)'

Before:

> Traceback (most recent call last):
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/test_jit.py", line 3014, in test_unused_decorator
>     torch.jit.script(MyMod())
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_script.py", line 888, in script
>     obj, torch.jit._recursive.infer_methods_to_compile
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_recursive.py", line 317, in create_script_module
>     return create_script_module_impl(nn_module, concrete_type, stubs_fn)
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_recursive.py", line 376, in create_script_module_impl
>     create_methods_from_stubs(concrete_type, stubs)
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_recursive.py", line 292, in create_methods_from_stubs
>     concrete_type._create_methods(defs, rcbs, defaults)
> RuntimeError:
> Non-static method does not have a self argument:
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/test_jit.py", line 3012
>             def forward(self, x):
>                 return self.fn()
>                        ~~~~~~~ <--- HERE
>

Differential Revision: D22554479

Summary: use the wrapped function (instead of the wrapper) to obtain argument names

Test Plan:
```
buck test mode/dev-nosan //caffe2/test:jit -- 'test_unused_decorator \(test_jit\.TestScript\)'
```

Before:
```
> Traceback (most recent call last):
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/test_jit.py", line 3014, in test_unused_decorator
>     torch.jit.script(MyMod())
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_script.py", line 888, in script
>     obj, torch.jit._recursive.infer_methods_to_compile
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_recursive.py", line 317, in create_script_module
>     return create_script_module_impl(nn_module, concrete_type, stubs_fn)
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_recursive.py", line 376, in create_script_module_impl
>     create_methods_from_stubs(concrete_type, stubs)
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/torch/jit/_recursive.py", line 292, in create_methods_from_stubs
>     concrete_type._create_methods(defs, rcbs, defaults)
> RuntimeError:
> Non-static method does not have a self argument:
>   File "/data/users/yuxinwu/fbsource2/fbcode/buck-out/dev/gen/caffe2/test/jit#binary,link-tree/test_jit.py", line 3012
>             def forward(self, x):
>                 return self.fn()
>                        ~~~~~~~ <--- HERE
>
```

Differential Revision: D22554479

fbshipit-source-id: f200ba89f0ad0c80a4d98e89d3a111424d909f95
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D22554479

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jul 15, 2020
@dr-ci
Copy link

dr-ci bot commented Jul 15, 2020

💊 CI failures summary and remediations

As of commit 850c7ce (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build caffe2_onnx_main_py3_6_clang7_ubuntu16_04_test (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

Jul 15 20:57:32 E AssertionError: False is not true
Jul 15 20:57:32         worker_coordinator = parallel_workers.init_workers(dummy_worker) 
Jul 15 20:57:32         worker_coordinator.start() 
Jul 15 20:57:32      
Jul 15 20:57:32         for _ in range(10): 
Jul 15 20:57:32             value = dequeue_value(queue) 
Jul 15 20:57:32             self.assertTrue( 
Jul 15 20:57:32                 value in [b'0', b'1'], 'Got unexpected value ' + str(value) 
Jul 15 20:57:32             ) 
Jul 15 20:57:32      
Jul 15 20:57:32 >       self.assertTrue(worker_coordinator.stop()) 
Jul 15 20:57:32 E       AssertionError: False is not true 
Jul 15 20:57:32  
Jul 15 20:57:32 ../.local/lib/python3.6/site-packages/caffe2/python/parallel_workers_test.py:73: AssertionError 
Jul 15 20:57:32 ----------------------------- Captured stdout call ----------------------------- 
Jul 15 20:57:32 Wait for workers to die: train 
Jul 15 20:57:32 Worker <Thread(parallel_workers worker id 0, started daemon 140108032091904)> failed to close while waiting 
Jul 15 20:57:32 All workers terminated: False 
Jul 15 20:57:32 - generated xml file: /var/lib/jenkins/workspace/caffe2_tests/python/result.xml - 
Jul 15 20:57:32 ---------- onnx coverage: ---------- 
Jul 15 20:57:32 Operators (passed/loaded/total): 0/0/185 
Jul 15 20:57:32 ------------------------------------ 

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 1 time.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 488ee37.

@ppwwyyxx ppwwyyxx deleted the export-D22554479 branch September 26, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fb-exported Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants