mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #2065] Hygon DCU (gfx936 / DTK 26.04) build works — two undocumented gaps (libhwloc-dev, pip build isolation) #1261
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#1261
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lutianshu824 on GitHub (Jun 27, 2026).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/2065
Summary
kt-kernelfrom v0.6.3.post1 builds and imports cleanly on Hygon DCU(arch gfx936, e.g. BW100/BW150) using Hygon's DTK 26.04 ROCm-compatible
toolkit. The existing ROCm path (
KTRANSFORMERS_USE_ROCM,cpu_backend/vendors/hip.h,the CPUInfer stream bridge) compiles against DTK with no source changes.
Sharing the validated recipe, plus two small, undocumented friction points
that bite any ROCm / vendor-torch user (not just Hygon). Happy to send a docs PR
if useful.
Environment
ROCM_PATH=/opt/dtk,hipcc/dcc 25.10)torch.version.hip= 6.3.xResult:
pipbuildskt_kernel-0.6.3.post1-cp310andpython -c "import kt_kernel; print(kt_kernel.__cpu_variant__)"→avx2.Recipe that worked
Gap #1 —
libhwloc-devis a REQUIRED build dep but undocumentedcmake hard-fails for anyone without hwloc:
pkg_search_module(HWLOC REQUIRED IMPORTED_TARGET hwloc)makes hwloc mandatory,but it's not listed in
kt-kernel/install.sh depsnor in the install docs.Suggestion: add
libhwloc-dev(Debian/Ubuntu) /hwloc-devel(RHEL) to thedepsstep + the AVX2/ROCm tutorials, or emit a friendlier error.Gap #2 — default
pip install .(build isolation) pulls a generic PyPI torchOn ROCm / vendor-torch setups,
pip install .uses an isolated build envand resolves a stock CPU/CUDA
torchfrom PyPI, which shadows the vendor(ROCm/DCU) torch already installed and yields a kernel linked against the wrong
torch. Using
--no-build-isolation --no-depsso the build links the in-envvendor torch fixes it. Worth a one-line note in the ROCm / AVX2 tutorials, since
the current ROCm doc targets AMD GPUs with the PyPI
rocm6.2.4wheel and won'twarn vendor-torch users.
Note
The current ROCm tutorial (
doc/en/ROCm.md) is validated on AMD Radeon7900xtx + ROCm 6.2.4. The above shows the same code path also works on Hygon DCU
(gfx936) via DTK with a vendor torch. A short
doc/en/DCU.md(or a section in theROCm doc) would help other Hygon DCU users — I'm glad to open that PR.
Full recipe, a
Dockerfile, and a prebuilt gfx936 wheel:https://github.com/lutianshu824/ktransformers-dcu
Thanks for the great project!
@yyj6666667 commented on GitHub (Jun 28, 2026):
🫡
Thanks for the job, Hygon users will be glad to see that. It's my pleasure to review and merge your docs PR
@yyj6666667 commented on GitHub (Jul 6, 2026):
The tutorial (a section in the ROCm doc) has been added and merged into main along with this PR https://github.com/kvcache-ai/ktransformers/pull/2075