Skip to content

[PyTorch Debug] More advanced stats for Quantized Tensors #1897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

pggPL
Copy link
Collaborator

@pggPL pggPL commented Jun 26, 2025

Description

This PR adds more statistics for Quantized Tensors that can be used to debug FP8 convergence issues.

It also adds inspect_tensor_all api call, which was necessary to support this features.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

  • Infra/Build change

  • Code refactoring

  • I have read and followed the contributing guidelines

  • The functionality is complete

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation

  • My changes generate no new warnings

  • I have added tests that prove my fix is effective or that my feature works

  • New and existing unit tests pass locally with my changes

pggPL and others added 23 commits June 26, 2025 11:59
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
@pggPL pggPL force-pushed the debug_log_more_fp8_stats branch from 30688dd to b78a504 Compare July 4, 2025 14:57
@pggPL pggPL marked this pull request as ready for review July 4, 2025 14:59
@@ -231,6 +233,9 @@ def inspect_tensor(
tp_group: torch.distributed.ProcessGroup,
) -> None:
"""
This is legacy call, we advise to use *inspect_tensor_all* and *inspect_tensor_all_enabled* instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't want users to call inspect_tensor and other legacy functions, we should raise a deprecation warning.

Also, it seems like a shame to so quickly abandon these function names and replace them with clunky _all variants. Is there a way to maintain backward compatibility? Maybe have kwargs like high_precision_tensors and quantized_tensors, and have quantized_tensors=False by default.

It allows to inspect both quantized and high precision tensors.
The feature LogFp8TensorStats uses this call to collect FP8 statistics after the quantization.

If tensor and the transpose are quantized differently
Copy link
Collaborator

@timmoon10 timmoon10 Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally deleted some of the docstring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants