Skip to content
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

Add magma conda package install support via MAGMA_PACKAGE_SOURCE #30

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from

Conversation

jataylo
Copy link

@jataylo jataylo commented May 3, 2023

Add condition to install_rocm_magma.sh which will either install magma via a package source if supplied or fallback to building from source.

Corresponding rocAutomation PR:
https://github.com/ROCmSoftwarePlatform/rocAutomation/pull/161

build_manylinux_image.sh snippet:

#64 [rocm_final 7/7] RUN bash ./install_rocm_magma.sh && rm install_rocm_magma.sh
#64 sha256:1b8cb3c1d37d22ee3a84c0912d1f5aadcf5c92d1fcd78d0e83d96cf3a3e33a6f
#64 1.169 MAGMA_PACKAGE_SOURCE is set, installing magma from source
#64 1.169 + '[' -z .../magma-rocm-2.6.2-+RC5_44_35.tar.bz2 ']'
#64 1.169 + echo 'MAGMA_PACKAGE_SOURCE is set, installing magma from source'
#64 1.169 + install_magma_package
#64 1.169 + MAGMA_VERSION=2.6.2
#64 1.169 + rocm_path=/opt/rocm
#64 1.170 ++ mktemp -d
#64 1.174 + tmp_dir=/tmp/tmp.9OOq5zKOo8
#64 1.174 + pushd /tmp/tmp.9OOq5zKOo8
#64 1.174 /tmp/tmp.9OOq5zKOo8 /
#64 1.174 + wget --no-check-certificate -q ...magma-rocm-2.6.2-+RC5_44_35.tar.bz2
#64 4.581 + tar -xf magma-rocm-2.6.2-+RC5_44_35.tar.bz2
#64 26.13 + mkdir -p /opt/rocm/magma
#64 26.13 + '[' -e /tmp/tmp.9OOq5zKOo8/magma/include ']'
#64 26.13 + mv /tmp/tmp.9OOq5zKOo8/magma/include /opt/rocm/magma/include
#64 26.14 Successfully installed MAGMA include files to /opt/rocm/magma/include
#64 26.14 + echo 'Successfully installed MAGMA include files to /opt/rocm/magma/include'
#64 26.14 + '[' -e /tmp/tmp.9OOq5zKOo8/magma/lib/ ']'
#64 26.14 + mv /tmp/tmp.9OOq5zKOo8/magma/lib/ /opt/rocm/magma/lib
#64 26.14 Successfully installed MAGMA library files to /opt/rocm/magma/lib
#64 26.14 /
#64 26.14 + echo 'Successfully installed MAGMA library files to /opt/rocm/magma/lib'
#64 26.14 + popd
#64 26.14 + rm -rf /tmp/tmp.9OOq5zKOo8
#64 26.71 + '[' '!' -d /opt/rocm/magma ']'
#64 DONE 34.0s

KyleCZH and others added 30 commits March 22, 2022 19:07
* add dependencies for rocm5.1

* install miopen dependencies using cmake

* change lib path in build_rocm.sh for rocm5.1

* change amdgpu_version for rocm5.1

* remove 4.5.2 and add 5.1
[ROCm] add dependencies for rocm5.2
* change the MAYBE_LIB64 path for just for 5.2
* Changes to support ROCm 5.3

* Updated as per comments
- In ROCm 5.3 libtorch build are failing during magma build due to
  to missing python binary so added install statement
* Updating the condition for noRCCL build

* Updated changes as per comments
…rocm_fork

Disable MLIR backend when building MIOpen
jithunnair-amd and others added 20 commits October 5, 2022 02:07
…taging_branch

Use staging branch of MIOpen for ROCm5.3
* Update to so patching for ROCm

Wildcard used in grep to grab the actual numbered so file referenced
in patchelf. This allows the removal of specifying the so number in
DEPS_LIST & DEPS_SONAME

This commit also adds the functionality for trimming so names to
build_libtorch.sh from build_common.sh

* Refactor to remove switch statement in build_rocm.sh

This commit refactors build_rocm.sh and brings in a few major updates:
 - No longer required to specify the full .so name (with number) for ROCm libraries
       - The .so versions are copied and the patching code will fix the links to point to this version
 - No longer required to specify paths for ROCm libraries allowing the removal of the large switch
       - Paths are acquired programmatically with find
 - No longer required to specify both the path and filename for the OS specific libraries
       - Programatically extract file name from the path
 - Automatically extract Tensile/Kernels files for the architectures specified in PYTORCH_ROCM_ARCH
   and any non-arch specific files e.g. TensileLibrary.dat
* Remove miopen custom build step

* Bundle MIOpen db files in wheel

* Correct path
* Use libtinfo.so.6 for Ubuntu 2004

* Fix to origname grep

* Condition on ROCM_VERSION for libtinfo6
We require the same fix that was made on upstream pytorch
pytorch/pytorch#91371
ROCm/pytorch@b72ec7c

Without this change install_conda.sh stage fails
```
#21 6.254 CondaFileIOError: '/opt/conda/pkgs/envs/*/env.txt'. [Errno 2] No such file or directory: '/opt/conda/pkgs/envs/*/env.txt'
#21 6.254 
#21 ERROR: executor failed running [/bin/sh -c bash ./install_conda.sh && rm install_conda.sh]: exit code: 1
------
 > [conda 2/3] RUN bash ./install_conda.sh && rm install_conda.sh:
------
executor failed running [/bin/sh -c bash ./install_conda.sh && rm install_conda.sh]: exit code: 1
```

Locally tested with the `/builder/libtorch/build_docker.sh`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants