Skip to content
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

Support tensors with only column-wise data #1505

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

timmoon10
Copy link
Collaborator

Description

The quantized tensor infrastructure in TE 2.0 assumes that tensors have row-wise data available, both in the core C++ library and in the PyTorch extensions. This PR relaxes that assumption to support tensors wth only column-wise data. This allows us to avoid caching unnecessary data after the linear forward pass (we only need column-wise input for wgrad GEMM) and to reduce communication volume in MXFP8 tensor-parallel all-gathers. It is not quite perfectly optimized (tensor-parallel linear module still caches BF16 input tensor instead of column-wise MXFP8 tensor), but it is a reasonable step.

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

Changes

  • Support tensors with only column-wise data in the core C++ library
  • Support tensors with only column-wise data in the PyTorch framework
  • Only cache column-wise data for input tensor in single-GPU Linear module, LayerNormLinear module, BasicLinear op
  • Support MXFP8 all-gather with column-wise data

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

@timmoon10 timmoon10 added enhancement New feature or request performance labels Feb 25, 2025
@timmoon10 timmoon10 requested a review from ksivaman February 25, 2025 02:13
@timmoon10 timmoon10 marked this pull request as draft February 25, 2025 02:14
@timmoon10
Copy link
Collaborator Author

/te-ci core pytorch L0 L1

@timmoon10 timmoon10 requested a review from ptrendx February 25, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant