pytorch/torch
Joel Schlosser ecc5e05854 Refactor NJT min / max seqlen handling for convenience (#138130)
There's an annoying pattern emerging for pulling out the NJT min / max seqlen ints if they exist without computing / caching if they don't. This PR introduces private convenience functions to simplify handling this and avoiding redundant checks.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138130
Approved by: https://github.com/soulitzer
2024-10-17 17:28:39 +00:00
..
_awaits
_C Revert "Expose option to disable CRC-32 computation during torch.save (#137735)" 2024-10-16 17:03:06 +00:00
_C_flatbuffer
_custom_op
_decomp Revert "Add decomposition for permute_copy (#130944)" 2024-10-16 23:18:53 +00:00
_dispatch
_dynamo Revert "[compiled autograd] directly use python Logger class in cpp (#137953)" 2024-10-17 17:19:36 +00:00
_export Fix constant returning (#137993) 2024-10-16 16:42:09 +00:00
_functorch Revert "[compiled autograd] Compiled autograd configs in TLS (#137821)" 2024-10-16 16:38:29 +00:00
_higher_order_ops [cond] support lifted symint inputs in subgraph (#137519) 2024-10-17 16:09:06 +00:00
_inductor [cond] support lifted symint inputs in subgraph (#137519) 2024-10-17 16:09:06 +00:00
_lazy
_library Proper handling of arguments passed by in kwargs inside zip_schema (#137311) 2024-10-04 21:50:31 +00:00
_logging Don't actually import module when checking if its valid (#136548) 2024-09-25 20:47:32 +00:00
_numpy
_prims Fix AOT Graph capture not propagating non_blocking copy parameter to … (#136513) 2024-10-01 00:32:47 +00:00
_prims_common Fix six broken tests in test_ops.py (#136653) 2024-09-30 20:32:55 +00:00
_refs Revert "Add decomposition for permute_copy (#130944)" 2024-10-16 23:18:53 +00:00
_strobelight Increase default COMPILE_STROBELIGHT_MAX_STACK_LENGTH to 500 (#138006) 2024-10-17 07:31:32 +00:00
_subclasses Remove an unused variable in _subclasses.fake_tensor (#138086) 2024-10-17 09:05:25 +00:00
_vendor
amp Fix autocast for non-strict export (#137495) 2024-10-16 17:39:00 +00:00
ao torch/ao/quantization/utils.py: Moving eps to targeted device to avoid device mismatch issue (#135204) 2024-10-15 14:58:55 +00:00
autograd Param fixes in docstring (#136097) 2024-09-21 18:56:34 +00:00
backends Clarify opt-einsum usage, fix #127109 (#137596) 2024-10-09 20:31:24 +00:00
compiler Fix https://github.com/pytorch/pytorch/issues/138062 (#138137) 2024-10-17 07:12:15 +00:00
contrib
cpu Extend vectorization with SVE(ARM) with Torch Compile (Inductor) (#134672) 2024-10-10 13:20:40 +00:00
csrc Revert "[compiled autograd] directly use python Logger class in cpp (#137953)" 2024-10-17 17:19:36 +00:00
cuda [ROCm] Add AMDSMI support for UUID input (#129741) 2024-10-15 15:56:30 +00:00
distributed [SymmetricMemory] fix a race condition in _pipelined_produce_and_all2all that can cause correctness issues for very small chunk_producers (#138126) 2024-10-17 01:05:41 +00:00
distributions [BE]: Update mypy to 1.11.2 (#133816) 2024-09-16 19:44:11 +00:00
export Fix assigning tensor with requires_grad as constant in export (#137997) 2024-10-17 06:41:10 +00:00
fft
func
futures
fx Minor assert error message improvement (#138053) 2024-10-17 03:54:15 +00:00
jit
legacy
lib
linalg docs: clarify alias usage for x parameter in vector_norm function (#136921) 2024-09-30 02:50:06 +00:00
masked Fix memory leak on masked Tensor (#137890) 2024-10-15 18:37:55 +00:00
monitor
mps
mtia [MTIA] Support torch.cuda.get_device_capability equivalent API on MTIA (#135889) 2024-09-17 17:42:56 +00:00
multiprocessing multiprocessing.spawn: allow a grace period when shutdown (#131278) 2024-10-07 12:37:34 +00:00
nested Refactor NJT min / max seqlen handling for convenience (#138130) 2024-10-17 17:28:39 +00:00
nn Removed _compile workaround for create_block_mask (#137477) 2024-10-11 19:04:23 +00:00
onnx Revert "[ONNX] Remove ExportTypes (#137789)" 2024-10-15 17:40:06 +00:00
optim RMSprop docs: add missing input "epsilon" (#137854) 2024-10-15 16:40:42 +00:00
package [3.13] fix 3.13 pickle error in torch/package (#136049) 2024-09-14 14:28:09 +00:00
profiler [Profiler] Torch Profiler distributed info is not JSON serializable (#135548) 2024-09-13 02:22:33 +00:00
quantization
signal
sparse [sparse][semi-structured] Add float8 dtype support to 24 sparsity (#136397) 2024-09-27 21:37:34 +00:00
special
testing Naive impls for NJT matmul (#138121) 2024-10-17 01:31:46 +00:00
utils Add host-side Triton TMA support to Dynamo (#137677) 2024-10-16 02:18:48 +00:00
xpu Use torch.Stream&torch.Event for Dynamo capature (#134850) 2024-10-02 14:15:33 +00:00
__config__.py
__future__.py
__init__.py Revert "[Dynamo] Disable torch function compilation during guard execution and in compiled bytecode (#137669)" 2024-10-15 23:22:58 +00:00
_appdirs.py
_classes.py
_compile.py
_custom_ops.py
_deploy.py
_environment.py Improve is_fbcode functionality (#136871) 2024-09-27 21:19:01 +00:00
_guards.py Turn on type-checking in torch.fx.experimental.symbolic_shapes (#136972) 2024-10-01 13:22:10 +00:00
_jit_internal.py
_linalg_utils.py
_lobpcg.py
_lowrank.py
_meta_registrations.py Add meta functions for lerp, addcmul, and addcdiv. (#136909) 2024-10-12 12:40:46 +00:00
_namedtensor_internals.py
_ops.py Add type annotations for higher order ops/flex_attention (#137065) 2024-10-02 04:39:25 +00:00
_python_dispatcher.py
_size_docs.py
_sources.py
_storage_docs.py
_streambase.py Use torch.Stream&torch.Event for Dynamo capature (#134850) 2024-10-02 14:15:33 +00:00
_tensor_docs.py Revert "Add deterministic path for CUDA cumsum (#136224)" 2024-09-27 12:54:47 +00:00
_tensor_str.py
_tensor.py Remove dependency on numpy for serialization for XLA/open registration devices without numpy (#137444) 2024-10-09 19:35:55 +00:00
_thread_safe_fork.py [inductor] parallel compile: add import of thread_safe_fork for internal (#137155) 2024-10-03 17:37:21 +00:00
_torch_docs.py [Docs] Optimize parameter description to declare allowed type (1/N) (#137956) 2024-10-17 01:19:55 +00:00
_utils_internal.py Log compile ids to pt2_remote_cache and pt2_compile_events (#137431) 2024-10-08 18:04:48 +00:00
_utils.py Remove dependency on numpy for serialization for XLA/open registration devices without numpy (#137444) 2024-10-09 19:35:55 +00:00
_VF.py
_vmap_internals.py
_weights_only_unpickler.py Remove dependency on numpy for serialization for XLA/open registration devices without numpy (#137444) 2024-10-09 19:35:55 +00:00
abi-check.cpp
CMakeLists.txt
custom_class_detail.h
custom_class.h
extension.h
functional.py Clarify opt-einsum usage, fix #127109 (#137596) 2024-10-09 20:31:24 +00:00
hub.py torch.hub: add get_dir/set_dir type hints (#134906) 2024-09-12 03:53:29 +00:00
library.h
library.py Fix custom op bug of clearing dir (#137655) 2024-10-11 04:32:40 +00:00
overrides.py Revert "Introduce torch.sym_sum (#136429)" 2024-10-09 20:08:01 +00:00
py.typed
quasirandom.py
random.py [Torch] Support meta device in random.fork_rng (#137715) 2024-10-16 18:00:39 +00:00
README.txt
return_types.py
script.h
serialization.py Revert "Expose option to disable CRC-32 computation during torch.save (#137735)" 2024-10-16 17:03:06 +00:00
storage.py Fix serialization for torch.uint16, torch.uint32, torch.uint64 (#137184) 2024-10-03 14:56:11 +00:00
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.