Commit Graph

8 Commits

Author SHA1 Message Date
Peter Bell
7ecbbc40c3 [HOP][inductor] Add higher order associative scan operator (#119430)
Currently only supports single tensor scans, e.g. `cumsum`, `cumprod`, `logcumsumexp`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/119430
Approved by: https://github.com/Chillee
2024-04-23 14:40:13 +00:00
Oleg Khabinov
8209bbbd06 [AOTInductor] Improve validation for C++ wrapper codegen (#111102)
It's a reimplementation of #111089

1. When using fake inputs make sure they are on the same device as the original inputs.
2. Don't change the value of self.cpp_wrapper from True to False if can't generate a C++ wrapper, instead have a check and fail early to avoid producing Python code for C++ compiler.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/111102
Approved by: https://github.com/desertfire, https://github.com/jgong5, https://github.com/chunyuan-w
2023-10-13 08:46:17 +00:00
Jez Ng
66fdea606d Enable typing for _inductor/exc.py (#109176)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109176
Approved by: https://github.com/eellison
ghstack dependencies: #109173
2023-09-15 12:36:59 +00:00
Ying Zhang
102fefac21 [Inductor CUTLASS backend] Step 2: CUDACodeCache (#107847)
This is the step 2 to add cutlass as an alternative inductor backend.
Feature request: https://github.com/pytorch/pytorch/issues/106991.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/107847
Approved by: https://github.com/jansel, https://github.com/kadeng, https://github.com/aakhundov
ghstack dependencies: #107802
2023-09-12 17:44:34 +00:00
David Berard
c29f8ccc02 [inductor][easy] Improved warning message for missing OMP on mac (#106241)
If 'omp.h' file not found is encountered, link to https://github.com/pytorch/pytorch/issues/95708 for suggestions on how to work around this

Error message after this change:
```
(pytorch-docs) dberard@dberard-mbp scripts % python inductor_mac_cpu.py
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT fn /Users/dberard/Documents/scripts/inductor_mac_cpu.py line 3
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] due to:
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]   File "/Users/dberard/Documents/pytorch/torch/_inductor/codecache.py", line 953, in compile_file
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]     raise exc.CppCompileError(cmd, output) from e
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised:
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] CppCompileError: C++ compile error
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] Command:
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] g++ /var/folders/1k/9l4kxkgx6jn28jn_pp2th63c0000gn/T/torchinductor_dberard/4s/c4sg7sknpldhmeuikjbbjt7lcjvndzrr7h2ml2iqprmzyjjw6sn4.cpp -shared -fPIC -Wall -std=c++17 -Wno-unused-variable -I/Users/dberard/Documents/pytorch/torch/include -I/Users/dberard/Documents/pytorch/torch/include/torch/csrc/api/include -I/Users/dberard/Documents/pytorch/torch/include/TH -I/Users/dberard/Documents/pytorch/torch/include/THC -I/Users/dberard/miniconda3/envs/pytorch-docs/include/python3.9 -I/Users/dberard/miniconda3/envs/pytorch-docs/include -L/Users/dberard/miniconda3/envs/pytorch-docs/lib -lomp -O3 -ffast-math -fno-finite-math-only -Xclang -fopenmp -D C10_USING_CUSTOM_GENERATED_MACROS -o /var/folders/1k/9l4kxkgx6jn28jn_pp2th63c0000gn/T/torchinductor_dberard/4s/c4sg7sknpldhmeuikjbbjt7lcjvndzrr7h2ml2iqprmzyjjw6sn4.so
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] Output:
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] In file included from /var/folders/1k/9l4kxkgx6jn28jn_pp2th63c0000gn/T/torchinductor_dberard/4s/c4sg7sknpldhmeuikjbbjt7lcjvndzrr7h2ml2iqprmzyjjw6sn4.cpp:2:
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] /var/folders/1k/9l4kxkgx6jn28jn_pp2th63c0000gn/T/torchinductor_dberard/i5/ci5uspp363v3ky6jkccllm3bxudy2fkdpqinkqhmpehfihejs7ko.h:8:10: fatal error: 'omp.h' file not found
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] #include <omp.h>
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]          ^~~~~~~
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] 1 error generated.
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING] Try setting OMP_PREFIX; see https://github.com/pytorch/pytorch/issues/95708
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]
[2023-07-28 17:15:25,731] torch._dynamo.convert_frame: [WARNING]
[2023-07-28 17:15:25,732] torch._dynamo.convert_frame: [WARNING] converting frame raised error, suppressing error
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/106241
Approved by: https://github.com/jansel
2023-08-02 02:12:27 +00:00
Edward Z. Yang
ca9ebf9e2b Delete dynamo_import and inductor_import (#93851)
Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/93851
Approved by: https://github.com/albanD, https://github.com/jansel
2023-02-02 01:51:29 +00:00
Mark Saroufim
c7f32613ec Find other temp directory for code cache if no /tmp (#91701)
Fixes https://github.com/pytorch/torchdynamo/issues/2004

Pull Request resolved: https://github.com/pytorch/pytorch/pull/91701
Approved by: https://github.com/anijain2305, https://github.com/wconstab
2023-01-05 02:29:52 +00:00
Jason Ansel
c7c09722ad Move TorchDynamo into PyTorch core (#86461)
Context:
https://github.com/pytorch/torchdynamo/issues/1588

This PR moves [TorchDynamo](https://github.com/pytorch/torchdynamo) and TorchInductor into PyTorch core.
- `torchdynamo` becomes `torch._dynamo`
- `torchinductor` becomes `torch._inductor`

This PR was generated by running `copy_to_core.sh` in https://github.com/pytorch/torchdynamo/pull/1538

Pull Request resolved: https://github.com/pytorch/pytorch/pull/86461
Approved by: https://github.com/voznesenskym
2022-10-13 23:18:06 +00:00