Diff Coverage

Diff: origin/master...HEAD, staged and unstaged changes

Source File Diff Coverage (%) Missing Lines
hyper_parallel/core/pipeline_parallel/mpipe/executor_base.py 69.2% 118,120,125,127
hyper_parallel/core/pipeline_parallel/mpipe/executor_base.py
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
        meta: list = [None, None]
        platform.recv_object_list(meta, src, self._mpipe_group)
        shape, dtype = meta
        if not isinstance(shape, (tuple, list)) or not shape or len(shape) > 8:
            raise ValueError(f'Invalid tensor metadata shape from rank {src}: {shape!r}')
        if any(not isinstance(dim, int) or dim < 0 for dim in shape):
            raise ValueError(f'Invalid tensor metadata dimensions from rank {src}: {shape!r}')
        numel = 1
        for dim in shape:
            numel *= dim
            if numel > 2**31 - 1:
                raise ValueError(f'Tensor metadata exceeds the supported size from rank {src}: {shape!r}')
        if dtype is None:
            raise ValueError(f'Missing tensor metadata dtype from rank {src}')
        return tuple(shape), dtype

    def _output_arity(self):
        """Number of output tensors to communicate (cached after first use)."""