chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:35:51 +08:00
commit c36a561cd8
2172 changed files with 455595 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
#!/bin/bash
. /opt/conda/etc/profile.d/conda.sh
conda activate pytorch-ci
GCN_EXAMPLE_DIR="./examples/pytorch/"
function fail {
echo FAIL: $@
exit -1
}
function usage {
echo "Usage: $0 [cpu|gpu]"
}
# check arguments
if [ $# -ne 1 ]; then
usage
fail "Error: must specify device"
fi
if [ "$1" == "cpu" ]; then
dev=-1
elif [ "$1" == "gpu" ]; then
export CUDA_VISIBLE_DEVICES=0
dev=0
else
usage
fail "Unknown device $1"
fi
export DGLBACKEND=pytorch
export DGL_LIBRARY_PATH=${PWD}/build
export PYTHONPATH=${PWD}/python:$PYTHONPATH
export DGL_DOWNLOAD_DIR=${PWD}/_download
# test
python3 -m pytest -v --junitxml=pytest_backend.xml --durations=100 tests/examples || fail "sparse examples on $1"
pushd $GCN_EXAMPLE_DIR> /dev/null
python3 pagerank.py || fail "run pagerank.py on $1"
python3 gcn/train.py --dataset cora || fail "run gcn/train.py on $1"
python3 lda/lda_model.py || fail "run lda/lda_model.py on $1"
popd > /dev/null