fix bf16 check when preprocessing data (#1140)

This commit is contained in:
Wing Lian
2024-01-17 22:41:23 -05:00
committed by GitHub
parent 1e56b88cde
commit 317fa2555a

View File

@@ -182,7 +182,11 @@ def validate_config(cfg):
if not cfg.bf16 and not cfg.bfloat16: if not cfg.bf16 and not cfg.bfloat16:
LOG.info("bf16 support detected, but not enabled for this configuration.") LOG.info("bf16 support detected, but not enabled for this configuration.")
else: else:
if not cfg.merge_lora and (cfg.bf16 or cfg.bfloat16): if (
not cfg.merge_lora
and not cfg.is_preprocess
and (cfg.bf16 is True or cfg.bfloat16 is True)
):
raise ValueError( raise ValueError(
"bf16 requested, but AMP is not supported on this GPU. Requires Ampere series or above." "bf16 requested, but AMP is not supported on this GPU. Requires Ampere series or above."
) )