Skip to content

feat(kunlun): add Kunlun XPU runtime backend - #57

Open
rubik-hua wants to merge 1 commit into
InfiniTensor:masterfrom
rubik-hua:feat/kunlun-backend
Open

rubik-hua wants to merge 1 commit into
InfiniTensor:masterfrom
rubik-hua:feat/kunlun-backend

Conversation

@rubik-hua

Copy link
Copy Markdown

Register Kunlun as device type 10 (kKunlun) and wire the XRE runtime as a native backend:

  • cmake: WITH_KUNLUN option with device autodetection (/dev/xpu*); SDK root accepts a bare XRE tree or a torch_xmlir package root
  • src/native/kunlun: device_/runtime_/data_type_ shims over the xpu_* C API; runtime_ carries its own stream create/destroy/synchronize and a device-wide xpu_wait() as DeviceSynchronize (XRE has no whole-device sync)
  • link libxpurt.so; expose only the xpu/kernel XTDK header subtree to host compilation

端到端验证
XPU_VISIBLE_DEVICES=7 python3 examples/test_infer.py --device=kunlun --model=/mnt/infini/infrahi/infinilm-models/DeepSeek-R1-Distill-Qwen-7B --enable-paged-attn --attn flash-attn --prompt "你是谁"
image

Register Kunlun as device type 10 (kKunlun) and wire the XRE runtime as a
native backend:

- cmake: WITH_KUNLUN option with device autodetection (/dev/xpu*); SDK root
  accepts a bare XRE tree or a torch_xmlir package root
- src/native/kunlun: device_/runtime_/data_type_ shims over the xpu_* C API;
  runtime_ carries its own stream create/destroy/synchronize and a
  device-wide xpu_wait() as DeviceSynchronize (XRE has no whole-device sync)
- link libxpurt.so; expose only the xpu/kernel XTDK header subtree to host
  compilation

This branch has not been deployed

No deployments
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