Skip to content
Open
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
9 changes: 5 additions & 4 deletions src/twinkle/kernel/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ def npu_builtin(model: nn.Module | None = None) -> dict[Any, dict[str, Any]]:
if exists('mindspeed>=0.12.1') and exists('flash-linear-attention'):
apply_qwen3_5_fla(model)
else:
logger.warning('[NPU] [FLA] mindspeed or flash-linear-attention is not installed, or mindspeed version smaller than 0.12.1; '
'FLA patch for Qwen3.5 requires mindspeed and flash-linear-attention. '
'Install them with: pip install flash-linear-attention and mindspeed from source code via https://gitcode.com/Ascend/MindSpeed.'
'Other NPU patches will still apply.')
logger.warning(
'[NPU] [FLA] mindspeed or flash-linear-attention is not installed, or mindspeed version smaller than 0.12.1; '
'FLA patch for Qwen3.5 requires mindspeed and flash-linear-attention. '
'Install them with: pip install flash-linear-attention and mindspeed from source code via https://gitcode.com/Ascend/MindSpeed.'
'Other NPU patches will still apply.')
return bundle


Expand Down
2 changes: 1 addition & 1 deletion src/twinkle/model/transformers/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _router_replay_setup(self, router_replay_action, routed_experts=None, batch_
Returns ``cleanup_fn``.
Call *cleanup_fn* after the forward to gather recorded indices(when RECORD) and clear global state.
"""
if not self._router_replay_enabled:
if not getattr(self, '_router_replay_enabled', False):
return lambda: None

self._maybe_apply_router_replay()
Expand Down
1 change: 1 addition & 0 deletions src/twinkle/utils/device_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ class DeviceGroup:
ranks: Union[List[int], int]
device_type: str
gpus_per_worker: int = 1
visible_devices: Optional[Union[List[str], List[int], str, int]] = None
_device_mesh: Dict[str, DeviceMesh] = field(default_factory=dict)


Expand Down