From d26bcca4d93ee9e64ca5ae64175069326968aa24 Mon Sep 17 00:00:00 2001 From: Masaki Kozuki Date: Sat, 24 Aug 2024 00:41:08 +0900 Subject: [PATCH] use `torch.compiler.is_compiling` (#739) following ``` /path/to/ao/torchao/float8/float8_linear_utils.py:165: FutureWarning: `torch._dynamo.external_utils.is_compiling` is deprecated. Use `torch.compiler.is_compiling` instead. if not torch._dynamo.is_compiling(): ``` Signed-off-by: Masaki Kozuki --- torchao/float8/float8_linear_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchao/float8/float8_linear_utils.py b/torchao/float8/float8_linear_utils.py index 675ed5ee6..d61e65b7a 100644 --- a/torchao/float8/float8_linear_utils.py +++ b/torchao/float8/float8_linear_utils.py @@ -162,7 +162,7 @@ def get_float8_layers(model: torch.nn.Module): # Get all fp8 layers and tensors fp8_layers = [child for child in model.modules() if isinstance(child, Float8Linear)] - if not torch._dynamo.is_compiling(): + if not torch.compiler.is_compiling(): for layer in fp8_layers: for buf in layer.buffers(): torch._dynamo.mark_static_address(buf, guard=True)