-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow up #1281 Adds the missing evaluation of paddlepaddle in the D2L Infra 2.0 for d2l-zh.
- Loading branch information
1 parent
e709c64
commit 54f324a
Showing
5 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
# Used to capture status exit of build eval command | ||
ss=0 | ||
|
||
REPO_NAME="$1" # Eg. 'd2l-zh' | ||
TARGET_BRANCH="$2" # Eg. 'master' ; if PR raised to master | ||
CACHE_DIR="$3" # Eg. 'ci_cache_pr' or 'ci_cache_push' | ||
|
||
pip3 install d2l==0.17.6 | ||
mkdir _build | ||
|
||
source $(dirname "$0")/utils.sh | ||
|
||
# Move sanity check outside | ||
d2lbook build outputcheck tabcheck | ||
|
||
# Move aws copy commands for cache restore outside | ||
if [ "$DISABLE_CACHE" = "false" ]; then | ||
echo "Retrieving paddle build cache from "$CACHE_DIR"" | ||
measure_command_time "aws s3 sync s3://preview.d2l.ai/"$CACHE_DIR"/"$REPO_NAME"-"$TARGET_BRANCH"/_build/eval_paddle/ _build/eval_paddle/ --delete --quiet --exclude 'data/*'" | ||
fi | ||
|
||
# Continue the script even if some notebooks in build fail to | ||
# make sure that cache is copied to s3 for the successful notebooks | ||
d2lbook build eval --tab paddle || ((ss=1)) | ||
|
||
# Move aws copy commands for cache store outside | ||
echo "Upload paddle build cache to s3" | ||
measure_command_time "aws s3 sync _build s3://preview.d2l.ai/"$CACHE_DIR"/"$REPO_NAME"-"$TARGET_BRANCH"/_build --acl public-read --quiet --exclude 'eval*/data/*'" | ||
|
||
# Exit with a non-zero status if evaluation failed | ||
if [ "$ss" -ne 0 ]; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Use Paddle 2.3.2 (Dec 2022) | ||
FROM nvcr.io/nvidia/paddlepaddle:22.12-py3 | ||
|
||
RUN adduser --disabled-password --disabled-login ci | ||
WORKDIR /home/ci | ||
|
||
# Copy d2l_job script | ||
ADD d2l_job.sh . | ||
RUN chmod +x d2l_job.sh; chown ci d2l_job.sh | ||
|
||
# Copy git timesync for caching | ||
ADD git-timesync /home/ci/.local/bin/ | ||
RUN chmod +x /home/ci/.local/bin/git-timesync | ||
|
||
# Allow permissions for pip installations and git-timesync | ||
RUN chown -R ci:ci /home/ci/.local | ||
|
||
USER ci | ||
|
||
ENV PATH="/home/ci/.local/bin:$PATH" | ||
|
||
# Install d2lbook using pip + paddlepaddle dependencies | ||
RUN pip3 install git+https://github.com/d2l-ai/d2l-book opencv-python==4.6.0.66 | ||
|
||
# Python script to print framework versions | ||
ADD print_versions.py . | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters