Skip to content

[MoE][Common/PyTorch] Add permutation#936

Merged
phu0ngng merged 35 commits intoNVIDIA:mainfrom
StudyingShao:jiangs/permutation
Aug 22, 2024
Merged

[MoE][Common/PyTorch] Add permutation#936
phu0ngng merged 35 commits intoNVIDIA:mainfrom
StudyingShao:jiangs/permutation

Conversation

@StudyingShao
Copy link
Copy Markdown
Contributor

@StudyingShao StudyingShao commented Jun 17, 2024

Description

Permutation for fp32/bf16/fp16/fp8 data type. Now PyTorch op only.

Additional descriptions: https://github.com/fanshiqing/moe_grouped_gemm/tree/dev

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 refractor

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

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

@StudyingShao StudyingShao changed the title [Draft][Common/PyTorch] Add permutation [Draft][MoE][Common/PyTorch] Add permutation Jun 24, 2024
@StudyingShao StudyingShao force-pushed the jiangs/permutation branch 3 times, most recently from 225a5be to 4b24d86 Compare June 25, 2024 20:04
Co-authored-by: Qi Zhang <qizhang@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
@StudyingShao
Copy link
Copy Markdown
Contributor Author

Hi @phu0ngng @cyanguwa , this PR is the Permutation fusion operators needed by MoE.
Please ignore the unit test file tests/pytorch/test_permutation.py, and help to review other changes. Thanks.
I will start to refactor the unit test file in parallel.

cc @QiZhangNV

@StudyingShao StudyingShao changed the title [Draft][MoE][Common/PyTorch] Add permutation [MoE][Common/PyTorch] Add permutation Jun 28, 2024
@phu0ngng phu0ngng requested review from cyanguwa and phu0ngng June 28, 2024 16:02
@phu0ngng phu0ngng added the enhancement New feature or request label Jun 28, 2024
@phu0ngng
Copy link
Copy Markdown
Collaborator

/te-ci pytorch

@phu0ngng
Copy link
Copy Markdown
Collaborator

phu0ngng commented Jul 1, 2024

Hi @StudyingShao, thanks for putting this work into TE.
I have a couple of suggestions after the first glance at your code.

  1. Please sign off all of your commits (DCO failed).
  2. Please rewrite the unit test with pytest and enable skipping if FP8 is unavailable (see
    pytest.skip(reason_for_no_fp8)
    ).

Comment thread transformer_engine/common/include/transformer_engine/permutation.h Outdated
Comment thread transformer_engine/common/permutation/permutation.cu Outdated
Comment thread transformer_engine/pytorch/permutation.py Outdated
Comment thread transformer_engine/pytorch/permutation.py Outdated
Comment thread transformer_engine/pytorch/csrc/extensions/pybind.cpp Outdated
Comment thread transformer_engine/pytorch/csrc/extensions/permutation.cu Outdated
Comment thread transformer_engine/pytorch/csrc/extensions/permutation.cu Outdated
Comment thread transformer_engine/common/permutation/permutation.cu Outdated
Comment thread transformer_engine/common/permutation/permutation.cu Outdated
Comment thread transformer_engine/common/permutation/permutation.cu Outdated
Comment thread transformer_engine/common/permutation/permutation.cu Outdated
Comment thread transformer_engine/pytorch/csrc/extensions/permutation.cu Outdated
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Comment thread transformer_engine/pytorch/csrc/extensions/permutation.cu Outdated
Comment thread transformer_engine/common/permutation/permutation.cu Outdated
Comment thread tests/pytorch/test_permutation.py Outdated
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
@phu0ngng phu0ngng requested review from timmoon10 and removed request for cyanguwa August 2, 2024 23:06
Comment thread transformer_engine/pytorch/permutation.py
Comment thread transformer_engine/pytorch/permutation.py Outdated
@timmoon10 timmoon10 self-requested a review August 5, 2024 22:02
Comment thread transformer_engine/pytorch/permutation.py Outdated
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
Copy link
Copy Markdown
Collaborator

@phu0ngng phu0ngng left a comment

Choose a reason for hiding this comment

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

LGTM!

@phu0ngng
Copy link
Copy Markdown
Collaborator

/te-ci pytorch

Copy link
Copy Markdown
Collaborator

@timmoon10 timmoon10 left a comment

Choose a reason for hiding this comment

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

LGTM once the CI passes.

StudyingShao and others added 2 commits August 22, 2024 10:14
Signed-off-by: Jiang Shao <jiangs@nvidia.com>
@StudyingShao
Copy link
Copy Markdown
Contributor Author

/te-ci pytorch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants