pytorch/benchmarks/static_runtime
Akshay Parashar 28f87b9cf9 [Static Runtime] Fix aten::clone out variant (#78297) (#78322)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78297

Clone followed by expand/expand_as due to memoryOverlap check on copy_ native method. Refer to T118519310 for more details.

Crashing test case:
a = tensor(3,1)			  // strides = (1,1)
B = tensor(3,2)	          // strides = (2,1)
Temp = a.expand_as(b).   // creates temp with shape as (3,2) and strides as (1,0)
temp.clone()		         // crashe on copy_ due to memoryOverlap

Fix: Disable the out variant for the expanded tensor.
- Calls native clone instead of out variant for clone dealing with expanded tensors
- Added test case for both clone variants (out and native clones)
- Increased the tensor size for memory planner test case to trigger dynamic allocation

Test Plan:
buck test caffe2/benchmarks/static_runtime/fb:test_fb_operators

buck test caffe2/benchmarks/static_runtime:static_runtime_cpptest

Differential Revision: D36672180

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78322
Approved by: https://github.com/mikeiovine
2022-06-02 21:06:59 +00:00
..
CMakeLists.txt [Static Runtime] Add auto-generated out variant dispatchers (#72603) 2022-02-28 08:39:10 +00:00
deep_wide_pt_bench.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746) 2021-11-03 12:23:14 -07:00
deep_wide_pt.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746) 2021-11-03 12:23:14 -07:00
deep_wide_pt.h [SR] Fix broken unit test build (#76111) 2022-04-20 18:36:31 +00:00
test_cpu_fusion.cc [Static Runtime] Add test that runs NNC fused kernels in parallel (#73256) 2022-02-28 17:44:45 +00:00
test_generated_ops.cc [static_runtime] Add auto-generated view ops (#77106) 2022-05-26 03:13:59 +00:00
test_static_module.cc [SR] Fuse clamp/nan_to_num 2022-05-10 23:33:59 +00:00
test_static_runtime.cc [Static Runtime] Fix aten::clone out variant (#78297) (#78322) 2022-06-02 21:06:59 +00:00
test_utils.cc [SR] Fix StaticRuntime move ctor (#74927) 2022-04-07 02:16:37 +00:00
test_utils.h [SR] Fix StaticRuntime move ctor (#74927) 2022-04-07 02:16:37 +00:00