Skip to content

Commit

Permalink
Merge pull request #54 from ROCmSoftwarePlatform/IFU-2024-01-05
Browse files Browse the repository at this point in the history
Ifu 2024 01 05
  • Loading branch information
liligwu authored Jan 16, 2024
2 parents 03b582b + 9aefa3f commit f53b42e
Show file tree
Hide file tree
Showing 149 changed files with 4,809 additions and 2,491 deletions.
4 changes: 4 additions & 0 deletions .github/scripts/fbgemm_gpu_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ __configure_fbgemm_gpu_build_rocm () {
echo "[BUILD] Architectures list from rocminfo: ${arch_list}"

if [ "$arch_list" == "" ]; then
# It is possible to build FBGEMM_GPU-ROCm on a machine without AMD
# cards, in which case the arch_list will be empty.
echo "[BUILD] rocminfo did not return anything valid!"

# By default, we build just for MI100 and MI250 to save time. This list
Expand Down Expand Up @@ -418,6 +420,8 @@ build_fbgemm_gpu_install () {
# fbgemm_gpu/ subdirectory present
cd - || return 1
(test_python_import_package "${env_name}" fbgemm_gpu) || return 1
(test_python_import_symbol "${env_name}" fbgemm_gpu __version__) || return 1
cd - || return 1

echo "[BUILD] FBGEMM-GPU build + install completed"
}
Expand Down
15 changes: 9 additions & 6 deletions .github/scripts/fbgemm_gpu_docs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,20 @@ install_docs_tools () {
# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[INSTALL] Installing docs tools ..."
echo "[INSTALL] Installing Doxygen ..."

# shellcheck disable=SC2086
(exec_with_retries 3 conda install ${env_prefix} -c conda-forge -y \
doxygen) || return 1
doxygen \
make) || return 1

# Check binaries are visible in the PATH
(test_binpath "${env_name}" doxygen) || return 1
(test_binpath "${env_name}" make) || return 1

echo "[BUILD] Installing docs-build dependencies ..."
# shellcheck disable=SC2086
(exec_with_retries 3 conda run ${env_prefix} python -m pip install -r requirements.txt) || return 1

echo "[INSTALL] Successfully installed all the docs tools"
}
Expand Down Expand Up @@ -69,10 +76,6 @@ build_fbgemm_gpu_docs () {
# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[BUILD] Installing docs-build dependencies ..."
# shellcheck disable=SC2086
(exec_with_retries 3 conda run ${env_prefix} python -m pip install -r requirements.txt) || return 1

echo "[BUILD] Running Doxygen build ..."
# shellcheck disable=SC2086
(exec_with_retries 3 conda run ${env_prefix} doxygen Doxyfile.in) || return 1
Expand Down
20 changes: 11 additions & 9 deletions .github/scripts/fbgemm_gpu_install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ __fbgemm_gpu_post_install_checks () {
(test_python_import_symbol "${env_name}" fbgemm_gpu __version__) || return 1

echo "[CHECK] Printing out the FBGEMM-GPU version ..."
# shellcheck disable=SC2086
installed_fbgemm_gpu_version=$(conda run ${env_prefix} python -c "import fbgemm_gpu; print(fbgemm_gpu.__version__)")
# shellcheck disable=SC2086,SC2155
local installed_fbgemm_gpu_version=$(conda run ${env_prefix} python -c "import fbgemm_gpu; print(fbgemm_gpu.__version__)")
echo "[CHECK] The installed version is: ${installed_fbgemm_gpu_version}"
}

Expand Down Expand Up @@ -67,13 +67,15 @@ install_fbgemm_gpu_wheel () {

install_fbgemm_gpu_pip () {
local env_name="$1"
local fbgemm_gpu_version="$2"
local fbgemm_gpu_variant_type="$3"
local fbgemm_gpu_variant_version="$4"
if [ "$fbgemm_gpu_variant_type" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME FBGEMM_GPU_VERSION FBGEMM_GPU_VARIANT_TYPE [FBGEMM_GPU_VARIANT_VERSION]"
local fbgemm_gpu_channel_version="$2"
local fbgemm_gpu_variant_type_version="$3"
if [ "$fbgemm_gpu_variant_type_version" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME FBGEMM_GPU_CHANNEL[/VERSION] FBGEMM_GPU_VARIANT_TYPE[/VARIANT_VERSION]"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env 0.5.0rc2 cuda 12.1.1 # Install a specific version of the package (PyPI)"
echo " ${FUNCNAME[0]} build_env 0.5.0 cpu # Install the CPU variant, specific version from release channel"
echo " ${FUNCNAME[0]} build_env release cuda 12.1.1 # Install the CUDA variant, latest version from release channel"
echo " ${FUNCNAME[0]} build_env test/0.6.0rc0 cuda 12.1.0 # Install the CUDA 12.1 variant, specific version from test channel"
echo " ${FUNCNAME[0]} build_env nightly rocm 5.3 # Install the ROCM 5.3 variant, latest version from nightly channel"
return 1
else
echo "################################################################################"
Expand All @@ -86,7 +88,7 @@ install_fbgemm_gpu_pip () {

# Install the package from PyTorch PIP (not PyPI)
# The package's canonical name is 'fbgemm-gpu' (hyphen, not underscore)
install_from_pytorch_pip "${env_name}" fbgemm_gpu "${fbgemm_gpu_version}" "${fbgemm_gpu_variant_type}" "${fbgemm_gpu_variant_version}" || return 1
install_from_pytorch_pip "${env_name}" fbgemm_gpu "${fbgemm_gpu_channel_version}" "${fbgemm_gpu_variant_type_version}" || return 1

# Run post-installation checks
__fbgemm_gpu_post_install_checks "${env_name}" || return 1
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/fbgemm_gpu_test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ test_setup_conda_environment () {
if [ "$pytorch_installer" == "conda" ]; then
install_pytorch_conda "${env_name}" "${pytorch_version}" "${pytorch_variant_type}" "${pytorch_variant_version}" || return 1
else
install_pytorch_pip "${env_name}" "${pytorch_version}" "${pytorch_variant_type}" "${pytorch_variant_version}" || return 1
install_pytorch_pip "${env_name}" "${pytorch_version}" "${pytorch_variant_type}"/"${pytorch_variant_version}" || return 1
fi
}

Expand Down
17 changes: 13 additions & 4 deletions .github/scripts/nova_postscript.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ install_fbgemm_gpu_wheel "${BUILD_ENV_NAME}" fbgemm_gpu/dist/*.whl

# Test with PyTest
echo "[NOVA] Current working directory: $(pwd)"
CPU_GPU="${CU_VERSION}"
if [ "${CU_VERSION}" != 'cpu' ]; then
CPU_GPU=""
if [[ $CU_VERSION = cu* ]]; then
echo "[NOVA] Testing the CUDA variant of FBGEMM_GPU ..."
export fbgemm_variant="cuda"

elif [[ $CU_VERSION = rocm* ]]; then
echo "[NOVA] Testing the ROCm variant of FBGEMM_GPU ..."
export fbgemm_variant="rocm"

else
echo "[NOVA] Testing the CPU variant of FBGEMM_GPU ..."
export fbgemm_variant="cpu"
fi

$CONDA_RUN python3 -c "import torch; print('cuda.is_available() ', torch.cuda.is_available()); print ('device_count() ',torch.cuda.device_count());"
cd "${FBGEMM_REPO}/fbgemm_gpu/test" || { echo "[NOVA] Failed to cd to fbgemm_gpu/test from $(pwd)"; };
run_fbgemm_gpu_tests "${BUILD_ENV_NAME}" "${CPU_GPU}"
run_fbgemm_gpu_tests "${BUILD_ENV_NAME}" "${fbgemm_variant}"

# Workaround EACCES: permission denied error at checkout step
chown -R 1000:1000 /__w/FBGEMM/FBGEMM/ || echo "Unable to chown 1000:1000 from $USER, uid: $(id -u)"
2 changes: 2 additions & 0 deletions .github/scripts/utils_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,14 @@ install_build_tools () {
cmake \
hypothesis \
jinja2 \
make \
ninja \
numpy \
scikit-build \
wheel) || return 1

# Check binaries are visible in the PAATH
(test_binpath "${env_name}" make) || return 1
(test_binpath "${env_name}" cmake) || return 1
(test_binpath "${env_name}" ninja) || return 1

Expand Down
Loading

0 comments on commit f53b42e

Please sign in to comment.