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

miss device_type when checking is_bf16_supported on ascend platform #2663

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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: 3 additions & 3 deletions lmdeploy/pytorch/check_env/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __check_model_transformers_version(config, trans_version):
f'but transformers {trans_version} is installed.')
_handle_exception(e, 'transformers', logger, message=message)

def __check_model_dtype_support(config):
def __check_model_dtype_support(config, device_type):
"""Checking model dtype support."""
logger.debug('Checking <Model> dtype support.')

Expand All @@ -215,7 +215,7 @@ def __check_model_dtype_support(config):
model_path=model_path,
dtype=dtype)
if model_config.dtype == torch.bfloat16:
assert is_bf16_supported(), (
assert is_bf16_supported(device_type), (
'bf16 is not supported on your device')
except AssertionError as e:
message = (
Expand All @@ -234,7 +234,7 @@ def __check_model_dtype_support(config):
_, trans_version = __check_transformers_version()
config = __check_config(trans_version)
__check_model_transformers_version(config, trans_version)
__check_model_dtype_support(config)
__check_model_dtype_support(config, device_type)
check_awq(config, device_type)


Expand Down
Loading