Skip to content

Conversation

pggPL
Copy link
Collaborator

@pggPL pggPL commented Sep 1, 2025

Description

Currently precision debug tools are not supported for FP8 model parameters. It is because all logic of debug tools is inside quantize() function in DebugQuantizers, which are not called if weight is in FP8. Also, for some stats like number of underflows we need both high precision tensor and quantized tensor.

I added function DebugQunatizer.wrap_quantized_tensor(QuantizedTensor) -> DebugQuantizedTensor which will be called for debug iterations for weight. The debug for all the other tensors work without any change.

I made argument tensor for inspect_tensor call optional - it is None for weight tensor in case of fp8 model parameters.
If one wants to use LogTensorStats, the quantized tensor is dequantized. For LogFp8TensorStats the stats which needs high precision tensor are disabled in considered case.

Fixes #2140

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

Checklist:

  • 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 9 commits September 1, 2025 10:17
Signed-off-by: Pawel Gadzinski <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
@pggPL pggPL marked this pull request as ready for review September 1, 2025 13:06
@pggPL
Copy link
Collaborator Author

pggPL commented Sep 1, 2025

/te-ci pytorch

@pggPL
Copy link
Collaborator Author

pggPL commented Sep 15, 2025

/te-ci pytorch

1 similar comment
@pggPL
Copy link
Collaborator Author

pggPL commented Sep 15, 2025

/te-ci pytorch

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.

[REQUEST ]Support using nvidia-dlfw-inspect when the fp8_primary_weight option is enabled.
1 participant