File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,20 @@ if [[ "$BUILD_LIGHTWEIGHT" == "1" ]]; then
7373 build_version=" ${build_version} .lw"
7474fi
7575
76+ if [[ -z " $PYTORCH_ROOT " ]]; then
77+ echo " Need to set PYTORCH_ROOT env variable"
78+ exit 1
79+ fi
80+ # Always append the pytorch commit to the build_version by querying Git
81+ pushd " $PYTORCH_ROOT "
82+ PYTORCH_COMMIT=$( git rev-parse HEAD)
83+ popd
84+
85+ # Append the commit as a ".git<shortsha>" suffix
86+ # This yields versions like: torch-2.5.0+rocm6.2.0.lw.gitabcd1234
87+ short_commit=$( echo " $PYTORCH_COMMIT " | cut -c1-8)
88+ build_version=" ${build_version} .git${short_commit} "
89+
7690echo " Final build_version: $build_version "
7791
7892export PYTORCH_BUILD_VERSION=$build_version
119133# #######################################################
120134# Compile wheels as well as libtorch
121135# ######################################################
122- if [[ -z " $PYTORCH_ROOT " ]]; then
123- echo " Need to set PYTORCH_ROOT env variable"
124- exit 1
125- fi
136+
126137pushd " $PYTORCH_ROOT "
127138python setup.py clean
128139retry pip install -r requirements.txt
You can’t perform that action at this time.
0 commit comments