Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
a3d96521
Commit
a3d96521
authored
Dec 04, 2024
by
zhuwenwen
Browse files
remove unsupported tests from kernels and add pytest html
parent
4646fe24
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
37 additions
and
6 deletions
+37
-6
requirements-test.txt
requirements-test.txt
+2
-0
tests/conftest.py
tests/conftest.py
+20
-0
tests/kernels/test_attention_selector.py
tests/kernels/test_attention_selector.py
+1
-1
tests/kernels/test_int8_quant.py
tests/kernels/test_int8_quant.py
+5
-2
tests/kernels/untest_aqlm.py
tests/kernels/untest_aqlm.py
+0
-0
tests/kernels/untest_awq.py
tests/kernels/untest_awq.py
+0
-0
tests/kernels/untest_causal_conv1d.py
tests/kernels/untest_causal_conv1d.py
+0
-0
tests/kernels/untest_flashinfer.py
tests/kernels/untest_flashinfer.py
+0
-0
tests/kernels/untest_fp8_quant.py
tests/kernels/untest_fp8_quant.py
+0
-0
tests/kernels/untest_ggml.py
tests/kernels/untest_ggml.py
+0
-0
tests/kernels/untest_gguf.py
tests/kernels/untest_gguf.py
+0
-0
tests/kernels/untest_gptq.py
tests/kernels/untest_gptq.py
+0
-0
tests/kernels/untest_machete_gemm.py
tests/kernels/untest_machete_gemm.py
+0
-0
tests/kernels/untest_mamba_ssm.py
tests/kernels/untest_mamba_ssm.py
+0
-0
tests/kernels/untest_marlin_gemm.py
tests/kernels/untest_marlin_gemm.py
+0
-0
tests/kernels/untest_permute_cols.py
tests/kernels/untest_permute_cols.py
+0
-0
tests/tokenization/test_tokenizer.py
tests/tokenization/test_tokenizer.py
+8
-2
vllm/triton_utils/custom_cache_manager.py
vllm/triton_utils/custom_cache_manager.py
+1
-1
No files found.
requirements-test.txt
View file @
a3d96521
...
@@ -5,6 +5,8 @@ pytest-forked
...
@@ -5,6 +5,8 @@ pytest-forked
pytest-asyncio
pytest-asyncio
pytest-rerunfailures
pytest-rerunfailures
pytest-shard
pytest-shard
pytest-html
pytest-timeout
# testing utils
# testing utils
awscli
awscli
...
...
tests/conftest.py
View file @
a3d96521
...
@@ -8,6 +8,8 @@ from collections import UserList
...
@@ -8,6 +8,8 @@ from collections import UserList
from
enum
import
Enum
from
enum
import
Enum
from
typing
import
(
Any
,
Callable
,
Dict
,
List
,
Optional
,
Tuple
,
Type
,
from
typing
import
(
Any
,
Callable
,
Dict
,
List
,
Optional
,
Tuple
,
Type
,
TypedDict
,
TypeVar
,
Union
)
TypedDict
,
TypeVar
,
Union
)
import
pytest
import
pytest_html
import
numpy
as
np
import
numpy
as
np
import
pytest
import
pytest
...
@@ -898,3 +900,21 @@ def dummy_opt_path():
...
@@ -898,3 +900,21 @@ def dummy_opt_path():
with
open
(
json_path
,
"w"
)
as
f
:
with
open
(
json_path
,
"w"
)
as
f
:
json
.
dump
(
config
,
f
)
json
.
dump
(
config
,
f
)
return
_dummy_path
return
_dummy_path
# 定义一个 pytest 钩子,在测试后生成报告
@
pytest
.
hookimpl
(
tryfirst
=
True
,
hookwrapper
=
True
)
def
pytest_runtest_makereport
(
item
,
call
):
# 获取测试结果
outcome
=
yield
result
=
outcome
.
get_result
()
# 如果测试失败并且有浏览器实例,添加截图
if
result
.
when
==
"call"
and
result
.
failed
:
if
hasattr
(
item
,
"funcargs"
)
and
"browser"
in
item
.
funcargs
:
browser
=
item
.
funcargs
[
"browser"
]
screenshot_path
=
"screenshot.png"
# 设置截图路径
browser
.
save_screenshot
(
screenshot_path
)
# 如果测试结果有 extra 属性,则添加截图
if
hasattr
(
result
,
"extra"
):
result
.
extra
.
append
(
pytest_html
.
extras
.
image
(
screenshot_path
))
tests/kernels/test_attention_selector.py
View file @
a3d96521
...
@@ -12,7 +12,7 @@ from vllm.utils import STR_FLASH_ATTN_VAL, STR_INVALID_VAL
...
@@ -12,7 +12,7 @@ from vllm.utils import STR_FLASH_ATTN_VAL, STR_INVALID_VAL
# "name", ["TORCH_SDPA", "ROCM_FLASH", "XFORMERS", "FLASHINFER", "OPENVINO"])
# "name", ["TORCH_SDPA", "ROCM_FLASH", "XFORMERS", "FLASHINFER", "OPENVINO"])
# @pytest.mark.parametrize("device", ["cpu", "openvino", "hip", "cuda"])
# @pytest.mark.parametrize("device", ["cpu", "openvino", "hip", "cuda"])
@
pytest
.
mark
.
parametrize
(
@
pytest
.
mark
.
parametrize
(
"name"
,
[
"
TORCH_SDPA"
,
"ROCM_FLASH"
,
"XFORMERS"
,
"FLASHINFER
"
])
"name"
,
[
"
ROCM_FLASH
"
])
@
pytest
.
mark
.
parametrize
(
"device"
,
[
"cpu"
,
"hip"
,
"cuda"
])
@
pytest
.
mark
.
parametrize
(
"device"
,
[
"cpu"
,
"hip"
,
"cuda"
])
def
test_env
(
name
:
str
,
device
:
str
,
monkeypatch
):
def
test_env
(
name
:
str
,
device
:
str
,
monkeypatch
):
"""Test that the attention selector can be set via environment variable.
"""Test that the attention selector can be set via environment variable.
...
...
tests/kernels/test_int8_quant.py
View file @
a3d96521
...
@@ -5,6 +5,7 @@ from tests.kernels.quant_utils import ref_dynamic_per_token_quant
...
@@ -5,6 +5,7 @@ from tests.kernels.quant_utils import ref_dynamic_per_token_quant
from
tests.kernels.utils
import
opcheck
from
tests.kernels.utils
import
opcheck
from
vllm._custom_ops
import
scaled_int8_quant
from
vllm._custom_ops
import
scaled_int8_quant
from
vllm.utils
import
seed_everything
from
vllm.utils
import
seed_everything
from
vllm.utils
import
is_hip
DTYPES
=
[
torch
.
half
,
torch
.
bfloat16
,
torch
.
float
]
DTYPES
=
[
torch
.
half
,
torch
.
bfloat16
,
torch
.
float
]
HIDDEN_SIZES
=
[
16
,
67
,
768
,
2048
,
5120
,
5137
,
8192
,
HIDDEN_SIZES
=
[
16
,
67
,
768
,
2048
,
5120
,
5137
,
8192
,
...
@@ -37,7 +38,8 @@ def opcheck_int8_quant_dynamic(output, input, symmetric=True):
...
@@ -37,7 +38,8 @@ def opcheck_int8_quant_dynamic(output, input, symmetric=True):
opcheck
(
torch
.
ops
.
_C
.
dynamic_scaled_int8_quant
,
opcheck
(
torch
.
ops
.
_C
.
dynamic_scaled_int8_quant
,
(
output
,
input
,
scale
,
azp
))
(
output
,
input
,
scale
,
azp
))
@
pytest
.
mark
.
skipif
(
is_hip
(),
reason
=
"Currently, there is not supported on ROCm."
)
@
pytest
.
mark
.
parametrize
(
"num_tokens"
,
NUM_TOKENS
)
@
pytest
.
mark
.
parametrize
(
"num_tokens"
,
NUM_TOKENS
)
@
pytest
.
mark
.
parametrize
(
"hidden_size"
,
HIDDEN_SIZES
)
@
pytest
.
mark
.
parametrize
(
"hidden_size"
,
HIDDEN_SIZES
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
DTYPES
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
DTYPES
)
...
@@ -60,7 +62,8 @@ def test_dynamic_scaled_int8_quant(num_tokens: int, hidden_size: int,
...
@@ -60,7 +62,8 @@ def test_dynamic_scaled_int8_quant(num_tokens: int, hidden_size: int,
opcheck_int8_quant_dynamic
(
ops_out
,
x
)
opcheck_int8_quant_dynamic
(
ops_out
,
x
)
@
pytest
.
mark
.
skipif
(
is_hip
(),
reason
=
"Currently, there is not supported on ROCm."
)
@
pytest
.
mark
.
parametrize
(
"num_tokens"
,
NUM_TOKENS
)
@
pytest
.
mark
.
parametrize
(
"num_tokens"
,
NUM_TOKENS
)
@
pytest
.
mark
.
parametrize
(
"hidden_size"
,
HIDDEN_SIZES
)
@
pytest
.
mark
.
parametrize
(
"hidden_size"
,
HIDDEN_SIZES
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
DTYPES
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
DTYPES
)
...
...
tests/kernels/test_aqlm.py
→
tests/kernels/
un
test_aqlm.py
View file @
a3d96521
File moved
tests/kernels/test_awq.py
→
tests/kernels/
un
test_awq.py
View file @
a3d96521
File moved
tests/kernels/test_causal_conv1d.py
→
tests/kernels/
un
test_causal_conv1d.py
View file @
a3d96521
File moved
tests/kernels/test_flashinfer.py
→
tests/kernels/
un
test_flashinfer.py
View file @
a3d96521
File moved
tests/kernels/test_fp8_quant.py
→
tests/kernels/
un
test_fp8_quant.py
View file @
a3d96521
File moved
tests/kernels/test_ggml.py
→
tests/kernels/
un
test_ggml.py
View file @
a3d96521
File moved
tests/kernels/test_gguf.py
→
tests/kernels/
un
test_gguf.py
View file @
a3d96521
File moved
tests/kernels/test_gptq.py
→
tests/kernels/
un
test_gptq.py
View file @
a3d96521
File moved
tests/kernels/test_machete_gemm.py
→
tests/kernels/
un
test_machete_gemm.py
View file @
a3d96521
File moved
tests/kernels/test_mamba_ssm.py
→
tests/kernels/
un
test_mamba_ssm.py
View file @
a3d96521
File moved
tests/kernels/test_marlin_gemm.py
→
tests/kernels/
un
test_marlin_gemm.py
View file @
a3d96521
File moved
tests/kernels/test_permute_cols.py
→
tests/kernels/
un
test_permute_cols.py
View file @
a3d96521
File moved
tests/tokenization/test_tokenizer.py
View file @
a3d96521
...
@@ -5,9 +5,15 @@ from transformers import PreTrainedTokenizerBase
...
@@ -5,9 +5,15 @@ from transformers import PreTrainedTokenizerBase
from
vllm.transformers_utils.tokenizer
import
get_tokenizer
from
vllm.transformers_utils.tokenizer
import
get_tokenizer
from
..utils
import
models_path_prefix
from
..utils
import
models_path_prefix
# TOKENIZER_NAMES = [
# os.path.join(models_path_prefix, "facebook/opt-125m"),
# os.path.join(models_path_prefix, "gpt2"),
# ]
# export HF_ENDPOINT=https://hf-mirror.com
TOKENIZER_NAMES
=
[
TOKENIZER_NAMES
=
[
os
.
path
.
join
(
models_path_prefix
,
"facebook/opt-125m"
)
,
"facebook/opt-125m"
,
os
.
path
.
join
(
models_path_prefix
,
"gpt2"
)
,
"gpt2"
,
]
]
...
...
vllm/triton_utils/custom_cache_manager.py
View file @
a3d96521
...
@@ -45,7 +45,7 @@ class CustomCacheManager(FileCacheManager):
...
@@ -45,7 +45,7 @@ class CustomCacheManager(FileCacheManager):
self
.
cache_dir
=
os
.
getenv
(
"TRITON_CACHE_DIR"
,
self
.
cache_dir
=
os
.
getenv
(
"TRITON_CACHE_DIR"
,
""
).
strip
()
or
default_cache_dir
()
""
).
strip
()
or
default_cache_dir
()
if
self
.
cache_dir
:
if
self
.
cache_dir
:
self
.
cache_dir
=
f
"
{
self
.
cache_dir
}
_
{
os
.
getpid
()
}
"
#
self.cache_dir = f"{self.cache_dir}_{os.getpid()}"
self
.
cache_dir
=
os
.
path
.
join
(
self
.
cache_dir
,
self
.
key
)
self
.
cache_dir
=
os
.
path
.
join
(
self
.
cache_dir
,
self
.
key
)
self
.
lock_path
=
os
.
path
.
join
(
self
.
cache_dir
,
"lock"
)
self
.
lock_path
=
os
.
path
.
join
(
self
.
cache_dir
,
"lock"
)
os
.
makedirs
(
self
.
cache_dir
,
exist_ok
=
True
)
os
.
makedirs
(
self
.
cache_dir
,
exist_ok
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment