You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/02/24 20:50:49 UTC

[GitHub] [tvm] areusch commented on a change in pull request #10246: [ci] Use sccache in builds

areusch commented on a change in pull request #10246:
URL: https://github.com/apache/tvm/pull/10246#discussion_r814256912



##########
File path: tests/scripts/task_build.sh
##########
@@ -15,5 +15,41 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-export VTA_HW_PATH=`pwd`/3rdparty/vta-hw
-cd $1 && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make $2 && cd ..
+set -eux
+
+VTA_HW_PATH=$(pwd)/3rdparty/vta-hw
+export VTA_HW_PATH
+
+pushd "$1"
+
+# Set up sccache to use S3
+if [ -n "${3+x}" ] && which sccache; then

Review comment:
       should we error here if `which sccache` is empty?

##########
File path: tests/scripts/task_build.sh
##########
@@ -15,5 +15,41 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-export VTA_HW_PATH=`pwd`/3rdparty/vta-hw
-cd $1 && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make $2 && cd ..
+set -eux
+
+VTA_HW_PATH=$(pwd)/3rdparty/vta-hw
+export VTA_HW_PATH
+
+pushd "$1"
+
+# Set up sccache to use S3
+if [ -n "${3+x}" ] && which sccache; then
+    export SCCACHE_BUCKET=$3
+    HAS_SCCACHE=1
+else
+    export SCCACHE_BUCKET="no-bucket-configured"
+    HAS_SCCACHE=0
+fi
+
+if [ "$HAS_SCCACHE" -eq "1" ]; then
+    echo "Running with sccache enabled"
+    export CC=/opt/sccache/cc
+    export CXX=/opt/sccache/c++
+fi
+
+# Send this out through a side channel, the bucket name is not actually secret
+# so it's OK to leak it in this way
+echo "$SCCACHE_BUCKET" | base64
+
+if [ "$HAS_SCCACHE" -eq "1" ]; then
+    sccache --start-server || echo failed
+    sccache --show-stats
+fi
+
+cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
+cmake --build . -- VERBOSE=1 "$2"
+
+if [ "$HAS_SCCACHE" -eq "1" ]; then
+    sccache --show-stats

Review comment:
       should we label this? same q above on line 42

##########
File path: tests/scripts/task_config_build_gpu.sh
##########
@@ -41,7 +41,6 @@ echo set\(USE_PROFILER ON\) >> config.cmake
 echo set\(USE_ANTLR ON\) >> config.cmake
 echo set\(USE_VTA_FSIM ON\) >> config.cmake
 echo set\(USE_BLAS openblas\) >> config.cmake
-echo set\(CMAKE_CXX_COMPILER g++\) >> config.cmake

Review comment:
       i think removing this should be fine, but has this been tested locally outside the CI?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org