README-DCU.rst 1.6 KB
Newer Older
tianlh's avatar
tianlh committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
镜像
============

docker pull harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-py3.10

创建容器
============

docker run -it --name lightgbm-tlh --privileged --shm-size=256G --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit memlock=-1:-1 --ipc=host --network host --group-add video --device /dev/kfd --device /dev/dri --device /dev/mkfd -v /opt/hyhal:/opt/hyhal:ro -v /public/tianlh:/workspace  harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-py3.10 /bin/bash

下载仓库
============
git clone --recursive xxx.git

环境、脚本准备
============

cd LightGBM
git checkout release/4.6.0.99
pip install scikit_build_core
修改build-python.sh,148行,改成下方内容

.. code:: bash

        --rocm)
                BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.USE_ROCM=ON"
                BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.CMAKE_HIP_COMPILER=dcc"
        ;;

构建whl
============

.. code:: bash

        export CMAKE_PREFIX_PATH=/opt/dtk
        export CMAKE_CXX_COMPILER=hipcc
        ./build-python.sh bdist_wheel --rocm --no-isolation

安装whl
============

pip install dist/amd_lightgbm*.whl

验证安装
============

   .. code-block:: shell

      pip show -v amd_lightgbm

   .. dropdown:: Example output

      .. code-block:: shell-session

          Name: amd_lightgbm
          Version: 4.6.0.99
          Summary: ROCm Port of LightGBM Python-package
         ... [output truncated]

测试程序
============

   .. code-block:: shell

        hipprof HIP_VISIBLE_DEVICES=0 python lightgbm_test.py