Skip to content

Commit e339fa9

Browse files
fix single gpu bug (#78)
1 parent a8fb5cb commit e339fa9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/twinkle/processor/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def to_tensor(_input):
105105

106106
def pad_cp(self, inputs: List[InputFeature], **kwargs) -> List[InputFeature]:
107107

108+
if self.device_mesh is None:
109+
return inputs
110+
108111
def _pad_cp(_input: InputFeature) -> InputFeature:
109112
# Pad sequence for parallel compatibility
110113
# 1. For CP > 1: Megatron's RoPE requires seq_len % (2 * cp_size) == 0

0 commit comments

Comments
 (0)