pytorch/docs/source
BowenBao 22095acfd7 [ONNX] Migrate to PT2 logging (#106592)
Summary
- The 'dynamo_export' diagnostics leverages the PT2 artifact logger to handle the verbosity
level of logs that are recorded in each SARIF log diagnostic. In addition to SARIF log,
terminal logging is by default disabled. Terminal logging can be activated by setting
the environment variable `TORCH_LOGS="onnx_diagnostics"`. When the environment variable
is set, it also fixes logging level to `logging.DEBUG`, overriding the verbosity level
specified in the diagnostic options.
See `torch/_logging/__init__.py` for more on PT2 logging.
- Replaces 'with_additional_message' with 'Logger.log' like apis.
- Introduce 'LazyString', adopted from 'torch._dynamo.utils', to skip
evaluation if the message will not be logged into diagnostic.
- Introduce 'log_source_exception' for easier exception logging.
- Introduce 'log_section' for easier markdown title logging.
- Updated all existing code to use new api.
- Removed 'arg_format_too_verbose' diagnostic.
- Rename legacy diagnostic classes for TorchScript Onnx Exporter to avoid
confusion.

Follow ups
- The 'dynamo_export' diagnostic now will not capture python stack
information at point of diagnostic creation. This will be added back in
follow up PRs for debug level logging.
- There is type mismatch due to subclassing 'Diagnostic' and 'DiagnosticContext'
for 'dynamo_export' to incorporate with PT2 logging. Follow up PR will
attempt to fix it.
- More docstrings with examples.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/106592
Approved by: https://github.com/titaiwangms
2023-08-11 23:27:00 +00:00
..
_static torch.compile docs: "Profiling to understand torch.compile performance (#102862) 2023-06-06 22:00:36 +00:00
_templates Replace master with main in links and docs/conf.py (#100176) 2023-05-02 18:20:32 +00:00
community Update CODEOWNERS (#103934) 2023-06-26 19:29:29 +00:00
elastic [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
notes Add autograd modes table to docs (#104774) 2023-07-08 03:14:10 +00:00
rpc
scripts Enable UFMT on a bunch of low traffic Python files outside of main files (#106052) 2023-07-27 01:01:17 +00:00
amp.rst Documentation for torch.autocast (#95760) 2023-07-22 03:56:34 +00:00
autograd.rst [docs] Add missing functions to autograd.rst (#98854) 2023-04-11 20:45:49 +00:00
backends.rst Fix Backend docs search items (#101214) 2023-05-22 14:58:38 +00:00
benchmark_utils.rst
bottleneck.rst
checkpoint.rst add checkpoint support for custom device (#99626) 2023-05-04 00:23:42 +00:00
complex_numbers.rst Remove CUDA 11.6 note from complex docs (#100118) 2023-04-27 16:26:27 +00:00
conf.py Enable UFMT on a bunch of low traffic Python files outside of main files (#106052) 2023-07-27 01:01:17 +00:00
config_mod.rst
cpp_extension.rst
cpp_index.rst
cpu.rst [core] Bring cpu device module closer to cuda's. (#103172) 2023-07-12 19:43:22 +00:00
cuda._sanitizer.rst
cuda.rst Add more GPU metric instrumentation (#91717) 2023-02-24 00:38:03 +00:00
cudnn_persistent_rnn.rst
cudnn_rnn_determinism.rst
data.rst missed StackDataset documentation (#101927) 2023-05-22 21:12:16 +00:00
ddp_comm_hooks.rst [DOCS][DDP]Fix the simple of saving and reloading PowerSGD state and hook. (#102721) 2023-06-10 00:15:00 +00:00
deploy.rst
distributed.algorithms.join.rst
distributed.checkpoint.rst Replace master with main in links and docs/conf.py (#100176) 2023-05-02 18:20:32 +00:00
distributed.elastic.rst
distributed.optim.rst
distributed.rst Replace master with main in links and docs/conf.py (#100176) 2023-05-02 18:20:32 +00:00
distributed.tensor.parallel.rst Clean up unsed MHA code to avoid confusion (#105956) 2023-07-27 17:10:17 +00:00
distributions.rst
dlpack.rst
docutils.conf
export.rst [exportdb] Setup website (#104288) 2023-07-01 01:03:56 +00:00
fft.rst
fsdp.rst [FSDP][Docs] Make model/optim state dict configs visible in docs (#105848) 2023-07-25 16:23:53 +00:00
func.api.rst [functorch] linearize (#94173) 2023-02-09 15:45:08 +00:00
func.batch_norm.rst Fix typo under docs directory (#97202) 2023-03-21 01:24:10 +00:00
func.migrating.rst
func.rst
func.ux_limitations.rst
func.whirlwind_tour.rst
futures.rst
fx.rst [fx] change from #users to num_users in graph printout (#101140) 2023-06-20 21:24:32 +00:00
hub.rst
index.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
jit.rst Replace master with main in links and docs/conf.py (#100176) 2023-05-02 18:20:32 +00:00
jit_builtin_functions.rst
jit_language_reference.rst [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
jit_language_reference_v2.rst Fix typo under docs directory (#97202) 2023-03-21 01:24:10 +00:00
jit_python_reference.rst
jit_unsupported.rst
jit_utils.rst
library.rst Enable registering fallthroughs to (op, dk) from torch.library (#106086) 2023-07-28 19:37:59 +00:00
linalg.rst
logging.rst Revert "Correct dynamo logging docs (#105658)" 2023-07-21 22:38:28 +00:00
masked.rst Fix link in docs (#94686) 2023-02-13 20:42:24 +00:00
math-quantizer-equation.png
mobile_optimizer.rst
model_zoo.rst
monitor.rst
mps.rst [MPS] Introduce torch.mps.Event() APIs (#102121) 2023-08-08 03:45:45 +00:00
multiprocessing.rst
name_inference.rst Add itemsize and nbytes properties to Tensor (#98322) 2023-04-05 12:11:55 +00:00
named_tensor.rst
nested.rst Replace master with main in links and docs/conf.py (#100176) 2023-05-02 18:20:32 +00:00
nn.functional.rst [SDPA] update type hint for scaled_dot_product_attention and documentation (#94008) 2023-02-10 18:02:43 +00:00
nn.init.rst
nn.rst Back out "Reland "Make adding buffers more like adding parameters (#104069)" (#106224)" (#106743) 2023-08-08 15:27:34 +00:00
onnx.rst [ONNX] Expose OnnxRegistry publicly (#106140) 2023-08-04 20:46:03 +00:00
onnx_diagnostics.rst [ONNX] Migrate to PT2 logging (#106592) 2023-08-11 23:27:00 +00:00
onnx_supported_aten_ops.rst
optim.rst Optimized EMA implementation (#94820) 2023-04-26 18:02:11 +00:00
package.rst
pipeline.rst docs: Linking ResNeXt PyTorch Hub Pipeline (#98689) 2023-04-11 02:20:26 +00:00
profiler.rst
quantization-accuracy-debugging.rst
quantization-backend-configuration.rst
quantization-support.rst [quant][api] Move torch.ao.quantization.pt2e.quantizer to torch.ao.quantization.quantizer (#105885) 2023-07-26 18:20:09 +00:00
quantization.rst Quantization oneDNN backend only support VNNI CPU (#103653) 2023-06-19 09:50:07 +00:00
random.rst
rpc.rst [BE] RPC is missing RRef docs (#106902) 2023-08-10 16:26:27 +00:00
signal.rst
sparse.rst Update sparse semi-structured linear operator (#104608) 2023-07-13 23:52:39 +00:00
special.rst
storage.rst
tensor_attributes.rst
tensor_view.rst
tensorboard.rst
tensors.rst [Doc] Add Tensor.Shape (#104750) 2023-07-26 16:30:15 +00:00
testing.rst
torch.ao.ns._numeric_suite.rst
torch.ao.ns._numeric_suite_fx.rst
torch.compiler.rst Remove dynamo+nvfuser (#105789) 2023-08-08 22:29:32 +00:00
torch.compiler_api.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_best_practices_for_backends.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_cudagraph_trees.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_custom_backends.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_deepdive.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_dynamic_shapes.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_fake_tensor.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_faq.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_fine_grain_apis.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_get_started.rst Remove dynamo+nvfuser (#105789) 2023-08-08 22:29:32 +00:00
torch.compiler_guards_overview.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_inductor_profiling.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_ir.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_nn_module.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_performance_dashboard.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_profiling_torch_compile.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_transformations.rst Restructure torch.compile docs (#105376) 2023-07-28 20:58:57 +00:00
torch.compiler_troubleshooting.rst Remove dynamo+nvfuser (#105789) 2023-08-08 22:29:32 +00:00
torch.overrides.rst Add torch_dispatch and modes to extending.rst note (#102087) 2023-06-22 12:56:35 +00:00
torch.rst Add torch.utils to the docs page, remove dead code and fix docstrings (#105142) 2023-07-26 14:24:58 +00:00
type_info.rst
utils.rst Add torch.utils to the docs page, remove dead code and fix docstrings (#105142) 2023-07-26 14:24:58 +00:00