Skip to content

Commit

Permalink
use torch.compiler.is_compiling (#739)
Browse files Browse the repository at this point in the history
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 <mkozuki@nvidia.com>
  • Loading branch information
crcrpar committed Aug 23, 2024
1 parent 0ed3090 commit d26bcca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchao/float8/float8_linear_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d26bcca

Please sign in to comment.