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

[JAX] THD ring attention #1454

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

Conversation

zlsh80826
Copy link
Collaborator

@zlsh80826 zlsh80826 commented Feb 4, 2025

Description

Support P2P context parallel (ring attn) with THD format. This feature is only available for self attn + causal + segment_ids/pos + load balancing (reorder before the attn and inverse-reorder after the attn).

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

  • Refactor reorder/inverse_reorder_causal_loading_balancing API to support different reorder strategy.
  • Support P2P context parallel. The limitations are list above.
  • Reduce the number of test configs of kv_groups in test_distributed_fused_attn
  • Use AttnBiasType, AttnMaskType, QKVLayout in cpp_extenion/attention.py for maintaining the readibility.

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

@zlsh80826 zlsh80826 marked this pull request as draft February 4, 2025 20:27
@zlsh80826
Copy link
Collaborator Author

/te-ci jax L1

@zlsh80826 zlsh80826 marked this pull request as ready for review February 6, 2025 09:46
@zlsh80826 zlsh80826 requested a review from phu0ngng February 6, 2025 09:56
@zlsh80826
Copy link
Collaborator Author

/te-ci jax L1

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.

1 participant