From 2bc7dae2fc7ac09bb003973fdcfb76899a59b157 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Tue, 28 Jul 2020 07:14:02 -0700 Subject: [PATCH] Use new sccache for RocM builds (#42134) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/42134 Reviewed By: seemethere Differential Revision: D22782146 Pulled By: malfet fbshipit-source-id: 85ba69a705600e30ae0eddbf654298b3dc6f96ed --- .jenkins/pytorch/build.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.jenkins/pytorch/build.sh b/.jenkins/pytorch/build.sh index 7d8324330e6d..8730b61c00d5 100755 --- a/.jenkins/pytorch/build.sh +++ b/.jenkins/pytorch/build.sh @@ -7,6 +7,13 @@ # shellcheck disable=SC2034 COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}" +# Temp: use new sccache +if [[ -n "$IN_CIRCLECI" && "$BUILD_ENVIRONMENT" == *rocm* ]]; then + # Download customized sccache + sudo curl --retry 3 http://repo.radeon.com/misc/.sccache_amd/sccache -o /opt/cache/bin/sccache + sudo chmod 755 /opt/cache/bin/sccache +fi + source "$(dirname "${BASH_SOURCE[0]}")/common.sh" # For distributed, four environmental configs: @@ -126,7 +133,7 @@ if [[ "$BUILD_ENVIRONMENT" == *rocm* ]]; then # ROCm CI is using Caffe2 docker images, which needs these wrapper # scripts to correctly use sccache. - if [ -n "${SCCACHE_BUCKET}" ]; then + if [[ -n "${SCCACHE_BUCKET}" && -z "$IN_CIRCLECI" ]]; then mkdir -p ./sccache SCCACHE="$(which sccache)" @@ -150,8 +157,8 @@ if [[ "$BUILD_ENVIRONMENT" == *rocm* ]]; then export PATH="$CACHE_WRAPPER_DIR:$PATH" fi - # Set ROCM_ARCH to gtx900 and gtx906 - if [[ -n "$CIRCLECI" ]]; then + if [[ -n "$IN_CIRCLECI" ]]; then + # Set ROCM_ARCH to gtx900 and gtx906 in CircleCI echo "Limiting PYTORCH_ROCM_ARCH to gfx90[06] for CircleCI builds" export PYTORCH_ROCM_ARCH="gfx900;gfx906" fi