Skip to content

Merge caffe2_specific into ROCm/master #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c8328ce
py changes and docs
rohithkrn Aug 14, 2018
50886a6
add execute permissions to build script
rohithkrn Aug 14, 2018
c3feae7
Merge pull request #124 from rohithkrn/python_and_doc_changes
rohithkrn Aug 15, 2018
495fa02
update conv_test from upstream
Aug 17, 2018
8fc3bbc
Merge remote-tracking branch 'upstream/master' into caffe2_specific
rohithkrn Aug 27, 2018
5dd23c9
sync with upstream
rohithkrn Aug 28, 2018
0a337b4
update docs
rohithkrn Aug 28, 2018
3fd5e93
Merge pull request #156 from rohithkrn/upstream_sync
rohithkrn Aug 29, 2018
53acb37
Update caffe2-build.md
rohithkrn Aug 29, 2018
6423f9d
add thinlto
rohithkrn Sep 10, 2018
ee594c6
Merge branch 'caffe2_specific' of https://github.com/ROCmSoftwarePlat…
rohithkrn Sep 10, 2018
4362496
merge upstream master
rohithkrn Sep 14, 2018
740e2e7
cmake fixes
yxsamliu Sep 12, 2018
0d892b0
Replace hc::__lane_id with __lane_id
yxsamliu Sep 12, 2018
48e6c17
update tests
rohithkrn Sep 17, 2018
48371a6
update optimizer.py
rohithkrn Sep 17, 2018
2419ec5
add ignore tests
rohithkrn Sep 18, 2018
cff7561
merge upstream
rohithkrn Sep 18, 2018
9154b6a
resolve merge conflict
rohithkrn Sep 20, 2018
2a967b1
Merge remote-tracking branch 'upstream/master' into caffe2_specific
rohithkrn Sep 21, 2018
c2dc0b7
update docker images versions in the docs
rohithkrn Sep 21, 2018
daced6b
fix bug in rnn_cell test
rohithkrn Sep 24, 2018
b1b216e
exclude fp16 for hip
rohithkrn Sep 24, 2018
7aa653a
merge rocm/master
rohithkrn Sep 25, 2018
3309875
add correct conditioning in workspace.py
rohithkrn Sep 25, 2018
413e940
fix device options in hypothesis_test_util
rohithkrn Sep 25, 2018
30cfc8e
Fixed a typo
Sep 25, 2018
402461b
fix typo
rohithkrn Sep 26, 2018
4e6de58
modify resnet benchmarking script
rohithkrn Sep 26, 2018
98ba4a1
filter group > 1 in conv_test
rohithkrn Sep 26, 2018
83b85e0
fix whitespaces Dependencies.cmake
rohithkrn Sep 26, 2018
775d102
Using MIOpen group conv API
Sep 26, 2018
43399c2
Merge pull request #227 from ashishfarmer/af/mio_hotfix
rohithkrn Sep 26, 2018
0c8b222
address comments, whitespaces
rohithkrn Sep 26, 2018
deb6cb2
merge group conv fixes
rohithkrn Sep 26, 2018
8bed68c
will instead add a readme for this soon
rohithkrn Sep 26, 2018
65f24b1
remove unused varaibles
rohithkrn Sep 26, 2018
fc7fcc1
whitespace changes
rohithkrn Sep 27, 2018
d03ae3f
update-docs
rohithkrn Sep 27, 2018
56fa470
change benchmarking command
rohithkrn Sep 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .jenkins/caffe2/amd/binary_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -ex

LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$LOCAL_DIR"/../../../ && pwd)

cd "$ROOT_DIR"

echo "Running C++ tests.."

for file in $(find "${ROOT_DIR}/build_caffe2/bin" -executable -type f); do
if [[ "$file" =~ "test" ]]; then
case "$file" in
# skip tests we know are hanging or bad
*/mkl_utils_test|*/aten/integer_divider_test)
continue
;;
*/scalar_tensor_test|*/basic|*/native_test)
continue
;;
*)
"$file"
esac
fi
done
73 changes: 73 additions & 0 deletions .jenkins/caffe2/amd/build_amd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash

set -ex

# The INSTALL_PREFIX here must match up with test.sh
INSTALL_PREFIX="/usr/local/caffe2"
LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$LOCAL_DIR"/../../.. && pwd)
CMAKE_ARGS=()

##############################################################################
# Explicitly set Python executable.
###############################################################################
# On Ubuntu 16.04 the default Python is still 2.7.
PYTHON="$(which python)"

###############################################################################
# Set cmake args
###############################################################################
CMAKE_ARGS+=("-DBUILD_BINARY=ON")
CMAKE_ARGS+=("-DBUILD_TEST=ON")
CMAKE_ARGS+=("-DINSTALL_TEST=ON")
CMAKE_ARGS+=("-DUSE_OBSERVERS=ON")
CMAKE_ARGS+=("-DUSE_ZSTD=ON")
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}")

# TODO: This is patching the official FindHip to properly handly
# cmake generator expression. A PR is opened in the upstream repo here:
# https://github.com/ROCm-Developer-Tools/HIP/pull/516
# remove this hack once it's merged.
if [[ -f /opt/rocm/hip/cmake/FindHIP.cmake ]]; then
sudo sed -i 's/\ -I${dir}/\ $<$<BOOL:${dir}>:-I${dir}>/' /opt/rocm/hip/cmake/FindHIP.cmake
fi

export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export HCC_AMDGPU_TARGET=gfx900
export KMTHINLTO=1

########## HIPIFY Caffe2 operators
${PYTHON} "${ROOT_DIR}/tools/amd_build/build_caffe2_amd.py"
${PYTHON} "${ROOT_DIR}/tools/amd_build/build_pytorch_amd.py"

MAX_JOBS=$(nproc)

###############################################################################
# Configure and make
###############################################################################
# Run cmake from ./build_caffe2 directory so it doesn't conflict with
# standard PyTorch build directory. Eventually these won't need to
# be separate.
rm -rf build_caffe2
mkdir build_caffe2
cd ./build_caffe2

# Configure
cmake "${ROOT_DIR}" ${CMAKE_ARGS[*]} "$@"

# Build
if [ "$(uname)" == "Linux" ]; then
make "-j${MAX_JOBS}" install
else
echo "Don't know how to build on $(uname)"
exit 1
fi

###############################################################################
# Install ONNX
###############################################################################

# Install ONNX into a local directory
pip install --user -b /tmp/pip_install_onnx "file://${ROOT_DIR}/third_party/onnx#egg=onnx"

40 changes: 40 additions & 0 deletions .jenkins/caffe2/amd/python_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -ex

LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$LOCAL_DIR"/../../../ && pwd)

cd "$ROOT_DIR"

# Get the relative path to where the caffe2 python module was installed
CAFFE2_PYPATH="$ROOT_DIR/build_caffe2/caffe2"

rocm_ignore_test=()
# need to debug
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/arg_ops_test.py")
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/piecewise_linear_transform_test.py")
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/softmax_ops_test.py")
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/unique_ops_test.py")
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/model_device_test.py")
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/data_parallel_model_test.py")

# Need to go through roi ops to replace max(...) with fmaxf(...)
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/roi_align_rotated_op_test.py")

# cuda top_k op has some asm code, the hipified version doesn't
# compile yet, so we don't have top_k operator for now
rocm_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/top_k_test.py")


# Python tests
echo "Running Python tests.."
python \
-m pytest \
-v \
--ignore "$CAFFE2_PYPATH/python/test/executor_test.py" \
--ignore "$CAFFE2_PYPATH/python/operator_test/matmul_op_test.py" \
--ignore "$CAFFE2_PYPATH/python/operator_test/pack_ops_test.py" \
--ignore "$CAFFE2_PYPATH/python/mkl/mkl_sbn_speed_test.py" \
${rocm_ignore_test[@]} \
"$CAFFE2_PYPATH/python"
Loading