Skip to content

feat(kunlun): add BKCL backend for collective communication - #91

Open
rubik-hua wants to merge 1 commit into
InfiniTensor:masterfrom
rubik-hua:kunlun-pp-adaptor
Open

rubik-hua wants to merge 1 commit into
InfiniTensor:masterfrom
rubik-hua:kunlun-pp-adaptor

Conversation

@rubik-hua

Copy link
Copy Markdown

Register Kunlun as device type 10 and BKCL as backend type 7, over the vendor xccl_* C API in libbkcl.so:

  • send/recv/all_gather/all_reduce/reduce_scatter/comm_init_rank/ comm_destroy/get_unique_id inherit the common backend; broadcast is implemented directly (non-root ranks pass NULL sendbuf)
  • int16/uint16/uint32/uint64 rejected (no XCCL type mappings); no AVG RedOp
  • cmake/devices/Kunlun.cmake + cmake/backends/BKCL.cmake; gen_bridge.py registers bkcl; DevicePriority = 5 (without it dispatch silently falls back to CPU, rc=8 NotSupported)
  • examples/ccl/pp_p2p.cc: two-process TCP-rendezvous test

PP并行策略端到端验证

export PYTHONPATH=/workspace/rubik-hua/InfiniLM/python:$PYTHONPATH
MODEL=/mnt/infini/infrahi/infinilm-models/DeepSeek-R1-Distill-Qwen-7B
cd /workspace/rubik-hua/InfiniLM/examples

rank 1 (second pipeline stage) in background on XPU 1
XPU_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python test_infer.py --device=kunlun
--model=$MODEL --tp=1 --pp=2 --node-rank=1 --master-addr=127.0.0.1
--master-port=29500 --max-new-tokens 24 > /tmp/pp_worker_new.log 2>&1 &
sleep 5

rank 0 (first stage) foreground on XPU 0
XPU_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python test_infer.py --device=kunlun
--model=$MODEL --tp=1 --pp=2 --node-rank=0 --master-addr=127.0.0.1
--master-port=29500 --max-new-tokens 24 2>&1 | tee /tmp/pp_main_new.log

image

Register Kunlun as device type 10 and BKCL as backend type 7, over the
vendor xccl_* C API in libbkcl.so:

- send/recv/all_gather/all_reduce/reduce_scatter/comm_init_rank/
  comm_destroy/get_unique_id inherit the common backend; broadcast is
  implemented directly (non-root ranks pass NULL sendbuf)
- int16/uint16/uint32/uint64 rejected (no XCCL type mappings); no AVG RedOp
- cmake/devices/Kunlun.cmake + cmake/backends/BKCL.cmake; gen_bridge.py
  registers bkcl; DevicePriority<kKunlun> = 5 (without it dispatch silently
  falls back to CPU, rc=8 NotSupported)
- examples/ccl/pp_p2p.cc: two-process TCP-rendezvous test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant