pytorch/torch
Benji Beck 4bbb61812c [BE][1/2] Move original_weights_lookup attribute to constant (#151241)
Summary: As title. Cleaning usages by using global constant.

Test Plan: `buck test 'fbcode//mode/opt' fbcode//caffe2/test:quantization_fx -- --exact 'caffe2/test:quantization_fx - test_keep_original_weights (quantization.fx.test_quantize_fx.TestQuantizeFx)'`

Differential Revision: D72892815

Pull Request resolved: https://github.com/pytorch/pytorch/pull/151241
Approved by: https://github.com/Skylion007, https://github.com/hl475
2025-04-16 00:41:25 +00:00
..
_awaits
_C Reapply "ProcessGroupGloo: support lazy_init (#150801)" (#151031) 2025-04-11 01:58:35 +00:00
_C_flatbuffer
_custom_op
_decomp Fix addbmm & addmv & baddbmm out dtype check (#148176) 2025-04-09 07:02:56 +00:00
_dispatch [BE][PYFMT] migrate PYFMT for torch._dynamo to ruff format (#144549) 2025-02-28 03:03:53 +00:00
_dynamo Replace all random is_fbcode imports to environment (#151283) 2025-04-15 19:42:58 +00:00
_export [dynamic shapes] add sym_and, sym_or (#150456) 2025-04-14 18:18:06 +00:00
_functorch Add inductor standalone_compile API (#150670) 2025-04-15 23:38:15 +00:00
_higher_order_ops [HOP] Reworked DispatchKey.Autograd (#151107) 2025-04-15 19:55:46 +00:00
_inductor [cutlass backend] "Fix" FlexibleLayout (#151284) 2025-04-16 00:10:52 +00:00
_lazy
_library Generate meta kernel with operator profiles (#150807) 2025-04-14 19:28:54 +00:00
_logging [export] Beef up guard_added logs (#149465) 2025-03-20 23:02:07 +00:00
_numpy
_prims Support torch.compile rng selective activation checkpointing with cudagraph (#146878) 2025-02-28 00:47:03 +00:00
_prims_common Propagate callable parameter types using ParamSpec (#142306) (#151014) 2025-04-13 20:38:11 +00:00
_refs Remove guard_size_oblivious from vector_norm decomposition. (#148809) 2025-04-10 16:19:00 +00:00
_strobelight Enable strobelight profiling specific compile frame ids using COMPILE_STROBELIGHT_FRAME_FILTER (#147549) 2025-02-22 03:44:53 +00:00
_subclasses Fix assert_tensor_meta (#150808) 2025-04-14 19:28:54 +00:00
_vendor
accelerator Delegate torch.accelerator.device_count to torch.xxx.device_count for multi-process usage (#149924) 2025-04-10 02:37:37 +00:00
amp [Intel GPU] skip a cuda api call in amp to save some host overhead on xpu (#151111) 2025-04-13 06:37:07 +00:00
ao [BE][1/2] Move original_weights_lookup attribute to constant (#151241) 2025-04-16 00:41:25 +00:00
autograd [Profiler][HPU] Enable profiler.key_averages().table() for HPU devices (#150770) 2025-04-11 05:17:12 +00:00
backends Expose is_available API for torch.backends.mkldnn (#147432) 2025-04-10 05:05:37 +00:00
compiler Add inductor standalone_compile API (#150670) 2025-04-15 23:38:15 +00:00
contrib
cpu [CPU Stream] Add noop for CPU stream record_event() and wait_event() (#145935) 2025-02-20 18:50:55 +00:00
csrc [c10d][fr] Record each individual collective being coalesced (#151238) 2025-04-15 20:56:37 +00:00
cuda Delegate torch.accelerator.device_count to torch.xxx.device_count for multi-process usage (#149924) 2025-04-10 02:37:37 +00:00
distributed Remove ls from filesystem base (#151117) 2025-04-15 14:45:20 +00:00
distributions [typing] Add type hints to __init__ methods in torch.distributions. (#144197) 2025-04-06 17:50:35 +00:00
export [reland] Make export._trace._WrapperModule work in strict mode (#146919) (#151264) 2025-04-15 18:35:34 +00:00
fft
func
futures PEP585: More UP006 fixes (#146392) 2025-02-20 06:18:13 +00:00
fx Add inductor standalone_compile API (#150670) 2025-04-15 23:38:15 +00:00
jit Fix torchscript issues with reference quantized modules (#150870) 2025-04-10 20:14:45 +00:00
legacy
lib [1/N] Use internal linkage in torch/csrc C++ files. (#150930) 2025-04-11 02:19:31 +00:00
linalg Implement gradient for the residuals of torch.linalg.lstsq (#148526) 2025-03-10 12:35:09 +00:00
masked Use variadic length tuple for torch.masked.DimOrDims (#149870) 2025-03-31 07:06:58 +00:00
monitor
mps [MPS] Make torch.mps.compile_shader public (#148972) 2025-03-11 20:20:58 +00:00
mtia [MTIA] Add _mtia_maybeExchangeDevice to MTIA module (#149340) 2025-03-18 15:15:12 +00:00
multiprocessing
nested [aotd] Guess tangents stride as output strides (#144579) 2025-03-20 15:41:36 +00:00
nn Expand docs for nn.functional, and make the wording consistent (#148436) 2025-04-14 19:37:12 +00:00
onnx [ONNX] Produce correct dtypes for bf16/f8 in IR TorchTensor (#151259) 2025-04-15 23:21:04 +00:00
optim Optimize typing in lr_scheduler.py (#151219) 2025-04-15 01:00:13 +00:00
package
profiler [profiler][retry] don't disable CUPTI_LAZY_REINIT for cuda >= 12.6 (#151124) 2025-04-15 16:11:49 +00:00
quantization
signal
sparse Fix spelling (#149277) 2025-03-20 01:02:32 +00:00
special
testing Revert "Fix setUpClass() / tearDownClass() for device-specific tests (#151129)" 2025-04-15 22:07:25 +00:00
utils Warn user of existing lock file to avoid infinite waiting (#149382) 2025-04-15 20:25:29 +00:00
xpu xpu: torch.xpu.get_arch_list() to return [] if xpu not compiled (#147431) 2025-02-24 01:35:54 +00:00
__config__.py
__future__.py
__init__.py [profiler][retry] don't disable CUPTI_LAZY_REINIT for cuda >= 12.6 (#151124) 2025-04-15 16:11:49 +00:00
_appdirs.py
_classes.py
_compile.py
_custom_ops.py
_deploy.py
_environment.py
_guards.py [dynamo][invoke_subgraph] Use FxGraphModule comparison instead of hashing (#150911) 2025-04-14 23:34:26 +00:00
_jit_internal.py [BE][CI] bump ruff to 0.9.2: multiline assert statements (#144546) 2025-02-27 20:46:16 +00:00
_linalg_utils.py
_lobpcg.py [BE][CI] bump ruff to 0.9.2: multiline assert statements (#144546) 2025-02-27 20:46:16 +00:00
_lowrank.py
_meta_registrations.py [dtensor] add op support for torch._grouped_mm (#151072) 2025-04-12 07:07:44 +00:00
_namedtensor_internals.py
_ops.py [HOP] Reworked DispatchKey.Autograd (#151107) 2025-04-15 19:55:46 +00:00
_python_dispatcher.py
_size_docs.py
_sources.py
_storage_docs.py
_streambase.py
_tensor_docs.py [Docs] Clarify behavior when integer dtype is used with requires_grad=True in tensor.to() (#150913) 2025-04-10 02:52:58 +00:00
_tensor_str.py add torch.float4_e2m1fn_x2 to PyTorch (#148791) 2025-03-27 17:32:20 +00:00
_tensor.py
_thread_safe_fork.py
_torch_docs.py Clarify that x and dx are mutually exclusive in torch.trapezoid doc (#151190) 2025-04-15 21:42:05 +00:00
_utils_internal.py [profiler][retry] don't disable CUPTI_LAZY_REINIT for cuda >= 12.6 (#151124) 2025-04-15 16:11:49 +00:00
_utils.py Allow torch.load under FakeTensorMode to load FakeTensors with correct devices (for plain Tensors) (#147786) 2025-03-06 12:04:32 +00:00
_VF.py
_vmap_internals.py
_weights_only_unpickler.py Add sparse tensors constructed via legacy constructor to _sparse_tensors_to_validate (#147759) 2025-02-25 23:51:12 +00:00
CMakeLists.txt Add new dependences for gen_pyi.py (#150391) 2025-04-03 14:18:18 +00:00
custom_class_detail.h
custom_class.h Remove unneeded Clang-tidy suppression (#148246) 2025-03-01 16:51:54 +00:00
extension.h
functional.py Optimize cdist param description (#151178) 2025-04-14 13:53:10 +00:00
hub.py [BE][CI][Easy] bump ruff to 0.9.0: long statements in docstrings (#146509) 2025-02-24 19:56:08 +00:00
library.h [pytorch] add header docs for TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT (#150854) 2025-04-09 12:59:24 +00:00
library.py [custom ops] Override fake registration (#150806) 2025-04-12 02:43:47 +00:00
overrides.py Propagate callable parameter types using ParamSpec (#142306) (#151014) 2025-04-13 20:38:11 +00:00
py.typed
quasirandom.py
random.py
README.md Rename README.txt to README.md (#149811) 2025-03-24 22:33:33 +00:00
return_types.py
script.h
serialization.py Move get accelerator to use build time flags when possible (#146098) 2025-03-10 13:17:58 +00:00
storage.py add torch.float4_e2m1fn_x2 to PyTorch (#148791) 2025-03-27 17:32:20 +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.