dolpm
4ac2ee573d
[sigmoid] memory planner C10 deps ( #151275 )
...
Summary: perf-sensitive util functions for use in our memory planner
Test Plan: CI
Differential Revision: D73002726
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151275
Approved by: https://github.com/georgiaphillips
2025-04-24 01:46:32 +00:00
cyy
383d9e3de6
[4/N] Fix cppcoreguidelines-special-member-functions warnings ( #139027 )
...
Follows #138796
Pull Request resolved: https://github.com/pytorch/pytorch/pull/139027
Approved by: https://github.com/ezyang
2024-10-29 00:18:18 +00:00
Richard Barnes
8f62832189
c10::nullopt -> std::nullopt ( #138701 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138701
Approved by: https://github.com/Skylion007 , https://github.com/malfet
2024-10-24 15:03:32 +00:00
Richard Barnes
dbd6ada8c3
Clean up a c10::optional and fix documentation ( #138700 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138700
Approved by: https://github.com/Skylion007
2024-10-23 20:42:28 +00:00
eellison
8893881867
Invalidate StorageImpl instances when tensor is overwritten with cudagraphs ( #125264 )
...
Fixes #104435
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125264
Approved by: https://github.com/ezyang
Co-authored-by: eellison <elias.ellison@gmail.com>
2024-10-09 00:05:52 +00:00
PyTorch MergeBot
796c3c3415
Revert "Disallow FakeTensor.data_ptr access in eager mode ( #137221 )"
...
This reverts commit 7e13e7dd7e .
Reverted https://github.com/pytorch/pytorch/pull/137221 on behalf of https://github.com/jovianjaison due to failing internal tests ([comment](https://github.com/pytorch/pytorch/pull/137221#issuecomment-2397957081 ))
2024-10-07 21:46:13 +00:00
rzou
7e13e7dd7e
Disallow FakeTensor.data_ptr access in eager mode ( #137221 )
...
Previously we raised a deprecation warning (beginning PyTorch 2.4). Now
that we are on 2.6, we're completing the deprecation and disallowing
this behavior.
Test Plan:
- tests
Pull Request resolved: https://github.com/pytorch/pytorch/pull/137221
Approved by: https://github.com/albanD , https://github.com/eellison
2024-10-03 23:47:55 +00:00
PyTorch MergeBot
7c299b46ca
Revert "Invalidate StorageImpl instances when tensor is overwritten with cudagraphs ( #125264 )"
...
This reverts commit 8390843eba .
Reverted https://github.com/pytorch/pytorch/pull/125264 on behalf of https://github.com/izaitsevfb due to breaks internal tests ([comment](https://github.com/pytorch/pytorch/pull/125264#issuecomment-2240516202 ))
2024-07-19 22:58:51 +00:00
Isuru Fernando
8390843eba
Invalidate StorageImpl instances when tensor is overwritten with cudagraphs ( #125264 )
...
Fixes #104435
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125264
Approved by: https://github.com/ezyang
2024-07-16 14:29:29 +00:00
PyTorch MergeBot
78799e82b0
Revert "Invalidate StorageImpl instances when tensor is overwritten with cudagraphs ( #125264 )"
...
This reverts commit 1bc390c5f5 .
Reverted https://github.com/pytorch/pytorch/pull/125264 on behalf of https://github.com/jithunnair-amd due to test test/inductor/test_cudagraph_trees.py::CudaGraphTreeTests::test_fallback_to_eager_if_recompiling_too_many_times is failing https://github.com/pytorch/pytorch/actions/runs/9933628108/job/27477785946 1bc390c5f5 . Test was introduced by fa5f572748 which is before the merge base ([comment](https://github.com/pytorch/pytorch/pull/125264#issuecomment-2229508737 ))
2024-07-15 21:59:46 +00:00
Isuru Fernando
1bc390c5f5
Invalidate StorageImpl instances when tensor is overwritten with cudagraphs ( #125264 )
...
Fixes #104435
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125264
Approved by: https://github.com/ezyang
2024-07-15 04:16:17 +00:00
Richard Barnes
ed327876f5
[codemod] c10:optional -> std::optional ( #126135 )
...
Generated by running the following from PyTorch root:
```
find . -regex ".*\.\(cpp\|h\|cu\|hpp\|cc\|cxx\)$" | grep -v "build/" | xargs -n 50 -P 4 perl -pi -e 's/c10::optional/std::optional/'
```
`c10::optional` is just an alias for `std::optional`. This removes usages of that alias in preparation for eliminating it entirely.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126135
Approved by: https://github.com/Skylion007 , https://github.com/malfet , https://github.com/albanD , https://github.com/aaronenyeshi
2024-05-14 19:35:51 +00:00
rzou
d486cb7c1b
Deprecate calling FakeTensor.data_ptr in eager-mode ( #123292 )
...
Today, we error out on FakeTensor.data_ptr under torch.compile. This PR
moves to error out on FakeTensor.data_ptr under eager mode to avoid
diverging behavior.
We do this by adding another bit onto FakeTensor that we'll remove after
the deprecation cycle.
Test Plan:
- tested locally
Pull Request resolved: https://github.com/pytorch/pytorch/pull/123292
Approved by: https://github.com/eellison
ghstack dependencies: #123261 , #123282 , #123291
2024-04-04 20:35:24 +00:00
rzou
c81c9ba472
Disallow {FakeTensor,FunctionalTensor}.data_ptr ( #122514 )
...
This PR:
- disallows FakeTensor.data_ptr when it is called inside PT2 or fx tracing.
- disallows FunctionalTensor.data_ptr (python FunctionalTensor is only used in
PT2)
The motivation behind this is that the leading cause of segfaults when
using custom ops with PT2 is calling .data_ptr on FunctionalTensor or
FakeTensor.
This change is BC-breaking. If your code broke as a result of this, it's
because there was a bug in it (these .data_ptr should never be
accessed!). You can either fix the bug (recommended) or get the previous
behavior back with:
```
from torch._subclasses.fake_tensor import FakeTensor
from torch._subclasses.functional_tensor import FunctionalTensor
data_ptr = 0 if isinstance(tensor, (FakeTensor, FunctionalTensor)) else tensor.data_ptr()
```
Test Plan:
- existing tests
Differential Revision: [D55366199](https://our.internmc.facebook.com/intern/diff/D55366199 )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/122514
Approved by: https://github.com/ezyang , https://github.com/albanD , https://github.com/yifuwang , https://github.com/kurtamohler
2024-03-26 23:55:42 +00:00
Chen_Liqing
291ce86a6c
Modify StorageImplCreateHelper ( #118459 )
...
I want to use tensor.untyped_storage()[a:b] for ``PrivateUse1`` backend but fail. The code will go into ``THPStorage_get``:
bb6eba189f/torch/csrc/Storage.cpp (L525-L540)
Here ``torch`` will create a new ``c10::StorageImpl`` but not consider about ``PrivateUse1`` backend.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/118459
Approved by: https://github.com/albanD
2024-03-07 06:26:55 +00:00
Edward Yang
b4a35632f9
Add function to materialize COW storages ( #117053 )
...
Summary: From Kurt Mohler, see https://github.com/pytorch/pytorch/pull/113396 (manually imported due to ghimport problems)
Test Plan: sandcastle, OSS CI
Differential Revision: D52610522
Pull Request resolved: https://github.com/pytorch/pytorch/pull/117053
Approved by: https://github.com/malfet , https://github.com/kurtamohler
2024-01-10 15:34:16 +00:00
cyy
968b94bef2
[8/N] Fixes clang-tidy warnings in c10/{core,util}/*.h ( #116082 )
...
This patch enables clang-tidy coverage on c10/**/*.h and contains other fixes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/116082
Approved by: https://github.com/Skylion007
2023-12-20 12:22:21 +00:00
cyy
1544c37520
[7/N] Fixes clang-tidy warnings in c10/{core,util}/*.h ( #115495 )
...
This PR continues to fix clang-tidy warnings for headers in c10/core and c10/util.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/115495
Approved by: https://github.com/malfet
2023-12-19 02:14:30 +00:00
PyTorch MergeBot
f36d09fcb7
Revert "Add function to materialize COW storages ( #113396 )"
...
This reverts commit e2f090086b .
Reverted https://github.com/pytorch/pytorch/pull/113396 on behalf of https://github.com/DanilBaibak due to Break internal build ([comment](https://github.com/pytorch/pytorch/pull/113396#issuecomment-1818769090 ))
2023-11-20 10:26:01 +00:00
Kurt Mohler
e2f090086b
Add function to materialize COW storages ( #113396 )
...
Part of #109833
Pull Request resolved: https://github.com/pytorch/pytorch/pull/113396
Approved by: https://github.com/ezyang
2023-11-17 01:58:51 +00:00
Kurt Mohler
4c5e43574c
Reland 2: Add PyObject preservation for UntypedStorage ( #109039 )
...
Relands #103907 after it was reverted. This PR makes the new `ignore_hermetic_tls` argument of `check_pyobj` optional to avoid causing a compilation error in torchdistx
Part of #91395
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109039
Approved by: https://github.com/ezyang
2023-09-12 22:26:05 +00:00
PyTorch MergeBot
59f605be57
Revert "Reland 2: Add PyObject preservation for UntypedStorage ( #109039 )"
...
This reverts commit 419e4e17a2 .
Reverted https://github.com/pytorch/pytorch/pull/109039 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it is failing linter job in trunk, probably due to a landrace ([comment](https://github.com/pytorch/pytorch/pull/109039#issuecomment-1715147020 ))
2023-09-12 07:26:11 +00:00
Kurt Mohler
419e4e17a2
Reland 2: Add PyObject preservation for UntypedStorage ( #109039 )
...
Relands #103907 after it was reverted. This PR makes the new `ignore_hermetic_tls` argument of `check_pyobj` optional to avoid causing a compilation error in torchdistx
Part of #91395
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109039
Approved by: https://github.com/ezyang
2023-09-12 01:19:40 +00:00
PyTorch MergeBot
68238606f3
Revert "Reland: Add PyObject preservation for UntypedStorage ( #103907 )"
...
This reverts commit 56b848157c .
Reverted https://github.com/pytorch/pytorch/pull/103907 on behalf of https://github.com/huydhn due to Sorry for reverting your change, but it is failing torchdistx build which uses check_pyobj here 9c1b9f5cb2/src/python/torchdistx/_C/deferred_init.cc (L87) ([comment](https://github.com/pytorch/pytorch/pull/103907#issuecomment-1712121158 ))
2023-09-08 19:27:07 +00:00
Kurt Mohler
56b848157c
Reland: Add PyObject preservation for UntypedStorage ( #103907 )
...
This relands #97470 after #102553 reverted it. This PR attempts to fix the internal failure by avoiding an unnecessary intermediate storage buffer allocation in `c10::newStorageImplFromRefcountedDataPtr`.
Part of #91395
Pull Request resolved: https://github.com/pytorch/pytorch/pull/103907
Approved by: https://github.com/ezyang
2023-09-07 04:24:11 +00:00
cyy
b3e24c53eb
use performance-unnecessary-value-param in clang-tidy ( #102615 )
...
performance-unnecessary-value-param has been disabled in clang-tidy for a long time. However, this check is actually useful and able to some interesting performance problems.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102615
Approved by: https://github.com/malfet , https://github.com/Skylion007
2023-07-28 17:37:03 +00:00
Shiyan Deng
685505353a
Back out "Add PyObject preservation for UntypedStorage ( #97470 )" ( #102553 )
...
Summary:
Original commit changeset: c24708d18ccb
Original Phabricator Diff: D46159983
Test Plan: SL tests and CI
Differential Revision: D46284986
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102553
Approved by: https://github.com/DanilBaibak
2023-06-01 17:23:43 +00:00
cyy
3ae42cb7db
adjust header inclusions in C10 as sugguested by IWYU ( #102467 )
...
This PR aims to reduce unused header inclusions in C10.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102467
Approved by: https://github.com/albanD
2023-05-31 19:19:10 +00:00
Kurt Mohler
5fe629e314
Add PyObject preservation for UntypedStorage ( #97470 )
...
Part of #91395
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97470
Approved by: https://github.com/ezyang
2023-05-23 01:27:30 +00:00
Benson Ma
66a2600b6a
[T153220354] Fix header inclusions in c10 ( #1541 ) ( #101846 )
...
Summary:
This is a re-attempt to land the iwyu header changes, by taking the diff from [PR 100304](https://github.com/pytorch/pytorch/pull/100304 ), and adding the bare minimal changes to make the diff build corectly in the internal builds.
X-link: https://github.com/facebookresearch/pytorch3d/pull/1541
X-link: https://github.com/fairinternal/pytorch3d/pull/44
- Re-work D45769819 to fix header inclusions in c10
Test Plan:
```
buck2 build --no-remote-cache mode/dev-nosan //caffe2/c10/...
buck2 build --no-remote-cache mode/dev-nosan //deeplearning/fbgemm/fbgemm_gpu/...
buck2 build mode/dev-nosan //vision/fair/pytorch3d/pytorch3d:_C
```
Reviewed By: malfet
Differential Revision: D45920611
Pull Request resolved: https://github.com/pytorch/pytorch/pull/101846
Approved by: https://github.com/malfet , https://github.com/Skylion007
2023-05-20 19:35:14 +00:00
Bug Hunter Yan
0c470b17e3
Extend storage create for custom storageImpl ( #100237 )
...
Fixes #ISSUE_NUMBER
For the scenario where users inherit storageimpl to implement their own subclasses, the current storage creation method cannot correctly create storage objects.
Refer to the registration method of Allocator to expand the creation method of storageimpl, users can register their own custom storageimpl creation.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100237
Approved by: https://github.com/albanD
2023-05-17 04:30:13 +00:00
PyTorch MergeBot
4eaaa08623
Revert "Fix header inclusions in c10 by iwyu ( #100304 )"
...
This reverts commit 6037ee8cc9 .
Reverted https://github.com/pytorch/pytorch/pull/100304 on behalf of https://github.com/jeanschmidt due to Breaking meta internal builds and fbgemm builds ([comment](https://github.com/pytorch/pytorch/pull/100304#issuecomment-1543919257 ))
2023-05-11 12:37:35 +00:00
cyy
6037ee8cc9
Fix header inclusions in c10 by iwyu ( #100304 )
...
This work introduces include-what-you-use support for c10 by a CMake option defaulting to off. We also remove some unused header inclusions and fix a trivial inclusion error.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100304
Approved by: https://github.com/ezyang
2023-05-11 05:19:42 +00:00
PyTorch MergeBot
3271413e74
Revert "Fix header inclusions in c10 by iwyu ( #100304 )"
...
This reverts commit 39ec5fa722 .
Reverted https://github.com/pytorch/pytorch/pull/100304 on behalf of https://github.com/huydhn due to Sorry for reverting your PR, it is almost there but fails on Windows 39ec5fa722 , which is in unstable mode after https://github.com/pytorch/pytorch/pull/100548 ([comment](https://github.com/pytorch/pytorch/pull/100304#issuecomment-1542975714 ))
2023-05-11 00:37:32 +00:00
cyy
39ec5fa722
Fix header inclusions in c10 by iwyu ( #100304 )
...
This work introduces include-what-you-use support for c10 by a CMake option defaulting to off. We also remove some unused header inclusions and fix a trivial inclusion error.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100304
Approved by: https://github.com/ezyang
2023-05-10 15:42:43 +00:00
mikey dagitses
8cc57593b9
remove redundant trailing semicolons in StorageImpl.h ( #97658 )
...
remove redundant trailing semicolons in StorageImpl.h
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97658
Approved by: https://github.com/kit1980 , https://github.com/malfet
2023-04-25 21:04:22 +00:00
Edward Z. Yang
756a86d52c
Support large negative SymInt ( #99157 )
...
The strategy is that we will heap allocate a LargeNegativeIntSymNodeImpl whenever we have a large negative int, so that we can keep the old `is_symbolic` test (now called `is_heap_allocated`) on SymInt. Whenever we need to do something with these ints, though, we convert them back into a plain `int64_t` (and then, e.g., wrap it in whatever user specificed SymNodeImpl they need.) We cannot wrap directly in the user specified SymNodeImpl as we generally do not know what the "tracing context" is from C++. We expect large negative ints to be rare, so we don't apply optimizations like singleton-ifying INT_MIN. Here's the order to review:
* c10/core/SymInt.h and cpp
* `is_symbolic` renamed to `is_heap_allocated` as I needed to audit all use sites: the old `is_symbolic` test would return true for large negative int, but it would be wrong to then try to dispatch on the LargeNegativeIntSymNodeImpl which supports very few operations. In this file, I had to update expect_int,
* If you pass in a large negative integer, we instead heap allocate it in `promote_to_negative`. The function is written in a funny way to keep compact constructor code for SymInt (the heap allocation happens out of line)
* clone is now moved out-of-line
* New method maybe_as_int which will give you a constant int if it is possible, either because it's stored inline or in LargeNegativeIntSymNodeImpl. This is the preferred replacement for previous use of is_symbolic() and then as_int_unchecked().
* Rename toSymNodeImpl to toSymNode, which is more correct (since it returns a SymNode)
* Complete rewrite of `normalize_symints.cpp` to use new `maybe_as_int`. Cannot easily use the old code structure, so it's now done doing a macro and typing out each case manually (it's actually not that bad.)
* Reimplementations of all the unary operators by hand to use `maybe_as_int`, relatively simple.
* c10/core/LargeNegativeIntSymNodeImpl.h - Just stores a int64_t value, but it has to be big and negative. Most methods are not implemented, since we will rewrap the large negative int in the real SymNodeImpl subclass before doing operations with it
* The rest of the files are just rewriting code to use `maybe_as_int`. There is a nontrivial comment in c10/core/SymIntArrayRef.h
Very minor test adjustment in c10/test/core/SymInt_test.cpp . Plan to exercise this properly in next PR.
Companion XLA PR: https://github.com/pytorch/xla/pull/4882
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/99157
Approved by: https://github.com/albanD
2023-04-15 22:43:51 +00:00
mikey dagitses
3af0228338
remove typed StorageImpl::unsafe_data() ( #98218 )
...
Typed data will now only be a tensor level concept.
Differential Revision: [D44629939](https://our.internmc.facebook.com/intern/diff/D44629939/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98218
Approved by: https://github.com/ezyang
2023-04-05 00:10:59 +00:00
mikey dagitses
4431509a54
introduce c10::DataPtr::mutable_get() and use it in c10 ( #98217 )
...
Differential Revision: [D44629940](https://our.internmc.facebook.com/intern/diff/D44629940/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98217
Approved by: https://github.com/ezyang
2023-04-04 02:26:18 +00:00
mikey dagitses
64077ce511
remove redundant typed StorageImpl::data() member ( #97650 )
...
This has the same implementation as the unsafe variants and the unsafe
variants match the original semantics of the code, given that they
don't check that the type matches.
Given that we're updating callsites anyways to address the mutability
aspect, we might as well just drop this method now.
Differential Revision: [D44410210](https://our.internmc.facebook.com/intern/diff/D44410210/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97650
Approved by: https://github.com/ezyang
2023-04-01 08:16:54 +00:00
mikey dagitses
cb8c0be54d
add StorageImpl::mutable_unsafe_data ( #97648 )
...
See D44409928.
Differential Revision: [D44409945](https://our.internmc.facebook.com/intern/diff/D44409945/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97648
Approved by: https://github.com/ezyang
2023-03-31 16:04:07 +00:00
mikey dagitses
da28af3286
distinguish mutability of StorageImpl::data_ptr() member ( #97651 )
...
See D44409928.
Differential Revision: [D44410323](https://our.internmc.facebook.com/intern/diff/D44410323/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97651
Approved by: https://github.com/ezyang
2023-03-30 19:13:56 +00:00
mikey dagitses
428cb3a868
distinguish mutability of untyped StorageImpl::data() member ( #97647 )
...
To implement the warning when transitioning reshape to copy-on-write
storage, we want to be able to detect a write to one view family
following by a read or a write to another one that shares the same
copy-on-write storage.
Because we have historically not been strict about the mutability of
our data pointers, any warning we have would likely be far too
aggressive.
Therefore, this is the first PR in a long series to ensure a strict
distinction between mutable and const data accessors in TensorBase,
TensorImpl, Storage, and StorageImpl.
The rough plan is to give the mutable accessor a new name that is
explicit about mutation, this will also force us to rewrite any code
that really needs a mutation.
Differential Revision: [D44409928](https://our.internmc.facebook.com/intern/diff/D44409928/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97647
Approved by: https://github.com/ezyang
2023-03-30 09:45:09 +00:00
Kurt Mohler
1b59c3feb5
Add PyObjectSlot member to StorageImpl ( #93342 )
...
Part of #91395
Also modifies how `StorageImpl`s are stored in JIT static runtime's `MemoryPlanner`, which used to `std::move` `StorageImpl`s into a vector. But `StorageImpl` can no longer be moved. Instead, `MemoryPlanner` now contains a malloced buffer to which we add new `StorageImpl`s using placement new
Pull Request resolved: https://github.com/pytorch/pytorch/pull/93342
Approved by: https://github.com/ezyang
2023-03-10 10:40:01 +00:00
Aaron Gokaslan
48dc24ddce
Fix: [ATen] Add some missing moves ( #88514 )
...
Related to #88512 , but for ATen. This should reduce a number of copies and inefficient atomic smart pointer increments.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88514
Approved by: https://github.com/jgong5 , https://github.com/ezyang
2022-11-13 22:05:41 +00:00
Scott Wolchok
f6a18d3d37
[PyTorch] StorageImpl: cache size_bytes.is_symbolic() ( #85309 )
...
We've got 6 bools' worth of extra space, so let's try caching this.
Differential Revision: [D39636570](https://our.internmc.facebook.com/intern/diff/D39636570/ )
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D39636570/ )!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85309
Approved by: https://github.com/ezyang
2022-09-20 22:50:35 +00:00
Edward Z. Yang
e1f634753c
Setup fake tensor and symbolic shapes once at beginning of AOTAutograd ( #85233 )
...
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Differential Revision: [D39662822](https://our.internmc.facebook.com/intern/diff/D39662822 )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85233
Approved by: https://github.com/wconstab
2022-09-20 19:11:25 +00:00
Edward Z. Yang
95f9ca4931
Symbolic storage size
...
Signed-off-by: Edward Z. Yang <ezyangfb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79492
Approved by: https://github.com/albanD
2022-06-14 17:54:34 +00:00
Scott Wolchok
fff1948b02
[PyTorch] intrusive_ptr: don't guarantee release_resources will be called
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76767
We're spending a virtual function call in the common case
where there are no weak references just to save a small amount of care
in intrusive_ptr_target subclasses that override release_resources, of
which there aren't very many.
Differential Revision: [D36109757](https://our.internmc.facebook.com/intern/diff/D36109757/ )
**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D36109757/ )!
Approved by: https://github.com/ezyang
2022-06-10 19:30:35 +00:00
Richard Barnes
72e4aab74b
Eliminate unused parameters in PyTorch ( #73749 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73749
Unused parameters cause compiler warnings which distract from real issues. Let's remove unused parameters!
Test Plan: Sandcastle
Reviewed By: swolchok, ngimel
Differential Revision: D34567731
fbshipit-source-id: 2e42301a29a8e1014ac8ab429588bb773db58850
(cherry picked from commit 3eda4743991328d532194efd0fe3d127a294343d)
2022-03-04 02:31:37 +00:00