Skip to content

[release/1.8.0] Added AITER as a submodule and use in fused_rope.py #222

Merged
amd-sriram merged 10 commits intomasterfrom
add_aiter_fused_rope_kernels
Jul 8, 2025
Merged

[release/1.8.0] Added AITER as a submodule and use in fused_rope.py #222
amd-sriram merged 10 commits intomasterfrom
add_aiter_fused_rope_kernels

Conversation

@amd-sriram
Copy link
Copy Markdown
Collaborator

@amd-sriram amd-sriram commented May 26, 2025

Added AITER support in fused_rope.py for all 4 variants. Updated fused rope test, reduced tolerances according to unit test in aiter repo.
Tested UT - python tests/L0/run_transformer/test_fused_rope.py

Added aiter as a submodule and build it in setup.py if it is rocm.

For rocm, it uses AITER backend
For cuda, it uses apex native kernels

Tested with 6.5_internal_testing and upstream main

Fixes : https://ontrack-internal.amd.com/browse/SWDEV-496182

…d rope test, reduced tolerances according to unit test in aiter repo.
@amd-sriram amd-sriram self-assigned this May 26, 2025
@amd-sriram amd-sriram force-pushed the add_aiter_fused_rope_kernels branch 2 times, most recently from 7da8bac to 1f30182 Compare May 26, 2025 15:27
@amd-sriram amd-sriram marked this pull request as draft May 27, 2025 06:55
…r backend if it is rocm and aiter is installed
…y error - ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
@amd-sriram amd-sriram changed the title Added AITER support in fused_rope.py for all 4 variants Added AITER as a submodule and t in fused_rope.py May 28, 2025
@amd-sriram amd-sriram changed the title Added AITER as a submodule and t in fused_rope.py Added AITER as a submodule and use in fused_rope.py May 28, 2025
@amd-sriram amd-sriram marked this pull request as ready for review May 28, 2025 11:54
@amd-sriram amd-sriram changed the title Added AITER as a submodule and use in fused_rope.py [master] Added AITER as a submodule and use in fused_rope.py Jun 4, 2025
Comment thread apex/transformer/functional/fused_rope.py Outdated
Comment thread tests/L0/run_transformer/test_fused_rope.py Outdated
@alugorey
Copy link
Copy Markdown

alugorey commented Jun 5, 2025

Just a couple questions.

Comment thread apex/transformer/functional/fused_rope.py Outdated
Comment thread setup.py Outdated
Comment thread tests/L0/run_transformer/test_fused_rope.py Outdated
Comment thread setup.py Outdated
…nd use pip install -e . instead of python setup.py develop for installing aiter.
…nc and select apex or aiter subclass based on AITER_ROPE_BACKEND value. The user can specify the environment variable USE_ROCM_AITER_ROPE_BACKEND to select between aiter and apex backends for fused rope.
…est otherwise use the original precision 1e-3
@amd-sriram
Copy link
Copy Markdown
Collaborator Author

amd-sriram commented Jun 10, 2025

@xinyazhang @alugorey @pruthvistony I have now made the requested changes.

alugorey
alugorey previously approved these changes Jun 30, 2025
Copy link
Copy Markdown

@alugorey alugorey left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown

@xinyazhang xinyazhang left a comment

Choose a reason for hiding this comment

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

Mostly cosmetic problems.
Also please go through the file to remove unnecessary changes.

Comment thread apex/transformer/functional/fused_rope.py Outdated
Comment thread apex/transformer/functional/fused_rope.py Outdated
Comment thread apex/transformer/functional/fused_rope.py Outdated
Comment thread tests/L0/run_transformer/test_fused_rope.py
Comment thread tests/L0/run_transformer/test_fused_rope.py
remove spaces
@amd-sriram amd-sriram requested a review from xinyazhang July 7, 2025 13:15
pruthvistony
pruthvistony previously approved these changes Jul 8, 2025
Copy link
Copy Markdown

@pruthvistony pruthvistony left a comment

Choose a reason for hiding this comment

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

LGTM. testing is good.
Wait for Andy and Xinya approval.

xinyazhang
xinyazhang previously approved these changes Jul 8, 2025
Copy link
Copy Markdown

@xinyazhang xinyazhang left a comment

Choose a reason for hiding this comment

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

LGTM. The only concern is the pip install -e . for aiter.

Comment thread setup.py Outdated
@amd-sriram
Copy link
Copy Markdown
Collaborator Author

Currently there is a build issue related to aiter. I am trying to contact aiter team regarding. I will merge after the build issue is resolved.

@amd-sriram amd-sriram dismissed stale reviews from xinyazhang and pruthvistony via abd8aca July 8, 2025 10:42
@amd-sriram amd-sriram merged commit d533e3f into master Jul 8, 2025
@amd-sriram amd-sriram deleted the add_aiter_fused_rope_kernels branch July 8, 2025 10:43
@amd-sriram amd-sriram restored the add_aiter_fused_rope_kernels branch July 8, 2025 12:39
@amd-sriram amd-sriram deleted the add_aiter_fused_rope_kernels branch July 8, 2025 13:06
@amd-sriram amd-sriram changed the title [master] Added AITER as a submodule and use in fused_rope.py [release/1.8.0] Added AITER as a submodule and use in fused_rope.py Jul 9, 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