pytorch/test
Emmett Bicker 0de661dc27 Add support for differentiable weight decay (#143679)
(Actual) second PR in a larger project to broaden support for differentiable optimizers with @janeyx99!

In this PR, I did a lot of pattern matching from the previous PR to add support for differentiable weight_decay.

And also added a single new line on line 359 (previously line 352) to make the code from the last PR a little easier to read

Continuation of progress on #141832

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143679
Approved by: https://github.com/janeyx99

Co-authored-by: Jane (Yuan) Xu <31798555+janeyx99@users.noreply.github.com>
2024-12-27 23:14:43 +00:00
..
ao/sparsity Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
autograd Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
backends/xeon
benchmark_utils c10::optional -> std::optional in PyTorch (#137333) 2024-10-11 00:16:10 +00:00
bottleneck_test Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
cpp [rpc] Fix unit test after c10::nullopt removal (#143690) 2024-12-20 23:36:07 +00:00
cpp_api_parity Fix failures when default is flipped for weights_only (#127627) 2024-08-16 00:22:43 +00:00
cpp_extensions Make Context to be Device-agnostic Step by Step (3/N) (#137578) 2024-12-18 15:12:19 +00:00
custom_backend
custom_operator Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
distributed [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
distributions Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
dynamo [dynamo] Trace through overridden __getattribute__ method (#143888) 2024-12-27 18:10:00 +00:00
dynamo_expected_failures [dynamo] Support user defined dicts (#143548) 2024-12-21 01:46:14 +00:00
dynamo_skips config: Add env_name_default and env_name_force to Config (#138956) 2024-11-06 21:20:42 +00:00
edge Set RUNPATH so installed tests can find the required shared libraries (#136627) 2024-10-25 09:38:08 +00:00
error_messages
expect [ARM][feat]: Add 4 bit dynamic quantization matmuls & KleidiAI Backend (#134124) 2024-12-20 19:32:03 +00:00
export [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
forward_backward_compatibility [aotd] capture rrelu_with_noise noise mutation in compile (#141867) 2024-12-04 12:18:58 +00:00
functorch [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
fx subgraph rewriter supports matched pattern with no users (#143842) 2024-12-27 12:45:39 +00:00
higher_order_ops [inductor][invoke_subgraph] Support None/int as input/output of invoke_subgraph (#139373) 2024-12-27 06:46:09 +00:00
inductor Fix duplicate pattern error (#139321) 2024-12-27 11:10:46 +00:00
jit Revert "[BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)" 2024-12-26 17:32:23 +00:00
jit_hooks [BE][Easy][13/19] enforce style for empty lines in import segments in test/j*/ (#129764) 2024-08-01 12:13:42 +00:00
lazy Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
mobile Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
nn add grad_output shape check for fractional_max_pool2d_backward (#141666) 2024-12-19 22:47:02 +00:00
onnx [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
optim Add support for differentiable weight decay (#143679) 2024-12-27 23:14:43 +00:00
package Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
profiler [pytorch/et] Allow ET to save additional resources for completing a trace like generated kernels and index tensor data (#143775) 2024-12-26 21:15:39 +00:00
quantization [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
scripts [BE][Easy] enable ruff rule PIE790: unnecessary pass statement (#133200) 2024-08-15 15:50:19 +00:00
test_img
torch_np Revert "Use random64 in Fischer-Yates algorithm for large N (#143682)" 2024-12-27 09:09:33 +00:00
typing [BE][Easy][7/19] enforce style for empty lines in import segments in test/[a-c]*/ and test/[q-z]*/ (#129758) 2024-07-31 10:54:03 +00:00
xpu Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
_test_bazel.py
allowlist_for_publicAPI.json Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
conftest.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
create_dummy_torchscript_model.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
delete.py
hi.py
HowToWriteTestsUsingFileCheck.md [Docs] Update FileCheck doc (#135199) 2024-09-06 08:18:38 +00:00
linear.py
load_torchscript_model.py Flip default on weights_only (#137602) 2024-11-04 18:30:29 +00:00
minioptest_failures_dict.json
mkl_verbose.py
mkldnn_verbose.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
pytest_shard_custom.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
run_doctests.sh
run_test.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
simulate_nccl_errors.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
slow_tests.json Update slow tests (#143278) 2024-12-16 12:40:40 +00:00
test_accelerator.py torch/accelerator: fix device type comparison (#143541) 2024-12-23 10:54:53 +00:00
test_ao_sparsity.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_autocast.py [MPS] Add support for bf16 autocast (#139390) 2024-11-20 19:52:28 +00:00
test_autograd_fallback.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_autograd.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_autoload.py
test_binary_ufuncs.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_bundled_images.py Fix lint errors in fbcode (#135614) 2024-09-13 02:04:34 +00:00
test_bundled_inputs.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_ci_sanity_check_fail.py
test_comparison_utils.py [export] Add device and dtype fields to assert_tensor_metadata (#141071) 2024-11-22 20:54:55 +00:00
test_compile_benchmark_util.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_complex.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_content_store.py Rename cache limit to recompile limit in configs (#143709) 2024-12-22 10:03:57 +00:00
test_cpp_api_parity.py No actual change, just remove variable contain Tensors from global scope (#143225) 2024-12-17 16:14:25 +00:00
test_cpp_extensions_aot.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cpp_extensions_jit.py Avoid file encoding issues when loading cpp extensions (#138565) 2024-10-28 14:06:34 +00:00
test_cpp_extensions_mtia_backend.py Unify cpp_extension build directory removal (#136059) 2024-10-03 06:22:11 +00:00
test_cpp_extensions_open_device_registration.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cpp_extensions_stream_and_event.py Unify cpp_extension build directory removal (#136059) 2024-10-03 06:22:11 +00:00
test_cuda_expandable_segments.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
test_cuda_multigpu.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cuda_nvml_based_avail.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_cuda_primary_ctx.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_cuda_sanitizer.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cuda_trace.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cuda.py Respect ROCR_VISIBLE_DEVICES on AMD GPU device discovery (#142292) 2024-12-25 02:37:11 +00:00
test_custom_ops.py Pass allow_rhs_unbacked to the stride test in metadata test too (#143040) 2024-12-19 09:37:50 +00:00
test_dataloader.py Revert "Use random64 in Fischer-Yates algorithm for large N (#143682)" 2024-12-27 09:09:33 +00:00
test_datapipe.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_decomp.py [Inductor][CPU] disable bernoulli_p decomposition (#143460) 2024-12-19 11:21:35 +00:00
test_deploy.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_determination.py
test_dispatch.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_dlpack.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_dynamic_shapes.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_expanded_weights.py No actual change, just remove variable contain Tensors from global scope (#143225) 2024-12-17 16:14:25 +00:00
test_fake_tensor.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_file_check.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_flop_counter.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_foreach.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_function_schema.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_functional_autograd_benchmark.py
test_functional_optim.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_functionalization_of_rng_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_functionalization.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_futures.py
test_fx_experimental.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_fx_passes.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_fx_reinplace_pass.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_fx.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_hub.py
test_import_stats.py
test_indexing.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_itt.py
test_jit_autocast.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_disabled.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_fuser.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py
test_jit.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jiterator.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_kernel_launch_checks.py
test_legacy_vmap.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_license.py
test_linalg.py [CUDA] Bump tolerances in test_svd_lowrank_cuda_float64 (#143049) 2024-12-20 23:25:21 +00:00
test_logging.py
test_masked.py
test_maskedtensor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_matmul_cuda.py Revert "Add torch._scaled_mm for CPU (#139975)" 2024-12-27 05:25:17 +00:00
test_meta.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_metal.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_mkl_verbose.py
test_mkldnn_fusion.py improve mkldnn_linear_pointwise_binary performance for contiguous tensor with non default contiguous strides (#132019) 2024-07-30 05:02:38 +00:00
test_mkldnn_verbose.py
test_mkldnn.py [BE][CI] bump ruff to 0.8.4 (#143753) 2024-12-24 12:24:10 +00:00
test_mobile_optimizer.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_model_exports_to_core_aten.py Replace capture_pre_autograd_graph with export_for_training in torch tests (#135623) 2024-09-11 19:23:08 +00:00
test_module_tracker.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_modules.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_monitor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_mps.py Workaround for gather_out in MPS backend (#135543) 2024-12-19 18:01:01 +00:00
test_multiprocessing_spawn.py [BE][CI] bump ruff to 0.8.4 (#143753) 2024-12-24 12:24:10 +00:00
test_multiprocessing.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_namedtensor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_namedtuple_return_api.py
test_native_functions.py
test_native_mha.py [ROCm] Update to AOTriton 0.8b (#140172) 2024-12-06 21:45:18 +00:00
test_nestedtensor.py Fix batch-specific attention mod for NJT + Flex (#143866) 2024-12-27 20:51:41 +00:00
test_nn.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_nnapi.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_numba_integration.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_numpy_interop.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_openmp.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_ops_fwd_gradients.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_ops_gradients.py Run only listed tests on s390x (#140265) 2024-11-20 22:53:09 +00:00
test_ops_jit.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_optim.py Refactor AdamW into Adam (heavily inspired by tfsingh) (#143710) 2024-12-23 23:27:28 +00:00
test_out_dtype_op.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_overrides.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_package.py
test_per_overload_api.py
test_prims.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_proxy_tensor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_pruning_op.py
test_public_bindings.py [BE] Remove Model Dump utility (#141540) 2024-11-27 22:52:55 +00:00
test_python_dispatch.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_pytree.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_quantization.py Add support for prototype affine quantization in pt2e flow (#141421) 2024-12-24 04:22:18 +00:00
test_reductions.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_scatter_gather_ops.py Fix the check for can_use_expanded_index_path (#140351) 2024-11-15 05:52:23 +00:00
test_schema_check.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_segment_reductions.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_serialization.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_show_pickle.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_sort_and_select.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_sparse_csr.py Revert "Use random64 in Fischer-Yates algorithm for large N (#143682)" 2024-12-27 09:09:33 +00:00
test_sparse_semi_structured.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_sparse.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_spectral_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_stateless.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_static_runtime.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_subclass.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_sympy_utils.py [dynamo] add SymNode bitwise and/or (#138777) 2024-11-22 23:36:16 +00:00
test_tensor_creation_ops.py Revert "fix randint distribution for large max (#143787)" 2024-12-27 09:16:36 +00:00
test_tensorboard.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_tensorexpr_pybind.py [BE][Easy] enable ruff rule PIE790: unnecessary pass statement (#133200) 2024-08-15 15:50:19 +00:00
test_tensorexpr.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_testing.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_throughput_benchmark.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_torch.py [cumsum][CUDA][64-bit indexing] Add 64-bit indexing path for cumsum (#143696) 2024-12-24 03:45:28 +00:00
test_transformers.py Enable ruff's unused variable checking everywhere in pytorch (#136965) 2024-12-22 02:33:11 +00:00
test_type_hints.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2024-12-26 17:26:06 +00:00
test_type_info.py [BE][Easy][6/19] enforce style for empty lines in import segments in test/ (#129757) 2024-07-17 06:42:37 +00:00
test_type_promotion.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_typing.py Revert "[BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)" 2024-12-26 17:32:23 +00:00
test_unary_ufuncs.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_utils_config_module.py Add config alias (#142088) 2024-12-16 18:51:17 +00:00
test_utils_filelock.py filelock: Make waitcounter variant to use (#139816) 2024-12-12 01:18:34 +00:00
test_utils.py Various fix for memory leak in test autograd and dataloader (#143323) 2024-12-18 13:56:59 +00:00
test_view_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_vulkan.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_weak.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_xnnpack_integration.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_xpu.py Fix torch.accelerator api abort when passing invaild device (#143550) 2024-12-23 03:44:22 +00:00