Skip to content
Merged
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
5 changes: 4 additions & 1 deletion slime/backends/megatron_utils/cp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ def slice_log_prob_with_cp(
qkv_format: str = "thd",
max_token_len: int | None = None,
) -> list[float] | torch.Tensor:
assert len(log_prob) == response_length
assert len(log_prob) == response_length, (
f"log_prob length mismatch: len(log_prob)={len(log_prob)}, "
f"response_length={response_length}, total_length={total_length}"
)

cp_size = mpu.get_context_parallel_world_size()

Expand Down