cyy
e872c38eb3
Remove cppcoreguidelines-pro-type-member-init_fix suppression ( #148638 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148638
Approved by: https://github.com/zou3519
2025-04-02 01:33:20 +00:00
Su, Tong
60523540f1
Force build to conform C++ standard on windows by adding /permissive- flag ( #149035 )
...
Fixes #147366
1. Add `/permissive-` to the `torch_compile_options` for the build to conform to the C++ standard.
2. Fix the error when trying to assign a string literal to a non-const ptr.
The `/permissive-` flag can be found at https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170
From the above [doc](https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170#remarks ),
> By default, the /permissive- option is set in new projects created by Visual Studio 2017 version 15.5 and later versions.
> The /permissive- option is implicitly set by the /std:c++latest option starting in Visual Studio 2019 version 16.8, and in version 16.11 by the /std:c++20 option.
Thus, it is reasonable to add this flag to the existing project.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149035
Approved by: https://github.com/guangyey , https://github.com/malfet
2025-03-18 01:51:46 +00:00
cyy
f7c0c230b0
Fix compile errors ( #148758 )
...
Fix
```
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'torch::jit::AliasDb::WriteRegistry'
91 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_ptr.h:399:4: note: in instantiation of member function 'std::default_delete<torch::jit::AliasDb::WriteRegistry>::operator()' requested here
399 | get_deleter()(std::move(__ptr));
| ^
../torch/csrc/jit/ir/alias_analysis.cpp:200:10: note: in instantiation of member function 'std::unique_ptr<torch::jit::AliasDb::WriteRegistry>::~unique_ptr' requested here
200 | AliasDb::~AliasDb() = default;
| ^
../torch/csrc/jit/ir/alias_analysis.cpp:200:23: note: in defaulted destructor for 'torch::jit::AliasDb' first required here
200 | AliasDb::~AliasDb() = default;
| ^
../torch/csrc/jit/ir/alias_analysis.h:298:10: note: forward declaration of 'torch::jit::AliasDb::WriteRegistry'
298 | struct WriteRegistry;
| ^
1 error generated.
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148758
Approved by: https://github.com/Skylion007
2025-03-08 04:56:42 +00:00
Richard Barnes
5301710b15
[codemod] Fix unused-value issue in caffe2/aten/src/ATen/cuda/detail/CUDAHooks.cpp +4 ( #147555 )
...
Summary:
LLVM has a warning `-Wunused-value` which we treat as an error because it's so often diagnostic of a code issue. Unused values often indicate a programming mistake, but can also just be unnecessary cruft that harms readability and performance.
For questions/comments, contact r-barnes.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Test Plan: Sandcastle
Differential Revision: D69945678
Pull Request resolved: https://github.com/pytorch/pytorch/pull/147555
Approved by: https://github.com/Skylion007 , https://github.com/eqy
2025-03-01 19:46:13 +00:00
Michal Gallus
d9cf1debf9
[ROCm][Windows] Fix clang-cl error related to -Wmissing prototypes enabled ( #146981 )
...
Some of the windows files (fused_kernels.cpp or temp_file.h) contain code that fail to compile when this flag is enabled when built with clang-cl.
This PR resolves the issue by ensuring that even if we build with clang-cl, it doesn't include those flags on windows.
Alternatively if needed, I can fix the files mentioned to pass under this flag.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146981
Approved by: https://github.com/cyyever , https://github.com/Skylion007
2025-02-18 07:41:12 +00:00
cyy
8f291e8c00
Fix clang-tidy warnings in torch/jit ( #146963 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146963
Approved by: https://github.com/davidberard98
2025-02-15 03:36:59 +00:00
cyy
25aa7ca62d
Cleanup CallOnce.h ( #146700 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146700
Approved by: https://github.com/albanD
2025-02-07 16:44:45 +00:00
PyTorch MergeBot
00dc5b10f6
Revert "[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )"
...
This reverts commit 2fd1b6b361 .
Reverted https://github.com/pytorch/pytorch/pull/140211 on behalf of https://github.com/atalman due to Breaks executorch tests ([comment](https://github.com/pytorch/pytorch/pull/140211#issuecomment-2632202864 ))
2025-02-03 22:04:28 +00:00
cyy
2fd1b6b361
[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140211
Approved by: https://github.com/ezyang , https://github.com/eqy
2025-02-01 12:33:41 +00:00
PyTorch MergeBot
284f217011
Revert "[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )"
...
This reverts commit 97b3b73f3e .
Reverted https://github.com/pytorch/pytorch/pull/140211 on behalf of https://github.com/ZainRizvi due to Sorry but this is failing internally. @eqy @ezyang can you please help this get remerged? See D68779772. ([comment](https://github.com/pytorch/pytorch/pull/140211#issuecomment-2622504898 ))
2025-01-29 18:24:29 +00:00
cyyever
97b3b73f3e
[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140211
Approved by: https://github.com/ezyang , https://github.com/eqy
2025-01-28 15:21:12 +00:00
PyTorch MergeBot
614e727191
Revert "[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )"
...
This reverts commit cd942d00dd .
Reverted https://github.com/pytorch/pytorch/pull/140211 on behalf of https://github.com/izaitsevfb due to causes crash internally during test listing ([comment](https://github.com/pytorch/pytorch/pull/140211#issuecomment-2492328790 ))
2024-11-21 21:05:22 +00:00
cyyever
cd942d00dd
[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140211
Approved by: https://github.com/ezyang , https://github.com/eqy
2024-11-21 00:25:20 +00:00
PyTorch MergeBot
4a18e26ff5
Revert "[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )"
...
This reverts commit a3cff4bbd4 .
Reverted https://github.com/pytorch/pytorch/pull/140211 on behalf of https://github.com/ezyang due to One of these diffs had incorrect downstream optional handling, we must reaudit all of these diffs ([comment](https://github.com/pytorch/pytorch/pull/140211#issuecomment-2473709246 ))
2024-11-13 14:05:01 +00:00
cyy
a3cff4bbd4
[Environment Variable][7/N] Use thread-safe getenv functions ( #140211 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140211
Approved by: https://github.com/ezyang , https://github.com/eqy
2024-11-12 18:49:51 +00:00
cyy
0274d16c01
Fix clang-tidy warnings in jit code ( #138974 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138974
Approved by: https://github.com/ezyang
2024-10-29 04:33:40 +00:00
cyy
f4f0f2995d
Fix Wextra-semi warnings ( #139000 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/139000
Approved by: https://github.com/ezyang
2024-10-28 21:48:51 +00:00
cyy
1a73255102
Concat namespaces in jit code ( #138976 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138976
Approved by: https://github.com/Skylion007
2024-10-26 17:41:27 +00:00
cyy
7bbdf87517
[22/N] Fix clang-tidy warnings in jit ( #134829 )
...
Follows #134537
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134829
Approved by: https://github.com/ezyang
2024-09-19 19:24:42 +00:00
cyy
ec3f52dd27
[21/N] Fix clang-tidy warnings in jit ( #134537 )
...
Follows #133399
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134537
Approved by: https://github.com/Skylion007
2024-08-28 03:22:01 +00:00
cyy
73604eed0c
[20/N] Fix clang-tidy warnings in jit ( #133399 )
...
Follows #133067
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133399
Approved by: https://github.com/Skylion007
2024-08-26 17:43:52 +00:00
Jerry Mannil
42f647219a
[ROCm] Add int4 support ( #129710 )
...
- Add AMD support for int4 kernel
- Only supports CDNA2 and CDNA3 gpus for now
- Uses `mfma_f32_16x16x16bf16` instruction for matrix multiply
- Uses `v_and_or_b32` instruction and `__hfma2` instrinsic for unpacking bf16 values
- Enable hipify for `__nv_bfloat16` and `__nv_bfloat162` data types
- Enable int4 unit tests for CDNA2 and CDNA3 AMD gpus
- Fix torchscript issues due to hipify for `__nv_bfloat16` type
- TorchScript has its own implementation for bfloat16 type
- Implemented in `__nv_bloat16` structure at [resource_strings.h](https://github.com/pytorch/pytorch/blob/main/torch/csrc/jit/codegen/fuser/cuda/resource_strings.h )
- So, we shouldn't hipify any reference of `__nv_bfloat16` in the torchscript implementation
- Hence moved the `__nv_bfloat16` direct references in `codegen.cpp` and `cuda_codegen.cpp` to `resource_strings.h` which is already exempted from hipify
Fixes #124699
Fixes pytorch-labs/gpt-fast/issues/154
Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129710
Approved by: https://github.com/malfet
2024-07-09 19:49:12 +00:00
cyy
71efbf701d
[3/N] Change #include <c10/util/Optional.h> to #include <optional> ( #130300 )
...
Follows #130236
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130300
Approved by: https://github.com/ezyang
2024-07-09 13:32:57 +00:00
cyy
29861779ce
[2/N] Change #include <c10/util/Optional.h> to #include <optional> ( #130236 )
...
Follows #128301 . The changes were made by grep and sed
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130236
Approved by: https://github.com/ezyang
2024-07-09 03:17:24 +00:00
cyy
f4dcf2ae93
[1/N] Change #include <c10/util/Optional.h> to #include <optional> ( #128301 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/128301
Approved by: https://github.com/ezyang , https://github.com/r-barnes
2024-07-08 07:03:53 +00:00
PyTorch MergeBot
846bb30e13
Revert "[1/N] Change #include <c10/util/Optional.h> to #include <optional> ( #128301 )"
...
This reverts commit bd72e28314 .
Reverted https://github.com/pytorch/pytorch/pull/128301 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it fails XLA build bd72e28314 . Please rebase your PR before relanding because I think the failure is hidden by an unrelated broken trunk XLA failure from your current base commit ([comment](https://github.com/pytorch/pytorch/pull/128301#issuecomment-2169035822 ))
2024-06-15 01:58:20 +00:00
cyy
bd72e28314
[1/N] Change #include <c10/util/Optional.h> to #include <optional> ( #128301 )
...
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/128301
Approved by: https://github.com/ezyang
2024-06-14 23:21:01 +00:00
cyy
30875953a4
[1/N] Remove inclusion of c10/util/string_utils.h ( #128300 )
...
As a first step to remove it.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/128300
Approved by: https://github.com/ezyang , https://github.com/eqy
2024-06-10 23:40:47 +00:00
cyy
e5db6758c8
[BE]: Use make_unique ( #126966 )
...
Adds make_unique in places
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126966
Approved by: https://github.com/Skylion007
2024-05-23 17:39:48 +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
Jeff Daily
ae9a4fa63c
[ROCm] enforce ROCM_VERSION >= 6.0 ( #125646 )
...
Remove any code relying on ROCM_VERSION < 6.0.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125646
Approved by: https://github.com/albanD , https://github.com/eqy
2024-05-12 18:01:28 +00:00
cyy
5f9b432494
[2/N] Replace std::tie with structural binding ( #119879 )
...
This PR follows #119774 , Python generated code was changed to use structural binding.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/119879
Approved by: https://github.com/albanD
2024-02-15 02:56:34 +00:00
Xia, Weiwen
daf89b4101
Update oneDNN submodule to v3.3.2 ( #112700 )
...
Update oneDNN submodule to v3.3.2.
Add a macro to check the version of `third_party/ideep`.
Since we have versioning now, the changes won't break any pipeline even if `third_party/ideep` is not updated at the same time.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/112700
Approved by: https://github.com/leslie-fang-intel , https://github.com/atalman
2023-12-05 17:51:55 +00:00
PyTorch MergeBot
62df4f3428
Revert "Update oneDNN submodule to v3.3.2 ( #112700 )"
...
This reverts commit afbaa0c165 .
Reverted https://github.com/pytorch/pytorch/pull/112700 on behalf of https://github.com/atalman due to Diff broke internal tests ([comment](https://github.com/pytorch/pytorch/pull/112700#issuecomment-1839350284 ))
2023-12-04 19:41:12 +00:00
Xia, Weiwen
afbaa0c165
Update oneDNN submodule to v3.3.2 ( #112700 )
...
Update oneDNN submodule to v3.3.2.
Add a macro to check the version of `third_party/ideep`.
Since we have versioning now, the changes won't break any pipeline even if `third_party/ideep` is not updated at the same time.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/112700
Approved by: https://github.com/leslie-fang-intel , https://github.com/atalman
2023-12-01 18:40:07 +00:00
cyy
bae61ecb96
[Reland 1] Cleanup header inclusions in torch_cpu by iwyu ( #112311 )
...
Reland https://github.com/pytorch/pytorch/pull/101178 to use IWYU on torch_cpu. The header file changes are excluded to avoid breaking internal jobs.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/112311
Approved by: https://github.com/ezyang
2023-11-19 04:06:36 +00:00
jjsjann123
39c09d4da6
Revert "Revert "Nvfuser code removal ( #111093 )"" ( #111604 )
...
This reverts commit 715dfced72 .
The original PR #111093 is reverted due to broken internal build.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111604
Approved by: https://github.com/davidberard98
2023-10-23 18:32:41 +00:00
PyTorch MergeBot
715dfced72
Revert "Nvfuser code removal ( #111093 )"
...
This reverts commit 572628e520 .
Reverted https://github.com/pytorch/pytorch/pull/111093 on behalf of https://github.com/jeanschmidt due to Breaking internal builds, @albanD please help to support the author with the next steps to get this diff merged ([comment](https://github.com/pytorch/pytorch/pull/111093#issuecomment-1771434853 ))
2023-10-19 17:39:49 +00:00
jjsjann123
572628e520
Nvfuser code removal ( #111093 )
...
Removes the existing integration code & build of nvfuser in TorchScript.
Note that I intentionally left the part where we wipe out `third_party/nvfuser` repo. I'll do that in a separate PR.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111093
Approved by: https://github.com/albanD
2023-10-18 01:00:47 +00:00
jjsjann123
37567fdf31
Nvfuser cpp api deprecation attempt 2 ( #110881 )
...
attempting to re-try #110318 deprecating nvfuser c++ API
warning has been updated to TORCH_WARN_ONCE;
Warning thrown inside torch::jit::fuser::cuda::isEnabled() is turned off and will be deprecated when we pulled out TorchScript integration in the follow up PR.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110881
Approved by: https://github.com/davidberard98 , https://github.com/NicolasHug
2023-10-10 08:07:03 +00:00
PyTorch MergeBot
bbdc8c7b05
Revert "deprecating nvfuser c++ API ( #110318 )"
...
This reverts commit bf0866fc16 .
Reverted https://github.com/pytorch/pytorch/pull/110318 on behalf of https://github.com/davidberard98 due to too many warnings being thrown in torchvision https://github.com/pytorch/pytorch/issues/110857 ([comment](https://github.com/pytorch/pytorch/pull/110318#issuecomment-1753245449 ))
2023-10-09 15:41:50 +00:00
jjsjann123
bf0866fc16
deprecating nvfuser c++ API ( #110318 )
...
deprecating nvfuser c++ API
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110318
Approved by: https://github.com/davidberard98
2023-10-07 02:25:21 +00:00
jjsjann123
e6b5e0ecc6
removing the functionality of nvfuser python APIs ( #110124 )
...
Removing the functionalities from nvfuser python APIs.
Since the use of nvfuser has been deprecated before the last release cut. We are removing torch script support.
I'll have the next PR to actually remove the code base.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110124
Approved by: https://github.com/davidberard98
2023-09-29 01:45:00 +00:00
PyTorch MergeBot
83deaa16ed
Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu ( #101178 )"
...
This reverts commit b7a95f4fdb .
Reverted https://github.com/pytorch/pytorch/pull/101178 on behalf of https://github.com/atalman due to Break internal CI ([comment](https://github.com/pytorch/pytorch/pull/101178#issuecomment-1734384645 ))
2023-09-25 20:05:25 +00:00
cyy
b7a95f4fdb
[1/N] Cleanup header inclusions in torch_cpu by iwyu ( #101178 )
...
Following our previous IWYU work #100304 on C10, it makes more sense to try IWYU on torch_cpu. This PR does exactly that. Meanwhile, it fixes issue #48684 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/101178
Approved by: https://github.com/ezyang
2023-09-24 05:01:20 +00:00
cyy
e9e93c5350
[Reland] Move torch::make_unique to std::make_unique ( #109780 )
...
We can first try to move torch::make_unique to std::make_unique despite reverting of #108866 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109780
Approved by: https://github.com/ezyang
2023-09-21 18:30:21 +00:00
Peter Bell
7ce69d5dbe
[RELAND] Remove some unnecessary <iostream> includes from headers ( #108150 )
...
In almost all cases this is only included for writing the output formatter, which
only uses `std::ostream` so including `<ostream>` is sufficient.
The istream header is ~1000 lines so the difference is non-trivial.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/108150
Approved by: https://github.com/albanD , https://github.com/malfet
ghstack dependencies: #108149
2023-09-20 21:55:15 +00:00
PyTorch MergeBot
525e4f42d0
Revert "replace torch::make_unique with std::make_unique ( #108866 )"
...
This reverts commit 03e35efbf7 .
Reverted https://github.com/pytorch/pytorch/pull/108866 on behalf of https://github.com/clee2000 due to Sorry but I found more usages of `torch::make_unique` internally, I can go change all of these, but I'd prefer if that gets done before this gets merged ([comment](https://github.com/pytorch/pytorch/pull/108866#issuecomment-1722577925 ))
2023-09-17 21:57:30 +00:00
cyy
03e35efbf7
replace torch::make_unique with std::make_unique ( #108866 )
...
It should be safe to remove the old torch::make_unique functions.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/108866
Approved by: https://github.com/albanD
2023-09-14 20:52:26 +00:00
PyTorch MergeBot
378ffde8c1
Revert "Remove some unnecessary <iostream> includes from headers ( #106914 )"
...
This reverts commit a6c29b7227 .
Reverted https://github.com/pytorch/pytorch/pull/106914 on behalf of https://github.com/izaitsevfb due to Causing metal breakage internally, see D48709279 ([comment](https://github.com/pytorch/pytorch/pull/106914#issuecomment-1696670027 ))
2023-08-29 02:22:33 +00:00