2424 type : string
2525 default : ' 3.10'
2626 description : ' The python version to use'
27+ rel_ver :
28+ required : true
29+ type : string
30+ description : ' The release version of torch_hpu to use'
2731 outputs :
2832 torch-hpu-artifact :
2933 description : ' The distribution artifact name of torch_hpu'
4852 env :
4953 HABANA_VISIBLE_DEVICES : all
5054 OMPI_MCA_btl_vader_single_copy_mechanism : none
55+ REL_VERSION : ${{inputs.rel_ver}}
56+ BASE_INC : " /usr/include/habanalabs"
5157 options : >-
5258 --ipc host
5359 --cap-add sys_nice
@@ -92,14 +98,14 @@ jobs:
9298 run : |
9399 mkdir torch_hpu && cd torch_hpu
94100 # apt update -y && apt install -y curl gnupg pciutils wget
95- # wget ' https://vault.habana.ai/artifactory/gaudi-installer/latest /habanalabs-installer.sh'
101+ wget " https://vault.habana.ai/artifactory/gaudi-installer/$REL_VERSION /habanalabs-installer.sh"
96102 export HABANA_SOFTWARE_STACK="$(pwd)"
97103 export PYTORCH_MODULES_ROOT_PATH="$HABANA_SOFTWARE_STACK/gaudi-pytorch-bridge"
98104 git clone https://github.com/HabanaAI/gaudi-pytorch-bridge $PYTORCH_MODULES_ROOT_PATH
99105
100- # IFS=- read -r VERSION BUILD <<EOF
101- # $(bash habanalabs-installer.sh -v)
102- # EOF
106+ IFS=- read -r VERSION BUILD <<EOF
107+ $(bash habanalabs-installer.sh -v)
108+ EOF
103109 # "${PYTORCH_MODULES_ROOT_PATH}"/scripts/install_torch_fork.sh "$VERSION" "$BUILD"
104110
105111 mkdir 3rd-parties
@@ -115,13 +121,10 @@ jobs:
115121 sed -i 's/namespace nlohmann/namespace nlohmannV340/; s/nlohmann::/nlohmannV340::/g' json/single_include/nlohmann/json.hpp
116122
117123 popd
118- git clone --depth 1 --branch 1.20.0-543 https://github.com/HabanaAI/HCL.git
119- git clone --depth 1 --branch main https://github.com/HabanaAI/Intel_Gaudi3_Software.git
124+ pip install -r "$PYTORCH_MODULES_ROOT_PATH"/requirements.txt
125+ pip install habana-media-loader==$VERSION.$BUILD
120126
121- ln -s /usr/include/habanalabs/ /usr/include/habanalabs/include
122- ln -s /usr/lib/habanalabs/libaeon.so.1 /usr/lib/habanalabs/libaeon.so
123- patch -p1 <$PYTORCH_MODULES_ROOT_PATH/.devops/patches/Intel_Gaudi3_Software.patch
124- cp $PYTORCH_MODULES_ROOT_PATH/.devops/patches/media_pytorch_proxy.h /usr/include/habanalabs/media_pytorch_proxy.h
127+ chmod +w /usr/lib/habanalabs/
125128
126129 - name : Build torch_hpu
127130 working-directory : torch_hpu
@@ -130,20 +133,21 @@ jobs:
130133 export THIRD_PARTIES_ROOT="$HABANA_SOFTWARE_STACK/3rd-parties"
131134
132135 export HCL_ROOT="$HABANA_SOFTWARE_STACK/HCL/hcl/"
133- export HL_LOGGER_INCLUDE_DIRS="$HABANA_SOFTWARE_STACK/HCL/dependencies/swtools_sdk/hl_logger/include;$THIRD_PARTIES_ROOT"
134- export MEDIA_ROOT=/usr/include/habanalabs/
135- export SPECS_EXT_ROOT="$HABANA_SOFTWARE_STACK/Intel_Gaudi3_Software/specs_external/"
136- export SYNAPSE_ROOT=/usr/include/habanalabs/
137- export SYNAPSE_UTILS_ROOT=/usr/include/habanalabs/
136+ export HCL_INCLUDE_DIR=$BASE_INC/
137+ export HL_LOGGER_INCLUDE_DIRS=$BASE_INC/hl_logger
138+ export MEDIA_ROOT=$(python -c "import habana_frameworks.mediapipe, os;print(os.path.dirname(habana_frameworks.mediapipe.__file__))")
139+ export SPECS_EXT_ROOT=$BASE_INC
140+ export SYNAPSE_ROOT=$BASE_INC
141+ export SYNAPSE_INCLUDE_DIR=$BASE_INC
142+ export SYNAPSE_UTILS_ROOT=$BASE_INC
143+ export SYNAPSE_UTILS_INCLUDE_DIR=$BASE_INC
138144
139145 export BUILD_ROOT="$HABANA_SOFTWARE_STACK/builds"
140146 export BUILD_ROOT_LATEST=/usr/lib/habanalabs/
141147 export PYTORCH_MODULES_RELEASE_BUILD="$BUILD_ROOT/pytorch_modules_release" # the release build artifact directory
142148 export PYTORCH_MODULES_DEBUG_BUILD="$BUILD_ROOT/pytorch_modules_debug" # the debug build artifact directory
143149 export PYTORCH_MODULES_ROOT_PATH="$HABANA_SOFTWARE_STACK/gaudi-pytorch-bridge"
144150
145- pip install -r "$PYTORCH_MODULES_ROOT_PATH"/requirements.txt
146-
147151 "$PYTORCH_MODULES_ROOT_PATH"/.devops/build.py -cir
148152
149153 - name : List distribution package
@@ -195,4 +199,4 @@ jobs:
195199
196200 - name : Cleanup workspace
197201 if : always()
198- run : rm -rf ${{ github.workspace }}/*
202+ run : rm -rf ${{ github.workspace }}/*
0 commit comments