Skip to content

Fix MOE tests#1476

Closed
ksivaman wants to merge 4 commits into
NVIDIA:mainfrom
ksivaman:fix_fp8_tests
Closed

Fix MOE tests#1476
ksivaman wants to merge 4 commits into
NVIDIA:mainfrom
ksivaman:fix_fp8_tests

Conversation

@ksivaman
Copy link
Copy Markdown
Member

Description

The code drop for 2.0 results in breaking certain tests in the CI. This PR fixes the MOE/permutation tests.

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

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
@ksivaman ksivaman requested a review from timmoon10 February 11, 2025 14:38
Comment thread transformer_engine/pytorch/tensor/_internal/float8_tensor_base.py Outdated
return _ReshapeFunc.apply(self, shape)

@classmethod
def to_float8(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer naming this quantize so that we can generalize to the other quantized tensor classes.

Copy link
Copy Markdown
Member Author

@ksivaman ksivaman Feb 12, 2025

Choose a reason for hiding this comment

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

This is meant as a standalone quantization for a high precision tensor and I think it would be better for this to not conflict with existing quantize function in QuantizedTensor.

Comment thread tests/pytorch/test_permutation.py Outdated
Comment thread tests/pytorch/test_permutation.py Outdated
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Copy link
Copy Markdown
Member

@ptrendx ptrendx left a comment

Choose a reason for hiding this comment

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

Wait wait wait. Why are we adding the to_float8 function again? We should just fix the tests to create and use the quantizer instead.

@yaox12
Copy link
Copy Markdown
Member

yaox12 commented Feb 13, 2025

I think the to_float8 issues has been fixed in #1468 using dequantize. Can you review that PR?

@ksivaman
Copy link
Copy Markdown
Member Author

@ptrendx The to_float8 function is meant purely as a utility/convenience function for one-time/throwaway quantization use cases that just creates a defaults quantizer and returns quantized tensor. Either way, closing as this change has been included in #1468

@ksivaman ksivaman closed this Feb 18, 2025
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.

4 participants