Skip to content

issue/1573 perf(kunlun): parallelize RoPE and bound native positions - #1574

Closed
JoeZhang-0x000 wants to merge 1 commit into
InfiniTensor:InfiniLM-v0.2.9cfrom
JoeZhang-0x000:issue/1573
Closed

JoeZhang-0x000 wants to merge 1 commit into
InfiniTensor:InfiniLM-v0.2.9cfrom
JoeZhang-0x000:issue/1573

Conversation

@JoeZhang-0x000

@JoeZhang-0x000 JoeZhang-0x000 commented Oct 10, 2026 •

Copy link
Copy Markdown

Superseded by InfiniRT #48 (runtime prerequisite) and InfiniOps #1001 (minimal Kunlun RoPE backend). This legacy InfiniCore PR is closed; fresh modern-API correctness and performance results are in the InfiniOps PR description.


Improve Kunlun RoPE utilization on P800 by striping workers across clusters and querying up to 12 available clusters. Bound native integer positions inside the kernel, reject empty tables, and expose an optional capability bit so callers can skip cast/clamp. Rotation arithmetic is preserved.

Closes #1573. Targets the experiment's legacy InfiniLM-v0.2.9c branch.

Validation on one P800 OAM: 96 correctness cases and 192 changed-input/position Graph replays passed per build, covering BF16/FP16/FP32, I32/I64/U32/U64, both layouts, packed strides, in-place and batched inputs; candidate boundary/extrema checks passed. All 24 benchmark Q/K hash pairs match across four runs.

Median kernel-only Q+K latency, BF16, 8192 tokens, head dimension 128. TP labels are per-rank shapes measured on one XPU.

TP shape Before (us) After (us) Speedup
1 2683.799 1802.164 1.489x
2 1349.381 908.608 1.485x
4 677.987 460.720 1.472x
8 341.882 233.495 1.464x

Timing uses 8 Q+K pairs/Graph × 20 synchronized replays/sample, median of 5 samples. Removing caller cast/clamp gives 1.311–1.563x across 24 shapes (1–8192 tokens); adoption of the capability is required. Small kernel-only inputs regress by up to 0.65 us (6.0%).

Both RoPE translation units were freshly compiled against target-branch headers and relinked with identical pinned runtime/objects; a full branch rebuild was not run. Kernel bytes are unchanged from the validated version. Prior downstream integration achieved a 0 pp GSM8K gap and all 40 static-throughput cases ≥90% native with combined plugin optimizations.

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