0104ac0f6f
[Ez][BE]: Fix click ImportError in torch/csrc/jit ( #153323 )
...
Fixes unnecessary import for torch script. Unblocks #153020 as it appears to fix circular importer linter into importing every Python file under torch
Pull Request resolved: https://github.com/pytorch/pytorch/pull/153323
Approved by: https://github.com/ngimel , https://github.com/cyyever
2025-05-11 19:16:01 +00:00
1c30862d8f
Partilally revert https://github.com/pytorch/pytorch/pull/152288 ( #152909 )
...
Summary: As it results in build failures for some internal targets that stuck on older compiler. Platform update is tracked in [T223408150](https://www.internalfb.com/tasks?t=223408150 )
Test Plan: CI
Differential Revision: D74220384
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152909
Approved by: https://github.com/cyyever , https://github.com/wdvr
2025-05-06 22:02:42 +00:00
8904ba6387
Forward fix D74196435 ( #152926 )
...
Summary: Forward fix a misplace declaration from D74196435
Test Plan: Random check with a failed build `buck2 build --config fbcode.enable_gpu_sections=true --flagfile fbcode//mode/opt fbcode//accelerators/workloads/models/emu_flash/tests:test_compile_eager`
Reviewed By: wdvr
Differential Revision: D74225582
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152926
Approved by: https://github.com/cyyever , https://github.com/wdvr
2025-05-06 07:33:38 +00:00
45efa1aaa8
[3/N] Use internal linkage in C++ files ( #151297 )
...
Follows #151070 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151297
Approved by: https://github.com/Skylion007
2025-05-05 17:48:39 +00:00
ce94b212c7
[Environment Variable][Rebase] Use thread-safe getenv functions ( #140200 )
...
Use our thread-safe getenv wrappers.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140200
Approved by: https://github.com/kwen2501 , https://github.com/eqy
2025-05-02 00:41:49 +00:00
256c96332c
[1/N] Use std::filesystem ( #152288 )
...
Maybe it is time to use std::filesystem because CXX11 ABI is now the default. The changes are for jit and distributed code.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152288
Approved by: https://github.com/Skylion007
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com >
2025-04-30 17:54:16 +00:00
41bd0c900a
[1/N] Deprecate c10::string_view and at::string ( #151972 )
...
The calls of `c10::string_view` in the code base are replaced by `std::string_view`. The calls of `at::string` are replaced by `std::string`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151972
Approved by: https://github.com/malfet
2025-04-29 07:23:52 +00:00
520366e102
Fix StringCoordView::substr after D73379178 / #151810 ( #152304 )
...
Received complaint that we broke something. After a bunch of debugging, landed on this test + fix.
Differential Revision: [D73754877](https://our.internmc.facebook.com/intern/diff/D73754877/ )
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D73754877/ )!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152304
Approved by: https://github.com/Skylion007
2025-04-29 06:00:38 +00:00
46419c7899
Revert "[Relandx2] Rewrite the guts of torch::jit::Lexer to speed it up ( #152372 )"
...
This reverts commit 7ce6f632142b65849fa33f325c90a24bace2c130.
Reverted https://github.com/pytorch/pytorch/pull/152372 on behalf of https://github.com/malfet due to Looks like it broke distributed this time around, see f05d3e5019/1 ([comment](https://github.com/pytorch/pytorch/pull/152372#issuecomment-2837426497 ))
2025-04-29 04:37:40 +00:00
7ce6f63214
[Relandx2] Rewrite the guts of torch::jit::Lexer to speed it up ( #152372 )
...
Reapplying with fix for linux-manylinux-2_28-py3-cpu-s390x / build
failure
(https://github.com/pytorch/pytorch/actions/runs/14716285820/job/41300304223#logs ),
which is to just update a pair of static_assert constants I got wrong.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152372
Approved by: https://github.com/wdvr , https://github.com/malfet
2025-04-28 23:55:48 +00:00
e7c19f4f69
Revert "Reapply "Rewrite the guts of torch::jit::Lexer to speed it up ( #151850 )" ( #152250 )"
...
This reverts commit e407ea1e5e22a41d14ce141295bf391cd46f2677.
Reverted https://github.com/pytorch/pytorch/pull/152250 on behalf of https://github.com/malfet due to Breaks s390, may be time to move build back to opt-in 2667cb69d9/1 ([comment](https://github.com/pytorch/pytorch/pull/152250#issuecomment-2836833030 ))
2025-04-28 22:05:12 +00:00
e407ea1e5e
Reapply "Rewrite the guts of torch::jit::Lexer to speed it up ( #151850 )" ( #152250 )
...
Almost-exact reapply of #151850 (adding minor reviewer nits) . AFAICT it was reverted unnecessarily.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152250
Approved by: https://github.com/Skylion007 , https://github.com/cyyever
2025-04-28 19:33:40 +00:00
70d7638b0d
Fix clang-tidy suppression in torch/csrc/jit ( #152271 )
...
Remove some clang-tidy suppression in torch/csrc/jit by applying fixes or refactoring.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152271
Approved by: https://github.com/Skylion007 , https://github.com/malfet
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com >
2025-04-27 21:18:39 +00:00
e2f9759bd0
Fix broken URLs ( #152237 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152237
Approved by: https://github.com/huydhn , https://github.com/malfet
2025-04-27 09:56:42 +00:00
fa1b4ef649
Revert "Rewrite the guts of torch::jit::Lexer to speed it up ( #151850 )"
...
This reverts commit 47d34261e06e2416e7a1e7d51a3d428e4ea51f9d.
Reverted https://github.com/pytorch/pytorch/pull/151850 on behalf of https://github.com/ZainRizvi due to This codev PR is breaking on it's internal counterpart diff D73129443. For codev PRs like this one, please always make sure the internal diff is green and then land the diff internally. The Github PR will be automatically merged ([comment](https://github.com/pytorch/pytorch/pull/151850#issuecomment-2831686141 ))
2025-04-26 00:44:11 +00:00
47d34261e0
Rewrite the guts of torch::jit::Lexer to speed it up ( #151850 )
...
The trie-based approach was, apparently, not efficient. This incidentally fixes a bug where "not inp" and "is note" were lexed incorrectly; see test_lexer.cpp update.
Differential Revision: [D73129443](https://our.internmc.facebook.com/intern/diff/D73129443/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151850
Approved by: https://github.com/Skylion007
ghstack dependencies: #151801 , #151802 , #151803 , #151804 , #151805 , #151806 , #151807 , #151810 , #151849
2025-04-25 23:49:35 +00:00
9e50c21e27
Fix xrefs ( #151888 )
...
Fix existing cross references and removed old ones
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151888
Approved by: https://github.com/eqy , https://github.com/huydhn , https://github.com/svekars
2025-04-25 21:27:27 +00:00
2a58d2a155
StringCordView: make iterator fast when there is only one piece ( #151810 )
...
This makes the StringCordView iterator a variant holding
either the existing implementation (when there is more than one piece)
or a simple `std::string_view::iterator` (when there is only one
piece). The latter seems to be significantly cheaper.
Differential Revision: [D73379178](https://our.internmc.facebook.com/intern/diff/D73379178/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151810
Approved by: https://github.com/Skylion007
ghstack dependencies: #151801 , #151802 , #151803 , #151804 , #151805 , #151806 , #151807
2025-04-24 04:43:34 +00:00
76cc379bec
Fix missing moves in SchemaTypeParser::parseFakeAndRealType ( #151807 )
...
Was seeing a small amount of shared_ptr traffic from these.
The std::move(text) at the top is just a piggyback.
Differential Revision: [D73376720](https://our.internmc.facebook.com/intern/diff/D73376720/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151807
Approved by: https://github.com/zou3519 , https://github.com/cyyever , https://github.com/Skylion007
ghstack dependencies: #151801 , #151802 , #151803 , #151804 , #151805 , #151806
2025-04-24 04:43:34 +00:00
68454b9d17
Fix a missed c10::TypeFactory::create spot in function_schema_parser ( #151806 )
...
Looks like we are supposed to be using TypeFactory instead of direct creation everywhere that might run on mobile.
Differential Revision: [D73376716](https://our.internmc.facebook.com/intern/diff/D73376716/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151806
Approved by: https://github.com/Skylion007 , https://github.com/iseeyuan
ghstack dependencies: #151801 , #151802 , #151803 , #151804 , #151805
2025-04-24 04:43:34 +00:00
b237211b42
Fix easy missing moves in function_schema_parser ( #151805 )
...
Just some straightforward not-moving-upon-return.
Differential Revision: [D73376718](https://our.internmc.facebook.com/intern/diff/D73376718/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151805
Approved by: https://github.com/malfet , https://github.com/cyyever
ghstack dependencies: #151801 , #151802 , #151803 , #151804
2025-04-24 04:43:34 +00:00
89a85d0954
Add & use Token::text_view() (which returns a string_view unlike text()) ( #151804 )
...
Sadly, I can't just fix text() because that might cause lifetime issues in somebody's code.
Differential Revision: [D73376715](https://our.internmc.facebook.com/intern/diff/D73376715/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151804
Approved by: https://github.com/zou3519 , https://github.com/cyyever , https://github.com/Skylion007 , https://github.com/malfet
ghstack dependencies: #151801 , #151802 , #151803
2025-04-24 04:43:34 +00:00
f2cfeb23e5
[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-04-24 01:06:29 +00:00
aa61707a56
Fix extra heap allocation in Source constructor ( #151800 )
...
This was a sneaky one: the StringCordView default constructor allocates.
Differential Revision: [D73129448](https://our.internmc.facebook.com/intern/diff/D73129448/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151800
Approved by: https://github.com/malfet , https://github.com/cyyever , https://github.com/Skylion007
ghstack dependencies: #151682
2025-04-22 23:36:06 +00:00
e48189cf03
Don't eagerly create AliasInfo in parseAliasDeclaration ( #151630 )
...
No need to create an AliasInfo...unless we need it.
Differential Revision: [D73129452](https://our.internmc.facebook.com/intern/diff/D73129452/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151630
Approved by: https://github.com/Skylion007 , https://github.com/malfet
ghstack dependencies: #151626 , #151627 , #151628 , #151629
2025-04-18 22:51:37 +00:00
313ceb4da3
Reserve vector in StringCordView ctor ( #151628 )
...
Clear missing reserve (we should expect that pieces are not empty).
Differential Revision: [D73129445](https://our.internmc.facebook.com/intern/diff/D73129445/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151628
Approved by: https://github.com/Skylion007 , https://github.com/malfet
ghstack dependencies: #151626 , #151627
2025-04-18 22:51:29 +00:00
eb19f5abab
[2/N] Use internal linkage in aten C++ files ( #151070 )
...
Turn functions and variables into static if they are not used outside the ten cpp files. In some cases, missing header inclusion is added. In other cases, unused functions are removed.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151070
Approved by: https://github.com/Skylion007
2025-04-14 16:07:17 +00:00
24ca7e91e6
[1/N] Use internal linkage in torch/csrc C++ files. ( #150930 )
...
Turn more functions and variables into static if they are not used outside the cpp files. Unused functions are removed.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150930
Approved by: https://github.com/Skylion007
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com >
2025-04-11 02:19:31 +00:00
c714d2fc0e
[hop] support base_hop._gen_schema ( #149688 )
...
This PR creates two utils for generating a schema for hops from example inputs and use base hop as an exmaple.
1. HopArgumentInfoGen creates an argument or an output schema with mutation information.
2. CFuncitonSchemaGen piece together the argument info of inputs and outputs and produces torch._C.FunctionSchema.
is_write attribute of argument info can be computed. Note that the is_write annotation only works when the inputs are flattened (e.g. cannot support mutation inside tuple). We need special handling the case where we have tuple inputs like cond.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149688
Approved by: https://github.com/zou3519
2025-04-09 16:42:55 +00:00
64ac41f68d
[pytorch] add header docs for TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT ( #150854 )
...
Summary: Add header docs for the experimental TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT feature, and guard behind C10_MOBILE.
Reviewed By: albanD
Differential Revision: D72572345
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150854
Approved by: https://github.com/larryliu0820 , https://github.com/zou3519
2025-04-09 12:59:24 +00:00
142f0f86ce
Enable modernize-use-default-member-init ( #149046 )
...
``modernize-use-default-member-init`` prefers initialisation in class members, that make more ``= default`` constructors possible. Some violations or modernize rules have been fixed.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149046
Approved by: https://github.com/zou3519
2025-04-09 11:57:24 +00:00
4926bd6004
Revert "Fix the Problems About Defining Static Variable in Inline Function ( #147095 )"
...
This reverts commit 3da14d38bd396f5bbe8494872d1509efa1a6f048.
Reverted https://github.com/pytorch/pytorch/pull/147095 on behalf of https://github.com/atalman due to breaks internally ([comment](https://github.com/pytorch/pytorch/pull/147095#issuecomment-2787129770 ))
2025-04-08 17:10:36 +00:00
3da14d38bd
Fix the Problems About Defining Static Variable in Inline Function ( #147095 )
...
Refer to https://github.com/pytorch/pytorch/issues/125465 for more informations
- Remove unused header files
- Move the inline function that defines the static variable to .cc
Pull Request resolved: https://github.com/pytorch/pytorch/pull/147095
Approved by: https://github.com/cyyever , https://github.com/albanD
2025-04-08 10:23:02 +00:00
76994d48f4
[pytorch] add experimental TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT ( #150537 )
...
Summary: Add an experimental feature to defer pytorch library initialization cost to post startup. As noted this feature is not thread safe, it requires the client to maintain thread safety at library load time.
Reviewed By: zou3519
Differential Revision: D71917841
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150537
Approved by: https://github.com/zou3519
2025-04-03 22:36:17 +00:00
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
79e8a69257
Enable move warnings for torch targets ( #149923 )
...
This PR enables more move warnings for torch targets and fixes some code.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149923
Approved by: https://github.com/malfet
2025-03-26 08:38:13 +00:00
6ae8eb881c
[ONNX] Clean up the diagnostics module ( #149864 )
...
Remove the diagnostics/SARIF module from ONNX exporter because it is obsolete unused.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149864
Approved by: https://github.com/titaiwangms
2025-03-26 05:58:32 +00:00
30e8be599f
Revert "[ONNX] Clean up the diagnostics module ( #149864 )"
...
This reverts commit cc6e300fe225ac7f34f37494639b061ef45ceeec.
Reverted https://github.com/pytorch/pytorch/pull/149864 on behalf of https://github.com/malfet due to This indeed broke Mac testing see 1c98dc3664/1 ([comment](https://github.com/pytorch/pytorch/pull/149864#issuecomment-2752317873 ))
2025-03-25 19:31:50 +00:00
cc6e300fe2
[ONNX] Clean up the diagnostics module ( #149864 )
...
Remove the diagnostics/SARIF module from ONNX exporter because it is obsolete unused.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149864
Approved by: https://github.com/titaiwangms
2025-03-25 16:58:46 +00:00
d90d83c484
[torch] Fix unsafe concurrent access to autocast_enabled ( #148281 )
...
Summary: Making autocast_enabled atomic, as it can be accessed from multiple threads
Differential Revision: D70456813
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148281
Approved by: https://github.com/davidberard98
2025-03-25 14:46:12 +00:00
b99fc9d29f
[MTIA] Support loading Tensors on mtia:0 for pytorch code ( #149327 )
...
Summary: The diff includes updates to the PyTorch code to enable loading tensors to MTIA.
Reviewed By: PatriceVignola
Differential Revision: D71176848
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149327
Approved by: https://github.com/ezyang
2025-03-20 18:05:15 +00:00
842a072fd3
[codemod] Fix clang-tidy command line doc comments ( #149524 )
...
Summary:
Fixes the comments to match the latest updates to the checked-in tools.
Search/replace applied in this order:
* `# /fbsource/tools/lint/clangtidy/clang-tidy-platform010 -list-checks` -> `# ~/fbsource/tools/lint/clangtidy/clang-tidy-platform010-clang-17 -list-checks`
* `# ~/fbsource/tools/lint/clangtidy/clang-tidy-platform010 -list-checks` -> `# ~/fbsource/tools/lint/clangtidy/clang-tidy-platform010-clang-17 -list-checks`
* `fbsource/tools/lint/clangtidy/clang-tidy-platform010 -list-checks` -> `fbsource/tools/lint/clangtidy/clang-tidy-platform010-clang-17 -list-checks`
Test Plan: CI
Reviewed By: johnkearney
Differential Revision: D71431516
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149524
Approved by: https://github.com/janeyx99
2025-03-19 19:22:11 +00:00
b963d96bad
[Torchscript] Add a flag to use mangled names instead of demangled ( #148906 )
...
Summary: Optionally keep mangled names when expanding torchscript stacks
Test Plan:
```
buck2 build mode/opt //scripts/rihams/LearnPyTorch:torch_script_generate --show-full-output
/data/users/rihams/fbsource/buck-out/v2/gen/fbcode/0bd9d136228ad8a7/scripts/rihams/LearnPyTorch/__torch_script_generate__/torch_script_generate.par
buck2 build mode/opt //scripts/rihams/LearnPyTorch:torch_script_execute --show-full-output
```
- With `--torch_jit_expanded_stacks_mangled` Flag:
/data/users/rihams/fbsource/buck-out/v2/gen/fbcode/ef35e45045e8164c/scripts/rihams/LearnPyTorch/__torch_script_execute__/torch_script_execute fbcode/model.pt --torch_jit_expanded_stacks_mangled --torch_jit_enable_expanded_stacks
https://fburl.com/scuba/strobelight_function_tracer/8die4rvm
{F1975933247}
Without Flag:
/data/users/rihams/fbsource/buck-out/v2/gen/fbcode/ef35e45045e8164c/scripts/rihams/LearnPyTorch/__torch_script_execute__/torch_script_execute ./model.pt --torch_jit_enable_expanded_stacks
https://fburl.com/scuba/strobelight_function_tracer/x3nladpf
{F1975933268}
Reviewed By: bbus
Differential Revision: D70905872
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148906
Approved by: https://github.com/zdevito
2025-03-19 07:53:02 +00:00
536c0c7a47
[codemod][lowrisk] Remove unused exception parameter from caffe2/aten/src/ATen/cuda/CUDABlas.cpp ( #149328 )
...
Summary:
`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.
This:
```
try {
...
} catch (exception& e) {
// no use of e
}
```
should instead be written as
```
} catch (exception&) {
```
If the code compiles, this is safe to land.
Test Plan: Sandcastle
Reviewed By: dtolnay
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149328
Approved by: https://github.com/Skylion007 , https://github.com/eqy
2025-03-19 02:05:33 +00:00
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
97272e4b49
Fix torch.nn.functional.hardswish gradients corner case ( #148049 )
...
Fixes #147801
## Changes
- Change hardswish gradient compute condition as [torch.nn.functional.hardswish](https://pytorch.org/docs/stable/generated/torch.nn.functional.hardswish.html )
- Enable cuda for test `test_hardswish_grad_corner`
- Add test case for value=-3
## Test Result
```bash
pytest test/test_nn.py -k test_hardswish
pytest test/test_unary_ufuncs.py -k test_hardswish
pytest test/inductor/test_torchinductor.py -k test_hardswish
```



Pull Request resolved: https://github.com/pytorch/pytorch/pull/148049
Approved by: https://github.com/soulitzer
2025-03-14 18:53:10 +00:00
e5fccb2bab
[pytorch] Fix duplicated Malloc/Free insertation when using IRBuilderBase::CreateMalloc/CreateFree in LLVM 18+ ( #149058 )
...
Summary:
Pytorch unitest hangs when jitting the Tensor kernel. The problem exists for LLVM version >= 18 due to this upstream change: 45bb45f2ae
`IRBuilderBase::CreateCall` will insert the instruction into the BasicBlock by default. And we don't need to explicitly insert the instruction when compiling the tensor kernel.
Test Plan:
## Test with the release toolchain
```
buck test 'mode/dev' //caffe2/test:jit -- --exact 'caffe2/test:jit - test_concat_invariant (test_jit_fuser_te.TestTEFuserDynamic)'
```
## Test with the Buckified toolchain
Apply this D71046097 to select the LLVM libraries.
```
# Build tests
buck build 'mode/dev-asan' //caffe2/test:jit --show-output
```
```
# Run test (Change HASH and paths accordingly)
HASH="b755f1c435832a1e"
ENABLE_FLATBUFFER=0 FB_OVERRIDE_PYBIND11_GIL_INCREF_DECREF_CHECK=1 MKL_NUM_THREADS=1 NO_MULTIPROCESSING_SPAWN=0 OMP_NUM_THREADS=1 PYTORCH_TEST=1 PYTORCH_TEST_FBCODE=1 PYTORCH_TEST_WITH_ASAN=1 PYTORCH_TEST_WITH_DEV_DBG_ASAN=1 PYTORCH_TEST_WITH_TSAN=0 PYTORCH_TEST_WITH_UBSAN=1 SKIP_TEST_BOTTLENECK=1 TENSORPIPE_TLS_DATACENTER=test_dc TEST_PILOT=True TPX_IS_TEST_EXECUTION=true TPX_TIMEOUT_SEC=6000 \
buck-out/v2/gen/$HASH/caffe2/test/__jit__/jit.par --test-filter test_jit_fuser_te.TestTEFuserDynamic.test_concat_invariant
```
Differential Revision: D71046799
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149058
Approved by: https://github.com/dcci , https://github.com/Skylion007
2025-03-13 20:37:47 +00:00
f1444f006c
[caffe2/torch] Fixup upstream LLVM (major version 21) API changes ( #148833 )
...
Latest LLVM introduced two changes related to the `Triple` usage that causes build failures when building pytorch.
## Failure in llvm_codegen.cpp:
Triple is stored in Modules instead of the string: 979c275097
## Failure in llvm_jit.cpp:
Triple argument is removed from LLJITBuilder::... : b18e5b6a36
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148833
Approved by: https://github.com/Skylion007
2025-03-09 18:58:36 +00:00
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
6602e632cd
Suppress build warnings when gcc-11 is used ( #148763 )
...
By decorating the header with `C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wmismatched-new-delete")`
that will suppress following (when building against ancient llvm-9)
```
In file included from /var/lib/jenkins/workspace/torch/csrc/jit/tensorexpr/llvm_codegen.cpp:24:
/opt/llvm/include/llvm/IR/IRBuilder.h: In member function 'llvm::LoadInst* llvm::IRBuilder<T, Inserter>::CreateLoad(llvm::Type*, llvm::Value*, const llvm::Twine&) [with T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter]':
/opt/llvm/include/llvm/IR/IRBuilder.h:1581:19: error: 'static void llvm::User::operator delete(void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
1581 | return Insert(new LoadInst(Ty, Ptr), Name);
| ^~~~~~~~~~~~~~~~~~~~~
/opt/llvm/include/llvm/IR/IRBuilder.h:1581:19: note: returned from 'static void* llvm::UnaryInstruction::operator new(size_t)'
```
Probably a reasonable followup will be to disable NNC testing all-together, as project has been in a maintenance mode for a while now
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148763
Approved by: https://github.com/Skylion007 , https://github.com/ZainRizvi , https://github.com/atalman
ghstack dependencies: #148739
2025-03-07 20:43:35 +00:00