Skip to content

Conversation

@adobrzyn
Copy link
Contributor

@adobrzyn adobrzyn commented Sep 25, 2025

Fix issue:
AttributeError: module 'triton.language' has no attribute 'tensor'

As LanguagePlaceholder doesn't have this field that is being used in compute_identity_kernel in vllm/model_executor/layers/fused_moe/fused_moe.py:670

Regression after: #23991

Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses the AttributeError by adding the tensor attribute to the TritonLanguagePlaceholder. The fix is straightforward and aligns with the existing implementation of the placeholder class. However, to ensure this bug does not reappear in the future, it's important to add a corresponding test case. I've left a specific comment regarding updating the tests.

self.dtype = None
self.int64 = None
self.int32 = None
self.tensor = None
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change correctly adds the tensor attribute. To prevent future regressions, please also update the corresponding unit test in tests/test_triton_utils.py.

The test_triton_placeholder_language function is incomplete and should be updated to check for all attributes of TritonLanguagePlaceholder, including the newly added tensor.

Here is a suggested update for the test:

def test_triton_placeholder_language():
    lang = TritonLanguagePlaceholder()
    assert isinstance(lang, types.ModuleType)
    assert lang.__name__ == "triton.language"
    assert lang.constexpr is None
    assert lang.dtype is None
    assert lang.int64 is None
    assert lang.int32 is None
    assert lang.tensor is None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added both int32 and tensor attribute

adobrzyn and others added 2 commits September 25, 2025 11:24
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
Copy link
Member

@bigPYJ1151 bigPYJ1151 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@bigPYJ1151 bigPYJ1151 enabled auto-merge (squash) September 25, 2025 08:45
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 25, 2025
@bigPYJ1151 bigPYJ1151 merged commit 3c2b2cc into vllm-project:main Sep 25, 2025
48 of 50 checks passed
Zhuul pushed a commit to Zhuul/vllm that referenced this pull request Sep 26, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
choprahetarth pushed a commit to Tandemn-Labs/vllm that referenced this pull request Oct 11, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants