Skip to content

Commit df5e715

Browse files
committed
Move CPU offload imports to op module scope
Signed-off-by: hongbinl <hongbinl@nvidia.com>
1 parent 1b81786 commit df5e715

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • transformer_engine/pytorch/ops

transformer_engine/pytorch/ops/op.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import torch
1515

1616
from transformer_engine.common.recipe import Recipe
17+
from ..cpu_offload import mark_activation_offload, mark_not_offload
1718
from ..quantization import (
1819
FP8GlobalStateManager,
1920
QuantizerRole,
@@ -209,11 +210,6 @@ def maybe_mark_activation_offload(self, *tensors: Any) -> None:
209210
If activation offloading has been disabled for this op, mark the tensors so the
210211
active offload context skips them.
211212
"""
212-
from ..cpu_offload import ( # pylint: disable=import-outside-toplevel
213-
mark_activation_offload,
214-
mark_not_offload,
215-
)
216-
217213
tensors = tuple(tensor for tensor in tensors if tensor is not None)
218214
if not tensors:
219215
return

0 commit comments

Comments
 (0)