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

[Bugfix] Fix test_long_context.py and activation kernels #12111

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/lora/test_long_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ast
import os
from typing import List, Optional, Tuple

import numpy as np
Expand Down Expand Up @@ -113,7 +114,10 @@ def lora_llm(long_context_infos):
context_len_to_scaling_factor[info["context_length"]]
for info in long_context_infos.values()
]

# Since dist_init sets CUDA_VISIBLE_DEVICES and affects LLM initialization,
# remove this env if it exists.
if "CUDA_VISIBLE_DEVICES" in os.environ:
del os.environ["CUDA_VISIBLE_DEVICES"]
llm = vllm.LLM(
"meta-llama/Llama-2-13b-chat-hf",
enable_lora=True,
Expand Down
4 changes: 2 additions & 2 deletions vllm/model_executor/layers/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class FatreluAndMul(CustomOp):
def __init__(self, threshold: float = 0.):
super().__init__()
self.threshold = threshold
if current_platform.is_cuda_alike() or current_platform.is_cpu():
if current_platform.is_cuda_alike():
Copy link
Member

Choose a reason for hiding this comment

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

this is also solved in #12150 . I prefer to merge that PR to fix cpu ci test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I think it makes more sense to fix this LoRA failure in #12102, which can save one full round of CI . So I closed this PR, what do you think?

self.op = torch.ops._C.fatrelu_and_mul

def forward_native(self, x: torch.Tensor) -> torch.Tensor:
Expand Down Expand Up @@ -100,7 +100,7 @@ class MulAndSilu(CustomOp):

def __init__(self):
super().__init__()
if current_platform.is_cuda_alike() or current_platform.is_cpu():
if current_platform.is_cuda_alike():
self.op = torch.ops._C.mul_and_silu
elif current_platform.is_xpu():
from vllm._ipex_ops import ipex_ops
Expand Down
Loading