    def init_group(self):
        if self.is_initialized:
            return

        self.is_initialized = True

        """Initialize the sequence parallel group."""
        num_zp_groups: int = self.world_size // self.zp_size
        for i in range(num_zp_groups):
            ranks = range(i * self.zp_size, (i + 1) * self.zp_size)
            group = dist.new_group(ranks)
            if self.rank in ranks:
                self.zp_group = group
                self.zp_rank = self.rank % self.zp_size
Initialize the sequence parallel group.
opensora/adaptor/zp_manager.py