Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions colossalai/accelerator/npu_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@

from .base_accelerator import BaseAccelerator

IS_NPU_AVAILABLE = False
try:
import torch_npu # noqa

IS_NPU_AVAILABLE = True
except ImportError:
pass

Expand Down
4 changes: 2 additions & 2 deletions colossalai/booster/plugin/gemini_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from torch.optim.lr_scheduler import _LRScheduler as LRScheduler
from torch.utils.data import DataLoader

from colossalai.accelerator import IS_NPU_AVAILABLE, get_accelerator
from colossalai.accelerator import get_accelerator
from colossalai.checkpoint_io import CheckpointIndexFile, CheckpointIO, GeneralCheckpointIO
from colossalai.checkpoint_io.utils import (
get_model_base_filenames,
Expand Down Expand Up @@ -362,7 +362,7 @@ def __init__(
) -> None:
super().__init__()
assert precision in SUPPORTED_PRECISION, f"precision {precision} is not supported"
if IS_NPU_AVAILABLE:
if get_accelerator().name == "npu":
assert placement_policy == "static", "NPU only supports static placement policy"
self.gemini_config = dict(
chunk_config_dict=chunk_config_dict,
Expand Down