pytorch/test/cpp
Scott Wolchok 2d885ab73d [jit] Reduce refcounting of Types (#65345)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65345

FooType::get() can return a const reference. Inconveniently, converting shared_ptr<FooType> to shared_ptr<Type> requires a copy & refcount bump, so to properly take advantage of this in unshapedType() we need to take a const Type& in isSubtypeOf(), which is good practice anyway -- don't require a shared_ptr if you don't need to take ownership.
ghstack-source-id: 140044165

Test Plan:
CI

perf says c10::unshapedType time decreased from 2.8% to 2.2% during static runtime startup, though I expect this to be generally beneficial.

Reviewed By: hlu1

Differential Revision: D31027361

fbshipit-source-id: 676feb81db9f74ad7b8651d8774f4ecb4cfa6ab8
2021-10-08 09:03:04 -07:00
..
api Compile without -Wno-unused-variable (take 2) (#66041) 2021-10-04 20:39:39 -07:00
c10d Revert D31005792: [NCCL] Init dummy NCCL comms in constructor 2021-09-29 20:46:38 -07:00
common
dist_autograd Fix distributed autograd gradients synchronization (#57792) 2021-05-09 17:32:59 -07:00
jit [jit] Reduce refcounting of Types (#65345) 2021-10-08 09:03:04 -07:00
lazy [pytorch][PR] Add hash and int128 utils for Lazy Tensor Core" (#66181) 2021-10-07 10:05:26 -07:00
lite_interpreter_runtime [Pytorch Edge] Enable kineto profiler on mobile via EdgeKinetoProfiler (#62419) 2021-08-13 21:40:19 -07:00
rpc Remove process_group_agent and faulty_process_group_agent files (#62985) 2021-08-10 15:57:39 -07:00
tensorexpr [nnc] Added a cache to use singleton instances of PytorchLLVMJIT for every triple,cpu,attrs combination (#66217) 2021-10-07 13:17:11 -07:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00