Commit 18b2751
[nnc] Make our exceptions c10::Errors, get C++ stacktraces (pytorch#64332)
Summary:
Pull Request resolved: pytorch#64332
With this diff, if a compiler bug occurs (unlikely, I know!) we'll be able to get a c++ stacktrace leading to the exception, rather than just a terse message. E.g.,
```
RuntimeError: UNSUPPORTED DTYPE
Exception raised from compilation_error at ../torch/csrc/jit/tensorexpr/exceptions.h:32 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6b (0x7f966659b2eb in /fsx/users/bertrand/c\
onda/envs/pytorch/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x376f099 (0x7f966a195099 in /fsx/users/bertrand/conda/envs/pytorch/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so)
frame #2: <unknown function> + 0x3763bf5 (0x7f966a189bf5 in /fsx/users/bertrand/conda/envs/pytorch/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so)
frame #3: torch::jit::tensorexpr::CudaCodeGen::Initialize() + 0xdd8 (0x7f966a193368 in /fsx/users/bertrand/conda/envs/pytorch/lib/python3.8/site-packages/torch/lib/libtorch_cuda\
.so)
```
Test Plan: Imported from OSS
Reviewed By: huiguoo
Differential Revision: D30745610
Pulled By: bertmaher
fbshipit-source-id: a1cfaa7364ef4120de834e9cbe57ced1d082ab4e1 parent 6cac7ca commit 18b2751
2 files changed
+41
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
32 | 46 | | |
33 | | - | |
| 47 | + | |
34 | 48 | | |
35 | 49 | | |
36 | | - | |
| 50 | + | |
37 | 51 | | |
38 | | - | |
| 52 | + | |
39 | 53 | | |
40 | | - | |
| 54 | + | |
41 | 55 | | |
42 | 56 | | |
43 | | - | |
| 57 | + | |
44 | 58 | | |
45 | 59 | | |
46 | | - | |
| 60 | + | |
47 | 61 | | |
48 | | - | |
| 62 | + | |
49 | 63 | | |
50 | | - | |
| 64 | + | |
51 | 65 | | |
52 | 66 | | |
53 | | - | |
| 67 | + | |
54 | 68 | | |
55 | | - | |
| 69 | + | |
56 | 70 | | |
57 | | - | |
| 71 | + | |
58 | 72 | | |
59 | | - | |
| 73 | + | |
60 | 74 | | |
61 | | - | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | | - | |
| 78 | + | |
65 | 79 | | |
66 | | - | |
| 80 | + | |
67 | 81 | | |
68 | 82 | | |
69 | 83 | | |
70 | | - | |
| 84 | + | |
71 | 85 | | |
72 | | - | |
| 86 | + | |
73 | 87 | | |
74 | | - | |
| 88 | + | |
75 | 89 | | |
76 | | - | |
| 90 | + | |
77 | 91 | | |
78 | | - | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | | - | |
| 95 | + | |
82 | 96 | | |
83 | | - | |
| 97 | + | |
84 | 98 | | |
85 | 99 | | |
86 | 100 | | |
87 | | - | |
88 | | - | |
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| 484 | + | |
| 485 | + | |
484 | 486 | | |
485 | 487 | | |
486 | 488 | | |
| |||
0 commit comments