Diff Coverage

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

Source File Diff Coverage (%) Missing Lines
hyper_parallel/core/activation_memory/sac.py 100%  
hyper_parallel/core/activation_memory/swap.py 50.0% 655,794,796-799,801
hyper_parallel/core/activation_memory/wrapper.py 100%  
hyper_parallel/core/optimizer/swap_optimizer_base.py 100%  
hyper_parallel/core/activation_memory/swap.py
651
652
653
654
655
656
657
658
659
        """
        for buf in group_device_bufs.values():
            device = getattr(buf, "device", None)
            if device is not None and device.type not in ("cpu", "meta"):
                buf.record_stream(copy_stream)

    def _acquire_bucket_cpu_buf(self, bucket_key, bucket):
        """Acquire the pinned CPU buffer that receives one bucket's D2H copy."""
        numel = bucket["total_numel"]
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
                    )
                # Publish and protect the staging buffers before the first async
                # H2D, for the same reason as launch_offload.
                self._group_device_buf = group_device_bufs
                self._protect_device_bufs(group_device_bufs, copy_stream)

                for bucket_key, bucket in self._packed_buckets.items():
                    group_device_buf = group_device_bufs.get(bucket_key)
                    if group_device_buf is None:
                        continue
                    # One-shot H2D per packed bucket.
                    group_device_buf.copy_(
                        self._group_cpu_buf[bucket_key][:bucket["total_numel"]],
                        non_blocking=True,
                    )