Skip to content

Commit 7f6e804

Browse files
Removed custom_io passing for bf16 dtype case (quic#983)
- Removed custom_io passing when running through bf16 dtype - Removed BF16 Warning Emitted by QEfficient Despite BF16 Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com> Co-authored-by: Hem Agnihotri <hemagnih@qti.qualcomm.com>
1 parent e4ea3a7 commit 7f6e804

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

QEfficient/base/modeling_qeff.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ def __init__(self, model: torch.nn.Module, **kwargs) -> None:
9595
else:
9696
logger.info(f"Pytorch transforms applied to model: {self.model_name}")
9797

98-
if self.config.torch_dtype == torch.bfloat16:
99-
logger.warning("BFloat16 dtype is not yet supported; converting to float16 precision!")
100-
10198
def _normalize_torch_dtype(self):
10299
"""
103100
Normalizes torch_dtype across all nested configs to match the top-level config.
@@ -644,7 +641,7 @@ def _compile(
644641
# Write custom_io.yaml file
645642
model_in_bfloat16 = hasattr(self, "config") and (self.config.torch_dtype == torch.bfloat16)
646643
pkv_in_bfloat16 = (custom_io is not None) and any(
647-
"past_" in key and "bfloat16" in value for key, value in custom_io.items()
644+
("past_" in key or "pixel_values" in key) and "bfloat16" in value for key, value in custom_io.items()
648645
)
649646
if custom_io is not None:
650647
custom_io_yaml = compile_dir / "custom_io.yaml"

0 commit comments

Comments
 (0)