pytorch/torch
leslie-fang-intel 00b0210139 [Inductor] Use sleef implementation for CPP backend asinh codegen (#142360)
**Summary**
Fix https://github.com/pytorch/pytorch/issues/142345. Previously, we use `asinh(x) = log(x + sqrt(1 + x**2))` to calculate the result of `asinh`, the issue happens when input with `-10000.1`, which makes `x + sqrt(1 + x**2)` close to 0 and log(0) is invalid. We use the `sleef` implementation in this PR to fix this issue.

**Test Plan**
```
python -u -m pytest -s -v test/inductor/test_cpu_repro.py -k test_asinh_with_corner_inputs
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/142360
Approved by: https://github.com/jgong5
2024-12-14 00:27:55 +00:00
..
_awaits
_C Inductor annotations (#130429) 2024-12-10 08:53:39 +00:00
_C_flatbuffer
_custom_op
_decomp Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_dispatch Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_dynamo add private config to temporarily preserve old FSDP guard behavior (#142871) 2024-12-13 22:06:48 +00:00
_export [export][ez] Fix forward D67044185 (#143193) 2024-12-13 16:06:42 +00:00
_functorch Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_higher_order_ops [ca] fix flex attention backward HOP capture in initial graph (#143155) 2024-12-13 06:04:39 +00:00
_inductor [Inductor] Use sleef implementation for CPP backend asinh codegen (#142360) 2024-12-14 00:27:55 +00:00
_lazy
_library Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_logging Add "inductor_pre_grad_graph" logging (#142717) (#143126) 2024-12-13 21:48:25 +00:00
_numpy Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_prims Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_prims_common Remove an unused variable from _prims_common/wrappers.py (#138480) 2024-12-10 00:12:53 +00:00
_refs Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_strobelight Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_subclasses Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_vendor
accelerator [BE][accelerator] formalize API name {current,set}_device_{idx => index} (#140542) 2024-12-12 10:53:48 +00:00
amp [MPS] Add support for bf16 autocast (#139390) 2024-11-20 19:52:28 +00:00
ao [BC-Breaking]Remove capture_pre_autograd_graph references in quantization (#139505) 2024-12-13 22:26:22 +00:00
autograd Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
backends [BE] replace incorrect .. note:: invocations (#142868) 2024-12-11 19:58:18 +00:00
compiler Revert "Migrate compiler config to Config (#143152)" 2024-12-13 20:55:14 +00:00
contrib
cpu [Inductor][CPP] Add oneDNN BRGEMM config for Half cpp gemm template (#136255) 2024-11-05 05:33:29 +00:00
csrc Fix Tensor clear to properly clear slots (#143203) 2024-12-14 00:17:07 +00:00
cuda [BE] replace incorrect .. note:: invocations (#142868) 2024-12-11 19:58:18 +00:00
distributed Enable cutlass-based all-gather matmul when TORCH_SYMM_MEM_ENABLE_NATIVE_ASYNC_TP is set (#142283) 2024-12-13 10:29:14 +00:00
distributions Remove some unused type ignores (round 1) (#142325) 2024-12-09 18:23:46 +00:00
export fix dynamo nn module stack fqn (#142823) 2024-12-12 07:02:13 +00:00
fft
func
futures
fx Add <string> to uninteresting_files (#142984) 2024-12-12 14:35:30 +00:00
jit Remove some unused type ignores (round 1) (#142325) 2024-12-09 18:23:46 +00:00
legacy
lib Add and use thread-safe strerror (#140472) 2024-11-19 04:24:17 +00:00
linalg fix linalg.SVD docs typo: wrong V* shape in reduced SVD (#142037) 2024-12-04 09:18:33 +00:00
masked Correctly specify size of sparse_csr tensors in maskedtensor binary ops (#134335) 2024-12-03 02:55:57 +00:00
monitor
mps [MPS] Add CompileShader method (#141478) 2024-12-11 02:00:51 +00:00
mtia [BE] replace incorrect .. note:: invocations (#142868) 2024-12-11 19:58:18 +00:00
multiprocessing
nested [aotd] non-contiguous NestedTensor mutation in compile (#139630) 2024-12-06 12:18:46 +00:00
nn DistributedDataParallel: add init_sync option to control collectives during initialization (#142824) 2024-12-11 20:28:38 +00:00
onnx [ONNX] Avoid overwriting overlapped decomposed functions (#142831) 2024-12-11 18:47:40 +00:00
optim Remove some unused type ignores (round 1) (#142325) 2024-12-09 18:23:46 +00:00
package [torch.package, 3.13] fixes to torch.package for 3.13 (#141409) 2024-12-05 00:23:47 +00:00
profiler [Profiler] Enable Iterative Step without profiler in fbcode (#142077) 2024-12-12 19:00:13 +00:00
quantization
signal
sparse [sparse] add extra options to _cslt_spare_mm (#137427) 2024-11-27 05:32:45 +00:00
special
testing Require Config to have a default (#143150) 2024-12-13 19:28:59 +00:00
utils Fix precedence of bitwise and/or printing (#143197) 2024-12-13 19:29:42 +00:00
xpu Support torch.xpu.mem_get_info API (#141230) 2024-12-05 08:17:25 +00:00
__config__.py
__future__.py
__init__.py Transform unbacked int expressions into a fresh unbacked int. (#141917) 2024-12-05 16:53:44 +00:00
_appdirs.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_classes.py
_compile.py
_custom_ops.py
_deploy.py
_environment.py
_guards.py add private config to temporarily preserve old FSDP guard behavior (#142871) 2024-12-13 22:06:48 +00:00
_jit_internal.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_linalg_utils.py
_lobpcg.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_lowrank.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_meta_registrations.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_namedtensor_internals.py
_ops.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_python_dispatcher.py
_size_docs.py
_sources.py
_storage_docs.py
_streambase.py
_tensor_docs.py
_tensor_str.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_tensor.py [dim_order] raised runtime error when tensor has ambiguous dim order (#141632) 2024-12-08 23:16:57 +00:00
_thread_safe_fork.py
_torch_docs.py Update documentation for torch.mean() to note behavior with empty tensors (#142039) 2024-12-05 17:21:53 +00:00
_utils_internal.py Change export IR to non-functional pre-dispatch IR (#139511) 2024-11-20 21:47:55 +00:00
_utils.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_VF.py
_vmap_internals.py
_weights_only_unpickler.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
abi-check.cpp
CMakeLists.txt Revert "Hide torch_python symbols (#142214)" 2024-12-12 17:15:51 +00:00
custom_class_detail.h
custom_class.h
extension.h
functional.py
hub.py
library.h
library.py Improve torch.library.opcheck and register_autograd docs (#141883) 2024-12-03 16:28:56 +00:00
overrides.py [dim_order] raised runtime error when tensor has ambiguous dim order (#141632) 2024-12-08 23:16:57 +00:00
py.typed
quasirandom.py
random.py
README.txt
return_types.py
script.h
serialization.py Allow user to manually pass module.name associated with global in {add}_safe_global (#142153) 2024-12-06 18:56:39 +00:00
storage.py
torch_version.py
types.py
version.py.tpl

Note [TH abstraction violation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TH/THC provide some hpp headers, which are proper C++ headers rather than
C headers.  These headers serve double duty as *internal implementation
detail* headers, whose contents should largely not be used by external
clients.

Ideally, we would not install these headers at all; instead, you should
use public functions (in headers like `THTensor.h`, NOT `THTensor.hpp`)
to manipulate these structs.  However, there are a few places
in torch/csrc where we violate this abstraction.  They are marked with
a pointer to this note.  Each of those sites will have to be refactored
when we refactor the guts of THTensor and related structures.