[PyTorch Debug] Skip logging stats if unsupported#2652
Open
pggPL wants to merge 1 commit intoNVIDIA:mainfrom
Open
[PyTorch Debug] Skip logging stats if unsupported#2652pggPL wants to merge 1 commit intoNVIDIA:mainfrom
pggPL wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Contributor
Greptile OverviewGreptile SummaryReplaces hard errors with graceful warnings when debug logging features encounter unsupported precision modes (high precision or incompatible quantizers). Changes:
Impact: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant LogFp8Stats as LogFp8TensorStats.inspect_tensor()
participant LogNvfp4Stats as LogNvfp4TensorStats.inspect_tensor()
Note over Caller,LogNvfp4Stats: High Precision Layer (No Quantizer)
Caller->>LogFp8Stats: inspect_tensor(quantizer=None)
LogFp8Stats->>LogFp8Stats: Check if quantizer is None
LogFp8Stats->>LogFp8Stats: warnings.warn("layer runs in high precision")
LogFp8Stats-->>Caller: return (skip logging)
Caller->>LogNvfp4Stats: inspect_tensor(quantizer=None)
LogNvfp4Stats->>LogNvfp4Stats: Check if quantizer is None
LogNvfp4Stats->>LogNvfp4Stats: warnings.warn("layer runs in high precision")
LogNvfp4Stats-->>Caller: return (skip logging)
Note over Caller,LogNvfp4Stats: Incompatible Precision Type
Caller->>LogFp8Stats: inspect_tensor(quantized_tensor=WrongType)
LogFp8Stats->>LogFp8Stats: Check if isinstance(quantized_tensor, QuantizedTensor)
LogFp8Stats->>LogFp8Stats: warnings.warn("incompatible precision")
LogFp8Stats-->>Caller: return (skip logging)
Caller->>LogNvfp4Stats: inspect_tensor(quantizer=WrongType)
LogNvfp4Stats->>LogNvfp4Stats: Check if isinstance(quantizer, NVFP4Quantizer)
LogNvfp4Stats->>LogNvfp4Stats: warnings.warn("incompatible precision")
LogNvfp4Stats-->>Caller: return (skip logging)
|
Collaborator
Author
|
/te-ci pytorch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If the layer is run in high precision and LogFP8Stats is invoked, it results in error. It is very inconvenient, thus this PR changes the behavior to ignore + warning.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: