Repository navigation
[CP] Work around Ulysses graph registration on older NCCL - #5393
Conversation
[ghstack-poisoned]
[ghstack-poisoned]
| if not any(model.traverse(UlyssesCPInnerAttention.Config)): | ||
| return | ||
|
|
||
| _warn_overwrite_env("NCCL_GRAPH_REGISTER", "0") |
There was a problem hiding this comment.
so this will also affect other collectives if we turn this flag on when using Ulysses? is there any impact?
There was a problem hiding this comment.
yes, performance regressions, extra copy. But whether we will actually see performance regressions depends on the actual workloads.
[ghstack-poisoned]
NCCL may reuse an incomplete CUDA-graph IPC mapping for another buffer view. This can cause incorrect results or invalid memory access. Set NCCL_GRAPH_REGISTER=0 before process-group initialization for normal Ulysses on NCCL releases before 2.32.3. The affected NCCL registration code is shared with other collective paths, including all-gather and some out-of-place all-reduce paths. This workaround is scoped to normal Ulysses because that is the confirmed reproduction. We currently couldn't reproduce this issues with other collectives, so we just enable the workaround for Ulysses. Reproduced the error on a smaller scale, need a larger scale run of Kimi K3 to verify. Upstream fix: NVIDIA/nccl#2362. The first fixed public release is NCCL 2.32.3. ghstack-source-id: 881da57 Pull-Request: #5393
shuhuayu
left a comment
There was a problem hiding this comment.
thx! fixed my kimi k3 run with cp and cudagraph.
| device_module.set_device(self.device) | ||
| config = self.config | ||
| set_batch_invariance(config.debug.batch_invariant) | ||
| dist_utils.configure_nccl_for_ulysses( |
There was a problem hiding this comment.
please add a TODO here, too
| """Disable graph registration on affected NCCL versions before initialization. | ||
|
|
||
| NCCL < 2.32.3 can reuse partial IPC imports for Ulysses graph buffers. | ||
| Fix: https://github.com/NVIDIA/nccl/pull/2362 (NCCL 2.32.3). |
There was a problem hiding this comment.
I heard from @shuhuayu that this problem being addressed by this PR only happens when cudagraph + Ulysses is used, which will make cudagraph perf same as eager.
I wonder if we should just ban Ulysses + cudagraph for now, and add a TODO to wait for NCCL version bump. In particular, this is a global flag which affects other parts, "unexpectedly".
There was a problem hiding this comment.
@tianyu-l that is only for Kimi K3. For Muse Spark, without CUDAGraph, the performance is worse.
[ghstack-poisoned]
[ghstack-poisoned]
NCCL may reuse an incomplete CUDA-graph IPC mapping for another buffer view. This can cause incorrect results or invalid memory access. Set NCCL_GRAPH_REGISTER=0 before process-group initialization for normal Ulysses on NCCL releases before 2.32.3. The affected NCCL registration code is shared with other collective paths, including all-gather and some out-of-place all-reduce paths. This workaround is scoped to normal Ulysses because that is the confirmed reproduction. We currently couldn't reproduce this issues with other collectives, so we just enable the workaround for Ulysses. Reproduced the error on a smaller scale, need a larger scale run of Kimi K3 to verify. Upstream fix: NVIDIA/nccl#2362. The first fixed public release is NCCL 2.32.3. ghstack-source-id: da351b7 Pull-Request: #5393
[ghstack-poisoned]
NCCL may reuse an incomplete CUDA-graph IPC mapping for another buffer view. This can cause incorrect results or invalid memory access. Set NCCL_GRAPH_REGISTER=0 before process-group initialization for normal Ulysses on NCCL releases before 2.32.3. The affected NCCL registration code is shared with other collective paths, including all-gather and some out-of-place all-reduce paths. This workaround is scoped to normal Ulysses because that is the confirmed reproduction. We currently couldn't reproduce this issues with other collectives, so we just enable the workaround for Ulysses. Reproduced the error on a smaller scale, need a larger scale run of Kimi K3 to verify. Upstream fix: NVIDIA/nccl#2362. The first fixed public release is NCCL 2.32.3. ghstack-source-id: f98d139 Pull-Request: #5393
Stack from ghstack (oldest at bottom):
NCCL may reuse an incomplete CUDA-graph IPC mapping for another buffer view. This can cause incorrect results or invalid memory access. Set NCCL_GRAPH_REGISTER=0 before process-group initialization for normal Ulysses on NCCL releases before 2.32.3.
The affected NCCL registration code is shared with other collective paths, including all-gather and some out-of-place all-reduce paths. This workaround is scoped to normal Ulysses because that is the confirmed reproduction. We currently couldn't reproduce this issues with other collectives, so we just enable the workaround for Ulysses.
Reproduced the error on a smaller scale, need a larger scale run of Kimi K3 to verify.
Upstream fix: NVIDIA/nccl#2362. The first fixed public release is NCCL 2.32.3.